@grackle-ai/web 0.76.0 → 0.76.2
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/assets/{KnowledgePage-EtkEDnqG.js → KnowledgePage-C7AWqnpx.js} +1 -1
- package/dist/assets/index-D6tIqrUx.css +1 -0
- package/dist/assets/index-DpPkLAIz.js +119 -0
- package/dist/index.html +2 -2
- package/package.json +2 -2
- package/dist/assets/index-CCcqlbSS.js +0 -112
- package/dist/assets/index-lNZfVpV-.css +0 -1
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/KnowledgePage-C7AWqnpx.js","assets/markdown-gcy1Jmzi.js","assets/dagview-BA5TtMAQ.js","assets/grpc-B1TrVI0Z.js","assets/KnowledgePage-DMqJ4jlP.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as j1,a as y,j as r,v as w1,b as N1,t as Br,i as C1,f as E1,M as Hf,c as Pf}from"./markdown-gcy1Jmzi.js";import{r as A1,d as Bg,H as Lg,P as Ig,i as D1,B as R1,a as M1,C as O1,M as B1}from"./dagview-BA5TtMAQ.js";import{c as L1,a as I1,G as z1,e as U1,w as V1,t as H1,p as Lr,b as P1,C as Gf,f as G1,M as $1,R as Po,S as zg}from"./grpc-B1TrVI0Z.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))l(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const f of d.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&l(f)}).observe(document,{childList:!0,subtree:!0});function i(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function l(c){if(c.ep)return;c.ep=!0;const d=i(c);fetch(c.href,d)}})();var Id={exports:{}},Go={},zd={exports:{}},Ud={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* scheduler.production.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/var Ug;function q1(){return Ug||(Ug=1,(function(n){function a(O,P){var W=O.length;O.push(P);e:for(;0<W;){var re=W-1>>>1,oe=O[re];if(0<c(oe,P))O[re]=P,O[W]=oe,W=re;else break e}}function i(O){return O.length===0?null:O[0]}function l(O){if(O.length===0)return null;var P=O[0],W=O.pop();if(W!==P){O[0]=W;e:for(var re=0,oe=O.length,Ce=oe>>>1;re<Ce;){var je=2*(re+1)-1,Se=O[je],Le=je+1,ce=O[Le];if(0>c(Se,W))Le<oe&&0>c(ce,Se)?(O[re]=ce,O[Le]=W,re=Le):(O[re]=Se,O[je]=W,re=je);else if(Le<oe&&0>c(ce,W))O[re]=ce,O[Le]=W,re=Le;else break e}}return P}function c(O,P){var W=O.sortIndex-P.sortIndex;return W!==0?W:O.id-P.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var f=Date,m=f.now();n.unstable_now=function(){return f.now()-m}}var p=[],v=[],g=1,b=null,x=3,_=!1,T=!1,N=!1,w=!1,k=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function D(O){for(var P=i(v);P!==null;){if(P.callback===null)l(v);else if(P.startTime<=O)l(v),P.sortIndex=P.expirationTime,a(p,P);else break;P=i(v)}}function E(O){if(N=!1,D(O),!T)if(i(p)!==null)T=!0,I||(I=!0,ie());else{var P=i(v);P!==null&&te(E,P.startTime-O)}}var I=!1,z=-1,U=5,Y=-1;function ae(){return w?!0:!(n.unstable_now()-Y<U)}function se(){if(w=!1,I){var O=n.unstable_now();Y=O;var P=!0;try{e:{T=!1,N&&(N=!1,C(z),z=-1),_=!0;var W=x;try{t:{for(D(O),b=i(p);b!==null&&!(b.expirationTime>O&&ae());){var re=b.callback;if(typeof re=="function"){b.callback=null,x=b.priorityLevel;var oe=re(b.expirationTime<=O);if(O=n.unstable_now(),typeof oe=="function"){b.callback=oe,D(O),P=!0;break t}b===i(p)&&l(p),D(O)}else l(p);b=i(p)}if(b!==null)P=!0;else{var Ce=i(v);Ce!==null&&te(E,Ce.startTime-O),P=!1}}break e}finally{b=null,x=W,_=!1}P=void 0}}finally{P?ie():I=!1}}}var ie;if(typeof A=="function")ie=function(){A(se)};else if(typeof MessageChannel<"u"){var le=new MessageChannel,q=le.port2;le.port1.onmessage=se,ie=function(){q.postMessage(null)}}else ie=function(){k(se,0)};function te(O,P){z=k(function(){O(n.unstable_now())},P)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(O){O.callback=null},n.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<O?Math.floor(1e3/O):5},n.unstable_getCurrentPriorityLevel=function(){return x},n.unstable_next=function(O){switch(x){case 1:case 2:case 3:var P=3;break;default:P=x}var W=x;x=P;try{return O()}finally{x=W}},n.unstable_requestPaint=function(){w=!0},n.unstable_runWithPriority=function(O,P){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var W=x;x=O;try{return P()}finally{x=W}},n.unstable_scheduleCallback=function(O,P,W){var re=n.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?re+W:re):W=re,O){case 1:var oe=-1;break;case 2:oe=250;break;case 5:oe=1073741823;break;case 4:oe=1e4;break;default:oe=5e3}return oe=W+oe,O={id:g++,callback:P,priorityLevel:O,startTime:W,expirationTime:oe,sortIndex:-1},W>re?(O.sortIndex=W,a(v,O),i(p)===null&&O===i(v)&&(N?(C(z),z=-1):N=!0,te(E,W-re))):(O.sortIndex=oe,a(p,O),T||_||(T=!0,I||(I=!0,ie()))),O},n.unstable_shouldYield=ae,n.unstable_wrapCallback=function(O){var P=x;return function(){var W=x;x=P;try{return O.apply(this,arguments)}finally{x=W}}}})(Ud)),Ud}var Vg;function K1(){return Vg||(Vg=1,zd.exports=q1()),zd.exports}/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react-dom-client.production.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var Hg;function Y1(){if(Hg)return Go;Hg=1;var n=K1(),a=j1(),i=A1();function l(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function f(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(d(e)!==e)throw Error(l(188))}function v(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(l(188));return t!==e?null:e}for(var s=e,o=t;;){var u=s.return;if(u===null)break;var h=u.alternate;if(h===null){if(o=u.return,o!==null){s=o;continue}break}if(u.child===h.child){for(h=u.child;h;){if(h===s)return p(u),e;if(h===o)return p(u),t;h=h.sibling}throw Error(l(188))}if(s.return!==o.return)s=u,o=h;else{for(var S=!1,j=u.child;j;){if(j===s){S=!0,s=u,o=h;break}if(j===o){S=!0,o=u,s=h;break}j=j.sibling}if(!S){for(j=h.child;j;){if(j===s){S=!0,s=h,o=u;break}if(j===o){S=!0,o=h,s=u;break}j=j.sibling}if(!S)throw Error(l(189))}}if(s.alternate!==o)throw Error(l(190))}if(s.tag!==3)throw Error(l(188));return s.stateNode.current===s?e:t}function g(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=g(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,x=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),A=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),ae=Symbol.for("react.memo_cache_sentinel"),se=Symbol.iterator;function ie(e){return e===null||typeof e!="object"?null:(e=se&&e[se]||e["@@iterator"],typeof e=="function"?e:null)}var le=Symbol.for("react.client.reference");function q(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===le?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case N:return"Fragment";case k:return"Profiler";case w:return"StrictMode";case E:return"Suspense";case I:return"SuspenseList";case Y:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case A:return e.displayName||"Context";case C:return(e._context.displayName||"Context")+".Consumer";case D:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case z:return t=e.displayName||null,t!==null?t:q(e.type)||"Memo";case U:t=e._payload,e=e._init;try{return q(e(t))}catch{}}return null}var te=Array.isArray,O=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},re=[],oe=-1;function Ce(e){return{current:e}}function je(e){0>oe||(e.current=re[oe],re[oe]=null,oe--)}function Se(e,t){oe++,re[oe]=e.current,e.current=t}var Le=Ce(null),ce=Ce(null),ue=Ce(null),fe=Ce(null);function tt(e,t){switch(Se(ue,t),Se(ce,e),Se(Le,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?sg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=sg(t),e=ig(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}je(Le),Se(Le,e)}function ee(){je(Le),je(ce),je(ue)}function X(e){e.memoizedState!==null&&Se(fe,e);var t=Le.current,s=ig(t,e.type);t!==s&&(Se(ce,e),Se(Le,s))}function At(e){ce.current===e&&(je(Le),je(ce)),fe.current===e&&(je(fe),zo._currentValue=W)}var pt,yn;function Ke(e){if(pt===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);pt=t&&t[1]||"",yn=-1<s.stack.indexOf(`
|
|
19
|
+
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
20
|
+
`+pt+e+yn}var Pn=!1;function Gn(e,t){if(!e||Pn)return"";Pn=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(t){var Q=function(){throw Error()};if(Object.defineProperty(Q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Q,[])}catch($){var G=$}Reflect.construct(e,[],Q)}else{try{Q.call()}catch($){G=$}e.call(Q.prototype)}}else{try{throw Error()}catch($){G=$}(Q=e())&&typeof Q.catch=="function"&&Q.catch(function(){})}}catch($){if($&&G&&typeof $.stack=="string")return[$.stack,G.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=o.DetermineComponentFrameRoot(),S=h[0],j=h[1];if(S&&j){var R=S.split(`
|
|
21
|
+
`),H=j.split(`
|
|
22
|
+
`);for(u=o=0;o<R.length&&!R[o].includes("DetermineComponentFrameRoot");)o++;for(;u<H.length&&!H[u].includes("DetermineComponentFrameRoot");)u++;if(o===R.length||u===H.length)for(o=R.length-1,u=H.length-1;1<=o&&0<=u&&R[o]!==H[u];)u--;for(;1<=o&&0<=u;o--,u--)if(R[o]!==H[u]){if(o!==1||u!==1)do if(o--,u--,0>u||R[o]!==H[u]){var K=`
|
|
23
|
+
`+R[o].replace(" at new "," at ");return e.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",e.displayName)),K}while(1<=o&&0<=u);break}}}finally{Pn=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?Ke(s):""}function Bn(e,t){switch(e.tag){case 26:case 27:case 5:return Ke(e.type);case 16:return Ke("Lazy");case 13:return e.child!==t&&t!==null?Ke("Suspense Fallback"):Ke("Suspense");case 19:return Ke("SuspenseList");case 0:case 15:return Gn(e.type,!1);case 11:return Gn(e.type.render,!1);case 1:return Gn(e.type,!0);case 31:return Ke("Activity");default:return""}}function Ca(e){try{var t="",s=null;do t+=Bn(e,s),s=e,e=e.return;while(e);return t}catch(o){return`
|
|
24
|
+
Error generating stack: `+o.message+`
|
|
25
|
+
`+o.stack}}var $n=Object.prototype.hasOwnProperty,Ea=n.unstable_scheduleCallback,ln=n.unstable_cancelCallback,Ee=n.unstable_shouldYield,Dt=n.unstable_requestPaint,Kt=n.unstable_now,xl=n.unstable_getCurrentPriorityLevel,Sl=n.unstable_ImmediatePriority,F=n.unstable_UserBlockingPriority,ne=n.unstable_NormalPriority,me=n.unstable_LowPriority,Te=n.unstable_IdlePriority,be=n.log,nt=n.unstable_setDisableYieldValue,we=null,He=null;function Ie(e){if(typeof be=="function"&&nt(e),He&&typeof He.setStrictMode=="function")try{He.setStrictMode(we,e)}catch{}}var Ye=Math.clz32?Math.clz32:zt,Yt=Math.log,Bt=Math.LN2;function zt(e){return e>>>=0,e===0?32:31-(Yt(e)/Bt|0)|0}var vt=256,Aa=262144,bn=4194304;function Ln(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function _l(e,t,s){var o=e.pendingLanes;if(o===0)return 0;var u=0,h=e.suspendedLanes,S=e.pingedLanes;e=e.warmLanes;var j=o&134217727;return j!==0?(o=j&~h,o!==0?u=Ln(o):(S&=j,S!==0?u=Ln(S):s||(s=j&~e,s!==0&&(u=Ln(s))))):(j=o&~h,j!==0?u=Ln(j):S!==0?u=Ln(S):s||(s=o&~e,s!==0&&(u=Ln(s)))),u===0?0:t!==0&&t!==u&&(t&h)===0&&(h=u&-u,s=t&-t,h>=s||h===32&&(s&4194048)!==0)?t:u}function Xi(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function fS(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Uh(){var e=bn;return bn<<=1,(bn&62914560)===0&&(bn=4194304),e}function jc(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function Qi(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function hS(e,t,s,o,u,h){var S=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var j=e.entanglements,R=e.expirationTimes,H=e.hiddenUpdates;for(s=S&~s;0<s;){var K=31-Ye(s),Q=1<<K;j[K]=0,R[K]=-1;var G=H[K];if(G!==null)for(H[K]=null,K=0;K<G.length;K++){var $=G[K];$!==null&&($.lane&=-536870913)}s&=~Q}o!==0&&Vh(e,o,0),h!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=h&~(S&~t))}function Vh(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var o=31-Ye(t);e.entangledLanes|=t,e.entanglements[o]=e.entanglements[o]|1073741824|s&261930}function Hh(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var o=31-Ye(s),u=1<<o;u&t|e[o]&t&&(e[o]|=t),s&=~u}}function Ph(e,t){var s=t&-t;return s=(s&42)!==0?1:wc(s),(s&(e.suspendedLanes|t))!==0?0:s}function wc(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Nc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Gh(){var e=P.p;return e!==0?e:(e=window.event,e===void 0?32:Cg(e.type))}function $h(e,t){var s=P.p;try{return P.p=e,t()}finally{P.p=s}}var Da=Math.random().toString(36).slice(2),Ut="__reactFiber$"+Da,Wt="__reactProps$"+Da,qs="__reactContainer$"+Da,Cc="__reactEvents$"+Da,mS="__reactListeners$"+Da,pS="__reactHandles$"+Da,qh="__reactResources$"+Da,Wi="__reactMarker$"+Da;function Ec(e){delete e[Ut],delete e[Wt],delete e[Cc],delete e[mS],delete e[pS]}function Ks(e){var t=e[Ut];if(t)return t;for(var s=e.parentNode;s;){if(t=s[qs]||s[Ut]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=fg(e);e!==null;){if(s=e[Ut])return s;e=fg(e)}return t}e=s,s=e.parentNode}return null}function Ys(e){if(e=e[Ut]||e[qs]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ji(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(l(33))}function Fs(e){var t=e[qh];return t||(t=e[qh]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Lt(e){e[Wi]=!0}var Kh=new Set,Yh={};function ds(e,t){Zs(e,t),Zs(e+"Capture",t)}function Zs(e,t){for(Yh[e]=t,e=0;e<t.length;e++)Kh.add(t[e])}var vS=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Fh={},Zh={};function gS(e){return $n.call(Zh,e)?!0:$n.call(Fh,e)?!1:vS.test(e)?Zh[e]=!0:(Fh[e]=!0,!1)}function Tl(e,t,s){if(gS(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var o=t.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+s)}}function kl(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+s)}}function ta(e,t,s,o){if(o===null)e.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+o)}}function xn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Xh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function yS(e,t,s){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var u=o.get,h=o.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(S){s=""+S,h.call(this,S)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return s},setValue:function(S){s=""+S},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ac(e){if(!e._valueTracker){var t=Xh(e)?"checked":"value";e._valueTracker=yS(e,t,""+e[t])}}function Qh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),o="";return e&&(o=Xh(e)?e.checked?"true":"false":e.value),e=o,e!==s?(t.setValue(e),!0):!1}function jl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var bS=/[\n"\\]/g;function Sn(e){return e.replace(bS,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Dc(e,t,s,o,u,h,S,j){e.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.type=S:e.removeAttribute("type"),t!=null?S==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+xn(t)):e.value!==""+xn(t)&&(e.value=""+xn(t)):S!=="submit"&&S!=="reset"||e.removeAttribute("value"),t!=null?Rc(e,S,xn(t)):s!=null?Rc(e,S,xn(s)):o!=null&&e.removeAttribute("value"),u==null&&h!=null&&(e.defaultChecked=!!h),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.name=""+xn(j):e.removeAttribute("name")}function Wh(e,t,s,o,u,h,S,j){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),t!=null||s!=null){if(!(h!=="submit"&&h!=="reset"||t!=null)){Ac(e);return}s=s!=null?""+xn(s):"",t=t!=null?""+xn(t):s,j||t===e.value||(e.value=t),e.defaultValue=t}o=o??u,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=j?e.checked:!!o,e.defaultChecked=!!o,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(e.name=S),Ac(e)}function Rc(e,t,s){t==="number"&&jl(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function Xs(e,t,s,o){if(e=e.options,t){t={};for(var u=0;u<s.length;u++)t["$"+s[u]]=!0;for(s=0;s<e.length;s++)u=t.hasOwnProperty("$"+e[s].value),e[s].selected!==u&&(e[s].selected=u),u&&o&&(e[s].defaultSelected=!0)}else{for(s=""+xn(s),t=null,u=0;u<e.length;u++){if(e[u].value===s){e[u].selected=!0,o&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function Jh(e,t,s){if(t!=null&&(t=""+xn(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+xn(s):""}function em(e,t,s,o){if(t==null){if(o!=null){if(s!=null)throw Error(l(92));if(te(o)){if(1<o.length)throw Error(l(93));o=o[0]}s=o}s==null&&(s=""),t=s}s=xn(t),e.defaultValue=s,o=e.textContent,o===s&&o!==""&&o!==null&&(e.value=o),Ac(e)}function Qs(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var xS=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function tm(e,t,s){var o=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?o?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":o?e.setProperty(t,s):typeof s!="number"||s===0||xS.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function nm(e,t,s){if(t!=null&&typeof t!="object")throw Error(l(62));if(e=e.style,s!=null){for(var o in s)!s.hasOwnProperty(o)||t!=null&&t.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="");for(var u in t)o=t[u],t.hasOwnProperty(u)&&s[u]!==o&&tm(e,u,o)}else for(var h in t)t.hasOwnProperty(h)&&tm(e,h,t[h])}function Mc(e){if(e.indexOf("-")===-1)return!1;switch(e){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 SS=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),_S=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function wl(e){return _S.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function na(){}var Oc=null;function Bc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ws=null,Js=null;function am(e){var t=Ys(e);if(t&&(e=t.stateNode)){var s=e[Wt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Dc(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Sn(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var o=s[t];if(o!==e&&o.form===e.form){var u=o[Wt]||null;if(!u)throw Error(l(90));Dc(o,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<s.length;t++)o=s[t],o.form===e.form&&Qh(o)}break e;case"textarea":Jh(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&Xs(e,!!s.multiple,t,!1)}}}var Lc=!1;function sm(e,t,s){if(Lc)return e(t,s);Lc=!0;try{var o=e(t);return o}finally{if(Lc=!1,(Ws!==null||Js!==null)&&(hr(),Ws&&(t=Ws,e=Js,Js=Ws=null,am(t),e)))for(t=0;t<e.length;t++)am(e[t])}}function eo(e,t){var s=e.stateNode;if(s===null)return null;var o=s[Wt]||null;if(o===null)return null;s=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(l(231,t,typeof s));return s}var aa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ic=!1;if(aa)try{var to={};Object.defineProperty(to,"passive",{get:function(){Ic=!0}}),window.addEventListener("test",to,to),window.removeEventListener("test",to,to)}catch{Ic=!1}var Ra=null,zc=null,Nl=null;function im(){if(Nl)return Nl;var e,t=zc,s=t.length,o,u="value"in Ra?Ra.value:Ra.textContent,h=u.length;for(e=0;e<s&&t[e]===u[e];e++);var S=s-e;for(o=1;o<=S&&t[s-o]===u[h-o];o++);return Nl=u.slice(e,1<o?1-o:void 0)}function Cl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function El(){return!0}function om(){return!1}function Jt(e){function t(s,o,u,h,S){this._reactName=s,this._targetInst=u,this.type=o,this.nativeEvent=h,this.target=S,this.currentTarget=null;for(var j in e)e.hasOwnProperty(j)&&(s=e[j],this[j]=s?s(h):h[j]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?El:om,this.isPropagationStopped=om,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=El)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=El)},persist:function(){},isPersistent:El}),t}var fs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Al=Jt(fs),no=b({},fs,{view:0,detail:0}),TS=Jt(no),Uc,Vc,ao,Dl=b({},no,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pc,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ao&&(ao&&e.type==="mousemove"?(Uc=e.screenX-ao.screenX,Vc=e.screenY-ao.screenY):Vc=Uc=0,ao=e),Uc)},movementY:function(e){return"movementY"in e?e.movementY:Vc}}),lm=Jt(Dl),kS=b({},Dl,{dataTransfer:0}),jS=Jt(kS),wS=b({},no,{relatedTarget:0}),Hc=Jt(wS),NS=b({},fs,{animationName:0,elapsedTime:0,pseudoElement:0}),CS=Jt(NS),ES=b({},fs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),AS=Jt(ES),DS=b({},fs,{data:0}),rm=Jt(DS),RS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},MS={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"},OS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function BS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=OS[e])?!!t[e]:!1}function Pc(){return BS}var LS=b({},no,{key:function(e){if(e.key){var t=RS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Cl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?MS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pc,charCode:function(e){return e.type==="keypress"?Cl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Cl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),IS=Jt(LS),zS=b({},Dl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cm=Jt(zS),US=b({},no,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pc}),VS=Jt(US),HS=b({},fs,{propertyName:0,elapsedTime:0,pseudoElement:0}),PS=Jt(HS),GS=b({},Dl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),$S=Jt(GS),qS=b({},fs,{newState:0,oldState:0}),KS=Jt(qS),YS=[9,13,27,32],Gc=aa&&"CompositionEvent"in window,so=null;aa&&"documentMode"in document&&(so=document.documentMode);var FS=aa&&"TextEvent"in window&&!so,um=aa&&(!Gc||so&&8<so&&11>=so),dm=" ",fm=!1;function hm(e,t){switch(e){case"keyup":return YS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function mm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ei=!1;function ZS(e,t){switch(e){case"compositionend":return mm(t);case"keypress":return t.which!==32?null:(fm=!0,dm);case"textInput":return e=t.data,e===dm&&fm?null:e;default:return null}}function XS(e,t){if(ei)return e==="compositionend"||!Gc&&hm(e,t)?(e=im(),Nl=zc=Ra=null,ei=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return um&&t.locale!=="ko"?null:t.data;default:return null}}var QS={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 pm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!QS[e.type]:t==="textarea"}function vm(e,t,s,o){Ws?Js?Js.push(o):Js=[o]:Ws=o,t=xr(t,"onChange"),0<t.length&&(s=new Al("onChange","change",null,s,o),e.push({event:s,listeners:t}))}var io=null,oo=null;function WS(e){Wv(e,0)}function Rl(e){var t=Ji(e);if(Qh(t))return e}function gm(e,t){if(e==="change")return t}var ym=!1;if(aa){var $c;if(aa){var qc="oninput"in document;if(!qc){var bm=document.createElement("div");bm.setAttribute("oninput","return;"),qc=typeof bm.oninput=="function"}$c=qc}else $c=!1;ym=$c&&(!document.documentMode||9<document.documentMode)}function xm(){io&&(io.detachEvent("onpropertychange",Sm),oo=io=null)}function Sm(e){if(e.propertyName==="value"&&Rl(oo)){var t=[];vm(t,oo,e,Bc(e)),sm(WS,t)}}function JS(e,t,s){e==="focusin"?(xm(),io=t,oo=s,io.attachEvent("onpropertychange",Sm)):e==="focusout"&&xm()}function e_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Rl(oo)}function t_(e,t){if(e==="click")return Rl(t)}function n_(e,t){if(e==="input"||e==="change")return Rl(t)}function a_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var rn=typeof Object.is=="function"?Object.is:a_;function lo(e,t){if(rn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),o=Object.keys(t);if(s.length!==o.length)return!1;for(o=0;o<s.length;o++){var u=s[o];if(!$n.call(t,u)||!rn(e[u],t[u]))return!1}return!0}function _m(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Tm(e,t){var s=_m(e);e=0;for(var o;s;){if(s.nodeType===3){if(o=e+s.textContent.length,e<=t&&o>=t)return{node:s,offset:t-e};e=o}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=_m(s)}}function km(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?km(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function jm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=jl(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=jl(e.document)}return t}function Kc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var s_=aa&&"documentMode"in document&&11>=document.documentMode,ti=null,Yc=null,ro=null,Fc=!1;function wm(e,t,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Fc||ti==null||ti!==jl(o)||(o=ti,"selectionStart"in o&&Kc(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),ro&&lo(ro,o)||(ro=o,o=xr(Yc,"onSelect"),0<o.length&&(t=new Al("onSelect","select",null,t,s),e.push({event:t,listeners:o}),t.target=ti)))}function hs(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var ni={animationend:hs("Animation","AnimationEnd"),animationiteration:hs("Animation","AnimationIteration"),animationstart:hs("Animation","AnimationStart"),transitionrun:hs("Transition","TransitionRun"),transitionstart:hs("Transition","TransitionStart"),transitioncancel:hs("Transition","TransitionCancel"),transitionend:hs("Transition","TransitionEnd")},Zc={},Nm={};aa&&(Nm=document.createElement("div").style,"AnimationEvent"in window||(delete ni.animationend.animation,delete ni.animationiteration.animation,delete ni.animationstart.animation),"TransitionEvent"in window||delete ni.transitionend.transition);function ms(e){if(Zc[e])return Zc[e];if(!ni[e])return e;var t=ni[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in Nm)return Zc[e]=t[s];return e}var Cm=ms("animationend"),Em=ms("animationiteration"),Am=ms("animationstart"),i_=ms("transitionrun"),o_=ms("transitionstart"),l_=ms("transitioncancel"),Dm=ms("transitionend"),Rm=new Map,Xc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Xc.push("scrollEnd");function In(e,t){Rm.set(e,t),ds(t,[e])}var Ml=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},_n=[],ai=0,Qc=0;function Ol(){for(var e=ai,t=Qc=ai=0;t<e;){var s=_n[t];_n[t++]=null;var o=_n[t];_n[t++]=null;var u=_n[t];_n[t++]=null;var h=_n[t];if(_n[t++]=null,o!==null&&u!==null){var S=o.pending;S===null?u.next=u:(u.next=S.next,S.next=u),o.pending=u}h!==0&&Mm(s,u,h)}}function Bl(e,t,s,o){_n[ai++]=e,_n[ai++]=t,_n[ai++]=s,_n[ai++]=o,Qc|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function Wc(e,t,s,o){return Bl(e,t,s,o),Ll(e)}function ps(e,t){return Bl(e,null,null,t),Ll(e)}function Mm(e,t,s){e.lanes|=s;var o=e.alternate;o!==null&&(o.lanes|=s);for(var u=!1,h=e.return;h!==null;)h.childLanes|=s,o=h.alternate,o!==null&&(o.childLanes|=s),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(u=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,u&&t!==null&&(u=31-Ye(s),e=h.hiddenUpdates,o=e[u],o===null?e[u]=[t]:o.push(t),t.lane=s|536870912),h):null}function Ll(e){if(50<Do)throw Do=0,ld=null,Error(l(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var si={};function r_(e,t,s,o){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function cn(e,t,s,o){return new r_(e,t,s,o)}function Jc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sa(e,t){var s=e.alternate;return s===null?(s=cn(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function Om(e,t){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Il(e,t,s,o,u,h){var S=0;if(o=e,typeof e=="function")Jc(e)&&(S=1);else if(typeof e=="string")S=h1(e,s,Le.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Y:return e=cn(31,s,t,u),e.elementType=Y,e.lanes=h,e;case N:return vs(s.children,u,h,t);case w:S=8,u|=24;break;case k:return e=cn(12,s,t,u|2),e.elementType=k,e.lanes=h,e;case E:return e=cn(13,s,t,u),e.elementType=E,e.lanes=h,e;case I:return e=cn(19,s,t,u),e.elementType=I,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case A:S=10;break e;case C:S=9;break e;case D:S=11;break e;case z:S=14;break e;case U:S=16,o=null;break e}S=29,s=Error(l(130,e===null?"null":typeof e,"")),o=null}return t=cn(S,s,t,u),t.elementType=e,t.type=o,t.lanes=h,t}function vs(e,t,s,o){return e=cn(7,e,o,t),e.lanes=s,e}function eu(e,t,s){return e=cn(6,e,null,t),e.lanes=s,e}function Bm(e){var t=cn(18,null,null,0);return t.stateNode=e,t}function tu(e,t,s){return t=cn(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Lm=new WeakMap;function Tn(e,t){if(typeof e=="object"&&e!==null){var s=Lm.get(e);return s!==void 0?s:(t={value:e,source:t,stack:Ca(t)},Lm.set(e,t),t)}return{value:e,source:t,stack:Ca(t)}}var ii=[],oi=0,zl=null,co=0,kn=[],jn=0,Ma=null,qn=1,Kn="";function ia(e,t){ii[oi++]=co,ii[oi++]=zl,zl=e,co=t}function Im(e,t,s){kn[jn++]=qn,kn[jn++]=Kn,kn[jn++]=Ma,Ma=e;var o=qn;e=Kn;var u=32-Ye(o)-1;o&=~(1<<u),s+=1;var h=32-Ye(t)+u;if(30<h){var S=u-u%5;h=(o&(1<<S)-1).toString(32),o>>=S,u-=S,qn=1<<32-Ye(t)+u|s<<u|o,Kn=h+e}else qn=1<<h|s<<u|o,Kn=e}function nu(e){e.return!==null&&(ia(e,1),Im(e,1,0))}function au(e){for(;e===zl;)zl=ii[--oi],ii[oi]=null,co=ii[--oi],ii[oi]=null;for(;e===Ma;)Ma=kn[--jn],kn[jn]=null,Kn=kn[--jn],kn[jn]=null,qn=kn[--jn],kn[jn]=null}function zm(e,t){kn[jn++]=qn,kn[jn++]=Kn,kn[jn++]=Ma,qn=t.id,Kn=t.overflow,Ma=e}var Vt=null,it=null,ze=!1,Oa=null,wn=!1,su=Error(l(519));function Ba(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw uo(Tn(t,e)),su}function Um(e){var t=e.stateNode,s=e.type,o=e.memoizedProps;switch(t[Ut]=e,t[Wt]=o,s){case"dialog":Me("cancel",t),Me("close",t);break;case"iframe":case"object":case"embed":Me("load",t);break;case"video":case"audio":for(s=0;s<Mo.length;s++)Me(Mo[s],t);break;case"source":Me("error",t);break;case"img":case"image":case"link":Me("error",t),Me("load",t);break;case"details":Me("toggle",t);break;case"input":Me("invalid",t),Wh(t,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Me("invalid",t);break;case"textarea":Me("invalid",t),em(t,o.value,o.defaultValue,o.children)}s=o.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||o.suppressHydrationWarning===!0||ng(t.textContent,s)?(o.popover!=null&&(Me("beforetoggle",t),Me("toggle",t)),o.onScroll!=null&&Me("scroll",t),o.onScrollEnd!=null&&Me("scrollend",t),o.onClick!=null&&(t.onclick=na),t=!0):t=!1,t||Ba(e,!0)}function Vm(e){for(Vt=e.return;Vt;)switch(Vt.tag){case 5:case 31:case 13:wn=!1;return;case 27:case 3:wn=!0;return;default:Vt=Vt.return}}function li(e){if(e!==Vt)return!1;if(!ze)return Vm(e),ze=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||_d(e.type,e.memoizedProps)),s=!s),s&&it&&Ba(e),Vm(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));it=dg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));it=dg(e)}else t===27?(t=it,Za(e.type)?(e=Nd,Nd=null,it=e):it=t):it=Vt?Cn(e.stateNode.nextSibling):null;return!0}function gs(){it=Vt=null,ze=!1}function iu(){var e=Oa;return e!==null&&(an===null?an=e:an.push.apply(an,e),Oa=null),e}function uo(e){Oa===null?Oa=[e]:Oa.push(e)}var ou=Ce(null),ys=null,oa=null;function La(e,t,s){Se(ou,t._currentValue),t._currentValue=s}function la(e){e._currentValue=ou.current,je(ou)}function lu(e,t,s){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===s)break;e=e.return}}function ru(e,t,s,o){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var h=u.dependencies;if(h!==null){var S=u.child;h=h.firstContext;e:for(;h!==null;){var j=h;h=u;for(var R=0;R<t.length;R++)if(j.context===t[R]){h.lanes|=s,j=h.alternate,j!==null&&(j.lanes|=s),lu(h.return,s,e),o||(S=null);break e}h=j.next}}else if(u.tag===18){if(S=u.return,S===null)throw Error(l(341));S.lanes|=s,h=S.alternate,h!==null&&(h.lanes|=s),lu(S,s,e),S=null}else S=u.child;if(S!==null)S.return=u;else for(S=u;S!==null;){if(S===e){S=null;break}if(u=S.sibling,u!==null){u.return=S.return,S=u;break}S=S.return}u=S}}function ri(e,t,s,o){e=null;for(var u=t,h=!1;u!==null;){if(!h){if((u.flags&524288)!==0)h=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var S=u.alternate;if(S===null)throw Error(l(387));if(S=S.memoizedProps,S!==null){var j=u.type;rn(u.pendingProps.value,S.value)||(e!==null?e.push(j):e=[j])}}else if(u===fe.current){if(S=u.alternate,S===null)throw Error(l(387));S.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(zo):e=[zo])}u=u.return}e!==null&&ru(t,e,s,o),t.flags|=262144}function Ul(e){for(e=e.firstContext;e!==null;){if(!rn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function bs(e){ys=e,oa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ht(e){return Hm(ys,e)}function Vl(e,t){return ys===null&&bs(e),Hm(e,t)}function Hm(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},oa===null){if(e===null)throw Error(l(308));oa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else oa=oa.next=t;return s}var c_=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,o){e.push(o)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},u_=n.unstable_scheduleCallback,d_=n.unstable_NormalPriority,kt={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function cu(){return{controller:new c_,data:new Map,refCount:0}}function fo(e){e.refCount--,e.refCount===0&&u_(d_,function(){e.controller.abort()})}var ho=null,uu=0,ci=0,ui=null;function f_(e,t){if(ho===null){var s=ho=[];uu=0,ci=hd(),ui={status:"pending",value:void 0,then:function(o){s.push(o)}}}return uu++,t.then(Pm,Pm),t}function Pm(){if(--uu===0&&ho!==null){ui!==null&&(ui.status="fulfilled");var e=ho;ho=null,ci=0,ui=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function h_(e,t){var s=[],o={status:"pending",value:null,reason:null,then:function(u){s.push(u)}};return e.then(function(){o.status="fulfilled",o.value=t;for(var u=0;u<s.length;u++)(0,s[u])(t)},function(u){for(o.status="rejected",o.reason=u,u=0;u<s.length;u++)(0,s[u])(void 0)}),o}var Gm=O.S;O.S=function(e,t){wv=Kt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&f_(e,t),Gm!==null&&Gm(e,t)};var xs=Ce(null);function du(){var e=xs.current;return e!==null?e:at.pooledCache}function Hl(e,t){t===null?Se(xs,xs.current):Se(xs,t.pool)}function $m(){var e=du();return e===null?null:{parent:kt._currentValue,pool:e}}var di=Error(l(460)),fu=Error(l(474)),Pl=Error(l(542)),Gl={then:function(){}};function qm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Km(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(na,na),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Fm(e),e;default:if(typeof t.status=="string")t.then(na,na);else{if(e=at,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=t,e.status="pending",e.then(function(o){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=o}},function(o){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=o}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Fm(e),e}throw _s=t,di}}function Ss(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(_s=s,di):s}}var _s=null;function Ym(){if(_s===null)throw Error(l(459));var e=_s;return _s=null,e}function Fm(e){if(e===di||e===Pl)throw Error(l(483))}var fi=null,mo=0;function $l(e){var t=mo;return mo+=1,fi===null&&(fi=[]),Km(fi,e,t)}function po(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ql(e,t){throw t.$$typeof===x?Error(l(525)):(e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Zm(e){function t(B,M){if(e){var V=B.deletions;V===null?(B.deletions=[M],B.flags|=16):V.push(M)}}function s(B,M){if(!e)return null;for(;M!==null;)t(B,M),M=M.sibling;return null}function o(B){for(var M=new Map;B!==null;)B.key!==null?M.set(B.key,B):M.set(B.index,B),B=B.sibling;return M}function u(B,M){return B=sa(B,M),B.index=0,B.sibling=null,B}function h(B,M,V){return B.index=V,e?(V=B.alternate,V!==null?(V=V.index,V<M?(B.flags|=67108866,M):V):(B.flags|=67108866,M)):(B.flags|=1048576,M)}function S(B){return e&&B.alternate===null&&(B.flags|=67108866),B}function j(B,M,V,Z){return M===null||M.tag!==6?(M=eu(V,B.mode,Z),M.return=B,M):(M=u(M,V),M.return=B,M)}function R(B,M,V,Z){var ve=V.type;return ve===N?K(B,M,V.props.children,Z,V.key):M!==null&&(M.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===U&&Ss(ve)===M.type)?(M=u(M,V.props),po(M,V),M.return=B,M):(M=Il(V.type,V.key,V.props,null,B.mode,Z),po(M,V),M.return=B,M)}function H(B,M,V,Z){return M===null||M.tag!==4||M.stateNode.containerInfo!==V.containerInfo||M.stateNode.implementation!==V.implementation?(M=tu(V,B.mode,Z),M.return=B,M):(M=u(M,V.children||[]),M.return=B,M)}function K(B,M,V,Z,ve){return M===null||M.tag!==7?(M=vs(V,B.mode,Z,ve),M.return=B,M):(M=u(M,V),M.return=B,M)}function Q(B,M,V){if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return M=eu(""+M,B.mode,V),M.return=B,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case _:return V=Il(M.type,M.key,M.props,null,B.mode,V),po(V,M),V.return=B,V;case T:return M=tu(M,B.mode,V),M.return=B,M;case U:return M=Ss(M),Q(B,M,V)}if(te(M)||ie(M))return M=vs(M,B.mode,V,null),M.return=B,M;if(typeof M.then=="function")return Q(B,$l(M),V);if(M.$$typeof===A)return Q(B,Vl(B,M),V);ql(B,M)}return null}function G(B,M,V,Z){var ve=M!==null?M.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return ve!==null?null:j(B,M,""+V,Z);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case _:return V.key===ve?R(B,M,V,Z):null;case T:return V.key===ve?H(B,M,V,Z):null;case U:return V=Ss(V),G(B,M,V,Z)}if(te(V)||ie(V))return ve!==null?null:K(B,M,V,Z,null);if(typeof V.then=="function")return G(B,M,$l(V),Z);if(V.$$typeof===A)return G(B,M,Vl(B,V),Z);ql(B,V)}return null}function $(B,M,V,Z,ve){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return B=B.get(V)||null,j(M,B,""+Z,ve);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case _:return B=B.get(Z.key===null?V:Z.key)||null,R(M,B,Z,ve);case T:return B=B.get(Z.key===null?V:Z.key)||null,H(M,B,Z,ve);case U:return Z=Ss(Z),$(B,M,V,Z,ve)}if(te(Z)||ie(Z))return B=B.get(V)||null,K(M,B,Z,ve,null);if(typeof Z.then=="function")return $(B,M,V,$l(Z),ve);if(Z.$$typeof===A)return $(B,M,V,Vl(M,Z),ve);ql(M,Z)}return null}function he(B,M,V,Z){for(var ve=null,Ge=null,pe=M,Ae=M=0,Be=null;pe!==null&&Ae<V.length;Ae++){pe.index>Ae?(Be=pe,pe=null):Be=pe.sibling;var $e=G(B,pe,V[Ae],Z);if($e===null){pe===null&&(pe=Be);break}e&&pe&&$e.alternate===null&&t(B,pe),M=h($e,M,Ae),Ge===null?ve=$e:Ge.sibling=$e,Ge=$e,pe=Be}if(Ae===V.length)return s(B,pe),ze&&ia(B,Ae),ve;if(pe===null){for(;Ae<V.length;Ae++)pe=Q(B,V[Ae],Z),pe!==null&&(M=h(pe,M,Ae),Ge===null?ve=pe:Ge.sibling=pe,Ge=pe);return ze&&ia(B,Ae),ve}for(pe=o(pe);Ae<V.length;Ae++)Be=$(pe,B,Ae,V[Ae],Z),Be!==null&&(e&&Be.alternate!==null&&pe.delete(Be.key===null?Ae:Be.key),M=h(Be,M,Ae),Ge===null?ve=Be:Ge.sibling=Be,Ge=Be);return e&&pe.forEach(function(es){return t(B,es)}),ze&&ia(B,Ae),ve}function ye(B,M,V,Z){if(V==null)throw Error(l(151));for(var ve=null,Ge=null,pe=M,Ae=M=0,Be=null,$e=V.next();pe!==null&&!$e.done;Ae++,$e=V.next()){pe.index>Ae?(Be=pe,pe=null):Be=pe.sibling;var es=G(B,pe,$e.value,Z);if(es===null){pe===null&&(pe=Be);break}e&&pe&&es.alternate===null&&t(B,pe),M=h(es,M,Ae),Ge===null?ve=es:Ge.sibling=es,Ge=es,pe=Be}if($e.done)return s(B,pe),ze&&ia(B,Ae),ve;if(pe===null){for(;!$e.done;Ae++,$e=V.next())$e=Q(B,$e.value,Z),$e!==null&&(M=h($e,M,Ae),Ge===null?ve=$e:Ge.sibling=$e,Ge=$e);return ze&&ia(B,Ae),ve}for(pe=o(pe);!$e.done;Ae++,$e=V.next())$e=$(pe,B,Ae,$e.value,Z),$e!==null&&(e&&$e.alternate!==null&&pe.delete($e.key===null?Ae:$e.key),M=h($e,M,Ae),Ge===null?ve=$e:Ge.sibling=$e,Ge=$e);return e&&pe.forEach(function(k1){return t(B,k1)}),ze&&ia(B,Ae),ve}function et(B,M,V,Z){if(typeof V=="object"&&V!==null&&V.type===N&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case _:e:{for(var ve=V.key;M!==null;){if(M.key===ve){if(ve=V.type,ve===N){if(M.tag===7){s(B,M.sibling),Z=u(M,V.props.children),Z.return=B,B=Z;break e}}else if(M.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===U&&Ss(ve)===M.type){s(B,M.sibling),Z=u(M,V.props),po(Z,V),Z.return=B,B=Z;break e}s(B,M);break}else t(B,M);M=M.sibling}V.type===N?(Z=vs(V.props.children,B.mode,Z,V.key),Z.return=B,B=Z):(Z=Il(V.type,V.key,V.props,null,B.mode,Z),po(Z,V),Z.return=B,B=Z)}return S(B);case T:e:{for(ve=V.key;M!==null;){if(M.key===ve)if(M.tag===4&&M.stateNode.containerInfo===V.containerInfo&&M.stateNode.implementation===V.implementation){s(B,M.sibling),Z=u(M,V.children||[]),Z.return=B,B=Z;break e}else{s(B,M);break}else t(B,M);M=M.sibling}Z=tu(V,B.mode,Z),Z.return=B,B=Z}return S(B);case U:return V=Ss(V),et(B,M,V,Z)}if(te(V))return he(B,M,V,Z);if(ie(V)){if(ve=ie(V),typeof ve!="function")throw Error(l(150));return V=ve.call(V),ye(B,M,V,Z)}if(typeof V.then=="function")return et(B,M,$l(V),Z);if(V.$$typeof===A)return et(B,M,Vl(B,V),Z);ql(B,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,M!==null&&M.tag===6?(s(B,M.sibling),Z=u(M,V),Z.return=B,B=Z):(s(B,M),Z=eu(V,B.mode,Z),Z.return=B,B=Z),S(B)):s(B,M)}return function(B,M,V,Z){try{mo=0;var ve=et(B,M,V,Z);return fi=null,ve}catch(pe){if(pe===di||pe===Pl)throw pe;var Ge=cn(29,pe,null,B.mode);return Ge.lanes=Z,Ge.return=B,Ge}finally{}}}var Ts=Zm(!0),Xm=Zm(!1),Ia=!1;function hu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function za(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ua(e,t,s){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Fe&2)!==0){var u=o.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),o.pending=t,t=Ll(e),Mm(e,null,s),t}return Bl(e,o,t,s),Ll(e)}function vo(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,Hh(e,s)}}function pu(e,t){var s=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,s===o)){var u=null,h=null;if(s=s.firstBaseUpdate,s!==null){do{var S={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};h===null?u=h=S:h=h.next=S,s=s.next}while(s!==null);h===null?u=h=t:h=h.next=t}else u=h=t;s={baseState:o.baseState,firstBaseUpdate:u,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var vu=!1;function go(){if(vu){var e=ui;if(e!==null)throw e}}function yo(e,t,s,o){vu=!1;var u=e.updateQueue;Ia=!1;var h=u.firstBaseUpdate,S=u.lastBaseUpdate,j=u.shared.pending;if(j!==null){u.shared.pending=null;var R=j,H=R.next;R.next=null,S===null?h=H:S.next=H,S=R;var K=e.alternate;K!==null&&(K=K.updateQueue,j=K.lastBaseUpdate,j!==S&&(j===null?K.firstBaseUpdate=H:j.next=H,K.lastBaseUpdate=R))}if(h!==null){var Q=u.baseState;S=0,K=H=R=null,j=h;do{var G=j.lane&-536870913,$=G!==j.lane;if($?(Oe&G)===G:(o&G)===G){G!==0&&G===ci&&(vu=!0),K!==null&&(K=K.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var he=e,ye=j;G=t;var et=s;switch(ye.tag){case 1:if(he=ye.payload,typeof he=="function"){Q=he.call(et,Q,G);break e}Q=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=ye.payload,G=typeof he=="function"?he.call(et,Q,G):he,G==null)break e;Q=b({},Q,G);break e;case 2:Ia=!0}}G=j.callback,G!==null&&(e.flags|=64,$&&(e.flags|=8192),$=u.callbacks,$===null?u.callbacks=[G]:$.push(G))}else $={lane:G,tag:j.tag,payload:j.payload,callback:j.callback,next:null},K===null?(H=K=$,R=Q):K=K.next=$,S|=G;if(j=j.next,j===null){if(j=u.shared.pending,j===null)break;$=j,j=$.next,$.next=null,u.lastBaseUpdate=$,u.shared.pending=null}}while(!0);K===null&&(R=Q),u.baseState=R,u.firstBaseUpdate=H,u.lastBaseUpdate=K,h===null&&(u.shared.lanes=0),$a|=S,e.lanes=S,e.memoizedState=Q}}function Qm(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function Wm(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)Qm(s[e],t)}var hi=Ce(null),Kl=Ce(0);function Jm(e,t){e=va,Se(Kl,e),Se(hi,t),va=e|t.baseLanes}function gu(){Se(Kl,va),Se(hi,hi.current)}function yu(){va=Kl.current,je(hi),je(Kl)}var un=Ce(null),Nn=null;function Va(e){var t=e.alternate;Se(St,St.current&1),Se(un,e),Nn===null&&(t===null||hi.current!==null||t.memoizedState!==null)&&(Nn=e)}function bu(e){Se(St,St.current),Se(un,e),Nn===null&&(Nn=e)}function ep(e){e.tag===22?(Se(St,St.current),Se(un,e),Nn===null&&(Nn=e)):Ha()}function Ha(){Se(St,St.current),Se(un,un.current)}function dn(e){je(un),Nn===e&&(Nn=null),je(St)}var St=Ce(0);function Yl(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||jd(s)||wd(s)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ra=0,Ne=null,We=null,jt=null,Fl=!1,mi=!1,ks=!1,Zl=0,bo=0,pi=null,m_=0;function gt(){throw Error(l(321))}function xu(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!rn(e[s],t[s]))return!1;return!0}function Su(e,t,s,o,u,h){return ra=h,Ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,O.H=e===null||e.memoizedState===null?Ip:Lu,ks=!1,h=s(o,u),ks=!1,mi&&(h=np(t,s,o,u)),tp(e),h}function tp(e){O.H=_o;var t=We!==null&&We.next!==null;if(ra=0,jt=We=Ne=null,Fl=!1,bo=0,pi=null,t)throw Error(l(300));e===null||wt||(e=e.dependencies,e!==null&&Ul(e)&&(wt=!0))}function np(e,t,s,o){Ne=e;var u=0;do{if(mi&&(pi=null),bo=0,mi=!1,25<=u)throw Error(l(301));if(u+=1,jt=We=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}O.H=zp,h=t(s,o)}while(mi);return h}function p_(){var e=O.H,t=e.useState()[0];return t=typeof t.then=="function"?xo(t):t,e=e.useState()[0],(We!==null?We.memoizedState:null)!==e&&(Ne.flags|=1024),t}function _u(){var e=Zl!==0;return Zl=0,e}function Tu(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function ku(e){if(Fl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Fl=!1}ra=0,jt=We=Ne=null,mi=!1,bo=Zl=0,pi=null}function Xt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jt===null?Ne.memoizedState=jt=e:jt=jt.next=e,jt}function _t(){if(We===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=We.next;var t=jt===null?Ne.memoizedState:jt.next;if(t!==null)jt=t,We=e;else{if(e===null)throw Ne.alternate===null?Error(l(467)):Error(l(310));We=e,e={memoizedState:We.memoizedState,baseState:We.baseState,baseQueue:We.baseQueue,queue:We.queue,next:null},jt===null?Ne.memoizedState=jt=e:jt=jt.next=e}return jt}function Xl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xo(e){var t=bo;return bo+=1,pi===null&&(pi=[]),e=Km(pi,e,t),t=Ne,(jt===null?t.memoizedState:jt.next)===null&&(t=t.alternate,O.H=t===null||t.memoizedState===null?Ip:Lu),e}function Ql(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return xo(e);if(e.$$typeof===A)return Ht(e)}throw Error(l(438,String(e)))}function ju(e){var t=null,s=Ne.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var o=Ne.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(t={data:o.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=Xl(),Ne.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),o=0;o<e;o++)s[o]=ae;return t.index++,s}function ca(e,t){return typeof t=="function"?t(e):t}function Wl(e){var t=_t();return wu(t,We,e)}function wu(e,t,s){var o=e.queue;if(o===null)throw Error(l(311));o.lastRenderedReducer=s;var u=e.baseQueue,h=o.pending;if(h!==null){if(u!==null){var S=u.next;u.next=h.next,h.next=S}t.baseQueue=u=h,o.pending=null}if(h=e.baseState,u===null)e.memoizedState=h;else{t=u.next;var j=S=null,R=null,H=t,K=!1;do{var Q=H.lane&-536870913;if(Q!==H.lane?(Oe&Q)===Q:(ra&Q)===Q){var G=H.revertLane;if(G===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null}),Q===ci&&(K=!0);else if((ra&G)===G){H=H.next,G===ci&&(K=!0);continue}else Q={lane:0,revertLane:H.revertLane,gesture:null,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null},R===null?(j=R=Q,S=h):R=R.next=Q,Ne.lanes|=G,$a|=G;Q=H.action,ks&&s(h,Q),h=H.hasEagerState?H.eagerState:s(h,Q)}else G={lane:Q,revertLane:H.revertLane,gesture:H.gesture,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null},R===null?(j=R=G,S=h):R=R.next=G,Ne.lanes|=Q,$a|=Q;H=H.next}while(H!==null&&H!==t);if(R===null?S=h:R.next=j,!rn(h,e.memoizedState)&&(wt=!0,K&&(s=ui,s!==null)))throw s;e.memoizedState=h,e.baseState=S,e.baseQueue=R,o.lastRenderedState=h}return u===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function Nu(e){var t=_t(),s=t.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=e;var o=s.dispatch,u=s.pending,h=t.memoizedState;if(u!==null){s.pending=null;var S=u=u.next;do h=e(h,S.action),S=S.next;while(S!==u);rn(h,t.memoizedState)||(wt=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),s.lastRenderedState=h}return[h,o]}function ap(e,t,s){var o=Ne,u=_t(),h=ze;if(h){if(s===void 0)throw Error(l(407));s=s()}else s=t();var S=!rn((We||u).memoizedState,s);if(S&&(u.memoizedState=s,wt=!0),u=u.queue,Au(op.bind(null,o,u,e),[e]),u.getSnapshot!==t||S||jt!==null&&jt.memoizedState.tag&1){if(o.flags|=2048,vi(9,{destroy:void 0},ip.bind(null,o,u,s,t),null),at===null)throw Error(l(349));h||(ra&127)!==0||sp(o,t,s)}return s}function sp(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=Ne.updateQueue,t===null?(t=Xl(),Ne.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function ip(e,t,s,o){t.value=s,t.getSnapshot=o,lp(t)&&rp(e)}function op(e,t,s){return s(function(){lp(t)&&rp(e)})}function lp(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!rn(e,s)}catch{return!0}}function rp(e){var t=ps(e,2);t!==null&&sn(t,e,2)}function Cu(e){var t=Xt();if(typeof e=="function"){var s=e;if(e=s(),ks){Ie(!0);try{s()}finally{Ie(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ca,lastRenderedState:e},t}function cp(e,t,s,o){return e.baseState=s,wu(e,We,typeof o=="function"?o:ca)}function v_(e,t,s,o,u){if(tr(e))throw Error(l(485));if(e=t.action,e!==null){var h={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){h.listeners.push(S)}};O.T!==null?s(!0):h.isTransition=!1,o(h),s=t.pending,s===null?(h.next=t.pending=h,up(t,h)):(h.next=s.next,t.pending=s.next=h)}}function up(e,t){var s=t.action,o=t.payload,u=e.state;if(t.isTransition){var h=O.T,S={};O.T=S;try{var j=s(u,o),R=O.S;R!==null&&R(S,j),dp(e,t,j)}catch(H){Eu(e,t,H)}finally{h!==null&&S.types!==null&&(h.types=S.types),O.T=h}}else try{h=s(u,o),dp(e,t,h)}catch(H){Eu(e,t,H)}}function dp(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(o){fp(e,t,o)},function(o){return Eu(e,t,o)}):fp(e,t,s)}function fp(e,t,s){t.status="fulfilled",t.value=s,hp(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,up(e,s)))}function Eu(e,t,s){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do t.status="rejected",t.reason=s,hp(t),t=t.next;while(t!==o)}e.action=null}function hp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function mp(e,t){return t}function pp(e,t){if(ze){var s=at.formState;if(s!==null){e:{var o=Ne;if(ze){if(it){t:{for(var u=it,h=wn;u.nodeType!==8;){if(!h){u=null;break t}if(u=Cn(u.nextSibling),u===null){u=null;break t}}h=u.data,u=h==="F!"||h==="F"?u:null}if(u){it=Cn(u.nextSibling),o=u.data==="F!";break e}}Ba(o)}o=!1}o&&(t=s[0])}}return s=Xt(),s.memoizedState=s.baseState=t,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:mp,lastRenderedState:t},s.queue=o,s=Op.bind(null,Ne,o),o.dispatch=s,o=Cu(!1),h=Bu.bind(null,Ne,!1,o.queue),o=Xt(),u={state:t,dispatch:null,action:e,pending:null},o.queue=u,s=v_.bind(null,Ne,u,h,s),u.dispatch=s,o.memoizedState=e,[t,s,!1]}function vp(e){var t=_t();return gp(t,We,e)}function gp(e,t,s){if(t=wu(e,t,mp)[0],e=Wl(ca)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var o=xo(t)}catch(S){throw S===di?Pl:S}else o=t;t=_t();var u=t.queue,h=u.dispatch;return s!==t.memoizedState&&(Ne.flags|=2048,vi(9,{destroy:void 0},g_.bind(null,u,s),null)),[o,h,e]}function g_(e,t){e.action=t}function yp(e){var t=_t(),s=We;if(s!==null)return gp(t,s,e);_t(),t=t.memoizedState,s=_t();var o=s.queue.dispatch;return s.memoizedState=e,[t,o,!1]}function vi(e,t,s,o){return e={tag:e,create:s,deps:o,inst:t,next:null},t=Ne.updateQueue,t===null&&(t=Xl(),Ne.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(o=s.next,s.next=e,e.next=o,t.lastEffect=e),e}function bp(){return _t().memoizedState}function Jl(e,t,s,o){var u=Xt();Ne.flags|=e,u.memoizedState=vi(1|t,{destroy:void 0},s,o===void 0?null:o)}function er(e,t,s,o){var u=_t();o=o===void 0?null:o;var h=u.memoizedState.inst;We!==null&&o!==null&&xu(o,We.memoizedState.deps)?u.memoizedState=vi(t,h,s,o):(Ne.flags|=e,u.memoizedState=vi(1|t,h,s,o))}function xp(e,t){Jl(8390656,8,e,t)}function Au(e,t){er(2048,8,e,t)}function y_(e){Ne.flags|=4;var t=Ne.updateQueue;if(t===null)t=Xl(),Ne.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function Sp(e){var t=_t().memoizedState;return y_({ref:t,nextImpl:e}),function(){if((Fe&2)!==0)throw Error(l(440));return t.impl.apply(void 0,arguments)}}function _p(e,t){return er(4,2,e,t)}function Tp(e,t){return er(4,4,e,t)}function kp(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function jp(e,t,s){s=s!=null?s.concat([e]):null,er(4,4,kp.bind(null,t,e),s)}function Du(){}function wp(e,t){var s=_t();t=t===void 0?null:t;var o=s.memoizedState;return t!==null&&xu(t,o[1])?o[0]:(s.memoizedState=[e,t],e)}function Np(e,t){var s=_t();t=t===void 0?null:t;var o=s.memoizedState;if(t!==null&&xu(t,o[1]))return o[0];if(o=e(),ks){Ie(!0);try{e()}finally{Ie(!1)}}return s.memoizedState=[o,t],o}function Ru(e,t,s){return s===void 0||(ra&1073741824)!==0&&(Oe&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=Cv(),Ne.lanes|=e,$a|=e,s)}function Cp(e,t,s,o){return rn(s,t)?s:hi.current!==null?(e=Ru(e,s,o),rn(e,t)||(wt=!0),e):(ra&42)===0||(ra&1073741824)!==0&&(Oe&261930)===0?(wt=!0,e.memoizedState=s):(e=Cv(),Ne.lanes|=e,$a|=e,t)}function Ep(e,t,s,o,u){var h=P.p;P.p=h!==0&&8>h?h:8;var S=O.T,j={};O.T=j,Bu(e,!1,t,s);try{var R=u(),H=O.S;if(H!==null&&H(j,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var K=h_(R,o);So(e,t,K,mn(e))}else So(e,t,o,mn(e))}catch(Q){So(e,t,{then:function(){},status:"rejected",reason:Q},mn())}finally{P.p=h,S!==null&&j.types!==null&&(S.types=j.types),O.T=S}}function b_(){}function Mu(e,t,s,o){if(e.tag!==5)throw Error(l(476));var u=Ap(e).queue;Ep(e,u,t,W,s===null?b_:function(){return Dp(e),s(o)})}function Ap(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ca,lastRenderedState:W},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ca,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Dp(e){var t=Ap(e);t.next===null&&(t=e.alternate.memoizedState),So(e,t.next.queue,{},mn())}function Ou(){return Ht(zo)}function Rp(){return _t().memoizedState}function Mp(){return _t().memoizedState}function x_(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=mn();e=za(s);var o=Ua(t,e,s);o!==null&&(sn(o,t,s),vo(o,t,s)),t={cache:cu()},e.payload=t;return}t=t.return}}function S_(e,t,s){var o=mn();s={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},tr(e)?Bp(t,s):(s=Wc(e,t,s,o),s!==null&&(sn(s,e,o),Lp(s,t,o)))}function Op(e,t,s){var o=mn();So(e,t,s,o)}function So(e,t,s,o){var u={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(tr(e))Bp(t,u);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var S=t.lastRenderedState,j=h(S,s);if(u.hasEagerState=!0,u.eagerState=j,rn(j,S))return Bl(e,t,u,0),at===null&&Ol(),!1}catch{}finally{}if(s=Wc(e,t,u,o),s!==null)return sn(s,e,o),Lp(s,t,o),!0}return!1}function Bu(e,t,s,o){if(o={lane:2,revertLane:hd(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},tr(e)){if(t)throw Error(l(479))}else t=Wc(e,s,o,2),t!==null&&sn(t,e,2)}function tr(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function Bp(e,t){mi=Fl=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function Lp(e,t,s){if((s&4194048)!==0){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,Hh(e,s)}}var _o={readContext:Ht,use:Ql,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useLayoutEffect:gt,useInsertionEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useSyncExternalStore:gt,useId:gt,useHostTransitionStatus:gt,useFormState:gt,useActionState:gt,useOptimistic:gt,useMemoCache:gt,useCacheRefresh:gt};_o.useEffectEvent=gt;var Ip={readContext:Ht,use:Ql,useCallback:function(e,t){return Xt().memoizedState=[e,t===void 0?null:t],e},useContext:Ht,useEffect:xp,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,Jl(4194308,4,kp.bind(null,t,e),s)},useLayoutEffect:function(e,t){return Jl(4194308,4,e,t)},useInsertionEffect:function(e,t){Jl(4,2,e,t)},useMemo:function(e,t){var s=Xt();t=t===void 0?null:t;var o=e();if(ks){Ie(!0);try{e()}finally{Ie(!1)}}return s.memoizedState=[o,t],o},useReducer:function(e,t,s){var o=Xt();if(s!==void 0){var u=s(t);if(ks){Ie(!0);try{s(t)}finally{Ie(!1)}}}else u=t;return o.memoizedState=o.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},o.queue=e,e=e.dispatch=S_.bind(null,Ne,e),[o.memoizedState,e]},useRef:function(e){var t=Xt();return e={current:e},t.memoizedState=e},useState:function(e){e=Cu(e);var t=e.queue,s=Op.bind(null,Ne,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:Du,useDeferredValue:function(e,t){var s=Xt();return Ru(s,e,t)},useTransition:function(){var e=Cu(!1);return e=Ep.bind(null,Ne,e.queue,!0,!1),Xt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var o=Ne,u=Xt();if(ze){if(s===void 0)throw Error(l(407));s=s()}else{if(s=t(),at===null)throw Error(l(349));(Oe&127)!==0||sp(o,t,s)}u.memoizedState=s;var h={value:s,getSnapshot:t};return u.queue=h,xp(op.bind(null,o,h,e),[e]),o.flags|=2048,vi(9,{destroy:void 0},ip.bind(null,o,h,s,t),null),s},useId:function(){var e=Xt(),t=at.identifierPrefix;if(ze){var s=Kn,o=qn;s=(o&~(1<<32-Ye(o)-1)).toString(32)+s,t="_"+t+"R_"+s,s=Zl++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=m_++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ou,useFormState:pp,useActionState:pp,useOptimistic:function(e){var t=Xt();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Bu.bind(null,Ne,!0,s),s.dispatch=t,[e,t]},useMemoCache:ju,useCacheRefresh:function(){return Xt().memoizedState=x_.bind(null,Ne)},useEffectEvent:function(e){var t=Xt(),s={impl:e};return t.memoizedState=s,function(){if((Fe&2)!==0)throw Error(l(440));return s.impl.apply(void 0,arguments)}}},Lu={readContext:Ht,use:Ql,useCallback:wp,useContext:Ht,useEffect:Au,useImperativeHandle:jp,useInsertionEffect:_p,useLayoutEffect:Tp,useMemo:Np,useReducer:Wl,useRef:bp,useState:function(){return Wl(ca)},useDebugValue:Du,useDeferredValue:function(e,t){var s=_t();return Cp(s,We.memoizedState,e,t)},useTransition:function(){var e=Wl(ca)[0],t=_t().memoizedState;return[typeof e=="boolean"?e:xo(e),t]},useSyncExternalStore:ap,useId:Rp,useHostTransitionStatus:Ou,useFormState:vp,useActionState:vp,useOptimistic:function(e,t){var s=_t();return cp(s,We,e,t)},useMemoCache:ju,useCacheRefresh:Mp};Lu.useEffectEvent=Sp;var zp={readContext:Ht,use:Ql,useCallback:wp,useContext:Ht,useEffect:Au,useImperativeHandle:jp,useInsertionEffect:_p,useLayoutEffect:Tp,useMemo:Np,useReducer:Nu,useRef:bp,useState:function(){return Nu(ca)},useDebugValue:Du,useDeferredValue:function(e,t){var s=_t();return We===null?Ru(s,e,t):Cp(s,We.memoizedState,e,t)},useTransition:function(){var e=Nu(ca)[0],t=_t().memoizedState;return[typeof e=="boolean"?e:xo(e),t]},useSyncExternalStore:ap,useId:Rp,useHostTransitionStatus:Ou,useFormState:yp,useActionState:yp,useOptimistic:function(e,t){var s=_t();return We!==null?cp(s,We,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:ju,useCacheRefresh:Mp};zp.useEffectEvent=Sp;function Iu(e,t,s,o){t=e.memoizedState,s=s(o,t),s=s==null?t:b({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var zu={enqueueSetState:function(e,t,s){e=e._reactInternals;var o=mn(),u=za(o);u.payload=t,s!=null&&(u.callback=s),t=Ua(e,u,o),t!==null&&(sn(t,e,o),vo(t,e,o))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var o=mn(),u=za(o);u.tag=1,u.payload=t,s!=null&&(u.callback=s),t=Ua(e,u,o),t!==null&&(sn(t,e,o),vo(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=mn(),o=za(s);o.tag=2,t!=null&&(o.callback=t),t=Ua(e,o,s),t!==null&&(sn(t,e,s),vo(t,e,s))}};function Up(e,t,s,o,u,h,S){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,h,S):t.prototype&&t.prototype.isPureReactComponent?!lo(s,o)||!lo(u,h):!0}function Vp(e,t,s,o){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,o),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,o),t.state!==e&&zu.enqueueReplaceState(t,t.state,null)}function js(e,t){var s=t;if("ref"in t){s={};for(var o in t)o!=="ref"&&(s[o]=t[o])}if(e=e.defaultProps){s===t&&(s=b({},s));for(var u in e)s[u]===void 0&&(s[u]=e[u])}return s}function Hp(e){Ml(e)}function Pp(e){console.error(e)}function Gp(e){Ml(e)}function nr(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(o){setTimeout(function(){throw o})}}function $p(e,t,s){try{var o=e.onCaughtError;o(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Uu(e,t,s){return s=za(s),s.tag=3,s.payload={element:null},s.callback=function(){nr(e,t)},s}function qp(e){return e=za(e),e.tag=3,e}function Kp(e,t,s,o){var u=s.type.getDerivedStateFromError;if(typeof u=="function"){var h=o.value;e.payload=function(){return u(h)},e.callback=function(){$p(t,s,o)}}var S=s.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(e.callback=function(){$p(t,s,o),typeof u!="function"&&(qa===null?qa=new Set([this]):qa.add(this));var j=o.stack;this.componentDidCatch(o.value,{componentStack:j!==null?j:""})})}function __(e,t,s,o,u){if(s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(t=s.alternate,t!==null&&ri(t,s,u,!0),s=un.current,s!==null){switch(s.tag){case 31:case 13:return Nn===null?mr():s.alternate===null&&yt===0&&(yt=3),s.flags&=-257,s.flags|=65536,s.lanes=u,o===Gl?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([o]):t.add(o),ud(e,o,u)),!1;case 22:return s.flags|=65536,o===Gl?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([o])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([o]):s.add(o)),ud(e,o,u)),!1}throw Error(l(435,s.tag))}return ud(e,o,u),mr(),!1}if(ze)return t=un.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,o!==su&&(e=Error(l(422),{cause:o}),uo(Tn(e,s)))):(o!==su&&(t=Error(l(423),{cause:o}),uo(Tn(t,s))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,o=Tn(o,s),u=Uu(e.stateNode,o,u),pu(e,u),yt!==4&&(yt=2)),!1;var h=Error(l(520),{cause:o});if(h=Tn(h,s),Ao===null?Ao=[h]:Ao.push(h),yt!==4&&(yt=2),t===null)return!0;o=Tn(o,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=u&-u,s.lanes|=e,e=Uu(s.stateNode,o,e),pu(s,e),!1;case 1:if(t=s.type,h=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(qa===null||!qa.has(h))))return s.flags|=65536,u&=-u,s.lanes|=u,u=qp(u),Kp(u,e,s,o),pu(s,u),!1}s=s.return}while(s!==null);return!1}var Vu=Error(l(461)),wt=!1;function Pt(e,t,s,o){t.child=e===null?Xm(t,null,s,o):Ts(t,e.child,s,o)}function Yp(e,t,s,o,u){s=s.render;var h=t.ref;if("ref"in o){var S={};for(var j in o)j!=="ref"&&(S[j]=o[j])}else S=o;return bs(t),o=Su(e,t,s,S,h,u),j=_u(),e!==null&&!wt?(Tu(e,t,u),ua(e,t,u)):(ze&&j&&nu(t),t.flags|=1,Pt(e,t,o,u),t.child)}function Fp(e,t,s,o,u){if(e===null){var h=s.type;return typeof h=="function"&&!Jc(h)&&h.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=h,Zp(e,t,h,o,u)):(e=Il(s.type,null,o,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!Fu(e,u)){var S=h.memoizedProps;if(s=s.compare,s=s!==null?s:lo,s(S,o)&&e.ref===t.ref)return ua(e,t,u)}return t.flags|=1,e=sa(h,o),e.ref=t.ref,e.return=t,t.child=e}function Zp(e,t,s,o,u){if(e!==null){var h=e.memoizedProps;if(lo(h,o)&&e.ref===t.ref)if(wt=!1,t.pendingProps=o=h,Fu(e,u))(e.flags&131072)!==0&&(wt=!0);else return t.lanes=e.lanes,ua(e,t,u)}return Hu(e,t,s,o,u)}function Xp(e,t,s,o){var u=o.children,h=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((t.flags&128)!==0){if(h=h!==null?h.baseLanes|s:s,e!==null){for(o=t.child=e.child,u=0;o!==null;)u=u|o.lanes|o.childLanes,o=o.sibling;o=u&~h}else o=0,t.child=null;return Qp(e,t,h,s,o)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Hl(t,h!==null?h.cachePool:null),h!==null?Jm(t,h):gu(),ep(t);else return o=t.lanes=536870912,Qp(e,t,h!==null?h.baseLanes|s:s,s,o)}else h!==null?(Hl(t,h.cachePool),Jm(t,h),Ha(),t.memoizedState=null):(e!==null&&Hl(t,null),gu(),Ha());return Pt(e,t,u,s),t.child}function To(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Qp(e,t,s,o,u){var h=du();return h=h===null?null:{parent:kt._currentValue,pool:h},t.memoizedState={baseLanes:s,cachePool:h},e!==null&&Hl(t,null),gu(),ep(t),e!==null&&ri(e,t,o,!0),t.childLanes=u,null}function ar(e,t){return t=ir({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Wp(e,t,s){return Ts(t,e.child,null,s),e=ar(t,t.pendingProps),e.flags|=2,dn(t),t.memoizedState=null,e}function T_(e,t,s){var o=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ze){if(o.mode==="hidden")return e=ar(t,o),t.lanes=536870912,To(null,e);if(bu(t),(e=it)?(e=ug(e,wn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ma!==null?{id:qn,overflow:Kn}:null,retryLane:536870912,hydrationErrors:null},s=Bm(e),s.return=t,t.child=s,Vt=t,it=null)):e=null,e===null)throw Ba(t);return t.lanes=536870912,null}return ar(t,o)}var h=e.memoizedState;if(h!==null){var S=h.dehydrated;if(bu(t),u)if(t.flags&256)t.flags&=-257,t=Wp(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(l(558));else if(wt||ri(e,t,s,!1),u=(s&e.childLanes)!==0,wt||u){if(o=at,o!==null&&(S=Ph(o,s),S!==0&&S!==h.retryLane))throw h.retryLane=S,ps(e,S),sn(o,e,S),Vu;mr(),t=Wp(e,t,s)}else e=h.treeContext,it=Cn(S.nextSibling),Vt=t,ze=!0,Oa=null,wn=!1,e!==null&&zm(t,e),t=ar(t,o),t.flags|=4096;return t}return e=sa(e.child,{mode:o.mode,children:o.children}),e.ref=t.ref,t.child=e,e.return=t,e}function sr(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(l(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function Hu(e,t,s,o,u){return bs(t),s=Su(e,t,s,o,void 0,u),o=_u(),e!==null&&!wt?(Tu(e,t,u),ua(e,t,u)):(ze&&o&&nu(t),t.flags|=1,Pt(e,t,s,u),t.child)}function Jp(e,t,s,o,u,h){return bs(t),t.updateQueue=null,s=np(t,o,s,u),tp(e),o=_u(),e!==null&&!wt?(Tu(e,t,h),ua(e,t,h)):(ze&&o&&nu(t),t.flags|=1,Pt(e,t,s,h),t.child)}function ev(e,t,s,o,u){if(bs(t),t.stateNode===null){var h=si,S=s.contextType;typeof S=="object"&&S!==null&&(h=Ht(S)),h=new s(o,h),t.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=zu,t.stateNode=h,h._reactInternals=t,h=t.stateNode,h.props=o,h.state=t.memoizedState,h.refs={},hu(t),S=s.contextType,h.context=typeof S=="object"&&S!==null?Ht(S):si,h.state=t.memoizedState,S=s.getDerivedStateFromProps,typeof S=="function"&&(Iu(t,s,S,o),h.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(S=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),S!==h.state&&zu.enqueueReplaceState(h,h.state,null),yo(t,o,h,u),go(),h.state=t.memoizedState),typeof h.componentDidMount=="function"&&(t.flags|=4194308),o=!0}else if(e===null){h=t.stateNode;var j=t.memoizedProps,R=js(s,j);h.props=R;var H=h.context,K=s.contextType;S=si,typeof K=="object"&&K!==null&&(S=Ht(K));var Q=s.getDerivedStateFromProps;K=typeof Q=="function"||typeof h.getSnapshotBeforeUpdate=="function",j=t.pendingProps!==j,K||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(j||H!==S)&&Vp(t,h,o,S),Ia=!1;var G=t.memoizedState;h.state=G,yo(t,o,h,u),go(),H=t.memoizedState,j||G!==H||Ia?(typeof Q=="function"&&(Iu(t,s,Q,o),H=t.memoizedState),(R=Ia||Up(t,s,R,o,G,H,S))?(K||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=o,t.memoizedState=H),h.props=o,h.state=H,h.context=S,o=R):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{h=t.stateNode,mu(e,t),S=t.memoizedProps,K=js(s,S),h.props=K,Q=t.pendingProps,G=h.context,H=s.contextType,R=si,typeof H=="object"&&H!==null&&(R=Ht(H)),j=s.getDerivedStateFromProps,(H=typeof j=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(S!==Q||G!==R)&&Vp(t,h,o,R),Ia=!1,G=t.memoizedState,h.state=G,yo(t,o,h,u),go();var $=t.memoizedState;S!==Q||G!==$||Ia||e!==null&&e.dependencies!==null&&Ul(e.dependencies)?(typeof j=="function"&&(Iu(t,s,j,o),$=t.memoizedState),(K=Ia||Up(t,s,K,o,G,$,R)||e!==null&&e.dependencies!==null&&Ul(e.dependencies))?(H||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(o,$,R),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(o,$,R)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||S===e.memoizedProps&&G===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&G===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=$),h.props=o,h.state=$,h.context=R,o=K):(typeof h.componentDidUpdate!="function"||S===e.memoizedProps&&G===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&G===e.memoizedState||(t.flags|=1024),o=!1)}return h=o,sr(e,t),o=(t.flags&128)!==0,h||o?(h=t.stateNode,s=o&&typeof s.getDerivedStateFromError!="function"?null:h.render(),t.flags|=1,e!==null&&o?(t.child=Ts(t,e.child,null,u),t.child=Ts(t,null,s,u)):Pt(e,t,s,u),t.memoizedState=h.state,e=t.child):e=ua(e,t,u),e}function tv(e,t,s,o){return gs(),t.flags|=256,Pt(e,t,s,o),t.child}var Pu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Gu(e){return{baseLanes:e,cachePool:$m()}}function $u(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=hn),e}function nv(e,t,s){var o=t.pendingProps,u=!1,h=(t.flags&128)!==0,S;if((S=h)||(S=e!==null&&e.memoizedState===null?!1:(St.current&2)!==0),S&&(u=!0,t.flags&=-129),S=(t.flags&32)!==0,t.flags&=-33,e===null){if(ze){if(u?Va(t):Ha(),(e=it)?(e=ug(e,wn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ma!==null?{id:qn,overflow:Kn}:null,retryLane:536870912,hydrationErrors:null},s=Bm(e),s.return=t,t.child=s,Vt=t,it=null)):e=null,e===null)throw Ba(t);return wd(e)?t.lanes=32:t.lanes=536870912,null}var j=o.children;return o=o.fallback,u?(Ha(),u=t.mode,j=ir({mode:"hidden",children:j},u),o=vs(o,u,s,null),j.return=t,o.return=t,j.sibling=o,t.child=j,o=t.child,o.memoizedState=Gu(s),o.childLanes=$u(e,S,s),t.memoizedState=Pu,To(null,o)):(Va(t),qu(t,j))}var R=e.memoizedState;if(R!==null&&(j=R.dehydrated,j!==null)){if(h)t.flags&256?(Va(t),t.flags&=-257,t=Ku(e,t,s)):t.memoizedState!==null?(Ha(),t.child=e.child,t.flags|=128,t=null):(Ha(),j=o.fallback,u=t.mode,o=ir({mode:"visible",children:o.children},u),j=vs(j,u,s,null),j.flags|=2,o.return=t,j.return=t,o.sibling=j,t.child=o,Ts(t,e.child,null,s),o=t.child,o.memoizedState=Gu(s),o.childLanes=$u(e,S,s),t.memoizedState=Pu,t=To(null,o));else if(Va(t),wd(j)){if(S=j.nextSibling&&j.nextSibling.dataset,S)var H=S.dgst;S=H,o=Error(l(419)),o.stack="",o.digest=S,uo({value:o,source:null,stack:null}),t=Ku(e,t,s)}else if(wt||ri(e,t,s,!1),S=(s&e.childLanes)!==0,wt||S){if(S=at,S!==null&&(o=Ph(S,s),o!==0&&o!==R.retryLane))throw R.retryLane=o,ps(e,o),sn(S,e,o),Vu;jd(j)||mr(),t=Ku(e,t,s)}else jd(j)?(t.flags|=192,t.child=e.child,t=null):(e=R.treeContext,it=Cn(j.nextSibling),Vt=t,ze=!0,Oa=null,wn=!1,e!==null&&zm(t,e),t=qu(t,o.children),t.flags|=4096);return t}return u?(Ha(),j=o.fallback,u=t.mode,R=e.child,H=R.sibling,o=sa(R,{mode:"hidden",children:o.children}),o.subtreeFlags=R.subtreeFlags&65011712,H!==null?j=sa(H,j):(j=vs(j,u,s,null),j.flags|=2),j.return=t,o.return=t,o.sibling=j,t.child=o,To(null,o),o=t.child,j=e.child.memoizedState,j===null?j=Gu(s):(u=j.cachePool,u!==null?(R=kt._currentValue,u=u.parent!==R?{parent:R,pool:R}:u):u=$m(),j={baseLanes:j.baseLanes|s,cachePool:u}),o.memoizedState=j,o.childLanes=$u(e,S,s),t.memoizedState=Pu,To(e.child,o)):(Va(t),s=e.child,e=s.sibling,s=sa(s,{mode:"visible",children:o.children}),s.return=t,s.sibling=null,e!==null&&(S=t.deletions,S===null?(t.deletions=[e],t.flags|=16):S.push(e)),t.child=s,t.memoizedState=null,s)}function qu(e,t){return t=ir({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ir(e,t){return e=cn(22,e,null,t),e.lanes=0,e}function Ku(e,t,s){return Ts(t,e.child,null,s),e=qu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function av(e,t,s){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),lu(e.return,t,s)}function Yu(e,t,s,o,u,h){var S=e.memoizedState;S===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:o,tail:s,tailMode:u,treeForkCount:h}:(S.isBackwards=t,S.rendering=null,S.renderingStartTime=0,S.last=o,S.tail=s,S.tailMode=u,S.treeForkCount=h)}function sv(e,t,s){var o=t.pendingProps,u=o.revealOrder,h=o.tail;o=o.children;var S=St.current,j=(S&2)!==0;if(j?(S=S&1|2,t.flags|=128):S&=1,Se(St,S),Pt(e,t,o,s),o=ze?co:0,!j&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&av(e,s,t);else if(e.tag===19)av(e,s,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(u){case"forwards":for(s=t.child,u=null;s!==null;)e=s.alternate,e!==null&&Yl(e)===null&&(u=s),s=s.sibling;s=u,s===null?(u=t.child,t.child=null):(u=s.sibling,s.sibling=null),Yu(t,!1,u,s,h,o);break;case"backwards":case"unstable_legacy-backwards":for(s=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&Yl(e)===null){t.child=u;break}e=u.sibling,u.sibling=s,s=u,u=e}Yu(t,!0,s,null,h,o);break;case"together":Yu(t,!1,null,null,void 0,o);break;default:t.memoizedState=null}return t.child}function ua(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),$a|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(ri(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(l(153));if(t.child!==null){for(e=t.child,s=sa(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=sa(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function Fu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ul(e)))}function k_(e,t,s){switch(t.tag){case 3:tt(t,t.stateNode.containerInfo),La(t,kt,e.memoizedState.cache),gs();break;case 27:case 5:X(t);break;case 4:tt(t,t.stateNode.containerInfo);break;case 10:La(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,bu(t),null;break;case 13:var o=t.memoizedState;if(o!==null)return o.dehydrated!==null?(Va(t),t.flags|=128,null):(s&t.child.childLanes)!==0?nv(e,t,s):(Va(t),e=ua(e,t,s),e!==null?e.sibling:null);Va(t);break;case 19:var u=(e.flags&128)!==0;if(o=(s&t.childLanes)!==0,o||(ri(e,t,s,!1),o=(s&t.childLanes)!==0),u){if(o)return sv(e,t,s);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),Se(St,St.current),o)break;return null;case 22:return t.lanes=0,Xp(e,t,s,t.pendingProps);case 24:La(t,kt,e.memoizedState.cache)}return ua(e,t,s)}function iv(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)wt=!0;else{if(!Fu(e,s)&&(t.flags&128)===0)return wt=!1,k_(e,t,s);wt=(e.flags&131072)!==0}else wt=!1,ze&&(t.flags&1048576)!==0&&Im(t,co,t.index);switch(t.lanes=0,t.tag){case 16:e:{var o=t.pendingProps;if(e=Ss(t.elementType),t.type=e,typeof e=="function")Jc(e)?(o=js(e,o),t.tag=1,t=ev(null,t,e,o,s)):(t.tag=0,t=Hu(null,t,e,o,s));else{if(e!=null){var u=e.$$typeof;if(u===D){t.tag=11,t=Yp(null,t,e,o,s);break e}else if(u===z){t.tag=14,t=Fp(null,t,e,o,s);break e}}throw t=q(e)||e,Error(l(306,t,""))}}return t;case 0:return Hu(e,t,t.type,t.pendingProps,s);case 1:return o=t.type,u=js(o,t.pendingProps),ev(e,t,o,u,s);case 3:e:{if(tt(t,t.stateNode.containerInfo),e===null)throw Error(l(387));o=t.pendingProps;var h=t.memoizedState;u=h.element,mu(e,t),yo(t,o,null,s);var S=t.memoizedState;if(o=S.cache,La(t,kt,o),o!==h.cache&&ru(t,[kt],s,!0),go(),o=S.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:S.cache},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){t=tv(e,t,o,s);break e}else if(o!==u){u=Tn(Error(l(424)),t),uo(u),t=tv(e,t,o,s);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(it=Cn(e.firstChild),Vt=t,ze=!0,Oa=null,wn=!0,s=Xm(t,null,o,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(gs(),o===u){t=ua(e,t,s);break e}Pt(e,t,o,s)}t=t.child}return t;case 26:return sr(e,t),e===null?(s=vg(t.type,null,t.pendingProps,null))?t.memoizedState=s:ze||(s=t.type,e=t.pendingProps,o=Sr(ue.current).createElement(s),o[Ut]=t,o[Wt]=e,Gt(o,s,e),Lt(o),t.stateNode=o):t.memoizedState=vg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return X(t),e===null&&ze&&(o=t.stateNode=hg(t.type,t.pendingProps,ue.current),Vt=t,wn=!0,u=it,Za(t.type)?(Nd=u,it=Cn(o.firstChild)):it=u),Pt(e,t,t.pendingProps.children,s),sr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ze&&((u=o=it)&&(o=e1(o,t.type,t.pendingProps,wn),o!==null?(t.stateNode=o,Vt=t,it=Cn(o.firstChild),wn=!1,u=!0):u=!1),u||Ba(t)),X(t),u=t.type,h=t.pendingProps,S=e!==null?e.memoizedProps:null,o=h.children,_d(u,h)?o=null:S!==null&&_d(u,S)&&(t.flags|=32),t.memoizedState!==null&&(u=Su(e,t,p_,null,null,s),zo._currentValue=u),sr(e,t),Pt(e,t,o,s),t.child;case 6:return e===null&&ze&&((e=s=it)&&(s=t1(s,t.pendingProps,wn),s!==null?(t.stateNode=s,Vt=t,it=null,e=!0):e=!1),e||Ba(t)),null;case 13:return nv(e,t,s);case 4:return tt(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=Ts(t,null,o,s):Pt(e,t,o,s),t.child;case 11:return Yp(e,t,t.type,t.pendingProps,s);case 7:return Pt(e,t,t.pendingProps,s),t.child;case 8:return Pt(e,t,t.pendingProps.children,s),t.child;case 12:return Pt(e,t,t.pendingProps.children,s),t.child;case 10:return o=t.pendingProps,La(t,t.type,o.value),Pt(e,t,o.children,s),t.child;case 9:return u=t.type._context,o=t.pendingProps.children,bs(t),u=Ht(u),o=o(u),t.flags|=1,Pt(e,t,o,s),t.child;case 14:return Fp(e,t,t.type,t.pendingProps,s);case 15:return Zp(e,t,t.type,t.pendingProps,s);case 19:return sv(e,t,s);case 31:return T_(e,t,s);case 22:return Xp(e,t,s,t.pendingProps);case 24:return bs(t),o=Ht(kt),e===null?(u=du(),u===null&&(u=at,h=cu(),u.pooledCache=h,h.refCount++,h!==null&&(u.pooledCacheLanes|=s),u=h),t.memoizedState={parent:o,cache:u},hu(t),La(t,kt,u)):((e.lanes&s)!==0&&(mu(e,t),yo(t,null,null,s),go()),u=e.memoizedState,h=t.memoizedState,u.parent!==o?(u={parent:o,cache:o},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),La(t,kt,o)):(o=h.cache,La(t,kt,o),o!==u.cache&&ru(t,[kt],s,!0))),Pt(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function da(e){e.flags|=4}function Zu(e,t,s,o,u){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(Rv())e.flags|=8192;else throw _s=Gl,fu}else e.flags&=-16777217}function ov(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Sg(t))if(Rv())e.flags|=8192;else throw _s=Gl,fu}function or(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Uh():536870912,e.lanes|=t,xi|=t)}function ko(e,t){if(!ze)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function ot(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,o=0;if(t)for(var u=e.child;u!==null;)s|=u.lanes|u.childLanes,o|=u.subtreeFlags&65011712,o|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)s|=u.lanes|u.childLanes,o|=u.subtreeFlags,o|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=o,e.childLanes=s,t}function j_(e,t,s){var o=t.pendingProps;switch(au(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ot(t),null;case 1:return ot(t),null;case 3:return s=t.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),la(kt),ee(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(li(t)?da(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,iu())),ot(t),null;case 26:var u=t.type,h=t.memoizedState;return e===null?(da(t),h!==null?(ot(t),ov(t,h)):(ot(t),Zu(t,u,null,o,s))):h?h!==e.memoizedState?(da(t),ot(t),ov(t,h)):(ot(t),t.flags&=-16777217):(e=e.memoizedProps,e!==o&&da(t),ot(t),Zu(t,u,e,o,s)),null;case 27:if(At(t),s=ue.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&da(t);else{if(!o){if(t.stateNode===null)throw Error(l(166));return ot(t),null}e=Le.current,li(t)?Um(t):(e=hg(u,o,s),t.stateNode=e,da(t))}return ot(t),null;case 5:if(At(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&da(t);else{if(!o){if(t.stateNode===null)throw Error(l(166));return ot(t),null}if(h=Le.current,li(t))Um(t);else{var S=Sr(ue.current);switch(h){case 1:h=S.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:h=S.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":h=S.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":h=S.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":h=S.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?S.createElement("select",{is:o.is}):S.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?S.createElement(u,{is:o.is}):S.createElement(u)}}h[Ut]=t,h[Wt]=o;e:for(S=t.child;S!==null;){if(S.tag===5||S.tag===6)h.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===t)break e;for(;S.sibling===null;){if(S.return===null||S.return===t)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}t.stateNode=h;e:switch(Gt(h,u,o),u){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&da(t)}}return ot(t),Zu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==o&&da(t);else{if(typeof o!="string"&&t.stateNode===null)throw Error(l(166));if(e=ue.current,li(t)){if(e=t.stateNode,s=t.memoizedProps,o=null,u=Vt,u!==null)switch(u.tag){case 27:case 5:o=u.memoizedProps}e[Ut]=t,e=!!(e.nodeValue===s||o!==null&&o.suppressHydrationWarning===!0||ng(e.nodeValue,s)),e||Ba(t,!0)}else e=Sr(e).createTextNode(o),e[Ut]=t,t.stateNode=e}return ot(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(o=li(t),s!==null){if(e===null){if(!o)throw Error(l(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[Ut]=t}else gs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ot(t),e=!1}else s=iu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(dn(t),t):(dn(t),null);if((t.flags&128)!==0)throw Error(l(558))}return ot(t),null;case 13:if(o=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=li(t),o!==null&&o.dehydrated!==null){if(e===null){if(!u)throw Error(l(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(l(317));u[Ut]=t}else gs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ot(t),u=!1}else u=iu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(dn(t),t):(dn(t),null)}return dn(t),(t.flags&128)!==0?(t.lanes=s,t):(s=o!==null,e=e!==null&&e.memoizedState!==null,s&&(o=t.child,u=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(u=o.alternate.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==u&&(o.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),or(t,t.updateQueue),ot(t),null);case 4:return ee(),e===null&&gd(t.stateNode.containerInfo),ot(t),null;case 10:return la(t.type),ot(t),null;case 19:if(je(St),o=t.memoizedState,o===null)return ot(t),null;if(u=(t.flags&128)!==0,h=o.rendering,h===null)if(u)ko(o,!1);else{if(yt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=Yl(e),h!==null){for(t.flags|=128,ko(o,!1),e=h.updateQueue,t.updateQueue=e,or(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)Om(s,e),s=s.sibling;return Se(St,St.current&1|2),ze&&ia(t,o.treeForkCount),t.child}e=e.sibling}o.tail!==null&&Kt()>dr&&(t.flags|=128,u=!0,ko(o,!1),t.lanes=4194304)}else{if(!u)if(e=Yl(h),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,or(t,e),ko(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!ze)return ot(t),null}else 2*Kt()-o.renderingStartTime>dr&&s!==536870912&&(t.flags|=128,u=!0,ko(o,!1),t.lanes=4194304);o.isBackwards?(h.sibling=t.child,t.child=h):(e=o.last,e!==null?e.sibling=h:t.child=h,o.last=h)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Kt(),e.sibling=null,s=St.current,Se(St,u?s&1|2:s&1),ze&&ia(t,o.treeForkCount),e):(ot(t),null);case 22:case 23:return dn(t),yu(),o=t.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(t.flags|=8192):o&&(t.flags|=8192),o?(s&536870912)!==0&&(t.flags&128)===0&&(ot(t),t.subtreeFlags&6&&(t.flags|=8192)):ot(t),s=t.updateQueue,s!==null&&or(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),o=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),o!==s&&(t.flags|=2048),e!==null&&je(xs),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),la(kt),ot(t),null;case 25:return null;case 30:return null}throw Error(l(156,t.tag))}function w_(e,t){switch(au(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return la(kt),ee(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return At(t),null;case 31:if(t.memoizedState!==null){if(dn(t),t.alternate===null)throw Error(l(340));gs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(dn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));gs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return je(St),null;case 4:return ee(),null;case 10:return la(t.type),null;case 22:case 23:return dn(t),yu(),e!==null&&je(xs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return la(kt),null;case 25:return null;default:return null}}function lv(e,t){switch(au(t),t.tag){case 3:la(kt),ee();break;case 26:case 27:case 5:At(t);break;case 4:ee();break;case 31:t.memoizedState!==null&&dn(t);break;case 13:dn(t);break;case 19:je(St);break;case 10:la(t.type);break;case 22:case 23:dn(t),yu(),e!==null&&je(xs);break;case 24:la(kt)}}function jo(e,t){try{var s=t.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var u=o.next;s=u;do{if((s.tag&e)===e){o=void 0;var h=s.create,S=s.inst;o=h(),S.destroy=o}s=s.next}while(s!==u)}}catch(j){Qe(t,t.return,j)}}function Pa(e,t,s){try{var o=t.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var h=u.next;o=h;do{if((o.tag&e)===e){var S=o.inst,j=S.destroy;if(j!==void 0){S.destroy=void 0,u=t;var R=s,H=j;try{H()}catch(K){Qe(u,R,K)}}}o=o.next}while(o!==h)}}catch(K){Qe(t,t.return,K)}}function rv(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{Wm(t,s)}catch(o){Qe(e,e.return,o)}}}function cv(e,t,s){s.props=js(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(o){Qe(e,t,o)}}function wo(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof s=="function"?e.refCleanup=s(o):s.current=o}}catch(u){Qe(e,t,u)}}function Yn(e,t){var s=e.ref,o=e.refCleanup;if(s!==null)if(typeof o=="function")try{o()}catch(u){Qe(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(u){Qe(e,t,u)}else s.current=null}function uv(e){var t=e.type,s=e.memoizedProps,o=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&o.focus();break e;case"img":s.src?o.src=s.src:s.srcSet&&(o.srcset=s.srcSet)}}catch(u){Qe(e,e.return,u)}}function Xu(e,t,s){try{var o=e.stateNode;F_(o,e.type,s,t),o[Wt]=t}catch(u){Qe(e,e.return,u)}}function dv(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Za(e.type)||e.tag===4}function Qu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dv(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Za(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Wu(e,t,s){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(e),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=na));else if(o!==4&&(o===27&&Za(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(Wu(e,t,s),e=e.sibling;e!==null;)Wu(e,t,s),e=e.sibling}function lr(e,t,s){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(o!==4&&(o===27&&Za(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(lr(e,t,s),e=e.sibling;e!==null;)lr(e,t,s),e=e.sibling}function fv(e){var t=e.stateNode,s=e.memoizedProps;try{for(var o=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);Gt(t,o,s),t[Ut]=e,t[Wt]=s}catch(h){Qe(e,e.return,h)}}var fa=!1,Nt=!1,Ju=!1,hv=typeof WeakSet=="function"?WeakSet:Set,It=null;function N_(e,t){if(e=e.containerInfo,xd=Cr,e=jm(e),Kc(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var o=s.getSelection&&s.getSelection();if(o&&o.rangeCount!==0){s=o.anchorNode;var u=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{s.nodeType,h.nodeType}catch{s=null;break e}var S=0,j=-1,R=-1,H=0,K=0,Q=e,G=null;t:for(;;){for(var $;Q!==s||u!==0&&Q.nodeType!==3||(j=S+u),Q!==h||o!==0&&Q.nodeType!==3||(R=S+o),Q.nodeType===3&&(S+=Q.nodeValue.length),($=Q.firstChild)!==null;)G=Q,Q=$;for(;;){if(Q===e)break t;if(G===s&&++H===u&&(j=S),G===h&&++K===o&&(R=S),($=Q.nextSibling)!==null)break;Q=G,G=Q.parentNode}Q=$}s=j===-1||R===-1?null:{start:j,end:R}}else s=null}s=s||{start:0,end:0}}else s=null;for(Sd={focusedElem:e,selectionRange:s},Cr=!1,It=t;It!==null;)if(t=It,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,It=e;else for(;It!==null;){switch(t=It,h=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)u=e[s],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,s=t,u=h.memoizedProps,h=h.memoizedState,o=s.stateNode;try{var he=js(s.type,u);e=o.getSnapshotBeforeUpdate(he,h),o.__reactInternalSnapshotBeforeUpdate=e}catch(ye){Qe(s,s.return,ye)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)kd(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":kd(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(l(163))}if(e=t.sibling,e!==null){e.return=t.return,It=e;break}It=t.return}}function mv(e,t,s){var o=s.flags;switch(s.tag){case 0:case 11:case 15:ma(e,s),o&4&&jo(5,s);break;case 1:if(ma(e,s),o&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(S){Qe(s,s.return,S)}else{var u=js(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(S){Qe(s,s.return,S)}}o&64&&rv(s),o&512&&wo(s,s.return);break;case 3:if(ma(e,s),o&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{Wm(e,t)}catch(S){Qe(s,s.return,S)}}break;case 27:t===null&&o&4&&fv(s);case 26:case 5:ma(e,s),t===null&&o&4&&uv(s),o&512&&wo(s,s.return);break;case 12:ma(e,s);break;case 31:ma(e,s),o&4&&gv(e,s);break;case 13:ma(e,s),o&4&&yv(e,s),o&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=L_.bind(null,s),n1(e,s))));break;case 22:if(o=s.memoizedState!==null||fa,!o){t=t!==null&&t.memoizedState!==null||Nt,u=fa;var h=Nt;fa=o,(Nt=t)&&!h?pa(e,s,(s.subtreeFlags&8772)!==0):ma(e,s),fa=u,Nt=h}break;case 30:break;default:ma(e,s)}}function pv(e){var t=e.alternate;t!==null&&(e.alternate=null,pv(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ec(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var dt=null,en=!1;function ha(e,t,s){for(s=s.child;s!==null;)vv(e,t,s),s=s.sibling}function vv(e,t,s){if(He&&typeof He.onCommitFiberUnmount=="function")try{He.onCommitFiberUnmount(we,s)}catch{}switch(s.tag){case 26:Nt||Yn(s,t),ha(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Nt||Yn(s,t);var o=dt,u=en;Za(s.type)&&(dt=s.stateNode,en=!1),ha(e,t,s),Bo(s.stateNode),dt=o,en=u;break;case 5:Nt||Yn(s,t);case 6:if(o=dt,u=en,dt=null,ha(e,t,s),dt=o,en=u,dt!==null)if(en)try{(dt.nodeType===9?dt.body:dt.nodeName==="HTML"?dt.ownerDocument.body:dt).removeChild(s.stateNode)}catch(h){Qe(s,t,h)}else try{dt.removeChild(s.stateNode)}catch(h){Qe(s,t,h)}break;case 18:dt!==null&&(en?(e=dt,rg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Ci(e)):rg(dt,s.stateNode));break;case 4:o=dt,u=en,dt=s.stateNode.containerInfo,en=!0,ha(e,t,s),dt=o,en=u;break;case 0:case 11:case 14:case 15:Pa(2,s,t),Nt||Pa(4,s,t),ha(e,t,s);break;case 1:Nt||(Yn(s,t),o=s.stateNode,typeof o.componentWillUnmount=="function"&&cv(s,t,o)),ha(e,t,s);break;case 21:ha(e,t,s);break;case 22:Nt=(o=Nt)||s.memoizedState!==null,ha(e,t,s),Nt=o;break;default:ha(e,t,s)}}function gv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ci(e)}catch(s){Qe(t,t.return,s)}}}function yv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ci(e)}catch(s){Qe(t,t.return,s)}}function C_(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new hv),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new hv),t;default:throw Error(l(435,e.tag))}}function rr(e,t){var s=C_(e);t.forEach(function(o){if(!s.has(o)){s.add(o);var u=I_.bind(null,e,o);o.then(u,u)}})}function tn(e,t){var s=t.deletions;if(s!==null)for(var o=0;o<s.length;o++){var u=s[o],h=e,S=t,j=S;e:for(;j!==null;){switch(j.tag){case 27:if(Za(j.type)){dt=j.stateNode,en=!1;break e}break;case 5:dt=j.stateNode,en=!1;break e;case 3:case 4:dt=j.stateNode.containerInfo,en=!0;break e}j=j.return}if(dt===null)throw Error(l(160));vv(h,S,u),dt=null,en=!1,h=u.alternate,h!==null&&(h.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)bv(t,e),t=t.sibling}var zn=null;function bv(e,t){var s=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:tn(t,e),nn(e),o&4&&(Pa(3,e,e.return),jo(3,e),Pa(5,e,e.return));break;case 1:tn(t,e),nn(e),o&512&&(Nt||s===null||Yn(s,s.return)),o&64&&fa&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?o:s.concat(o))));break;case 26:var u=zn;if(tn(t,e),nn(e),o&512&&(Nt||s===null||Yn(s,s.return)),o&4){var h=s!==null?s.memoizedState:null;if(o=e.memoizedState,s===null)if(o===null)if(e.stateNode===null){e:{o=e.type,s=e.memoizedProps,u=u.ownerDocument||u;t:switch(o){case"title":h=u.getElementsByTagName("title")[0],(!h||h[Wi]||h[Ut]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=u.createElement(o),u.head.insertBefore(h,u.querySelector("head > title"))),Gt(h,o,s),h[Ut]=e,Lt(h),o=h;break e;case"link":var S=bg("link","href",u).get(o+(s.href||""));if(S){for(var j=0;j<S.length;j++)if(h=S[j],h.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&h.getAttribute("rel")===(s.rel==null?null:s.rel)&&h.getAttribute("title")===(s.title==null?null:s.title)&&h.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){S.splice(j,1);break t}}h=u.createElement(o),Gt(h,o,s),u.head.appendChild(h);break;case"meta":if(S=bg("meta","content",u).get(o+(s.content||""))){for(j=0;j<S.length;j++)if(h=S[j],h.getAttribute("content")===(s.content==null?null:""+s.content)&&h.getAttribute("name")===(s.name==null?null:s.name)&&h.getAttribute("property")===(s.property==null?null:s.property)&&h.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&h.getAttribute("charset")===(s.charSet==null?null:s.charSet)){S.splice(j,1);break t}}h=u.createElement(o),Gt(h,o,s),u.head.appendChild(h);break;default:throw Error(l(468,o))}h[Ut]=e,Lt(h),o=h}e.stateNode=o}else xg(u,e.type,e.stateNode);else e.stateNode=yg(u,o,e.memoizedProps);else h!==o?(h===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):h.count--,o===null?xg(u,e.type,e.stateNode):yg(u,o,e.memoizedProps)):o===null&&e.stateNode!==null&&Xu(e,e.memoizedProps,s.memoizedProps)}break;case 27:tn(t,e),nn(e),o&512&&(Nt||s===null||Yn(s,s.return)),s!==null&&o&4&&Xu(e,e.memoizedProps,s.memoizedProps);break;case 5:if(tn(t,e),nn(e),o&512&&(Nt||s===null||Yn(s,s.return)),e.flags&32){u=e.stateNode;try{Qs(u,"")}catch(he){Qe(e,e.return,he)}}o&4&&e.stateNode!=null&&(u=e.memoizedProps,Xu(e,u,s!==null?s.memoizedProps:u)),o&1024&&(Ju=!0);break;case 6:if(tn(t,e),nn(e),o&4){if(e.stateNode===null)throw Error(l(162));o=e.memoizedProps,s=e.stateNode;try{s.nodeValue=o}catch(he){Qe(e,e.return,he)}}break;case 3:if(kr=null,u=zn,zn=_r(t.containerInfo),tn(t,e),zn=u,nn(e),o&4&&s!==null&&s.memoizedState.isDehydrated)try{Ci(t.containerInfo)}catch(he){Qe(e,e.return,he)}Ju&&(Ju=!1,xv(e));break;case 4:o=zn,zn=_r(e.stateNode.containerInfo),tn(t,e),nn(e),zn=o;break;case 12:tn(t,e),nn(e);break;case 31:tn(t,e),nn(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,rr(e,o)));break;case 13:tn(t,e),nn(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(ur=Kt()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,rr(e,o)));break;case 22:u=e.memoizedState!==null;var R=s!==null&&s.memoizedState!==null,H=fa,K=Nt;if(fa=H||u,Nt=K||R,tn(t,e),Nt=K,fa=H,nn(e),o&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(s===null||R||fa||Nt||ws(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){R=s=t;try{if(h=R.stateNode,u)S=h.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{j=R.stateNode;var Q=R.memoizedProps.style,G=Q!=null&&Q.hasOwnProperty("display")?Q.display:null;j.style.display=G==null||typeof G=="boolean"?"":(""+G).trim()}}catch(he){Qe(R,R.return,he)}}}else if(t.tag===6){if(s===null){R=t;try{R.stateNode.nodeValue=u?"":R.memoizedProps}catch(he){Qe(R,R.return,he)}}}else if(t.tag===18){if(s===null){R=t;try{var $=R.stateNode;u?cg($,!0):cg(R.stateNode,!1)}catch(he){Qe(R,R.return,he)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;s===t&&(s=null),t=t.return}s===t&&(s=null),t.sibling.return=t.return,t=t.sibling}o&4&&(o=e.updateQueue,o!==null&&(s=o.retryQueue,s!==null&&(o.retryQueue=null,rr(e,s))));break;case 19:tn(t,e),nn(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,rr(e,o)));break;case 30:break;case 21:break;default:tn(t,e),nn(e)}}function nn(e){var t=e.flags;if(t&2){try{for(var s,o=e.return;o!==null;){if(dv(o)){s=o;break}o=o.return}if(s==null)throw Error(l(160));switch(s.tag){case 27:var u=s.stateNode,h=Qu(e);lr(e,h,u);break;case 5:var S=s.stateNode;s.flags&32&&(Qs(S,""),s.flags&=-33);var j=Qu(e);lr(e,j,S);break;case 3:case 4:var R=s.stateNode.containerInfo,H=Qu(e);Wu(e,H,R);break;default:throw Error(l(161))}}catch(K){Qe(e,e.return,K)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function xv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;xv(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ma(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)mv(e,t.alternate,t),t=t.sibling}function ws(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Pa(4,t,t.return),ws(t);break;case 1:Yn(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&cv(t,t.return,s),ws(t);break;case 27:Bo(t.stateNode);case 26:case 5:Yn(t,t.return),ws(t);break;case 22:t.memoizedState===null&&ws(t);break;case 30:ws(t);break;default:ws(t)}e=e.sibling}}function pa(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var o=t.alternate,u=e,h=t,S=h.flags;switch(h.tag){case 0:case 11:case 15:pa(u,h,s),jo(4,h);break;case 1:if(pa(u,h,s),o=h,u=o.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(H){Qe(o,o.return,H)}if(o=h,u=o.updateQueue,u!==null){var j=o.stateNode;try{var R=u.shared.hiddenCallbacks;if(R!==null)for(u.shared.hiddenCallbacks=null,u=0;u<R.length;u++)Qm(R[u],j)}catch(H){Qe(o,o.return,H)}}s&&S&64&&rv(h),wo(h,h.return);break;case 27:fv(h);case 26:case 5:pa(u,h,s),s&&o===null&&S&4&&uv(h),wo(h,h.return);break;case 12:pa(u,h,s);break;case 31:pa(u,h,s),s&&S&4&&gv(u,h);break;case 13:pa(u,h,s),s&&S&4&&yv(u,h);break;case 22:h.memoizedState===null&&pa(u,h,s),wo(h,h.return);break;case 30:break;default:pa(u,h,s)}t=t.sibling}}function ed(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&fo(s))}function td(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&fo(e))}function Un(e,t,s,o){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Sv(e,t,s,o),t=t.sibling}function Sv(e,t,s,o){var u=t.flags;switch(t.tag){case 0:case 11:case 15:Un(e,t,s,o),u&2048&&jo(9,t);break;case 1:Un(e,t,s,o);break;case 3:Un(e,t,s,o),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&fo(e)));break;case 12:if(u&2048){Un(e,t,s,o),e=t.stateNode;try{var h=t.memoizedProps,S=h.id,j=h.onPostCommit;typeof j=="function"&&j(S,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(R){Qe(t,t.return,R)}}else Un(e,t,s,o);break;case 31:Un(e,t,s,o);break;case 13:Un(e,t,s,o);break;case 23:break;case 22:h=t.stateNode,S=t.alternate,t.memoizedState!==null?h._visibility&2?Un(e,t,s,o):No(e,t):h._visibility&2?Un(e,t,s,o):(h._visibility|=2,gi(e,t,s,o,(t.subtreeFlags&10256)!==0||!1)),u&2048&&ed(S,t);break;case 24:Un(e,t,s,o),u&2048&&td(t.alternate,t);break;default:Un(e,t,s,o)}}function gi(e,t,s,o,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var h=e,S=t,j=s,R=o,H=S.flags;switch(S.tag){case 0:case 11:case 15:gi(h,S,j,R,u),jo(8,S);break;case 23:break;case 22:var K=S.stateNode;S.memoizedState!==null?K._visibility&2?gi(h,S,j,R,u):No(h,S):(K._visibility|=2,gi(h,S,j,R,u)),u&&H&2048&&ed(S.alternate,S);break;case 24:gi(h,S,j,R,u),u&&H&2048&&td(S.alternate,S);break;default:gi(h,S,j,R,u)}t=t.sibling}}function No(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,o=t,u=o.flags;switch(o.tag){case 22:No(s,o),u&2048&&ed(o.alternate,o);break;case 24:No(s,o),u&2048&&td(o.alternate,o);break;default:No(s,o)}t=t.sibling}}var Co=8192;function yi(e,t,s){if(e.subtreeFlags&Co)for(e=e.child;e!==null;)_v(e,t,s),e=e.sibling}function _v(e,t,s){switch(e.tag){case 26:yi(e,t,s),e.flags&Co&&e.memoizedState!==null&&m1(s,zn,e.memoizedState,e.memoizedProps);break;case 5:yi(e,t,s);break;case 3:case 4:var o=zn;zn=_r(e.stateNode.containerInfo),yi(e,t,s),zn=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=Co,Co=16777216,yi(e,t,s),Co=o):yi(e,t,s));break;default:yi(e,t,s)}}function Tv(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Eo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var o=t[s];It=o,jv(o,e)}Tv(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)kv(e),e=e.sibling}function kv(e){switch(e.tag){case 0:case 11:case 15:Eo(e),e.flags&2048&&Pa(9,e,e.return);break;case 3:Eo(e);break;case 12:Eo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,cr(e)):Eo(e);break;default:Eo(e)}}function cr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var o=t[s];It=o,jv(o,e)}Tv(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Pa(8,t,t.return),cr(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,cr(t));break;default:cr(t)}e=e.sibling}}function jv(e,t){for(;It!==null;){var s=It;switch(s.tag){case 0:case 11:case 15:Pa(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var o=s.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:fo(s.memoizedState.cache)}if(o=s.child,o!==null)o.return=s,It=o;else e:for(s=e;It!==null;){o=It;var u=o.sibling,h=o.return;if(pv(o),o===s){It=null;break e}if(u!==null){u.return=h,It=u;break e}It=h}}}var E_={getCacheForType:function(e){var t=Ht(kt),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Ht(kt).controller.signal}},A_=typeof WeakMap=="function"?WeakMap:Map,Fe=0,at=null,Re=null,Oe=0,Xe=0,fn=null,Ga=!1,bi=!1,nd=!1,va=0,yt=0,$a=0,Ns=0,ad=0,hn=0,xi=0,Ao=null,an=null,sd=!1,ur=0,wv=0,dr=1/0,fr=null,qa=null,Rt=0,Ka=null,Si=null,ga=0,id=0,od=null,Nv=null,Do=0,ld=null;function mn(){return(Fe&2)!==0&&Oe!==0?Oe&-Oe:O.T!==null?hd():Gh()}function Cv(){if(hn===0)if((Oe&536870912)===0||ze){var e=Aa;Aa<<=1,(Aa&3932160)===0&&(Aa=262144),hn=e}else hn=536870912;return e=un.current,e!==null&&(e.flags|=32),hn}function sn(e,t,s){(e===at&&(Xe===2||Xe===9)||e.cancelPendingCommit!==null)&&(_i(e,0),Ya(e,Oe,hn,!1)),Qi(e,s),((Fe&2)===0||e!==at)&&(e===at&&((Fe&2)===0&&(Ns|=s),yt===4&&Ya(e,Oe,hn,!1)),Fn(e))}function Ev(e,t,s){if((Fe&6)!==0)throw Error(l(327));var o=!s&&(t&127)===0&&(t&e.expiredLanes)===0||Xi(e,t),u=o?M_(e,t):cd(e,t,!0),h=o;do{if(u===0){bi&&!o&&Ya(e,t,0,!1);break}else{if(s=e.current.alternate,h&&!D_(s)){u=cd(e,t,!1),h=!1;continue}if(u===2){if(h=t,e.errorRecoveryDisabledLanes&h)var S=0;else S=e.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){t=S;e:{var j=e;u=Ao;var R=j.current.memoizedState.isDehydrated;if(R&&(_i(j,S).flags|=256),S=cd(j,S,!1),S!==2){if(nd&&!R){j.errorRecoveryDisabledLanes|=h,Ns|=h,u=4;break e}h=an,an=u,h!==null&&(an===null?an=h:an.push.apply(an,h))}u=S}if(h=!1,u!==2)continue}}if(u===1){_i(e,0),Ya(e,t,0,!0);break}e:{switch(o=e,h=u,h){case 0:case 1:throw Error(l(345));case 4:if((t&4194048)!==t)break;case 6:Ya(o,t,hn,!Ga);break e;case 2:an=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(u=ur+300-Kt(),10<u)){if(Ya(o,t,hn,!Ga),_l(o,0,!0)!==0)break e;ga=t,o.timeoutHandle=og(Av.bind(null,o,s,an,fr,sd,t,hn,Ns,xi,Ga,h,"Throttled",-0,0),u);break e}Av(o,s,an,fr,sd,t,hn,Ns,xi,Ga,h,null,-0,0)}}break}while(!0);Fn(e)}function Av(e,t,s,o,u,h,S,j,R,H,K,Q,G,$){if(e.timeoutHandle=-1,Q=t.subtreeFlags,Q&8192||(Q&16785408)===16785408){Q={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:na},_v(t,h,Q);var he=(h&62914560)===h?ur-Kt():(h&4194048)===h?wv-Kt():0;if(he=p1(Q,he),he!==null){ga=h,e.cancelPendingCommit=he(zv.bind(null,e,t,h,s,o,u,S,j,R,K,Q,null,G,$)),Ya(e,h,S,!H);return}}zv(e,t,h,s,o,u,S,j,R)}function D_(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var o=0;o<s.length;o++){var u=s[o],h=u.getSnapshot;u=u.value;try{if(!rn(h(),u))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ya(e,t,s,o){t&=~ad,t&=~Ns,e.suspendedLanes|=t,e.pingedLanes&=~t,o&&(e.warmLanes|=t),o=e.expirationTimes;for(var u=t;0<u;){var h=31-Ye(u),S=1<<h;o[h]=-1,u&=~S}s!==0&&Vh(e,s,t)}function hr(){return(Fe&6)===0?(Ro(0),!1):!0}function rd(){if(Re!==null){if(Xe===0)var e=Re.return;else e=Re,oa=ys=null,ku(e),fi=null,mo=0,e=Re;for(;e!==null;)lv(e.alternate,e),e=e.return;Re=null}}function _i(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,Q_(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),ga=0,rd(),at=e,Re=s=sa(e.current,null),Oe=t,Xe=0,fn=null,Ga=!1,bi=Xi(e,t),nd=!1,xi=hn=ad=Ns=$a=yt=0,an=Ao=null,sd=!1,(t&8)!==0&&(t|=t&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=t;0<o;){var u=31-Ye(o),h=1<<u;t|=e[u],o&=~h}return va=t,Ol(),s}function Dv(e,t){Ne=null,O.H=_o,t===di||t===Pl?(t=Ym(),Xe=3):t===fu?(t=Ym(),Xe=4):Xe=t===Vu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,fn=t,Re===null&&(yt=1,nr(e,Tn(t,e.current)))}function Rv(){var e=un.current;return e===null?!0:(Oe&4194048)===Oe?Nn===null:(Oe&62914560)===Oe||(Oe&536870912)!==0?e===Nn:!1}function Mv(){var e=O.H;return O.H=_o,e===null?_o:e}function Ov(){var e=O.A;return O.A=E_,e}function mr(){yt=4,Ga||(Oe&4194048)!==Oe&&un.current!==null||(bi=!0),($a&134217727)===0&&(Ns&134217727)===0||at===null||Ya(at,Oe,hn,!1)}function cd(e,t,s){var o=Fe;Fe|=2;var u=Mv(),h=Ov();(at!==e||Oe!==t)&&(fr=null,_i(e,t)),t=!1;var S=yt;e:do try{if(Xe!==0&&Re!==null){var j=Re,R=fn;switch(Xe){case 8:rd(),S=6;break e;case 3:case 2:case 9:case 6:un.current===null&&(t=!0);var H=Xe;if(Xe=0,fn=null,Ti(e,j,R,H),s&&bi){S=0;break e}break;default:H=Xe,Xe=0,fn=null,Ti(e,j,R,H)}}R_(),S=yt;break}catch(K){Dv(e,K)}while(!0);return t&&e.shellSuspendCounter++,oa=ys=null,Fe=o,O.H=u,O.A=h,Re===null&&(at=null,Oe=0,Ol()),S}function R_(){for(;Re!==null;)Bv(Re)}function M_(e,t){var s=Fe;Fe|=2;var o=Mv(),u=Ov();at!==e||Oe!==t?(fr=null,dr=Kt()+500,_i(e,t)):bi=Xi(e,t);e:do try{if(Xe!==0&&Re!==null){t=Re;var h=fn;t:switch(Xe){case 1:Xe=0,fn=null,Ti(e,t,h,1);break;case 2:case 9:if(qm(h)){Xe=0,fn=null,Lv(t);break}t=function(){Xe!==2&&Xe!==9||at!==e||(Xe=7),Fn(e)},h.then(t,t);break e;case 3:Xe=7;break e;case 4:Xe=5;break e;case 7:qm(h)?(Xe=0,fn=null,Lv(t)):(Xe=0,fn=null,Ti(e,t,h,7));break;case 5:var S=null;switch(Re.tag){case 26:S=Re.memoizedState;case 5:case 27:var j=Re;if(S?Sg(S):j.stateNode.complete){Xe=0,fn=null;var R=j.sibling;if(R!==null)Re=R;else{var H=j.return;H!==null?(Re=H,pr(H)):Re=null}break t}}Xe=0,fn=null,Ti(e,t,h,5);break;case 6:Xe=0,fn=null,Ti(e,t,h,6);break;case 8:rd(),yt=6;break e;default:throw Error(l(462))}}O_();break}catch(K){Dv(e,K)}while(!0);return oa=ys=null,O.H=o,O.A=u,Fe=s,Re!==null?0:(at=null,Oe=0,Ol(),yt)}function O_(){for(;Re!==null&&!Ee();)Bv(Re)}function Bv(e){var t=iv(e.alternate,e,va);e.memoizedProps=e.pendingProps,t===null?pr(e):Re=t}function Lv(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=Jp(s,t,t.pendingProps,t.type,void 0,Oe);break;case 11:t=Jp(s,t,t.pendingProps,t.type.render,t.ref,Oe);break;case 5:ku(t);default:lv(s,t),t=Re=Om(t,va),t=iv(s,t,va)}e.memoizedProps=e.pendingProps,t===null?pr(e):Re=t}function Ti(e,t,s,o){oa=ys=null,ku(t),fi=null,mo=0;var u=t.return;try{if(__(e,u,t,s,Oe)){yt=1,nr(e,Tn(s,e.current)),Re=null;return}}catch(h){if(u!==null)throw Re=u,h;yt=1,nr(e,Tn(s,e.current)),Re=null;return}t.flags&32768?(ze||o===1?e=!0:bi||(Oe&536870912)!==0?e=!1:(Ga=e=!0,(o===2||o===9||o===3||o===6)&&(o=un.current,o!==null&&o.tag===13&&(o.flags|=16384))),Iv(t,e)):pr(t)}function pr(e){var t=e;do{if((t.flags&32768)!==0){Iv(t,Ga);return}e=t.return;var s=j_(t.alternate,t,va);if(s!==null){Re=s;return}if(t=t.sibling,t!==null){Re=t;return}Re=t=e}while(t!==null);yt===0&&(yt=5)}function Iv(e,t){do{var s=w_(e.alternate,e);if(s!==null){s.flags&=32767,Re=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){Re=e;return}Re=e=s}while(e!==null);yt=6,Re=null}function zv(e,t,s,o,u,h,S,j,R){e.cancelPendingCommit=null;do vr();while(Rt!==0);if((Fe&6)!==0)throw Error(l(327));if(t!==null){if(t===e.current)throw Error(l(177));if(h=t.lanes|t.childLanes,h|=Qc,hS(e,s,h,S,j,R),e===at&&(Re=at=null,Oe=0),Si=t,Ka=e,ga=s,id=h,od=u,Nv=o,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,z_(ne,function(){return Gv(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||o){o=O.T,O.T=null,u=P.p,P.p=2,S=Fe,Fe|=4;try{N_(e,t,s)}finally{Fe=S,P.p=u,O.T=o}}Rt=1,Uv(),Vv(),Hv()}}function Uv(){if(Rt===1){Rt=0;var e=Ka,t=Si,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=O.T,O.T=null;var o=P.p;P.p=2;var u=Fe;Fe|=4;try{bv(t,e);var h=Sd,S=jm(e.containerInfo),j=h.focusedElem,R=h.selectionRange;if(S!==j&&j&&j.ownerDocument&&km(j.ownerDocument.documentElement,j)){if(R!==null&&Kc(j)){var H=R.start,K=R.end;if(K===void 0&&(K=H),"selectionStart"in j)j.selectionStart=H,j.selectionEnd=Math.min(K,j.value.length);else{var Q=j.ownerDocument||document,G=Q&&Q.defaultView||window;if(G.getSelection){var $=G.getSelection(),he=j.textContent.length,ye=Math.min(R.start,he),et=R.end===void 0?ye:Math.min(R.end,he);!$.extend&&ye>et&&(S=et,et=ye,ye=S);var B=Tm(j,ye),M=Tm(j,et);if(B&&M&&($.rangeCount!==1||$.anchorNode!==B.node||$.anchorOffset!==B.offset||$.focusNode!==M.node||$.focusOffset!==M.offset)){var V=Q.createRange();V.setStart(B.node,B.offset),$.removeAllRanges(),ye>et?($.addRange(V),$.extend(M.node,M.offset)):(V.setEnd(M.node,M.offset),$.addRange(V))}}}}for(Q=[],$=j;$=$.parentNode;)$.nodeType===1&&Q.push({element:$,left:$.scrollLeft,top:$.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<Q.length;j++){var Z=Q[j];Z.element.scrollLeft=Z.left,Z.element.scrollTop=Z.top}}Cr=!!xd,Sd=xd=null}finally{Fe=u,P.p=o,O.T=s}}e.current=t,Rt=2}}function Vv(){if(Rt===2){Rt=0;var e=Ka,t=Si,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=O.T,O.T=null;var o=P.p;P.p=2;var u=Fe;Fe|=4;try{mv(e,t.alternate,t)}finally{Fe=u,P.p=o,O.T=s}}Rt=3}}function Hv(){if(Rt===4||Rt===3){Rt=0,Dt();var e=Ka,t=Si,s=ga,o=Nv;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Rt=5:(Rt=0,Si=Ka=null,Pv(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(qa=null),Nc(s),t=t.stateNode,He&&typeof He.onCommitFiberRoot=="function")try{He.onCommitFiberRoot(we,t,void 0,(t.current.flags&128)===128)}catch{}if(o!==null){t=O.T,u=P.p,P.p=2,O.T=null;try{for(var h=e.onRecoverableError,S=0;S<o.length;S++){var j=o[S];h(j.value,{componentStack:j.stack})}}finally{O.T=t,P.p=u}}(ga&3)!==0&&vr(),Fn(e),u=e.pendingLanes,(s&261930)!==0&&(u&42)!==0?e===ld?Do++:(Do=0,ld=e):Do=0,Ro(0)}}function Pv(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,fo(t)))}function vr(){return Uv(),Vv(),Hv(),Gv()}function Gv(){if(Rt!==5)return!1;var e=Ka,t=id;id=0;var s=Nc(ga),o=O.T,u=P.p;try{P.p=32>s?32:s,O.T=null,s=od,od=null;var h=Ka,S=ga;if(Rt=0,Si=Ka=null,ga=0,(Fe&6)!==0)throw Error(l(331));var j=Fe;if(Fe|=4,kv(h.current),Sv(h,h.current,S,s),Fe=j,Ro(0,!1),He&&typeof He.onPostCommitFiberRoot=="function")try{He.onPostCommitFiberRoot(we,h)}catch{}return!0}finally{P.p=u,O.T=o,Pv(e,t)}}function $v(e,t,s){t=Tn(s,t),t=Uu(e.stateNode,t,2),e=Ua(e,t,2),e!==null&&(Qi(e,2),Fn(e))}function Qe(e,t,s){if(e.tag===3)$v(e,e,s);else for(;t!==null;){if(t.tag===3){$v(t,e,s);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(qa===null||!qa.has(o))){e=Tn(s,e),s=qp(2),o=Ua(t,s,2),o!==null&&(Kp(s,o,t,e),Qi(o,2),Fn(o));break}}t=t.return}}function ud(e,t,s){var o=e.pingCache;if(o===null){o=e.pingCache=new A_;var u=new Set;o.set(t,u)}else u=o.get(t),u===void 0&&(u=new Set,o.set(t,u));u.has(s)||(nd=!0,u.add(s),e=B_.bind(null,e,t,s),t.then(e,e))}function B_(e,t,s){var o=e.pingCache;o!==null&&o.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,at===e&&(Oe&s)===s&&(yt===4||yt===3&&(Oe&62914560)===Oe&&300>Kt()-ur?(Fe&2)===0&&_i(e,0):ad|=s,xi===Oe&&(xi=0)),Fn(e)}function qv(e,t){t===0&&(t=Uh()),e=ps(e,t),e!==null&&(Qi(e,t),Fn(e))}function L_(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),qv(e,s)}function I_(e,t){var s=0;switch(e.tag){case 31:case 13:var o=e.stateNode,u=e.memoizedState;u!==null&&(s=u.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(l(314))}o!==null&&o.delete(t),qv(e,s)}function z_(e,t){return Ea(e,t)}var gr=null,ki=null,dd=!1,yr=!1,fd=!1,Fa=0;function Fn(e){e!==ki&&e.next===null&&(ki===null?gr=ki=e:ki=ki.next=e),yr=!0,dd||(dd=!0,V_())}function Ro(e,t){if(!fd&&yr){fd=!0;do for(var s=!1,o=gr;o!==null;){if(e!==0){var u=o.pendingLanes;if(u===0)var h=0;else{var S=o.suspendedLanes,j=o.pingedLanes;h=(1<<31-Ye(42|e)+1)-1,h&=u&~(S&~j),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(s=!0,Zv(o,h))}else h=Oe,h=_l(o,o===at?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||Xi(o,h)||(s=!0,Zv(o,h));o=o.next}while(s);fd=!1}}function U_(){Kv()}function Kv(){yr=dd=!1;var e=0;Fa!==0&&X_()&&(e=Fa);for(var t=Kt(),s=null,o=gr;o!==null;){var u=o.next,h=Yv(o,t);h===0?(o.next=null,s===null?gr=u:s.next=u,u===null&&(ki=s)):(s=o,(e!==0||(h&3)!==0)&&(yr=!0)),o=u}Rt!==0&&Rt!==5||Ro(e),Fa!==0&&(Fa=0)}function Yv(e,t){for(var s=e.suspendedLanes,o=e.pingedLanes,u=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var S=31-Ye(h),j=1<<S,R=u[S];R===-1?((j&s)===0||(j&o)!==0)&&(u[S]=fS(j,t)):R<=t&&(e.expiredLanes|=j),h&=~j}if(t=at,s=Oe,s=_l(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,s===0||e===t&&(Xe===2||Xe===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&ln(o),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Xi(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(o!==null&&ln(o),Nc(s)){case 2:case 8:s=F;break;case 32:s=ne;break;case 268435456:s=Te;break;default:s=ne}return o=Fv.bind(null,e),s=Ea(s,o),e.callbackPriority=t,e.callbackNode=s,t}return o!==null&&o!==null&&ln(o),e.callbackPriority=2,e.callbackNode=null,2}function Fv(e,t){if(Rt!==0&&Rt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(vr()&&e.callbackNode!==s)return null;var o=Oe;return o=_l(e,e===at?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(Ev(e,o,t),Yv(e,Kt()),e.callbackNode!=null&&e.callbackNode===s?Fv.bind(null,e):null)}function Zv(e,t){if(vr())return null;Ev(e,t,!0)}function V_(){W_(function(){(Fe&6)!==0?Ea(Sl,U_):Kv()})}function hd(){if(Fa===0){var e=ci;e===0&&(e=vt,vt<<=1,(vt&261888)===0&&(vt=256)),Fa=e}return Fa}function Xv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:wl(""+e)}function Qv(e,t){var s=t.ownerDocument.createElement("input");return s.name=t.name,s.value=t.value,e.id&&s.setAttribute("form",e.id),t.parentNode.insertBefore(s,t),e=new FormData(e),s.parentNode.removeChild(s),e}function H_(e,t,s,o,u){if(t==="submit"&&s&&s.stateNode===u){var h=Xv((u[Wt]||null).action),S=o.submitter;S&&(t=(t=S[Wt]||null)?Xv(t.formAction):S.getAttribute("formAction"),t!==null&&(h=t,S=null));var j=new Al("action","action",null,o,u);e.push({event:j,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(Fa!==0){var R=S?Qv(u,S):new FormData(u);Mu(s,{pending:!0,data:R,method:u.method,action:h},null,R)}}else typeof h=="function"&&(j.preventDefault(),R=S?Qv(u,S):new FormData(u),Mu(s,{pending:!0,data:R,method:u.method,action:h},h,R))},currentTarget:u}]})}}for(var md=0;md<Xc.length;md++){var pd=Xc[md],P_=pd.toLowerCase(),G_=pd[0].toUpperCase()+pd.slice(1);In(P_,"on"+G_)}In(Cm,"onAnimationEnd"),In(Em,"onAnimationIteration"),In(Am,"onAnimationStart"),In("dblclick","onDoubleClick"),In("focusin","onFocus"),In("focusout","onBlur"),In(i_,"onTransitionRun"),In(o_,"onTransitionStart"),In(l_,"onTransitionCancel"),In(Dm,"onTransitionEnd"),Zs("onMouseEnter",["mouseout","mouseover"]),Zs("onMouseLeave",["mouseout","mouseover"]),Zs("onPointerEnter",["pointerout","pointerover"]),Zs("onPointerLeave",["pointerout","pointerover"]),ds("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ds("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ds("onBeforeInput",["compositionend","keypress","textInput","paste"]),ds("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ds("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ds("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Mo="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(" "),$_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Mo));function Wv(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var o=e[s],u=o.event;o=o.listeners;e:{var h=void 0;if(t)for(var S=o.length-1;0<=S;S--){var j=o[S],R=j.instance,H=j.currentTarget;if(j=j.listener,R!==h&&u.isPropagationStopped())break e;h=j,u.currentTarget=H;try{h(u)}catch(K){Ml(K)}u.currentTarget=null,h=R}else for(S=0;S<o.length;S++){if(j=o[S],R=j.instance,H=j.currentTarget,j=j.listener,R!==h&&u.isPropagationStopped())break e;h=j,u.currentTarget=H;try{h(u)}catch(K){Ml(K)}u.currentTarget=null,h=R}}}}function Me(e,t){var s=t[Cc];s===void 0&&(s=t[Cc]=new Set);var o=e+"__bubble";s.has(o)||(Jv(t,e,2,!1),s.add(o))}function vd(e,t,s){var o=0;t&&(o|=4),Jv(s,e,o,t)}var br="_reactListening"+Math.random().toString(36).slice(2);function gd(e){if(!e[br]){e[br]=!0,Kh.forEach(function(s){s!=="selectionchange"&&($_.has(s)||vd(s,!1,e),vd(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[br]||(t[br]=!0,vd("selectionchange",!1,t))}}function Jv(e,t,s,o){switch(Cg(t)){case 2:var u=y1;break;case 8:u=b1;break;default:u=Rd}s=u.bind(null,t,s,e),u=void 0,!Ic||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),o?u!==void 0?e.addEventListener(t,s,{capture:!0,passive:u}):e.addEventListener(t,s,!0):u!==void 0?e.addEventListener(t,s,{passive:u}):e.addEventListener(t,s,!1)}function yd(e,t,s,o,u){var h=o;if((t&1)===0&&(t&2)===0&&o!==null)e:for(;;){if(o===null)return;var S=o.tag;if(S===3||S===4){var j=o.stateNode.containerInfo;if(j===u)break;if(S===4)for(S=o.return;S!==null;){var R=S.tag;if((R===3||R===4)&&S.stateNode.containerInfo===u)return;S=S.return}for(;j!==null;){if(S=Ks(j),S===null)return;if(R=S.tag,R===5||R===6||R===26||R===27){o=h=S;continue e}j=j.parentNode}}o=o.return}sm(function(){var H=h,K=Bc(s),Q=[];e:{var G=Rm.get(e);if(G!==void 0){var $=Al,he=e;switch(e){case"keypress":if(Cl(s)===0)break e;case"keydown":case"keyup":$=IS;break;case"focusin":he="focus",$=Hc;break;case"focusout":he="blur",$=Hc;break;case"beforeblur":case"afterblur":$=Hc;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":$=lm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":$=jS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":$=VS;break;case Cm:case Em:case Am:$=CS;break;case Dm:$=PS;break;case"scroll":case"scrollend":$=TS;break;case"wheel":$=$S;break;case"copy":case"cut":case"paste":$=AS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":$=cm;break;case"toggle":case"beforetoggle":$=KS}var ye=(t&4)!==0,et=!ye&&(e==="scroll"||e==="scrollend"),B=ye?G!==null?G+"Capture":null:G;ye=[];for(var M=H,V;M!==null;){var Z=M;if(V=Z.stateNode,Z=Z.tag,Z!==5&&Z!==26&&Z!==27||V===null||B===null||(Z=eo(M,B),Z!=null&&ye.push(Oo(M,Z,V))),et)break;M=M.return}0<ye.length&&(G=new $(G,he,null,s,K),Q.push({event:G,listeners:ye}))}}if((t&7)===0){e:{if(G=e==="mouseover"||e==="pointerover",$=e==="mouseout"||e==="pointerout",G&&s!==Oc&&(he=s.relatedTarget||s.fromElement)&&(Ks(he)||he[qs]))break e;if(($||G)&&(G=K.window===K?K:(G=K.ownerDocument)?G.defaultView||G.parentWindow:window,$?(he=s.relatedTarget||s.toElement,$=H,he=he?Ks(he):null,he!==null&&(et=d(he),ye=he.tag,he!==et||ye!==5&&ye!==27&&ye!==6)&&(he=null)):($=null,he=H),$!==he)){if(ye=lm,Z="onMouseLeave",B="onMouseEnter",M="mouse",(e==="pointerout"||e==="pointerover")&&(ye=cm,Z="onPointerLeave",B="onPointerEnter",M="pointer"),et=$==null?G:Ji($),V=he==null?G:Ji(he),G=new ye(Z,M+"leave",$,s,K),G.target=et,G.relatedTarget=V,Z=null,Ks(K)===H&&(ye=new ye(B,M+"enter",he,s,K),ye.target=V,ye.relatedTarget=et,Z=ye),et=Z,$&&he)t:{for(ye=q_,B=$,M=he,V=0,Z=B;Z;Z=ye(Z))V++;Z=0;for(var ve=M;ve;ve=ye(ve))Z++;for(;0<V-Z;)B=ye(B),V--;for(;0<Z-V;)M=ye(M),Z--;for(;V--;){if(B===M||M!==null&&B===M.alternate){ye=B;break t}B=ye(B),M=ye(M)}ye=null}else ye=null;$!==null&&eg(Q,G,$,ye,!1),he!==null&&et!==null&&eg(Q,et,he,ye,!0)}}e:{if(G=H?Ji(H):window,$=G.nodeName&&G.nodeName.toLowerCase(),$==="select"||$==="input"&&G.type==="file")var Ge=gm;else if(pm(G))if(ym)Ge=n_;else{Ge=e_;var pe=JS}else $=G.nodeName,!$||$.toLowerCase()!=="input"||G.type!=="checkbox"&&G.type!=="radio"?H&&Mc(H.elementType)&&(Ge=gm):Ge=t_;if(Ge&&(Ge=Ge(e,H))){vm(Q,Ge,s,K);break e}pe&&pe(e,G,H),e==="focusout"&&H&&G.type==="number"&&H.memoizedProps.value!=null&&Rc(G,"number",G.value)}switch(pe=H?Ji(H):window,e){case"focusin":(pm(pe)||pe.contentEditable==="true")&&(ti=pe,Yc=H,ro=null);break;case"focusout":ro=Yc=ti=null;break;case"mousedown":Fc=!0;break;case"contextmenu":case"mouseup":case"dragend":Fc=!1,wm(Q,s,K);break;case"selectionchange":if(s_)break;case"keydown":case"keyup":wm(Q,s,K)}var Ae;if(Gc)e:{switch(e){case"compositionstart":var Be="onCompositionStart";break e;case"compositionend":Be="onCompositionEnd";break e;case"compositionupdate":Be="onCompositionUpdate";break e}Be=void 0}else ei?hm(e,s)&&(Be="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Be="onCompositionStart");Be&&(um&&s.locale!=="ko"&&(ei||Be!=="onCompositionStart"?Be==="onCompositionEnd"&&ei&&(Ae=im()):(Ra=K,zc="value"in Ra?Ra.value:Ra.textContent,ei=!0)),pe=xr(H,Be),0<pe.length&&(Be=new rm(Be,e,null,s,K),Q.push({event:Be,listeners:pe}),Ae?Be.data=Ae:(Ae=mm(s),Ae!==null&&(Be.data=Ae)))),(Ae=FS?ZS(e,s):XS(e,s))&&(Be=xr(H,"onBeforeInput"),0<Be.length&&(pe=new rm("onBeforeInput","beforeinput",null,s,K),Q.push({event:pe,listeners:Be}),pe.data=Ae)),H_(Q,e,H,s,K)}Wv(Q,t)})}function Oo(e,t,s){return{instance:e,listener:t,currentTarget:s}}function xr(e,t){for(var s=t+"Capture",o=[];e!==null;){var u=e,h=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||h===null||(u=eo(e,s),u!=null&&o.unshift(Oo(e,u,h)),u=eo(e,t),u!=null&&o.push(Oo(e,u,h))),e.tag===3)return o;e=e.return}return[]}function q_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function eg(e,t,s,o,u){for(var h=t._reactName,S=[];s!==null&&s!==o;){var j=s,R=j.alternate,H=j.stateNode;if(j=j.tag,R!==null&&R===o)break;j!==5&&j!==26&&j!==27||H===null||(R=H,u?(H=eo(s,h),H!=null&&S.unshift(Oo(s,H,R))):u||(H=eo(s,h),H!=null&&S.push(Oo(s,H,R)))),s=s.return}S.length!==0&&e.push({event:t,listeners:S})}var K_=/\r\n?/g,Y_=/\u0000|\uFFFD/g;function tg(e){return(typeof e=="string"?e:""+e).replace(K_,`
|
|
26
|
+
`).replace(Y_,"")}function ng(e,t){return t=tg(t),tg(e)===t}function Je(e,t,s,o,u,h){switch(s){case"children":typeof o=="string"?t==="body"||t==="textarea"&&o===""||Qs(e,o):(typeof o=="number"||typeof o=="bigint")&&t!=="body"&&Qs(e,""+o);break;case"className":kl(e,"class",o);break;case"tabIndex":kl(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":kl(e,s,o);break;case"style":nm(e,o,h);break;case"data":if(t!=="object"){kl(e,"data",o);break}case"src":case"href":if(o===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(s);break}o=wl(""+o),e.setAttribute(s,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(s==="formAction"?(t!=="input"&&Je(e,t,"name",u.name,u,null),Je(e,t,"formEncType",u.formEncType,u,null),Je(e,t,"formMethod",u.formMethod,u,null),Je(e,t,"formTarget",u.formTarget,u,null)):(Je(e,t,"encType",u.encType,u,null),Je(e,t,"method",u.method,u,null),Je(e,t,"target",u.target,u,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(s);break}o=wl(""+o),e.setAttribute(s,o);break;case"onClick":o!=null&&(e.onclick=na);break;case"onScroll":o!=null&&Me("scroll",e);break;case"onScrollEnd":o!=null&&Me("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(l(61));if(s=o.__html,s!=null){if(u.children!=null)throw Error(l(60));e.innerHTML=s}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}s=wl(""+o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,""+o):e.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":o===!0?e.setAttribute(s,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,o):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(s,o):e.removeAttribute(s);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(s):e.setAttribute(s,o);break;case"popover":Me("beforetoggle",e),Me("toggle",e),Tl(e,"popover",o);break;case"xlinkActuate":ta(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":ta(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":ta(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":ta(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":ta(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":ta(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":ta(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":ta(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":ta(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Tl(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=SS.get(s)||s,Tl(e,s,o))}}function bd(e,t,s,o,u,h){switch(s){case"style":nm(e,o,h);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(l(61));if(s=o.__html,s!=null){if(u.children!=null)throw Error(l(60));e.innerHTML=s}}break;case"children":typeof o=="string"?Qs(e,o):(typeof o=="number"||typeof o=="bigint")&&Qs(e,""+o);break;case"onScroll":o!=null&&Me("scroll",e);break;case"onScrollEnd":o!=null&&Me("scrollend",e);break;case"onClick":o!=null&&(e.onclick=na);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Yh.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(u=s.endsWith("Capture"),t=s.slice(2,u?s.length-7:void 0),h=e[Wt]||null,h=h!=null?h[s]:null,typeof h=="function"&&e.removeEventListener(t,h,u),typeof o=="function")){typeof h!="function"&&h!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,o,u);break e}s in e?e[s]=o:o===!0?e.setAttribute(s,""):Tl(e,s,o)}}}function Gt(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Me("error",e),Me("load",e);var o=!1,u=!1,h;for(h in s)if(s.hasOwnProperty(h)){var S=s[h];if(S!=null)switch(h){case"src":o=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:Je(e,t,h,S,s,null)}}u&&Je(e,t,"srcSet",s.srcSet,s,null),o&&Je(e,t,"src",s.src,s,null);return;case"input":Me("invalid",e);var j=h=S=u=null,R=null,H=null;for(o in s)if(s.hasOwnProperty(o)){var K=s[o];if(K!=null)switch(o){case"name":u=K;break;case"type":S=K;break;case"checked":R=K;break;case"defaultChecked":H=K;break;case"value":h=K;break;case"defaultValue":j=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(l(137,t));break;default:Je(e,t,o,K,s,null)}}Wh(e,h,j,R,H,S,u,!1);return;case"select":Me("invalid",e),o=S=h=null;for(u in s)if(s.hasOwnProperty(u)&&(j=s[u],j!=null))switch(u){case"value":h=j;break;case"defaultValue":S=j;break;case"multiple":o=j;default:Je(e,t,u,j,s,null)}t=h,s=S,e.multiple=!!o,t!=null?Xs(e,!!o,t,!1):s!=null&&Xs(e,!!o,s,!0);return;case"textarea":Me("invalid",e),h=u=o=null;for(S in s)if(s.hasOwnProperty(S)&&(j=s[S],j!=null))switch(S){case"value":o=j;break;case"defaultValue":u=j;break;case"children":h=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(l(91));break;default:Je(e,t,S,j,s,null)}em(e,o,u,h);return;case"option":for(R in s)if(s.hasOwnProperty(R)&&(o=s[R],o!=null))switch(R){case"selected":e.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:Je(e,t,R,o,s,null)}return;case"dialog":Me("beforetoggle",e),Me("toggle",e),Me("cancel",e),Me("close",e);break;case"iframe":case"object":Me("load",e);break;case"video":case"audio":for(o=0;o<Mo.length;o++)Me(Mo[o],e);break;case"image":Me("error",e),Me("load",e);break;case"details":Me("toggle",e);break;case"embed":case"source":case"link":Me("error",e),Me("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(H in s)if(s.hasOwnProperty(H)&&(o=s[H],o!=null))switch(H){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:Je(e,t,H,o,s,null)}return;default:if(Mc(t)){for(K in s)s.hasOwnProperty(K)&&(o=s[K],o!==void 0&&bd(e,t,K,o,s,void 0));return}}for(j in s)s.hasOwnProperty(j)&&(o=s[j],o!=null&&Je(e,t,j,o,s,null))}function F_(e,t,s,o){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,h=null,S=null,j=null,R=null,H=null,K=null;for($ in s){var Q=s[$];if(s.hasOwnProperty($)&&Q!=null)switch($){case"checked":break;case"value":break;case"defaultValue":R=Q;default:o.hasOwnProperty($)||Je(e,t,$,null,o,Q)}}for(var G in o){var $=o[G];if(Q=s[G],o.hasOwnProperty(G)&&($!=null||Q!=null))switch(G){case"type":h=$;break;case"name":u=$;break;case"checked":H=$;break;case"defaultChecked":K=$;break;case"value":S=$;break;case"defaultValue":j=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(l(137,t));break;default:$!==Q&&Je(e,t,G,$,o,Q)}}Dc(e,S,j,R,H,K,h,u);return;case"select":$=S=j=G=null;for(h in s)if(R=s[h],s.hasOwnProperty(h)&&R!=null)switch(h){case"value":break;case"multiple":$=R;default:o.hasOwnProperty(h)||Je(e,t,h,null,o,R)}for(u in o)if(h=o[u],R=s[u],o.hasOwnProperty(u)&&(h!=null||R!=null))switch(u){case"value":G=h;break;case"defaultValue":j=h;break;case"multiple":S=h;default:h!==R&&Je(e,t,u,h,o,R)}t=j,s=S,o=$,G!=null?Xs(e,!!s,G,!1):!!o!=!!s&&(t!=null?Xs(e,!!s,t,!0):Xs(e,!!s,s?[]:"",!1));return;case"textarea":$=G=null;for(j in s)if(u=s[j],s.hasOwnProperty(j)&&u!=null&&!o.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:Je(e,t,j,null,o,u)}for(S in o)if(u=o[S],h=s[S],o.hasOwnProperty(S)&&(u!=null||h!=null))switch(S){case"value":G=u;break;case"defaultValue":$=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(l(91));break;default:u!==h&&Je(e,t,S,u,o,h)}Jh(e,G,$);return;case"option":for(var he in s)if(G=s[he],s.hasOwnProperty(he)&&G!=null&&!o.hasOwnProperty(he))switch(he){case"selected":e.selected=!1;break;default:Je(e,t,he,null,o,G)}for(R in o)if(G=o[R],$=s[R],o.hasOwnProperty(R)&&G!==$&&(G!=null||$!=null))switch(R){case"selected":e.selected=G&&typeof G!="function"&&typeof G!="symbol";break;default:Je(e,t,R,G,o,$)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ye in s)G=s[ye],s.hasOwnProperty(ye)&&G!=null&&!o.hasOwnProperty(ye)&&Je(e,t,ye,null,o,G);for(H in o)if(G=o[H],$=s[H],o.hasOwnProperty(H)&&G!==$&&(G!=null||$!=null))switch(H){case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(l(137,t));break;default:Je(e,t,H,G,o,$)}return;default:if(Mc(t)){for(var et in s)G=s[et],s.hasOwnProperty(et)&&G!==void 0&&!o.hasOwnProperty(et)&&bd(e,t,et,void 0,o,G);for(K in o)G=o[K],$=s[K],!o.hasOwnProperty(K)||G===$||G===void 0&&$===void 0||bd(e,t,K,G,o,$);return}}for(var B in s)G=s[B],s.hasOwnProperty(B)&&G!=null&&!o.hasOwnProperty(B)&&Je(e,t,B,null,o,G);for(Q in o)G=o[Q],$=s[Q],!o.hasOwnProperty(Q)||G===$||G==null&&$==null||Je(e,t,Q,G,o,$)}function ag(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Z_(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),o=0;o<s.length;o++){var u=s[o],h=u.transferSize,S=u.initiatorType,j=u.duration;if(h&&j&&ag(S)){for(S=0,j=u.responseEnd,o+=1;o<s.length;o++){var R=s[o],H=R.startTime;if(H>j)break;var K=R.transferSize,Q=R.initiatorType;K&&ag(Q)&&(R=R.responseEnd,S+=K*(R<j?1:(j-H)/(R-H)))}if(--o,t+=8*(h+S)/(u.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var xd=null,Sd=null;function Sr(e){return e.nodeType===9?e:e.ownerDocument}function sg(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function ig(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function _d(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Td=null;function X_(){var e=window.event;return e&&e.type==="popstate"?e===Td?!1:(Td=e,!0):(Td=null,!1)}var og=typeof setTimeout=="function"?setTimeout:void 0,Q_=typeof clearTimeout=="function"?clearTimeout:void 0,lg=typeof Promise=="function"?Promise:void 0,W_=typeof queueMicrotask=="function"?queueMicrotask:typeof lg<"u"?function(e){return lg.resolve(null).then(e).catch(J_)}:og;function J_(e){setTimeout(function(){throw e})}function Za(e){return e==="head"}function rg(e,t){var s=t,o=0;do{var u=s.nextSibling;if(e.removeChild(s),u&&u.nodeType===8)if(s=u.data,s==="/$"||s==="/&"){if(o===0){e.removeChild(u),Ci(t);return}o--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")o++;else if(s==="html")Bo(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,Bo(s);for(var h=s.firstChild;h;){var S=h.nextSibling,j=h.nodeName;h[Wi]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&h.rel.toLowerCase()==="stylesheet"||s.removeChild(h),h=S}}else s==="body"&&Bo(e.ownerDocument.body);s=u}while(s);Ci(t)}function cg(e,t){var s=e;e=0;do{var o=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),o&&o.nodeType===8)if(s=o.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=o}while(s)}function kd(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":kd(s),Ec(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function e1(e,t,s,o){for(;e.nodeType===1;){var u=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[Wi])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var h=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=Cn(e.nextSibling),e===null)break}return null}function t1(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=Cn(e.nextSibling),e===null))return null;return e}function ug(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Cn(e.nextSibling),e===null))return null;return e}function jd(e){return e.data==="$?"||e.data==="$~"}function wd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function n1(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var o=function(){t(),s.removeEventListener("DOMContentLoaded",o)};s.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function Cn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Nd=null;function dg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return Cn(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function fg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function hg(e,t,s){switch(t=Sr(s),e){case"html":if(e=t.documentElement,!e)throw Error(l(452));return e;case"head":if(e=t.head,!e)throw Error(l(453));return e;case"body":if(e=t.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function Bo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ec(e)}var En=new Map,mg=new Set;function _r(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ya=P.d;P.d={f:a1,r:s1,D:i1,C:o1,L:l1,m:r1,X:u1,S:c1,M:d1};function a1(){var e=ya.f(),t=hr();return e||t}function s1(e){var t=Ys(e);t!==null&&t.tag===5&&t.type==="form"?Dp(t):ya.r(e)}var ji=typeof document>"u"?null:document;function pg(e,t,s){var o=ji;if(o&&typeof t=="string"&&t){var u=Sn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof s=="string"&&(u+='[crossorigin="'+s+'"]'),mg.has(u)||(mg.add(u),e={rel:e,crossOrigin:s,href:t},o.querySelector(u)===null&&(t=o.createElement("link"),Gt(t,"link",e),Lt(t),o.head.appendChild(t)))}}function i1(e){ya.D(e),pg("dns-prefetch",e,null)}function o1(e,t){ya.C(e,t),pg("preconnect",e,t)}function l1(e,t,s){ya.L(e,t,s);var o=ji;if(o&&e&&t){var u='link[rel="preload"][as="'+Sn(t)+'"]';t==="image"&&s&&s.imageSrcSet?(u+='[imagesrcset="'+Sn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(u+='[imagesizes="'+Sn(s.imageSizes)+'"]')):u+='[href="'+Sn(e)+'"]';var h=u;switch(t){case"style":h=wi(e);break;case"script":h=Ni(e)}En.has(h)||(e=b({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),En.set(h,e),o.querySelector(u)!==null||t==="style"&&o.querySelector(Lo(h))||t==="script"&&o.querySelector(Io(h))||(t=o.createElement("link"),Gt(t,"link",e),Lt(t),o.head.appendChild(t)))}}function r1(e,t){ya.m(e,t);var s=ji;if(s&&e){var o=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Sn(o)+'"][href="'+Sn(e)+'"]',h=u;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Ni(e)}if(!En.has(h)&&(e=b({rel:"modulepreload",href:e},t),En.set(h,e),s.querySelector(u)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Io(h)))return}o=s.createElement("link"),Gt(o,"link",e),Lt(o),s.head.appendChild(o)}}}function c1(e,t,s){ya.S(e,t,s);var o=ji;if(o&&e){var u=Fs(o).hoistableStyles,h=wi(e);t=t||"default";var S=u.get(h);if(!S){var j={loading:0,preload:null};if(S=o.querySelector(Lo(h)))j.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},s),(s=En.get(h))&&Cd(e,s);var R=S=o.createElement("link");Lt(R),Gt(R,"link",e),R._p=new Promise(function(H,K){R.onload=H,R.onerror=K}),R.addEventListener("load",function(){j.loading|=1}),R.addEventListener("error",function(){j.loading|=2}),j.loading|=4,Tr(S,t,o)}S={type:"stylesheet",instance:S,count:1,state:j},u.set(h,S)}}}function u1(e,t){ya.X(e,t);var s=ji;if(s&&e){var o=Fs(s).hoistableScripts,u=Ni(e),h=o.get(u);h||(h=s.querySelector(Io(u)),h||(e=b({src:e,async:!0},t),(t=En.get(u))&&Ed(e,t),h=s.createElement("script"),Lt(h),Gt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(u,h))}}function d1(e,t){ya.M(e,t);var s=ji;if(s&&e){var o=Fs(s).hoistableScripts,u=Ni(e),h=o.get(u);h||(h=s.querySelector(Io(u)),h||(e=b({src:e,async:!0,type:"module"},t),(t=En.get(u))&&Ed(e,t),h=s.createElement("script"),Lt(h),Gt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(u,h))}}function vg(e,t,s,o){var u=(u=ue.current)?_r(u):null;if(!u)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=wi(s.href),s=Fs(u).hoistableStyles,o=s.get(t),o||(o={type:"style",instance:null,count:0,state:null},s.set(t,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=wi(s.href);var h=Fs(u).hoistableStyles,S=h.get(e);if(S||(u=u.ownerDocument||u,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,S),(h=u.querySelector(Lo(e)))&&!h._p&&(S.instance=h,S.state.loading=5),En.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},En.set(e,s),h||f1(u,e,s,S.state))),t&&o===null)throw Error(l(528,""));return S}if(t&&o!==null)throw Error(l(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ni(s),s=Fs(u).hoistableScripts,o=s.get(t),o||(o={type:"script",instance:null,count:0,state:null},s.set(t,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function wi(e){return'href="'+Sn(e)+'"'}function Lo(e){return'link[rel="stylesheet"]['+e+"]"}function gg(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function f1(e,t,s,o){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?o.loading=1:(t=e.createElement("link"),o.preload=t,t.addEventListener("load",function(){return o.loading|=1}),t.addEventListener("error",function(){return o.loading|=2}),Gt(t,"link",s),Lt(t),e.head.appendChild(t))}function Ni(e){return'[src="'+Sn(e)+'"]'}function Io(e){return"script[async]"+e}function yg(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var o=e.querySelector('style[data-href~="'+Sn(s.href)+'"]');if(o)return t.instance=o,Lt(o),o;var u=b({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),Lt(o),Gt(o,"style",u),Tr(o,s.precedence,e),t.instance=o;case"stylesheet":u=wi(s.href);var h=e.querySelector(Lo(u));if(h)return t.state.loading|=4,t.instance=h,Lt(h),h;o=gg(s),(u=En.get(u))&&Cd(o,u),h=(e.ownerDocument||e).createElement("link"),Lt(h);var S=h;return S._p=new Promise(function(j,R){S.onload=j,S.onerror=R}),Gt(h,"link",o),t.state.loading|=4,Tr(h,s.precedence,e),t.instance=h;case"script":return h=Ni(s.src),(u=e.querySelector(Io(h)))?(t.instance=u,Lt(u),u):(o=s,(u=En.get(h))&&(o=b({},s),Ed(o,u)),e=e.ownerDocument||e,u=e.createElement("script"),Lt(u),Gt(u,"link",o),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(l(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(o=t.instance,t.state.loading|=4,Tr(o,s.precedence,e));return t.instance}function Tr(e,t,s){for(var o=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=o.length?o[o.length-1]:null,h=u,S=0;S<o.length;S++){var j=o[S];if(j.dataset.precedence===t)h=j;else if(h!==u)break}h?h.parentNode.insertBefore(e,h.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function Cd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Ed(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var kr=null;function bg(e,t,s){if(kr===null){var o=new Map,u=kr=new Map;u.set(s,o)}else u=kr,o=u.get(s),o||(o=new Map,u.set(s,o));if(o.has(e))return o;for(o.set(e,null),s=s.getElementsByTagName(e),u=0;u<s.length;u++){var h=s[u];if(!(h[Wi]||h[Ut]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var S=h.getAttribute(t)||"";S=e+S;var j=o.get(S);j?j.push(h):o.set(S,[h])}}return o}function xg(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function h1(e,t,s){if(s===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Sg(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function m1(e,t,s,o){if(s.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var u=wi(o.href),h=t.querySelector(Lo(u));if(h){t=h._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=jr.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=h,Lt(h);return}h=t.ownerDocument||t,o=gg(o),(u=En.get(u))&&Cd(o,u),h=h.createElement("link"),Lt(h);var S=h;S._p=new Promise(function(j,R){S.onload=j,S.onerror=R}),Gt(h,"link",o),s.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=jr.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var Ad=0;function p1(e,t){return e.stylesheets&&e.count===0&&Nr(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var o=setTimeout(function(){if(e.stylesheets&&Nr(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+t);0<e.imgBytes&&Ad===0&&(Ad=62500*Z_());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Nr(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Ad?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(u)}}:null}function jr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Nr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var wr=null;function Nr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,wr=new Map,t.forEach(v1,e),wr=null,jr.call(e))}function v1(e,t){if(!(t.state.loading&4)){var s=wr.get(e);if(s)var o=s.get(null);else{s=new Map,wr.set(e,s);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<u.length;h++){var S=u[h];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(s.set(S.dataset.precedence,S),o=S)}o&&s.set(null,o)}u=t.instance,S=u.getAttribute("data-precedence"),h=s.get(S)||o,h===o&&s.set(null,u),s.set(S,u),this.count++,o=jr.bind(this),u.addEventListener("load",o),u.addEventListener("error",o),h?h.parentNode.insertBefore(u,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var zo={$$typeof:A,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function g1(e,t,s,o,u,h,S,j,R){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=jc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jc(0),this.hiddenUpdates=jc(null),this.identifierPrefix=o,this.onUncaughtError=u,this.onCaughtError=h,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function _g(e,t,s,o,u,h,S,j,R,H,K,Q){return e=new g1(e,t,s,S,R,H,K,Q,j),t=1,h===!0&&(t|=24),h=cn(3,null,null,t),e.current=h,h.stateNode=e,t=cu(),t.refCount++,e.pooledCache=t,t.refCount++,h.memoizedState={element:o,isDehydrated:s,cache:t},hu(h),e}function Tg(e){return e?(e=si,e):si}function kg(e,t,s,o,u,h){u=Tg(u),o.context===null?o.context=u:o.pendingContext=u,o=za(t),o.payload={element:s},h=h===void 0?null:h,h!==null&&(o.callback=h),s=Ua(e,o,t),s!==null&&(sn(s,e,t),vo(s,e,t))}function jg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Dd(e,t){jg(e,t),(e=e.alternate)&&jg(e,t)}function wg(e){if(e.tag===13||e.tag===31){var t=ps(e,67108864);t!==null&&sn(t,e,67108864),Dd(e,67108864)}}function Ng(e){if(e.tag===13||e.tag===31){var t=mn();t=wc(t);var s=ps(e,t);s!==null&&sn(s,e,t),Dd(e,t)}}var Cr=!0;function y1(e,t,s,o){var u=O.T;O.T=null;var h=P.p;try{P.p=2,Rd(e,t,s,o)}finally{P.p=h,O.T=u}}function b1(e,t,s,o){var u=O.T;O.T=null;var h=P.p;try{P.p=8,Rd(e,t,s,o)}finally{P.p=h,O.T=u}}function Rd(e,t,s,o){if(Cr){var u=Md(o);if(u===null)yd(e,t,o,Er,s),Eg(e,o);else if(S1(u,e,t,s,o))o.stopPropagation();else if(Eg(e,o),t&4&&-1<x1.indexOf(e)){for(;u!==null;){var h=Ys(u);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var S=Ln(h.pendingLanes);if(S!==0){var j=h;for(j.pendingLanes|=2,j.entangledLanes|=2;S;){var R=1<<31-Ye(S);j.entanglements[1]|=R,S&=~R}Fn(h),(Fe&6)===0&&(dr=Kt()+500,Ro(0))}}break;case 31:case 13:j=ps(h,2),j!==null&&sn(j,h,2),hr(),Dd(h,2)}if(h=Md(o),h===null&&yd(e,t,o,Er,s),h===u)break;u=h}u!==null&&o.stopPropagation()}else yd(e,t,o,null,s)}}function Md(e){return e=Bc(e),Od(e)}var Er=null;function Od(e){if(Er=null,e=Ks(e),e!==null){var t=d(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=f(t),e!==null)return e;e=null}else if(s===31){if(e=m(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Er=e,null}function Cg(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(xl()){case Sl:return 2;case F:return 8;case ne:case me:return 32;case Te:return 268435456;default:return 32}default:return 32}}var Bd=!1,Xa=null,Qa=null,Wa=null,Uo=new Map,Vo=new Map,Ja=[],x1="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Eg(e,t){switch(e){case"focusin":case"focusout":Xa=null;break;case"dragenter":case"dragleave":Qa=null;break;case"mouseover":case"mouseout":Wa=null;break;case"pointerover":case"pointerout":Uo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vo.delete(t.pointerId)}}function Ho(e,t,s,o,u,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:s,eventSystemFlags:o,nativeEvent:h,targetContainers:[u]},t!==null&&(t=Ys(t),t!==null&&wg(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function S1(e,t,s,o,u){switch(t){case"focusin":return Xa=Ho(Xa,e,t,s,o,u),!0;case"dragenter":return Qa=Ho(Qa,e,t,s,o,u),!0;case"mouseover":return Wa=Ho(Wa,e,t,s,o,u),!0;case"pointerover":var h=u.pointerId;return Uo.set(h,Ho(Uo.get(h)||null,e,t,s,o,u)),!0;case"gotpointercapture":return h=u.pointerId,Vo.set(h,Ho(Vo.get(h)||null,e,t,s,o,u)),!0}return!1}function Ag(e){var t=Ks(e.target);if(t!==null){var s=d(t);if(s!==null){if(t=s.tag,t===13){if(t=f(s),t!==null){e.blockedOn=t,$h(e.priority,function(){Ng(s)});return}}else if(t===31){if(t=m(s),t!==null){e.blockedOn=t,$h(e.priority,function(){Ng(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ar(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Md(e.nativeEvent);if(s===null){s=e.nativeEvent;var o=new s.constructor(s.type,s);Oc=o,s.target.dispatchEvent(o),Oc=null}else return t=Ys(s),t!==null&&wg(t),e.blockedOn=s,!1;t.shift()}return!0}function Dg(e,t,s){Ar(e)&&s.delete(t)}function _1(){Bd=!1,Xa!==null&&Ar(Xa)&&(Xa=null),Qa!==null&&Ar(Qa)&&(Qa=null),Wa!==null&&Ar(Wa)&&(Wa=null),Uo.forEach(Dg),Vo.forEach(Dg)}function Dr(e,t){e.blockedOn===t&&(e.blockedOn=null,Bd||(Bd=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,_1)))}var Rr=null;function Rg(e){Rr!==e&&(Rr=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Rr===e&&(Rr=null);for(var t=0;t<e.length;t+=3){var s=e[t],o=e[t+1],u=e[t+2];if(typeof o!="function"){if(Od(o||s)===null)continue;break}var h=Ys(s);h!==null&&(e.splice(t,3),t-=3,Mu(h,{pending:!0,data:u,method:s.method,action:o},o,u))}}))}function Ci(e){function t(R){return Dr(R,e)}Xa!==null&&Dr(Xa,e),Qa!==null&&Dr(Qa,e),Wa!==null&&Dr(Wa,e),Uo.forEach(t),Vo.forEach(t);for(var s=0;s<Ja.length;s++){var o=Ja[s];o.blockedOn===e&&(o.blockedOn=null)}for(;0<Ja.length&&(s=Ja[0],s.blockedOn===null);)Ag(s),s.blockedOn===null&&Ja.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(o=0;o<s.length;o+=3){var u=s[o],h=s[o+1],S=u[Wt]||null;if(typeof h=="function")S||Rg(s);else if(S){var j=null;if(h&&h.hasAttribute("formAction")){if(u=h,S=h[Wt]||null)j=S.formAction;else if(Od(u)!==null)continue}else j=S.action;typeof j=="function"?s[o+1]=j:(s.splice(o,3),o-=3),Rg(s)}}}function Mg(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(S){return u=S})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),o||setTimeout(s,20)}function s(){if(!o&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function Ld(e){this._internalRoot=e}Mr.prototype.render=Ld.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));var s=t.current,o=mn();kg(s,o,e,t,null,null)},Mr.prototype.unmount=Ld.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;kg(e.current,2,null,e,null,null),hr(),t[qs]=null}};function Mr(e){this._internalRoot=e}Mr.prototype.unstable_scheduleHydration=function(e){if(e){var t=Gh();e={blockedOn:null,target:e,priority:t};for(var s=0;s<Ja.length&&t!==0&&t<Ja[s].priority;s++);Ja.splice(s,0,e),s===0&&Ag(e)}};var Og=a.version;if(Og!=="19.2.4")throw Error(l(527,Og,"19.2.4"));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=v(t),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var T1={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Or=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Or.isDisabled&&Or.supportsFiber)try{we=Or.inject(T1),He=Or}catch{}}return Go.createRoot=function(e,t){if(!c(e))throw Error(l(299));var s=!1,o="",u=Hp,h=Pp,S=Gp;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(h=t.onCaughtError),t.onRecoverableError!==void 0&&(S=t.onRecoverableError)),t=_g(e,1,!1,null,null,s,o,null,u,h,S,Mg),e[qs]=t.current,gd(e),new Ld(t)},Go.hydrateRoot=function(e,t,s){if(!c(e))throw Error(l(299));var o=!1,u="",h=Hp,S=Pp,j=Gp,R=null;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(u=s.identifierPrefix),s.onUncaughtError!==void 0&&(h=s.onUncaughtError),s.onCaughtError!==void 0&&(S=s.onCaughtError),s.onRecoverableError!==void 0&&(j=s.onRecoverableError),s.formState!==void 0&&(R=s.formState)),t=_g(e,1,!0,t,s??null,o,u,R,h,S,j,Mg),t.context=Tg(null),s=t.current,o=mn(),o=wc(o),u=za(o),u.callback=null,Ua(s,u,o),s=o,t.current.lanes=s,Qi(t,s),Fn(t),e[qs]=t.current,gd(e),new Mr(t)},Go.version="19.2.4",Go}var Pg;function F1(){if(Pg)return Id.exports;Pg=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),Id.exports=Y1(),Id.exports}var Z1=F1();const X1="modulepreload",Q1=function(n){return"/"+n},Gg={},W1=function(a,i,l){let c=Promise.resolve();if(i&&i.length>0){let f=function(v){return Promise.all(v.map(g=>Promise.resolve(g).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const m=document.querySelector("meta[property=csp-nonce]"),p=(m==null?void 0:m.nonce)||(m==null?void 0:m.getAttribute("nonce"));c=f(i.map(v=>{if(v=Q1(v),v in Gg)return;Gg[v]=!0;const g=v.endsWith(".css"),b=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${v}"]${b}`))return;const x=document.createElement("link");if(x.rel=g?"stylesheet":X1,g||(x.as="script"),x.crossOrigin="",x.href=v,p&&x.setAttribute("nonce",p),document.head.appendChild(x),g)return new Promise((_,T)=>{x.addEventListener("load",_),x.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${v}`)))})}))}function d(f){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=f,window.dispatchEvent(m),!m.defaultPrevented)throw f}return c.then(f=>{for(const m of f||[])m.status==="rejected"&&d(m.reason);return a().catch(d)})};function Ls(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function U0(n,a){return console.warn(`[ws] Malformed "${n}" message: ${a}`),!1}function J1(n){return Ls(n)&&typeof n.id=="string"&&typeof n.type=="string"&&typeof n.timestamp=="string"&&Ls(n.payload)}function eT(n){return Ls(n)&&typeof n.sessionId=="string"&&typeof n.eventType=="string"&&typeof n.timestamp=="string"&&typeof n.content=="string"&&(n.raw===void 0||typeof n.raw=="string")}const tT=new Set(["off","subscription","api_key"]),Ir=new Set(["off","on"]);function nT(n){return Ls(n)&&tT.has(n.claude)&&Ir.has(n.github)&&Ir.has(n.copilot)&&Ir.has(n.codex)&&Ir.has(n.goose)}function aT(n){let a;try{a=JSON.parse(n)}catch{console.warn("[ws] Failed to parse WebSocket message as JSON");return}if(!Ls(a)||typeof a.type!="string"){console.warn("[ws] Received WebSocket message without a string 'type' field:",a);return}return typeof a.id=="string"&&typeof a.timestamp=="string"?{id:a.id,type:a.type,timestamp:a.timestamp,payload:Ls(a.payload)?a.payload:{}}:{type:a.type,payload:Ls(a.payload)?a.payload:void 0}}function V0(n){switch(n){case"waiting_input":return"idle";case"completed":return"stopped";case"killed":return"stopped";case"failed":return"stopped";case"interrupted":return"stopped";default:return n}}function H0(n){switch(n){case"completed":return"completed";case"killed":return"killed";case"failed":return"interrupted";case"interrupted":return"interrupted";default:return}}const sT=3e3,Ei=5e3,iT=4001;/**
|
|
27
|
+
* react-router v7.13.2
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Remix Software Inc.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
33
|
+
*
|
|
34
|
+
* @license MIT
|
|
35
|
+
*/var $g="popstate";function qg(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function oT(n={}){function a(l,c){var v;let d=(v=c.state)==null?void 0:v.masked,{pathname:f,search:m,hash:p}=d||l.location;return pf("",{pathname:f,search:m,hash:p},c.state&&c.state.usr||null,c.state&&c.state.key||"default",d?{pathname:l.location.pathname,search:l.location.search,hash:l.location.hash}:void 0)}function i(l,c){return typeof c=="string"?c:ol(c)}return rT(a,i,null,n)}function rt(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function Mn(n,a){if(!n){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function lT(){return Math.random().toString(36).substring(2,10)}function Kg(n,a){return{usr:n.state,key:n.key,idx:a,masked:n.unstable_mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function pf(n,a,i=null,l,c){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof a=="string"?Ki(a):a,state:i,key:a&&a.key||l||lT(),unstable_mask:c}}function ol({pathname:n="/",search:a="",hash:i=""}){return a&&a!=="?"&&(n+=a.charAt(0)==="?"?a:"?"+a),i&&i!=="#"&&(n+=i.charAt(0)==="#"?i:"#"+i),n}function Ki(n){let a={};if(n){let i=n.indexOf("#");i>=0&&(a.hash=n.substring(i),n=n.substring(0,i));let l=n.indexOf("?");l>=0&&(a.search=n.substring(l),n=n.substring(0,l)),n&&(a.pathname=n)}return a}function rT(n,a,i,l={}){let{window:c=document.defaultView,v5Compat:d=!1}=l,f=c.history,m="POP",p=null,v=g();v==null&&(v=0,f.replaceState({...f.state,idx:v},""));function g(){return(f.state||{idx:null}).idx}function b(){m="POP";let w=g(),k=w==null?null:w-v;v=w,p&&p({action:m,location:N.location,delta:k})}function x(w,k){m="PUSH";let C=qg(w)?w:pf(N.location,w,k);v=g()+1;let A=Kg(C,v),D=N.createHref(C.unstable_mask||C);try{f.pushState(A,"",D)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;c.location.assign(D)}d&&p&&p({action:m,location:N.location,delta:1})}function _(w,k){m="REPLACE";let C=qg(w)?w:pf(N.location,w,k);v=g();let A=Kg(C,v),D=N.createHref(C.unstable_mask||C);f.replaceState(A,"",D),d&&p&&p({action:m,location:N.location,delta:0})}function T(w){return cT(w)}let N={get action(){return m},get location(){return n(c,f)},listen(w){if(p)throw new Error("A history only accepts one active listener");return c.addEventListener($g,b),p=w,()=>{c.removeEventListener($g,b),p=null}},createHref(w){return a(c,w)},createURL:T,encodeLocation(w){let k=T(w);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:x,replace:_,go(w){return f.go(w)}};return N}function cT(n,a=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),rt(i,"No window.location.(origin|href) available to create URL");let l=typeof n=="string"?n:ol(n);return l=l.replace(/ $/,"%20"),!a&&l.startsWith("//")&&(l=i+l),new URL(l,i)}function P0(n,a,i="/"){return uT(n,a,i,!1)}function uT(n,a,i,l){let c=typeof a=="string"?Ki(a):a,d=ja(c.pathname||"/",i);if(d==null)return null;let f=G0(n);dT(f);let m=null;for(let p=0;m==null&&p<f.length;++p){let v=q0(d);m=xT(f[p],v,l)}return m}function G0(n,a=[],i=[],l="",c=!1){let d=(f,m,p=c,v)=>{let g={relativePath:v===void 0?f.path||"":v,caseSensitive:f.caseSensitive===!0,childrenIndex:m,route:f};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(l)&&p)return;rt(g.relativePath.startsWith(l),`Absolute route path "${g.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(l.length)}let b=Xn([l,g.relativePath]),x=i.concat(g);f.children&&f.children.length>0&&(rt(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),G0(f.children,a,x,b,p)),!(f.path==null&&!f.index)&&a.push({path:b,score:yT(b,f.index),routesMeta:x})};return n.forEach((f,m)=>{var p;if(f.path===""||!((p=f.path)!=null&&p.includes("?")))d(f,m);else for(let v of $0(f.path))d(f,m,!0,v)}),a}function $0(n){let a=n.split("/");if(a.length===0)return[];let[i,...l]=a,c=i.endsWith("?"),d=i.replace(/\?$/,"");if(l.length===0)return c?[d,""]:[d];let f=$0(l.join("/")),m=[];return m.push(...f.map(p=>p===""?d:[d,p].join("/"))),c&&m.push(...f),m.map(p=>n.startsWith("/")&&p===""?"/":p)}function dT(n){n.sort((a,i)=>a.score!==i.score?i.score-a.score:bT(a.routesMeta.map(l=>l.childrenIndex),i.routesMeta.map(l=>l.childrenIndex)))}var fT=/^:[\w-]+$/,hT=3,mT=2,pT=1,vT=10,gT=-2,Yg=n=>n==="*";function yT(n,a){let i=n.split("/"),l=i.length;return i.some(Yg)&&(l+=gT),a&&(l+=mT),i.filter(c=>!Yg(c)).reduce((c,d)=>c+(fT.test(d)?hT:d===""?pT:vT),l)}function bT(n,a){return n.length===a.length&&n.slice(0,-1).every((l,c)=>l===a[c])?n[n.length-1]-a[a.length-1]:0}function xT(n,a,i=!1){let{routesMeta:l}=n,c={},d="/",f=[];for(let m=0;m<l.length;++m){let p=l[m],v=m===l.length-1,g=d==="/"?a:a.slice(d.length)||"/",b=ll({path:p.relativePath,caseSensitive:p.caseSensitive,end:v},g),x=p.route;if(!b&&v&&i&&!l[l.length-1].route.index&&(b=ll({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},g)),!b)return null;Object.assign(c,b.params),f.push({params:c,pathname:Xn([d,b.pathname]),pathnameBase:jT(Xn([d,b.pathnameBase])),route:x}),b.pathnameBase!=="/"&&(d=Xn([d,b.pathnameBase]))}return f}function ll(n,a){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[i,l]=ST(n.path,n.caseSensitive,n.end),c=a.match(i);if(!c)return null;let d=c[0],f=d.replace(/(.)\/+$/,"$1"),m=c.slice(1);return{params:l.reduce((v,{paramName:g,isOptional:b},x)=>{if(g==="*"){let T=m[x]||"";f=d.slice(0,d.length-T.length).replace(/(.)\/+$/,"$1")}const _=m[x];return b&&!_?v[g]=void 0:v[g]=(_||"").replace(/%2F/g,"/"),v},{}),pathname:d,pathnameBase:f,pattern:n}}function ST(n,a=!1,i=!0){Mn(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let l=[],c="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,m,p,v,g)=>{if(l.push({paramName:m,isOptional:p!=null}),p){let b=g.charAt(v+f.length);return b&&b!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(l.push({paramName:"*"}),c+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?c+="\\/*$":n!==""&&n!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),l]}function q0(n){try{return n.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Mn(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),n}}function ja(n,a){if(a==="/")return n;if(!n.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,l=n.charAt(i);return l&&l!=="/"?null:n.slice(i)||"/"}var _T=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function TT(n,a="/"){let{pathname:i,search:l="",hash:c=""}=typeof n=="string"?Ki(n):n,d;return i?(i=i.replace(/\/\/+/g,"/"),i.startsWith("/")?d=Fg(i.substring(1),"/"):d=Fg(i,a)):d=a,{pathname:d,search:wT(l),hash:NT(c)}}function Fg(n,a){let i=a.replace(/\/+$/,"").split("/");return n.split("/").forEach(c=>{c===".."?i.length>1&&i.pop():c!=="."&&i.push(c)}),i.length>1?i.join("/"):"/"}function Vd(n,a,i,l){return`Cannot include a '${n}' character in a manually specified \`to.${a}\` field [${JSON.stringify(l)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function kT(n){return n.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function $f(n){let a=kT(n);return a.map((i,l)=>l===a.length-1?i.pathname:i.pathnameBase)}function hc(n,a,i,l=!1){let c;typeof n=="string"?c=Ki(n):(c={...n},rt(!c.pathname||!c.pathname.includes("?"),Vd("?","pathname","search",c)),rt(!c.pathname||!c.pathname.includes("#"),Vd("#","pathname","hash",c)),rt(!c.search||!c.search.includes("#"),Vd("#","search","hash",c)));let d=n===""||c.pathname==="",f=d?"/":c.pathname,m;if(f==null)m=i;else{let b=a.length-1;if(!l&&f.startsWith("..")){let x=f.split("/");for(;x[0]==="..";)x.shift(),b-=1;c.pathname=x.join("/")}m=b>=0?a[b]:"/"}let p=TT(c,m),v=f&&f!=="/"&&f.endsWith("/"),g=(d||f===".")&&i.endsWith("/");return!p.pathname.endsWith("/")&&(v||g)&&(p.pathname+="/"),p}var Xn=n=>n.join("/").replace(/\/\/+/g,"/"),jT=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),wT=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,NT=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,CT=class{constructor(n,a,i,l=!1){this.status=n,this.statusText=a||"",this.internal=l,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function ET(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function AT(n){return n.map(a=>a.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var K0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Y0(n,a){let i=n;if(typeof i!="string"||!_T.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let l=i,c=!1;if(K0)try{let d=new URL(window.location.href),f=i.startsWith("//")?new URL(d.protocol+i):new URL(i),m=ja(f.pathname,a);f.origin===d.origin&&m!=null?i=m+f.search+f.hash:c=!0}catch{Mn(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:l,isExternal:c,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var F0=["POST","PUT","PATCH","DELETE"];new Set(F0);var DT=["GET",...F0];new Set(DT);var Yi=y.createContext(null);Yi.displayName="DataRouter";var mc=y.createContext(null);mc.displayName="DataRouterState";var RT=y.createContext(!1),Z0=y.createContext({isTransitioning:!1});Z0.displayName="ViewTransition";var MT=y.createContext(new Map);MT.displayName="Fetchers";var OT=y.createContext(null);OT.displayName="Await";var gn=y.createContext(null);gn.displayName="Navigation";var ml=y.createContext(null);ml.displayName="Location";var On=y.createContext({outlet:null,matches:[],isDataRoute:!1});On.displayName="Route";var qf=y.createContext(null);qf.displayName="RouteError";var X0="REACT_ROUTER_ERROR",BT="REDIRECT",LT="ROUTE_ERROR_RESPONSE";function IT(n){if(n.startsWith(`${X0}:${BT}:{`))try{let a=JSON.parse(n.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function zT(n){if(n.startsWith(`${X0}:${LT}:{`))try{let a=JSON.parse(n.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new CT(a.status,a.statusText,a.data)}catch{}}function UT(n,{relative:a}={}){rt(Hs(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:l}=y.useContext(gn),{hash:c,pathname:d,search:f}=pl(n,{relative:a}),m=d;return i!=="/"&&(m=d==="/"?i:Xn([i,d])),l.createHref({pathname:m,search:f,hash:c})}function Hs(){return y.useContext(ml)!=null}function Ot(){return rt(Hs(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(ml).location}function Ct(n){rt(Hs(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:a}=Ot();return y.useMemo(()=>ll(n,q0(a)),[a,n])}var Q0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function W0(n){y.useContext(gn).static||y.useLayoutEffect(n)}function pc(){let{isDataRoute:n}=y.useContext(On);return n?ek():VT()}function VT(){rt(Hs(),"useNavigate() may be used only in the context of a <Router> component.");let n=y.useContext(Yi),{basename:a,navigator:i}=y.useContext(gn),{matches:l}=y.useContext(On),{pathname:c}=Ot(),d=JSON.stringify($f(l)),f=y.useRef(!1);return W0(()=>{f.current=!0}),y.useCallback((p,v={})=>{if(Mn(f.current,Q0),!f.current)return;if(typeof p=="number"){i.go(p);return}let g=hc(p,JSON.parse(d),c,v.relative==="path");n==null&&a!=="/"&&(g.pathname=g.pathname==="/"?a:Xn([a,g.pathname])),(v.replace?i.replace:i.push)(g,v.state,v)},[a,i,d,c,n])}var HT=y.createContext(null);function PT(n){let a=y.useContext(On).outlet;return y.useMemo(()=>a&&y.createElement(HT.Provider,{value:n},a),[a,n])}function rs(){let{matches:n}=y.useContext(On),a=n[n.length-1];return a?a.params:{}}function pl(n,{relative:a}={}){let{matches:i}=y.useContext(On),{pathname:l}=Ot(),c=JSON.stringify($f(i));return y.useMemo(()=>hc(n,JSON.parse(c),l,a==="path"),[n,c,l,a])}function GT(n,a){return J0(n,a)}function J0(n,a,i){var w;rt(Hs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=y.useContext(gn),{matches:c}=y.useContext(On),d=c[c.length-1],f=d?d.params:{},m=d?d.pathname:"/",p=d?d.pathnameBase:"/",v=d&&d.route;{let k=v&&v.path||"";tb(m,!v||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
36
|
+
|
|
37
|
+
Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let g=Ot(),b;if(a){let k=typeof a=="string"?Ki(a):a;rt(p==="/"||((w=k.pathname)==null?void 0:w.startsWith(p)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${k.pathname}" was given in the \`location\` prop.`),b=k}else b=g;let x=b.pathname||"/",_=x;if(p!=="/"){let k=p.replace(/^\//,"").split("/");_="/"+x.replace(/^\//,"").split("/").slice(k.length).join("/")}let T=P0(n,{pathname:_});Mn(v||T!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Mn(T==null||T[T.length-1].route.element!==void 0||T[T.length-1].route.Component!==void 0||T[T.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let N=FT(T&&T.map(k=>Object.assign({},k,{params:Object.assign({},f,k.params),pathname:Xn([p,l.encodeLocation?l.encodeLocation(k.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?p:Xn([p,l.encodeLocation?l.encodeLocation(k.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),c,i);return a&&N?y.createElement(ml.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...b},navigationType:"POP"}},N):N}function $T(){let n=JT(),a=ET(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),i=n instanceof Error?n.stack:null,l="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:l},d={padding:"2px 4px",backgroundColor:l},f=null;return console.error("Error handled by React Router default ErrorBoundary:",n),f=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:d},"ErrorBoundary")," or"," ",y.createElement("code",{style:d},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},a),i?y.createElement("pre",{style:c},i):null,f)}var qT=y.createElement($T,null),eb=class extends y.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,a){return a.location!==n.location||a.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:a.error,location:a.location,revalidation:n.revalidation||a.revalidation}}componentDidCatch(n,a){this.props.onError?this.props.onError(n,a):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const i=zT(n.digest);i&&(n=i)}let a=n!==void 0?y.createElement(On.Provider,{value:this.props.routeContext},y.createElement(qf.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?y.createElement(KT,{error:n},a):a}};eb.contextType=RT;var Hd=new WeakMap;function KT({children:n,error:a}){let{basename:i}=y.useContext(gn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let l=IT(a.digest);if(l){let c=Hd.get(a);if(c)throw c;let d=Y0(l.location,i);if(K0&&!Hd.get(a))if(d.isExternal||l.reloadDocument)window.location.href=d.absoluteURL||d.to;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(d.to,{replace:l.replace}));throw Hd.set(a,f),f}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d.absoluteURL||d.to}`})}}return n}function YT({routeContext:n,match:a,children:i}){let l=y.useContext(Yi);return l&&l.static&&l.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=a.route.id),y.createElement(On.Provider,{value:n},i)}function FT(n,a=[],i){let l=i==null?void 0:i.state;if(n==null){if(!l)return null;if(l.errors)n=l.matches;else if(a.length===0&&!l.initialized&&l.matches.length>0)n=l.matches;else return null}let c=n,d=l==null?void 0:l.errors;if(d!=null){let g=c.findIndex(b=>b.route.id&&(d==null?void 0:d[b.route.id])!==void 0);rt(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),c=c.slice(0,Math.min(c.length,g+1))}let f=!1,m=-1;if(i&&l){f=l.renderFallback;for(let g=0;g<c.length;g++){let b=c[g];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(m=g),b.route.id){let{loaderData:x,errors:_}=l,T=b.route.loader&&!x.hasOwnProperty(b.route.id)&&(!_||_[b.route.id]===void 0);if(b.route.lazy||T){i.isStatic&&(f=!0),m>=0?c=c.slice(0,m+1):c=[c[0]];break}}}}let p=i==null?void 0:i.onError,v=l&&p?(g,b)=>{var x,_;p(g,{location:l.location,params:((_=(x=l.matches)==null?void 0:x[0])==null?void 0:_.params)??{},unstable_pattern:AT(l.matches),errorInfo:b})}:void 0;return c.reduceRight((g,b,x)=>{let _,T=!1,N=null,w=null;l&&(_=d&&b.route.id?d[b.route.id]:void 0,N=b.route.errorElement||qT,f&&(m<0&&x===0?(tb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),T=!0,w=null):m===x&&(T=!0,w=b.route.hydrateFallbackElement||null)));let k=a.concat(c.slice(0,x+1)),C=()=>{let A;return _?A=N:T?A=w:b.route.Component?A=y.createElement(b.route.Component,null):b.route.element?A=b.route.element:A=g,y.createElement(YT,{match:b,routeContext:{outlet:g,matches:k,isDataRoute:l!=null},children:A})};return l&&(b.route.ErrorBoundary||b.route.errorElement||x===0)?y.createElement(eb,{location:l.location,revalidation:l.revalidation,component:N,error:_,children:C(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:v}):C()},null)}function Kf(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ZT(n){let a=y.useContext(Yi);return rt(a,Kf(n)),a}function XT(n){let a=y.useContext(mc);return rt(a,Kf(n)),a}function QT(n){let a=y.useContext(On);return rt(a,Kf(n)),a}function Yf(n){let a=QT(n),i=a.matches[a.matches.length-1];return rt(i.route.id,`${n} can only be used on routes that contain a unique "id"`),i.route.id}function WT(){return Yf("useRouteId")}function JT(){var l;let n=y.useContext(qf),a=XT("useRouteError"),i=Yf("useRouteError");return n!==void 0?n:(l=a.errors)==null?void 0:l[i]}function ek(){let{router:n}=ZT("useNavigate"),a=Yf("useNavigate"),i=y.useRef(!1);return W0(()=>{i.current=!0}),y.useCallback(async(c,d={})=>{Mn(i.current,Q0),i.current&&(typeof c=="number"?await n.navigate(c):await n.navigate(c,{fromRouteId:a,...d}))},[n,a])}var Zg={};function tb(n,a,i){!a&&!Zg[n]&&(Zg[n]=!0,Mn(!1,i))}y.memo(tk);function tk({routes:n,future:a,state:i,isStatic:l,onError:c}){return J0(n,void 0,{state:i,isStatic:l,onError:c})}function Hn({to:n,replace:a,state:i,relative:l}){rt(Hs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=y.useContext(gn);Mn(!c,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:d}=y.useContext(On),{pathname:f}=Ot(),m=pc(),p=hc(n,$f(d),f,l==="path"),v=JSON.stringify(p);return y.useEffect(()=>{m(JSON.parse(v),{replace:a,state:i,relative:l})},[m,v,l,a,i]),null}function Ps(n){return PT(n.context)}function ke(n){rt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function nk({basename:n="/",children:a=null,location:i,navigationType:l="POP",navigator:c,static:d=!1,unstable_useTransitions:f}){rt(!Hs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=n.replace(/^\/*/,"/"),p=y.useMemo(()=>({basename:m,navigator:c,static:d,unstable_useTransitions:f,future:{}}),[m,c,d,f]);typeof i=="string"&&(i=Ki(i));let{pathname:v="/",search:g="",hash:b="",state:x=null,key:_="default",unstable_mask:T}=i,N=y.useMemo(()=>{let w=ja(v,m);return w==null?null:{location:{pathname:w,search:g,hash:b,state:x,key:_,unstable_mask:T},navigationType:l}},[m,v,g,b,x,_,l,T]);return Mn(N!=null,`<Router basename="${m}"> is not able to match the URL "${v}${g}${b}" because it does not start with the basename, so the <Router> won't render anything.`),N==null?null:y.createElement(gn.Provider,{value:p},y.createElement(ml.Provider,{children:a,value:N}))}function ak({children:n,location:a}){return GT(vf(n),a)}function vf(n,a=[]){let i=[];return y.Children.forEach(n,(l,c)=>{if(!y.isValidElement(l))return;let d=[...a,c];if(l.type===y.Fragment){i.push.apply(i,vf(l.props.children,d));return}rt(l.type===ke,`[${typeof l.type=="string"?l.type:l.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),rt(!l.props.index||!l.props.children,"An index route cannot have child routes.");let f={id:l.props.id||d.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,middleware:l.props.middleware,loader:l.props.loader,action:l.props.action,hydrateFallbackElement:l.props.hydrateFallbackElement,HydrateFallback:l.props.HydrateFallback,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.hasErrorBoundary===!0||l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(f.children=vf(l.props.children,d)),i.push(f)}),i}var Fr="get",Zr="application/x-www-form-urlencoded";function vc(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function sk(n){return vc(n)&&n.tagName.toLowerCase()==="button"}function ik(n){return vc(n)&&n.tagName.toLowerCase()==="form"}function ok(n){return vc(n)&&n.tagName.toLowerCase()==="input"}function lk(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function rk(n,a){return n.button===0&&(!a||a==="_self")&&!lk(n)}function gf(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((a,i)=>{let l=n[i];return a.concat(Array.isArray(l)?l.map(c=>[i,c]):[[i,l]])},[]))}function ck(n,a){let i=gf(n);return a&&a.forEach((l,c)=>{i.has(c)||a.getAll(c).forEach(d=>{i.append(c,d)})}),i}var zr=null;function uk(){if(zr===null)try{new FormData(document.createElement("form"),0),zr=!1}catch{zr=!0}return zr}var dk=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Pd(n){return n!=null&&!dk.has(n)?(Mn(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Zr}"`),null):n}function fk(n,a){let i,l,c,d,f;if(ik(n)){let m=n.getAttribute("action");l=m?ja(m,a):null,i=n.getAttribute("method")||Fr,c=Pd(n.getAttribute("enctype"))||Zr,d=new FormData(n)}else if(sk(n)||ok(n)&&(n.type==="submit"||n.type==="image")){let m=n.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=n.getAttribute("formaction")||m.getAttribute("action");if(l=p?ja(p,a):null,i=n.getAttribute("formmethod")||m.getAttribute("method")||Fr,c=Pd(n.getAttribute("formenctype"))||Pd(m.getAttribute("enctype"))||Zr,d=new FormData(m,n),!uk()){let{name:v,type:g,value:b}=n;if(g==="image"){let x=v?`${v}.`:"";d.append(`${x}x`,"0"),d.append(`${x}y`,"0")}else v&&d.append(v,b)}}else{if(vc(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=Fr,l=null,c=Zr,f=n}return d&&c==="text/plain"&&(f=d,d=void 0),{action:l,method:i.toLowerCase(),encType:c,formData:d,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ff(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function hk(n,a,i,l){let c=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return i?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${l}`:c.pathname=`${c.pathname}.${l}`:c.pathname==="/"?c.pathname=`_root.${l}`:a&&ja(c.pathname,a)==="/"?c.pathname=`${a.replace(/\/$/,"")}/_root.${l}`:c.pathname=`${c.pathname.replace(/\/$/,"")}.${l}`,c}async function mk(n,a){if(n.id in a)return a[n.id];try{let i=await import(n.module);return a[n.id]=i,i}catch(i){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function pk(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function vk(n,a,i){let l=await Promise.all(n.map(async c=>{let d=a.routes[c.route.id];if(d){let f=await mk(d,i);return f.links?f.links():[]}return[]}));return xk(l.flat(1).filter(pk).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function Xg(n,a,i,l,c,d){let f=(p,v)=>i[v]?p.route.id!==i[v].route.id:!0,m=(p,v)=>{var g;return i[v].pathname!==p.pathname||((g=i[v].route.path)==null?void 0:g.endsWith("*"))&&i[v].params["*"]!==p.params["*"]};return d==="assets"?a.filter((p,v)=>f(p,v)||m(p,v)):d==="data"?a.filter((p,v)=>{var b;let g=l.routes[p.route.id];if(!g||!g.hasLoader)return!1;if(f(p,v)||m(p,v))return!0;if(p.route.shouldRevalidate){let x=p.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:((b=i[0])==null?void 0:b.params)||{},nextUrl:new URL(n,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function gk(n,a,{includeHydrateFallback:i}={}){return yk(n.map(l=>{let c=a.routes[l.route.id];if(!c)return[];let d=[c.module];return c.clientActionModule&&(d=d.concat(c.clientActionModule)),c.clientLoaderModule&&(d=d.concat(c.clientLoaderModule)),i&&c.hydrateFallbackModule&&(d=d.concat(c.hydrateFallbackModule)),c.imports&&(d=d.concat(c.imports)),d}).flat(1))}function yk(n){return[...new Set(n)]}function bk(n){let a={},i=Object.keys(n).sort();for(let l of i)a[l]=n[l];return a}function xk(n,a){let i=new Set;return new Set(a),n.reduce((l,c)=>{let d=JSON.stringify(bk(c));return i.has(d)||(i.add(d),l.push({key:d,link:c})),l},[])}function nb(){let n=y.useContext(Yi);return Ff(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function Sk(){let n=y.useContext(mc);return Ff(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Zf=y.createContext(void 0);Zf.displayName="FrameworkContext";function ab(){let n=y.useContext(Zf);return Ff(n,"You must render this element inside a <HydratedRouter> element"),n}function _k(n,a){let i=y.useContext(Zf),[l,c]=y.useState(!1),[d,f]=y.useState(!1),{onFocus:m,onBlur:p,onMouseEnter:v,onMouseLeave:g,onTouchStart:b}=a,x=y.useRef(null);y.useEffect(()=>{if(n==="render"&&f(!0),n==="viewport"){let N=k=>{k.forEach(C=>{f(C.isIntersecting)})},w=new IntersectionObserver(N,{threshold:.5});return x.current&&w.observe(x.current),()=>{w.disconnect()}}},[n]),y.useEffect(()=>{if(l){let N=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(N)}}},[l]);let _=()=>{c(!0)},T=()=>{c(!1),f(!1)};return i?n!=="intent"?[d,x,{}]:[d,x,{onFocus:$o(m,_),onBlur:$o(p,T),onMouseEnter:$o(v,_),onMouseLeave:$o(g,T),onTouchStart:$o(b,_)}]:[!1,x,{}]}function $o(n,a){return i=>{n&&n(i),i.defaultPrevented||a(i)}}function Tk({page:n,...a}){let{router:i}=nb(),l=y.useMemo(()=>P0(i.routes,n,i.basename),[i.routes,n,i.basename]);return l?y.createElement(jk,{page:n,matches:l,...a}):null}function kk(n){let{manifest:a,routeModules:i}=ab(),[l,c]=y.useState([]);return y.useEffect(()=>{let d=!1;return vk(n,a,i).then(f=>{d||c(f)}),()=>{d=!0}},[n,a,i]),l}function jk({page:n,matches:a,...i}){let l=Ot(),{future:c,manifest:d,routeModules:f}=ab(),{basename:m}=nb(),{loaderData:p,matches:v}=Sk(),g=y.useMemo(()=>Xg(n,a,v,d,l,"data"),[n,a,v,d,l]),b=y.useMemo(()=>Xg(n,a,v,d,l,"assets"),[n,a,v,d,l]),x=y.useMemo(()=>{if(n===l.pathname+l.search+l.hash)return[];let N=new Set,w=!1;if(a.forEach(C=>{var D;let A=d.routes[C.route.id];!A||!A.hasLoader||(!g.some(E=>E.route.id===C.route.id)&&C.route.id in p&&((D=f[C.route.id])!=null&&D.shouldRevalidate)||A.hasClientLoader?w=!0:N.add(C.route.id))}),N.size===0)return[];let k=hk(n,m,c.unstable_trailingSlashAwareDataRequests,"data");return w&&N.size>0&&k.searchParams.set("_routes",a.filter(C=>N.has(C.route.id)).map(C=>C.route.id).join(",")),[k.pathname+k.search]},[m,c.unstable_trailingSlashAwareDataRequests,p,l,d,g,a,n,f]),_=y.useMemo(()=>gk(b,d),[b,d]),T=kk(b);return y.createElement(y.Fragment,null,x.map(N=>y.createElement("link",{key:N,rel:"prefetch",as:"fetch",href:N,...i})),_.map(N=>y.createElement("link",{key:N,rel:"modulepreload",href:N,...i})),T.map(({key:N,link:w})=>y.createElement("link",{key:N,nonce:i.nonce,...w,crossOrigin:w.crossOrigin??i.crossOrigin})))}function wk(...n){return a=>{n.forEach(i=>{typeof i=="function"?i(a):i!=null&&(i.current=a)})}}var Nk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Nk&&(window.__reactRouterVersion="7.13.2")}catch{}function Ck({basename:n,children:a,unstable_useTransitions:i,window:l}){let c=y.useRef();c.current==null&&(c.current=oT({window:l,v5Compat:!0}));let d=c.current,[f,m]=y.useState({action:d.action,location:d.location}),p=y.useCallback(v=>{i===!1?m(v):y.startTransition(()=>m(v))},[i]);return y.useLayoutEffect(()=>d.listen(p),[d,p]),y.createElement(nk,{basename:n,children:a,location:f.location,navigationType:f.action,navigator:d,unstable_useTransitions:i})}var sb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Xf=y.forwardRef(function({onClick:a,discover:i="render",prefetch:l="none",relative:c,reloadDocument:d,replace:f,unstable_mask:m,state:p,target:v,to:g,preventScrollReset:b,viewTransition:x,unstable_defaultShouldRevalidate:_,...T},N){let{basename:w,navigator:k,unstable_useTransitions:C}=y.useContext(gn),A=typeof g=="string"&&sb.test(g),D=Y0(g,w);g=D.to;let E=UT(g,{relative:c}),I=Ot(),z=null;if(m){let te=hc(m,[],I.unstable_mask?I.unstable_mask.pathname:"/",!0);w!=="/"&&(te.pathname=te.pathname==="/"?w:Xn([w,te.pathname])),z=k.createHref(te)}let[U,Y,ae]=_k(l,T),se=Rk(g,{replace:f,unstable_mask:m,state:p,target:v,preventScrollReset:b,relative:c,viewTransition:x,unstable_defaultShouldRevalidate:_,unstable_useTransitions:C});function ie(te){a&&a(te),te.defaultPrevented||se(te)}let le=!(D.isExternal||d),q=y.createElement("a",{...T,...ae,href:(le?z:void 0)||D.absoluteURL||E,onClick:le?ie:a,ref:wk(N,Y),target:v,"data-discover":!A&&i==="render"?"true":void 0});return U&&!A?y.createElement(y.Fragment,null,q,y.createElement(Tk,{page:E})):q});Xf.displayName="Link";var Ek=y.forwardRef(function({"aria-current":a="page",caseSensitive:i=!1,className:l="",end:c=!1,style:d,to:f,viewTransition:m,children:p,...v},g){let b=pl(f,{relative:v.relative}),x=Ot(),_=y.useContext(mc),{navigator:T,basename:N}=y.useContext(gn),w=_!=null&&Ik(b)&&m===!0,k=T.encodeLocation?T.encodeLocation(b).pathname:b.pathname,C=x.pathname,A=_&&_.navigation&&_.navigation.location?_.navigation.location.pathname:null;i||(C=C.toLowerCase(),A=A?A.toLowerCase():null,k=k.toLowerCase()),A&&N&&(A=ja(A,N)||A);const D=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let E=C===k||!c&&C.startsWith(k)&&C.charAt(D)==="/",I=A!=null&&(A===k||!c&&A.startsWith(k)&&A.charAt(k.length)==="/"),z={isActive:E,isPending:I,isTransitioning:w},U=E?a:void 0,Y;typeof l=="function"?Y=l(z):Y=[l,E?"active":null,I?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let ae=typeof d=="function"?d(z):d;return y.createElement(Xf,{...v,"aria-current":U,className:Y,ref:g,style:ae,to:f,viewTransition:m},typeof p=="function"?p(z):p)});Ek.displayName="NavLink";var Ak=y.forwardRef(({discover:n="render",fetcherKey:a,navigate:i,reloadDocument:l,replace:c,state:d,method:f=Fr,action:m,onSubmit:p,relative:v,preventScrollReset:g,viewTransition:b,unstable_defaultShouldRevalidate:x,..._},T)=>{let{unstable_useTransitions:N}=y.useContext(gn),w=Bk(),k=Lk(m,{relative:v}),C=f.toLowerCase()==="get"?"get":"post",A=typeof m=="string"&&sb.test(m),D=E=>{if(p&&p(E),E.defaultPrevented)return;E.preventDefault();let I=E.nativeEvent.submitter,z=(I==null?void 0:I.getAttribute("formmethod"))||f,U=()=>w(I||E.currentTarget,{fetcherKey:a,method:z,navigate:i,replace:c,state:d,relative:v,preventScrollReset:g,viewTransition:b,unstable_defaultShouldRevalidate:x});N&&i!==!1?y.startTransition(()=>U()):U()};return y.createElement("form",{ref:T,method:C,action:k,onSubmit:l?p:D,..._,"data-discover":!A&&n==="render"?"true":void 0})});Ak.displayName="Form";function Dk(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ib(n){let a=y.useContext(Yi);return rt(a,Dk(n)),a}function Rk(n,{target:a,replace:i,unstable_mask:l,state:c,preventScrollReset:d,relative:f,viewTransition:m,unstable_defaultShouldRevalidate:p,unstable_useTransitions:v}={}){let g=pc(),b=Ot(),x=pl(n,{relative:f});return y.useCallback(_=>{if(rk(_,a)){_.preventDefault();let T=i!==void 0?i:ol(b)===ol(x),N=()=>g(n,{replace:T,unstable_mask:l,state:c,preventScrollReset:d,relative:f,viewTransition:m,unstable_defaultShouldRevalidate:p});v?y.startTransition(()=>N()):N()}},[b,g,x,i,l,c,a,n,d,f,m,p,v])}function Qf(n){Mn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let a=y.useRef(gf(n)),i=y.useRef(!1),l=Ot(),c=y.useMemo(()=>ck(l.search,i.current?null:a.current),[l.search]),d=pc(),f=y.useCallback((m,p)=>{const v=gf(typeof m=="function"?m(new URLSearchParams(c)):m);i.current=!0,d("?"+v,p)},[d,c]);return[c,f]}var Mk=0,Ok=()=>`__${String(++Mk)}__`;function Bk(){let{router:n}=ib("useSubmit"),{basename:a}=y.useContext(gn),i=WT(),l=n.fetch,c=n.navigate;return y.useCallback(async(d,f={})=>{let{action:m,method:p,encType:v,formData:g,body:b}=fk(d,a);if(f.navigate===!1){let x=f.fetcherKey||Ok();await l(x,i,f.action||m,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:g,body:b,formMethod:f.method||p,formEncType:f.encType||v,flushSync:f.flushSync})}else await c(f.action||m,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:g,body:b,formMethod:f.method||p,formEncType:f.encType||v,replace:f.replace,state:f.state,fromRouteId:i,flushSync:f.flushSync,viewTransition:f.viewTransition})},[l,c,a,i])}function Lk(n,{relative:a}={}){let{basename:i}=y.useContext(gn),l=y.useContext(On);rt(l,"useFormAction must be used inside a RouteContext");let[c]=l.matches.slice(-1),d={...pl(n||".",{relative:a})},f=Ot();if(n==null){d.search=f.search;let m=new URLSearchParams(d.search),p=m.getAll("index");if(p.some(g=>g==="")){m.delete("index"),p.filter(b=>b).forEach(b=>m.append("index",b));let g=m.toString();d.search=g?`?${g}`:""}}return(!n||n===".")&&c.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(d.pathname=d.pathname==="/"?i:Xn([i,d.pathname])),ol(d)}function Ik(n,{relative:a}={}){let i=y.useContext(Z0);rt(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:l}=ib("useViewTransitionState"),c=pl(n,{relative:a});if(!i.isTransitioning)return!1;let d=ja(i.currentLocation.pathname,l)||i.currentLocation.pathname,f=ja(i.nextLocation.pathname,l)||i.nextLocation.pathname;return ll(c.pathname,f)!=null||ll(c.pathname,d)!=null}function xt(){const n=pc();return y.useCallback((a,i)=>{typeof a=="number"?n(a):n(a,i)},[n])}function ob(n){return`/sessions/${encodeURIComponent(n)}`}function Ui(n,a){return a?`/environments/${encodeURIComponent(a)}/workspaces/${encodeURIComponent(n)}`:`/workspaces/${encodeURIComponent(n)}`}function Jn(n,a,i,l){const c=encodeURIComponent(n);let d;return i&&l?d=`/environments/${encodeURIComponent(l)}/workspaces/${encodeURIComponent(i)}/tasks/${c}`:i?d=`/workspaces/${encodeURIComponent(i)}/tasks/${c}`:d=`/tasks/${c}`,a?`${d}/${a}`:d}function Gs(n,a,i){const l=new URLSearchParams;n&&l.set("workspace",n),a&&l.set("parent",a);const c=l.toString();if(n&&i){const d=`/environments/${encodeURIComponent(i)}/workspaces/${encodeURIComponent(n)}/tasks/new`;return a?`${d}?parent=${encodeURIComponent(a)}`:d}return c?`/tasks/new?${c}`:"/tasks/new"}function lb(n){return`/sessions/new?${new URLSearchParams({env:n}).toString()}`}const Vi="/environments",zk="/environments/new";function Hi(n){return`/environments/${encodeURIComponent(n)}`}function Uk(n){return`/environments/${encodeURIComponent(n)}/edit`}const zi="/settings",Vk="/settings/credentials",Gd="/settings/personas",Hk="/settings/personas/new";function rb(n){return`/settings/personas/${encodeURIComponent(n)}`}const Pk="/settings/shortcuts",Gk="/pair",$k="/chat",zs="/",qk="/tasks",cb="/workspaces/new",ub="/knowledge";function Kk(n,a){const i=typeof window<"u"?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`:"ws://localhost:3000",l=y.useRef(void 0),[c,d]=y.useState(!1),f=y.useRef(a.onMessage);f.current=a.onMessage;const m=y.useRef(a.onConnect);m.current=a.onConnect;const p=y.useRef(a.onDisconnect);p.current=a.onDisconnect;const v=y.useCallback(g=>{var b;((b=l.current)==null?void 0:b.readyState)===WebSocket.OPEN&&l.current.send(JSON.stringify(g))},[]);return y.useEffect(()=>{let g,b;function x(){g=new WebSocket(i),l.current=g,g.onopen=()=>{d(!0),m.current(v)},g.onmessage=_=>{if(typeof _.data!="string"){console.warn("[ws] Received non-string WebSocket message; ignoring");return}const T=aT(_.data);T&&f.current(T)},g.onclose=_=>{var T;if(d(!1),l.current=void 0,(T=p.current)==null||T.call(p),clearTimeout(b),_.code===iT){window.location.href=Gk;return}b=setTimeout(x,sT)},g.onerror=()=>{g.close()}}return x(),()=>{clearTimeout(b),g==null||g.close()}},[i,v]),{connected:c,send:v}}const Yk=new Proxy(globalThis.fetch,{apply(n,a,i){return Reflect.apply(globalThis.fetch,a,i)}}),Fk=L1({baseUrl:"/",fetch:Yk}),_e=I1(z1,Fk);function Zk(n){return{id:n.id,displayName:n.displayName,adapterType:n.adapterType,adapterConfig:n.adapterConfig||"{}",status:n.status,bootstrapped:n.bootstrapped}}function Qg(n){return{id:n.id,environmentId:n.environmentId,runtime:n.runtime,status:n.status,prompt:n.prompt,startedAt:n.startedAt,endedAt:n.endedAt||void 0,error:n.error||void 0,endReason:n.endReason||void 0,personaId:n.personaId||void 0,inputTokens:n.inputTokens,outputTokens:n.outputTokens,costUsd:n.costUsd}}function Xk(n){return{sessionId:n.sessionId,eventType:U1(n.type),timestamp:n.timestamp,content:n.content,raw:n.raw||void 0}}function Qk(n){return{id:n.id,name:n.name,description:n.description,repoUrl:n.repoUrl,environmentId:n.environmentId,status:V1(n.status),workingDirectory:n.workingDirectory,useWorktrees:n.useWorktrees,defaultPersonaId:n.defaultPersonaId,createdAt:n.createdAt,updatedAt:n.updatedAt}}function Wg(n){return{id:n.id,workspaceId:n.workspaceId??void 0,title:n.title,description:n.description,status:H1(n.status),branch:n.branch,latestSessionId:n.latestSessionId,dependsOn:[...n.dependsOn],sortOrder:n.sortOrder,createdAt:n.createdAt,startedAt:n.startedAt||void 0,completedAt:n.completedAt||void 0,parentTaskId:n.parentTaskId,depth:n.depth,childTaskIds:[...n.childTaskIds],canDecompose:n.canDecompose,defaultPersonaId:n.defaultPersonaId,workpad:n.workpad}}function Wk(n){return{id:n.id,workspaceId:n.workspaceId,taskId:n.taskId,sessionId:n.sessionId,category:n.category,title:n.title,content:n.content,tags:[...n.tags],createdAt:n.createdAt}}function Jk(n){return{name:n.name,tokenType:n.type,envVar:n.envVar,filePath:n.filePath,expiresAt:n.expiresAt}}function ej(n){return{claude:P1(n.claude),github:Lr(n.github),copilot:Lr(n.copilot),codex:Lr(n.codex),goose:Lr(n.goose)}}function tj(n){return{name:n.name,repository:n.repository,state:n.state,gitStatus:n.gitStatus}}function $d(n){return{id:n.id,name:n.name,description:n.description,systemPrompt:n.systemPrompt,toolConfig:n.toolConfig?JSON.stringify({allowedTools:[...n.toolConfig.allowedTools],disallowedTools:[...n.toolConfig.disallowedTools]}):"{}",runtime:n.runtime,model:n.model,maxTurns:n.maxTurns,mcpServers:JSON.stringify(n.mcpServers.map(a=>({name:a.name,command:a.command,args:[...a.args],tools:[...a.tools]}))),createdAt:n.createdAt,updatedAt:n.updatedAt,type:n.type||"agent",script:n.script}}function nj(n){return{inputTokens:n.inputTokens,outputTokens:n.outputTokens,costUsd:n.costUsd,sessionCount:n.sessionCount}}function Ur(n,a=0){return{id:n.id,label:n.title||n.label||n.id,kind:n.kind,category:n.category||void 0,sourceType:n.sourceType||void 0,sourceId:n.sourceId||void 0,content:n.content||void 0,tags:n.tags.length>0?[...n.tags]:void 0,workspaceId:n.workspaceId||void 0,createdAt:n.createdAt||void 0,updatedAt:n.updatedAt||void 0,val:a}}function qd(n){return{source:n.fromId,target:n.toId,type:n.type}}const Jg=5e3;function aj(){const[n,a]=y.useState([]),[i,l]=y.useState({}),c=y.useCallback(()=>{_e.listEnvironments({}).then(x=>{a(x.environments.map(Zk))},()=>{})},[]),d=y.useCallback(x=>{switch(x.type){case"environment.added":return!0;case"environment.removed":{const _=x.payload.environmentId;return _&&(a(T=>T.filter(N=>N.id!==_)),l(T=>{const N={...T};return delete N[_],N})),!0}case"environment.changed":return c(),!0;case"environment.provision_progress":{const _=x.payload;if(typeof _.environmentId!="string"||typeof _.stage!="string"||typeof _.message!="string"||typeof _.progress!="number")return U0("environment.provision_progress","invalid payload"),!0;if(l(T=>({...T,[_.environmentId]:{stage:_.stage,message:_.message,progress:_.progress}})),_.stage==="ready"){const T=_.environmentId;setTimeout(()=>{l(N=>{const w={...N};return delete w[T],w})},Jg)}return!0}default:return!1}},[c]),f=y.useCallback(x=>{var _;if(x.type==="environments"){const T=Array.isArray((_=x.payload)==null?void 0:_.environments)?x.payload.environments:[];return a(T),!0}return!1},[]),m=y.useCallback((x,_,T)=>{_e.addEnvironment({displayName:x,adapterType:_,adapterConfig:JSON.stringify(T??{})}).catch(()=>{})},[]),p=y.useCallback((x,_)=>{_e.updateEnvironment({id:x,displayName:_.displayName,adapterConfig:_.adapterConfig?JSON.stringify(_.adapterConfig):void 0}).catch(()=>{})},[]),v=y.useCallback((x,_)=>{(async()=>{try{const N=_e.provisionEnvironment({id:x,force:_??!1});for await(const w of N)l(k=>({...k,[x]:{stage:w.stage,message:w.message,progress:w.progress}})),w.stage==="ready"&&setTimeout(()=>{l(k=>{const C={...k};return delete C[x],C})},Jg)}catch{l(N=>{const w={...N};return delete w[x],w})}})().catch(()=>{})},[]),g=y.useCallback(x=>{_e.stopEnvironment({id:x}).catch(()=>{})},[]),b=y.useCallback(x=>{_e.removeEnvironment({id:x}).catch(()=>{})},[]);return{environments:n,provisionStatus:i,loadEnvironments:c,addEnvironment:m,updateEnvironment:p,provisionEnvironment:v,stopEnvironment:g,removeEnvironment:b,handleEvent:d,handleLegacyMessage:f}}const Kd=new Set(["pending","running","idle"]),sj=new Set(["completed","failed","interrupted","hibernating","suspended"]),ey=["pending","running","idle"];function ij(){const[n,a]=y.useState([]),[i,l]=y.useState([]),[c,d]=y.useState(0),[f,m]=y.useState(void 0),[p,v]=y.useState({}),g=y.useCallback(()=>{_e.listSessions({}).then(A=>{const D=A.sessions.map(Qg);a(E=>{const I=new Map(E.map(z=>[z.id,z]));return D.map(z=>{const U=I.get(z.id),Y=U==null?void 0:U.status;return!Y||Y===z.status?z:sj.has(Y)&&Kd.has(z.status)?{...z,status:Y,...U.endReason!==void 0?{endReason:U.endReason}:{}}:Kd.has(Y)&&Kd.has(z.status)&&ey.indexOf(Y)>ey.indexOf(z.status)?{...z,status:Y}:z})})},()=>{})},[]),b=y.useCallback(A=>{if(A.type!=="session_event")return!1;if(!eT(A.payload))return U0("session_event","payload is not a valid SessionEvent"),!0;const D=A.payload;let E=0;if(l(I=>{const z=[...I,D];return z.length>Ei?(E=z.length-Ei,z.slice(-Ei)):z}),E>0&&d(I=>I+E),D.eventType==="usage")try{const I=JSON.parse(D.content),z=Number(I.input_tokens)||0,U=Number(I.output_tokens)||0,Y=Number(I.cost_usd)||0;(z>0||U>0||Y>0)&&a(ae=>ae.map(se=>se.id===D.sessionId?{...se,inputTokens:(se.inputTokens??0)+z,outputTokens:(se.outputTokens??0)+U,costUsd:(se.costUsd??0)+Y}:se))}catch{}if(D.eventType==="status"){const I=V0(D.content),z=H0(D.content);a(U=>U.some(ae=>ae.id===D.sessionId)?U.map(ae=>ae.id===D.sessionId?{...ae,status:I,...z!==void 0?{endReason:z}:{}}:ae):[...U,{id:D.sessionId,environmentId:"",runtime:"",status:I,prompt:"",startedAt:D.timestamp,...z!==void 0?{endReason:z}:{}}])}return!0},[]),x=y.useCallback(A=>{var D,E,I,z,U;switch(A.type){case"sessions":{const Y=Array.isArray((D=A.payload)==null?void 0:D.sessions)?A.payload.sessions:[];return a(Y),!0}case"spawned":{const Y=(E=A.payload)==null?void 0:E.sessionId;return typeof Y=="string"&&Y&&m(Y),g(),!0}case"session_events":{const Y=Array.isArray((I=A.payload)==null?void 0:I.events)?A.payload.events:[];return Y.length>0&&l(Y),!0}case"task_sessions":{const Y=(z=A.payload)==null?void 0:z.taskId;if(typeof Y=="string"&&Y){const ae=Array.isArray((U=A.payload)==null?void 0:U.sessions)?A.payload.sessions:[];v(se=>({...se,[Y]:ae}))}return!0}default:return!1}},[g]),_=y.useCallback((A,D,E,I)=>{_e.spawnAgent({environmentId:A,prompt:D,personaId:E||"",workingDirectory:I||""}).then(z=>{m(z.id),g()},()=>{})},[g]),T=y.useCallback((A,D)=>{_e.sendInput({sessionId:A,text:D}).catch(()=>{})},[]),N=y.useCallback(A=>{_e.killAgent({id:A}).catch(()=>{})},[]),w=y.useCallback(A=>{_e.getSessionEvents({id:A}).then(D=>{const E=D.events.map(Xk);if(E.length>0){let I=0;l(z=>{const U=new Set;for(const se of z)se.sessionId===A&&U.add(`${se.timestamp}|${se.eventType}`);const Y=E.filter(se=>!U.has(`${se.timestamp}|${se.eventType}`)),ae=[...z,...Y].sort((se,ie)=>se.sessionId!==ie.sessionId?0:se.timestamp.localeCompare(ie.timestamp));return ae.length>Ei?(I=ae.length-Ei,ae.slice(-Ei)):ae}),I>0&&d(z=>z+I)}},()=>{})},[]),k=y.useCallback(()=>{l([]),d(0)},[]),C=y.useCallback(A=>{_e.getTaskSessions({id:A}).then(D=>{const E=D.sessions.map(Qg);v(I=>({...I,[A]:E}))},()=>{})},[]);return{sessions:n,events:i,eventsDropped:c,lastSpawnedId:f,taskSessions:p,loadSessions:g,spawn:_,sendInput:T,kill:N,loadSessionEvents:w,clearEvents:k,loadTaskSessions:C,handleMessage:b,handleLegacyMessage:x}}function oj(){const[n,a]=y.useState([]),[i,l]=y.useState(!1),c=y.useCallback(()=>{_e.listWorkspaces({}).then(g=>{a(g.workspaces.map(Qk))},()=>{})},[]),d=y.useCallback(g=>{switch(g.type){case"workspace.created":return l(!1),c(),!0;case"workspace.archived":case"workspace.updated":return c(),!0;default:return!1}},[c]),f=y.useCallback(()=>{l(!1)},[]),m=y.useCallback((g,b,x,_,T,N,w,k,C)=>{l(!0),_e.createWorkspace({name:g,description:b||"",repoUrl:x||"",environmentId:_||"",defaultPersonaId:T||void 0,useWorktrees:N??!0,workingDirectory:w||void 0}).then(()=>{l(!1),k==null||k()},A=>{l(!1);const D=A instanceof Gf?A.message:"Failed to create workspace";C==null||C(D)})},[]),p=y.useCallback(g=>{_e.archiveWorkspace({id:g}).catch(()=>{})},[]),v=y.useCallback((g,b)=>{_e.updateWorkspace({id:g,...b}).catch(()=>{})},[]);return{workspaces:n,workspaceCreating:i,loadWorkspaces:c,createWorkspace:m,archiveWorkspace:p,updateWorkspace:v,handleEvent:d,onDisconnect:f}}function lj(){const[n,a]=y.useState([]),[i,l]=y.useState(void 0),c=y.useCallback(k=>{_e.listTasks({workspaceId:k}).then(C=>{const A=C.tasks.map(Wg);a(D=>[...D.filter(E=>E.workspaceId!==k),...A])},()=>{})},[]),d=y.useCallback(()=>{_e.listTasks({}).then(k=>{const C=k.tasks.map(Wg);a(A=>{const D=new Set(C.map(E=>E.id));return[...A.filter(E=>!D.has(E.id)),...C]})},()=>{})},[]),f=y.useCallback((k,C)=>{k?c(k):C&&a(A=>{const D=A.find(E=>E.id===C);return D!=null&&D.workspaceId?c(D.workspaceId):d(),A})},[c,d]),m=y.useCallback(k=>{const C=k.payload;switch(k.type){case"task.created":{const A=typeof C.workspaceId=="string"?C.workspaceId:"";return A&&c(A),!0}case"task.started":{const A=typeof C.taskId=="string"?C.taskId:"",D=typeof C.sessionId=="string"?C.sessionId:"",E=typeof C.workspaceId=="string"?C.workspaceId:"";return l(I=>A&&I===A?void 0:I),D&&A&&a(I=>I.map(z=>z.id===A?{...z,latestSessionId:D}:z)),f(E,A),!0}case"task.completed":case"task.deleted":case"task.updated":{const A=typeof C.workspaceId=="string"?C.workspaceId:"",D=typeof C.taskId=="string"?C.taskId:"";return f(A,D),!0}default:return!1}},[c,f]),p=y.useCallback(()=>{l(void 0)},[]),v=y.useCallback(k=>{var C,A;if(k.type==="tasks"){const D=Array.isArray((C=k.payload)==null?void 0:C.tasks)?k.payload.tasks:[],E=typeof((A=k.payload)==null?void 0:A.workspaceId)=="string"&&k.payload.workspaceId?k.payload.workspaceId:"";return a(E?I=>[...I.filter(z=>z.workspaceId!==E),...D]:I=>{const z=new Set(D.map(U=>U.id));return[...I.filter(U=>!z.has(U.id)),...D]}),!0}return!1},[]),g=y.useCallback((k,C,A,D,E,I,z,U,Y)=>{_e.createTask({workspaceId:k,title:C,description:A||"",dependsOn:D||[],parentTaskId:E||"",defaultPersonaId:I||void 0,canDecompose:z??void 0}).then(()=>{U==null||U()},ae=>{const se=ae instanceof Gf?ae.message:"Failed to create task";Y==null||Y(se)})},[]),b=y.useCallback((k,C,A,D)=>{l(k),_e.startTask({taskId:k,personaId:C||"",environmentId:A||"",notes:D||""}).catch(()=>{l(void 0)})},[]),x=y.useCallback(k=>{_e.stopTask({id:k}).catch(()=>{})},[]),_=y.useCallback(k=>{_e.completeTask({id:k}).catch(()=>{})},[]),T=y.useCallback(k=>{_e.resumeTask({id:k}).catch(()=>{})},[]),N=y.useCallback((k,C,A,D,E)=>{_e.updateTask({id:k,title:C,description:A,dependsOn:D,...E!==void 0?{defaultPersonaId:E}:{}}).catch(()=>{})},[]),w=y.useCallback(k=>{_e.deleteTask({id:k}).catch(()=>{})},[]);return{tasks:n,taskStartingId:i,loadTasks:c,loadAllTasks:d,createTask:g,startTask:b,stopTask:x,completeTask:_,resumeTask:T,updateTask:N,deleteTask:w,handleEvent:m,onDisconnect:p,handleLegacyMessage:v}}function rj(){const[n,a]=y.useState([]),i=y.useCallback(d=>{_e.queryFindings({workspaceId:d}).then(f=>{a(f.findings.map(Wk))},()=>{})},[]),l=y.useCallback(d=>{if(d.type==="finding.posted"){const f=typeof d.payload.workspaceId=="string"?d.payload.workspaceId:"";return f&&i(f),!0}return!1},[i]),c=y.useCallback((d,f,m,p,v)=>{_e.postFinding({workspaceId:d,title:f,content:m,category:p??"general",tags:v??[]}).catch(()=>{})},[]);return{findings:n,loadFindings:i,postFinding:c,handleEvent:l}}function cj(){const[n,a]=y.useState([]),i=y.useCallback(()=>{_e.listTokens({}).then(f=>{a(f.tokens.map(Jk))},()=>{})},[]),l=y.useCallback(f=>f.type==="token.changed"?(i(),!0):!1,[i]),c=y.useCallback((f,m,p,v,g)=>{_e.setToken({name:f,value:m,type:p,envVar:v,filePath:g}).catch(()=>{})},[]),d=y.useCallback(f=>{_e.deleteToken({name:f}).catch(()=>{})},[]);return{tokens:n,loadTokens:i,setToken:c,deleteToken:d,handleEvent:l}}function uj(){const[n,a]=y.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),i=y.useCallback(()=>{_e.getCredentialProviders({}).then(d=>{a(ej(d))},()=>{})},[]),l=y.useCallback(d=>d.type==="credential.providers_changed"?(nT(d.payload)&&a(d.payload),!0):!1,[]),c=y.useCallback(d=>{const f=[{provider:"claude",value:d.claude},{provider:"github",value:d.github},{provider:"copilot",value:d.copilot},{provider:"codex",value:d.codex},{provider:"goose",value:d.goose}];for(const{provider:m,value:p}of f)_e.setCredentialProvider({provider:m,value:p}).catch(()=>{})},[]);return{credentialProviders:n,loadCredentials:i,updateCredentialProviders:c,handleEvent:l}}function dj(){const[n,a]=y.useState([]),[i,l]=y.useState(""),[c,d]=y.useState(""),[f,m]=y.useState(!1),p=y.useCallback(()=>{_e.listCodespaces({}).then(g=>{a(g.codespaces.map(tj)),d(g.error)},()=>{})},[]),v=y.useCallback((g,b)=>{m(!0),l(""),_e.createCodespace({repo:g,machine:b??""}).then(()=>{m(!1),p()},x=>{m(!1);const _=x instanceof Gf?x.message:"Failed to create codespace";l(_)})},[p]);return{codespaces:n,codespaceError:i,codespaceListError:c,codespaceCreating:f,listCodespaces:p,createCodespace:v}}function fj(){const[n,a]=y.useState([]),i=y.useCallback(()=>{_e.listPersonas({}).then(m=>{a(m.personas.map($d))},()=>{})},[]),l=y.useCallback(m=>{switch(m.type){case"persona.created":case"persona.updated":case"persona.deleted":return i(),!0;default:return!1}},[i]),c=y.useCallback((m,p,v,g,b,x,_,T)=>_e.createPersona({name:m,description:p,systemPrompt:v,runtime:g||"",model:b||"",maxTurns:x||0,type:_||"agent",script:T||""}).then(N=>{const w=$d(N);return a(k=>[...k.filter(C=>C.id!==w.id),w]),w}),[]),d=y.useCallback((m,p,v,g,b,x,_,T,N)=>{const w={id:m};return p!==void 0&&(w.name=p),v!==void 0&&(w.description=v),g!==void 0&&(w.systemPrompt=g),b!==void 0&&(w.runtime=b),x!==void 0&&(w.model=x),_!==void 0&&(w.maxTurns=_),T!==void 0&&(w.type=T),N!==void 0&&(w.script=N),_e.updatePersona(w).then(k=>{const C=$d(k);return a(A=>A.map(D=>D.id===C.id?C:D)),C})},[]),f=y.useCallback(async m=>{await _e.deletePersona({id:m}),a(p=>p.filter(v=>v.id!==m))},[]);return{personas:n,loadPersonas:i,createPersona:c,updatePersona:d,deletePersona:f,handleEvent:l}}function hj(n){if(n)try{return JSON.parse(n)}catch{return}}function mj(){const[n,a]=y.useState(new Map),[i,l]=y.useState([]),[c,d]=y.useState(void 0),[f,m]=y.useState(void 0),[p,v]=y.useState(!1),[g,b]=y.useState(""),x=y.useCallback(A=>{v(!0),_e.listRecentKnowledgeNodes({limit:30,workspaceId:A??""}).then(D=>{const E=new Map,I=[];for(const z of D.nodes)E.set(z.id,Ur(z));for(const z of D.edges)I.push(qd(z));for(const z of I){const U=E.get(z.source);U&&(U.val+=1);const Y=E.get(z.target);Y&&(Y.val+=1)}a(E),l(I),v(!1)},()=>{v(!1)})},[]),_=y.useCallback(A=>{A.trim()&&(b(A),m(void 0),d(void 0),v(!0),_e.searchKnowledge({query:A,limit:20}).then(D=>{const E=new Map,I=[];for(const z of D.results){z.node&&E.set(z.node.id,Ur(z.node,z.edges.length));for(const U of z.edges)I.push(qd(U))}a(E),l(I),v(!1)},()=>{v(!1)}))},[]),T=y.useCallback(()=>{b(""),x()},[x]),N=y.useCallback(A=>{m(A),_e.getKnowledgeNode({id:A}).then(D=>{if(!D.node){d(void 0);return}d({node:Ur(D.node,D.edges.length),edges:D.edges.map(E=>({fromId:E.fromId,toId:E.toId,type:E.type,metadata:hj(E.metadataJson)}))})},()=>{d(void 0)})},[]),w=y.useCallback(()=>{m(void 0),d(void 0)},[]),k=y.useCallback(A=>{_e.expandKnowledgeNode({id:A,depth:1}).then(D=>{a(E=>{const I=new Map(E);for(const z of D.nodes)I.has(z.id)||I.set(z.id,Ur(z));return I}),l(E=>{const I=new Set(E.map(U=>`${U.source}:${U.target}:${U.type}`)),z=[];for(const U of D.edges){const Y=qd(U),ae=`${Y.source}:${Y.target}:${Y.type}`;I.has(ae)||z.push(Y)}return[...E,...z]})},()=>{})},[]),C=y.useCallback(A=>!1,[]);return{graphData:{nodes:[...n.values()],links:i},selectedNode:c,selectedId:f,loading:p,searchQuery:g,search:_,clearSearch:T,selectNode:N,clearSelection:w,expandNode:k,loadRecent:x,handleEvent:C}}function pj(n){const[a,i]=y.useState(""),[l,c]=y.useState(void 0),[d,f]=y.useState({}),{connected:m,send:p}=Kk(n,{onMessage:Y,onConnect:ae,onDisconnect:se}),v=aj(),g=ij(),b=oj(),x=lj(),_=rj(),T=cj(),N=uj(),w=dj(),k=fj(),C=mj(),A="default_persona_id",D="onboarding_completed",E=y.useCallback(async le=>{const q=await _e.setSetting({key:A,value:le});i(q.value)},[]),I=y.useCallback(()=>{c(!0),_e.setSetting({key:D,value:"true"}).catch(()=>{})},[]),z=y.useCallback((le,q)=>{_e.getUsage({scope:le,id:q}).then(te=>{const O=`${le}:${q}`;f(P=>({...P,[O]:nj(te)}))},()=>{})},[]);function U(le){const q=le.payload.key,te=le.payload.value;if(le.type==="setting.changed"){q===A&&i(te??""),q===D&&c(te==="true");return}if(v.handleEvent(le)){(le.type==="environment.removed"||le.type==="environment.changed")&&g.loadSessions();return}if(!b.handleEvent(le)){if(x.handleEvent(le)){le.type==="task.started"&&g.loadSessions();return}_.handleEvent(le)||T.handleEvent(le)||N.handleEvent(le)||k.handleEvent(le)||C.handleEvent(le)}}function Y(le){var q,te,O,P;if(J1(le)){U(le);return}if(!g.handleMessage(le)&&!((q=g.handleLegacyMessage)!=null&&q.call(g,le))&&!((te=v.handleLegacyMessage)!=null&&te.call(v,le))&&!((O=x.handleLegacyMessage)!=null&&O.call(x,le))&&le.type==="error"){console.error("[ws]",(P=le.payload)==null?void 0:P.message);return}}function ae(le){v.loadEnvironments(),g.loadSessions(),b.loadWorkspaces(),T.loadTokens(),N.loadCredentials(),k.loadPersonas(),_e.getSetting({key:A}).then(q=>{i(q.value)},()=>{}),_e.getSetting({key:D}).then(q=>{c(q.value==="true")},()=>{}),x.loadAllTasks(),le({type:"subscribe_all"})}function se(){b.onDisconnect(),x.onDisconnect()}const ie=y.useCallback(()=>{v.loadEnvironments(),g.loadSessions(),b.loadWorkspaces(),T.loadTokens()},[v.loadEnvironments,g.loadSessions,b.loadWorkspaces,T.loadTokens]);return{connected:m,send:p,environments:v.environments,sessions:g.sessions,events:g.events,eventsDropped:g.eventsDropped,lastSpawnedId:g.lastSpawnedId,workspaces:b.workspaces,tasks:x.tasks,findings:_.findings,tokens:T.tokens,spawn:g.spawn,sendInput:g.sendInput,kill:g.kill,refresh:ie,loadSessionEvents:g.loadSessionEvents,clearEvents:g.clearEvents,loadWorkspaces:b.loadWorkspaces,createWorkspace:b.createWorkspace,archiveWorkspace:b.archiveWorkspace,updateWorkspace:b.updateWorkspace,loadTasks:x.loadTasks,loadAllTasks:x.loadAllTasks,createTask:x.createTask,startTask:x.startTask,stopTask:x.stopTask,completeTask:x.completeTask,resumeTask:x.resumeTask,updateTask:x.updateTask,deleteTask:x.deleteTask,loadFindings:_.loadFindings,postFinding:_.postFinding,loadEnvironments:v.loadEnvironments,addEnvironment:v.addEnvironment,updateEnvironment:v.updateEnvironment,loadTokens:T.loadTokens,setToken:T.setToken,deleteToken:T.deleteToken,credentialProviders:N.credentialProviders,updateCredentialProviders:N.updateCredentialProviders,provisionStatus:v.provisionStatus,provisionEnvironment:v.provisionEnvironment,stopEnvironment:v.stopEnvironment,removeEnvironment:v.removeEnvironment,codespaces:w.codespaces,codespaceError:w.codespaceError,codespaceListError:w.codespaceListError,codespaceCreating:w.codespaceCreating,listCodespaces:w.listCodespaces,createCodespace:w.createCodespace,workspaceCreating:b.workspaceCreating,taskStartingId:x.taskStartingId,personas:k.personas,createPersona:k.createPersona,updatePersona:k.updatePersona,deletePersona:k.deletePersona,taskSessions:g.taskSessions,loadTaskSessions:g.loadTaskSessions,appDefaultPersonaId:a,setAppDefaultPersonaId:E,onboardingCompleted:l,completeOnboarding:I,usageCache:d,loadUsage:z,knowledge:C}}const Wf=y.createContext(void 0);function vj({children:n}){const a=pj();return r.jsx(Wf.Provider,{value:a,children:n})}function ut(){const n=y.useContext(Wf);if(!n)throw new Error("useGrackle must be used within GrackleProvider");return n}const gj=[{id:"env-local-01",displayName:"Local Dev",adapterType:"local",adapterConfig:"{}",status:"connected",bootstrapped:!0},{id:"env-docker-01",displayName:"Docker Sandbox",adapterType:"docker",adapterConfig:'{"image":"node:20"}',status:"connected",bootstrapped:!0},{id:"env-cs-01",displayName:"GitHub Codespace",adapterType:"codespace",adapterConfig:'{"codespaceName":"my-codespace"}',status:"connected",bootstrapped:!0},{id:"env-remote-01",displayName:"Staging (SSH)",adapterType:"ssh",adapterConfig:'{"host":"192.168.1.10","user":"deploy","sshPort":22}',status:"disconnected",bootstrapped:!1}],yj=[{id:"sess-001-prev",environmentId:"env-local-01",runtime:"claude-code",status:"stopped",endReason:"interrupted",prompt:"Implement auth middleware",startedAt:"2026-02-26T14:00:00Z",endedAt:"2026-02-26T15:12:00Z",error:"Context window exceeded before completing implementation",inputTokens:84200,outputTokens:12750,costUsd:.41},{id:"sess-001",environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:"Refactor the authentication middleware to use JWT tokens",startedAt:"2026-02-27T08:15:00Z",inputTokens:42600,outputTokens:8100,costUsd:.22},{id:"sess-002",environmentId:"env-docker-01",runtime:"claude-code",status:"stopped",endReason:"completed",prompt:"Write unit tests for the user registration endpoint",startedAt:"2026-02-27T07:30:00Z",endedAt:"2026-02-27T07:33:00Z",inputTokens:31400,outputTokens:9800,costUsd:.18},{id:"sess-003",environmentId:"env-local-01",runtime:"claude-code",status:"stopped",endReason:"interrupted",prompt:"Migrate database schema to add audit_log table",startedAt:"2026-02-26T22:45:00Z",endedAt:"2026-02-26T23:10:00Z",inputTokens:56300,outputTokens:14200,costUsd:.31},{id:"sess-004",environmentId:"env-docker-01",runtime:"claude-code",status:"running",prompt:"Implement rate limiting for the public API",startedAt:"2026-02-27T09:00:00Z",inputTokens:18900,outputTokens:4500,costUsd:.1},{id:"sess-005",environmentId:"env-cs-01",runtime:"claude-code",status:"suspended",prompt:"Refactor database connection pooling for multi-tenant isolation",startedAt:"2026-02-27T06:00:00Z",inputTokens:67800,outputTokens:19300,costUsd:.38}],bj=[{sessionId:"sess-001-prev",eventType:"status",timestamp:"2026-02-26T14:00:01Z",content:"running"},{sessionId:"sess-001-prev",eventType:"output",timestamp:"2026-02-26T14:00:05Z",content:"Reading src/middleware/auth.ts to understand the current authentication flow..."},{sessionId:"sess-001-prev",eventType:"error",timestamp:"2026-02-26T15:12:00Z",content:"Context window exceeded before completing implementation"},{sessionId:"sess-001",eventType:"status",timestamp:"2026-02-27T08:15:01Z",content:"running"},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:02Z",content:"Analyzing current authentication middleware in src/middleware/auth.ts..."},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:04Z",content:`Found 3 files using session-based auth:
|
|
38
|
+
- src/middleware/auth.ts
|
|
39
|
+
- src/routes/login.ts
|
|
40
|
+
- src/routes/protected.ts`},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:07Z",content:"Installing jsonwebtoken and @types/jsonwebtoken..."},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:12Z",content:`Rewriting auth middleware:
|
|
41
|
+
\`\`\`typescript
|
|
42
|
+
import jwt from "jsonwebtoken";
|
|
43
|
+
import type { Request, Response, NextFunction } from "express";
|
|
44
|
+
|
|
45
|
+
const JWT_SECRET = process.env.JWT_SECRET || "change-me";
|
|
46
|
+
|
|
47
|
+
export function verifyToken(req: Request, res: Response, next: NextFunction): void {
|
|
48
|
+
const header = req.headers.authorization;
|
|
49
|
+
if (!header?.startsWith("Bearer ")) {
|
|
50
|
+
res.status(401).json({ error: "Missing token" });
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
const decoded = jwt.verify(header.slice(7), JWT_SECRET);
|
|
55
|
+
req.user = decoded;
|
|
56
|
+
next();
|
|
57
|
+
} catch {
|
|
58
|
+
res.status(403).json({ error: "Invalid token" });
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
\`\`\``},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:18Z",content:"Updated login route to issue JWT tokens with 24h expiry."},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:22Z",content:"Running test suite... 14 tests passed, 2 updated, 0 failed."},{sessionId:"sess-002",eventType:"status",timestamp:"2026-02-27T07:30:01Z",content:"running"},{sessionId:"sess-002",eventType:"output",timestamp:"2026-02-27T07:30:05Z",content:"Generating pytest tests for POST /api/register endpoint..."},{sessionId:"sess-002",eventType:"output",timestamp:"2026-02-27T07:32:00Z",content:"Created 8 test cases covering: valid registration, duplicate email, weak password, missing fields, SQL injection, XSS payload, rate limit, and CORS headers."},{sessionId:"sess-002",eventType:"status",timestamp:"2026-02-27T07:33:00Z",content:"completed"}],xj=[{id:"proj-alpha",name:"Workspace Alpha",description:"Core platform API and authentication services",repoUrl:"https://github.com/acme/alpha",environmentId:"env-local-01",status:"active",workingDirectory:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2026-01-15T10:00:00Z",updatedAt:"2026-01-15T10:00:00Z"},{id:"proj-beta",name:"Data Pipeline",description:"ETL pipelines for analytics and reporting",repoUrl:"https://github.com/acme/data-pipeline",environmentId:"env-docker-01",status:"active",workingDirectory:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2026-02-01T14:30:00Z",updatedAt:"2026-02-01T14:30:00Z"},{id:"proj-gamma",name:"Mobile App",description:"React Native cross-platform mobile application",repoUrl:"",environmentId:"env-local-01",status:"archived",workingDirectory:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2025-11-20T09:00:00Z",updatedAt:"2025-11-20T09:00:00Z"}],Sj=[{id:"task-001",workspaceId:"proj-alpha",title:"Implement JWT authentication",description:"Replace session-based auth with JWT tokens across all protected routes",status:"working",branch:"feat/jwt-auth",latestSessionId:"sess-001",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-25T10:00:00Z",parentTaskId:"",depth:0,childTaskIds:["task-001a","task-001b","task-001c"],canDecompose:!0,defaultPersonaId:"",workpad:""},{id:"task-001a",workspaceId:"proj-alpha",title:"Design token schema",description:"Define JWT payload structure, expiry, and refresh token strategy",status:"complete",branch:"feat/jwt-auth/design-token-schema",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-25T10:10:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-001b",workspaceId:"proj-alpha",title:"Implement auth middleware",description:"Build Express middleware that verifies JWT Bearer tokens",status:"working",branch:"feat/jwt-auth/implement-auth-middleware",latestSessionId:"sess-001",dependsOn:[],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-25T10:15:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-001c",workspaceId:"proj-alpha",title:"Write auth integration tests",description:"End-to-end tests for login flow, token refresh, and protected route access",status:"not_started",branch:"",latestSessionId:"",dependsOn:["task-001b"],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-25T10:20:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-002",workspaceId:"proj-alpha",title:"Add rate limiting",description:"Implement token-bucket rate limiting for public API endpoints",status:"not_started",branch:"",latestSessionId:"",dependsOn:["task-001"],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-25T10:05:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-003",workspaceId:"proj-alpha",title:"Set up OpenAPI documentation",description:"Generate Swagger docs from route decorators and serve at /api/docs",status:"paused",branch:"feat/openapi-docs",latestSessionId:"sess-002",dependsOn:[],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-24T16:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-004",workspaceId:"proj-alpha",title:"Database connection pooling",description:"Switch from single connection to a connection pool with health checks",status:"complete",branch:"feat/db-pool",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:4,createdAt:"2026-02-23T11:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-005",workspaceId:"proj-alpha",title:"Fix N+1 query in user list",description:"Use a JOIN instead of per-row lookups in GET /api/users",status:"not_started",branch:"fix/user-list-n1",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:5,createdAt:"2026-02-22T09:30:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-006",workspaceId:"proj-beta",title:"Add Parquet export support",description:"Allow pipeline outputs to be written as Parquet files for Spark consumption",status:"working",branch:"feat/parquet-export",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-26T08:00:00Z",parentTaskId:"",depth:0,childTaskIds:["task-006a","task-006b","task-006c","task-006d"],canDecompose:!0,defaultPersonaId:"",workpad:""},{id:"task-006a",workspaceId:"proj-beta",title:"Define Parquet schema mapping",description:"Map internal column types to Arrow/Parquet type system",status:"complete",branch:"feat/parquet-export/define-parquet-schema-mapping",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-26T08:05:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-006b",workspaceId:"proj-beta",title:"Implement row-group writer",description:"Write buffered row groups with configurable batch size",status:"complete",branch:"feat/parquet-export/implement-row-group-writer",latestSessionId:"",dependsOn:["task-006a"],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-26T08:10:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-006c",workspaceId:"proj-beta",title:"Add compression options",description:"Support Snappy, ZSTD, and GZIP compression for Parquet output",status:"working",branch:"feat/parquet-export/add-compression-options",latestSessionId:"sess-004",dependsOn:["task-006b"],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-26T08:15:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-006d",workspaceId:"proj-beta",title:"Write Parquet integration tests",description:"Round-trip tests: write Parquet, read back with pyarrow, verify data integrity",status:"not_started",branch:"",latestSessionId:"",dependsOn:["task-006c"],reviewNotes:void 0,sortOrder:4,createdAt:"2026-02-26T08:20:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-007",workspaceId:"proj-beta",title:"Implement incremental loads",description:"Track watermarks so pipelines only process new/changed rows",status:"working",branch:"feat/incremental",latestSessionId:"sess-004",dependsOn:[],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-26T08:30:00Z",parentTaskId:"",depth:0,childTaskIds:["task-007a","task-007b"],canDecompose:!0,defaultPersonaId:"",workpad:""},{id:"task-007a",workspaceId:"proj-beta",title:"Design watermark storage",description:"Define schema for per-pipeline high-watermark tracking",status:"complete",branch:"feat/incremental/design-watermark-storage",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-26T08:35:00Z",parentTaskId:"task-007",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-007b",workspaceId:"proj-beta",title:"Implement change detection query",description:"Generate WHERE clauses from watermarks to fetch only changed rows",status:"failed",branch:"feat/incremental/implement-change-detection-query",latestSessionId:"",dependsOn:["task-007a"],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-26T08:40:00Z",parentTaskId:"task-007",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-008",workspaceId:"proj-beta",title:"Add pipeline monitoring dashboard",description:"Real-time metrics for pipeline throughput, latency, and error rates",status:"paused",branch:"feat/monitoring",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-26T09:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""}],ty=[{id:"find-001",workspaceId:"proj-alpha",taskId:"task-001",sessionId:"sess-001",category:"architecture",title:"Auth middleware is tightly coupled to Express",content:"The current auth middleware directly references Express Request/Response types. Consider extracting a framework-agnostic token verification layer so we can reuse it in the WebSocket auth path.",tags:["auth","decoupling","middleware"],createdAt:"2026-02-27T08:16:00Z"},{id:"find-002",workspaceId:"proj-alpha",taskId:"task-003",sessionId:"sess-002",category:"api",title:"Missing pagination on GET /api/users",content:"The users endpoint returns all rows without limit/offset. For datasets over 10k rows this will cause timeouts. Recommend cursor-based pagination with a default page size of 50.",tags:["api","pagination","performance"],createdAt:"2026-02-27T07:31:00Z"},{id:"find-003",workspaceId:"proj-alpha",taskId:"task-005",sessionId:"sess-003",category:"bug",title:"Race condition in session cleanup",content:"When two requests hit /api/logout concurrently, the second call throws a 500 because the session row has already been deleted. Needs an idempotent DELETE or a conditional check.",tags:["bug","concurrency","sessions"],createdAt:"2026-02-26T22:50:00Z"},{id:"find-004",workspaceId:"proj-alpha",taskId:"task-004",sessionId:"",category:"decision",title:"Chose pg-pool over knex connection pool",content:"pg-pool gives us direct control over idle timeout, max connections, and health check queries. Knex wraps pg-pool anyway and adds overhead we don't need since we write raw SQL.",tags:["database","decision","postgres"],createdAt:"2026-02-23T11:30:00Z"},{id:"find-005",workspaceId:"proj-alpha",taskId:"",sessionId:"",category:"dependency",title:"jsonwebtoken has 3 high-severity CVEs",content:"The jsonwebtoken package (v8.x) has known vulnerabilities. Consider migrating to jose which is maintained, supports ESM, and covers the same JWS/JWE surface area with zero dependencies.",tags:["security","dependency","jwt"],createdAt:"2026-02-27T08:20:00Z"},{id:"find-006",workspaceId:"proj-alpha",taskId:"task-001",sessionId:"sess-001",category:"pattern",title:"Consistent error response shape",content:"All error responses should follow the shape `{ error: string, code: string, details?: unknown }`. Currently some routes return `{ message: string }` and others return `{ error: string }`.",tags:["api","consistency","error-handling"],createdAt:"2026-02-27T08:17:00Z"},{id:"find-007",workspaceId:"proj-beta",taskId:"task-007",sessionId:"sess-004",category:"architecture",title:"Watermark storage should be pluggable",content:"The incremental load watermarks are currently stored in a local SQLite file. For production multi-worker scenarios, this needs to be backed by a shared store (Redis or Postgres).",tags:["architecture","pipeline","scalability"],createdAt:"2026-02-27T09:05:00Z"}],_j=[{name:"anthropic",tokenType:"env_var",envVar:"ANTHROPIC_API_KEY",filePath:"",expiresAt:""},{name:"github",tokenType:"env_var",envVar:"GITHUB_TOKEN",filePath:"",expiresAt:"2026-12-31T23:59:59Z"},{name:"gcp-service-account",tokenType:"file",envVar:"",filePath:"/home/user/.config/gcloud/credentials.json",expiresAt:""}],Tj=[{id:"persona-arch",name:"Software Architect",description:"Designs system architecture, defines interfaces, and decomposes large features into implementable tasks.",systemPrompt:"You are a senior software architect. Focus on clean interfaces, separation of concerns, and scalable patterns. When decomposing work, create concrete subtasks with clear acceptance criteria.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:50,mcpServers:"[]",createdAt:"2026-02-20T10:00:00Z",updatedAt:"2026-02-20T10:00:00Z",type:"agent",script:""},{id:"persona-fe",name:"Frontend Engineer",description:"React specialist — builds UI components, writes CSS, implements routing, and creates Playwright tests.",systemPrompt:"You are a frontend engineer specializing in React, TypeScript, and modern CSS. Follow component composition patterns, use semantic HTML, and write accessible markup.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit","Bash"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:100,mcpServers:"[]",createdAt:"2026-02-20T10:05:00Z",updatedAt:"2026-02-20T10:05:00Z",type:"agent",script:""},{id:"persona-reviewer",name:"Code Reviewer",description:"Reviews diffs for correctness, security, and style. Posts findings for issues discovered.",systemPrompt:"You are a meticulous code reviewer. Check for security vulnerabilities, performance issues, and style consistency. Post findings for anything noteworthy.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:30,mcpServers:"[]",createdAt:"2026-02-20T10:10:00Z",updatedAt:"2026-02-20T10:10:00Z",type:"agent",script:""},{id:"persona-tester",name:"QA Engineer",description:"Writes comprehensive test suites — unit tests, integration tests, and E2E Playwright specs.",systemPrompt:"You are a QA engineer focused on test coverage. Write tests that cover happy paths, edge cases, error scenarios, and accessibility. Use Playwright for E2E tests.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit","Bash"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:80,mcpServers:"[]",createdAt:"2026-02-20T10:15:00Z",updatedAt:"2026-02-20T10:15:00Z",type:"agent",script:""},{id:"persona-lint",name:"Lint & Format",description:"Scripted persona — runs ESLint and Prettier on changed files, auto-fixes violations, and posts a findings summary.",systemPrompt:"",toolConfig:"{}",runtime:"genaiscript",model:"",maxTurns:1,mcpServers:"[]",createdAt:"2026-02-21T09:00:00Z",updatedAt:"2026-02-21T09:00:00Z",type:"script",script:`const files = env.files.filter(f => /\\.(ts|tsx|js)$/.test(f.filename));
|
|
62
|
+
for (const f of files) {
|
|
63
|
+
const eslintResult = await host.exec("npx", ["eslint", "--fix", f.filename]);
|
|
64
|
+
if (eslintResult.exitCode !== 0) {
|
|
65
|
+
env.findings.push({ category: "lint", title: \`Lint issues in \${f.filename}\`, content: eslintResult.stderr });
|
|
66
|
+
}
|
|
67
|
+
const prettierResult = await host.exec("npx", ["prettier", "--write", f.filename]);
|
|
68
|
+
if (prettierResult.exitCode !== 0) {
|
|
69
|
+
env.findings.push({ category: "format", title: \`Prettier issues in \${f.filename}\`, content: prettierResult.stderr });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
env.findings.push({ category: "summary", title: "Lint & format pass complete", content: \`Ran ESLint and Prettier on \${files.length} files\` });`}],kj={"task-001b":[{id:"sess-001-prev",environmentId:"env-local-01",runtime:"claude-code",status:"stopped",endReason:"interrupted",prompt:"Implement auth middleware",startedAt:"2026-02-26T14:00:00Z"},{id:"sess-001",environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:"Implement auth middleware",startedAt:"2026-02-27T08:15:00Z"}],"task-006c":[{id:"sess-004",environmentId:"env-docker-01",runtime:"claude-code",status:"running",prompt:"Add compression options",startedAt:"2026-02-27T09:00:00Z"}]};function Mt(n){return new Date(Date.now()+n).toISOString()}const ny=[{label:"API Refactor",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Mt(0),content:"running"}},{delayMs:800,event:{eventType:"output",timestamp:Mt(800),content:"Analyzing current API structure in src/routes/..."}},{delayMs:1600,event:{eventType:"output",timestamp:Mt(1600),content:`Found 5 endpoints that need refactoring:
|
|
73
|
+
- GET /api/users
|
|
74
|
+
- POST /api/users
|
|
75
|
+
- GET /api/users/:id
|
|
76
|
+
- PUT /api/users/:id
|
|
77
|
+
- DELETE /api/users/:id`}},{delayMs:2800,event:{eventType:"output",timestamp:Mt(2800),content:"Refactoring to use Express Router with middleware chain...\n```typescript\nconst router = Router();\nrouter.use(authenticate);\nrouter.use(validateBody);\n```"}},{delayMs:4e3,event:{eventType:"output",timestamp:Mt(4e3),content:"Running test suite... 22 tests passed, 3 updated, 0 failed."}},{delayMs:5e3,event:{eventType:"status",timestamp:Mt(5e3),content:"completed"}}]},{label:"Database Migration",pauseForInput:!0,pauseAfterStep:3,steps:[{delayMs:0,event:{eventType:"status",timestamp:Mt(0),content:"running"}},{delayMs:600,event:{eventType:"output",timestamp:Mt(600),content:"Scanning current schema for migration targets..."}},{delayMs:1400,event:{eventType:"output",timestamp:Mt(1400),content:`Found tables to modify:
|
|
78
|
+
- users (add column: last_login_at)
|
|
79
|
+
- sessions (add index on expires_at)
|
|
80
|
+
- audit_log (new table)`}},{delayMs:2200,event:{eventType:"output",timestamp:Mt(2200),content:`⚠ This migration will add a NOT NULL column to the users table.
|
|
81
|
+
The table has 50,000+ rows — this may lock the table briefly.
|
|
82
|
+
|
|
83
|
+
Please confirm to proceed.`}}],resumeSteps:[{delayMs:500,event:{eventType:"output",timestamp:Mt(0),content:"Proceeding with migration..."}},{delayMs:1500,event:{eventType:"output",timestamp:Mt(1e3),content:`Migration 001_add_last_login.sql applied successfully.
|
|
84
|
+
Migration 002_sessions_index.sql applied successfully.
|
|
85
|
+
Migration 003_audit_log.sql applied successfully.`}},{delayMs:2500,event:{eventType:"output",timestamp:Mt(2e3),content:"All 3 migrations applied. Running verification queries... OK."}},{delayMs:3200,event:{eventType:"status",timestamp:Mt(2700),content:"completed"}}]},{label:"Test Writer",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Mt(0),content:"running"}},{delayMs:700,event:{eventType:"output",timestamp:Mt(700),content:"Generating test scaffolding for src/services/billing.ts..."}},{delayMs:1800,event:{eventType:"output",timestamp:Mt(1800),content:`Writing test cases:
|
|
86
|
+
- should calculate monthly total
|
|
87
|
+
- should apply discount codes
|
|
88
|
+
- should handle currency conversion
|
|
89
|
+
- should reject expired cards`}},{delayMs:2800,event:{eventType:"output",timestamp:Mt(2800),content:`Error: Cannot resolve import 'src/services/stripe-client.ts' — module not found.
|
|
90
|
+
The billing service depends on a Stripe client that doesn't exist in this environment.`}},{delayMs:3500,event:{eventType:"status",timestamp:Mt(3500),content:"failed"}}]}],ay=400;function jj({children:n}){const[a,i]=y.useState(gj),[l,c]=y.useState(yj),[d,f]=y.useState(bj),[m,p]=y.useState(void 0),[v,g]=y.useState(xj),[b,x]=y.useState(Sj),[_,T]=y.useState(ty),[N,w]=y.useState(_j),[k,C]=y.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),[A,D]=y.useState(Tj),[E]=y.useState(kj),[I,z]=y.useState(""),U=y.useRef(0),Y=y.useRef(0),ae=y.useRef(new Set),se=y.useRef(new Map),ie=y.useRef(b);ie.current=b;const le=y.useRef(new Map),q=y.useRef(new Map),te=y.useCallback(F=>(U.current+=1,`mock-${F}-${String(U.current).padStart(3,"0")}`),[]),O=y.useCallback(()=>{const F=ny[Y.current%ny.length];return Y.current+=1,F},[]),P=y.useCallback((F,ne,me)=>{const Te=setTimeout(()=>{var be;ae.current.delete(Te),me&&((be=se.current.get(me))==null||be.delete(Te)),F()},ne);ae.current.add(Te),me&&(se.current.has(me)||se.current.set(me,new Set),se.current.get(me).add(Te))},[]),W=y.useCallback(F=>{const ne=se.current.get(F);ne&&(ne.forEach(me=>{clearTimeout(me),ae.current.delete(me)}),se.current.delete(F))},[]),re=y.useCallback((F,ne,me)=>{c(Te=>Te.map(be=>be.id===F?{...be,status:ne,...me!==void 0?{endReason:me}:{}}:be))},[]),oe=y.useCallback(F=>{f(ne=>[...ne,F])},[]),Ce=y.useCallback((F,ne,me)=>{ne.forEach((Te,be)=>{P(()=>{const nt={sessionId:F,...Te.event,timestamp:new Date().toISOString()};if(oe(nt),Te.event.eventType==="status"){const we=V0(Te.event.content),He=H0(Te.event.content);re(F,we,He)}be===ne.length-1&&me&&me()},Te.delayMs,F)})},[P,oe,re]),je=y.useCallback((F,ne,me,Te)=>{console.log("[MockGrackle] spawn",{environmentId:F,prompt:ne,runtime:Te});const be=te("sess"),nt={id:be,environmentId:F,runtime:Te||"claude-code",status:"running",prompt:ne,startedAt:new Date().toISOString()};c(He=>[...He,nt]),p(be);const we=O();if(console.log(`[MockGrackle] Playing scenario: ${we.label}`),we.pauseForInput){const He=we.pauseAfterStep??we.steps.length-1,Ie=we.steps.slice(0,He+1),Ye=Ie.length>0?Ie[Ie.length-1].delayMs:0;Ce(be,Ie),P(()=>{re(be,"idle"),oe({sessionId:be,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},Ye+ay,be),we.resumeSteps&&le.current.set(be,we.resumeSteps)}else Ce(be,we.steps)},[te,O,Ce,P,re,oe]),Se=y.useCallback(F=>{console.log("[MockGrackle] kill",F),W(F),le.current.delete(F),re(F,"stopped","killed"),oe({sessionId:F,eventType:"status",timestamp:new Date().toISOString(),content:"killed"}),x(ne=>ne.map(me=>me.latestSessionId===F&&me.status==="working"?{...me,status:"not_started"}:me))},[W,re,oe]),Le=y.useCallback(()=>{console.log("[MockGrackle] refresh")},[]),ce=y.useCallback(F=>{console.log("[MockGrackle] loadSessionEvents",F)},[]),ue=y.useCallback(()=>{console.log("[MockGrackle] clearEvents"),f([])},[]),fe=y.useCallback((F,ne,me,Te,be,nt,we,He,Ie)=>{console.log("[MockGrackle] createWorkspace",{name:F,description:ne});const Ye={id:te("proj"),name:F,description:ne||"",repoUrl:me||"",environmentId:Te||"",status:"active",workingDirectory:we||"",useWorktrees:nt??!0,defaultPersonaId:be||"",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};g(Yt=>[...Yt,Ye]),He&&He()},[te]),tt=y.useCallback(F=>{console.log("[MockGrackle] archiveWorkspace",F),g(ne=>ne.map(me=>me.id===F?{...me,status:"archived"}:me))},[]),ee=y.useCallback(F=>{console.log("[MockGrackle] loadTasks",F)},[]),X=y.useCallback((F,ne,me,Te,be,nt,we,He,Ie)=>{console.log("[MockGrackle] createTask",{workspaceId:F,title:ne,parentTaskId:be}),x(Ye=>{const Bt=Ye.filter(bn=>bn.workspaceId===F).reduce((bn,Ln)=>Math.max(bn,Ln.sortOrder),0),zt=be?Ye.find(bn=>bn.id===be):void 0;if(be&&!zt)return console.warn("[MockGrackle] Parent task not found:",be),Ye;if(zt&&!zt.canDecompose)return console.warn("[MockGrackle] Parent task does not have decomposition rights:",be),Ye;const vt=zt?zt.depth+1:0,Aa={id:te("task"),workspaceId:F,title:ne,description:me||"",status:"not_started",branch:"",latestSessionId:"",dependsOn:Te||[],reviewNotes:void 0,sortOrder:Bt+1,createdAt:new Date().toISOString(),parentTaskId:be||"",depth:vt,childTaskIds:[],canDecompose:we??!be,defaultPersonaId:nt||"",workpad:""};return[...Ye,Aa]}),He&&He()},[te]),At=y.useCallback((F,ne,me,Te)=>{var Ye;console.log("[MockGrackle] startTask",{taskId:F});const be=ie.current.find(Yt=>Yt.id===F),nt=(be==null?void 0:be.title)??"",we=te("sess"),He={id:we,environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:nt||F,startedAt:new Date().toISOString()};c(Yt=>[...Yt,He]),x(Yt=>Yt.map(Bt=>Bt.id===F?{...Bt,status:"working",latestSessionId:we,branch:`mock/${F.slice(0,8)}`}:Bt));const Ie=O();if(console.log(`[MockGrackle] Playing task scenario: ${Ie.label}`),Ie.pauseForInput){const Yt=Ie.pauseAfterStep??Ie.steps.length-1,Bt=Ie.steps.slice(0,Yt+1),zt=Bt.length>0?Bt[Bt.length-1].delayMs:0;if(Ce(we,Bt),P(()=>{re(we,"idle"),oe({sessionId:we,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},zt+ay,we),Ie.resumeSteps){const vt=[...Ie.resumeSteps];le.current.set(we,vt);const Aa=vt.reduce((bn,Ln)=>Math.max(bn,Ln.delayMs),0);q.current.set(we,{taskId:F,delayAfterResume:Aa+200})}}else{const Yt=Ie.steps.length>0?Ie.steps[Ie.steps.length-1].delayMs:0;Ce(we,Ie.steps);const Bt=(Ye=Ie.steps[Ie.steps.length-1])==null?void 0:Ye.event.content;P(()=>{Bt==="completed"?x(zt=>zt.map(vt=>vt.id===F&&vt.status==="working"?{...vt,status:"paused"}:vt)):Bt==="failed"&&x(zt=>zt.map(vt=>vt.id===F&&vt.status==="working"?{...vt,status:"failed"}:vt))},Yt+100,we)}},[te,O,Ce,P,re,oe]),pt=y.useCallback((F,ne)=>{console.log("[MockGrackle] sendInput",{sessionId:F,text:ne}),oe({sessionId:F,eventType:"output",timestamp:new Date().toISOString(),content:`User input: ${ne}`}),re(F,"running"),oe({sessionId:F,eventType:"status",timestamp:new Date().toISOString(),content:"running"});const me=le.current.get(F);if(me)le.current.delete(F),Ce(F,me);else{const be=[{delayMs:500,event:{eventType:"output",timestamp:new Date().toISOString(),content:"I received your input, continuing..."}},{delayMs:1500,event:{eventType:"status",timestamp:new Date().toISOString(),content:"completed"}}];Ce(F,be)}const Te=q.current.get(F);Te&&(q.current.delete(F),P(()=>{x(be=>be.map(nt=>nt.id===Te.taskId&&nt.status==="working"?{...nt,status:"paused"}:nt))},Te.delayAfterResume,F))},[oe,re,Ce,P]),yn=y.useCallback(F=>{console.log("[MockGrackle] completeTask",F),x(ne=>ne.map(me=>me.id===F?{...me,status:"complete"}:me))},[]),Ke=y.useCallback(F=>{console.log("[MockGrackle] resumeTask",F)},[]),Pn=y.useCallback((F,ne,me,Te,be)=>{console.log("[MockGrackle] updateTask",{taskId:F,title:ne}),x(nt=>nt.map(we=>we.id===F?{...we,title:ne.trim()||we.title,description:me,dependsOn:Te,...be!==void 0?{defaultPersonaId:be}:{}}:we))},[]),Gn=y.useCallback(F=>{console.log("[MockGrackle] deleteTask",F),x(ne=>ne.filter(me=>me.id!==F))},[]),Bn=y.useCallback(F=>{console.log("[MockGrackle] loadFindings",F),T(ty.filter(ne=>ne.workspaceId===F))},[]),Ca=y.useCallback((F,ne,me,Te,be)=>{console.log("[MockGrackle] postFinding",{workspaceId:F,title:ne});const nt={id:te("find"),workspaceId:F,taskId:"",sessionId:"",category:Te||"general",title:ne,content:me,tags:be||[],createdAt:new Date().toISOString()};T(we=>[...we,nt])},[te]),$n=y.useCallback(()=>{console.log("[MockGrackle] loadEnvironments")},[]),Ea=y.useCallback((F,ne,me)=>{console.log("[MockGrackle] addEnvironment",{displayName:F,adapterType:ne,adapterConfig:me})},[]),ln=y.useCallback((F,ne)=>{console.log("[MockGrackle] updateEnvironment",{environmentId:F,...ne}),i(me=>me.map(Te=>Te.id!==F?Te:{...Te,...ne.displayName!==void 0?{displayName:ne.displayName}:{},...ne.adapterConfig!==void 0?{adapterConfig:JSON.stringify(ne.adapterConfig)}:{}}))},[]),Ee=y.useCallback(()=>{console.log("[MockGrackle] loadTokens")},[]),Dt=y.useCallback((F,ne,me,Te,be)=>{console.log("[MockGrackle] setToken",{name:F,tokenType:me}),w(nt=>[...nt.filter(He=>He.name!==F),{name:F,tokenType:me,envVar:Te,filePath:be,expiresAt:""}])},[]),Kt=y.useCallback(F=>{console.log("[MockGrackle] deleteToken",F),w(ne=>ne.filter(me=>me.name!==F))},[]),xl=y.useCallback(F=>{console.log("[MockGrackle] updateCredentialProviders",F),C(F)},[]);y.useEffect(()=>()=>{ae.current.forEach(clearTimeout),ae.current.clear()},[]);const Sl=y.useMemo(()=>({connected:!0,send:()=>{},environments:a,sessions:l,events:d,eventsDropped:0,lastSpawnedId:m,workspaces:v,tasks:b,findings:_,tokens:N,credentialProviders:k,spawn:je,sendInput:pt,kill:Se,refresh:Le,loadSessionEvents:ce,clearEvents:ue,loadWorkspaces:()=>{console.log("[MockGrackle] loadWorkspaces")},createWorkspace:fe,archiveWorkspace:tt,updateWorkspace:(F,ne)=>{console.log("[MockGrackle] updateWorkspace",{workspaceId:F,...ne}),g(me=>me.map(Te=>Te.id!==F?Te:{...Te,...ne.name!==void 0?{name:ne.name}:{},...ne.description!==void 0?{description:ne.description}:{},...ne.repoUrl!==void 0?{repoUrl:ne.repoUrl}:{},...ne.environmentId!==void 0?{environmentId:ne.environmentId}:{},...ne.workingDirectory!==void 0?{workingDirectory:ne.workingDirectory}:{},...ne.useWorktrees!==void 0?{useWorktrees:ne.useWorktrees}:{},...ne.defaultPersonaId!==void 0?{defaultPersonaId:ne.defaultPersonaId}:{},updatedAt:new Date().toISOString()}))},loadTasks:ee,loadAllTasks:()=>{console.log("[MockGrackle] loadAllTasks")},createTask:X,startTask:At,stopTask:F=>{console.log("[MockGrackle] stopTask",{taskId:F}),yn(F)},completeTask:yn,resumeTask:Ke,updateTask:Pn,deleteTask:Gn,loadFindings:Bn,postFinding:Ca,loadEnvironments:$n,addEnvironment:Ea,updateEnvironment:ln,loadTokens:Ee,setToken:Dt,deleteToken:Kt,updateCredentialProviders:xl,provisionStatus:{},provisionEnvironment:(F,ne)=>{},stopEnvironment:()=>{},removeEnvironment:()=>{},codespaces:[],codespaceError:"",codespaceListError:"",codespaceCreating:!1,listCodespaces:()=>{},createCodespace:()=>{},workspaceCreating:!1,taskStartingId:void 0,personas:A,createPersona:async(F,ne,me,Te,be,nt,we,He)=>{console.log("[MockGrackle] createPersona",{name:F});const Ie={id:`mock-persona-${Date.now()}`,name:F,description:ne,systemPrompt:me,toolConfig:"{}",runtime:Te??"claude-code",model:be||"",maxTurns:nt||0,mcpServers:"[]",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),type:we||"agent",script:He||""};return D(Ye=>[...Ye,Ie]),Ie},updatePersona:async(F,ne,me,Te,be,nt,we,He,Ie)=>{console.log("[MockGrackle] updatePersona",{personaId:F,name:ne});const Ye=A.find(zt=>zt.id===F);if(!Ye)throw new Error(`Persona not found: ${F}`);const Yt=new Date().toISOString(),Bt={...Ye,...ne!==void 0?{name:ne}:{},...me!==void 0?{description:me}:{},...Te!==void 0?{systemPrompt:Te}:{},...be!==void 0?{runtime:be}:{},...nt!==void 0?{model:nt}:{},...we!==void 0?{maxTurns:we}:{},...He!==void 0?{type:He}:{},...Ie!==void 0?{script:Ie}:{},updatedAt:Yt};return D(zt=>zt.map(vt=>vt.id===F?Bt:vt)),Bt},deletePersona:async F=>{console.log("[MockGrackle] deletePersona",F),D(ne=>ne.filter(me=>me.id!==F))},taskSessions:E,loadTaskSessions:F=>{console.log("[MockGrackle] loadTaskSessions",F)},appDefaultPersonaId:I,setAppDefaultPersonaId:async F=>{console.log("[MockGrackle] setAppDefaultPersonaId",F),z(F)},onboardingCompleted:!0,completeOnboarding:()=>{console.log("[MockGrackle] completeOnboarding")},usageCache:{"workspace:proj-alpha":{inputTokens:214500,outputTokens:44850,costUsd:1.12,sessionCount:4},"workspace:proj-beta":{inputTokens:86700,outputTokens:23800,costUsd:.48,sessionCount:3},"task:task-001":{inputTokens:126800,outputTokens:20850,costUsd:.63,sessionCount:2},"task:task-006":{inputTokens:18900,outputTokens:4500,costUsd:.1,sessionCount:1},"task_tree:task-001":{inputTokens:126800,outputTokens:20850,costUsd:.63,sessionCount:2},"task_tree:task-006":{inputTokens:18900,outputTokens:4500,costUsd:.1,sessionCount:1}},loadUsage:(F,ne)=>{console.log(`[MockGrackle] loadUsage(${F}, ${ne})`)},knowledge:{graphData:{nodes:[],links:[]},selectedNode:void 0,loading:!1,selectedId:void 0,searchQuery:"",search:()=>{},clearSearch:()=>{},selectNode:()=>{},clearSelection:()=>{},expandNode:()=>{},loadRecent:()=>{},handleEvent:()=>!1}}),[a,l,d,m,v,b,_,N,k,A,E,I,je,pt,Se,Le,ce,ue,fe,tt,ee,X,At,yn,Ke,Pn,Gn,Bn,Ca,$n,Ea,ln,Ee,Dt,Kt,xl]);return r.jsx(Wf.Provider,{value:Sl,children:n})}const db=y.createContext(void 0),wj=4e3;function Nj({children:n}){const[a,i]=y.useState([]),l=y.useRef(0),c=y.useCallback(f=>{i(m=>m.filter(p=>p.id!==f))},[]),d=y.useCallback((f,m="info",p=wj)=>{const v=`toast-${++l.current}`;i(g=>[...g,{id:v,message:f,variant:m,duration:p}])},[]);return r.jsx(db.Provider,{value:{toasts:a,showToast:d,dismissToast:c},children:n})}function Na(){const n=y.useContext(db);if(!n)throw new Error("useToast must be used within ToastProvider");return n}const gc=[{id:"grackle",label:"Grackle",description:"The default Grackle theme — iridescent purple on clean dark.",swatches:["#0e1218","#8b5cf6","#60a5fa","#e5e7eb","#34d399"],variantLightId:"grackle-light",variantDarkId:"grackle-dark"},{id:"grackle-light",label:"Grackle Light",description:"Light Grackle variant.",hidden:!0},{id:"grackle-dark",label:"Grackle Dark",description:"Dark Grackle variant.",hidden:!0},{id:"glass",label:"Glassmorphism",description:"Dark frosted-glass aesthetic with backdrop blur effects.",swatches:["#0a0c14","#4ecca3","#70a1ff","#e2e8f0","#a855f7"]},{id:"matrix",label:"Matrix",description:"Phosphor-green CRT terminal with scanlines and glow.",swatches:["#050505","#00ff41","#00bfff","#33ff77","#ffb000"]},{id:"brutalist",label:"Neubrutalism",description:"Thick borders, raw colors, bold type — ugly on purpose.",swatches:["#f5f0e8","#ff5757","#5ce1e6","#1a1a1a","#ffde59"],variantLightId:"brutalist-light",variantDarkId:"brutalist-dark"},{id:"brutalist-light",label:"Neubrutalism Light",description:"Light neubrutalism variant.",hidden:!0},{id:"brutalist-dark",label:"Neubrutalism Dark",description:"Dark neubrutalism variant.",hidden:!0},{id:"monokai",label:"Monokai",description:"Classic warm editor palette — pink, green, and purple.",swatches:["#272822","#f92672","#a6e22e","#f8f8f2","#ae81ff"],variantLightId:"monokai-light",variantDarkId:"monokai-dark"},{id:"monokai-dark",label:"Monokai Dark",description:"Dark Monokai variant.",hidden:!0},{id:"monokai-light",label:"Monokai Light",description:"Light Monokai variant.",hidden:!0},{id:"ubuntu",label:"Ubuntu",description:"Aubergine terminal with the GNOME Tango palette.",swatches:["#300a24","#8ae234","#ef2929","#eeeeec","#fce94f"]},{id:"sandstone",label:"Sandstone",description:"Warm terracotta accent on dark brown, in the style of Claude Code.",swatches:["#1a1815","#C15F3C","#6b8afd","#e8e6e3","#a78bfa"]},{id:"verdigris",label:"Verdigris",description:"Teal accent on charcoal, in the style of ChatGPT.",swatches:["#141414","#00a67e","#3b82f6","#ececec","#ab68ff"]},{id:"primer",label:"Primer",description:"Blue accent on ink-dark grey, in the style of GitHub.",swatches:["#0d1117","#58a6ff","#3fb950","#c9d1d9","#bc8cff"]}],fb=new Set(gc.map(n=>n.id)),sy="grackle";function yf(n){return gc.find(a=>a.id===n)}const bf="grackle-theme",hb="grackle-prefer-system",mb="(prefers-color-scheme: dark)";let Fo=[],Xr;function Yd(){Xr=void 0;for(const n of Fo)n()}function xf(){return typeof window>"u"?!1:window.matchMedia(mb).matches}function el(){if(typeof localStorage>"u")return sy;try{const n=localStorage.getItem(bf);if(n!==null&&fb.has(n))return n}catch{}return sy}function nc(){if(typeof localStorage>"u")return!1;try{return localStorage.getItem(hb)==="true"}catch{return!1}}function Sf(n){return gc.find(a=>a.variantLightId===n||a.variantDarkId===n)}function pb(n,a){const i=yf(n);if(i!=null&&i.variantDarkId)return a&&i.variantLightId?xf()?i.variantDarkId:i.variantLightId:i.variantDarkId;if(i!=null&&i.hidden&&a){const l=Sf(n);if(l!=null&&l.variantLightId&&l.variantDarkId)return xf()?l.variantDarkId:l.variantLightId}return n}function Di(n,a,i=!1){i&&document.documentElement.classList.add("no-transitions"),document.documentElement.dataset.theme=pb(n,a),i&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove("no-transitions")}))}typeof document<"u"&&Di(el(),nc());function Cj(){return Xr===void 0&&(Xr={themeId:el(),systemDark:xf(),preferSystem:nc()}),Xr}function Ej(n){return Fo=[...Fo,n],()=>{Fo=Fo.filter(a=>a!==n)}}function Aj(){const n=y.useSyncExternalStore(Ej,Cj),{themeId:a,preferSystem:i}=n,l=pb(a,i),c=y.useCallback(f=>{if(fb.has(f)){try{localStorage.setItem(bf,f)}catch{}Di(f,nc(),!0),Yd()}},[]),d=y.useCallback(f=>{try{localStorage.setItem(hb,f?"true":"false")}catch{}if(f){const m=el(),p=yf(m);if(p!=null&&p.hidden){const v=Sf(m);if(v)try{localStorage.setItem(bf,v.id)}catch{}}}Di(el(),f,!0),Yd()},[]);return y.useEffect(()=>{Di(a,i)},[a,i]),y.useEffect(()=>{if(typeof window>"u")return;const f=window.matchMedia(mb),m=()=>{const p=el(),v=nc();if(v){const g=yf(p);if(g!=null&&g.variantDarkId&&g.variantLightId&&Di(p,v),g!=null&&g.hidden){const b=Sf(p);b!=null&&b.variantDarkId&&b.variantLightId&&Di(p,v)}}Yd()};return f.addEventListener("change",m),()=>{f.removeEventListener("change",m)}},[]),{themeId:a,setTheme:c,resolvedThemeId:l,preferSystem:i,setPreferSystem:d}}const vb=y.createContext(void 0);function Dj({children:n}){const a=Aj();return r.jsx(vb.Provider,{value:a,children:n})}function gb(){const n=y.useContext(vb);if(!n)throw new Error("useThemeContext must be used within ThemeProvider");return n}const Rj="_container_1mq5u_1",Mj="_hamburger_1mq5u_33",Oj="_brand_1mq5u_49",Bj="_brandLogo_1mq5u_68",Lj="_info_1mq5u_75",Ij="_connectionLabel_1mq5u_90",zj="_connectionDot_1mq5u_103",Uj="_connected_1mq5u_106",Vj="_disconnected_1mq5u_110",ba={container:Rj,hamburger:Mj,brand:Oj,brandLogo:Bj,info:Lj,connectionLabel:Ij,connectionDot:zj,connected:Uj,disconnected:Vj};function Hj({connected:n,environments:a,sessions:i,onToggleSidebar:l,sidebarOpen:c}){const d=xt(),f=a.length,m=a.filter(v=>v.status==="connected").length,p=i.filter(v=>["running","idle"].includes(v.status)).length;return r.jsxs("div",{className:ba.container,children:[l&&r.jsx("button",{type:"button",className:ba.hamburger,onClick:l,"aria-label":"Toggle sidebar","aria-expanded":c,children:"☰"}),r.jsxs("button",{type:"button",className:ba.brand,onClick:()=>d(zs),title:"Home",children:[r.jsx("img",{src:"/icon-192x192.png",alt:"",className:ba.brandLogo,"aria-hidden":"true","data-testid":"statusbar-logo"}),"Grackle"]}),r.jsxs("div",{className:ba.info,children:[r.jsxs("span",{"aria-label":n?"Connected":"Disconnected",children:[r.jsx("span",{className:`${ba.connectionDot} ${n?ba.connected:ba.disconnected}`,"aria-hidden":"true",children:"●"})," ",r.jsx("span",{className:ba.connectionLabel,"aria-hidden":"true",children:n?"Connected":"Disconnected"})]}),r.jsxs("span",{children:[m,"/",f," env",f!==1?"s":""]}),r.jsxs("span",{children:[p," active"]})]})]})}const Pj="_nav_13gkc_1",Gj="_tab_13gkc_35",$j="_tabIcon_13gkc_68",qj="_tabLabel_13gkc_79",Kj="_tabActive_13gkc_84",qo={nav:Pj,tab:Gj,tabIcon:$j,tabLabel:qj,tabActive:Kj},Cs=[{view:"dashboard",label:"Dashboard",icon:"🏠",route:zs,testId:"sidebar-tab-dashboard"},{view:"chat",label:"Chat",icon:"💬",route:$k,testId:"sidebar-tab-chat"},{view:"tasks",label:"Tasks",icon:"📋",route:qk,testId:"sidebar-tab-tasks"},{view:"environments",label:"Environments",icon:"🖥️",route:Vi,testId:"sidebar-tab-environments"},{view:"knowledge",label:"Knowledge",icon:"🧠",route:ub,testId:"sidebar-tab-knowledge"},{view:"settings",label:"Settings",icon:"⚙️",route:Vk,testId:"sidebar-tab-settings"}];function Yj(n){return n===zs||n==="/"?"dashboard":n.startsWith("/chat")||n.startsWith("/sessions")?"chat":n.startsWith("/workspaces")||n.startsWith("/environments")?"environments":n.startsWith(ub)?"knowledge":n.startsWith(zi)?"settings":"tasks"}function Fj(){const n=Ot(),a=xt(),i=y.useRef(null),l=Yj(n.pathname),c=y.useCallback(f=>{a(f.route)},[a]),d=y.useCallback(f=>{var b,x;const m=(b=i.current)==null?void 0:b.querySelectorAll('[role="tab"]');if(!m)return;const p=Array.from(m).findIndex(_=>_===document.activeElement),v=p>=0?p:Cs.findIndex(_=>_.view===l);let g=v;if(f.key==="ArrowRight"||f.key==="j"||f.key==="J")f.preventDefault(),g=(v+1)%Cs.length;else if(f.key==="ArrowLeft"||f.key==="k"||f.key==="K")f.preventDefault(),g=(v-1+Cs.length)%Cs.length;else if(f.key==="Home")f.preventDefault(),g=0;else if(f.key==="End")f.preventDefault(),g=Cs.length-1;else return;a(Cs[g].route),(x=m[g])==null||x.focus()},[l,a]);return r.jsx("nav",{className:qo.nav,ref:i,role:"tablist","aria-orientation":"horizontal","aria-label":"App navigation",onKeyDown:d,"data-testid":"sidebar-nav",children:Cs.map(f=>{const m=f.view===l;return r.jsxs("button",{role:"tab",type:"button","aria-selected":m,tabIndex:m?0:-1,className:`${qo.tab} ${m?qo.tabActive:""}`,onClick:()=>c(f),"data-testid":f.testId,title:f.label,"aria-label":f.label,children:[r.jsx("span",{className:qo.tabIcon,"aria-hidden":"true",children:f.icon}),r.jsx("span",{className:qo.tabLabel,children:f.label})]},f.view)})})}const yb=y.createContext(void 0),bb=y.createContext(void 0);function Zj({children:n}){const[a,i]=y.useState(void 0),l=y.useCallback(c=>{i(c)},[]);return r.jsx(bb.Provider,{value:l,children:r.jsx(yb.Provider,{value:a,children:n})})}function xb(){return y.useContext(yb)}function Xj(){const n=y.useContext(bb);if(n===void 0)throw new Error("useSidebarSetter must be used within a SidebarProvider");return n}const Qj="_container_pi6ii_1",Wj="_content_pi6ii_66",iy={container:Qj,content:Wj},Jj=320,Sb=220,_b=600,Tb="grackle-sidebar-width";function ew(){try{const n=localStorage.getItem(Tb);if(n!==null){const a=Number(n);if(Number.isFinite(a)&&a>=Sb&&a<=_b)return a}}catch{}return Jj}function tw(n){try{localStorage.setItem(Tb,String(n))}catch{}}function nw(){const[n]=y.useState(ew),a=y.useRef(null),i=xb();if(y.useEffect(()=>{const l=a.current;if(!l)return;const c=new ResizeObserver(d=>{for(const f of d){const m=f.borderBoxSize[0];if(m){const p=Math.round(m.inlineSize);p>=Sb&&p<=_b&&tw(p)}}});return c.observe(l),()=>{c.disconnect()}},[]),i!==void 0)return r.jsx("div",{className:iy.container,ref:a,"data-testid":"sidebar",style:{width:n},children:r.jsx("div",{className:iy.content,children:i})})}function yc(n){const a=Xj();y.useLayoutEffect(()=>(a(n),()=>{a(void 0)}),[n,a])}const Jf=y.createContext({});function eh(n){const a=y.useRef(null);return a.current===null&&(a.current=n()),a.current}const bc=y.createContext(null),th=y.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"});class aw extends y.Component{getSnapshotBeforeUpdate(a){const i=this.props.childRef.current;if(i&&a.isPresent&&!this.props.isPresent){const l=this.props.sizeRef.current;l.height=i.offsetHeight||0,l.width=i.offsetWidth||0,l.top=i.offsetTop,l.left=i.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function sw({children:n,isPresent:a}){const i=y.useId(),l=y.useRef(null),c=y.useRef({width:0,height:0,top:0,left:0}),{nonce:d}=y.useContext(th);return y.useInsertionEffect(()=>{const{width:f,height:m,top:p,left:v}=c.current;if(a||!l.current||!f||!m)return;l.current.dataset.motionPopId=i;const g=document.createElement("style");return d&&(g.nonce=d),document.head.appendChild(g),g.sheet&&g.sheet.insertRule(`
|
|
91
|
+
[data-motion-pop-id="${i}"] {
|
|
92
|
+
position: absolute !important;
|
|
93
|
+
width: ${f}px !important;
|
|
94
|
+
height: ${m}px !important;
|
|
95
|
+
top: ${p}px !important;
|
|
96
|
+
left: ${v}px !important;
|
|
97
|
+
}
|
|
98
|
+
`),()=>{document.head.removeChild(g)}},[a]),r.jsx(aw,{isPresent:a,childRef:l,sizeRef:c,children:y.cloneElement(n,{ref:l})})}const iw=({children:n,initial:a,isPresent:i,onExitComplete:l,custom:c,presenceAffectsLayout:d,mode:f})=>{const m=eh(ow),p=y.useId(),v=y.useCallback(b=>{m.set(b,!0);for(const x of m.values())if(!x)return;l&&l()},[m,l]),g=y.useMemo(()=>({id:p,initial:a,isPresent:i,custom:c,onExitComplete:v,register:b=>(m.set(b,!1),()=>m.delete(b))}),d?[Math.random(),v]:[i,v]);return y.useMemo(()=>{m.forEach((b,x)=>m.set(x,!1))},[i]),y.useEffect(()=>{!i&&!m.size&&l&&l()},[i]),f==="popLayout"&&(n=r.jsx(sw,{isPresent:i,children:n})),r.jsx(bc.Provider,{value:g,children:n})};function ow(){return new Map}function kb(n=!0){const a=y.useContext(bc);if(a===null)return[!0,null];const{isPresent:i,onExitComplete:l,register:c}=a,d=y.useId();y.useEffect(()=>{n&&c(d)},[n]);const f=y.useCallback(()=>n&&l&&l(d),[d,l,n]);return!i&&l?[!1,f]:[!0]}const Vr=n=>n.key||"";function oy(n){const a=[];return y.Children.forEach(n,i=>{y.isValidElement(i)&&a.push(i)}),a}const nh=typeof window<"u",jb=nh?y.useLayoutEffect:y.useEffect,ea=({children:n,custom:a,initial:i=!0,onExitComplete:l,presenceAffectsLayout:c=!0,mode:d="sync",propagate:f=!1})=>{const[m,p]=kb(f),v=y.useMemo(()=>oy(n),[n]),g=f&&!m?[]:v.map(Vr),b=y.useRef(!0),x=y.useRef(v),_=eh(()=>new Map),[T,N]=y.useState(v),[w,k]=y.useState(v);jb(()=>{b.current=!1,x.current=v;for(let D=0;D<w.length;D++){const E=Vr(w[D]);g.includes(E)?_.delete(E):_.get(E)!==!0&&_.set(E,!1)}},[w,g.length,g.join("-")]);const C=[];if(v!==T){let D=[...v];for(let E=0;E<w.length;E++){const I=w[E],z=Vr(I);g.includes(z)||(D.splice(E,0,I),C.push(I))}d==="wait"&&C.length&&(D=C),k(oy(D)),N(v);return}const{forceRender:A}=y.useContext(Jf);return r.jsx(r.Fragment,{children:w.map(D=>{const E=Vr(D),I=f&&!m?!1:v===w||g.includes(E),z=()=>{if(_.has(E))_.set(E,!0);else return;let U=!0;_.forEach(Y=>{Y||(U=!1)}),U&&(A==null||A(),k(x.current),f&&(p==null||p()),l&&l())};return r.jsx(iw,{isPresent:I,initial:!b.current||i?void 0:!1,custom:I?void 0:a,presenceAffectsLayout:c,mode:d,onExitComplete:I?void 0:z,children:D},E)})})},pn=n=>n;let wb=pn;const lw={useManualTiming:!1};function rw(n){let a=new Set,i=new Set,l=!1,c=!1;const d=new WeakSet;let f={delta:0,timestamp:0,isProcessing:!1};function m(v){d.has(v)&&(p.schedule(v),n()),v(f)}const p={schedule:(v,g=!1,b=!1)=>{const _=b&&l?a:i;return g&&d.add(v),_.has(v)||_.add(v),v},cancel:v=>{i.delete(v),d.delete(v)},process:v=>{if(f=v,l){c=!0;return}l=!0,[a,i]=[i,a],a.forEach(m),a.clear(),l=!1,c&&(c=!1,p.process(v))}};return p}const Hr=["read","resolveKeyframes","update","preRender","render","postRender"],cw=40;function Nb(n,a){let i=!1,l=!0;const c={delta:0,timestamp:0,isProcessing:!1},d=()=>i=!0,f=Hr.reduce((k,C)=>(k[C]=rw(d),k),{}),{read:m,resolveKeyframes:p,update:v,preRender:g,render:b,postRender:x}=f,_=()=>{const k=performance.now();i=!1,c.delta=l?1e3/60:Math.max(Math.min(k-c.timestamp,cw),1),c.timestamp=k,c.isProcessing=!0,m.process(c),p.process(c),v.process(c),g.process(c),b.process(c),x.process(c),c.isProcessing=!1,i&&a&&(l=!1,n(_))},T=()=>{i=!0,l=!0,c.isProcessing||n(_)};return{schedule:Hr.reduce((k,C)=>{const A=f[C];return k[C]=(D,E=!1,I=!1)=>(i||T(),A.schedule(D,E,I)),k},{}),cancel:k=>{for(let C=0;C<Hr.length;C++)f[Hr[C]].cancel(k)},state:c,steps:f}}const{schedule:ct,cancel:is,state:$t,steps:Fd}=Nb(typeof requestAnimationFrame<"u"?requestAnimationFrame:pn,!0),Cb=y.createContext({strict:!1}),ly={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"]},Pi={};for(const n in ly)Pi[n]={isEnabled:a=>ly[n].some(i=>!!a[i])};function uw(n){for(const a in n)Pi[a]={...Pi[a],...n[a]}}const dw=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","ignoreStrict","viewport"]);function ac(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||dw.has(n)}let Eb=n=>!ac(n);function fw(n){n&&(Eb=a=>a.startsWith("on")?!ac(a):n(a))}try{fw(require("@emotion/is-prop-valid").default)}catch{}function hw(n,a,i){const l={};for(const c in n)c==="values"&&typeof n.values=="object"||(Eb(c)||i===!0&&ac(c)||!a&&!ac(c)||n.draggable&&c.startsWith("onDrag"))&&(l[c]=n[c]);return l}function mw(n){if(typeof Proxy>"u")return n;const a=new Map,i=(...l)=>n(...l);return new Proxy(i,{get:(l,c)=>c==="create"?n:(a.has(c)||a.set(c,n(c)),a.get(c))})}const xc=y.createContext({});function rl(n){return typeof n=="string"||Array.isArray(n)}function Sc(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}const ah=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],sh=["initial",...ah];function _c(n){return Sc(n.animate)||sh.some(a=>rl(n[a]))}function Ab(n){return!!(_c(n)||n.variants)}function pw(n,a){if(_c(n)){const{initial:i,animate:l}=n;return{initial:i===!1||rl(i)?i:void 0,animate:rl(l)?l:void 0}}return n.inherit!==!1?a:{}}function vw(n){const{initial:a,animate:i}=pw(n,y.useContext(xc));return y.useMemo(()=>({initial:a,animate:i}),[ry(a),ry(i)])}function ry(n){return Array.isArray(n)?n.join(" "):n}const gw=Symbol.for("motionComponentSymbol");function Ri(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function yw(n,a,i){return y.useCallback(l=>{l&&n.onMount&&n.onMount(l),a&&(l?a.mount(l):a.unmount()),i&&(typeof i=="function"?i(l):Ri(i)&&(i.current=l))},[a])}const ih=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),bw="framerAppearId",Db="data-"+ih(bw),{schedule:oh}=Nb(queueMicrotask,!1),Rb=y.createContext({});function xw(n,a,i,l,c){var d,f;const{visualElement:m}=y.useContext(xc),p=y.useContext(Cb),v=y.useContext(bc),g=y.useContext(th).reducedMotion,b=y.useRef(null);l=l||p.renderer,!b.current&&l&&(b.current=l(n,{visualState:a,parent:m,props:i,presenceContext:v,blockInitialAnimation:v?v.initial===!1:!1,reducedMotionConfig:g}));const x=b.current,_=y.useContext(Rb);x&&!x.projection&&c&&(x.type==="html"||x.type==="svg")&&Sw(b.current,i,c,_);const T=y.useRef(!1);y.useInsertionEffect(()=>{x&&T.current&&x.update(i,v)});const N=i[Db],w=y.useRef(!!N&&!(!((d=window.MotionHandoffIsComplete)===null||d===void 0)&&d.call(window,N))&&((f=window.MotionHasOptimisedAnimation)===null||f===void 0?void 0:f.call(window,N)));return jb(()=>{x&&(T.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),oh.render(x.render),w.current&&x.animationState&&x.animationState.animateChanges())}),y.useEffect(()=>{x&&(!w.current&&x.animationState&&x.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var k;(k=window.MotionHandoffMarkAsComplete)===null||k===void 0||k.call(window,N)}),w.current=!1))}),x}function Sw(n,a,i,l){const{layoutId:c,layout:d,drag:f,dragConstraints:m,layoutScroll:p,layoutRoot:v}=a;n.projection=new i(n.latestValues,a["data-framer-portal-id"]?void 0:Mb(n.parent)),n.projection.setOptions({layoutId:c,layout:d,alwaysMeasureLayout:!!f||m&&Ri(m),visualElement:n,animationType:typeof d=="string"?d:"both",initialPromotionConfig:l,layoutScroll:p,layoutRoot:v})}function Mb(n){if(n)return n.options.allowProjection!==!1?n.projection:Mb(n.parent)}function _w({preloadedFeatures:n,createVisualElement:a,useRender:i,useVisualState:l,Component:c}){var d,f;n&&uw(n);function m(v,g){let b;const x={...y.useContext(th),...v,layoutId:Tw(v)},{isStatic:_}=x,T=vw(v),N=l(v,_);if(!_&&nh){kw();const w=jw(x);b=w.MeasureLayout,T.visualElement=xw(c,N,x,a,w.ProjectionNode)}return r.jsxs(xc.Provider,{value:T,children:[b&&T.visualElement?r.jsx(b,{visualElement:T.visualElement,...x}):null,i(c,v,yw(N,T.visualElement,g),N,_,T.visualElement)]})}m.displayName=`motion.${typeof c=="string"?c:`create(${(f=(d=c.displayName)!==null&&d!==void 0?d:c.name)!==null&&f!==void 0?f:""})`}`;const p=y.forwardRef(m);return p[gw]=c,p}function Tw({layoutId:n}){const a=y.useContext(Jf).id;return a&&n!==void 0?a+"-"+n:n}function kw(n,a){y.useContext(Cb).strict}function jw(n){const{drag:a,layout:i}=Pi;if(!a&&!i)return{};const l={...a,...i};return{MeasureLayout:a!=null&&a.isEnabled(n)||i!=null&&i.isEnabled(n)?l.MeasureLayout:void 0,ProjectionNode:l.ProjectionNode}}const ww=["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 lh(n){return typeof n!="string"||n.includes("-")?!1:!!(ww.indexOf(n)>-1||/[A-Z]/u.test(n))}function cy(n){const a=[{},{}];return n==null||n.values.forEach((i,l)=>{a[0][l]=i.get(),a[1][l]=i.getVelocity()}),a}function rh(n,a,i,l){if(typeof a=="function"){const[c,d]=cy(l);a=a(i!==void 0?i:n.custom,c,d)}if(typeof a=="string"&&(a=n.variants&&n.variants[a]),typeof a=="function"){const[c,d]=cy(l);a=a(i!==void 0?i:n.custom,c,d)}return a}const _f=n=>Array.isArray(n),Nw=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),Cw=n=>_f(n)?n[n.length-1]||0:n,Zt=n=>!!(n&&n.getVelocity);function Qr(n){const a=Zt(n)?n.get():n;return Nw(a)?a.toValue():a}function Ew({scrapeMotionValuesFromProps:n,createRenderState:a,onUpdate:i},l,c,d){const f={latestValues:Aw(l,c,d,n),renderState:a()};return i&&(f.onMount=m=>i({props:l,current:m,...f}),f.onUpdate=m=>i(m)),f}const Ob=n=>(a,i)=>{const l=y.useContext(xc),c=y.useContext(bc),d=()=>Ew(n,a,l,c);return i?d():eh(d)};function Aw(n,a,i,l){const c={},d=l(n,{});for(const x in d)c[x]=Qr(d[x]);let{initial:f,animate:m}=n;const p=_c(n),v=Ab(n);a&&v&&!p&&n.inherit!==!1&&(f===void 0&&(f=a.initial),m===void 0&&(m=a.animate));let g=i?i.initial===!1:!1;g=g||f===!1;const b=g?m:f;if(b&&typeof b!="boolean"&&!Sc(b)){const x=Array.isArray(b)?b:[b];for(let _=0;_<x.length;_++){const T=rh(n,x[_]);if(T){const{transitionEnd:N,transition:w,...k}=T;for(const C in k){let A=k[C];if(Array.isArray(A)){const D=g?A.length-1:0;A=A[D]}A!==null&&(c[C]=A)}for(const C in N)c[C]=N[C]}}}return c}const Fi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],$s=new Set(Fi),Bb=n=>a=>typeof a=="string"&&a.startsWith(n),Lb=Bb("--"),Dw=Bb("var(--"),ch=n=>Dw(n)?Rw.test(n.split("/*")[0].trim()):!1,Rw=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ib=(n,a)=>a&&typeof n=="number"?a.transform(n):n,wa=(n,a,i)=>i>a?a:i<n?n:i,Zi={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},cl={...Zi,transform:n=>wa(0,1,n)},Pr={...Zi,default:1},vl=n=>({test:a=>typeof a=="string"&&a.endsWith(n)&&a.split(" ").length===1,parse:parseFloat,transform:a=>`${a}${n}`}),ss=vl("deg"),Qn=vl("%"),xe=vl("px"),Mw=vl("vh"),Ow=vl("vw"),uy={...Qn,parse:n=>Qn.parse(n)/100,transform:n=>Qn.transform(n*100)},Bw={borderWidth:xe,borderTopWidth:xe,borderRightWidth:xe,borderBottomWidth:xe,borderLeftWidth:xe,borderRadius:xe,radius:xe,borderTopLeftRadius:xe,borderTopRightRadius:xe,borderBottomRightRadius:xe,borderBottomLeftRadius:xe,width:xe,maxWidth:xe,height:xe,maxHeight:xe,top:xe,right:xe,bottom:xe,left:xe,padding:xe,paddingTop:xe,paddingRight:xe,paddingBottom:xe,paddingLeft:xe,margin:xe,marginTop:xe,marginRight:xe,marginBottom:xe,marginLeft:xe,backgroundPositionX:xe,backgroundPositionY:xe},Lw={rotate:ss,rotateX:ss,rotateY:ss,rotateZ:ss,scale:Pr,scaleX:Pr,scaleY:Pr,scaleZ:Pr,skew:ss,skewX:ss,skewY:ss,distance:xe,translateX:xe,translateY:xe,translateZ:xe,x:xe,y:xe,z:xe,perspective:xe,transformPerspective:xe,opacity:cl,originX:uy,originY:uy,originZ:xe},dy={...Zi,transform:Math.round},uh={...Bw,...Lw,zIndex:dy,size:xe,fillOpacity:cl,strokeOpacity:cl,numOctaves:dy},Iw={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},zw=Fi.length;function Uw(n,a,i){let l="",c=!0;for(let d=0;d<zw;d++){const f=Fi[d],m=n[f];if(m===void 0)continue;let p=!0;if(typeof m=="number"?p=m===(f.startsWith("scale")?1:0):p=parseFloat(m)===0,!p||i){const v=Ib(m,uh[f]);if(!p){c=!1;const g=Iw[f]||f;l+=`${g}(${v}) `}i&&(a[f]=v)}}return l=l.trim(),i?l=i(a,c?"":l):c&&(l="none"),l}function dh(n,a,i){const{style:l,vars:c,transformOrigin:d}=n;let f=!1,m=!1;for(const p in a){const v=a[p];if($s.has(p)){f=!0;continue}else if(Lb(p)){c[p]=v;continue}else{const g=Ib(v,uh[p]);p.startsWith("origin")?(m=!0,d[p]=g):l[p]=g}}if(a.transform||(f||i?l.transform=Uw(a,n.transform,i):l.transform&&(l.transform="none")),m){const{originX:p="50%",originY:v="50%",originZ:g=0}=d;l.transformOrigin=`${p} ${v} ${g}`}}const Vw={offset:"stroke-dashoffset",array:"stroke-dasharray"},Hw={offset:"strokeDashoffset",array:"strokeDasharray"};function Pw(n,a,i=1,l=0,c=!0){n.pathLength=1;const d=c?Vw:Hw;n[d.offset]=xe.transform(-l);const f=xe.transform(a),m=xe.transform(i);n[d.array]=`${f} ${m}`}function fy(n,a,i){return typeof n=="string"?n:xe.transform(a+i*n)}function Gw(n,a,i){const l=fy(a,n.x,n.width),c=fy(i,n.y,n.height);return`${l} ${c}`}function fh(n,{attrX:a,attrY:i,attrScale:l,originX:c,originY:d,pathLength:f,pathSpacing:m=1,pathOffset:p=0,...v},g,b){if(dh(n,v,b),g){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:x,style:_,dimensions:T}=n;x.transform&&(T&&(_.transform=x.transform),delete x.transform),T&&(c!==void 0||d!==void 0||_.transform)&&(_.transformOrigin=Gw(T,c!==void 0?c:.5,d!==void 0?d:.5)),a!==void 0&&(x.x=a),i!==void 0&&(x.y=i),l!==void 0&&(x.scale=l),f!==void 0&&Pw(x,f,m,p,!1)}const hh=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),zb=()=>({...hh(),attrs:{}}),mh=n=>typeof n=="string"&&n.toLowerCase()==="svg";function Ub(n,{style:a,vars:i},l,c){Object.assign(n.style,a,c&&c.getProjectionStyles(l));for(const d in i)n.style.setProperty(d,i[d])}const Vb=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"]);function Hb(n,a,i,l){Ub(n,a,void 0,l);for(const c in a.attrs)n.setAttribute(Vb.has(c)?c:ih(c),a.attrs[c])}const sc={};function $w(n){Object.assign(sc,n)}function Pb(n,{layout:a,layoutId:i}){return $s.has(n)||n.startsWith("origin")||(a||i!==void 0)&&(!!sc[n]||n==="opacity")}function ph(n,a,i){var l;const{style:c}=n,d={};for(const f in c)(Zt(c[f])||a.style&&Zt(a.style[f])||Pb(f,n)||((l=i==null?void 0:i.getValue(f))===null||l===void 0?void 0:l.liveStyle)!==void 0)&&(d[f]=c[f]);return d}function Gb(n,a,i){const l=ph(n,a,i);for(const c in n)if(Zt(n[c])||Zt(a[c])){const d=Fi.indexOf(c)!==-1?"attr"+c.charAt(0).toUpperCase()+c.substring(1):c;l[d]=n[c]}return l}function qw(n,a){try{a.dimensions=typeof n.getBBox=="function"?n.getBBox():n.getBoundingClientRect()}catch{a.dimensions={x:0,y:0,width:0,height:0}}}const hy=["x","y","width","height","cx","cy","r"],Kw={useVisualState:Ob({scrapeMotionValuesFromProps:Gb,createRenderState:zb,onUpdate:({props:n,prevProps:a,current:i,renderState:l,latestValues:c})=>{if(!i)return;let d=!!n.drag;if(!d){for(const m in c)if($s.has(m)){d=!0;break}}if(!d)return;let f=!a;if(a)for(let m=0;m<hy.length;m++){const p=hy[m];n[p]!==a[p]&&(f=!0)}f&&ct.read(()=>{qw(i,l),ct.render(()=>{fh(l,c,mh(i.tagName),n.transformTemplate),Hb(i,l)})})}})},Yw={useVisualState:Ob({scrapeMotionValuesFromProps:ph,createRenderState:hh})};function $b(n,a,i){for(const l in a)!Zt(a[l])&&!Pb(l,i)&&(n[l]=a[l])}function Fw({transformTemplate:n},a){return y.useMemo(()=>{const i=hh();return dh(i,a,n),Object.assign({},i.vars,i.style)},[a])}function Zw(n,a){const i=n.style||{},l={};return $b(l,i,n),Object.assign(l,Fw(n,a)),l}function Xw(n,a){const i={},l=Zw(n,a);return n.drag&&n.dragListener!==!1&&(i.draggable=!1,l.userSelect=l.WebkitUserSelect=l.WebkitTouchCallout="none",l.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(i.tabIndex=0),i.style=l,i}function Qw(n,a,i,l){const c=y.useMemo(()=>{const d=zb();return fh(d,a,mh(l),n.transformTemplate),{...d.attrs,style:{...d.style}}},[a]);if(n.style){const d={};$b(d,n.style,n),c.style={...d,...c.style}}return c}function Ww(n=!1){return(i,l,c,{latestValues:d},f)=>{const p=(lh(i)?Qw:Xw)(l,d,f,i),v=hw(l,typeof i=="string",n),g=i!==y.Fragment?{...v,...p,ref:c}:{},{children:b}=l,x=y.useMemo(()=>Zt(b)?b.get():b,[b]);return y.createElement(i,{...g,children:x})}}function Jw(n,a){return function(l,{forwardMotionProps:c}={forwardMotionProps:!1}){const f={...lh(l)?Kw:Yw,preloadedFeatures:n,useRender:Ww(c),createVisualElement:a,Component:l};return _w(f)}}function qb(n,a){if(!Array.isArray(a))return!1;const i=a.length;if(i!==n.length)return!1;for(let l=0;l<i;l++)if(a[l]!==n[l])return!1;return!0}function Tc(n,a,i){const l=n.getProps();return rh(l,a,i!==void 0?i:l.custom,n)}function vh(n,a){return n?n[a]||n.default||n:void 0}const Kb=new Set(["width","height","top","left","right","bottom",...Fi]);let Wr;function eN(){Wr=void 0}const Wn={now:()=>(Wr===void 0&&Wn.set($t.isProcessing||lw.useManualTiming?$t.timestamp:performance.now()),Wr),set:n=>{Wr=n,queueMicrotask(eN)}};function gh(n,a){n.indexOf(a)===-1&&n.push(a)}function yh(n,a){const i=n.indexOf(a);i>-1&&n.splice(i,1)}class bh{constructor(){this.subscriptions=[]}add(a){return gh(this.subscriptions,a),()=>yh(this.subscriptions,a)}notify(a,i,l){const c=this.subscriptions.length;if(c)if(c===1)this.subscriptions[0](a,i,l);else for(let d=0;d<c;d++){const f=this.subscriptions[d];f&&f(a,i,l)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Yb(n,a){return a?n*(1e3/a):0}const my=30,tN=n=>!isNaN(parseFloat(n));class nN{constructor(a,i={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(l,c=!0)=>{const d=Wn.now();this.updatedAt!==d&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(l),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),c&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(a),this.owner=i.owner}setCurrent(a){this.current=a,this.updatedAt=Wn.now(),this.canTrackVelocity===null&&a!==void 0&&(this.canTrackVelocity=tN(this.current))}setPrevFrameValue(a=this.current){this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt}onChange(a){return this.on("change",a)}on(a,i){this.events[a]||(this.events[a]=new bh);const l=this.events[a].add(i);return a==="change"?()=>{l(),ct.read(()=>{this.events.change.getSize()||this.stop()})}:l}clearListeners(){for(const a in this.events)this.events[a].clear()}attach(a,i){this.passiveEffect=a,this.stopPassiveEffect=i}set(a,i=!0){!i||!this.passiveEffect?this.updateAndNotify(a,i):this.passiveEffect(a,this.updateAndNotify)}setWithVelocity(a,i,l){this.set(i),this.prev=void 0,this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt-l}jump(a,i=!0){this.updateAndNotify(a),this.prev=a,this.prevUpdatedAt=this.prevFrameValue=void 0,i&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const a=Wn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||a-this.updatedAt>my)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,my);return Yb(parseFloat(this.current)-parseFloat(this.prevFrameValue),i)}start(a){return this.stop(),new Promise(i=>{this.hasAnimated=!0,this.animation=a(i),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(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ul(n,a){return new nN(n,a)}function aN(n,a,i){n.hasValue(a)?n.getValue(a).set(i):n.addValue(a,ul(i))}function sN(n,a){const i=Tc(n,a);let{transitionEnd:l={},transition:c={},...d}=i||{};d={...d,...l};for(const f in d){const m=Cw(d[f]);aN(n,f,m)}}function iN(n){return!!(Zt(n)&&n.add)}function Tf(n,a){const i=n.getValue("willChange");if(iN(i))return i.add(a)}function Fb(n){return n.props[Db]}function xh(n){let a;return()=>(a===void 0&&(a=n()),a)}const oN=xh(()=>window.ScrollTimeline!==void 0);class lN{constructor(a){this.stop=()=>this.runAll("stop"),this.animations=a.filter(Boolean)}get finished(){return Promise.all(this.animations.map(a=>"finished"in a?a.finished:a))}getAll(a){return this.animations[0][a]}setAll(a,i){for(let l=0;l<this.animations.length;l++)this.animations[l][a]=i}attachTimeline(a,i){const l=this.animations.map(c=>{if(oN()&&c.attachTimeline)return c.attachTimeline(a);if(typeof i=="function")return i(c)});return()=>{l.forEach((c,d)=>{c&&c(),this.animations[d].stop()})}}get time(){return this.getAll("time")}set time(a){this.setAll("time",a)}get speed(){return this.getAll("speed")}set speed(a){this.setAll("speed",a)}get startTime(){return this.getAll("startTime")}get duration(){let a=0;for(let i=0;i<this.animations.length;i++)a=Math.max(a,this.animations[i].duration);return a}runAll(a){this.animations.forEach(i=>i[a]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class rN extends lN{then(a,i){return Promise.all(this.animations).then(a).catch(i)}}const _a=n=>n*1e3,Ta=n=>n/1e3;function Sh(n){return typeof n=="function"}function py(n,a){n.timeline=a,n.onfinish=null}const _h=n=>Array.isArray(n)&&typeof n[0]=="number",cN={linearEasing:void 0};function uN(n,a){const i=xh(n);return()=>{var l;return(l=cN[a])!==null&&l!==void 0?l:i()}}const ic=uN(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Gi=(n,a,i)=>{const l=a-n;return l===0?1:(i-n)/l},Zb=(n,a,i=10)=>{let l="";const c=Math.max(Math.round(a/i),2);for(let d=0;d<c;d++)l+=n(Gi(0,c-1,d))+", ";return`linear(${l.substring(0,l.length-2)})`};function Xb(n){return!!(typeof n=="function"&&ic()||!n||typeof n=="string"&&(n in kf||ic())||_h(n)||Array.isArray(n)&&n.every(Xb))}const Zo=([n,a,i,l])=>`cubic-bezier(${n}, ${a}, ${i}, ${l})`,kf={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Zo([0,.65,.55,1]),circOut:Zo([.55,0,1,.45]),backIn:Zo([.31,.01,.66,-.59]),backOut:Zo([.33,1.53,.69,.99])};function Qb(n,a){if(n)return typeof n=="function"&&ic()?Zb(n,a):_h(n)?Zo(n):Array.isArray(n)?n.map(i=>Qb(i,a)||kf.easeOut):kf[n]}const Wb=(n,a,i)=>(((1-3*i+3*a)*n+(3*i-6*a))*n+3*a)*n,dN=1e-7,fN=12;function hN(n,a,i,l,c){let d,f,m=0;do f=a+(i-a)/2,d=Wb(f,l,c)-n,d>0?i=f:a=f;while(Math.abs(d)>dN&&++m<fN);return f}function gl(n,a,i,l){if(n===a&&i===l)return pn;const c=d=>hN(d,0,1,n,i);return d=>d===0||d===1?d:Wb(c(d),a,l)}const Jb=n=>a=>a<=.5?n(2*a)/2:(2-n(2*(1-a)))/2,ex=n=>a=>1-n(1-a),tx=gl(.33,1.53,.69,.99),Th=ex(tx),nx=Jb(Th),ax=n=>(n*=2)<1?.5*Th(n):.5*(2-Math.pow(2,-10*(n-1))),kh=n=>1-Math.sin(Math.acos(n)),sx=ex(kh),ix=Jb(kh),ox=n=>/^0[^.\s]+$/u.test(n);function mN(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||ox(n):!0}const tl=n=>Math.round(n*1e5)/1e5,jh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function pN(n){return n==null}const vN=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,wh=(n,a)=>i=>!!(typeof i=="string"&&vN.test(i)&&i.startsWith(n)||a&&!pN(i)&&Object.prototype.hasOwnProperty.call(i,a)),lx=(n,a,i)=>l=>{if(typeof l!="string")return l;const[c,d,f,m]=l.match(jh);return{[n]:parseFloat(c),[a]:parseFloat(d),[i]:parseFloat(f),alpha:m!==void 0?parseFloat(m):1}},gN=n=>wa(0,255,n),Zd={...Zi,transform:n=>Math.round(gN(n))},Bs={test:wh("rgb","red"),parse:lx("red","green","blue"),transform:({red:n,green:a,blue:i,alpha:l=1})=>"rgba("+Zd.transform(n)+", "+Zd.transform(a)+", "+Zd.transform(i)+", "+tl(cl.transform(l))+")"};function yN(n){let a="",i="",l="",c="";return n.length>5?(a=n.substring(1,3),i=n.substring(3,5),l=n.substring(5,7),c=n.substring(7,9)):(a=n.substring(1,2),i=n.substring(2,3),l=n.substring(3,4),c=n.substring(4,5),a+=a,i+=i,l+=l,c+=c),{red:parseInt(a,16),green:parseInt(i,16),blue:parseInt(l,16),alpha:c?parseInt(c,16)/255:1}}const jf={test:wh("#"),parse:yN,transform:Bs.transform},Mi={test:wh("hsl","hue"),parse:lx("hue","saturation","lightness"),transform:({hue:n,saturation:a,lightness:i,alpha:l=1})=>"hsla("+Math.round(n)+", "+Qn.transform(tl(a))+", "+Qn.transform(tl(i))+", "+tl(cl.transform(l))+")"},Ft={test:n=>Bs.test(n)||jf.test(n)||Mi.test(n),parse:n=>Bs.test(n)?Bs.parse(n):Mi.test(n)?Mi.parse(n):jf.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?Bs.transform(n):Mi.transform(n)},bN=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function xN(n){var a,i;return isNaN(n)&&typeof n=="string"&&(((a=n.match(jh))===null||a===void 0?void 0:a.length)||0)+(((i=n.match(bN))===null||i===void 0?void 0:i.length)||0)>0}const rx="number",cx="color",SN="var",_N="var(",vy="${}",TN=/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 dl(n){const a=n.toString(),i=[],l={color:[],number:[],var:[]},c=[];let d=0;const m=a.replace(TN,p=>(Ft.test(p)?(l.color.push(d),c.push(cx),i.push(Ft.parse(p))):p.startsWith(_N)?(l.var.push(d),c.push(SN),i.push(p)):(l.number.push(d),c.push(rx),i.push(parseFloat(p))),++d,vy)).split(vy);return{values:i,split:m,indexes:l,types:c}}function ux(n){return dl(n).values}function dx(n){const{split:a,types:i}=dl(n),l=a.length;return c=>{let d="";for(let f=0;f<l;f++)if(d+=a[f],c[f]!==void 0){const m=i[f];m===rx?d+=tl(c[f]):m===cx?d+=Ft.transform(c[f]):d+=c[f]}return d}}const kN=n=>typeof n=="number"?0:n;function jN(n){const a=ux(n);return dx(n)(a.map(kN))}const os={test:xN,parse:ux,createTransformer:dx,getAnimatableNone:jN},wN=new Set(["brightness","contrast","saturate","opacity"]);function NN(n){const[a,i]=n.slice(0,-1).split("(");if(a==="drop-shadow")return n;const[l]=i.match(jh)||[];if(!l)return n;const c=i.replace(l,"");let d=wN.has(a)?1:0;return l!==i&&(d*=100),a+"("+d+c+")"}const CN=/\b([a-z-]*)\(.*?\)/gu,wf={...os,getAnimatableNone:n=>{const a=n.match(CN);return a?a.map(NN).join(" "):n}},EN={...uh,color:Ft,backgroundColor:Ft,outlineColor:Ft,fill:Ft,stroke:Ft,borderColor:Ft,borderTopColor:Ft,borderRightColor:Ft,borderBottomColor:Ft,borderLeftColor:Ft,filter:wf,WebkitFilter:wf},Nh=n=>EN[n];function fx(n,a){let i=Nh(n);return i!==wf&&(i=os),i.getAnimatableNone?i.getAnimatableNone(a):void 0}const AN=new Set(["auto","none","0"]);function DN(n,a,i){let l=0,c;for(;l<n.length&&!c;){const d=n[l];typeof d=="string"&&!AN.has(d)&&dl(d).values.length&&(c=n[l]),l++}if(c&&i)for(const d of a)n[d]=fx(i,c)}const gy=n=>n===Zi||n===xe,yy=(n,a)=>parseFloat(n.split(", ")[a]),by=(n,a)=>(i,{transform:l})=>{if(l==="none"||!l)return 0;const c=l.match(/^matrix3d\((.+)\)$/u);if(c)return yy(c[1],a);{const d=l.match(/^matrix\((.+)\)$/u);return d?yy(d[1],n):0}},RN=new Set(["x","y","z"]),MN=Fi.filter(n=>!RN.has(n));function ON(n){const a=[];return MN.forEach(i=>{const l=n.getValue(i);l!==void 0&&(a.push([i,l.get()]),l.set(i.startsWith("scale")?1:0))}),a}const $i={width:({x:n},{paddingLeft:a="0",paddingRight:i="0"})=>n.max-n.min-parseFloat(a)-parseFloat(i),height:({y:n},{paddingTop:a="0",paddingBottom:i="0"})=>n.max-n.min-parseFloat(a)-parseFloat(i),top:(n,{top:a})=>parseFloat(a),left:(n,{left:a})=>parseFloat(a),bottom:({y:n},{top:a})=>parseFloat(a)+(n.max-n.min),right:({x:n},{left:a})=>parseFloat(a)+(n.max-n.min),x:by(4,13),y:by(5,14)};$i.translateX=$i.x;$i.translateY=$i.y;const Is=new Set;let Nf=!1,Cf=!1;function hx(){if(Cf){const n=Array.from(Is).filter(l=>l.needsMeasurement),a=new Set(n.map(l=>l.element)),i=new Map;a.forEach(l=>{const c=ON(l);c.length&&(i.set(l,c),l.render())}),n.forEach(l=>l.measureInitialState()),a.forEach(l=>{l.render();const c=i.get(l);c&&c.forEach(([d,f])=>{var m;(m=l.getValue(d))===null||m===void 0||m.set(f)})}),n.forEach(l=>l.measureEndState()),n.forEach(l=>{l.suspendedScrollY!==void 0&&window.scrollTo(0,l.suspendedScrollY)})}Cf=!1,Nf=!1,Is.forEach(n=>n.complete()),Is.clear()}function mx(){Is.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(Cf=!0)})}function BN(){mx(),hx()}class Ch{constructor(a,i,l,c,d,f=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...a],this.onComplete=i,this.name=l,this.motionValue=c,this.element=d,this.isAsync=f}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Is.add(this),Nf||(Nf=!0,ct.read(mx),ct.resolveKeyframes(hx))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:a,name:i,element:l,motionValue:c}=this;for(let d=0;d<a.length;d++)if(a[d]===null)if(d===0){const f=c==null?void 0:c.get(),m=a[a.length-1];if(f!==void 0)a[0]=f;else if(l&&i){const p=l.readValue(i,m);p!=null&&(a[0]=p)}a[0]===void 0&&(a[0]=m),c&&f===void 0&&c.set(a[0])}else a[d]=a[d-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Is.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Is.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const px=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),LN=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function IN(n){const a=LN.exec(n);if(!a)return[,];const[,i,l,c]=a;return[`--${i??l}`,c]}function vx(n,a,i=1){const[l,c]=IN(n);if(!l)return;const d=window.getComputedStyle(a).getPropertyValue(l);if(d){const f=d.trim();return px(f)?parseFloat(f):f}return ch(c)?vx(c,a,i+1):c}const gx=n=>a=>a.test(n),zN={test:n=>n==="auto",parse:n=>n},yx=[Zi,xe,Qn,ss,Ow,Mw,zN],xy=n=>yx.find(gx(n));class bx extends Ch{constructor(a,i,l,c,d){super(a,i,l,c,d,!0)}readKeyframes(){const{unresolvedKeyframes:a,element:i,name:l}=this;if(!i||!i.current)return;super.readKeyframes();for(let p=0;p<a.length;p++){let v=a[p];if(typeof v=="string"&&(v=v.trim(),ch(v))){const g=vx(v,i.current);g!==void 0&&(a[p]=g),p===a.length-1&&(this.finalKeyframe=v)}}if(this.resolveNoneKeyframes(),!Kb.has(l)||a.length!==2)return;const[c,d]=a,f=xy(c),m=xy(d);if(f!==m)if(gy(f)&&gy(m))for(let p=0;p<a.length;p++){const v=a[p];typeof v=="string"&&(a[p]=parseFloat(v))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:a,name:i}=this,l=[];for(let c=0;c<a.length;c++)mN(a[c])&&l.push(c);l.length&&DN(a,l,i)}measureInitialState(){const{element:a,unresolvedKeyframes:i,name:l}=this;if(!a||!a.current)return;l==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=$i[l](a.measureViewportBox(),window.getComputedStyle(a.current)),i[0]=this.measuredOrigin;const c=i[i.length-1];c!==void 0&&a.getValue(l,c).jump(c,!1)}measureEndState(){var a;const{element:i,name:l,unresolvedKeyframes:c}=this;if(!i||!i.current)return;const d=i.getValue(l);d&&d.jump(this.measuredOrigin,!1);const f=c.length-1,m=c[f];c[f]=$i[l](i.measureViewportBox(),window.getComputedStyle(i.current)),m!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=m),!((a=this.removedTransforms)===null||a===void 0)&&a.length&&this.removedTransforms.forEach(([p,v])=>{i.getValue(p).set(v)}),this.resolveNoneKeyframes()}}const Sy=(n,a)=>a==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(os.test(n)||n==="0")&&!n.startsWith("url("));function UN(n){const a=n[0];if(n.length===1)return!0;for(let i=0;i<n.length;i++)if(n[i]!==a)return!0}function VN(n,a,i,l){const c=n[0];if(c===null)return!1;if(a==="display"||a==="visibility")return!0;const d=n[n.length-1],f=Sy(c,a),m=Sy(d,a);return!f||!m?!1:UN(n)||(i==="spring"||Sh(i))&&l}const HN=n=>n!==null;function kc(n,{repeat:a,repeatType:i="loop"},l){const c=n.filter(HN),d=a&&i!=="loop"&&a%2===1?0:c.length-1;return!d||l===void 0?c[d]:l}const PN=40;class xx{constructor({autoplay:a=!0,delay:i=0,type:l="keyframes",repeat:c=0,repeatDelay:d=0,repeatType:f="loop",...m}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Wn.now(),this.options={autoplay:a,delay:i,type:l,repeat:c,repeatDelay:d,repeatType:f,...m},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>PN?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&BN(),this._resolved}onKeyframesResolved(a,i){this.resolvedAt=Wn.now(),this.hasAttemptedResolve=!0;const{name:l,type:c,velocity:d,delay:f,onComplete:m,onUpdate:p,isGenerator:v}=this.options;if(!v&&!VN(a,l,c,d))if(f)this.options.duration=0;else{p&&p(kc(a,this.options,i)),m&&m(),this.resolveFinishedPromise();return}const g=this.initPlayback(a,i);g!==!1&&(this._resolved={keyframes:a,finalKeyframe:i,...g},this.onPostResolved())}onPostResolved(){}then(a,i){return this.currentFinishedPromise.then(a,i)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(a=>{this.resolveFinishedPromise=a})}}const Ef=2e4;function Sx(n){let a=0;const i=50;let l=n.next(a);for(;!l.done&&a<Ef;)a+=i,l=n.next(a);return a>=Ef?1/0:a}const mt=(n,a,i)=>n+(a-n)*i;function Xd(n,a,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?n+(a-n)*6*i:i<1/2?a:i<2/3?n+(a-n)*(2/3-i)*6:n}function GN({hue:n,saturation:a,lightness:i,alpha:l}){n/=360,a/=100,i/=100;let c=0,d=0,f=0;if(!a)c=d=f=i;else{const m=i<.5?i*(1+a):i+a-i*a,p=2*i-m;c=Xd(p,m,n+1/3),d=Xd(p,m,n),f=Xd(p,m,n-1/3)}return{red:Math.round(c*255),green:Math.round(d*255),blue:Math.round(f*255),alpha:l}}function oc(n,a){return i=>i>0?a:n}const Qd=(n,a,i)=>{const l=n*n,c=i*(a*a-l)+l;return c<0?0:Math.sqrt(c)},$N=[jf,Bs,Mi],qN=n=>$N.find(a=>a.test(n));function _y(n){const a=qN(n);if(!a)return!1;let i=a.parse(n);return a===Mi&&(i=GN(i)),i}const Ty=(n,a)=>{const i=_y(n),l=_y(a);if(!i||!l)return oc(n,a);const c={...i};return d=>(c.red=Qd(i.red,l.red,d),c.green=Qd(i.green,l.green,d),c.blue=Qd(i.blue,l.blue,d),c.alpha=mt(i.alpha,l.alpha,d),Bs.transform(c))},KN=(n,a)=>i=>a(n(i)),yl=(...n)=>n.reduce(KN),Af=new Set(["none","hidden"]);function YN(n,a){return Af.has(n)?i=>i<=0?n:a:i=>i>=1?a:n}function FN(n,a){return i=>mt(n,a,i)}function Eh(n){return typeof n=="number"?FN:typeof n=="string"?ch(n)?oc:Ft.test(n)?Ty:QN:Array.isArray(n)?_x:typeof n=="object"?Ft.test(n)?Ty:ZN:oc}function _x(n,a){const i=[...n],l=i.length,c=n.map((d,f)=>Eh(d)(d,a[f]));return d=>{for(let f=0;f<l;f++)i[f]=c[f](d);return i}}function ZN(n,a){const i={...n,...a},l={};for(const c in i)n[c]!==void 0&&a[c]!==void 0&&(l[c]=Eh(n[c])(n[c],a[c]));return c=>{for(const d in l)i[d]=l[d](c);return i}}function XN(n,a){var i;const l=[],c={color:0,var:0,number:0};for(let d=0;d<a.values.length;d++){const f=a.types[d],m=n.indexes[f][c[f]],p=(i=n.values[m])!==null&&i!==void 0?i:0;l[d]=p,c[f]++}return l}const QN=(n,a)=>{const i=os.createTransformer(a),l=dl(n),c=dl(a);return l.indexes.var.length===c.indexes.var.length&&l.indexes.color.length===c.indexes.color.length&&l.indexes.number.length>=c.indexes.number.length?Af.has(n)&&!c.values.length||Af.has(a)&&!l.values.length?YN(n,a):yl(_x(XN(l,c),c.values),i):oc(n,a)};function Tx(n,a,i){return typeof n=="number"&&typeof a=="number"&&typeof i=="number"?mt(n,a,i):Eh(n)(n,a)}const WN=5;function kx(n,a,i){const l=Math.max(a-WN,0);return Yb(i-n(l),a-l)}const bt={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},Wd=.001;function JN({duration:n=bt.duration,bounce:a=bt.bounce,velocity:i=bt.velocity,mass:l=bt.mass}){let c,d,f=1-a;f=wa(bt.minDamping,bt.maxDamping,f),n=wa(bt.minDuration,bt.maxDuration,Ta(n)),f<1?(c=v=>{const g=v*f,b=g*n,x=g-i,_=Df(v,f),T=Math.exp(-b);return Wd-x/_*T},d=v=>{const b=v*f*n,x=b*i+i,_=Math.pow(f,2)*Math.pow(v,2)*n,T=Math.exp(-b),N=Df(Math.pow(v,2),f);return(-c(v)+Wd>0?-1:1)*((x-_)*T)/N}):(c=v=>{const g=Math.exp(-v*n),b=(v-i)*n+1;return-Wd+g*b},d=v=>{const g=Math.exp(-v*n),b=(i-v)*(n*n);return g*b});const m=5/n,p=tC(c,d,m);if(n=_a(n),isNaN(p))return{stiffness:bt.stiffness,damping:bt.damping,duration:n};{const v=Math.pow(p,2)*l;return{stiffness:v,damping:f*2*Math.sqrt(l*v),duration:n}}}const eC=12;function tC(n,a,i){let l=i;for(let c=1;c<eC;c++)l=l-n(l)/a(l);return l}function Df(n,a){return n*Math.sqrt(1-a*a)}const nC=["duration","bounce"],aC=["stiffness","damping","mass"];function ky(n,a){return a.some(i=>n[i]!==void 0)}function sC(n){let a={velocity:bt.velocity,stiffness:bt.stiffness,damping:bt.damping,mass:bt.mass,isResolvedFromDuration:!1,...n};if(!ky(n,aC)&&ky(n,nC))if(n.visualDuration){const i=n.visualDuration,l=2*Math.PI/(i*1.2),c=l*l,d=2*wa(.05,1,1-(n.bounce||0))*Math.sqrt(c);a={...a,mass:bt.mass,stiffness:c,damping:d}}else{const i=JN(n);a={...a,...i,mass:bt.mass},a.isResolvedFromDuration=!0}return a}function jx(n=bt.visualDuration,a=bt.bounce){const i=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:a}:n;let{restSpeed:l,restDelta:c}=i;const d=i.keyframes[0],f=i.keyframes[i.keyframes.length-1],m={done:!1,value:d},{stiffness:p,damping:v,mass:g,duration:b,velocity:x,isResolvedFromDuration:_}=sC({...i,velocity:-Ta(i.velocity||0)}),T=x||0,N=v/(2*Math.sqrt(p*g)),w=f-d,k=Ta(Math.sqrt(p/g)),C=Math.abs(w)<5;l||(l=C?bt.restSpeed.granular:bt.restSpeed.default),c||(c=C?bt.restDelta.granular:bt.restDelta.default);let A;if(N<1){const E=Df(k,N);A=I=>{const z=Math.exp(-N*k*I);return f-z*((T+N*k*w)/E*Math.sin(E*I)+w*Math.cos(E*I))}}else if(N===1)A=E=>f-Math.exp(-k*E)*(w+(T+k*w)*E);else{const E=k*Math.sqrt(N*N-1);A=I=>{const z=Math.exp(-N*k*I),U=Math.min(E*I,300);return f-z*((T+N*k*w)*Math.sinh(U)+E*w*Math.cosh(U))/E}}const D={calculatedDuration:_&&b||null,next:E=>{const I=A(E);if(_)m.done=E>=b;else{let z=0;N<1&&(z=E===0?_a(T):kx(A,E,I));const U=Math.abs(z)<=l,Y=Math.abs(f-I)<=c;m.done=U&&Y}return m.value=m.done?f:I,m},toString:()=>{const E=Math.min(Sx(D),Ef),I=Zb(z=>D.next(E*z).value,E,30);return E+"ms "+I}};return D}function jy({keyframes:n,velocity:a=0,power:i=.8,timeConstant:l=325,bounceDamping:c=10,bounceStiffness:d=500,modifyTarget:f,min:m,max:p,restDelta:v=.5,restSpeed:g}){const b=n[0],x={done:!1,value:b},_=U=>m!==void 0&&U<m||p!==void 0&&U>p,T=U=>m===void 0?p:p===void 0||Math.abs(m-U)<Math.abs(p-U)?m:p;let N=i*a;const w=b+N,k=f===void 0?w:f(w);k!==w&&(N=k-b);const C=U=>-N*Math.exp(-U/l),A=U=>k+C(U),D=U=>{const Y=C(U),ae=A(U);x.done=Math.abs(Y)<=v,x.value=x.done?k:ae};let E,I;const z=U=>{_(x.value)&&(E=U,I=jx({keyframes:[x.value,T(x.value)],velocity:kx(A,U,x.value),damping:c,stiffness:d,restDelta:v,restSpeed:g}))};return z(0),{calculatedDuration:null,next:U=>{let Y=!1;return!I&&E===void 0&&(Y=!0,D(U),z(U)),E!==void 0&&U>=E?I.next(U-E):(!Y&&D(U),x)}}}const iC=gl(.42,0,1,1),oC=gl(0,0,.58,1),wx=gl(.42,0,.58,1),lC=n=>Array.isArray(n)&&typeof n[0]!="number",rC={linear:pn,easeIn:iC,easeInOut:wx,easeOut:oC,circIn:kh,circInOut:ix,circOut:sx,backIn:Th,backInOut:nx,backOut:tx,anticipate:ax},wy=n=>{if(_h(n)){wb(n.length===4);const[a,i,l,c]=n;return gl(a,i,l,c)}else if(typeof n=="string")return rC[n];return n};function cC(n,a,i){const l=[],c=i||Tx,d=n.length-1;for(let f=0;f<d;f++){let m=c(n[f],n[f+1]);if(a){const p=Array.isArray(a)?a[f]||pn:a;m=yl(p,m)}l.push(m)}return l}function uC(n,a,{clamp:i=!0,ease:l,mixer:c}={}){const d=n.length;if(wb(d===a.length),d===1)return()=>a[0];if(d===2&&a[0]===a[1])return()=>a[1];const f=n[0]===n[1];n[0]>n[d-1]&&(n=[...n].reverse(),a=[...a].reverse());const m=cC(a,l,c),p=m.length,v=g=>{if(f&&g<n[0])return a[0];let b=0;if(p>1)for(;b<n.length-2&&!(g<n[b+1]);b++);const x=Gi(n[b],n[b+1],g);return m[b](x)};return i?g=>v(wa(n[0],n[d-1],g)):v}function dC(n,a){const i=n[n.length-1];for(let l=1;l<=a;l++){const c=Gi(0,a,l);n.push(mt(i,1,c))}}function fC(n){const a=[0];return dC(a,n.length-1),a}function hC(n,a){return n.map(i=>i*a)}function mC(n,a){return n.map(()=>a||wx).splice(0,n.length-1)}function lc({duration:n=300,keyframes:a,times:i,ease:l="easeInOut"}){const c=lC(l)?l.map(wy):wy(l),d={done:!1,value:a[0]},f=hC(i&&i.length===a.length?i:fC(a),n),m=uC(f,a,{ease:Array.isArray(c)?c:mC(a,c)});return{calculatedDuration:n,next:p=>(d.value=m(p),d.done=p>=n,d)}}const pC=n=>{const a=({timestamp:i})=>n(i);return{start:()=>ct.update(a,!0),stop:()=>is(a),now:()=>$t.isProcessing?$t.timestamp:Wn.now()}},vC={decay:jy,inertia:jy,tween:lc,keyframes:lc,spring:jx},gC=n=>n/100;class Ah extends xx{constructor(a){super(a),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:p}=this.options;p&&p()};const{name:i,motionValue:l,element:c,keyframes:d}=this.options,f=(c==null?void 0:c.KeyframeResolver)||Ch,m=(p,v)=>this.onKeyframesResolved(p,v);this.resolver=new f(d,m,i,l,c),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(a){const{type:i="keyframes",repeat:l=0,repeatDelay:c=0,repeatType:d,velocity:f=0}=this.options,m=Sh(i)?i:vC[i]||lc;let p,v;m!==lc&&typeof a[0]!="number"&&(p=yl(gC,Tx(a[0],a[1])),a=[0,100]);const g=m({...this.options,keyframes:a});d==="mirror"&&(v=m({...this.options,keyframes:[...a].reverse(),velocity:-f})),g.calculatedDuration===null&&(g.calculatedDuration=Sx(g));const{calculatedDuration:b}=g,x=b+c,_=x*(l+1)-c;return{generator:g,mirroredGenerator:v,mapPercentToKeyframes:p,calculatedDuration:b,resolvedDuration:x,totalDuration:_}}onPostResolved(){const{autoplay:a=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!a?this.pause():this.state=this.pendingPlayState}tick(a,i=!1){const{resolved:l}=this;if(!l){const{keyframes:U}=this.options;return{done:!0,value:U[U.length-1]}}const{finalKeyframe:c,generator:d,mirroredGenerator:f,mapPercentToKeyframes:m,keyframes:p,calculatedDuration:v,totalDuration:g,resolvedDuration:b}=l;if(this.startTime===null)return d.next(0);const{delay:x,repeat:_,repeatType:T,repeatDelay:N,onUpdate:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,a):this.speed<0&&(this.startTime=Math.min(a-g/this.speed,this.startTime)),i?this.currentTime=a:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(a-this.startTime)*this.speed;const k=this.currentTime-x*(this.speed>=0?1:-1),C=this.speed>=0?k<0:k>g;this.currentTime=Math.max(k,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=g);let A=this.currentTime,D=d;if(_){const U=Math.min(this.currentTime,g)/b;let Y=Math.floor(U),ae=U%1;!ae&&U>=1&&(ae=1),ae===1&&Y--,Y=Math.min(Y,_+1),!!(Y%2)&&(T==="reverse"?(ae=1-ae,N&&(ae-=N/b)):T==="mirror"&&(D=f)),A=wa(0,1,ae)*b}const E=C?{done:!1,value:p[0]}:D.next(A);m&&(E.value=m(E.value));let{done:I}=E;!C&&v!==null&&(I=this.speed>=0?this.currentTime>=g:this.currentTime<=0);const z=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&I);return z&&c!==void 0&&(E.value=kc(p,this.options,c)),w&&w(E.value),z&&this.finish(),E}get duration(){const{resolved:a}=this;return a?Ta(a.calculatedDuration):0}get time(){return Ta(this.currentTime)}set time(a){a=_a(a),this.currentTime=a,this.holdTime!==null||this.speed===0?this.holdTime=a:this.driver&&(this.startTime=this.driver.now()-a/this.speed)}get speed(){return this.playbackSpeed}set speed(a){const i=this.playbackSpeed!==a;this.playbackSpeed=a,i&&(this.time=Ta(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:a=pC,onPlay:i,startTime:l}=this.options;this.driver||(this.driver=a(d=>this.tick(d))),i&&i();const c=this.driver.now();this.holdTime!==null?this.startTime=c-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=c):this.startTime=l??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var a;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(a=this.currentTime)!==null&&a!==void 0?a:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:a}=this.options;a&&a()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(a){return this.startTime=0,this.tick(a,!0)}}const yC=new Set(["opacity","clipPath","filter","transform"]);function bC(n,a,i,{delay:l=0,duration:c=300,repeat:d=0,repeatType:f="loop",ease:m="easeInOut",times:p}={}){const v={[a]:i};p&&(v.offset=p);const g=Qb(m,c);return Array.isArray(g)&&(v.easing=g),n.animate(v,{delay:l,duration:c,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:d+1,direction:f==="reverse"?"alternate":"normal"})}const xC=xh(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),rc=10,SC=2e4;function _C(n){return Sh(n.type)||n.type==="spring"||!Xb(n.ease)}function TC(n,a){const i=new Ah({...a,keyframes:n,repeat:0,delay:0,isGenerator:!0});let l={done:!1,value:n[0]};const c=[];let d=0;for(;!l.done&&d<SC;)l=i.sample(d),c.push(l.value),d+=rc;return{times:void 0,keyframes:c,duration:d-rc,ease:"linear"}}const Nx={anticipate:ax,backInOut:nx,circInOut:ix};function kC(n){return n in Nx}class Ny extends xx{constructor(a){super(a);const{name:i,motionValue:l,element:c,keyframes:d}=this.options;this.resolver=new bx(d,(f,m)=>this.onKeyframesResolved(f,m),i,l,c),this.resolver.scheduleResolve()}initPlayback(a,i){let{duration:l=300,times:c,ease:d,type:f,motionValue:m,name:p,startTime:v}=this.options;if(!m.owner||!m.owner.current)return!1;if(typeof d=="string"&&ic()&&kC(d)&&(d=Nx[d]),_C(this.options)){const{onComplete:b,onUpdate:x,motionValue:_,element:T,...N}=this.options,w=TC(a,N);a=w.keyframes,a.length===1&&(a[1]=a[0]),l=w.duration,c=w.times,d=w.ease,f="keyframes"}const g=bC(m.owner.current,p,a,{...this.options,duration:l,times:c,ease:d});return g.startTime=v??this.calcStartTime(),this.pendingTimeline?(py(g,this.pendingTimeline),this.pendingTimeline=void 0):g.onfinish=()=>{const{onComplete:b}=this.options;m.set(kc(a,this.options,i)),b&&b(),this.cancel(),this.resolveFinishedPromise()},{animation:g,duration:l,times:c,type:f,ease:d,keyframes:a}}get duration(){const{resolved:a}=this;if(!a)return 0;const{duration:i}=a;return Ta(i)}get time(){const{resolved:a}=this;if(!a)return 0;const{animation:i}=a;return Ta(i.currentTime||0)}set time(a){const{resolved:i}=this;if(!i)return;const{animation:l}=i;l.currentTime=_a(a)}get speed(){const{resolved:a}=this;if(!a)return 1;const{animation:i}=a;return i.playbackRate}set speed(a){const{resolved:i}=this;if(!i)return;const{animation:l}=i;l.playbackRate=a}get state(){const{resolved:a}=this;if(!a)return"idle";const{animation:i}=a;return i.playState}get startTime(){const{resolved:a}=this;if(!a)return null;const{animation:i}=a;return i.startTime}attachTimeline(a){if(!this._resolved)this.pendingTimeline=a;else{const{resolved:i}=this;if(!i)return pn;const{animation:l}=i;py(l,a)}return pn}play(){if(this.isStopped)return;const{resolved:a}=this;if(!a)return;const{animation:i}=a;i.playState==="finished"&&this.updateFinishedPromise(),i.play()}pause(){const{resolved:a}=this;if(!a)return;const{animation:i}=a;i.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:a}=this;if(!a)return;const{animation:i,keyframes:l,duration:c,type:d,ease:f,times:m}=a;if(i.playState==="idle"||i.playState==="finished")return;if(this.time){const{motionValue:v,onUpdate:g,onComplete:b,element:x,..._}=this.options,T=new Ah({..._,keyframes:l,duration:c,type:d,ease:f,times:m,isGenerator:!0}),N=_a(this.time);v.setWithVelocity(T.sample(N-rc).value,T.sample(N).value,rc)}const{onStop:p}=this.options;p&&p(),this.cancel()}complete(){const{resolved:a}=this;a&&a.animation.finish()}cancel(){const{resolved:a}=this;a&&a.animation.cancel()}static supports(a){const{motionValue:i,name:l,repeatDelay:c,repeatType:d,damping:f,type:m}=a;if(!i||!i.owner||!(i.owner.current instanceof HTMLElement))return!1;const{onUpdate:p,transformTemplate:v}=i.owner.getProps();return xC()&&l&&yC.has(l)&&!p&&!v&&!c&&d!=="mirror"&&f!==0&&m!=="inertia"}}const jC={type:"spring",stiffness:500,damping:25,restSpeed:10},wC=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),NC={type:"keyframes",duration:.8},CC={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},EC=(n,{keyframes:a})=>a.length>2?NC:$s.has(n)?n.startsWith("scale")?wC(a[1]):jC:CC;function AC({when:n,delay:a,delayChildren:i,staggerChildren:l,staggerDirection:c,repeat:d,repeatType:f,repeatDelay:m,from:p,elapsed:v,...g}){return!!Object.keys(g).length}const Dh=(n,a,i,l={},c,d)=>f=>{const m=vh(l,n)||{},p=m.delay||l.delay||0;let{elapsed:v=0}=l;v=v-_a(p);let g={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:a.getVelocity(),...m,delay:-v,onUpdate:x=>{a.set(x),m.onUpdate&&m.onUpdate(x)},onComplete:()=>{f(),m.onComplete&&m.onComplete()},name:n,motionValue:a,element:d?void 0:c};AC(m)||(g={...g,...EC(n,g)}),g.duration&&(g.duration=_a(g.duration)),g.repeatDelay&&(g.repeatDelay=_a(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let b=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(g.duration=0,g.delay===0&&(b=!0)),b&&!d&&a.get()!==void 0){const x=kc(g.keyframes,m);if(x!==void 0)return ct.update(()=>{g.onUpdate(x),g.onComplete()}),new rN([])}return!d&&Ny.supports(g)?new Ny(g):new Ah(g)};function DC({protectedKeys:n,needsAnimating:a},i){const l=n.hasOwnProperty(i)&&a[i]!==!0;return a[i]=!1,l}function Cx(n,a,{delay:i=0,transitionOverride:l,type:c}={}){var d;let{transition:f=n.getDefaultTransition(),transitionEnd:m,...p}=a;l&&(f=l);const v=[],g=c&&n.animationState&&n.animationState.getState()[c];for(const b in p){const x=n.getValue(b,(d=n.latestValues[b])!==null&&d!==void 0?d:null),_=p[b];if(_===void 0||g&&DC(g,b))continue;const T={delay:i,...vh(f||{},b)};let N=!1;if(window.MotionHandoffAnimation){const k=Fb(n);if(k){const C=window.MotionHandoffAnimation(k,b,ct);C!==null&&(T.startTime=C,N=!0)}}Tf(n,b),x.start(Dh(b,x,_,n.shouldReduceMotion&&Kb.has(b)?{type:!1}:T,n,N));const w=x.animation;w&&v.push(w)}return m&&Promise.all(v).then(()=>{ct.update(()=>{m&&sN(n,m)})}),v}function Rf(n,a,i={}){var l;const c=Tc(n,a,i.type==="exit"?(l=n.presenceContext)===null||l===void 0?void 0:l.custom:void 0);let{transition:d=n.getDefaultTransition()||{}}=c||{};i.transitionOverride&&(d=i.transitionOverride);const f=c?()=>Promise.all(Cx(n,c,i)):()=>Promise.resolve(),m=n.variantChildren&&n.variantChildren.size?(v=0)=>{const{delayChildren:g=0,staggerChildren:b,staggerDirection:x}=d;return RC(n,a,g+v,b,x,i)}:()=>Promise.resolve(),{when:p}=d;if(p){const[v,g]=p==="beforeChildren"?[f,m]:[m,f];return v().then(()=>g())}else return Promise.all([f(),m(i.delay)])}function RC(n,a,i=0,l=0,c=1,d){const f=[],m=(n.variantChildren.size-1)*l,p=c===1?(v=0)=>v*l:(v=0)=>m-v*l;return Array.from(n.variantChildren).sort(MC).forEach((v,g)=>{v.notify("AnimationStart",a),f.push(Rf(v,a,{...d,delay:i+p(g)}).then(()=>v.notify("AnimationComplete",a)))}),Promise.all(f)}function MC(n,a){return n.sortNodePosition(a)}function OC(n,a,i={}){n.notify("AnimationStart",a);let l;if(Array.isArray(a)){const c=a.map(d=>Rf(n,d,i));l=Promise.all(c)}else if(typeof a=="string")l=Rf(n,a,i);else{const c=typeof a=="function"?Tc(n,a,i.custom):a;l=Promise.all(Cx(n,c,i))}return l.then(()=>{n.notify("AnimationComplete",a)})}const BC=sh.length;function Ex(n){if(!n)return;if(!n.isControllingVariants){const i=n.parent?Ex(n.parent)||{}:{};return n.props.initial!==void 0&&(i.initial=n.props.initial),i}const a={};for(let i=0;i<BC;i++){const l=sh[i],c=n.props[l];(rl(c)||c===!1)&&(a[l]=c)}return a}const LC=[...ah].reverse(),IC=ah.length;function zC(n){return a=>Promise.all(a.map(({animation:i,options:l})=>OC(n,i,l)))}function UC(n){let a=zC(n),i=Cy(),l=!0;const c=p=>(v,g)=>{var b;const x=Tc(n,g,p==="exit"?(b=n.presenceContext)===null||b===void 0?void 0:b.custom:void 0);if(x){const{transition:_,transitionEnd:T,...N}=x;v={...v,...N,...T}}return v};function d(p){a=p(n)}function f(p){const{props:v}=n,g=Ex(n.parent)||{},b=[],x=new Set;let _={},T=1/0;for(let w=0;w<IC;w++){const k=LC[w],C=i[k],A=v[k]!==void 0?v[k]:g[k],D=rl(A),E=k===p?C.isActive:null;E===!1&&(T=w);let I=A===g[k]&&A!==v[k]&&D;if(I&&l&&n.manuallyAnimateOnMount&&(I=!1),C.protectedKeys={..._},!C.isActive&&E===null||!A&&!C.prevProp||Sc(A)||typeof A=="boolean")continue;const z=VC(C.prevProp,A);let U=z||k===p&&C.isActive&&!I&&D||w>T&&D,Y=!1;const ae=Array.isArray(A)?A:[A];let se=ae.reduce(c(k),{});E===!1&&(se={});const{prevResolvedValues:ie={}}=C,le={...ie,...se},q=P=>{U=!0,x.has(P)&&(Y=!0,x.delete(P)),C.needsAnimating[P]=!0;const W=n.getValue(P);W&&(W.liveStyle=!1)};for(const P in le){const W=se[P],re=ie[P];if(_.hasOwnProperty(P))continue;let oe=!1;_f(W)&&_f(re)?oe=!qb(W,re):oe=W!==re,oe?W!=null?q(P):x.add(P):W!==void 0&&x.has(P)?q(P):C.protectedKeys[P]=!0}C.prevProp=A,C.prevResolvedValues=se,C.isActive&&(_={..._,...se}),l&&n.blockInitialAnimation&&(U=!1),U&&(!(I&&z)||Y)&&b.push(...ae.map(P=>({animation:P,options:{type:k}})))}if(x.size){const w={};x.forEach(k=>{const C=n.getBaseTarget(k),A=n.getValue(k);A&&(A.liveStyle=!0),w[k]=C??null}),b.push({animation:w})}let N=!!b.length;return l&&(v.initial===!1||v.initial===v.animate)&&!n.manuallyAnimateOnMount&&(N=!1),l=!1,N?a(b):Promise.resolve()}function m(p,v){var g;if(i[p].isActive===v)return Promise.resolve();(g=n.variantChildren)===null||g===void 0||g.forEach(x=>{var _;return(_=x.animationState)===null||_===void 0?void 0:_.setActive(p,v)}),i[p].isActive=v;const b=f(p);for(const x in i)i[x].protectedKeys={};return b}return{animateChanges:f,setActive:m,setAnimateFunction:d,getState:()=>i,reset:()=>{i=Cy(),l=!0}}}function VC(n,a){return typeof a=="string"?a!==n:Array.isArray(a)?!qb(a,n):!1}function Es(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Cy(){return{animate:Es(!0),whileInView:Es(),whileHover:Es(),whileTap:Es(),whileDrag:Es(),whileFocus:Es(),exit:Es()}}class cs{constructor(a){this.isMounted=!1,this.node=a}update(){}}class HC extends cs{constructor(a){super(a),a.animationState||(a.animationState=UC(a))}updateAnimationControlsSubscription(){const{animate:a}=this.node.getProps();Sc(a)&&(this.unmountControls=a.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:a}=this.node.getProps(),{animate:i}=this.node.prevProps||{};a!==i&&this.updateAnimationControlsSubscription()}unmount(){var a;this.node.animationState.reset(),(a=this.unmountControls)===null||a===void 0||a.call(this)}}let PC=0;class GC extends cs{constructor(){super(...arguments),this.id=PC++}update(){if(!this.node.presenceContext)return;const{isPresent:a,onExitComplete:i}=this.node.presenceContext,{isPresent:l}=this.node.prevPresenceContext||{};if(!this.node.animationState||a===l)return;const c=this.node.animationState.setActive("exit",!a);i&&!a&&c.then(()=>i(this.id))}mount(){const{register:a}=this.node.presenceContext||{};a&&(this.unmount=a(this.id))}unmount(){}}const $C={animation:{Feature:HC},exit:{Feature:GC}},Vn={x:!1,y:!1};function Ax(){return Vn.x||Vn.y}function qC(n){return n==="x"||n==="y"?Vn[n]?null:(Vn[n]=!0,()=>{Vn[n]=!1}):Vn.x||Vn.y?null:(Vn.x=Vn.y=!0,()=>{Vn.x=Vn.y=!1})}const Rh=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1;function fl(n,a,i,l={passive:!0}){return n.addEventListener(a,i,l),()=>n.removeEventListener(a,i)}function bl(n){return{point:{x:n.pageX,y:n.pageY}}}const KC=n=>a=>Rh(a)&&n(a,bl(a));function nl(n,a,i,l){return fl(n,a,KC(i),l)}const Ey=(n,a)=>Math.abs(n-a);function YC(n,a){const i=Ey(n.x,a.x),l=Ey(n.y,a.y);return Math.sqrt(i**2+l**2)}class Dx{constructor(a,i,{transformPagePoint:l,contextWindow:c,dragSnapToOrigin:d=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=ef(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,_=YC(b.offset,{x:0,y:0})>=3;if(!x&&!_)return;const{point:T}=b,{timestamp:N}=$t;this.history.push({...T,timestamp:N});const{onStart:w,onMove:k}=this.handlers;x||(w&&w(this.lastMoveEvent,b),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,b)},this.handlePointerMove=(b,x)=>{this.lastMoveEvent=b,this.lastMoveEventInfo=Jd(x,this.transformPagePoint),ct.update(this.updatePoint,!0)},this.handlePointerUp=(b,x)=>{this.end();const{onEnd:_,onSessionEnd:T,resumeAnimation:N}=this.handlers;if(this.dragSnapToOrigin&&N&&N(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=ef(b.type==="pointercancel"?this.lastMoveEventInfo:Jd(x,this.transformPagePoint),this.history);this.startEvent&&_&&_(b,w),T&&T(b,w)},!Rh(a))return;this.dragSnapToOrigin=d,this.handlers=i,this.transformPagePoint=l,this.contextWindow=c||window;const f=bl(a),m=Jd(f,this.transformPagePoint),{point:p}=m,{timestamp:v}=$t;this.history=[{...p,timestamp:v}];const{onSessionStart:g}=i;g&&g(a,ef(m,this.history)),this.removeListeners=yl(nl(this.contextWindow,"pointermove",this.handlePointerMove),nl(this.contextWindow,"pointerup",this.handlePointerUp),nl(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(a){this.handlers=a}end(){this.removeListeners&&this.removeListeners(),is(this.updatePoint)}}function Jd(n,a){return a?{point:a(n.point)}:n}function Ay(n,a){return{x:n.x-a.x,y:n.y-a.y}}function ef({point:n},a){return{point:n,delta:Ay(n,Rx(a)),offset:Ay(n,FC(a)),velocity:ZC(a,.1)}}function FC(n){return n[0]}function Rx(n){return n[n.length-1]}function ZC(n,a){if(n.length<2)return{x:0,y:0};let i=n.length-1,l=null;const c=Rx(n);for(;i>=0&&(l=n[i],!(c.timestamp-l.timestamp>_a(a)));)i--;if(!l)return{x:0,y:0};const d=Ta(c.timestamp-l.timestamp);if(d===0)return{x:0,y:0};const f={x:(c.x-l.x)/d,y:(c.y-l.y)/d};return f.x===1/0&&(f.x=0),f.y===1/0&&(f.y=0),f}const Mx=1e-4,XC=1-Mx,QC=1+Mx,Ox=.01,WC=0-Ox,JC=0+Ox;function vn(n){return n.max-n.min}function eE(n,a,i){return Math.abs(n-a)<=i}function Dy(n,a,i,l=.5){n.origin=l,n.originPoint=mt(a.min,a.max,n.origin),n.scale=vn(i)/vn(a),n.translate=mt(i.min,i.max,n.origin)-n.originPoint,(n.scale>=XC&&n.scale<=QC||isNaN(n.scale))&&(n.scale=1),(n.translate>=WC&&n.translate<=JC||isNaN(n.translate))&&(n.translate=0)}function al(n,a,i,l){Dy(n.x,a.x,i.x,l?l.originX:void 0),Dy(n.y,a.y,i.y,l?l.originY:void 0)}function Ry(n,a,i){n.min=i.min+a.min,n.max=n.min+vn(a)}function tE(n,a,i){Ry(n.x,a.x,i.x),Ry(n.y,a.y,i.y)}function My(n,a,i){n.min=a.min-i.min,n.max=n.min+vn(a)}function sl(n,a,i){My(n.x,a.x,i.x),My(n.y,a.y,i.y)}function nE(n,{min:a,max:i},l){return a!==void 0&&n<a?n=l?mt(a,n,l.min):Math.max(n,a):i!==void 0&&n>i&&(n=l?mt(i,n,l.max):Math.min(n,i)),n}function Oy(n,a,i){return{min:a!==void 0?n.min+a:void 0,max:i!==void 0?n.max+i-(n.max-n.min):void 0}}function aE(n,{top:a,left:i,bottom:l,right:c}){return{x:Oy(n.x,i,c),y:Oy(n.y,a,l)}}function By(n,a){let i=a.min-n.min,l=a.max-n.max;return a.max-a.min<n.max-n.min&&([i,l]=[l,i]),{min:i,max:l}}function sE(n,a){return{x:By(n.x,a.x),y:By(n.y,a.y)}}function iE(n,a){let i=.5;const l=vn(n),c=vn(a);return c>l?i=Gi(a.min,a.max-l,n.min):l>c&&(i=Gi(n.min,n.max-c,a.min)),wa(0,1,i)}function oE(n,a){const i={};return a.min!==void 0&&(i.min=a.min-n.min),a.max!==void 0&&(i.max=a.max-n.min),i}const Mf=.35;function lE(n=Mf){return n===!1?n=0:n===!0&&(n=Mf),{x:Ly(n,"left","right"),y:Ly(n,"top","bottom")}}function Ly(n,a,i){return{min:Iy(n,a),max:Iy(n,i)}}function Iy(n,a){return typeof n=="number"?n:n[a]||0}const zy=()=>({translate:0,scale:1,origin:0,originPoint:0}),Oi=()=>({x:zy(),y:zy()}),Uy=()=>({min:0,max:0}),Tt=()=>({x:Uy(),y:Uy()});function Rn(n){return[n("x"),n("y")]}function Bx({top:n,left:a,right:i,bottom:l}){return{x:{min:a,max:i},y:{min:n,max:l}}}function rE({x:n,y:a}){return{top:a.min,right:n.max,bottom:a.max,left:n.min}}function cE(n,a){if(!a)return n;const i=a({x:n.left,y:n.top}),l=a({x:n.right,y:n.bottom});return{top:i.y,left:i.x,bottom:l.y,right:l.x}}function tf(n){return n===void 0||n===1}function Of({scale:n,scaleX:a,scaleY:i}){return!tf(n)||!tf(a)||!tf(i)}function Ms(n){return Of(n)||Lx(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function Lx(n){return Vy(n.x)||Vy(n.y)}function Vy(n){return n&&n!=="0%"}function cc(n,a,i){const l=n-i,c=a*l;return i+c}function Hy(n,a,i,l,c){return c!==void 0&&(n=cc(n,c,l)),cc(n,i,l)+a}function Bf(n,a=0,i=1,l,c){n.min=Hy(n.min,a,i,l,c),n.max=Hy(n.max,a,i,l,c)}function Ix(n,{x:a,y:i}){Bf(n.x,a.translate,a.scale,a.originPoint),Bf(n.y,i.translate,i.scale,i.originPoint)}const Py=.999999999999,Gy=1.0000000000001;function uE(n,a,i,l=!1){const c=i.length;if(!c)return;a.x=a.y=1;let d,f;for(let m=0;m<c;m++){d=i[m],f=d.projectionDelta;const{visualElement:p}=d.options;p&&p.props.style&&p.props.style.display==="contents"||(l&&d.options.layoutScroll&&d.scroll&&d!==d.root&&Li(n,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),f&&(a.x*=f.x.scale,a.y*=f.y.scale,Ix(n,f)),l&&Ms(d.latestValues)&&Li(n,d.latestValues))}a.x<Gy&&a.x>Py&&(a.x=1),a.y<Gy&&a.y>Py&&(a.y=1)}function Bi(n,a){n.min=n.min+a,n.max=n.max+a}function $y(n,a,i,l,c=.5){const d=mt(n.min,n.max,c);Bf(n,a,i,d,l)}function Li(n,a){$y(n.x,a.x,a.scaleX,a.scale,a.originX),$y(n.y,a.y,a.scaleY,a.scale,a.originY)}function zx(n,a){return Bx(cE(n.getBoundingClientRect(),a))}function dE(n,a,i){const l=zx(n,i),{scroll:c}=a;return c&&(Bi(l.x,c.offset.x),Bi(l.y,c.offset.y)),l}const Ux=({current:n})=>n?n.ownerDocument.defaultView:null,fE=new WeakMap;class hE{constructor(a){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Tt(),this.visualElement=a}start(a,{snapToCursor:i=!1}={}){const{presenceContext:l}=this.visualElement;if(l&&l.isPresent===!1)return;const c=g=>{const{dragSnapToOrigin:b}=this.getProps();b?this.pauseAnimation():this.stopAnimation(),i&&this.snapToCursor(bl(g).point)},d=(g,b)=>{const{drag:x,dragPropagation:_,onDragStart:T}=this.getProps();if(x&&!_&&(this.openDragLock&&this.openDragLock(),this.openDragLock=qC(x),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Rn(w=>{let k=this.getAxisMotionValue(w).get()||0;if(Qn.test(k)){const{projection:C}=this.visualElement;if(C&&C.layout){const A=C.layout.layoutBox[w];A&&(k=vn(A)*(parseFloat(k)/100))}}this.originPoint[w]=k}),T&&ct.postRender(()=>T(g,b)),Tf(this.visualElement,"transform");const{animationState:N}=this.visualElement;N&&N.setActive("whileDrag",!0)},f=(g,b)=>{const{dragPropagation:x,dragDirectionLock:_,onDirectionLock:T,onDrag:N}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:w}=b;if(_&&this.currentDirection===null){this.currentDirection=mE(w),this.currentDirection!==null&&T&&T(this.currentDirection);return}this.updateAxis("x",b.point,w),this.updateAxis("y",b.point,w),this.visualElement.render(),N&&N(g,b)},m=(g,b)=>this.stop(g,b),p=()=>Rn(g=>{var b;return this.getAnimationState(g)==="paused"&&((b=this.getAxisMotionValue(g).animation)===null||b===void 0?void 0:b.play())}),{dragSnapToOrigin:v}=this.getProps();this.panSession=new Dx(a,{onSessionStart:c,onStart:d,onMove:f,onSessionEnd:m,resumeAnimation:p},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:v,contextWindow:Ux(this.visualElement)})}stop(a,i){const l=this.isDragging;if(this.cancel(),!l)return;const{velocity:c}=i;this.startAnimation(c);const{onDragEnd:d}=this.getProps();d&&ct.postRender(()=>d(a,i))}cancel(){this.isDragging=!1;const{projection:a,animationState:i}=this.visualElement;a&&(a.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:l}=this.getProps();!l&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}updateAxis(a,i,l){const{drag:c}=this.getProps();if(!l||!Gr(a,c,this.currentDirection))return;const d=this.getAxisMotionValue(a);let f=this.originPoint[a]+l[a];this.constraints&&this.constraints[a]&&(f=nE(f,this.constraints[a],this.elastic[a])),d.set(f)}resolveConstraints(){var a;const{dragConstraints:i,dragElastic:l}=this.getProps(),c=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)===null||a===void 0?void 0:a.layout,d=this.constraints;i&&Ri(i)?this.constraints||(this.constraints=this.resolveRefConstraints()):i&&c?this.constraints=aE(c.layoutBox,i):this.constraints=!1,this.elastic=lE(l),d!==this.constraints&&c&&this.constraints&&!this.hasMutatedConstraints&&Rn(f=>{this.constraints!==!1&&this.getAxisMotionValue(f)&&(this.constraints[f]=oE(c.layoutBox[f],this.constraints[f]))})}resolveRefConstraints(){const{dragConstraints:a,onMeasureDragConstraints:i}=this.getProps();if(!a||!Ri(a))return!1;const l=a.current,{projection:c}=this.visualElement;if(!c||!c.layout)return!1;const d=dE(l,c.root,this.visualElement.getTransformPagePoint());let f=sE(c.layout.layoutBox,d);if(i){const m=i(rE(f));this.hasMutatedConstraints=!!m,m&&(f=Bx(m))}return f}startAnimation(a){const{drag:i,dragMomentum:l,dragElastic:c,dragTransition:d,dragSnapToOrigin:f,onDragTransitionEnd:m}=this.getProps(),p=this.constraints||{},v=Rn(g=>{if(!Gr(g,i,this.currentDirection))return;let b=p&&p[g]||{};f&&(b={min:0,max:0});const x=c?200:1e6,_=c?40:1e7,T={type:"inertia",velocity:l?a[g]:0,bounceStiffness:x,bounceDamping:_,timeConstant:750,restDelta:1,restSpeed:10,...d,...b};return this.startAxisValueAnimation(g,T)});return Promise.all(v).then(m)}startAxisValueAnimation(a,i){const l=this.getAxisMotionValue(a);return Tf(this.visualElement,a),l.start(Dh(a,l,0,i,this.visualElement,!1))}stopAnimation(){Rn(a=>this.getAxisMotionValue(a).stop())}pauseAnimation(){Rn(a=>{var i;return(i=this.getAxisMotionValue(a).animation)===null||i===void 0?void 0:i.pause()})}getAnimationState(a){var i;return(i=this.getAxisMotionValue(a).animation)===null||i===void 0?void 0:i.state}getAxisMotionValue(a){const i=`_drag${a.toUpperCase()}`,l=this.visualElement.getProps(),c=l[i];return c||this.visualElement.getValue(a,(l.initial?l.initial[a]:void 0)||0)}snapToCursor(a){Rn(i=>{const{drag:l}=this.getProps();if(!Gr(i,l,this.currentDirection))return;const{projection:c}=this.visualElement,d=this.getAxisMotionValue(i);if(c&&c.layout){const{min:f,max:m}=c.layout.layoutBox[i];d.set(a[i]-mt(f,m,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:a,dragConstraints:i}=this.getProps(),{projection:l}=this.visualElement;if(!Ri(i)||!l||!this.constraints)return;this.stopAnimation();const c={x:0,y:0};Rn(f=>{const m=this.getAxisMotionValue(f);if(m&&this.constraints!==!1){const p=m.get();c[f]=iE({min:p,max:p},this.constraints[f])}});const{transformTemplate:d}=this.visualElement.getProps();this.visualElement.current.style.transform=d?d({},""):"none",l.root&&l.root.updateScroll(),l.updateLayout(),this.resolveConstraints(),Rn(f=>{if(!Gr(f,a,null))return;const m=this.getAxisMotionValue(f),{min:p,max:v}=this.constraints[f];m.set(mt(p,v,c[f]))})}addListeners(){if(!this.visualElement.current)return;fE.set(this.visualElement,this);const a=this.visualElement.current,i=nl(a,"pointerdown",p=>{const{drag:v,dragListener:g=!0}=this.getProps();v&&g&&this.start(p)}),l=()=>{const{dragConstraints:p}=this.getProps();Ri(p)&&p.current&&(this.constraints=this.resolveRefConstraints())},{projection:c}=this.visualElement,d=c.addEventListener("measure",l);c&&!c.layout&&(c.root&&c.root.updateScroll(),c.updateLayout()),ct.read(l);const f=fl(window,"resize",()=>this.scalePositionWithinConstraints()),m=c.addEventListener("didUpdate",(({delta:p,hasLayoutChanged:v})=>{this.isDragging&&v&&(Rn(g=>{const b=this.getAxisMotionValue(g);b&&(this.originPoint[g]+=p[g].translate,b.set(b.get()+p[g].translate))}),this.visualElement.render())}));return()=>{f(),i(),d(),m&&m()}}getProps(){const a=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:l=!1,dragPropagation:c=!1,dragConstraints:d=!1,dragElastic:f=Mf,dragMomentum:m=!0}=a;return{...a,drag:i,dragDirectionLock:l,dragPropagation:c,dragConstraints:d,dragElastic:f,dragMomentum:m}}}function Gr(n,a,i){return(a===!0||a===n)&&(i===null||i===n)}function mE(n,a=10){let i=null;return Math.abs(n.y)>a?i="y":Math.abs(n.x)>a&&(i="x"),i}class pE extends cs{constructor(a){super(a),this.removeGroupControls=pn,this.removeListeners=pn,this.controls=new hE(a)}mount(){const{dragControls:a}=this.node.getProps();a&&(this.removeGroupControls=a.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||pn}unmount(){this.removeGroupControls(),this.removeListeners()}}const qy=n=>(a,i)=>{n&&ct.postRender(()=>n(a,i))};class vE extends cs{constructor(){super(...arguments),this.removePointerDownListener=pn}onPointerDown(a){this.session=new Dx(a,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ux(this.node)})}createPanHandlers(){const{onPanSessionStart:a,onPanStart:i,onPan:l,onPanEnd:c}=this.node.getProps();return{onSessionStart:qy(a),onStart:qy(i),onMove:l,onEnd:(d,f)=>{delete this.session,c&&ct.postRender(()=>c(d,f))}}}mount(){this.removePointerDownListener=nl(this.node.current,"pointerdown",a=>this.onPointerDown(a))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Jr={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Ky(n,a){return a.max===a.min?0:n/(a.max-a.min)*100}const Ko={correct:(n,a)=>{if(!a.target)return n;if(typeof n=="string")if(xe.test(n))n=parseFloat(n);else return n;const i=Ky(n,a.target.x),l=Ky(n,a.target.y);return`${i}% ${l}%`}},gE={correct:(n,{treeScale:a,projectionDelta:i})=>{const l=n,c=os.parse(n);if(c.length>5)return l;const d=os.createTransformer(n),f=typeof c[0]!="number"?1:0,m=i.x.scale*a.x,p=i.y.scale*a.y;c[0+f]/=m,c[1+f]/=p;const v=mt(m,p,.5);return typeof c[2+f]=="number"&&(c[2+f]/=v),typeof c[3+f]=="number"&&(c[3+f]/=v),d(c)}};class yE extends y.Component{componentDidMount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:l,layoutId:c}=this.props,{projection:d}=a;$w(bE),d&&(i.group&&i.group.add(d),l&&l.register&&c&&l.register(d),d.root.didUpdate(),d.addEventListener("animationComplete",()=>{this.safeToRemove()}),d.setOptions({...d.options,onExitComplete:()=>this.safeToRemove()})),Jr.hasEverUpdated=!0}getSnapshotBeforeUpdate(a){const{layoutDependency:i,visualElement:l,drag:c,isPresent:d}=this.props,f=l.projection;return f&&(f.isPresent=d,c||a.layoutDependency!==i||i===void 0?f.willUpdate():this.safeToRemove(),a.isPresent!==d&&(d?f.promote():f.relegate()||ct.postRender(()=>{const m=f.getStack();(!m||!m.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:a}=this.props.visualElement;a&&(a.root.didUpdate(),oh.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:l}=this.props,{projection:c}=a;c&&(c.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(c),l&&l.deregister&&l.deregister(c))}safeToRemove(){const{safeToRemove:a}=this.props;a&&a()}render(){return null}}function Vx(n){const[a,i]=kb(),l=y.useContext(Jf);return r.jsx(yE,{...n,layoutGroup:l,switchLayoutGroup:y.useContext(Rb),isPresent:a,safeToRemove:i})}const bE={borderRadius:{...Ko,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ko,borderTopRightRadius:Ko,borderBottomLeftRadius:Ko,borderBottomRightRadius:Ko,boxShadow:gE};function xE(n,a,i){const l=Zt(n)?n:ul(n);return l.start(Dh("",l,a,i)),l.animation}function SE(n){return n instanceof SVGElement&&n.tagName!=="svg"}const _E=(n,a)=>n.depth-a.depth;class TE{constructor(){this.children=[],this.isDirty=!1}add(a){gh(this.children,a),this.isDirty=!0}remove(a){yh(this.children,a),this.isDirty=!0}forEach(a){this.isDirty&&this.children.sort(_E),this.isDirty=!1,this.children.forEach(a)}}function kE(n,a){const i=Wn.now(),l=({timestamp:c})=>{const d=c-i;d>=a&&(is(l),n(d-a))};return ct.read(l,!0),()=>is(l)}const Hx=["TopLeft","TopRight","BottomLeft","BottomRight"],jE=Hx.length,Yy=n=>typeof n=="string"?parseFloat(n):n,Fy=n=>typeof n=="number"||xe.test(n);function wE(n,a,i,l,c,d){c?(n.opacity=mt(0,i.opacity!==void 0?i.opacity:1,NE(l)),n.opacityExit=mt(a.opacity!==void 0?a.opacity:1,0,CE(l))):d&&(n.opacity=mt(a.opacity!==void 0?a.opacity:1,i.opacity!==void 0?i.opacity:1,l));for(let f=0;f<jE;f++){const m=`border${Hx[f]}Radius`;let p=Zy(a,m),v=Zy(i,m);if(p===void 0&&v===void 0)continue;p||(p=0),v||(v=0),p===0||v===0||Fy(p)===Fy(v)?(n[m]=Math.max(mt(Yy(p),Yy(v),l),0),(Qn.test(v)||Qn.test(p))&&(n[m]+="%")):n[m]=v}(a.rotate||i.rotate)&&(n.rotate=mt(a.rotate||0,i.rotate||0,l))}function Zy(n,a){return n[a]!==void 0?n[a]:n.borderRadius}const NE=Px(0,.5,sx),CE=Px(.5,.95,pn);function Px(n,a,i){return l=>l<n?0:l>a?1:i(Gi(n,a,l))}function Xy(n,a){n.min=a.min,n.max=a.max}function An(n,a){Xy(n.x,a.x),Xy(n.y,a.y)}function Qy(n,a){n.translate=a.translate,n.scale=a.scale,n.originPoint=a.originPoint,n.origin=a.origin}function Wy(n,a,i,l,c){return n-=a,n=cc(n,1/i,l),c!==void 0&&(n=cc(n,1/c,l)),n}function EE(n,a=0,i=1,l=.5,c,d=n,f=n){if(Qn.test(a)&&(a=parseFloat(a),a=mt(f.min,f.max,a/100)-f.min),typeof a!="number")return;let m=mt(d.min,d.max,l);n===d&&(m-=a),n.min=Wy(n.min,a,i,m,c),n.max=Wy(n.max,a,i,m,c)}function Jy(n,a,[i,l,c],d,f){EE(n,a[i],a[l],a[c],a.scale,d,f)}const AE=["x","scaleX","originX"],DE=["y","scaleY","originY"];function e0(n,a,i,l){Jy(n.x,a,AE,i?i.x:void 0,l?l.x:void 0),Jy(n.y,a,DE,i?i.y:void 0,l?l.y:void 0)}function t0(n){return n.translate===0&&n.scale===1}function Gx(n){return t0(n.x)&&t0(n.y)}function n0(n,a){return n.min===a.min&&n.max===a.max}function RE(n,a){return n0(n.x,a.x)&&n0(n.y,a.y)}function a0(n,a){return Math.round(n.min)===Math.round(a.min)&&Math.round(n.max)===Math.round(a.max)}function $x(n,a){return a0(n.x,a.x)&&a0(n.y,a.y)}function s0(n){return vn(n.x)/vn(n.y)}function i0(n,a){return n.translate===a.translate&&n.scale===a.scale&&n.originPoint===a.originPoint}class ME{constructor(){this.members=[]}add(a){gh(this.members,a),a.scheduleRender()}remove(a){if(yh(this.members,a),a===this.prevLead&&(this.prevLead=void 0),a===this.lead){const i=this.members[this.members.length-1];i&&this.promote(i)}}relegate(a){const i=this.members.findIndex(c=>a===c);if(i===0)return!1;let l;for(let c=i;c>=0;c--){const d=this.members[c];if(d.isPresent!==!1){l=d;break}}return l?(this.promote(l),!0):!1}promote(a,i){const l=this.lead;if(a!==l&&(this.prevLead=l,this.lead=a,a.show(),l)){l.instance&&l.scheduleRender(),a.scheduleRender(),a.resumeFrom=l,i&&(a.resumeFrom.preserveOpacity=!0),l.snapshot&&(a.snapshot=l.snapshot,a.snapshot.latestValues=l.animationValues||l.latestValues),a.root&&a.root.isUpdating&&(a.isLayoutDirty=!0);const{crossfade:c}=a.options;c===!1&&l.hide()}}exitAnimationComplete(){this.members.forEach(a=>{const{options:i,resumingFrom:l}=a;i.onExitComplete&&i.onExitComplete(),l&&l.options.onExitComplete&&l.options.onExitComplete()})}scheduleRender(){this.members.forEach(a=>{a.instance&&a.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function OE(n,a,i){let l="";const c=n.x.translate/a.x,d=n.y.translate/a.y,f=(i==null?void 0:i.z)||0;if((c||d||f)&&(l=`translate3d(${c}px, ${d}px, ${f}px) `),(a.x!==1||a.y!==1)&&(l+=`scale(${1/a.x}, ${1/a.y}) `),i){const{transformPerspective:v,rotate:g,rotateX:b,rotateY:x,skewX:_,skewY:T}=i;v&&(l=`perspective(${v}px) ${l}`),g&&(l+=`rotate(${g}deg) `),b&&(l+=`rotateX(${b}deg) `),x&&(l+=`rotateY(${x}deg) `),_&&(l+=`skewX(${_}deg) `),T&&(l+=`skewY(${T}deg) `)}const m=n.x.scale*a.x,p=n.y.scale*a.y;return(m!==1||p!==1)&&(l+=`scale(${m}, ${p})`),l||"none"}const Os={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Xo=typeof window<"u"&&window.MotionDebug!==void 0,nf=["","X","Y","Z"],BE={visibility:"hidden"},o0=1e3;let LE=0;function af(n,a,i,l){const{latestValues:c}=a;c[n]&&(i[n]=c[n],a.setStaticValue(n,0),l&&(l[n]=0))}function qx(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:a}=n.options;if(!a)return;const i=Fb(a);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:c,layoutId:d}=n.options;window.MotionCancelOptimisedAnimation(i,"transform",ct,!(c||d))}const{parent:l}=n;l&&!l.hasCheckedOptimisedAppear&&qx(l)}function Kx({attachResizeListener:n,defaultParent:a,measureScroll:i,checkIsScrollRoot:l,resetTransform:c}){return class{constructor(f={},m=a==null?void 0:a()){this.id=LE++,this.animationId=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.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Xo&&(Os.totalNodes=Os.resolvedTargetDeltas=Os.recalculatedProjection=0),this.nodes.forEach(UE),this.nodes.forEach($E),this.nodes.forEach(qE),this.nodes.forEach(VE),Xo&&window.MotionDebug.record(Os)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=f,this.root=m?m.root||m:this,this.path=m?[...m.path,m]:[],this.parent=m,this.depth=m?m.depth+1:0;for(let p=0;p<this.path.length;p++)this.path[p].shouldResetTransform=!0;this.root===this&&(this.nodes=new TE)}addEventListener(f,m){return this.eventHandlers.has(f)||this.eventHandlers.set(f,new bh),this.eventHandlers.get(f).add(m)}notifyListeners(f,...m){const p=this.eventHandlers.get(f);p&&p.notify(...m)}hasListeners(f){return this.eventHandlers.has(f)}mount(f,m=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=SE(f),this.instance=f;const{layoutId:p,layout:v,visualElement:g}=this.options;if(g&&!g.current&&g.mount(f),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),m&&(v||p)&&(this.isLayoutDirty=!0),n){let b;const x=()=>this.root.updateBlockedByResize=!1;n(f,()=>{this.root.updateBlockedByResize=!0,b&&b(),b=kE(x,250),Jr.hasAnimatedSinceResize&&(Jr.hasAnimatedSinceResize=!1,this.nodes.forEach(r0))})}p&&this.root.registerSharedNode(p,this),this.options.animate!==!1&&g&&(p||v)&&this.addEventListener("didUpdate",({delta:b,hasLayoutChanged:x,hasRelativeTargetChanged:_,layout:T})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const N=this.options.transition||g.getDefaultTransition()||XE,{onLayoutAnimationStart:w,onLayoutAnimationComplete:k}=g.getProps(),C=!this.targetLayout||!$x(this.targetLayout,T)||_,A=!x&&_;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||A||x&&(C||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(b,A);const D={...vh(N,"layout"),onPlay:w,onComplete:k};(g.shouldReduceMotion||this.options.layoutRoot)&&(D.delay=0,D.type=!1),this.startAnimation(D)}else x||r0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=T})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const f=this.getStack();f&&f.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,is(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(KE),this.animationId++)}getTransformTemplate(){const{visualElement:f}=this.options;return f&&f.getProps().transformTemplate}willUpdate(f=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&qx(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let g=0;g<this.path.length;g++){const b=this.path[g];b.shouldResetTransform=!0,b.updateScroll("snapshot"),b.options.layoutRoot&&b.willUpdate(!1)}const{layoutId:m,layout:p}=this.options;if(m===void 0&&!p)return;const v=this.getTransformTemplate();this.prevTransformTemplateValue=v?v(this.latestValues,""):void 0,this.updateSnapshot(),f&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(l0);return}this.isUpdating||this.nodes.forEach(PE),this.isUpdating=!1,this.nodes.forEach(GE),this.nodes.forEach(IE),this.nodes.forEach(zE),this.clearAllSnapshots();const m=Wn.now();$t.delta=wa(0,1e3/60,m-$t.timestamp),$t.timestamp=m,$t.isProcessing=!0,Fd.update.process($t),Fd.preRender.process($t),Fd.render.process($t),$t.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,oh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(HE),this.sharedNodes.forEach(YE)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ct.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ct.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let p=0;p<this.path.length;p++)this.path[p].updateScroll();const f=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Tt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:m}=this.options;m&&m.notify("LayoutMeasure",this.layout.layoutBox,f?f.layoutBox:void 0)}updateScroll(f="measure"){let m=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===f&&(m=!1),m){const p=l(this.instance);this.scroll={animationId:this.root.animationId,phase:f,isRoot:p,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:p}}}resetTransform(){if(!c)return;const f=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,m=this.projectionDelta&&!Gx(this.projectionDelta),p=this.getTransformTemplate(),v=p?p(this.latestValues,""):void 0,g=v!==this.prevTransformTemplateValue;f&&(m||Ms(this.latestValues)||g)&&(c(this.instance,v),this.shouldResetTransform=!1,this.scheduleRender())}measure(f=!0){const m=this.measurePageBox();let p=this.removeElementScroll(m);return f&&(p=this.removeTransform(p)),QE(p),{animationId:this.root.animationId,measuredBox:m,layoutBox:p,latestValues:{},source:this.id}}measurePageBox(){var f;const{visualElement:m}=this.options;if(!m)return Tt();const p=m.measureViewportBox();if(!(((f=this.scroll)===null||f===void 0?void 0:f.wasRoot)||this.path.some(WE))){const{scroll:g}=this.root;g&&(Bi(p.x,g.offset.x),Bi(p.y,g.offset.y))}return p}removeElementScroll(f){var m;const p=Tt();if(An(p,f),!((m=this.scroll)===null||m===void 0)&&m.wasRoot)return p;for(let v=0;v<this.path.length;v++){const g=this.path[v],{scroll:b,options:x}=g;g!==this.root&&b&&x.layoutScroll&&(b.wasRoot&&An(p,f),Bi(p.x,b.offset.x),Bi(p.y,b.offset.y))}return p}applyTransform(f,m=!1){const p=Tt();An(p,f);for(let v=0;v<this.path.length;v++){const g=this.path[v];!m&&g.options.layoutScroll&&g.scroll&&g!==g.root&&Li(p,{x:-g.scroll.offset.x,y:-g.scroll.offset.y}),Ms(g.latestValues)&&Li(p,g.latestValues)}return Ms(this.latestValues)&&Li(p,this.latestValues),p}removeTransform(f){const m=Tt();An(m,f);for(let p=0;p<this.path.length;p++){const v=this.path[p];if(!v.instance||!Ms(v.latestValues))continue;Of(v.latestValues)&&v.updateSnapshot();const g=Tt(),b=v.measurePageBox();An(g,b),e0(m,v.latestValues,v.snapshot?v.snapshot.layoutBox:void 0,g)}return Ms(this.latestValues)&&e0(m,this.latestValues),m}setTargetDelta(f){this.targetDelta=f,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(f){this.options={...this.options,...f,crossfade:f.crossfade!==void 0?f.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!==$t.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(f=!1){var m;const p=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=p.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=p.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=p.isSharedProjectionDirty);const v=!!this.resumingFrom||this!==p;if(!(f||v&&this.isSharedProjectionDirty||this.isProjectionDirty||!((m=this.parent)===null||m===void 0)&&m.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:b,layoutId:x}=this.options;if(!(!this.layout||!(b||x))){if(this.resolvedRelativeTargetAt=$t.timestamp,!this.targetDelta&&!this.relativeTarget){const _=this.getClosestProjectingParent();_&&_.layout&&this.animationProgress!==1?(this.relativeParent=_,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Tt(),this.relativeTargetOrigin=Tt(),sl(this.relativeTargetOrigin,this.layout.layoutBox,_.layout.layoutBox),An(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Tt(),this.targetWithTransforms=Tt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),tE(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):An(this.target,this.layout.layoutBox),Ix(this.target,this.targetDelta)):An(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const _=this.getClosestProjectingParent();_&&!!_.resumingFrom==!!this.resumingFrom&&!_.options.layoutScroll&&_.target&&this.animationProgress!==1?(this.relativeParent=_,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Tt(),this.relativeTargetOrigin=Tt(),sl(this.relativeTargetOrigin,this.target,_.target),An(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Xo&&Os.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Of(this.parent.latestValues)||Lx(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var f;const m=this.getLead(),p=!!this.resumingFrom||this!==m;let v=!0;if((this.isProjectionDirty||!((f=this.parent)===null||f===void 0)&&f.isProjectionDirty)&&(v=!1),p&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(v=!1),this.resolvedRelativeTargetAt===$t.timestamp&&(v=!1),v)return;const{layout:g,layoutId:b}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(g||b))return;An(this.layoutCorrected,this.layout.layoutBox);const x=this.treeScale.x,_=this.treeScale.y;uE(this.layoutCorrected,this.treeScale,this.path,p),m.layout&&!m.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(m.target=m.layout.layoutBox,m.targetWithTransforms=Tt());const{target:T}=m;if(!T){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Qy(this.prevProjectionDelta.x,this.projectionDelta.x),Qy(this.prevProjectionDelta.y,this.projectionDelta.y)),al(this.projectionDelta,this.layoutCorrected,T,this.latestValues),(this.treeScale.x!==x||this.treeScale.y!==_||!i0(this.projectionDelta.x,this.prevProjectionDelta.x)||!i0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",T)),Xo&&Os.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(f=!0){var m;if((m=this.options.visualElement)===null||m===void 0||m.scheduleRender(),f){const p=this.getStack();p&&p.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Oi(),this.projectionDelta=Oi(),this.projectionDeltaWithTransform=Oi()}setAnimationOrigin(f,m=!1){const p=this.snapshot,v=p?p.latestValues:{},g={...this.latestValues},b=Oi();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!m;const x=Tt(),_=p?p.source:void 0,T=this.layout?this.layout.source:void 0,N=_!==T,w=this.getStack(),k=!w||w.members.length<=1,C=!!(N&&!k&&this.options.crossfade===!0&&!this.path.some(ZE));this.animationProgress=0;let A;this.mixTargetDelta=D=>{const E=D/1e3;c0(b.x,f.x,E),c0(b.y,f.y,E),this.setTargetDelta(b),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(sl(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox),FE(this.relativeTarget,this.relativeTargetOrigin,x,E),A&&RE(this.relativeTarget,A)&&(this.isProjectionDirty=!1),A||(A=Tt()),An(A,this.relativeTarget)),N&&(this.animationValues=g,wE(g,v,this.latestValues,E,C,k)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=E},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(f){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(is(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ct.update(()=>{Jr.hasAnimatedSinceResize=!0,this.currentAnimation=xE(0,o0,{...f,onUpdate:m=>{this.mixTargetDelta(m),f.onUpdate&&f.onUpdate(m)},onComplete:()=>{f.onComplete&&f.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 f=this.getStack();f&&f.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(o0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const f=this.getLead();let{targetWithTransforms:m,target:p,layout:v,latestValues:g}=f;if(!(!m||!p||!v)){if(this!==f&&this.layout&&v&&Yx(this.options.animationType,this.layout.layoutBox,v.layoutBox)){p=this.target||Tt();const b=vn(this.layout.layoutBox.x);p.x.min=f.target.x.min,p.x.max=p.x.min+b;const x=vn(this.layout.layoutBox.y);p.y.min=f.target.y.min,p.y.max=p.y.min+x}An(m,p),Li(m,g),al(this.projectionDeltaWithTransform,this.layoutCorrected,m,g)}}registerSharedNode(f,m){this.sharedNodes.has(f)||this.sharedNodes.set(f,new ME),this.sharedNodes.get(f).add(m);const v=m.options.initialPromotionConfig;m.promote({transition:v?v.transition:void 0,preserveFollowOpacity:v&&v.shouldPreserveFollowOpacity?v.shouldPreserveFollowOpacity(m):void 0})}isLead(){const f=this.getStack();return f?f.lead===this:!0}getLead(){var f;const{layoutId:m}=this.options;return m?((f=this.getStack())===null||f===void 0?void 0:f.lead)||this:this}getPrevLead(){var f;const{layoutId:m}=this.options;return m?(f=this.getStack())===null||f===void 0?void 0:f.prevLead:void 0}getStack(){const{layoutId:f}=this.options;if(f)return this.root.sharedNodes.get(f)}promote({needsReset:f,transition:m,preserveFollowOpacity:p}={}){const v=this.getStack();v&&v.promote(this,p),f&&(this.projectionDelta=void 0,this.needsReset=!0),m&&this.setOptions({transition:m})}relegate(){const f=this.getStack();return f?f.relegate(this):!1}resetSkewAndRotation(){const{visualElement:f}=this.options;if(!f)return;let m=!1;const{latestValues:p}=f;if((p.z||p.rotate||p.rotateX||p.rotateY||p.rotateZ||p.skewX||p.skewY)&&(m=!0),!m)return;const v={};p.z&&af("z",f,v,this.animationValues);for(let g=0;g<nf.length;g++)af(`rotate${nf[g]}`,f,v,this.animationValues),af(`skew${nf[g]}`,f,v,this.animationValues);f.render();for(const g in v)f.setStaticValue(g,v[g]),this.animationValues&&(this.animationValues[g]=v[g]);f.scheduleRender()}getProjectionStyles(f){var m,p;if(!this.instance||this.isSVG)return;if(!this.isVisible)return BE;const v={visibility:""},g=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,v.opacity="",v.pointerEvents=Qr(f==null?void 0:f.pointerEvents)||"",v.transform=g?g(this.latestValues,""):"none",v;const b=this.getLead();if(!this.projectionDelta||!this.layout||!b.target){const N={};return this.options.layoutId&&(N.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,N.pointerEvents=Qr(f==null?void 0:f.pointerEvents)||""),this.hasProjected&&!Ms(this.latestValues)&&(N.transform=g?g({},""):"none",this.hasProjected=!1),N}const x=b.animationValues||b.latestValues;this.applyTransformsToTarget(),v.transform=OE(this.projectionDeltaWithTransform,this.treeScale,x),g&&(v.transform=g(x,v.transform));const{x:_,y:T}=this.projectionDelta;v.transformOrigin=`${_.origin*100}% ${T.origin*100}% 0`,b.animationValues?v.opacity=b===this?(p=(m=x.opacity)!==null&&m!==void 0?m:this.latestValues.opacity)!==null&&p!==void 0?p:1:this.preserveOpacity?this.latestValues.opacity:x.opacityExit:v.opacity=b===this?x.opacity!==void 0?x.opacity:"":x.opacityExit!==void 0?x.opacityExit:0;for(const N in sc){if(x[N]===void 0)continue;const{correct:w,applyTo:k}=sc[N],C=v.transform==="none"?x[N]:w(x[N],b);if(k){const A=k.length;for(let D=0;D<A;D++)v[k[D]]=C}else v[N]=C}return this.options.layoutId&&(v.pointerEvents=b===this?Qr(f==null?void 0:f.pointerEvents)||"":"none"),v}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(f=>{var m;return(m=f.currentAnimation)===null||m===void 0?void 0:m.stop()}),this.root.nodes.forEach(l0),this.root.sharedNodes.clear()}}}function IE(n){n.updateLayout()}function zE(n){var a;const i=((a=n.resumeFrom)===null||a===void 0?void 0:a.snapshot)||n.snapshot;if(n.isLead()&&n.layout&&i&&n.hasListeners("didUpdate")){const{layoutBox:l,measuredBox:c}=n.layout,{animationType:d}=n.options,f=i.source!==n.layout.source;d==="size"?Rn(b=>{const x=f?i.measuredBox[b]:i.layoutBox[b],_=vn(x);x.min=l[b].min,x.max=x.min+_}):Yx(d,i.layoutBox,l)&&Rn(b=>{const x=f?i.measuredBox[b]:i.layoutBox[b],_=vn(l[b]);x.max=x.min+_,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[b].max=n.relativeTarget[b].min+_)});const m=Oi();al(m,l,i.layoutBox);const p=Oi();f?al(p,n.applyTransform(c,!0),i.measuredBox):al(p,l,i.layoutBox);const v=!Gx(m);let g=!1;if(!n.resumeFrom){const b=n.getClosestProjectingParent();if(b&&!b.resumeFrom){const{snapshot:x,layout:_}=b;if(x&&_){const T=Tt();sl(T,i.layoutBox,x.layoutBox);const N=Tt();sl(N,l,_.layoutBox),$x(T,N)||(g=!0),b.options.layoutRoot&&(n.relativeTarget=N,n.relativeTargetOrigin=T,n.relativeParent=b)}}}n.notifyListeners("didUpdate",{layout:l,snapshot:i,delta:p,layoutDelta:m,hasLayoutChanged:v,hasRelativeTargetChanged:g})}else if(n.isLead()){const{onExitComplete:l}=n.options;l&&l()}n.options.transition=void 0}function UE(n){Xo&&Os.totalNodes++,n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=!!(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}function VE(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function HE(n){n.clearSnapshot()}function l0(n){n.clearMeasurements()}function PE(n){n.isLayoutDirty=!1}function GE(n){const{visualElement:a}=n.options;a&&a.getProps().onBeforeLayoutMeasure&&a.notify("BeforeLayoutMeasure"),n.resetTransform()}function r0(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function $E(n){n.resolveTargetDelta()}function qE(n){n.calcProjection()}function KE(n){n.resetSkewAndRotation()}function YE(n){n.removeLeadSnapshot()}function c0(n,a,i){n.translate=mt(a.translate,0,i),n.scale=mt(a.scale,1,i),n.origin=a.origin,n.originPoint=a.originPoint}function u0(n,a,i,l){n.min=mt(a.min,i.min,l),n.max=mt(a.max,i.max,l)}function FE(n,a,i,l){u0(n.x,a.x,i.x,l),u0(n.y,a.y,i.y,l)}function ZE(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const XE={duration:.45,ease:[.4,0,.1,1]},d0=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),f0=d0("applewebkit/")&&!d0("chrome/")?Math.round:pn;function h0(n){n.min=f0(n.min),n.max=f0(n.max)}function QE(n){h0(n.x),h0(n.y)}function Yx(n,a,i){return n==="position"||n==="preserve-aspect"&&!eE(s0(a),s0(i),.2)}function WE(n){var a;return n!==n.root&&((a=n.scroll)===null||a===void 0?void 0:a.wasRoot)}const JE=Kx({attachResizeListener:(n,a)=>fl(n,"resize",a),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),sf={current:void 0},Fx=Kx({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!sf.current){const n=new JE({});n.mount(window),n.setOptions({layoutScroll:!0}),sf.current=n}return sf.current},resetTransform:(n,a)=>{n.style.transform=a!==void 0?a:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),e2={pan:{Feature:vE},drag:{Feature:pE,ProjectionNode:Fx,MeasureLayout:Vx}};function t2(n,a,i){var l;if(n instanceof Element)return[n];if(typeof n=="string"){let c=document;const d=(l=void 0)!==null&&l!==void 0?l:c.querySelectorAll(n);return d?Array.from(d):[]}return Array.from(n)}function Zx(n,a){const i=t2(n),l=new AbortController,c={passive:!0,...a,signal:l.signal};return[i,c,()=>l.abort()]}function m0(n){return a=>{a.pointerType==="touch"||Ax()||n(a)}}function n2(n,a,i={}){const[l,c,d]=Zx(n,i),f=m0(m=>{const{target:p}=m,v=a(m);if(typeof v!="function"||!p)return;const g=m0(b=>{v(b),p.removeEventListener("pointerleave",g)});p.addEventListener("pointerleave",g,c)});return l.forEach(m=>{m.addEventListener("pointerenter",f,c)}),d}function p0(n,a,i){const{props:l}=n;n.animationState&&l.whileHover&&n.animationState.setActive("whileHover",i==="Start");const c="onHover"+i,d=l[c];d&&ct.postRender(()=>d(a,bl(a)))}class a2 extends cs{mount(){const{current:a}=this.node;a&&(this.unmount=n2(a,i=>(p0(this.node,i,"Start"),l=>p0(this.node,l,"End"))))}unmount(){}}class s2 extends cs{constructor(){super(...arguments),this.isActive=!1}onFocus(){let a=!1;try{a=this.node.current.matches(":focus-visible")}catch{a=!0}!a||!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=yl(fl(this.node.current,"focus",()=>this.onFocus()),fl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const Xx=(n,a)=>a?n===a?!0:Xx(n,a.parentElement):!1,i2=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function o2(n){return i2.has(n.tagName)||n.tabIndex!==-1}const Qo=new WeakSet;function v0(n){return a=>{a.key==="Enter"&&n(a)}}function of(n,a){n.dispatchEvent(new PointerEvent("pointer"+a,{isPrimary:!0,bubbles:!0}))}const l2=(n,a)=>{const i=n.currentTarget;if(!i)return;const l=v0(()=>{if(Qo.has(i))return;of(i,"down");const c=v0(()=>{of(i,"up")}),d=()=>of(i,"cancel");i.addEventListener("keyup",c,a),i.addEventListener("blur",d,a)});i.addEventListener("keydown",l,a),i.addEventListener("blur",()=>i.removeEventListener("keydown",l),a)};function g0(n){return Rh(n)&&!Ax()}function r2(n,a,i={}){const[l,c,d]=Zx(n,i),f=m=>{const p=m.currentTarget;if(!g0(m)||Qo.has(p))return;Qo.add(p);const v=a(m),g=(_,T)=>{window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",x),!(!g0(_)||!Qo.has(p))&&(Qo.delete(p),typeof v=="function"&&v(_,{success:T}))},b=_=>{g(_,i.useGlobalTarget||Xx(p,_.target))},x=_=>{g(_,!1)};window.addEventListener("pointerup",b,c),window.addEventListener("pointercancel",x,c)};return l.forEach(m=>{!o2(m)&&m.getAttribute("tabindex")===null&&(m.tabIndex=0),(i.useGlobalTarget?window:m).addEventListener("pointerdown",f,c),m.addEventListener("focus",v=>l2(v,c),c)}),d}function y0(n,a,i){const{props:l}=n;n.animationState&&l.whileTap&&n.animationState.setActive("whileTap",i==="Start");const c="onTap"+(i==="End"?"":i),d=l[c];d&&ct.postRender(()=>d(a,bl(a)))}class c2 extends cs{mount(){const{current:a}=this.node;a&&(this.unmount=r2(a,i=>(y0(this.node,i,"Start"),(l,{success:c})=>y0(this.node,l,c?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Lf=new WeakMap,lf=new WeakMap,u2=n=>{const a=Lf.get(n.target);a&&a(n)},d2=n=>{n.forEach(u2)};function f2({root:n,...a}){const i=n||document;lf.has(i)||lf.set(i,{});const l=lf.get(i),c=JSON.stringify(a);return l[c]||(l[c]=new IntersectionObserver(d2,{root:n,...a})),l[c]}function h2(n,a,i){const l=f2(a);return Lf.set(n,i),l.observe(n),()=>{Lf.delete(n),l.unobserve(n)}}const m2={some:0,all:1};class p2 extends cs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:a={}}=this.node.getProps(),{root:i,margin:l,amount:c="some",once:d}=a,f={root:i?i.current:void 0,rootMargin:l,threshold:typeof c=="number"?c:m2[c]},m=p=>{const{isIntersecting:v}=p;if(this.isInView===v||(this.isInView=v,d&&!v&&this.hasEnteredView))return;v&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",v);const{onViewportEnter:g,onViewportLeave:b}=this.node.getProps(),x=v?g:b;x&&x(p)};return h2(this.node.current,f,m)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:a,prevProps:i}=this.node;["amount","margin","root"].some(v2(a,i))&&this.startObserver()}unmount(){}}function v2({viewport:n={}},{viewport:a={}}={}){return i=>n[i]!==a[i]}const g2={inView:{Feature:p2},tap:{Feature:c2},focus:{Feature:s2},hover:{Feature:a2}},y2={layout:{ProjectionNode:Fx,MeasureLayout:Vx}},uc={current:null},Mh={current:!1};function Qx(){if(Mh.current=!0,!!nh)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),a=()=>uc.current=n.matches;n.addListener(a),a()}else uc.current=!1}const b2=[...yx,Ft,os],x2=n=>b2.find(gx(n)),b0=new WeakMap;function S2(n,a,i){for(const l in a){const c=a[l],d=i[l];if(Zt(c))n.addValue(l,c);else if(Zt(d))n.addValue(l,ul(c,{owner:n}));else if(d!==c)if(n.hasValue(l)){const f=n.getValue(l);f.liveStyle===!0?f.jump(c):f.hasAnimated||f.set(c)}else{const f=n.getStaticValue(l);n.addValue(l,ul(f!==void 0?f:c,{owner:n}))}}for(const l in i)a[l]===void 0&&n.removeValue(l);return a}const x0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class _2{scrapeMotionValuesFromProps(a,i,l){return{}}constructor({parent:a,props:i,presenceContext:l,reducedMotionConfig:c,blockInitialAnimation:d,visualState:f},m={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Ch,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},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 _=Wn.now();this.renderScheduledAt<_&&(this.renderScheduledAt=_,ct.render(this.render,!1,!0))};const{latestValues:p,renderState:v,onUpdate:g}=f;this.onUpdate=g,this.latestValues=p,this.baseTarget={...p},this.initialValues=i.initial?{...p}:{},this.renderState=v,this.parent=a,this.props=i,this.presenceContext=l,this.depth=a?a.depth+1:0,this.reducedMotionConfig=c,this.options=m,this.blockInitialAnimation=!!d,this.isControllingVariants=_c(i),this.isVariantNode=Ab(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(a&&a.current);const{willChange:b,...x}=this.scrapeMotionValuesFromProps(i,{},this);for(const _ in x){const T=x[_];p[_]!==void 0&&Zt(T)&&T.set(p[_],!1)}}mount(a){this.current=a,b0.set(a,this),this.projection&&!this.projection.instance&&this.projection.mount(a),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,l)=>this.bindToMotionValue(l,i)),Mh.current||Qx(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:uc.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){b0.delete(this.current),this.projection&&this.projection.unmount(),is(this.notifyUpdate),is(this.render),this.valueSubscriptions.forEach(a=>a()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const a in this.events)this.events[a].clear();for(const a in this.features){const i=this.features[a];i&&(i.unmount(),i.isMounted=!1)}this.current=null}bindToMotionValue(a,i){this.valueSubscriptions.has(a)&&this.valueSubscriptions.get(a)();const l=$s.has(a),c=i.on("change",m=>{this.latestValues[a]=m,this.props.onUpdate&&ct.preRender(this.notifyUpdate),l&&this.projection&&(this.projection.isTransformDirty=!0)}),d=i.on("renderRequest",this.scheduleRender);let f;window.MotionCheckAppearSync&&(f=window.MotionCheckAppearSync(this,a,i)),this.valueSubscriptions.set(a,()=>{c(),d(),f&&f(),i.owner&&i.stop()})}sortNodePosition(a){return!this.current||!this.sortInstanceNodePosition||this.type!==a.type?0:this.sortInstanceNodePosition(this.current,a.current)}updateFeatures(){let a="animation";for(a in Pi){const i=Pi[a];if(!i)continue;const{isEnabled:l,Feature:c}=i;if(!this.features[a]&&c&&l(this.props)&&(this.features[a]=new c(this)),this.features[a]){const d=this.features[a];d.isMounted?d.update():(d.mount(),d.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Tt()}getStaticValue(a){return this.latestValues[a]}setStaticValue(a,i){this.latestValues[a]=i}update(a,i){(a.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=a,this.prevPresenceContext=this.presenceContext,this.presenceContext=i;for(let l=0;l<x0.length;l++){const c=x0[l];this.propEventSubscriptions[c]&&(this.propEventSubscriptions[c](),delete this.propEventSubscriptions[c]);const d="on"+c,f=a[d];f&&(this.propEventSubscriptions[c]=this.on(c,f))}this.prevMotionValues=S2(this,this.scrapeMotionValuesFromProps(a,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(a){return this.props.variants?this.props.variants[a]: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(a){const i=this.getClosestVariantNode();if(i)return i.variantChildren&&i.variantChildren.add(a),()=>i.variantChildren.delete(a)}addValue(a,i){const l=this.values.get(a);i!==l&&(l&&this.removeValue(a),this.bindToMotionValue(a,i),this.values.set(a,i),this.latestValues[a]=i.get())}removeValue(a){this.values.delete(a);const i=this.valueSubscriptions.get(a);i&&(i(),this.valueSubscriptions.delete(a)),delete this.latestValues[a],this.removeValueFromRenderState(a,this.renderState)}hasValue(a){return this.values.has(a)}getValue(a,i){if(this.props.values&&this.props.values[a])return this.props.values[a];let l=this.values.get(a);return l===void 0&&i!==void 0&&(l=ul(i===null?void 0:i,{owner:this}),this.addValue(a,l)),l}readValue(a,i){var l;let c=this.latestValues[a]!==void 0||!this.current?this.latestValues[a]:(l=this.getBaseTargetFromProps(this.props,a))!==null&&l!==void 0?l:this.readValueFromInstance(this.current,a,this.options);return c!=null&&(typeof c=="string"&&(px(c)||ox(c))?c=parseFloat(c):!x2(c)&&os.test(i)&&(c=fx(a,i)),this.setBaseTarget(a,Zt(c)?c.get():c)),Zt(c)?c.get():c}setBaseTarget(a,i){this.baseTarget[a]=i}getBaseTarget(a){var i;const{initial:l}=this.props;let c;if(typeof l=="string"||typeof l=="object"){const f=rh(this.props,l,(i=this.presenceContext)===null||i===void 0?void 0:i.custom);f&&(c=f[a])}if(l&&c!==void 0)return c;const d=this.getBaseTargetFromProps(this.props,a);return d!==void 0&&!Zt(d)?d:this.initialValues[a]!==void 0&&c===void 0?void 0:this.baseTarget[a]}on(a,i){return this.events[a]||(this.events[a]=new bh),this.events[a].add(i)}notify(a,...i){this.events[a]&&this.events[a].notify(...i)}}class Wx extends _2{constructor(){super(...arguments),this.KeyframeResolver=bx}sortInstanceNodePosition(a,i){return a.compareDocumentPosition(i)&2?1:-1}getBaseTargetFromProps(a,i){return a.style?a.style[i]:void 0}removeValueFromRenderState(a,{vars:i,style:l}){delete i[a],delete l[a]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:a}=this.props;Zt(a)&&(this.childSubscription=a.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}function T2(n){return window.getComputedStyle(n)}class k2 extends Wx{constructor(){super(...arguments),this.type="html",this.renderInstance=Ub}readValueFromInstance(a,i){if($s.has(i)){const l=Nh(i);return l&&l.default||0}else{const l=T2(a),c=(Lb(i)?l.getPropertyValue(i):l[i])||0;return typeof c=="string"?c.trim():c}}measureInstanceViewportBox(a,{transformPagePoint:i}){return zx(a,i)}build(a,i,l){dh(a,i,l.transformTemplate)}scrapeMotionValuesFromProps(a,i,l){return ph(a,i,l)}}class j2 extends Wx{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Tt}getBaseTargetFromProps(a,i){return a[i]}readValueFromInstance(a,i){if($s.has(i)){const l=Nh(i);return l&&l.default||0}return i=Vb.has(i)?i:ih(i),a.getAttribute(i)}scrapeMotionValuesFromProps(a,i,l){return Gb(a,i,l)}build(a,i,l){fh(a,i,this.isSVGTag,l.transformTemplate)}renderInstance(a,i,l,c){Hb(a,i,l,c)}mount(a){this.isSVGTag=mh(a.tagName),super.mount(a)}}const w2=(n,a)=>lh(n)?new j2(a):new k2(a,{allowProjection:n!==y.Fragment}),N2=Jw({...$C,...g2,...e2,...y2},w2),Et=mw(N2);function C2(){!Mh.current&&Qx();const[n]=y.useState(uc.current);return n}const If={not_started:{color:"var(--text-tertiary)",icon:"○",label:"Not Started"},working:{color:"var(--accent-green)",icon:"●",label:"Working"},paused:{color:"var(--accent-yellow)",icon:"◉",label:"Paused"},complete:{color:"var(--accent-green)",icon:"✓",label:"Complete"},failed:{color:"var(--accent-red)",icon:"✗",label:"Failed"},blocked:{color:"var(--accent-yellow)",icon:"⦸",label:"Blocked"}};function ls(n){return n==="blocked"?If.blocked:If[Oh(n)]}const E2={not_started:"statusPending",working:"statusInProgress",paused:"statusWaitingInput",complete:"statusDone",failed:"statusFailed"};function A2(n){return E2[Oh(n)]??"statusPending"}const D2=["working","paused","failed","not_started","blocked","complete"],S0=["not_started","working","paused","complete","failed"],R2={pending:"not_started",assigned:"not_started",in_progress:"working",waiting_input:"paused",review:"paused",done:"complete"};function Oh(n){return n in If&&n!=="blocked"?n:R2[n]??"not_started"}const M2={not_started:"--text-tertiary",working:"--accent-green",paused:"--accent-yellow",complete:"--accent-green",failed:"--accent-red",pending:"--text-tertiary",assigned:"--text-tertiary",in_progress:"--accent-green",review:"--accent-yellow",done:"--accent-green",waiting_input:"--accent-yellow"};function O2(n){if(n.length===0)return[];const a=[...n].sort((l,c)=>l[0]-c[0]),i=[[a[0][0],a[0][1]]];for(let l=1;l<a.length;l++){const c=i[i.length-1],[d,f]=a[l];d<=c[1]+1?c[1]=Math.max(c[1],f):i.push([d,f])}return i}function Jx({text:n,indices:a,highlightClass:i}){if(!a||a.length===0)return r.jsx(r.Fragment,{children:n});const l=O2(a),c=[];let d=0;for(const[f,m]of l)f>d&&c.push(r.jsx("span",{children:n.slice(d,f)},`p${d}`)),c.push(r.jsx("mark",{className:i,children:n.slice(f,m+1)},`m${f}`)),d=m+1;return d<n.length&&c.push(r.jsx("span",{children:n.slice(d)},`p${d}`)),r.jsx(r.Fragment,{children:c})}function B2(n){const a=new Map(n.map(l=>[l.id,{...l,children:[]}])),i=[];for(const l of a.values())l.parentTaskId&&a.has(l.parentTaskId)?a.get(l.parentTaskId).children.push(l):i.push(l);for(const l of a.values())l.children.sort((c,d)=>c.sortOrder-d.sortOrder);return i.sort((l,c)=>l.sortOrder-c.sortOrder)}function L2(n,a){const i=new Map;for(const d of n){const m=d.dependsOn.length>0&&d.dependsOn.some(v=>a.get(v)!=="complete")?"blocked":d.status,p=i.get(m);p?p.push(d):i.set(m,[d])}const l=[],c=new Set;for(const d of D2){c.add(d);const f=i.get(d);if(f&&f.length>0){f.sort((p,v)=>p.sortOrder-v.sortOrder);const m=ls(d);l.push({status:d,label:m.label,style:m,tasks:f})}}for(const[d,f]of i)if(!c.has(d)&&f.length>0){f.sort((p,v)=>p.sortOrder-v.sortOrder);const m=ls(d);l.push({status:d,label:m.label,style:m,tasks:f})}return l}const I2="_container_z4i38_1",z2="_header_z4i38_5",U2="_headerActions_z4i38_17",V2="_searchInput_z4i38_23",H2="_searchHighlight_z4i38_56",P2="_groupToggle_z4i38_62",G2="_groupToggleActive_z4i38_89",$2="_addButton_z4i38_93",q2="_taskRow_z4i38_120",K2="_selected_z4i38_140",Y2="_expandArrow_z4i38_150",F2="_expanded_z4i38_157",Z2="_leafSpacer_z4i38_161",X2="_taskStatusIcon_z4i38_166",Q2="_taskTitle_z4i38_170",W2="_workspaceBadge_z4i38_177",J2="_childCountBadge_z4i38_195",eA="_dependencyBadge_z4i38_208",tA="_blockedBadge_z4i38_220",nA="_addChildButton_z4i38_225",aA="_emptyState_z4i38_268",sA="_statusGroupHeader_z4i38_275",iA="_statusGroupIcon_z4i38_294",oA="_statusGroupLabel_z4i38_298",lA="_statusGroupCount_z4i38_303",Ve={container:I2,header:z2,headerActions:U2,searchInput:V2,searchHighlight:H2,groupToggle:P2,groupToggleActive:G2,addButton:$2,taskRow:q2,selected:K2,expandArrow:Y2,expanded:F2,leafSpacer:Z2,taskStatusIcon:X2,taskTitle:Q2,workspaceBadge:W2,childCountBadge:J2,dependencyBadge:eA,blockedBadge:tA,addChildButton:nA,emptyState:aA,statusGroupHeader:sA,statusGroupIcon:iA,statusGroupLabel:oA,statusGroupCount:lA},rA=[{name:"title",weight:2},{name:"description",weight:1}],eS=16,cA=16,tS="grackle-task-group-by-status";function _0(){try{return localStorage.getItem(tS)==="true"}catch{return!1}}function uA(n){try{localStorage.setItem(tS,String(n))}catch{}}function dA({group:n,isExpanded:a,onToggle:i,selectedTaskId:l,navigate:c,titleHighlights:d,workspaceNames:f}){return r.jsxs("div",{"data-testid":`status-group-${n.status}`,children:[r.jsxs("div",{className:Ve.statusGroupHeader,role:"button",tabIndex:0,"aria-expanded":a,onClick:i,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),i())},children:[r.jsx("span",{className:`${Ve.expandArrow} ${a?Ve.expanded:""}`,children:"▸"}),r.jsx("span",{className:Ve.statusGroupIcon,style:{color:n.style.color},children:n.style.icon}),r.jsx("span",{className:Ve.statusGroupLabel,children:n.label}),r.jsx("span",{className:Ve.statusGroupCount,children:n.tasks.length})]}),r.jsx(ea,{children:a&&r.jsx(Et.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},style:{overflow:"hidden"},children:n.tasks.map(m=>{const p=ls(m.status),v=l===m.id,g=m.parentTaskId||!m.workspaceId?void 0:f.get(m.workspaceId);return r.jsxs("div",{onClick:()=>c(Jn(m.id)),className:`${Ve.taskRow} ${v?Ve.selected:""}`,style:{"--task-indent":`${eS}px`},"data-task-id":m.id,children:[r.jsx("span",{className:Ve.leafSpacer}),r.jsx("span",{className:Ve.taskStatusIcon,style:{color:p.color},children:p.icon}),r.jsx("span",{className:Ve.taskTitle,title:m.title,children:r.jsx(Jx,{text:m.title,indices:d.get(m.id),highlightClass:Ve.searchHighlight})}),g&&r.jsx("span",{className:Ve.workspaceBadge,title:g,children:g})]},m.id)})})})]})}function nS({node:n,depth:a,expandedTasks:i,toggleTask:l,selectedTaskId:c,navigate:d,taskStatusById:f,titleHighlights:m,workspaceNames:p}){const v=ls(n.status),g=n.dependsOn.length>0&&n.dependsOn.some(k=>f.get(k)!=="complete"),b=i.has(n.id),x=n.children.length>0,_=c===n.id,T=eS+a*cA,w=a===0&&!n.parentTaskId&&n.workspaceId?p.get(n.workspaceId):void 0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{onClick:()=>d(Jn(n.id)),className:`${Ve.taskRow} ${_?Ve.selected:""}`,style:{"--task-indent":`${T}px`},"data-task-id":n.id,children:[x&&r.jsx("span",{className:`${Ve.expandArrow} ${b?Ve.expanded:""}`,role:"button",tabIndex:0,"aria-label":b?"Collapse task":"Expand task",onClick:k=>{k.stopPropagation(),l(n.id)},onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),k.stopPropagation(),l(n.id))},children:"▸"}),!x&&r.jsx("span",{className:Ve.leafSpacer}),r.jsx("span",{className:Ve.taskStatusIcon,style:{color:v.color},children:v.icon}),r.jsx("span",{className:Ve.taskTitle,title:n.title,children:r.jsx(Jx,{text:n.title,indices:m.get(n.id),highlightClass:Ve.searchHighlight})}),w&&r.jsx("span",{className:Ve.workspaceBadge,title:w,children:w}),x&&r.jsxs("span",{className:Ve.childCountBadge,children:[n.children.filter(k=>k.status==="complete").length,"/",n.children.length]}),n.dependsOn.length>0&&r.jsx("span",{className:`${Ve.dependencyBadge} ${g?Ve.blockedBadge:""}`,title:`Depends on: ${n.dependsOn.join(", ")}`,children:g?"blocked":"dep"}),a<$1&&r.jsx("button",{onClick:k=>{k.stopPropagation(),d(Gs(n.workspaceId,n.id))},title:"Add child task","aria-label":"Add child task",className:Ve.addChildButton,children:"+"})]}),r.jsx(ea,{children:x&&b&&r.jsx(Et.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.15},style:{overflow:"hidden"},children:n.children.map(k=>r.jsx(nS,{node:k,depth:a+1,expandedTasks:i,toggleTask:l,selectedTaskId:c,navigate:d,taskStatusById:f,titleHighlights:m,workspaceNames:p},k.id))})})]})}function fA({workspaces:n,tasks:a}){const i=xt(),[l,c]=y.useState(new Set),[d,f]=y.useState(new Set),[m,p]=y.useState(_0),[v,g]=y.useState(_0),[b,x]=y.useState(new Map),_=Ct("/tasks/:taskId/*"),T=(_==null?void 0:_.params.taskId)!=="new"?_==null?void 0:_.params.taskId:void 0,N=y.useMemo(()=>new Map(a.map(q=>[q.id,q.status])),[a]),w=y.useMemo(()=>new Map(n.map(q=>[q.id,q.name])),[n]),k=()=>{const q=!m;uA(q),p(q),q&&(g(!0),x(new Map))},C=q=>{x(te=>{const O=new Map(te),P=O.has(q)?O.get(q):v;return O.set(q,!P),O})},A=q=>b.has(q)?b.get(q):v,D=q=>{c(te=>{const O=new Set(te);return O.has(q)?(O.delete(q),f(P=>new Set(P).add(q))):(O.add(q),f(P=>{const W=new Set(P);return W.delete(q),W})),O})};y.useEffect(()=>{const q=new Set(a.filter(te=>te.parentTaskId).map(te=>te.parentTaskId));q.size>0&&c(te=>{const O=new Set(te);for(const P of q)d.has(P)||O.add(P);return O})},[a,d]);const[E,I]=y.useState(""),{directMatchTaskIds:z,treeMatchTaskIds:U,titleHighlights:Y}=y.useMemo(()=>{if(!E.trim())return{directMatchTaskIds:null,treeMatchTaskIds:null,titleHighlights:new Map};const q=G1(a,E,rA),te=new Set(q.map(re=>re.item.id)),O=new Map;for(const re of q){const oe=re.matches.find(Ce=>Ce.key==="title");oe&&O.set(re.item.id,oe.indices)}const P=new Set(te),W=new Map(a.map(re=>[re.id,re]));for(const re of[...te]){let oe=W.get(re);for(;oe!=null&&oe.parentTaskId;)P.add(oe.parentTaskId),oe=W.get(oe.parentTaskId)}return{directMatchTaskIds:te,treeMatchTaskIds:P,titleHighlights:O}},[E,a]),ae=z!==null,se=ae?m?z:U:null,ie=se?a.filter(q=>se.has(q.id)):a,le=m?[]:B2(ie);return r.jsxs("div",{className:Ve.container,children:[r.jsxs("div",{className:Ve.header,children:[r.jsx("span",{children:"Tasks"}),r.jsxs("div",{className:Ve.headerActions,children:[r.jsx("button",{className:`${Ve.groupToggle} ${m?Ve.groupToggleActive:""}`,onClick:k,"aria-label":m?"Switch to tree view":"Group tasks by status","aria-pressed":m,title:m?"Switch to tree view":"Group tasks by status","data-testid":"task-group-by-status-toggle",children:"≡"}),r.jsx("button",{className:Ve.addButton,onClick:()=>i(Gs()),"aria-label":"New task",title:"New task","data-testid":"new-task-button",children:"+"})]})]}),a.length>0&&r.jsx("input",{type:"text",value:E,onChange:q=>I(q.target.value),placeholder:"Filter...","aria-label":"Filter tasks",className:Ve.searchInput,"data-testid":"sidebar-search"}),m?L2(ie,N).map(q=>r.jsx(dA,{group:q,isExpanded:A(q.status),onToggle:()=>C(q.status),selectedTaskId:T,navigate:i,titleHighlights:Y,workspaceNames:w},q.status)):le.map(q=>r.jsx(nS,{node:q,depth:0,expandedTasks:l,toggleTask:D,selectedTaskId:T,navigate:i,taskStatusById:N,titleHighlights:Y,workspaceNames:w},q.id)),ie.length===0&&!ae&&r.jsx("div",{className:Ve.emptyState,children:"No tasks yet. Click + to create one."}),ie.length===0&&ae&&r.jsx("div",{className:Ve.emptyState,children:"No matching tasks"})]})}const hA="_nav_14i94_1",mA="_tab_14i94_24",pA="_tabActive_14i94_62",vA="_tabLabel_14i94_75",gA="_statusDot_14i94_81",yA="_pulse_14i94_87",bA="_addButton_14i94_99",xA="_empty_14i94_132",ts={nav:hA,tab:mA,tabActive:pA,tabLabel:vA,statusDot:gA,pulse:yA,addButton:bA,empty:xA},SA={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function _A({environments:n}){const a=xt(),i=y.useRef(null),l=Ct("/environments/:environmentId"),c=Ct("/environments/:environmentId/edit"),d=Ct("/environments/:environmentId/workspaces/:workspaceId"),f=Ct("/environments/:environmentId/workspaces/:workspaceId/*"),m=(l==null?void 0:l.params.environmentId)??(c==null?void 0:c.params.environmentId)??(d==null?void 0:d.params.environmentId)??(f==null?void 0:f.params.environmentId),p=m==="new"?void 0:m,v=y.useCallback(x=>{a(Hi(x))},[a]),g=y.useCallback(x=>{var k;const _=(k=i.current)==null?void 0:k.querySelectorAll('[role="tab"]');if(!_||_.length===0)return;const T=Array.from(_).findIndex(C=>C===document.activeElement),N=T>=0?T:n.findIndex(C=>C.id===p);let w=N;if(x.key==="ArrowDown"||x.key==="j"||x.key==="J")x.preventDefault(),w=(N+1)%_.length;else if(x.key==="ArrowUp"||x.key==="k"||x.key==="K")x.preventDefault(),w=(N-1+_.length)%_.length;else if(x.key==="Home")x.preventDefault(),w=0;else if(x.key==="End")x.preventDefault(),w=_.length-1;else return;w<n.length&&a(Hi(n[w].id)),_[w].focus()},[p,n,a]),b=p??(n.length>0?n[0].id:void 0);return r.jsxs("div",{className:ts.nav,"data-testid":"environment-nav",children:[r.jsx("nav",{ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Environments",onKeyDown:g,children:n.map(x=>{const _=x.id===p,T=x.id===b,N=SA[x.status]||"var(--text-tertiary)",w=x.status==="connected";return r.jsxs("button",{role:"tab",type:"button","aria-selected":_,tabIndex:T?0:-1,className:`${ts.tab} ${_?ts.tabActive:""}`,onClick:()=>v(x.id),"data-testid":"env-nav-item",children:[r.jsx("span",{className:`${ts.statusDot} ${w?ts.pulse:""}`,style:{color:N},children:"●"}),r.jsx("span",{className:ts.tabLabel,title:x.displayName||x.id,children:x.displayName||x.id})]},x.id)})}),r.jsx("button",{type:"button",className:ts.addButton,onClick:()=>a(zk),title:"Add environment","data-testid":"env-nav-add",children:"+ Add Environment"}),n.length===0&&r.jsx("div",{className:ts.empty,children:"No environments yet."})]})}const TA="_nav_1bhou_1",kA="_tab_1bhou_24",jA="_tabIcon_1bhou_62",wA="_tabActive_1bhou_68",$r={nav:TA,tab:kA,tabIcon:jA,tabActive:wA},xa=[{path:"credentials",label:"Credentials",icon:"🔑"},{path:"personas",label:"Personas",icon:"👤"},{path:"appearance",label:"Appearance",icon:"🎨"},{path:"shortcuts",label:"Shortcuts",icon:"⌨️"},{path:"about",label:"About",icon:"ℹ️"}];function NA(){var f;const n=Ot(),a=xt(),i=y.useRef(null),l=((f=xa.find(m=>{const p=`${zi}/${m.path}`;return n.pathname===p||n.pathname.startsWith(`${p}/`)}))==null?void 0:f.path)??xa[0].path,c=y.useCallback(m=>{a(`${zi}/${m}`)},[a]),d=y.useCallback(m=>{var _,T;const p=(_=i.current)==null?void 0:_.querySelectorAll('[role="tab"]');if(!p)return;const v=Array.from(p).findIndex(N=>N===document.activeElement),g=v>=0?v:xa.findIndex(N=>N.path===l);let b=g;if(m.key==="ArrowDown"||m.key==="j"||m.key==="J")m.preventDefault(),b=(g+1)%xa.length;else if(m.key==="ArrowUp"||m.key==="k"||m.key==="K")m.preventDefault(),b=(g-1+xa.length)%xa.length;else if(m.key==="Home")m.preventDefault(),b=0;else if(m.key==="End")m.preventDefault(),b=xa.length-1;else return;const x=xa[b].path;a(`${zi}/${x}`),(T=p[b])==null||T.focus()},[l,a]);return r.jsx("nav",{className:$r.nav,ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Settings",onKeyDown:d,children:xa.map(m=>{const p=m.path===l;return r.jsxs("button",{role:"tab",type:"button","aria-selected":p,tabIndex:p?0:-1,className:`${$r.tab} ${p?$r.tabActive:""}`,onClick:()=>c(m.path),children:[r.jsx("span",{className:$r.tabIcon,"aria-hidden":"true",children:m.icon}),m.label]},m.path)})})}const CA="_nav_1snmp_1",EA="_searchForm_1snmp_8",AA="_searchInput_1snmp_15",DA="_searchButton_1snmp_33",RA="_clearButton_1snmp_68",MA="_workspaceSelect_1snmp_85",OA="_listHeader_1snmp_99",BA="_nodeList_1snmp_108",LA="_nodeItem_1snmp_116",IA="_indicator_1snmp_129",zA="_label_1snmp_136",UA="_badge_1snmp_145",Dn={nav:CA,searchForm:EA,searchInput:AA,searchButton:DA,clearButton:RA,workspaceSelect:MA,listHeader:OA,nodeList:BA,nodeItem:LA,indicator:IA,label:zA,badge:UA};function VA(){const{knowledge:n,workspaces:a}=ut(),[i,l]=y.useState(""),c=y.useCallback(p=>{p.preventDefault(),i.trim()&&n.search(i.trim())},[i,n]),d=y.useCallback(()=>{l(""),n.clearSearch()},[n]),f=y.useCallback(p=>{n.selectNode(p)},[n]),m=y.useCallback(p=>{l(""),n.loadRecent(p||void 0)},[n]);return r.jsxs("div",{className:Dn.nav,"data-testid":"knowledge-nav",children:[r.jsxs("form",{className:Dn.searchForm,onSubmit:c,children:[r.jsx("input",{className:Dn.searchInput,type:"text",placeholder:"Search...",value:i,onChange:p=>{l(p.target.value)},"data-testid":"knowledge-search-input"}),r.jsx("button",{type:"submit",className:Dn.searchButton,disabled:n.loading,children:"Go"})]}),n.searchQuery&&r.jsx("button",{type:"button",className:Dn.clearButton,onClick:d,children:"Clear search"}),r.jsxs("select",{className:Dn.workspaceSelect,onChange:p=>{m(p.target.value)},"data-testid":"knowledge-workspace-filter",children:[r.jsx("option",{value:"",children:"All workspaces"}),a.map(p=>r.jsx("option",{value:p.id,children:p.name},p.id))]}),r.jsxs("div",{className:Dn.listHeader,children:["Nodes (",n.graphData.nodes.length,")"]}),r.jsx("ul",{className:Dn.nodeList,children:n.graphData.nodes.map(p=>r.jsxs("li",{className:Dn.nodeItem,onClick:()=>{f(p.id)},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),f(p.id))},role:"button",tabIndex:0,children:[r.jsx("span",{className:Dn.indicator,style:{backgroundColor:p.kind==="reference"?"#4A9EFF":p.category==="decision"?"#22C55E":p.category==="concept"?"#A855F7":p.category==="snippet"?"#6B7280":"#EAB308"}}),r.jsx("span",{className:Dn.label,children:p.label}),r.jsx("span",{className:Dn.badge,children:p.kind==="reference"?p.sourceType:p.category})]},p.id))})]})}function HA(){const{workspaces:n,tasks:a}=ut(),i=y.useMemo(()=>r.jsx(fA,{workspaces:n,tasks:a}),[n,a]);return yc(i),r.jsx(Ps,{})}function PA(){const{environments:n}=ut(),a=y.useMemo(()=>r.jsx(_A,{environments:n}),[n]);return yc(a),r.jsx(Ps,{})}function GA(){const n=y.useMemo(()=>r.jsx(NA,{}),[]);return yc(n),r.jsx(Ps,{})}function $A(){const n=y.useMemo(()=>r.jsx(VA,{}),[]);return yc(n),r.jsx(Ps,{})}const qA="_bar_tnfsh_1",KA="_btnPrimary_tnfsh_32",YA="_statusText_tnfsh_85",FA="_statusCompleted_tnfsh_90",ZA="_statusFailed_tnfsh_94",XA="_statusBlocked_tnfsh_98",QA="_hintText_tnfsh_103",ft={bar:qA,btnPrimary:KA,statusText:YA,statusCompleted:FA,statusFailed:ZA,statusBlocked:XA,hintText:QA};function WA({sessions:n,tasks:a,environments:i}){const l=xt(),c=Ot(),d=Ct("/sessions/:sessionId"),f=Ct("/tasks/:taskId"),m=Ct("/tasks/:taskId/stream"),p=Ct("/tasks/:taskId/findings"),v=Ct("/tasks/:taskId/edit"),g=Ct("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId"),b=Ct("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream"),x=Ct("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings"),_=Ct("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit"),T=Ct("/sessions/new"),N=Ct("/environments/:environmentId/workspaces/:workspaceId"),w=Ct("/tasks/new"),k=Ct("/chat"),C=Ct("/"),A=Ct("/settings/*"),D=d==null?void 0:d.params.sessionId,E=(f==null?void 0:f.params.taskId)??(m==null?void 0:m.params.taskId)??(p==null?void 0:p.params.taskId)??(g==null?void 0:g.params.taskId)??(b==null?void 0:b.params.taskId)??(x==null?void 0:x.params.taskId)??(_==null?void 0:_.params.taskId),I=g??b??x??_,z=(I==null?void 0:I.params.environmentId)??(N==null?void 0:N.params.environmentId),U=c.pathname.startsWith("/environments")&&!N&&!I,Y=!!k,ae=!!T,se=!!N&&!g&&!b&&!x&&!_,ie=!!w;if(!!C&&!ae&&!se&&!ie||!!A||(!!v||!!_)||ie||U||ae)return r.jsx(r.Fragment,{});if(Y)return i.find(P=>P.adapterType==="local"&&P.status==="connected")?r.jsx(r.Fragment,{}):r.jsx("div",{className:ft.bar,children:r.jsx("span",{className:ft.hintText,children:"Add a local environment to start chatting"})});if(se)return r.jsx("div",{className:ft.bar,children:r.jsx("span",{className:ft.hintText,children:"Select a task or click + to create one"})});if(E){const O=a.find(re=>re.id===E);if(!O)return r.jsx("div",{className:ft.bar,children:r.jsx("span",{className:ft.hintText,children:"Loading..."})});const P=new Map(a.map(re=>[re.id,re])),W=O.dependsOn.some(re=>{const oe=P.get(re);return oe!==void 0&&oe.status!=="complete"});if(O.status==="not_started"){const re=W?O.dependsOn.map(oe=>P.get(oe)).filter(oe=>oe&&oe.status!=="complete").map(oe=>oe.title):[];return r.jsx("div",{className:ft.bar,children:W?r.jsxs("span",{className:ft.statusBlocked,children:["Blocked by: ",re.join(", ")]}):r.jsx("span",{className:ft.hintText,children:"Use the buttons above to start or manage this task"})})}if(O.status==="working"||O.status==="paused"){const re=O.latestSessionId||void 0,oe=re?n.find(je=>je.id===re):void 0;return oe&&oe.status!=="stopped"?r.jsx(r.Fragment,{}):r.jsx("div",{className:ft.bar,children:r.jsx("span",{className:ft.hintText,children:"Waiting for agent..."})})}if(O.status==="complete")return r.jsxs("div",{className:ft.bar,children:[r.jsx("span",{className:`${ft.statusText} ${ft.statusCompleted}`,children:"Task completed"}),r.jsx("button",{onClick:()=>l(Gs(O.workspaceId,void 0,z)),className:ft.btnPrimary,children:"+ New Task"})]});if(O.status==="failed")return r.jsx("div",{className:ft.bar,children:r.jsx("span",{className:`${ft.statusText} ${ft.statusFailed}`,children:"Task failed"})})}if(D){const O=n.find(re=>re.id===D),P=(O==null?void 0:O.status)==="stopped";if(O!==void 0&&!P)return r.jsx(r.Fragment,{});if(P)return r.jsxs("div",{className:ft.bar,children:[r.jsxs("span",{className:`${ft.statusText} ${ft.hintText}`,children:["Session ",O.endReason||O.status]}),r.jsx("button",{onClick:()=>l(lb(O.environmentId)),className:ft.btnPrimary,children:"+ New Chat"})]})}return r.jsx("div",{className:ft.bar,children:r.jsx("span",{className:ft.hintText,children:"Loading..."})})}const JA="_toast_da8ll_1",eD="_success_da8ll_18",tD="_icon_da8ll_22",nD="_error_da8ll_25",aD="_warning_da8ll_32",sD="_info_da8ll_38",iD="_message_da8ll_53",oD="_close_da8ll_60",Yo={toast:JA,success:eD,icon:tD,error:nD,warning:aD,info:sD,message:iD,close:oD},lD={success:"✓",error:"✕",warning:"⚠",info:"ℹ"};function rD({toast:n,onDismiss:a}){return y.useEffect(()=>{const i=setTimeout(()=>a(n.id),n.duration);return()=>clearTimeout(i)},[n.id,n.duration,a]),r.jsxs(Et.div,{className:`${Yo.toast} ${Yo[n.variant]}`,role:"status",initial:{opacity:0,y:-16,scale:.94},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.94},transition:{duration:.2,ease:"easeOut"},layout:!0,children:[r.jsx("span",{className:Yo.icon,"aria-hidden":"true",children:lD[n.variant]}),r.jsx("span",{className:Yo.message,children:n.message}),r.jsx("button",{type:"button",className:Yo.close,onClick:()=>a(n.id),"aria-label":"Dismiss notification",children:"×"})]})}const cD="_container_qqse2_1",uD={container:cD};function dD(){const{toasts:n,dismissToast:a}=Na();return r.jsx("div",{className:uD.container,"data-testid":"toast-container",children:r.jsx(ea,{children:n.map(i=>r.jsx(rD,{toast:i,onDismiss:a},i.id))})})}const fD="_breadcrumbs_17or2_1",hD="_list_17or2_11",mD="_item_17or2_21",pD="_separator_17or2_28",vD="_link_17or2_34",gD="_current_17or2_57",Ai={breadcrumbs:fD,list:hD,item:mD,separator:pD,link:vD,current:gD},yD="›";function us({segments:n}){return r.jsx("nav",{className:Ai.breadcrumbs,"aria-label":"Breadcrumb","data-testid":"breadcrumbs",children:r.jsx("ol",{className:Ai.list,children:n.map((a,i)=>{const l=i===n.length-1;return r.jsxs("li",{className:Ai.item,children:[i>0&&r.jsx("span",{className:Ai.separator,"aria-hidden":"true",children:yD}),a.url&&!l?r.jsx(Xf,{className:Ai.link,to:a.url,title:a.label,children:a.label}):r.jsx("span",{className:Ai.current,"aria-current":"page",title:a.label,children:a.label})]},i)})})})}const bD="_btn_dwk2o_1",xD="_sm_dwk2o_22",SD="_md_dwk2o_28",_D="_lg_dwk2o_34",TD="_primary_dwk2o_40",kD="_danger_dwk2o_55",jD="_outline_dwk2o_70",wD="_ghost_dwk2o_80",rf={btn:bD,sm:xD,md:SD,lg:_D,primary:TD,danger:kD,outline:jD,ghost:wD},Sa=y.forwardRef(function({variant:a="primary",size:i="md",className:l,children:c,...d},f){const m=[rf.btn,rf[a],rf[i],l].filter(Boolean).join(" ");return r.jsx("button",{ref:f,className:m,...d,children:c})});function zf(){zf=function(c,d){return new i(c,void 0,d)};var n=RegExp.prototype,a=new WeakMap;function i(c,d,f){var m=new RegExp(c,d);return a.set(m,f||a.get(c)),dc(m,i.prototype)}function l(c,d){var f=a.get(d);return Object.keys(f).reduce(function(m,p){var v=f[p];if(typeof v=="number")m[p]=c[v];else{for(var g=0;c[v[g]]===void 0&&g+1<v.length;)g++;m[p]=c[v[g]]}return m},Object.create(null))}return(function(c,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(d&&d.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),d&&dc(c,d)})(i,RegExp),i.prototype.exec=function(c){var d=n.exec.call(this,c);if(d){d.groups=l(d,this);var f=d.indices;f&&(f.groups=l(f,this))}return d},i.prototype[Symbol.replace]=function(c,d){if(typeof d=="string"){var f=a.get(this);return n[Symbol.replace].call(this,c,d.replace(/\$<([^>]+)>/g,function(p,v){var g=f[v];return"$"+(Array.isArray(g)?g.join("$"):g)}))}if(typeof d=="function"){var m=this;return n[Symbol.replace].call(this,c,function(){var p=arguments;return typeof p[p.length-1]!="object"&&(p=[].slice.call(p)).push(l(p,m)),d.apply(this,p)})}return n[Symbol.replace].call(this,c,d)},zf.apply(this,arguments)}function dc(n,a){return dc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,l){return i.__proto__=l,i},dc(n,a)}function T0(n,a){(a==null||a>n.length)&&(a=n.length);for(var i=0,l=new Array(a);i<a;i++)l[i]=n[i];return l}function cf(n,a){var i=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i)return(i=i.call(n)).next.bind(i);if(Array.isArray(n)||(i=(function(c,d){if(c){if(typeof c=="string")return T0(c,d);var f=Object.prototype.toString.call(c).slice(8,-1);return f==="Object"&&c.constructor&&(f=c.constructor.name),f==="Map"||f==="Set"?Array.from(c):f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f)?T0(c,d):void 0}})(n))||a){i&&(n=i);var l=0;return function(){return l>=n.length?{done:!0}:{done:!1,value:n[l++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
99
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ND=(function(n){return function(a){return a===void 0&&(a={}),(function(l,c){if(c&&!l.registered(c))throw new Error('The default language "'+c+'" is not registered with refractor.')})(n,a.defaultLanguage),function(l){w1(l,"element",i)};function i(l,c,d){var f,m;if(d&&d.tagName==="pre"&&l.tagName==="code"){var p=(l==null||(f=l.data)==null?void 0:f.meta)||(l==null||(m=l.properties)==null?void 0:m.metastring)||"";l.properties.className?typeof l.properties.className=="boolean"?l.properties.className=[]:Array.isArray(l.properties.className)||(l.properties.className=[l.properties.className]):l.properties.className=[];var v,g,b=(function(E){for(var I,z=cf(E.properties.className);!(I=z()).done;){var U=I.value;if(U.slice(0,9)==="language-")return U.slice(9).toLowerCase()}return null})(l);if(!b&&a.defaultLanguage&&l.properties.className.push("language-"+(b=a.defaultLanguage)),l.properties.className.push("code-highlight"),b)try{var x,_;_=(x=b)!=null&&x.includes("diff-")?b.split("-")[1]:b,v=n.highlight(Br(l),_),d.properties.className=(d.properties.className||[]).concat("language-"+_)}catch(E){if(!a.ignoreMissing||!/Unknown language/.test(E.message))throw E;v=l}else v=l;v.children=(g=1,function E(I){return I.reduce(function(z,U){if(U.type==="text"){var Y=U.value,ae=(Y.match(/\n/g)||"").length;if(ae===0)U.position={start:{line:g,column:1},end:{line:g,column:1}},z.push(U);else for(var se,ie=Y.split(`
|
|
100
|
+
`),le=cf(ie.entries());!(se=le()).done;){var q=se.value,te=q[0],O=q[1];z.push({type:"text",value:te===ie.length-1?O:O+`
|
|
101
|
+
`,position:{start:{line:g+te,column:1},end:{line:g+te,column:1}}})}return g+=ae,z}if(Object.prototype.hasOwnProperty.call(U,"children")){var P=g;return U.children=E(U.children),z.push(U),U.position={start:{line:P,column:1},end:{line:g,column:1}},z}return z.push(U),z},[])})(v.children),v.position=v.children.length>0?{start:{line:v.children[0].position.start.line,column:0},end:{line:v.children[v.children.length-1].position.end.line,column:0}}:{start:{line:0,column:0},end:{line:0,column:0}};for(var T,N=(function(E){var I=/{([\d,-]+)}/,z=E.split(",").map(function(ae){return ae.trim()}).join();if(I.test(z)){var U=I.exec(z)[1],Y=C1(U);return function(ae){return Y.includes(ae+1)}}return function(){return!1}})(p),w=(function(E){var I=zf(/showLineNumbers=(\d+)/i,{lines:1});if(I.test(E)){var z=I.exec(E);return Number(z.groups.lines)}return 1})(p),k=(function(E){for(var I=new Array(E),z=0;z<E;z++)I[z]={type:"element",tagName:"span",properties:{className:[]},children:[]};return I})(v.position.end.line),C=["showlinenumbers=false",'showlinenumbers="false"',"showlinenumbers={false}"],A=function(){var E,I,z=T.value,U=z[0],Y=z[1];Y.properties.className=["code-line"];var ae=E1(v,function(se){return se.position.start.line<=U+1&&se.position.end.line>=U+1});Y.children=ae.children,(p.toLowerCase().includes("showLineNumbers".toLowerCase())||a.showLineNumbers===!0||typeof a.showLineNumbers=="object"&&a.showLineNumbers.includes(b))&&!C.some(function(se){return p.toLowerCase().includes(se)})&&(Y.properties.line=[(U+w).toString()],Y.properties.className.push("line-number")),N(U)&&Y.properties.className.push("highlight-line"),(b==="diff"||(E=b)!=null&&E.includes("diff-"))&&Br(Y).substring(0,1)==="-"?Y.properties.className.push("deleted"):(b==="diff"||(I=b)!=null&&I.includes("diff-"))&&Br(Y).substring(0,1)==="+"&&Y.properties.className.push("inserted")},D=cf(k.entries());!(T=D()).done;)A();k.length>0&&Br(k[k.length-1]).trim()===""&&k.pop(),l.children=k}}}})(N1);function aS(n){if(n>=1e6)return`${(n/1e6).toFixed(1)}M`;if(n>=1e3){const a=Number((n/1e3).toFixed(1));return a>=1e3?`${(n/1e6).toFixed(1)}M`:`${a.toFixed(1)}k`}return String(n)}function qi(n){return n===0?"-":n<.01?`$${n.toFixed(4)}`:`$${n.toFixed(2)}`}const CD="_systemContextEvent_1qbiw_1",ED="_systemContextHeader_1qbiw_7",AD="_systemContextBadge_1qbiw_28",DD="_systemContextToggle_1qbiw_37",RD="_systemContextPre_1qbiw_43",MD="_systemContextEllipsis_1qbiw_54",OD="_systemEvent_1qbiw_58",BD="_systemTimestamp_1qbiw_65",LD="_textEvent_1qbiw_69",ID="_toolUseEvent_1qbiw_155",zD="_toolUseHeader_1qbiw_175",UD="_toolUsePrefix_1qbiw_182",VD="_toolUseName_1qbiw_187",HD="_toolUseArgs_1qbiw_192",PD="_toolResultEvent_1qbiw_203",GD="_toolResultHeader_1qbiw_208",$D="_toolResultIndicatorOk_1qbiw_232",qD="_toolResultIndicatorError_1qbiw_239",KD="_toolResultLabel_1qbiw_246",YD="_toolResultToggle_1qbiw_250",FD="_toolResultCommand_1qbiw_256",ZD="_toolResultEllipsis_1qbiw_266",XD="_toolResultPre_1qbiw_270",QD="_errorEvent_1qbiw_291",WD="_statusEvent_1qbiw_299",JD="_userInputEvent_1qbiw_308",eR="_userInputContent_1qbiw_314",tR="_signalEvent_1qbiw_331",nR="_signalBadge_1qbiw_342",aR="_signalContent_1qbiw_351",sR="_usageEvent_1qbiw_356",iR="_usageBadge_1qbiw_363",oR="_defaultEvent_1qbiw_372",Pe={systemContextEvent:CD,systemContextHeader:ED,systemContextBadge:AD,systemContextToggle:DD,systemContextPre:RD,systemContextEllipsis:MD,systemEvent:OD,systemTimestamp:BD,textEvent:LD,toolUseEvent:ID,toolUseHeader:zD,toolUsePrefix:UD,toolUseName:VD,toolUseArgs:HD,toolResultEvent:PD,toolResultHeader:GD,toolResultIndicatorOk:$D,toolResultIndicatorError:qD,toolResultLabel:KD,toolResultToggle:YD,toolResultCommand:FD,toolResultEllipsis:ZD,toolResultPre:XD,errorEvent:QD,statusEvent:WD,userInputEvent:JD,userInputContent:eR,signalEvent:tR,signalBadge:nR,signalContent:aR,usageEvent:sR,usageBadge:iR,defaultEvent:oR},k0=3;function lR({content:n}){const[a,i]=y.useState(!1),l=n.split(`
|
|
102
|
+
`),c=l.length>k0,d=a?n:l.slice(0,k0).join(`
|
|
103
|
+
`);return r.jsxs("div",{className:Pe.systemContextEvent,"data-testid":"system-context-event",children:[r.jsxs("button",{type:"button",className:Pe.systemContextHeader,onClick:()=>{i(f=>!f)},"aria-expanded":a,children:[r.jsx("span",{className:Pe.systemContextBadge,children:"SYSTEM PROMPT"}),c&&r.jsx("span",{className:Pe.systemContextToggle,"aria-hidden":"true",children:a?"▾":"▸"})]}),r.jsxs("pre",{className:Pe.systemContextPre,children:[d,!a&&c&&r.jsx("span",{className:Pe.systemContextEllipsis,children:"…"})]})]})}function rR({time:n,content:a}){return r.jsxs("div",{className:Pe.systemEvent,children:[r.jsxs("span",{className:Pe.systemTimestamp,children:["[",n,"]"]})," ",a]})}function cR({content:n}){return r.jsx("div",{className:Pe.textEvent,children:r.jsx(Hf,{remarkPlugins:[Pf],rehypePlugins:[ND],children:n})})}function uR({content:n}){let a="",i=n;try{const l=JSON.parse(n);a=l.tool||"",i=JSON.stringify(l.args,null,2)}catch{}return r.jsxs("div",{className:Pe.toolUseEvent,children:[r.jsxs("div",{className:Pe.toolUseHeader,children:[r.jsx("span",{className:Pe.toolUsePrefix,children:">"}),a?r.jsx("span",{className:Pe.toolUseName,children:a}):null]}),r.jsx("pre",{className:Pe.toolUseArgs,children:i})]})}const j0=5;function dR(n,a){if(a==null)return"";if(typeof a!="object")return String(a);const i=a;if(typeof i.command=="string")return i.command;if(typeof i.file_path=="string")return i.file_path;if(typeof i.pattern=="string"){const l=typeof i.path=="string"?` in ${i.path}`:"";return`${i.pattern}${l}`}if(typeof i.path=="string")return i.path;if(typeof i.query=="string")return i.query;try{const l=JSON.stringify(a);return l.length>150?`${l.slice(0,150)}…`:l}catch{return""}}function fR({content:n,raw:a,toolUseCtx:i}){const[l,c]=y.useState(!1);let d=!1;if(a)try{d=JSON.parse(a).is_error===!0}catch{}const f=n.split(`
|
|
104
|
+
`),m=f.length>j0,p=l?n:f.slice(0,j0).join(`
|
|
105
|
+
`),g=((i==null?void 0:i.tool)??"")||(d?"Tool error":"Tool output"),b=i?dR(i.tool,i.args):"",x=r.jsxs(r.Fragment,{children:[r.jsx("span",{className:d?Pe.toolResultIndicatorError:Pe.toolResultIndicatorOk,"aria-label":d?"error":"success","data-testid":d?"tool-result-indicator-error":"tool-result-indicator-ok",children:d?"✗":"✓"}),r.jsx("span",{className:Pe.toolResultLabel,"data-testid":"tool-result-label",children:g}),m&&r.jsx("span",{className:Pe.toolResultToggle,"aria-hidden":"true",children:l?"▾":"▸"})]});return r.jsxs("div",{className:Pe.toolResultEvent,"data-testid":"tool-result",children:[m?r.jsx("button",{className:Pe.toolResultHeader,"data-testid":"tool-result-header",onClick:()=>{c(_=>!_)},"aria-expanded":l,children:x}):r.jsx("div",{className:Pe.toolResultHeader,"data-testid":"tool-result-header",children:x}),b&&r.jsx("div",{className:Pe.toolResultCommand,children:b}),r.jsxs("pre",{className:Pe.toolResultPre,"data-testid":"tool-result-content",children:[p,!l&&m&&r.jsx("span",{className:Pe.toolResultEllipsis,children:"…"})]})]})}function hR({content:n}){return r.jsxs("div",{className:Pe.errorEvent,children:["Error: ",n]})}function mR({content:n}){return r.jsxs("div",{className:Pe.statusEvent,children:["--- ",n," ---"]})}function pR({content:n}){return r.jsx("div",{className:Pe.userInputEvent,children:r.jsx("span",{className:Pe.userInputContent,children:n})})}function vR({content:n}){return r.jsxs("div",{className:Pe.signalEvent,"data-testid":"signal-event",children:[r.jsx("span",{className:Pe.signalBadge,children:"SIGNAL"}),r.jsx("span",{className:Pe.signalContent,children:n})]})}function gR({content:n}){let a=n;try{const i=JSON.parse(n),l=Number(i.input_tokens)||0,c=Number(i.output_tokens)||0,d=aS(l+c),f=qi(Number(i.cost_usd)||0);a=`${d} tokens · ${f}`}catch{}return r.jsx("div",{className:Pe.usageEvent,"data-testid":"usage-event",children:r.jsx("span",{className:Pe.usageBadge,children:a})})}function yR({content:n}){return r.jsx("div",{className:Pe.defaultEvent,children:n})}function bR({event:n,toolUseCtx:a}){const i=new Date(n.timestamp).toLocaleTimeString();switch(n.eventType){case"system":{if(n.raw)try{if(JSON.parse(n.raw).systemContext===!0)return r.jsx(lR,{content:n.content})}catch{}return r.jsx(rR,{time:i,content:n.content})}case"text":case"output":return r.jsx(cR,{content:n.content});case"tool_use":return r.jsx(uR,{content:n.content});case"tool_result":return r.jsx(fR,{content:n.content,raw:n.raw,toolUseCtx:a});case"error":return r.jsx(hR,{content:n.content});case"status":return r.jsx(mR,{content:n.content});case"user_input":return r.jsx(pR,{content:n.content});case"signal":return r.jsx(vR,{content:n.content});case"usage":return r.jsx(gR,{content:n.content});default:return r.jsx(yR,{content:n.content})}}const xR="_overlay_cmicx_1",SR="_dialog_cmicx_11",_R="_title_cmicx_30",TR="_description_cmicx_38",kR="_actions_cmicx_45",jR="_cancelButton_cmicx_52",wR="_confirmButton_cmicx_79",As={overlay:xR,dialog:SR,title:_R,description:TR,actions:kR,cancelButton:jR,confirmButton:wR};function Us({isOpen:n,title:a,description:i,confirmLabel:l="Delete",onConfirm:c,onCancel:d}){const f=y.useId(),m=y.useId();return r.jsx(ea,{children:n&&r.jsx(Et.div,{className:As.overlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},onClick:d,onKeyDown:p=>{p.key==="Escape"&&d()},role:"dialog","aria-modal":"true","aria-labelledby":f,"aria-describedby":i?m:void 0,children:r.jsxs(Et.div,{className:As.dialog,initial:{opacity:0,scale:.93,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.93,y:-10},transition:{duration:.15,ease:[.16,1,.3,1]},onClick:p=>p.stopPropagation(),children:[r.jsx("h3",{id:f,className:As.title,children:a}),i&&r.jsx("p",{id:m,className:As.description,children:i}),r.jsxs("div",{className:As.actions,children:[r.jsx("button",{type:"button",className:As.cancelButton,onClick:d,autoFocus:!0,children:"Cancel"}),r.jsx("button",{type:"button",className:As.confirmButton,onClick:c,children:l})]})]})})})}const NR="_spinner_1uyt1_1",CR="_spin_1uyt1_1",ER="_sm_1uyt1_14",AR="_md_1uyt1_20",DR="_lg_1uyt1_26",RR="_xl_1uyt1_32",w0={spinner:NR,spin:CR,sm:ER,md:AR,lg:DR,xl:RR};function sS({size:n="md",className:a,label:i="Loading",liveRegion:l=!1}){return r.jsx("span",{className:`${w0.spinner} ${w0[n]} ${a??""}`,role:l?"status":void 0,"aria-label":i,"aria-hidden":l?void 0:!0})}const MR="_splash_1bn1g_1",OR="_logo_1bn1g_11",N0={splash:MR,logo:OR};function iS(){return r.jsxs("div",{className:N0.splash,"data-testid":"splash-screen",children:[r.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:N0.logo}),r.jsx(sS,{size:"xl",label:"Loading Grackle",liveRegion:!0})]})}function BR(n,a){const i=y.useRef(null);y.useEffect(()=>{const l=i.current;if(i.current=n,l===null)return;const c=new Map;for(const f of l)c.set(f.id,f);const d=new Set;for(const f of n){d.add(f.id);const m=c.get(f.id);if(m&&m.status!==f.status&&f.status!=="sleeping"){if(f.status==="connecting"){a("Provisioning environment…","info");continue}f.status==="connected"?a("Environment connected","success"):f.status==="error"?a("Environment provision failed","error"):f.status==="disconnected"&&(m.status==="connected"?a("Environment disconnected","warning"):a("Environment stopped","info"))}}for(const f of l)d.has(f.id)||a("Environment removed","info")},[n,a])}const LR={working:{message:"Task is now running",variant:"info"},paused:{message:"Task paused",variant:"warning"},complete:{message:"Task complete",variant:"success"},failed:{message:"Task failed to complete",variant:"error"}};function IR(n){return LR[n]}function zR(n,a){if(n===void 0)return[];const i=[],l=new Map;for(const d of n)l.set(d.id,d);const c=new Set;for(const d of a){c.add(d.id);const f=l.get(d.id);if(!f||f.status===d.status)continue;const m=IR(d.status);m&&i.push(m)}for(const d of n)c.has(d.id)||i.push({message:"Task deleted",variant:"info"});return i}function UR(n,a){const i=y.useRef(void 0);y.useEffect(()=>{const l=i.current;i.current=n;const c=zR(l,n);for(const d of c)a(d.message,d.variant)},[n,a])}function VR(n,a,i){const l=n.filter(p=>p.status==="running"||p.status==="idle"||p.status==="waiting").length,c=oS(a),d=a.filter(p=>Uf(p,c)).length,f=a.filter(p=>p.status==="paused"||p.status==="failed"||Uf(p,c)).length,m=i.filter(p=>p.status==="disconnected"||p.status==="error").length;return{activeSessions:l,blockedTasks:d,attentionTasks:f,unhealthyEnvironments:m}}function oS(n){const a=new Map;for(const i of n)a.set(i.id,i.status);return a}function Uf(n,a){return n.dependsOn.some(i=>a.get(i)!=="complete")}function HR(n,a){var f;const i=new Map;for(const m of a)i.set(m.id,m);const l=oS(n),c=[];for(const m of n){const p=m.workspaceId?((f=i.get(m.workspaceId))==null?void 0:f.name)??"Unknown":"Unknown";m.status==="failed"?c.push({task:m,reason:"failed",workspaceName:p}):Uf(m,l)?c.push({task:m,reason:"blocked",workspaceName:p}):m.status==="paused"&&c.push({task:m,reason:"paused",workspaceName:p})}const d={failed:0,blocked:1,paused:2};return c.sort((m,p)=>(d[m.reason]??3)-(d[p.reason]??3)),c}function PR(n,a){const i=new Map;for(const l of a)i.set(l.id,l);return n.filter(l=>l.status==="running"||l.status==="idle"||l.status==="waiting").map(l=>{var c;return{session:l,environmentName:((c=i.get(l.environmentId))==null?void 0:c.displayName)??"Unknown"}})}function GR(n,a,i){const l=new Map;for(const c of a){if(!c.workspaceId)continue;let d=l.get(c.workspaceId);d||(d={totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0},l.set(c.workspaceId,d)),d.totalTasks+=1,c.status==="complete"?d.completedTasks+=1:c.status==="working"?d.workingTasks+=1:c.status==="failed"&&(d.failedTasks+=1)}return n.map(c=>{const d=l.get(c.id)??{totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0};return{workspace:c,totalTasks:d.totalTasks,completedTasks:d.completedTasks,workingTasks:d.workingTasks,failedTasks:d.failedTasks}})}const $R="_dashboard_16pzm_1",qR="_kpiStrip_16pzm_11",KR="_kpiCard_16pzm_23",YR="_kpiValue_16pzm_68",FR="_kpiLabel_16pzm_76",ZR="_bodyGrid_16pzm_84",XR="_section_16pzm_96",QR="_sectionHeader_16pzm_109",WR="_sectionIcon_16pzm_118",JR="_sectionTitle_16pzm_123",eM="_sectionCount_16pzm_131",tM="_sectionBody_16pzm_138",nM="_emptyHint_16pzm_143",aM="_sessionRow_16pzm_150",sM="_sessionPrompt_16pzm_177",iM="_sessionEnv_16pzm_186",oM="_sessionRuntime_16pzm_192",lM="_sessionStatus_16pzm_198",rM="_statusDot_16pzm_207",cM="_attentionRow_16pzm_233",uM="_attentionTitle_16pzm_259",dM="_attentionMeta_16pzm_267",fM="_reasonBadge_16pzm_274",hM="_bottomGrid_16pzm_301",mM="_envRow_16pzm_312",pM="_envName_16pzm_323",vM="_envStatusBadge_16pzm_333",gM="_workspaceRow_16pzm_369",yM="_workspaceTop_16pzm_395",bM="_workspaceName_16pzm_401",xM="_workspaceCounts_16pzm_407",SM="_progressBar_16pzm_415",_M="_progressFill_16pzm_422",ge={dashboard:$R,kpiStrip:qR,kpiCard:KR,kpiValue:YR,kpiLabel:FR,bodyGrid:ZR,section:XR,sectionHeader:QR,sectionIcon:WR,sectionTitle:JR,sectionCount:eM,sectionBody:tM,emptyHint:nM,sessionRow:aM,sessionPrompt:sM,sessionEnv:iM,sessionRuntime:oM,sessionStatus:lM,statusDot:rM,attentionRow:cM,attentionTitle:uM,attentionMeta:dM,reasonBadge:fM,bottomGrid:hM,envRow:mM,envName:pM,envStatusBadge:vM,workspaceRow:gM,workspaceTop:yM,workspaceName:bM,workspaceCounts:xM,progressBar:SM,progressFill:_M},TM={hidden:{opacity:0,y:12},visible:n=>({opacity:1,y:0,transition:{delay:n*.06,duration:.3,ease:"easeOut"}})},qr={hidden:{opacity:0,y:16},visible:n=>({opacity:1,y:0,transition:{delay:.15+n*.08,duration:.35,ease:"easeOut"}})};function kM(n,a,i,l){const c=[`${n} of ${a} tasks completed`];return i>0&&c.push(`${i} in progress`),l>0&&c.push(`${l} failed`),c.join(", ")}function Kr({value:n,label:a,accent:i,index:l,testId:c}){return r.jsxs(Et.div,{className:ge.kpiCard,"data-accent":i,"data-testid":c,variants:TM,initial:"hidden",animate:"visible",custom:l,children:[r.jsx("span",{className:ge.kpiValue,children:n}),r.jsx("span",{className:ge.kpiLabel,children:a})]})}function jM(){const{workspaces:n,tasks:a,sessions:i,environments:l,loadTasks:c}=ut(),d=xt(),f=y.useRef(new Set);y.useEffect(()=>{for(const b of n)f.current.has(b.id)||(f.current.add(b.id),c(b.id))},[n,c]);const m=y.useMemo(()=>VR(i,a,l),[i,a,l]),p=y.useMemo(()=>PR(i,l),[i,l]),v=y.useMemo(()=>HR(a,n),[a,n]),g=y.useMemo(()=>GR(n,a),[n,a,l]);return r.jsxs("div",{className:ge.dashboard,"data-testid":"dashboard",children:[r.jsxs("div",{className:ge.kpiStrip,"data-testid":"dashboard-kpi-strip",children:[r.jsx(Kr,{value:m.activeSessions,label:"Active Sessions",accent:"green",index:0,testId:"kpi-active-sessions"}),r.jsx(Kr,{value:m.blockedTasks,label:"Blocked Tasks",accent:"yellow",index:1,testId:"kpi-blocked-tasks"}),r.jsx(Kr,{value:m.attentionTasks,label:"Needs Attention",accent:"red",index:2,testId:"kpi-attention-tasks"}),r.jsx(Kr,{value:m.unhealthyEnvironments,label:"Unhealthy Envs",accent:"blue",index:3,testId:"kpi-unhealthy-envs"})]}),r.jsxs("div",{className:ge.bodyGrid,children:[r.jsxs(Et.div,{className:ge.section,variants:qr,initial:"hidden",animate:"visible",custom:0,"data-testid":"dashboard-active-sessions",children:[r.jsxs("div",{className:ge.sectionHeader,children:[r.jsx("span",{className:ge.sectionIcon,"aria-hidden":"true",children:"●"}),r.jsx("span",{className:ge.sectionTitle,children:"Active Sessions"}),r.jsx("span",{className:ge.sectionCount,children:p.length})]}),r.jsx("div",{className:ge.sectionBody,children:p.length===0?r.jsx("div",{className:ge.emptyHint,children:"No active sessions"}):p.map(({session:b,environmentName:x})=>r.jsxs("button",{type:"button",className:ge.sessionRow,onClick:()=>d(ob(b.id)),"data-testid":"session-row",children:[r.jsx("span",{className:ge.sessionPrompt,title:b.prompt,children:b.prompt||"—"}),r.jsx("span",{className:ge.sessionEnv,children:x}),r.jsx("span",{className:ge.sessionRuntime,children:b.runtime}),r.jsxs("span",{className:ge.sessionStatus,children:[r.jsx("span",{className:ge.statusDot,"data-status":b.status}),b.status]})]},b.id))})]}),r.jsxs(Et.div,{className:ge.section,variants:qr,initial:"hidden",animate:"visible",custom:1,"data-testid":"dashboard-needs-attention",children:[r.jsxs("div",{className:ge.sectionHeader,children:[r.jsx("span",{className:ge.sectionIcon,"aria-hidden":"true",children:"⚑"}),r.jsx("span",{className:ge.sectionTitle,children:"Needs Attention"}),r.jsx("span",{className:ge.sectionCount,children:v.length})]}),r.jsx("div",{className:ge.sectionBody,children:v.length===0?r.jsx("div",{className:ge.emptyHint,children:"All clear"}):v.map(({task:b,reason:x,workspaceName:_})=>r.jsxs("button",{type:"button",className:ge.attentionRow,onClick:()=>d(Jn(b.id)),"data-testid":"attention-row",children:[r.jsxs("div",{className:ge.attentionTitle,children:[r.jsx("span",{className:ge.reasonBadge,"data-reason":x,children:x}),b.title]}),r.jsx("div",{className:ge.attentionMeta,children:r.jsx("span",{children:_})})]},b.id))})]})]}),r.jsxs("div",{className:ge.bottomGrid,children:[r.jsxs(Et.div,{className:ge.section,variants:qr,initial:"hidden",animate:"visible",custom:2,"data-testid":"dashboard-env-health",children:[r.jsxs("div",{className:ge.sectionHeader,children:[r.jsx("span",{className:ge.sectionIcon,"aria-hidden":"true",children:"◈"}),r.jsx("span",{className:ge.sectionTitle,children:"Environment Health"}),r.jsx("span",{className:ge.sectionCount,children:l.length})]}),r.jsx("div",{className:ge.sectionBody,children:l.length===0?r.jsx("div",{className:ge.emptyHint,children:"No environments configured"}):l.map(b=>r.jsxs("div",{className:ge.envRow,"data-testid":"dashboard-env-row",children:[r.jsx("span",{className:ge.envName,children:b.displayName}),r.jsx("span",{className:ge.envStatusBadge,"data-status":b.status,children:b.status})]},b.id))})]}),r.jsxs(Et.div,{className:ge.section,variants:qr,initial:"hidden",animate:"visible",custom:3,"data-testid":"dashboard-workspace-snapshot",children:[r.jsxs("div",{className:ge.sectionHeader,children:[r.jsx("span",{className:ge.sectionIcon,"aria-hidden":"true",children:"▦"}),r.jsx("span",{className:ge.sectionTitle,children:"Workspaces"}),r.jsx("span",{className:ge.sectionCount,children:n.length})]}),r.jsx("div",{className:ge.sectionBody,children:g.length===0?r.jsx("div",{className:ge.emptyHint,children:"No workspaces yet"}):g.map(({workspace:b,totalTasks:x,completedTasks:_,workingTasks:T,failedTasks:N})=>{const w=x>0?Math.round(_/x*100):0;return r.jsxs("button",{type:"button",className:ge.workspaceRow,onClick:()=>d(Ui(b.id,b.environmentId)),"data-testid":"workspace-row",children:[r.jsxs("div",{className:ge.workspaceTop,children:[r.jsx("span",{className:ge.workspaceName,children:b.name}),r.jsxs("span",{className:ge.workspaceCounts,"aria-label":kM(_,x,T,N),children:[_,"/",x,T>0&&r.jsxs("span",{style:{color:"var(--accent-green)"},"aria-hidden":"true",children:["▸",T]}),N>0&&r.jsxs("span",{style:{color:"var(--accent-red)"},"aria-hidden":"true",children:["✗",N]})]})]}),x>0&&r.jsx("div",{className:ge.progressBar,children:r.jsx("div",{className:ge.progressFill,style:{width:`${w}%`}})})]},b.id)})})]})]})]})}const wM="_panelContainer_aei9x_1",NM="_emptyState_aei9x_8",CM="_fadeIn_aei9x_1",EM="_workspaceSummary_aei9x_17",AM="_workspaceSummaryTitle_aei9x_28",DM="_workspaceSummarySubtitle_aei9x_32",RM="_header_aei9x_36",MM="_headerInfo_aei9x_69",OM="_killButton_aei9x_75",BM="_headerTitle_aei9x_104",LM="_headerActions_aei9x_119",IM="_taskStatusBadge_aei9x_126",zM="_taskBranch_aei9x_135",UM="_taskBlockedBadge_aei9x_141",VM="_btnPrimary_aei9x_149",HM="_btnDanger_aei9x_180",PM="_btnGhost_aei9x_219",GM="_rejectInput_aei9x_245",$M="_tabBar_aei9x_275",qM="_tab_aei9x_275",KM="_active_aei9x_301",YM="_eventScroll_aei9x_306",FM="_tabContent_aei9x_312",ZM="_noContext_aei9x_317",XM="_overviewContent_aei9x_323",QM="_overviewDashboard_aei9x_332",WM="_overviewHero_aei9x_338",JM="_statusBadge_aei9x_345",e3="_statusPending_aei9x_357",t3="_statusAssigned_aei9x_362",n3="_statusInProgress_aei9x_367",a3="_statusReview_aei9x_372",s3="_statusDone_aei9x_377",i3="_statusFailed_aei9x_382",o3="_statusWaitingInput_aei9x_387",l3="_overviewBranchPill_aei9x_392",r3="_branchLink_aei9x_407",c3="_overviewSection_aei9x_418",u3="_overviewLabel_aei9x_424",d3="_overviewValue_aei9x_431",f3="_overviewMuted_aei9x_436",h3="_overviewMarkdown_aei9x_442",m3="_envRow_aei9x_511",p3="_envDot_aei9x_517",v3="_envDotGreen_aei9x_524",g3="_envDotYellow_aei9x_528",y3="_envDotRed_aei9x_532",b3="_envDotGray_aei9x_536",x3="_depList_aei9x_540",S3="_depItem_aei9x_546",_3="_depBlocked_aei9x_553",T3="_depDone_aei9x_557",k3="_timeline_aei9x_561",j3="_timelineRow_aei9x_567",w3="_timelineKey_aei9x_574",N3="_timelineValue_aei9x_580",C3="_timelineDelta_aei9x_584",E3="_reviewNotes_aei9x_595",A3="_overviewDescription_aei9x_606",D3="_waitingMessage_aei9x_612",R3="_errorMessage_aei9x_616",M3="_eventOverflowWarning_aei9x_620",O3="_attemptSelector_aei9x_634",B3="_attemptLabel_aei9x_650",L3="_attemptButton_aei9x_654",I3="_attemptActive_aei9x_671",z3="_attemptStatus_aei9x_677",U3="_emptyCta_aei9x_683",V3="_ctaTitle_aei9x_695",H3="_ctaDescription_aei9x_701",P3="_ctaButton_aei9x_708",G3="_ctaCreateForm_aei9x_743",$3="_ctaCreateInput_aei9x_749",q3="_ctaCreateOk_aei9x_780",K3="_ctaLink_aei9x_815",Y3="_workspaceHeader_aei9x_829",F3="_workspaceName_aei9x_854",Z3="_workspaceMeta_aei9x_867",X3="_metaRow_aei9x_875",Q3="_metaLabel_aei9x_888",W3="_metaValue_aei9x_903",J3="_archiveButton_aei9x_913",eO="_repoLink_aei9x_943",tO="_metaToggle_aei9x_953",nO="_metaToggleArrow_aei9x_974",aO="_metaToggleArrowOpen_aei9x_979",sO="_progressBarContainer_aei9x_983",iO="_progressBar_aei9x_983",oO="_progressFill_aei9x_999",lO="_progressLabel_aei9x_1006",rO="_metaTimestamps_aei9x_1013",cO="_metaTimestamp_aei9x_1013",L={panelContainer:wM,emptyState:NM,fadeIn:CM,workspaceSummary:EM,workspaceSummaryTitle:AM,workspaceSummarySubtitle:DM,header:RM,headerInfo:MM,killButton:OM,headerTitle:BM,headerActions:LM,taskStatusBadge:IM,taskBranch:zM,taskBlockedBadge:UM,btnPrimary:VM,btnDanger:HM,btnGhost:PM,rejectInput:GM,tabBar:$M,tab:qM,active:KM,eventScroll:YM,tabContent:FM,noContext:ZM,overviewContent:XM,overviewDashboard:QM,overviewHero:WM,statusBadge:JM,statusPending:e3,statusAssigned:t3,statusInProgress:n3,statusReview:a3,statusDone:s3,statusFailed:i3,statusWaitingInput:o3,overviewBranchPill:l3,branchLink:r3,overviewSection:c3,overviewLabel:u3,overviewValue:d3,overviewMuted:f3,overviewMarkdown:h3,envRow:m3,envDot:p3,envDotGreen:v3,envDotYellow:g3,envDotRed:y3,envDotGray:b3,depList:x3,depItem:S3,depBlocked:_3,depDone:T3,timeline:k3,timelineRow:j3,timelineKey:w3,timelineValue:N3,timelineDelta:C3,reviewNotes:E3,overviewDescription:A3,waitingMessage:D3,errorMessage:R3,eventOverflowWarning:M3,attemptSelector:O3,attemptLabel:B3,attemptButton:L3,attemptActive:I3,attemptStatus:z3,emptyCta:U3,ctaTitle:V3,ctaDescription:H3,ctaButton:P3,ctaCreateForm:G3,ctaCreateInput:$3,ctaCreateOk:q3,ctaLink:K3,workspaceHeader:Y3,workspaceName:F3,workspaceMeta:Z3,metaRow:X3,metaLabel:Q3,metaValue:W3,archiveButton:J3,repoLink:eO,metaToggle:tO,metaToggleArrow:nO,metaToggleArrowOpen:aO,progressBarContainer:sO,progressBar:iO,progressFill:oO,progressLabel:lO,metaTimestamps:rO,metaTimestamp:cO};function uO(){return r.jsx("div",{className:L.emptyState,children:"Select a task or click + to create one"})}function dO(){return r.jsx("div",{className:L.emptyState,children:"Select an environment to manage its workspaces, or add a new one."})}function fO(){const{workspaces:n,environments:a}=ut(),i=xt(),l=a.length>0;return n.length>0?r.jsx(jM,{}):r.jsxs("div",{className:L.emptyCta,"data-testid":"welcome-cta",children:[r.jsx("div",{className:L.ctaTitle,children:"Welcome to Grackle"}),r.jsx("div",{className:L.ctaDescription,children:"Organize your work into workspaces and let agents tackle the tasks."}),r.jsx("button",{className:L.ctaButton,onClick:()=>i(cb),disabled:!l,"data-testid":"welcome-create-button",children:"Create Your First Workspace"}),!l&&r.jsx("div",{className:L.ctaDescription,children:"Add an environment first before creating a workspace."})]})}const lS=50;function hO(n,a,i,l,c=lS){return l?n<c:a-n-i<c}function mO(n,a){const i=a-n;return i>0?i:0}function pO({scrollRef:n,contentLength:a,isReversed:i}){const[l,c]=y.useState(!0),d=y.useRef(0),f=y.useRef(!1),m=y.useRef(0);y.useEffect(()=>{const v=n.current;if(!v)return;let g=!0;const b=()=>{m.current||(m.current=requestAnimationFrame(()=>{m.current=0;const x=hO(v.scrollTop,v.scrollHeight,v.clientHeight,i,lS);x!==g&&(g=x,c(x))}))};return v.addEventListener("scroll",b,{passive:!0}),()=>{v.removeEventListener("scroll",b),m.current&&(cancelAnimationFrame(m.current),m.current=0)}},[n,i]),y.useLayoutEffect(()=>{const v=n.current;!v||f.current||(f.current=!0,i?v.scrollTop=0:v.scrollTop=v.scrollHeight,c(!0))},[n,i]),y.useLayoutEffect(()=>{const v=n.current;if(v){if(i&&!l){const g=mO(d.current,v.scrollHeight);g>0&&(v.scrollTop+=g)}l&&(i?v.scrollTo({top:0,behavior:"smooth"}):v.scrollTo({top:v.scrollHeight,behavior:"smooth"})),d.current=v.scrollHeight}},[a,l,i,n]);const p=y.useCallback(()=>{const v=n.current;if(!v)return;const g=i?0:v.scrollHeight;v.scrollTo({top:g,behavior:"smooth"}),c(!0)},[n,i]);return{isAtAnchor:l,scrollToAnchor:p}}const vO="_wrapper_p24zt_1",gO="_scrollContainer_p24zt_9",yO="_toolbar_p24zt_15",bO="_directionToggle_p24zt_22",xO="_scrollToAnchor_p24zt_60",SO="_scrollToAnchorBottom_p24zt_84",_O="_scrollToAnchorTop_p24zt_88",Ds={wrapper:vO,scrollContainer:gO,toolbar:yO,directionToggle:bO,scrollToAnchor:xO,scrollToAnchorBottom:SO,scrollToAnchorTop:_O},rS="grackle-stream-direction";function TO(){try{return localStorage.getItem(rS)==="reversed"}catch{return!1}}function kO({eventsDropped:n}){return n<=0?r.jsx(r.Fragment,{}):r.jsxs("div",{className:L.eventOverflowWarning,role:"alert",children:["⚠"," ",n.toLocaleString()," older event",n===1?"":"s"," were dropped — only the most recent 5,000 are shown. Full history is available in the session log."]})}function Bh({events:n,eventsDropped:a,emptyState:i}){const l=y.useRef(null),[c,d]=y.useState(TO),f=C2(),m=y.useMemo(()=>c?[...n].reverse():n,[n,c]),{isAtAnchor:p,scrollToAnchor:v}=pO({scrollRef:l,contentLength:n.length,isReversed:c}),g=()=>{const _=!c;d(_);try{localStorage.setItem(rS,_?"reversed":"default")}catch{}},b=f?0:.2,x=c?-8:8;return r.jsxs("div",{className:Ds.wrapper,children:[r.jsx("div",{className:Ds.toolbar,children:r.jsx("button",{className:Ds.directionToggle,onClick:g,title:c?"Showing newest first":"Showing oldest first","aria-label":c?"Switch to newest at bottom":"Switch to newest at top","data-testid":"direction-toggle",children:c?"↓":"↑"})}),r.jsxs("div",{ref:l,className:Ds.scrollContainer,"data-testid":"event-stream-scroll",children:[n.length===0&&i,r.jsx(kO,{eventsDropped:a}),r.jsx(ea,{initial:!1,children:m.map((_,T)=>{const N=c?n.length-1-T:T;return r.jsx(Et.div,{initial:{opacity:0,y:x},animate:{opacity:1,y:0},transition:{duration:b,ease:"easeOut"},children:r.jsx(bR,{event:_,toolUseCtx:_.toolUseCtx})},`${_.sessionId}-${_.timestamp}-${N}`)})})]}),r.jsx(ea,{children:!p&&r.jsxs(Et.button,{className:`${Ds.scrollToAnchor} ${c?Ds.scrollToAnchorTop:Ds.scrollToAnchorBottom}`,onClick:v,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.15},"aria-label":"Scroll to latest","data-testid":"scroll-to-anchor",children:[c?"↑":"↓"," New events"]})})]})}const jO="_bar_1xhb4_1",wO="_input_1xhb4_32",NO="_select_1xhb4_67",CO="_btnPrimary_1xhb4_103",EO="_btnDanger_1xhb4_134",AO="_btnGhost_1xhb4_173",DO="_badge_1xhb4_195",RO="_disconnectHint_1xhb4_205",on={bar:jO,input:wO,select:NO,btnPrimary:CO,btnDanger:EO,btnGhost:AO,badge:DO,disconnectHint:RO};function MO(n,a){if(!n)return!1;const i=a.find(l=>l.id===n);return i!==void 0&&(i.status==="disconnected"||i.status==="error")}function OO({environmentId:n,onReconnect:a}){return r.jsxs(r.Fragment,{children:[r.jsx("span",{className:on.disconnectHint,"data-testid":"env-disconnect-hint",children:"Environment unavailable"}),r.jsx("button",{type:"button",onClick:()=>a(n),className:on.btnGhost,"data-testid":"reconnect-btn",title:"Reconnect the environment to resume messaging",children:"Reconnect"})]})}function hl({mode:n,sessionId:a,environmentId:i,taskId:l,showStop:c,showPersonaSelect:d,onSessionKill:f,personas:m,environments:p,onSendInput:v,onSpawn:g,onStartTask:b,onProvisionEnvironment:x}){const{showToast:_}=Na(),[T,N]=y.useState(""),[w,k]=y.useState(""),C=MO(i,p),A=D=>{if(D.preventDefault(),!!T.trim())if(n==="send"){if(!a||C)return;v(a,T),N("")}else if(n==="spawn"){if(!i)return;g(i,T,w),_("Session started","success"),N(""),k("")}else{if(!l)return;b(l,void 0,i,T),N("")}};return n==="spawn"?r.jsxs("form",{onSubmit:A,className:on.bar,children:[r.jsx("span",{className:on.badge,children:"new chat"}),r.jsx("input",{type:"text",value:T,onChange:D=>N(D.target.value),placeholder:"Enter prompt...",autoFocus:!0,className:on.input}),d&&r.jsxs("select",{value:w,onChange:D=>k(D.target.value),className:on.select,children:[r.jsx("option",{value:"",children:"(Default)"}),m.map(D=>r.jsx("option",{value:D.id,children:D.name},D.id))]}),r.jsx("button",{type:"submit",disabled:!T.trim()||!i,className:on.btnPrimary,children:"Go"})]}):n==="start"?r.jsxs("form",{onSubmit:A,className:on.bar,children:[r.jsx("input",{type:"text",value:T,onChange:D=>N(D.target.value),placeholder:"Type a message...",autoFocus:!0,className:on.input}),r.jsx("button",{type:"submit",disabled:!T.trim(),className:on.btnPrimary,children:"Send"})]}):r.jsxs("form",{onSubmit:A,className:on.bar,children:[C&&i&&r.jsx(OO,{environmentId:i,onReconnect:x}),r.jsx("input",{type:"text",value:T,onChange:D=>N(D.target.value),placeholder:"Type a message...",autoFocus:!C,disabled:C,className:on.input}),r.jsx("span",{title:C?"Environment is unavailable — reconnect first":void 0,children:r.jsx("button",{type:"submit",disabled:!T.trim()||C,className:on.btnPrimary,children:"Send"})}),c&&f&&r.jsx("button",{type:"button",onClick:f,className:on.btnDanger,title:"Stop session",children:"Stop"})]})}function Lh(n){const a=[];for(const i of n){const l=a[a.length-1];i.eventType==="text"&&(l==null?void 0:l.eventType)==="text"?a[a.length-1]={...l,content:l.content+i.content}:a.push(i)}return a}function Ih(n){const a=new Map;for(const d of n)if(d.raw)try{a.set(d,JSON.parse(d.raw))}catch{}const i=new Map;for(const d of n){if(d.eventType!=="tool_use")continue;const f=a.get(d);if(!(!f||typeof f.id!="string"))try{const m=JSON.parse(d.content);i.set(f.id,{tool:m.tool,args:m.args})}catch{}}const l=new Set;return n.map(d=>{if(d.eventType!=="tool_result")return d;const f=a.get(d);if(!f||typeof f.tool_use_id!="string")return d;const m=i.get(f.tool_use_id);return m?(l.add(f.tool_use_id),{...d,toolUseCtx:m}):d}).filter(d=>{if(d.eventType!=="tool_use")return!0;const f=a.get(d);return f&&typeof f.id=="string"?!l.has(f.id):!0})}const BO="_panelContainer_pz4cr_1",LO="_emptyState_pz4cr_8",IO="_emptyTitle_pz4cr_20",zO="_emptyDescription_pz4cr_26",UO="_emptyHint_pz4cr_32",Wo={panelContainer:BO,emptyState:LO,emptyTitle:IO,emptyDescription:zO,emptyHint:UO};function VO({hasLocalEnvironment:n}){return r.jsxs("div",{className:Wo.emptyState,"data-testid":"chat-empty-state",children:[r.jsx("div",{className:Wo.emptyTitle,children:"Welcome to Grackle"}),r.jsx("div",{className:Wo.emptyDescription,children:n?"Type a message below to start chatting with the System agent. It can help you plan work, create tasks, and coordinate agents.":"Add a local environment in Settings to start chatting."}),!n&&r.jsx("div",{className:Wo.emptyHint,children:"Go to Settings → Environments to add one."})]})}function HO(){const{tasks:n,sessions:a,events:i,eventsDropped:l,environments:c,loadTaskSessions:d,loadSessionEvents:f,kill:m,taskSessions:p,sendInput:v,spawn:g,startTask:b,personas:x,provisionEnvironment:_}=ut(),T=y.useRef(void 0),[N,w]=y.useState(),k=n.find(U=>U.id===Po),C=k!=null&&k.latestSessionId?a.find(U=>U.id===k.latestSessionId)??(p[Po]??[]).find(U=>U.id===k.latestSessionId):void 0;y.useEffect(()=>{d(Po)},[d]),y.useEffect(()=>{k!=null&&k.latestSessionId&&d(Po)},[k==null?void 0:k.latestSessionId,d]),y.useEffect(()=>{C&&C.id!==T.current&&(T.current=C.id,f(C.id))},[C==null?void 0:C.id,f]);const A=y.useMemo(()=>{if(!C)return[];const U=i.filter(Y=>Y.sessionId===C.id);return Ih(Lh(U))},[i,C==null?void 0:C.id]),D=c.find(U=>U.adapterType==="local"&&U.status==="connected"),E=C!==void 0&&C.status!=="stopped"&&C.status!=="suspended",I=(C==null?void 0:C.status)==="idle";y.useEffect(()=>{N&&C&&I&&(v(C.id,N),w(void 0))},[N,I,C==null?void 0:C.id,v]);const z=y.useCallback((U,Y,ae,se)=>{se&&w(se),b(U,Y,ae)},[b]);return r.jsxs("div",{className:Wo.panelContainer,"data-testid":"chat-page",children:[r.jsx(Bh,{events:A,eventsDropped:l,emptyState:r.jsx(VO,{hasLocalEnvironment:!!D})}),D&&E&&r.jsx(hl,{mode:"send",sessionId:C.id,environmentId:C.environmentId,showStop:!0,onSessionKill:()=>m(C.id),personas:x,environments:c,onSendInput:v,onSpawn:g,onStartTask:b,onProvisionEnvironment:_}),D&&!E&&r.jsx(hl,{mode:"start",taskId:Po,environmentId:D.id,personas:x,environments:c,onSendInput:v,onSpawn:g,onStartTask:z,onProvisionEnvironment:_})]})}function PO(n,a){const i=[];let l=n;const c=new Set;for(;l&&a.has(l)&&!c.has(l);){c.add(l);const d=a.get(l);i.unshift(d),l=d.parentTaskId||void 0}return i}const Vs={label:"Home",url:zs};function GO(n){return n?[Vs,{label:"Settings",url:zi},{label:n,url:void 0}]:[Vs,{label:"Settings",url:void 0}]}const cS={label:"Environments",url:Vi};function $O(){return[Vs,{label:"Environments",url:void 0}]}function qO(){return[Vs,{label:"New Chat",url:void 0}]}function KO(n){return[Vs,{label:`Session ${n.slice(0,8)}`,url:void 0}]}function YO(n,a,i,l){const c=i.find(f=>f.id===n),d=l.find(f=>f.id===a);return[Vs,cS,{label:(d==null?void 0:d.displayName)??"Environment",url:Hi(a)},{label:(c==null?void 0:c.name)??"Workspace",url:void 0}]}function FO(n,a,i,l,c){const d=PO(n,c),f=c.get(n),m=f==null?void 0:f.workspaceId,p=m?i.find(_=>_.id===m):void 0,v=a??(p==null?void 0:p.environmentId),g=v?l.find(_=>_.id===v):void 0,b=[Vs];g&&v&&(b.push(cS),b.push({label:g.displayName,url:Hi(v)})),p&&v&&b.push({label:p.name,url:Ui(p.id,v)});for(let _=0;_<d.length-1;_++)b.push({label:d[_].title,url:Jn(d[_].id,void 0,m,v)});const x=d[d.length-1];return b.push({label:(x==null?void 0:x.title)??n,url:void 0}),b}function ZO(){const n=qO(),[a]=Qf(),i=a.get("env")??"",{sendInput:l,spawn:c,startTask:d,personas:f,environments:m,provisionEnvironment:p}=ut();return r.jsxs("div",{className:L.panelContainer,children:[r.jsx(us,{segments:n}),r.jsx("div",{className:L.emptyState,children:"Enter a prompt below to start a new session"}),r.jsx(hl,{mode:"spawn",environmentId:i,showPersonaSelect:!0,personas:f,environments:m,onSendInput:l,onSpawn:c,onStartTask:d,onProvisionEnvironment:p})]})}function XO({sessionId:n,session:a,isActive:i,onKill:l}){return r.jsxs("div",{className:L.header,children:[r.jsxs("span",{children:["Session: ",n.slice(0,8),a&&` | ${a.runtime} | ${a.endReason||a.status}`,a!=null&&a.inputTokens||a!=null&&a.outputTokens||a!=null&&a.costUsd?` | ${aS((a.inputTokens??0)+(a.outputTokens??0))} tokens · ${qi(a.costUsd??0)}`:""]}),r.jsxs("span",{className:L.headerInfo,children:[a&&r.jsx("span",{children:a.prompt.length>60?a.prompt.slice(0,60)+"...":a.prompt}),i&&r.jsx("button",{onClick:()=>l(n),title:"Stop session",className:L.killButton,children:"×"})]})]})}function QO({session:n}){const a=n&&(n.status==="stopped"||n.status==="suspended"),i=a?`Session ${n.endReason||n.status} with no events recorded.`:"Waiting for events...";return r.jsx("div",{className:a?L.errorMessage:L.waitingMessage,children:i})}function WO(){const{sessionId:n}=rs(),{events:a,eventsDropped:i,sessions:l,kill:c,loadSessionEvents:d,sendInput:f,spawn:m,startTask:p,personas:v,environments:g,provisionEnvironment:b}=ut(),x=y.useRef(void 0),_=KO(n),T=l.find(k=>k.id===n)??void 0,N=y.useMemo(()=>{const k=n?a.filter(C=>C.sessionId===n):[];return Ih(Lh(k))},[a,n]);if(y.useEffect(()=>{n&&n!==x.current&&(x.current=n,d(n))},[n,d]),!n)return r.jsx("div",{className:L.emptyState,children:"No session selected"});const w=(T==null?void 0:T.status)==="running"||(T==null?void 0:T.status)==="idle";return r.jsxs("div",{className:L.panelContainer,children:[r.jsx(us,{segments:_}),r.jsx(XO,{sessionId:n,session:T,isActive:w,onKill:c}),r.jsx(Bh,{events:N,eventsDropped:i,emptyState:r.jsx(QO,{session:T})}),w&&r.jsx(hl,{mode:"send",sessionId:n,environmentId:T.environmentId,showStop:!0,onSessionKill:()=>c(n),personas:v,environments:g,onSendInput:f,onSpawn:m,onStartTask:p,onProvisionEnvironment:b})]})}function JO(n){if(!n)return!1;const a=n.tagName;return!!(a==="INPUT"||a==="TEXTAREA"||a==="SELECT"||n.isContentEditable)}function ka(n,a){const i=y.useRef(a);i.current=a;const{key:l,ctrl:c=!1,shift:d=!1,suppressInInputs:f=!0,enabled:m=!0}=n;y.useEffect(()=>{if(!m)return;const p=v=>{if(f&&JO(document.activeElement??void 0))return;const g=v.ctrlKey||v.metaKey;c===g&&(d&&!v.shiftKey||v.key===l&&i.current())};return document.addEventListener("keydown",p),()=>{document.removeEventListener("keydown",p)}},[l,c,d,f,m])}const C0=220,E0=70,e6=40,t6=60,n6="hierarchy",a6="dependency";function s6(n){return y.useMemo(()=>{if(n.length===0)return{nodes:[],edges:[]};const a=new Bg.graphlib.Graph({multigraph:!0});a.setDefaultEdgeLabel(()=>({})),a.setGraph({rankdir:"TB",nodesep:e6,ranksep:t6});const i=new Map(n.map(f=>[f.id,f])),l=new Map;for(const f of n)if(f.parentTaskId&&i.has(f.parentTaskId)){const m=l.get(f.parentTaskId)||[];m.push(f),l.set(f.parentTaskId,m)}for(const f of n)a.setNode(f.id,{width:C0,height:E0});const c=[];for(const f of n){if(f.parentTaskId&&i.has(f.parentTaskId)){const m=`hierarchy-${f.parentTaskId}-${f.id}`;a.setEdge(f.parentTaskId,f.id,{},m),c.push({id:m,source:f.parentTaskId,target:f.id,type:"smoothstep",data:{edgeType:n6},style:{stroke:"var(--accent-green)",strokeWidth:2},animated:!1})}for(const m of f.dependsOn)if(i.has(m)){const p=`dependency-${m}-${f.id}`;a.setEdge(m,f.id,{},p),c.push({id:p,source:m,target:f.id,type:"smoothstep",data:{edgeType:a6},style:{stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeDasharray:"6 3"},animated:!1})}}return Bg.layout(a),{nodes:n.map(f=>{const m=a.node(f.id),p=l.get(f.id)||[];return{id:f.id,type:"task",position:{x:m.x-C0/2,y:m.y-E0/2},data:{task:f,childCount:p.length,doneChildCount:p.filter(v=>v.status==="complete").length,hasDependencies:f.dependsOn.length>0}}}),edges:c}},[n])}const i6="_dagContainer_js4w6_1",o6="_taskNode_js4w6_26",l6="_taskNodeBorder_js4w6_54",r6="_taskNodeContent_js4w6_60",c6="_taskNodeHeader_js4w6_70",u6="_taskNodeIcon_js4w6_77",d6="_taskNodeTitle_js4w6_82",f6="_taskNodeBadges_js4w6_90",h6="_childBadge_js4w6_95",m6="_depBadge_js4w6_107",p6="_handle_js4w6_119",v6="_emptyCta_js4w6_126",g6="_ctaDescription_js4w6_137",y6="_ctaButton_js4w6_144",Qt={dagContainer:i6,taskNode:o6,taskNodeBorder:l6,taskNodeContent:r6,taskNodeHeader:c6,taskNodeIcon:u6,taskNodeTitle:d6,taskNodeBadges:f6,childBadge:h6,depBadge:m6,handle:p6,emptyCta:v6,ctaDescription:g6,ctaButton:y6};function b6({data:n}){const{task:a,childCount:i,doneChildCount:l,hasDependencies:c}=n,d=ls(a.status);return r.jsxs("div",{className:Qt.taskNode,"data-task-id":a.id,"data-task-title":a.title,children:[r.jsx(Lg,{type:"target",position:Ig.Top,className:Qt.handle}),r.jsx("div",{className:Qt.taskNodeBorder,style:{backgroundColor:d.color}}),r.jsxs("div",{className:Qt.taskNodeContent,children:[r.jsxs("div",{className:Qt.taskNodeHeader,children:[r.jsx("span",{className:Qt.taskNodeIcon,style:{color:d.color},children:d.icon}),r.jsx("span",{className:Qt.taskNodeTitle,children:a.title})]}),r.jsxs("div",{className:Qt.taskNodeBadges,children:[i>0&&r.jsxs("span",{className:Qt.childBadge,children:[l,"/",i]}),c&&r.jsx("span",{className:Qt.depBadge,children:"dep"})]})]}),r.jsx(Lg,{type:"source",position:Ig.Bottom,className:Qt.handle})]})}const x6=M2,S6={task:b6};function _6({workspaceId:n,environmentId:a,tasks:i}){const l=xt(),{resolvedThemeId:c}=gb(),d=y.useMemo(()=>i.filter(b=>b.workspaceId===n),[i,n]),{nodes:f,edges:m}=s6(d),p=y.useMemo(()=>{const b=getComputedStyle(document.documentElement),x={};for(const[_,T]of Object.entries(x6))x[_]=b.getPropertyValue(T).trim()||"#6b7a8d";return x},[c]),v=y.useCallback((b,x)=>{l(Jn(x.id,void 0,n,a))},[l,n,a]),g=y.useCallback(b=>{const x=b.data;return p[x.task.status]||p.pending},[p]);return d.length===0?r.jsxs("div",{className:Qt.emptyCta,children:[r.jsx("button",{className:Qt.ctaButton,onClick:()=>l(Gs(n,void 0,a)),children:"Create Task"}),r.jsx("div",{className:Qt.ctaDescription,children:"Create tasks to see the dependency graph"})]}):r.jsx("div",{className:Qt.dagContainer,children:r.jsxs(D1,{nodes:f,edges:m,nodeTypes:S6,onNodeClick:v,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,children:[r.jsx(R1,{variant:M1.Dots,gap:24,size:1,color:"var(--text-disabled)"}),r.jsx(O1,{showInteractive:!1}),r.jsx(B1,{nodeColor:g,maskColor:"var(--bg-overlay)",style:{background:"var(--bg-inset)"}})]})})}function T6({tasks:n,taskStatusById:a,sessionStatusByTaskId:i}){const l=new Map;for(const d of n)if(d.parentTaskId){const f=l.get(d.parentTaskId);f?f.push(d):l.set(d.parentTaskId,[d])}const c=new Map(S0.map(d=>[d,[]]));for(const d of n){const f=Oh(d.status),m=d.dependsOn.length>0&&d.dependsOn.some(T=>a.get(T)!=="complete"),p=l.get(d.id)??[],v=p.length,g=p.filter(T=>T.status==="complete").length;let b;if(f==="paused"&&i){const T=i.get(d.id);T==="idle"?b="Needs input":T==="completed"&&(b="Ready to complete")}const x={task:d,isBlocked:m,childCount:v,doneChildCount:g,pausedSubBadge:b},_=c.get(f);_?_.push(x):c.get("not_started").push(x)}for(const d of c.values())d.sort((f,m)=>f.task.sortOrder-m.task.sortOrder);return S0.map(d=>{const f=ls(d);return{status:d,label:f.label,style:f,tasks:c.get(d)??[]}})}const k6="_boardContainer_1c4y1_1",j6="_column_1c4y1_17",w6="_columnHeader_1c4y1_34",N6="_columnIcon_1c4y1_47",C6="_columnLabel_1c4y1_52",E6="_columnCount_1c4y1_57",A6="_cardList_1c4y1_67",D6="_emptyPlaceholder_1c4y1_76",R6="_card_1c4y1_67",M6="_cardHeader_1c4y1_107",O6="_cardStatusIcon_1c4y1_113",B6="_cardTitle_1c4y1_119",L6="_cardBadges_1c4y1_127",I6="_badge_1c4y1_134",z6="_blockedBadge_1c4y1_146",U6="_childBadge_1c4y1_151",V6="_depBadge_1c4y1_155",H6="_parentBadge_1c4y1_159",P6="_pausedSubBadge_1c4y1_166",G6="_personaBadge_1c4y1_170",$6="_envBadge_1c4y1_174",q6="_emptyCta_1c4y1_178",K6="_ctaButton_1c4y1_188",Y6="_ctaDescription_1c4y1_204",Ze={boardContainer:k6,column:j6,columnHeader:w6,columnIcon:N6,columnLabel:C6,columnCount:E6,cardList:A6,emptyPlaceholder:D6,card:R6,cardHeader:M6,cardStatusIcon:O6,cardTitle:B6,cardBadges:L6,badge:I6,blockedBadge:z6,childBadge:U6,depBadge:V6,parentBadge:H6,pausedSubBadge:P6,personaBadge:G6,envBadge:$6,emptyCta:q6,ctaButton:K6,ctaDescription:Y6};function F6({workspaceId:n,environmentId:a,tasks:i,sessions:l,personas:c,environments:d}){const f=xt(),m=y.useMemo(()=>i.filter(x=>x.workspaceId===n),[i,n]),p=y.useMemo(()=>new Map(i.map(x=>[x.id,x.status])),[i]),v=y.useMemo(()=>new Map(m.map(x=>[x.id,x])),[m]),g=y.useMemo(()=>{const x=new Map(l.map(C=>[C.id,C])),_=new Map(c.map(C=>[C.id,C])),T=new Map(d.map(C=>[C.id,C])),N=new Map,w=new Map,k=new Map;for(const C of m)if(C.latestSessionId){const A=x.get(C.latestSessionId);if(A){if(N.set(C.id,A.endReason||A.status),A.personaId){const D=_.get(A.personaId);D&&w.set(C.id,D.name)}if(A.environmentId){const D=T.get(A.environmentId);D&&k.set(C.id,D.displayName)}}}return{sessionStatusByTaskId:N,personaNameByTaskId:w,environmentNameByTaskId:k}},[m,l,c,d]),b=y.useMemo(()=>T6({tasks:m,taskStatusById:p,sessionStatusByTaskId:g.sessionStatusByTaskId}),[m,p,g]);return m.length===0?r.jsxs("div",{className:Ze.emptyCta,"data-testid":"board-empty-cta",children:[r.jsx("button",{className:Ze.ctaButton,onClick:()=>f(Gs(n,void 0,a)),children:"Create Task"}),r.jsx("div",{className:Ze.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}):r.jsx("div",{className:Ze.boardContainer,"data-testid":"board-container",children:b.map(x=>r.jsxs("section",{className:Ze.column,"data-testid":`board-column-${x.status}`,"aria-label":`${x.label}, ${x.tasks.length} ${x.tasks.length===1?"task":"tasks"}`,children:[r.jsxs("div",{className:Ze.columnHeader,children:[r.jsx("span",{className:Ze.columnIcon,style:{color:x.style.color},children:x.style.icon}),r.jsx("span",{className:Ze.columnLabel,children:x.label}),r.jsx("span",{className:Ze.columnCount,"data-testid":`board-count-${x.status}`,children:x.tasks.length})]}),r.jsx("div",{className:Ze.cardList,children:x.tasks.length===0?r.jsx("div",{className:Ze.emptyPlaceholder,children:"No tasks"}):r.jsx(ea,{mode:"popLayout",children:x.tasks.map(_=>r.jsx(Et.div,{layout:!0,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},children:r.jsx(Z6,{boardTask:_,tasksById:v,personaName:g.personaNameByTaskId.get(_.task.id),envName:g.environmentNameByTaskId.get(_.task.id),onClick:()=>f(Jn(_.task.id,void 0,n,a))})},_.task.id))})})]},x.status))})}function Z6({boardTask:n,tasksById:a,personaName:i,envName:l,onClick:c}){const{task:d,isBlocked:f,childCount:m,doneChildCount:p,pausedSubBadge:v}=n,g=ls(d.status),b=d.parentTaskId?a.get(d.parentTaskId):void 0;return r.jsxs("div",{className:Ze.card,tabIndex:0,role:"button","data-testid":`board-card-${d.id}`,onClick:c,onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),c())},children:[r.jsxs("div",{className:Ze.cardHeader,children:[r.jsx("span",{className:Ze.cardStatusIcon,style:{color:g.color},children:g.icon}),r.jsx("span",{className:Ze.cardTitle,children:d.title})]}),r.jsxs("div",{className:Ze.cardBadges,children:[b&&r.jsx("span",{className:`${Ze.badge} ${Ze.parentBadge}`,title:b.title,children:b.title}),m>0&&r.jsxs("span",{className:`${Ze.badge} ${Ze.childBadge}`,children:[p,"/",m]}),f&&r.jsx("span",{className:`${Ze.badge} ${Ze.blockedBadge}`,children:"blocked"}),d.dependsOn.length>0&&!f&&r.jsx("span",{className:`${Ze.badge} ${Ze.depBadge}`,children:"dep"}),v&&r.jsx("span",{className:`${Ze.badge} ${Ze.pausedSubBadge}`,children:v}),i&&r.jsx("span",{className:`${Ze.badge} ${Ze.personaBadge}`,children:i}),l&&r.jsx("span",{className:`${Ze.badge} ${Ze.envBadge}`,children:l})]})]})}function zh(n){const{value:a,onSave:i,validate:l,fieldId:c,activeFieldId:d,onActivate:f,enterToSave:m=!0,trimOnSave:p=!0}=n,[v,g]=y.useState(""),[b,x]=y.useState(""),_=y.useRef(!1),T=d===c,N=y.useCallback(z=>{g(z),x("")},[]),w=y.useCallback(()=>{x("")},[]),k=y.useCallback(()=>{_.current=!1,f==null||f(null),g(""),x("")},[f]),C=y.useCallback(()=>{const z=p?v.trim():v;if(l){const Y=l(v);if(Y){x(Y);return}}const U=p?a.trim():a;if(z===U){k();return}i(z),k()},[v,a,p,l,i,k]),A=y.useCallback(()=>{_.current=!0,f==null||f(c),g(a),x("")},[c,a,f]),D=y.useCallback(z=>{if(_.current){_.current=!1;return}z.relatedTarget instanceof HTMLElement&&z.relatedTarget.dataset.editAction===c||C()},[c,C]),E=y.useCallback(z=>{z.key==="Escape"?k():z.key==="Enter"&&m&&C()},[k,m,C]),I=(()=>{if(!T)return!1;const z=p?a.trim():a;return(p?v.trim():v)!==z})();return y.useEffect(()=>{!T&&(v!==""||b!=="")&&(g(""),x(""))},[T,v,b]),{isEditing:T,draft:v,error:b,isDirty:I,startEdit:A,cancelEdit:k,save:C,setDraft:N,clearError:w,handleBlur:D,handleKeyDown:E,ignoreInitialBlurRef:_}}const X6="_editFieldWrapper_yuzty_1",Q6="_editInput_yuzty_10",W6="_editTextarea_yuzty_42",J6="_editSelect_yuzty_78",e4="_editError_yuzty_111",t4="_editInputInvalid_yuzty_118",n4="_editHint_yuzty_123",a4="_unsavedDot_yuzty_132",s4="_metaValueClickable_yuzty_140",i4="_editButton_yuzty_159",o4="_metaPlaceholder_yuzty_175",l4="_worktreeToggle_yuzty_180",qe={editFieldWrapper:X6,editInput:Q6,editTextarea:W6,editSelect:J6,editError:e4,editInputInvalid:t4,editHint:n4,unsavedDot:a4,metaValueClickable:s4,editButton:i4,metaPlaceholder:o4,worktreeToggle:l4};function qt(n){const{value:a,onSave:i,validate:l,mode:c="edit",fieldId:d="text",activeFieldId:f,onActivate:m,onChange:p,renderDisplay:v,placeholder:g,maxLength:b,ariaLabel:x,"data-testid":_}=n,T=y.useRef(null),N=zh({value:a,onSave:i,validate:l,fieldId:d,activeFieldId:f,onActivate:m,enterToSave:!0,trimOnSave:!0});if(y.useEffect(()=>{if(N.isEditing){const k=window.setTimeout(()=>{var C;(C=T.current)==null||C.focus()},0);return()=>window.clearTimeout(k)}},[N.isEditing]),c==="create"){const k=A=>{p==null||p(A.target.value)},C=l==null?void 0:l(a);return r.jsxs("div",{className:qe.editFieldWrapper,children:[r.jsx("input",{className:`${qe.editInput} ${C?qe.editInputInvalid:""}`,value:a,onChange:k,maxLength:b,placeholder:g,"aria-label":x,"data-testid":_?`${_}-input`:void 0}),C&&r.jsx("span",{className:qe.editError,"data-testid":"edit-error",children:C})]})}if(N.isEditing)return r.jsxs("div",{className:qe.editFieldWrapper,children:[r.jsx("input",{ref:T,className:`${qe.editInput} ${N.error?qe.editInputInvalid:""}`,value:N.draft,onChange:k=>N.setDraft(k.target.value),onBlur:N.handleBlur,onKeyDown:N.handleKeyDown,maxLength:b,placeholder:g,"aria-label":x,"data-testid":_?`${_}-input`:void 0}),N.isDirty&&r.jsx("span",{className:qe.unsavedDot,title:"Unsaved changes"}),N.error&&r.jsx("span",{className:qe.editError,"data-testid":"edit-error",children:N.error}),r.jsx("span",{className:qe.editHint,children:"Enter to save · Esc to cancel"})]});const w=v==null?void 0:v(a);return r.jsxs("span",{role:"button",tabIndex:0,className:qe.metaValueClickable,onClick:()=>N.startEdit(),onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),N.startEdit())},title:"Click to edit","aria-label":x,"data-testid":_?`${_}-button`:void 0,children:[w!==void 0?w:a?r.jsx("span",{children:a}):r.jsx("span",{className:qe.metaPlaceholder,children:g||"None"}),r.jsx("span",{className:qe.editButton,"aria-hidden":"true",children:"✏️"})]})}function Vf(n){const{value:a,onSave:i,validate:l,mode:c="edit",fieldId:d="textarea",activeFieldId:f,onActivate:m,onChange:p,renderDisplay:v,placeholder:g,ariaLabel:b,"data-testid":x}=n,_=y.useRef(null),T=zh({value:a,onSave:i,validate:l,fieldId:d,activeFieldId:f,onActivate:m,enterToSave:!1,trimOnSave:!1});if(y.useEffect(()=>{if(T.isEditing){const w=window.setTimeout(()=>{var k;(k=_.current)==null||k.focus()},0);return()=>window.clearTimeout(w)}},[T.isEditing]),c==="create"){const w=C=>{p==null||p(C.target.value)},k=l==null?void 0:l(a);return r.jsxs("div",{className:qe.editFieldWrapper,children:[r.jsx("textarea",{className:`${qe.editTextarea} ${k?qe.editInputInvalid:""}`,value:a,onChange:w,placeholder:g,"aria-label":b,"data-testid":x?`${x}-input`:void 0}),k&&r.jsx("span",{className:qe.editError,"data-testid":"edit-error",children:k})]})}if(T.isEditing)return r.jsxs("div",{className:qe.editFieldWrapper,children:[r.jsx("textarea",{ref:_,className:`${qe.editTextarea} ${T.error?qe.editInputInvalid:""}`,value:T.draft,onChange:w=>T.setDraft(w.target.value),onBlur:T.handleBlur,onKeyDown:T.handleKeyDown,title:b,"aria-label":b,"data-testid":x?`${x}-input`:void 0}),T.isDirty&&r.jsx("span",{className:qe.unsavedDot,title:"Unsaved changes"}),T.error&&r.jsx("span",{className:qe.editError,"data-testid":"edit-error",children:T.error}),r.jsx("span",{className:qe.editHint,children:"Tab to save · Esc to cancel"})]});const N=v==null?void 0:v(a);return r.jsxs("span",{role:"button",tabIndex:0,className:qe.metaValueClickable,onClick:()=>T.startEdit(),onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),T.startEdit())},title:"Click to edit","aria-label":b,"data-testid":x?`${x}-button`:void 0,children:[N!==void 0?N:a?r.jsx("span",{children:a}):r.jsx("span",{className:qe.metaPlaceholder,children:g||"None"}),r.jsx("span",{className:qe.editButton,"aria-hidden":"true",children:"✏️"})]})}function fc(n){var A;const{value:a,onSave:i,mode:l="edit",options:c,fieldId:d="select",activeFieldId:f,onActivate:m,onChange:p,renderDisplay:v,placeholder:g,ariaLabel:b,"data-testid":x}=n,_=y.useRef(null),T=zh({value:a,onSave:i,fieldId:d,activeFieldId:f,onActivate:m,enterToSave:!1,trimOnSave:!1});y.useEffect(()=>{if(T.isEditing){const D=window.setTimeout(()=>{var E;(E=_.current)==null||E.focus()},0);return()=>window.clearTimeout(D)}},[T.isEditing]);const N=y.useCallback(D=>{const E=D.target.value;T.ignoreInitialBlurRef.current=!1,E!==a&&i(E),T.cancelEdit()},[a,i,T]),w=y.useCallback(D=>{if(T.ignoreInitialBlurRef.current){T.ignoreInitialBlurRef.current=!1;return}D.relatedTarget instanceof HTMLElement&&D.relatedTarget.dataset.editAction===d||T.cancelEdit()},[d,T]);if(l==="create")return r.jsx("select",{className:qe.editSelect,value:a,onChange:D=>p==null?void 0:p(D.target.value),"aria-label":b,"data-testid":x?`${x}-select`:void 0,children:c.map(D=>r.jsx("option",{value:D.value,children:D.label},D.value))});if(T.isEditing)return r.jsx("select",{ref:_,className:qe.editSelect,value:T.draft,onChange:N,onBlur:w,title:b,"aria-label":b,"data-testid":x?`${x}-select`:void 0,children:c.map(D=>r.jsx("option",{value:D.value,children:D.label},D.value))});const k=v==null?void 0:v(a),C=(A=c.find(D=>D.value===a))==null?void 0:A.label;return r.jsxs("button",{type:"button",className:qe.metaValueClickable,onClick:()=>T.startEdit(),title:"Click to change","aria-label":b,"data-testid":x?`${x}-button`:void 0,children:[k!==void 0?k:C?r.jsx("span",{children:C}):r.jsx("span",{className:qe.metaPlaceholder,children:g||"None"}),r.jsx("span",{className:qe.editButton,"aria-hidden":"true",children:"✏️"})]})}function r4(n){const{checked:a,onChange:i,label:l,ariaLabel:c,"data-testid":d}=n;return r.jsxs("label",{className:qe.worktreeToggle,"data-testid":d,children:[r.jsx("input",{type:"checkbox",checked:a,onChange:f=>i(f.target.checked),"aria-label":c}),r.jsx("span",{children:l})]})}const c4="_envRow_1e1r5_1",u4="_envDot_1e1r5_7",d4="_envDotGreen_1e1r5_14",f4="_envDotYellow_1e1r5_18",h4="_envDotRed_1e1r5_22",m4="_envDotGray_1e1r5_26",Ii={envRow:c4,envDot:u4,envDotGreen:d4,envDotYellow:f4,envDotRed:h4,envDotGray:m4};function p4(n){const a=n.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?Ii.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?Ii.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?Ii.envDotRed:Ii.envDotGray}function v4(n){const{value:a,onSave:i,environments:l,allowNone:c=!1,fieldId:d="environment",activeFieldId:f,onActivate:m,placeholder:p="No environment",ariaLabel:v="Environment","data-testid":g}=n,b=l.find(T=>T.id===a),x=[...c?[{value:"",label:"None"}]:[],...l.map(T=>({value:T.id,label:T.displayName}))],_=()=>{if(b)return r.jsxs("span",{className:Ii.envRow,children:[r.jsx("span",{className:`${Ii.envDot} ${p4(b.status)}`}),b.displayName]})};return r.jsx(fc,{value:a,onSave:i,options:x,fieldId:d,activeFieldId:f,onActivate:m,renderDisplay:_,placeholder:p,ariaLabel:v,"data-testid":g})}function A0(n){if(!n)return"";const a=new Date(n);if(isNaN(a.getTime()))return"";const l=Date.now()-a.getTime();if(l<0)return"just now";const c=Math.floor(l/6e4);if(c<1)return"just now";if(c<60)return`${c}m ago`;const d=Math.floor(c/60);if(d<24)return`${d}h ago`;const f=Math.floor(d/24);return f<30?`${f}d ago`:a.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}const uf=100;function g4(n){try{const a=new URL(n);return a.protocol!=="http:"&&a.protocol!=="https:"?void 0:a.toString()}catch{return}}function y4(){const{workspaceId:n,environmentId:a}=rs(),i=xt(),{tasks:l,environments:c,workspaces:d,personas:f,sessions:m,archiveWorkspace:p,updateWorkspace:v,usageCache:g,loadUsage:b}=ut(),[x,_]=y.useState("tasks"),[T,N]=y.useState(!1),[w,k]=y.useState(null),[C,A]=y.useState(!1),D=y.useRef(void 0),E=d.find(q=>q.id===n),I=a??(E==null?void 0:E.environmentId)??"",z=YO(n,I,d,c);ka({key:"1"},()=>_("graph")),ka({key:"2"},()=>_("board")),ka({key:"3"},()=>_("tasks")),y.useEffect(()=>{const q=D.current;D.current=n,!(q===void 0||q===n)&&w!==null&&k(null)},[n,w]);const U=m.reduce((q,te)=>q+(te.costUsd??0),0);y.useEffect(()=>{n&&b("workspace",n)},[n,b,U]);const Y=n?g[`workspace:${n}`]:void 0,ae=l.filter(q=>q.workspaceId===n),se=ae.filter(q=>q.status==="complete").length,ie=ae.length,le=ie>0?Math.round(se/ie*100):0;return r.jsxs("div",{className:L.panelContainer,children:[r.jsx(us,{segments:z}),r.jsxs("div",{className:L.workspaceHeader,children:[r.jsx("span",{className:L.workspaceName,"data-testid":"workspace-name",children:r.jsx(qt,{value:(E==null?void 0:E.name)||"",onSave:q=>{E&&v(E.id,{name:q})},validate:q=>{const te=q.trim();if(!te)return"Name is required";if(te.length>uf)return`Max ${uf} characters`},maxLength:uf,fieldId:"name",activeFieldId:w,onActivate:k,ariaLabel:"Workspace name",renderDisplay:q=>q||n||void 0,"data-testid":"edit-name"})}),r.jsx("button",{className:L.archiveButton,onClick:()=>N(!0),title:"Archive workspace","data-testid":"archive-workspace-button",children:"Archive"})]}),r.jsxs("button",{className:L.metaToggle,onClick:()=>A(!C),"aria-expanded":!C,"aria-controls":"workspace-meta-panel","data-testid":"meta-toggle",children:[r.jsx("span",{className:`${L.metaToggleArrow} ${C?"":L.metaToggleArrowOpen}`,children:"▶"}),"Details"]}),!C&&r.jsxs("div",{className:L.workspaceMeta,"data-testid":"workspace-meta",id:"workspace-meta-panel",children:[r.jsxs("div",{className:L.metaRow,children:[r.jsx("span",{className:L.metaLabel,children:"Description"}),r.jsx("div",{className:L.metaValue,children:r.jsx(Vf,{value:(E==null?void 0:E.description)||"",onSave:q=>{E&&v(E.id,{description:q})},fieldId:"description",activeFieldId:w,onActivate:k,renderDisplay:q=>q?r.jsx("span",{className:L.overviewMarkdown,children:r.jsx(Hf,{remarkPlugins:[Pf],children:q})}):void 0,placeholder:"No description",ariaLabel:"Workspace description","data-testid":"edit-description"})})]}),r.jsxs("div",{className:L.metaRow,children:[r.jsx("span",{className:L.metaLabel,children:"Repository"}),r.jsx("div",{className:L.metaValue,children:r.jsx(qt,{value:(E==null?void 0:E.repoUrl)||"",onSave:q=>{E&&v(E.id,{repoUrl:q})},validate:q=>{const te=q.trim();if(te&&!/^https?:\/\/.+/.test(te))return"Must be a valid http(s) URL"},fieldId:"repoUrl",activeFieldId:w,onActivate:k,renderDisplay:q=>{const te=g4(q);return te?r.jsx("a",{className:L.repoLink,href:te,target:"_blank",rel:"noopener noreferrer",onClick:O=>O.stopPropagation(),children:q}):q?r.jsx("span",{children:q}):void 0},placeholder:"No repository",ariaLabel:"Workspace repository URL","data-testid":"edit-repo"})})]}),r.jsxs("div",{className:L.metaRow,children:[r.jsx("span",{className:L.metaLabel,children:"Environment"}),r.jsx("div",{className:L.metaValue,children:r.jsx(v4,{value:(E==null?void 0:E.environmentId)||"",onSave:q=>{E&&q&&v(E.id,{environmentId:q})},environments:c,fieldId:"environmentId",activeFieldId:w,onActivate:k,placeholder:"Select environment",ariaLabel:"Workspace environment","data-testid":"edit-env"})})]}),r.jsxs("div",{className:L.metaRow,children:[r.jsx("span",{className:L.metaLabel,children:"Persona"}),r.jsx("div",{className:L.metaValue,children:r.jsx(fc,{value:(E==null?void 0:E.defaultPersonaId)||"",onSave:q=>{E&&v(E.id,{defaultPersonaId:q})},options:[{value:"",label:"(Inherit)"},...f.map(q=>({value:q.id,label:q.name}))],fieldId:"defaultPersonaId",activeFieldId:w,onActivate:k,renderDisplay:q=>{const te=f.find(O=>O.id===q);if(te)return r.jsx("span",{children:te.name})},placeholder:(E==null?void 0:E.defaultPersonaId)||"(Inherit)",ariaLabel:"Workspace default persona","data-testid":"edit-persona"})})]}),r.jsxs("div",{className:L.metaRow,children:[r.jsx("span",{className:L.metaLabel,children:"Worktrees"}),r.jsx("div",{className:L.metaValue,children:r.jsx(r4,{checked:(E==null?void 0:E.useWorktrees)??!0,onChange:q=>{E&&v(E.id,{useWorktrees:q})},label:"Enable worktree isolation","data-testid":"worktree-toggle"})})]}),r.jsxs("div",{className:L.metaRow,children:[r.jsx("span",{className:L.metaLabel,children:"Working Dir"}),r.jsx("div",{className:L.metaValue,children:r.jsx(qt,{value:(E==null?void 0:E.workingDirectory)||"",onSave:q=>{E&&v(E.id,{workingDirectory:q})},fieldId:"workingDirectory",activeFieldId:w,onActivate:k,placeholder:"Default (server default)",ariaLabel:"Working directory","data-testid":"edit-working-directory"})})]}),E&&r.jsxs("div",{className:L.metaTimestamps,children:[r.jsxs("span",{className:L.metaTimestamp,children:["Created ",A0(E.createdAt)]}),E.updatedAt&&E.updatedAt!==E.createdAt&&r.jsxs("span",{className:L.metaTimestamp,children:["· Updated ",A0(E.updatedAt)]})]})]}),ie>0&&r.jsxs("div",{className:L.progressBarContainer,"data-testid":"progress-bar",children:[r.jsx("div",{className:L.progressBar,children:r.jsx("div",{className:L.progressFill,style:{width:`${le}%`}})}),r.jsxs("span",{className:L.progressLabel,children:[se,"/",ie]})]}),Y&&Y.costUsd>0&&r.jsx("div",{className:L.progressBarContainer,children:r.jsxs("span",{className:L.progressLabel,children:["Usage: ",qi(Y.costUsd)," (",Y.sessionCount," session",Y.sessionCount!==1?"s":"",")"]})}),r.jsxs("div",{className:L.tabBar,role:"tablist","aria-label":"Workspace view",children:[r.jsx("button",{role:"tab","aria-selected":x==="graph",className:`${L.tab} ${x==="graph"?L.active:""}`,onClick:()=>_("graph"),children:"Graph"}),r.jsx("button",{role:"tab","aria-selected":x==="board",className:`${L.tab} ${x==="board"?L.active:""}`,onClick:()=>_("board"),"data-testid":"board-tab",children:"Board"}),r.jsx("button",{role:"tab","aria-selected":x==="tasks",className:`${L.tab} ${x==="tasks"?L.active:""}`,onClick:()=>_("tasks"),children:"Tasks"})]}),x==="tasks"&&ie>0&&r.jsxs("div",{className:L.workspaceSummary,children:[r.jsx("span",{className:L.workspaceSummaryTitle,children:`${se}/${ie} tasks complete`}),r.jsx("span",{className:L.workspaceSummarySubtitle,children:"Select a task or click + to create one"})]}),x==="tasks"&&ie===0&&r.jsxs("div",{className:L.emptyCta,children:[r.jsx("button",{className:L.ctaButton,onClick:()=>i(Gs(n,void 0,I)),children:"Create Task"}),r.jsx("div",{className:L.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}),x==="board"&&r.jsx(F6,{workspaceId:n,environmentId:I,tasks:l,sessions:m,personas:f,environments:c}),x==="graph"&&r.jsx(_6,{workspaceId:n,environmentId:I,tasks:l}),r.jsx(Us,{isOpen:T,title:"Archive Workspace?",description:"This will hide the workspace from the sidebar. Tasks will not be deleted.",confirmLabel:"Archive",onConfirm:()=>{E&&(p(E.id),i("/",{replace:!0})),N(!1)},onCancel:()=>N(!1)})]})}const b4="_formContent_ymnez_1",x4="_section_ymnez_13",S4="_label_ymnez_19",_4="_titleInput_ymnez_26",T4="_descriptionTextarea_ymnez_58",k4="_selectField_ymnez_94",j4="_checkboxRow_ymnez_128",w4="_checkboxLabel_ymnez_141",N4="_fieldError_ymnez_146",lt={formContent:b4,section:x4,label:S4,titleInput:_4,descriptionTextarea:T4,selectField:k4,checkboxRow:j4,checkboxLabel:w4,fieldError:N4};function C4(n,a){return{name:(n==null?void 0:n.name)??"",description:(n==null?void 0:n.description)??"",repoUrl:(n==null?void 0:n.repoUrl)??"",environmentId:(n==null?void 0:n.environmentId)??a??"",defaultPersonaId:(n==null?void 0:n.defaultPersonaId)??"",useWorktrees:(n==null?void 0:n.useWorktrees)??!0,workingDirectory:(n==null?void 0:n.workingDirectory)??""}}const E4=100;function A4({values:n,onChange:a,environments:i,personas:l,errors:c,disabled:d,autoFocusName:f}){const m=(p,v)=>{a({...n,[p]:v})};return r.jsxs("div",{className:lt.formContent,children:[r.jsxs("div",{className:lt.section,children:[r.jsx("label",{className:lt.label,htmlFor:"ws-name",children:"Name"}),r.jsx("input",{id:"ws-name",className:lt.titleInput,type:"text",value:n.name,onChange:p=>m("name",p.target.value),placeholder:"Workspace name",maxLength:E4,autoFocus:f,disabled:d,"data-testid":"workspace-form-name"}),(c==null?void 0:c.name)&&r.jsx("span",{className:lt.fieldError,"data-testid":"workspace-form-error-name",children:c.name})]}),r.jsxs("div",{className:lt.section,children:[r.jsx("label",{className:lt.label,htmlFor:"ws-description",children:"Description"}),r.jsx("textarea",{id:"ws-description",className:lt.descriptionTextarea,value:n.description,onChange:p=>m("description",p.target.value),placeholder:"Optional description (Markdown supported)",disabled:d,"data-testid":"workspace-form-description"})]}),r.jsxs("div",{className:lt.section,children:[r.jsx("label",{className:lt.label,htmlFor:"ws-repo",children:"Repository URL"}),r.jsx("input",{id:"ws-repo",className:lt.titleInput,type:"text",value:n.repoUrl,onChange:p=>m("repoUrl",p.target.value),placeholder:"https://github.com/org/repo",disabled:d,"data-testid":"workspace-form-repo"}),(c==null?void 0:c.repoUrl)&&r.jsx("span",{className:lt.fieldError,"data-testid":"workspace-form-error-repoUrl",children:c.repoUrl})]}),r.jsxs("div",{className:lt.section,children:[r.jsx("label",{className:lt.label,htmlFor:"ws-environment",children:"Environment"}),r.jsxs("select",{id:"ws-environment",className:lt.selectField,value:n.environmentId,onChange:p=>m("environmentId",p.target.value),disabled:d,"data-testid":"workspace-form-environment",children:[r.jsx("option",{value:"",children:"Select environment…"}),i.map(p=>r.jsx("option",{value:p.id,children:p.displayName||p.id},p.id))]}),(c==null?void 0:c.environmentId)&&r.jsx("span",{className:lt.fieldError,"data-testid":"workspace-form-error-environmentId",children:c.environmentId})]}),r.jsxs("div",{className:lt.section,children:[r.jsx("label",{className:lt.label,htmlFor:"ws-persona",children:"Default Persona"}),r.jsxs("select",{id:"ws-persona",className:lt.selectField,value:n.defaultPersonaId,onChange:p=>m("defaultPersonaId",p.target.value),disabled:d,"data-testid":"workspace-form-persona",children:[r.jsx("option",{value:"",children:"(Inherit)"}),l.map(p=>r.jsx("option",{value:p.id,children:p.name},p.id))]})]}),r.jsx("div",{className:lt.section,children:r.jsxs("label",{className:lt.checkboxRow,children:[r.jsx("input",{type:"checkbox",checked:n.useWorktrees,onChange:p=>m("useWorktrees",p.target.checked),disabled:d,"data-testid":"workspace-form-worktrees"}),r.jsx("span",{className:lt.checkboxLabel,children:"Enable worktree isolation"})]})}),r.jsxs("div",{className:lt.section,children:[r.jsx("label",{className:lt.label,htmlFor:"ws-workdir",children:"Working Directory"}),r.jsx("input",{id:"ws-workdir",className:lt.titleInput,type:"text",value:n.workingDirectory,onChange:p=>m("workingDirectory",p.target.value),placeholder:"Default (server default)",disabled:d,"data-testid":"workspace-form-workdir"})]})]})}const D4="_container_cddyd_1",R4="_header_cddyd_8",M4="_headerTitle_cddyd_35",O4="_badge_cddyd_44",B4="_headerActions_cddyd_54",L4="_body_cddyd_61",I4="_formContent_cddyd_73",z4="_section_cddyd_85",U4="_label_cddyd_91",V4="_titleInput_cddyd_98",H4="_descriptionTextarea_cddyd_131",P4="_parentContext_cddyd_167",G4="_parentLabel_cddyd_175",$4="_parentName_cddyd_182",q4="_personaSelect_cddyd_186",K4="_depList_cddyd_220",Y4="_depItem_cddyd_226",F4="_depItemSelected_cddyd_248",Z4="_noDeps_cddyd_252",X4="_btnPrimary_cddyd_258",Q4="_btnGhost_cddyd_289",De={container:D4,header:R4,headerTitle:M4,badge:O4,headerActions:B4,body:L4,formContent:I4,section:z4,label:U4,titleInput:V4,descriptionTextarea:H4,parentContext:P4,parentLabel:G4,parentName:$4,personaSelect:q4,depList:K4,depItem:Y4,depItemSelected:F4,noDeps:Z4,btnPrimary:X4,btnGhost:Q4};function W4(n){const a={};return n.name.trim()||(a.name="Name is required"),n.repoUrl.trim()&&!/^https?:\/\/.+/i.test(n.repoUrl.trim())&&(a.repoUrl="Must be a valid http(s) URL"),n.environmentId||(a.environmentId="Environment is required"),Object.keys(a).length>0?a:void 0}const J4=[{label:"Home",url:zs},{label:"New Workspace",url:void 0}];function eB(){const[n]=Qf(),a=n.get("environment")??void 0,{environments:i,personas:l,createWorkspace:c,workspaceCreating:d}=ut(),{showToast:f}=Na(),m=xt(),[p,v]=y.useState(()=>{var w;return C4(void 0,a||((w=i[0])==null?void 0:w.id))}),[g,b]=y.useState(),[x,_]=y.useState();y.useEffect(()=>{a||p.environmentId||i.length===0||v(w=>{var k;return w.environmentId?w:{...w,environmentId:((k=i[0])==null?void 0:k.id)??""}})},[i,a,p.environmentId]);const T=()=>{const w=W4(p);if(w){b(w),_(void 0);return}b(void 0),_(void 0),c(p.name.trim(),p.description,p.repoUrl.trim(),p.environmentId,p.defaultPersonaId,p.useWorktrees,p.workingDirectory,()=>{f("Workspace created","success"),m(zs,{replace:!0})},k=>{_(k)})},N=()=>{m(a?Hi(a):zs,{replace:!0})};return r.jsxs("div",{className:De.container,children:[r.jsxs("div",{className:De.header,children:[r.jsx("div",{className:De.headerTitle,children:r.jsx(us,{segments:J4})}),r.jsxs("div",{className:De.headerActions,children:[r.jsx("button",{className:De.btnGhost,onClick:N,disabled:d,"data-testid":"workspace-create-cancel",children:"Cancel"}),r.jsx("button",{className:De.btnPrimary,onClick:T,disabled:d||!p.name.trim()||!p.environmentId,"data-testid":"workspace-create-save",children:d?r.jsx(sS,{size:"sm",label:"Creating"}):"Create Workspace"})]})]}),r.jsxs("div",{className:De.body,children:[r.jsx(A4,{values:p,onChange:w=>{v(w),b(void 0),_(void 0)},environments:i,personas:l,errors:g,disabled:d,autoFocusName:!0}),x&&r.jsx("div",{className:De.error,"data-testid":"workspace-create-submit-error",children:x})]})]})}function uS({mode:n,taskId:a,workspaceId:i,parentTaskId:l,environmentId:c,tasks:d,workspaces:f,personas:m,onCreateTask:p,onUpdateTask:v,onEditDone:g}){const{showToast:b}=Na(),x=xt(),_=n==="edit",T=_&&a?d.find(fe=>fe.id===a):void 0,N=_?(T==null?void 0:T.workspaceId)??"":i??"",[w,k]=y.useState(N),C=N||w,A=f.find(fe=>fe.id===C),D=c??(A==null?void 0:A.environmentId),E=!_&&!i,I=_?(T==null?void 0:T.parentTaskId)??"":l??"",z=I?d.find(fe=>fe.id===I):void 0,[U,Y]=y.useState((T==null?void 0:T.title)??""),[ae,se]=y.useState((T==null?void 0:T.description)??""),[ie,le]=y.useState((T==null?void 0:T.dependsOn)??[]),[q,te]=y.useState((T==null?void 0:T.defaultPersonaId)??""),[O,P]=y.useState((T==null?void 0:T.canDecompose)??!1),[W,re]=y.useState(!1),oe=y.useRef(!1);y.useEffect(()=>{_&&T&&!oe.current&&(oe.current=!0,Y(T.title),se(T.description),le(T.dependsOn),te(T.defaultPersonaId),P(T.canDecompose))},[_,T]);const Ce=d.filter(fe=>fe.workspaceId===C&&(!_||fe.id!==a)&&fe.id!==I),je=U.trim().length>0&&(!_||T!==void 0)&&C.length>0,Se=fe=>{le(tt=>tt.includes(fe)?tt.filter(ee=>ee!==fe):[...tt,fe])},Le=()=>{!je||W||_&&T===void 0||(_&&a?(v(a,U.trim(),ae,ie,q),b("Task updated","success"),g?g():x(Jn(a,void 0,C,D),{replace:!0})):(re(!0),p(C,U.trim(),ae,ie.length>0?ie:void 0,I||void 0,q,O,()=>{b("Task created","success"),x(i?Ui(i,D):"/tasks",{replace:!0})},fe=>{b(fe,"error"),re(!1)})))},ce=()=>{if(g){g();return}x(_&&a?Jn(a,void 0,C,D):i?Ui(i,D):"/tasks")},ue=_?"edit task":I?"child task":"new task";return r.jsxs("div",{className:De.container,children:[r.jsxs("div",{className:De.header,children:[r.jsxs("div",{className:De.headerTitle,children:[r.jsx("span",{className:De.badge,children:ue}),z&&r.jsxs("span",{className:De.parentContext,children:[r.jsx("span",{className:De.parentLabel,children:"Child of"}),r.jsx("span",{className:De.parentName,children:z.title})]})]}),r.jsxs("div",{className:De.headerActions,children:[r.jsx("button",{onClick:Le,disabled:!je||W,className:De.btnPrimary,"data-testid":"task-edit-save",children:W?"Creating…":_?"Save Changes":"Create"}),r.jsx("button",{onClick:ce,className:De.btnGhost,children:"Cancel"})]})]}),r.jsx("div",{className:De.body,children:r.jsxs("div",{className:De.formContent,children:[E&&r.jsxs("div",{className:De.section,children:[r.jsx("label",{className:De.label,htmlFor:"task-edit-workspace",children:"Workspace"}),r.jsxs("select",{id:"task-edit-workspace",value:w,onChange:fe=>k(fe.target.value),className:De.personaSelect,"data-testid":"task-edit-workspace",children:[r.jsx("option",{value:"",children:"Select a workspace..."}),f.map(fe=>r.jsx("option",{value:fe.id,children:fe.name},fe.id))]})]}),r.jsxs("div",{className:De.section,children:[r.jsx("label",{className:De.label,htmlFor:"task-edit-title",children:"Title"}),r.jsx("input",{id:"task-edit-title",type:"text",value:U,onChange:fe=>Y(fe.target.value),placeholder:"Task title...",autoFocus:!0,className:De.titleInput,"data-testid":"task-edit-title",onKeyDown:fe=>{fe.key==="Enter"&&je&&Le()}})]}),r.jsxs("div",{className:De.section,children:[r.jsx("label",{className:De.label,htmlFor:"task-edit-description",children:"Description"}),r.jsx("textarea",{id:"task-edit-description",value:ae,onChange:fe=>se(fe.target.value),placeholder:"Describe the task... (markdown supported)",className:De.descriptionTextarea,"data-testid":"task-edit-description",rows:8})]}),r.jsxs("div",{className:De.section,children:[r.jsx("label",{className:De.label,htmlFor:"task-edit-persona",children:"Default Persona"}),r.jsxs("select",{id:"task-edit-persona",value:q,onChange:fe=>te(fe.target.value),className:De.personaSelect,"data-testid":"task-edit-persona",children:[r.jsx("option",{value:"",children:"(Inherit)"}),m.map(fe=>r.jsx("option",{value:fe.id,children:fe.name},fe.id))]})]}),!_&&r.jsx("div",{className:De.section,children:r.jsxs("label",{className:De.depItem,"data-testid":"task-edit-can-decompose",children:[r.jsx("input",{type:"checkbox",checked:O,onChange:fe=>P(fe.target.checked)}),"Can spawn subtasks"]})}),r.jsxs("div",{className:De.section,children:[r.jsx("div",{className:De.label,children:"Dependencies"}),Ce.length===0?r.jsx("div",{className:De.noDeps,children:"No other tasks in this workspace"}):r.jsx("div",{className:De.depList,children:Ce.map(fe=>{const tt=ie.includes(fe.id);return r.jsxs("label",{className:`${De.depItem} ${tt?De.depItemSelected:""}`,"data-testid":`dep-option-${fe.id}`,children:[r.jsx("input",{type:"checkbox",checked:tt,onChange:()=>Se(fe.id)}),fe.title,r.jsxs("span",{style:{opacity:.5,fontSize:"11px",marginLeft:"4px"},children:["(",fe.status,")"]})]},fe.id)})})]})]})})]})}function D0(){const{workspaceId:n,environmentId:a}=rs(),[i]=Qf(),l=n??i.get("workspace")??"",c=i.get("parent")??void 0,{tasks:d,workspaces:f,personas:m,createTask:p,updateTask:v}=ut();return r.jsx(uS,{mode:"new",workspaceId:l,parentTaskId:c,environmentId:a,tasks:d,workspaces:f,personas:m,onCreateTask:p,onUpdateTask:v})}const tB="_container_1pqxm_1",nB="_emptyState_1pqxm_8",aB="_card_1pqxm_14",sB="_cardHeader_1pqxm_34",iB="_categoryBadge_1pqxm_46",oB="_findingTitle_1pqxm_54",lB="_findingDate_1pqxm_60",rB="_findingContent_1pqxm_72",cB="_tags_1pqxm_78",uB="_tag_1pqxm_78",Zn={container:tB,emptyState:nB,card:aB,cardHeader:sB,categoryBadge:iB,findingTitle:oB,findingDate:lB,findingContent:rB,tags:cB,tag:uB};function dB(n){const a=new Date(n),i=new Date,l=i.getTime()-a.getTime(),c=Math.floor(l/1e3),d=Math.floor(c/60),f=Math.floor(d/60),m=Math.floor(f/24);if(c<60)return"just now";if(d<60)return`${d}m ago`;if(f<24)return`${f}h ago`;if(m===1)return"yesterday";if(m<7)return`${m} days ago`;const p=a.getFullYear()===i.getFullYear(),v=a.toLocaleString("en-US",{month:"short"}),g=a.getDate();return p?`${v} ${g}`:`${v} ${g} ${a.getFullYear()}`}const R0={architecture:{text:"var(--accent-blue)",bg:"var(--accent-blue-dim)"},api:{text:"var(--accent-green)",bg:"var(--accent-green-dim)"},bug:{text:"var(--accent-red)",bg:"var(--accent-red-dim)"},decision:{text:"var(--accent-yellow)",bg:"var(--accent-yellow-dim)"},dependency:{text:"var(--accent-purple)",bg:"var(--accent-purple-dim)"},pattern:{text:"var(--accent-cyan)",bg:"var(--accent-cyan-dim)"},general:{text:"var(--text-secondary)",bg:"var(--bg-elevated)"}};function fB({findings:n}){return n.length===0?r.jsx("div",{className:Zn.emptyState,children:"No findings yet. Agents will post discoveries here."}):r.jsx("div",{className:Zn.container,children:n.map((a,i)=>{const l=R0[a.category]||R0.general;return r.jsxs(Et.div,{className:Zn.card,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:i*.05,duration:.2},children:[r.jsxs("div",{className:Zn.cardHeader,children:[r.jsx("span",{className:Zn.categoryBadge,style:{background:l.bg,color:l.text},children:a.category}),r.jsx("span",{className:Zn.findingTitle,children:a.title}),r.jsx("span",{className:Zn.findingDate,title:a.createdAt,children:dB(a.createdAt)})]}),r.jsx("div",{className:Zn.findingContent,children:a.content.length>300?a.content.slice(0,300)+"...":a.content}),a.tags.length>0&&r.jsx("div",{className:Zn.tags,children:a.tags.map(c=>r.jsx("span",{className:Zn.tag,style:{color:l.text,textShadow:`0 0 8px ${l.text}`},children:c},c))})]},a.id)})})}const hB="_workpadSection_y8nj9_1",mB="_workpadLabel_y8nj9_9",pB="_workpadStatus_y8nj9_17",vB="_workpadSummary_y8nj9_23",gB="_workpadExtra_y8nj9_29",ns={workpadSection:hB,workpadLabel:mB,workpadStatus:pB,workpadSummary:vB,workpadExtra:gB};function yB({workpad:n}){if(!n)return;let a;try{const i=JSON.parse(n);if(i==null||typeof i!="object"||Array.isArray(i))return;a=i}catch{return r.jsxs("div",{className:ns.workpadSection,"data-testid":"workpad-panel",children:[r.jsx("div",{className:ns.workpadLabel,children:"Workpad"}),r.jsx("div",{className:ns.workpadExtra,children:n})]})}if(!(!a.status&&!a.summary&&!a.extra))return r.jsxs("div",{className:ns.workpadSection,"data-testid":"workpad-panel",children:[r.jsx("div",{className:ns.workpadLabel,children:"Workpad"}),a.status&&r.jsx("div",{className:ns.workpadStatus,"data-testid":"workpad-status",children:a.status}),a.summary&&r.jsx("div",{className:ns.workpadSummary,"data-testid":"workpad-summary",children:a.summary}),a.extra&&Object.keys(a.extra).length>0&&r.jsx("div",{className:ns.workpadExtra,"data-testid":"workpad-extra",children:JSON.stringify(a.extra,null,2)})]})}function Yr(n){if(!n)return"—";const a=new Date(n);return isNaN(a.getTime())?"—":a.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})}function df(n,a){if(!n||!a)return;const i=new Date(a).getTime()-new Date(n).getTime();if(isNaN(i)||i<0)return;const l=Math.floor(i/6e4),c=Math.floor(i%6e4/1e3);if(l===0)return`${c}s`;const d=Math.floor(l/60),f=l%60;return d===0?`${l}m ${c}s`:`${d}h ${f}m`}function M0(n){const a=n.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?L.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?L.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?L.envDotRed:L.envDotGray}function bB({status:n}){const a=ls(n),i=A2(n);return r.jsx("span",{className:`${L.statusBadge} ${L[i]??L.statusPending}`,children:a.label})}function xB({task:n,tasksById:a,environments:i,workspaces:l,taskSessions:c,selectedEnvId:d}){const{loadUsage:f,usageCache:m}=ut(),p=c.reduce((A,D)=>A+(D.costUsd??0),0);y.useEffect(()=>{f("task",n.id),n.childTaskIds.length>0&&f("task_tree",n.id)},[n.id,n.childTaskIds.length,f,p]);const v=`task:${n.id}`,g=v in m?m[v]:void 0,b=`task_tree:${n.id}`,x=n.childTaskIds.length>0&&b in m?m[b]:void 0,_=c.length>0?c[c.length-1]:void 0,T=(_==null?void 0:_.environmentId)??"",N=T?i.find(A=>A.id===T):void 0,w=l.find(A=>A.id===n.workspaceId),k=i.find(A=>A.id===d),C=n.branch&&(w!=null&&w.repoUrl)?`${w.repoUrl.replace(/\/$/,"")}/tree/${encodeURIComponent(n.branch)}`:void 0;return r.jsxs("div",{className:L.overviewDashboard,children:[r.jsxs("div",{className:L.overviewHero,children:[r.jsx(bB,{status:n.status}),n.branch&&r.jsx("span",{className:L.overviewBranchPill,children:C?r.jsxs("a",{href:C,target:"_blank",rel:"noreferrer noopener",className:L.branchLink,children:["🔗"," ",n.branch]}):r.jsxs("span",{children:["🔗"," ",n.branch]})})]}),typeof n.description=="string"&&n.description&&r.jsxs("div",{className:L.overviewSection,children:[r.jsx("div",{className:L.overviewLabel,children:"Description"}),r.jsx("div",{className:L.overviewMarkdown,children:r.jsx(Hf,{remarkPlugins:[Pf],children:n.description})})]}),n.workpad&&r.jsx(yB,{workpad:n.workpad}),r.jsxs("div",{className:L.overviewSection,children:[r.jsx("div",{className:L.overviewLabel,children:"Environment"}),T&&N?r.jsxs("div",{className:L.envRow,"data-testid":"task-overview-environment",children:[r.jsx("span",{className:`${L.envDot} ${M0(N.status)}`,title:N.status,"aria-label":`Status: ${N.status}`,role:"img"}),r.jsx("span",{className:L.overviewValue,children:N.displayName})]}):k?r.jsxs("div",{className:L.envRow,"data-testid":"task-overview-environment",children:[r.jsx("span",{className:`${L.envDot} ${M0(k.status)}`,title:k.status,"aria-label":`Status: ${k.status}`,role:"img"}),r.jsx("span",{className:L.overviewValue,children:k.displayName}),r.jsx("span",{className:L.overviewMuted,children:"(workspace default)"})]}):r.jsx("div",{className:L.overviewMuted,children:"Set in workspace settings"})]}),r.jsxs("div",{className:L.overviewSection,children:[r.jsx("div",{className:L.overviewLabel,children:"Dependencies"}),n.dependsOn.length===0?r.jsx("div",{className:L.overviewMuted,children:"None"}):r.jsx("div",{className:L.depList,children:n.dependsOn.map(A=>{const D=a.get(A),E=(D==null?void 0:D.status)==="complete";return r.jsxs("div",{className:`${L.depItem} ${E?L.depDone:L.depBlocked}`,children:[r.jsx("span",{children:E?"✓":"○"}),r.jsx("span",{children:(D==null?void 0:D.title)??A})]},A)})})]}),r.jsxs("div",{className:L.overviewSection,children:[r.jsx("div",{className:L.overviewLabel,children:"Timeline"}),r.jsxs("div",{className:L.timeline,children:[n.createdAt&&r.jsxs("div",{className:L.timelineRow,children:[r.jsx("span",{className:L.timelineKey,children:"Created"}),r.jsx("span",{className:L.timelineValue,children:Yr(n.createdAt)})]}),n.assignedAt&&(()=>{const A=df(n.createdAt,n.assignedAt);return r.jsxs("div",{className:L.timelineRow,children:[r.jsx("span",{className:L.timelineKey,children:"Assigned"}),r.jsx("span",{className:L.timelineValue,children:Yr(n.assignedAt)}),A!==void 0&&r.jsx("span",{className:L.timelineDelta,children:A})]})})(),n.startedAt&&(()=>{const A=df(n.assignedAt??n.createdAt,n.startedAt);return r.jsxs("div",{className:L.timelineRow,children:[r.jsx("span",{className:L.timelineKey,children:"Started"}),r.jsx("span",{className:L.timelineValue,children:Yr(n.startedAt)}),A!==void 0&&r.jsx("span",{className:L.timelineDelta,children:A})]})})(),n.completedAt&&(()=>{const A=df(n.startedAt,n.completedAt);return r.jsxs("div",{className:L.timelineRow,children:[r.jsx("span",{className:L.timelineKey,children:"Completed"}),r.jsx("span",{className:L.timelineValue,children:Yr(n.completedAt)}),A!==void 0&&r.jsx("span",{className:L.timelineDelta,children:A})]})})(),!n.createdAt&&!n.assignedAt&&!n.startedAt&&!n.completedAt&&r.jsx("div",{className:L.overviewMuted,children:"No timing data"})]})]}),g&&g.costUsd>0&&r.jsxs("div",{className:L.overviewSection,children:[r.jsx("div",{className:L.overviewLabel,children:"Usage"}),r.jsxs("div",{className:L.timeline,children:[r.jsxs("div",{className:L.timelineRow,children:[r.jsx("span",{className:L.timelineKey,children:"Cost"}),r.jsx("span",{className:L.timelineValue,children:qi(g.costUsd)}),r.jsxs("span",{className:L.timelineDelta,children:[g.sessionCount," session",g.sessionCount!==1?"s":""]})]}),x&&x.costUsd>g.costUsd&&r.jsxs("div",{className:L.timelineRow,children:[r.jsx("span",{className:L.timelineKey,children:"Total (incl. subtasks)"}),r.jsx("span",{className:L.timelineValue,children:qi(x.costUsd)}),r.jsxs("span",{className:L.timelineDelta,children:[x.sessionCount," session",x.sessionCount!==1?"s":""]})]})]})]}),n.reviewNotes&&r.jsxs("div",{className:L.overviewSection,children:[r.jsx("div",{className:L.overviewLabel,children:"Review Notes"}),r.jsx("div",{className:L.reviewNotes,children:n.reviewNotes})]})]})}function SB({task:n,sessionId:a,isBlocked:i,onStart:l,onResume:c,onStop:d,onPause:f,onDelete:m,onEdit:p}){if(n.status==="not_started")return i?r.jsxs("div",{className:L.headerActions,children:[r.jsx("button",{onClick:p,className:L.btnGhost,children:"Edit"}),r.jsx("button",{onClick:m,className:L.btnDanger,children:"Delete"})]}):r.jsxs("div",{className:L.headerActions,children:[r.jsx("button",{onClick:l,className:L.btnPrimary,children:"Start"}),r.jsx("button",{onClick:p,className:L.btnGhost,children:"Edit"}),r.jsx("button",{onClick:m,className:L.btnDanger,children:"Delete"})]});if(n.status==="working")return r.jsxs("div",{className:L.headerActions,children:[r.jsx("button",{onClick:d,className:L.btnDanger,children:"Stop"}),r.jsx("button",{onClick:f,disabled:!a,className:L.btnGhost,children:"Pause"})]});if(n.status==="paused")return r.jsxs("div",{className:L.headerActions,children:[r.jsx("button",{onClick:d,className:L.btnPrimary,children:"Stop"}),r.jsx("button",{onClick:c,className:L.btnGhost,children:"Resume"}),r.jsx("button",{onClick:m,className:L.btnDanger,children:"Delete"})]});if(n.status==="complete")return r.jsx("div",{className:L.headerActions,children:r.jsx("button",{onClick:m,className:L.btnDanger,children:"Delete"})});if(n.status==="failed")return r.jsxs("div",{className:L.headerActions,children:[r.jsx("button",{onClick:l,className:L.btnPrimary,children:"Retry"}),r.jsx("button",{onClick:m,className:L.btnDanger,children:"Delete"})]})}function _B({taskSessions:n,selectedSessionId:a,onSelect:i}){if(!(n.length<2))return r.jsxs("div",{className:L.attemptSelector,"data-testid":"attempt-selector",children:[r.jsx("span",{className:L.attemptLabel,children:"Attempts:"}),n.map((l,c)=>{const d=l.id===a,f=l.status==="stopped"&&l.endReason==="completed"?"✓":l.status==="stopped"?"✗":l.status==="running"||l.status==="idle"?"●":"";return r.jsxs("button",{className:`${L.attemptButton} ${d?L.attemptActive:""}`,onClick:()=>i(l.id),title:`Attempt #${c+1} — ${l.status}`,"aria-label":`Attempt #${c+1}, ${l.status}`,"aria-pressed":d,"data-testid":`attempt-${c+1}`,children:["#",c+1,f&&r.jsx("span",{className:L.attemptStatus,children:f})]},l.id)})]})}function as(){const{taskId:n,workspaceId:a,environmentId:i}=rs(),l=Ot(),c=xt(),{events:d,eventsDropped:f,tasks:m,sessions:p,environments:v,findings:g,loadSessionEvents:b,loadFindings:x,kill:_,startTask:T,stopTask:N,resumeTask:w,deleteTask:k,createTask:C,updateTask:A,workspaces:D,taskSessions:E,loadTaskSessions:I,sendInput:z,spawn:U,personas:Y,provisionEnvironment:ae}=ut(),se=y.useRef(void 0),ie=y.useRef(void 0),le=y.useRef(void 0),q=y.useRef(void 0),te=y.useRef(void 0),O=l.pathname.endsWith("/stream")?"stream":l.pathname.endsWith("/findings")?"findings":"overview",P=l.pathname.endsWith("/edit"),[W,re]=y.useState(O),[oe,Ce]=y.useState(!1),[je,Se]=y.useState(void 0),[Le,ce]=y.useState(""),[ue,fe]=y.useState(P),tt=y.useRef(O),ee=y.useRef(P),X=m.find(Ee=>Ee.id===n),At=(X==null?void 0:X.workspaceId)||void 0,pt=D.find(Ee=>Ee.id===At);y.useEffect(()=>{O!==tt.current&&(tt.current=O,O!==W&&re(O))},[O,W]),y.useEffect(()=>{P!==ee.current&&(ee.current=P,P!==ue&&fe(P))},[P,ue]),y.useEffect(()=>{if(Le===""){if(pt!=null&&pt.environmentId)ce(pt.environmentId);else if(v.length>0){const Ee=v.find(Dt=>Dt.status==="connected");ce((Ee==null?void 0:Ee.id)??v[0].id)}}},[Le,pt==null?void 0:pt.environmentId,v]);const yn=X?E[X.id]??[]:[];let Ke;je&&yn.some(Ee=>Ee.id===je)?Ke=je:Ke=(X==null?void 0:X.latestSessionId)||void 0;const Pn=()=>{Ce(!0)},Gn=()=>{if(!X)return;k(X.id),Ce(!1);const Ee=i??(pt==null?void 0:pt.environmentId);c(X.workspaceId&&Ee?Ui(X.workspaceId,Ee):"/",{replace:!0})};y.useEffect(()=>{(X==null?void 0:X.id)!==ie.current&&(ie.current=X==null?void 0:X.id,Se(void 0),ce(""),fe(P))},[X==null?void 0:X.id,P]),y.useEffect(()=>{if(!(X!=null&&X.id))return;const Ee=X.id!==q.current,Dt=X.latestSessionId!==te.current;(Ee||Dt)&&(q.current=X.id,te.current=X.latestSessionId,I(X.id))},[X==null?void 0:X.id,X==null?void 0:X.latestSessionId,I]),y.useEffect(()=>{if((X==null?void 0:X.status)!==le.current){const Ee=le.current===void 0;le.current=X==null?void 0:X.status;const Dt=(X==null?void 0:X.status)==="not_started"?"overview":(X==null?void 0:X.status)==="working"||(X==null?void 0:X.status)==="paused"?"stream":(X==null?void 0:X.status)==="complete"?"findings":void 0;Dt&&Dt!==W&&!(Ee&&O!=="overview")&&re(Dt)}},[X==null?void 0:X.status,W,O]);const Bn=y.useMemo(()=>new Map(m.map(Ee=>[Ee.id,Ee])),[m]),Ca=y.useMemo(()=>{const Ee=Ke?d.filter(Dt=>Dt.sessionId===Ke):[];return Ih(Lh(Ee))},[d,Ke]),$n=X?X.dependsOn.some(Ee=>{const Dt=Bn.get(Ee);return Dt!==void 0&&Dt.status!=="complete"}):!1,Ea=y.useMemo(()=>FO(n,i,D,v,Bn),[n,i,D,v,Bn]);y.useEffect(()=>{Ke&&Ke!==se.current&&(se.current=Ke,b(Ke))},[Ke,b]),y.useEffect(()=>{W==="findings"&&At&&x(At)},[W,At,x]);const ln=Ee=>{re(Ee),c(Jn(n,Ee==="overview"?void 0:Ee,a,i))};return ka({key:"1"},()=>ln("overview")),ka({key:"2"},()=>ln("stream")),ka({key:"3"},()=>ln("findings")),r.jsxs("div",{className:L.panelContainer,children:[r.jsx(us,{segments:Ea}),r.jsxs("div",{className:L.header,children:[r.jsxs("span",{className:L.headerTitle,children:[r.jsx("span",{"data-testid":"task-title",children:(X==null?void 0:X.title)||n}),X&&r.jsx("span",{className:L.taskStatusBadge,"data-testid":"task-status",children:X.status}),(X==null?void 0:X.branch)&&r.jsx("span",{className:L.taskBranch,children:X.branch}),$n&&r.jsx("span",{className:L.taskBlockedBadge,children:"blocked"})]}),X&&r.jsx(SB,{task:X,sessionId:Ke,isBlocked:$n,onStart:()=>T(X.id,void 0,Le),onResume:()=>w(X.id),onStop:()=>N(X.id),onPause:()=>Ke&&_(Ke),onDelete:Pn,onEdit:()=>fe(!0)})]}),r.jsxs("div",{className:L.tabBar,role:"tablist","aria-label":"Task view",children:[r.jsx("button",{role:"tab","aria-selected":W==="overview",className:`${L.tab} ${W==="overview"?L.active:""}`,onClick:()=>ln("overview"),children:"Overview"}),r.jsx("button",{role:"tab","aria-selected":W==="stream",className:`${L.tab} ${W==="stream"?L.active:""}`,onClick:()=>ln("stream"),children:"Stream"}),r.jsx("button",{role:"tab","aria-selected":W==="findings",className:`${L.tab} ${W==="findings"?L.active:""}`,onClick:()=>ln("findings"),children:"Findings"})]}),r.jsxs(ea,{mode:"wait",children:[W==="overview"&&r.jsx(Et.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:L.overviewContent,"data-testid":"task-overview",children:ue&&X?r.jsx(uS,{mode:"edit",taskId:X.id,workspaceId:At,environmentId:i,tasks:m,workspaces:D,personas:Y,onCreateTask:C,onUpdateTask:A,onEditDone:()=>{P?c(Jn(X.id,void 0,a,i),{replace:!0}):fe(!1)}}):X?r.jsx(xB,{task:X,tasksById:Bn,environments:v,workspaces:D,taskSessions:yn,selectedEnvId:Le}):r.jsx("div",{className:L.waitingMessage,children:"No additional details"})},"overview"),W==="stream"&&r.jsxs(Et.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden"},children:[r.jsx(_B,{taskSessions:yn,selectedSessionId:Ke,onSelect:Ee=>Se(Ee)}),r.jsx(Bh,{events:Ca,eventsDropped:f,emptyState:!Ke&&X?$n?r.jsx("div",{className:L.emptyCta,"data-testid":"stream-blocked-message",children:r.jsx("div",{className:L.ctaDescription,children:"This task is blocked by incomplete dependencies"})}):r.jsxs("div",{className:L.emptyCta,children:[r.jsx("button",{"data-testid":"stream-start-cta",className:L.ctaButton,onClick:()=>T(X.id,void 0,Le),children:"Start Task"}),r.jsx("div",{className:L.ctaDescription,children:"Click to begin agent execution"})]}):Ke&&Ca.length===0?r.jsx("div",{className:L.waitingMessage,children:"Waiting for events..."}):void 0})]},"stream"),W==="findings"&&r.jsx(Et.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:L.tabContent,children:At?r.jsx(fB,{findings:g.filter(Ee=>Ee.workspaceId===At)}):r.jsx("div",{className:L.noContext,children:"Navigate to a task within a workspace to view findings"})},"findings")]}),(()=>{if(!X||X.status!=="working"&&X.status!=="paused")return;const Ee=Ke?p.find(Dt=>Dt.id===Ke):void 0;if(!(!Ee||Ee.status==="stopped"))return r.jsx(hl,{mode:"send",sessionId:Ee.id,environmentId:Ee.environmentId,personas:Y,environments:v,onSendInput:z,onSpawn:U,onStartTask:T,onProvisionEnvironment:ae})})(),X&&r.jsx(Us,{isOpen:oe,title:"Delete Task?",description:`"${X.title}" will be permanently removed.`,onConfirm:Gn,onCancel:()=>Ce(!1)})]})}const TB="_container_legrg_1",kB="_header_legrg_8",jB="_headerTitle_legrg_35",wB="_badge_legrg_44",NB="_headerActions_legrg_54",CB="_body_legrg_61",EB="_formContent_legrg_73",AB="_section_legrg_85",DB="_label_legrg_91",RB="_nameInput_legrg_98",MB="_fieldInput_legrg_131",OB="_adapterSelect_legrg_164",BB="_readOnlyValue_legrg_198",LB="_codespaceSection_legrg_204",IB="_codespaceActions_legrg_210",zB="_creatingHint_legrg_216",UB="_errorHint_legrg_222",VB="_btnPrimary_legrg_235",HB="_btnGhost_legrg_266",J={container:TB,header:kB,headerTitle:jB,badge:wB,headerActions:NB,body:CB,formContent:EB,section:AB,label:DB,nameInput:RB,fieldInput:MB,adapterSelect:OB,readOnlyValue:BB,codespaceSection:LB,codespaceActions:IB,creatingHint:zB,errorHint:UB,btnPrimary:VB,btnGhost:HB},ec=1,tc=65535;function ff(n){if(!n.trim())return!0;const a=Number(n);return Number.isInteger(a)&&a>=ec&&a<=tc}function hf(n){try{const a=JSON.parse(n);if(typeof a=="object"&&a!==null&&!Array.isArray(a))return a}catch{}return{}}function PB({codespaceName:n,onCodespaceNameChange:a,envName:i,onEnvNameChange:l,codespaces:c,codespaceError:d,codespaceListError:f,codespaceCreating:m,onCreateCodespace:p}){const[v,g]=y.useState("pick"),[b,x]=y.useState(""),[_,T]=y.useState("");return v==="create"?r.jsxs("div",{className:J.codespaceSection,children:[r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,children:"Repository"}),r.jsx("input",{type:"text",value:b,onChange:N=>x(N.target.value),placeholder:"owner/repo",className:J.fieldInput,"data-testid":"env-codespace-repo"})]}),r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,children:"Machine Type"}),r.jsx("input",{type:"text",value:_,onChange:N=>T(N.target.value),placeholder:"Machine type (optional)...",className:J.fieldInput,"data-testid":"env-codespace-machine"})]}),r.jsxs("div",{className:J.codespaceActions,children:[r.jsx("button",{onClick:()=>{b.trim()&&(p(b.trim(),_.trim()||void 0),g("pick"),x(""),T(""))},disabled:!b.trim(),className:J.btnPrimary,children:"Create"}),r.jsx("button",{onClick:()=>{g("pick"),x(""),T("")},className:J.btnGhost,children:"Cancel"})]})]}):r.jsx("div",{className:J.codespaceSection,children:r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,children:"Codespace"}),!f&&r.jsxs("select",{value:n,onChange:N=>{N.target.value==="__create__"?(g("create"),a("")):(a(N.target.value),N.target.value&&!i.trim()&&l(N.target.value))},disabled:m,className:J.adapterSelect,"data-testid":"env-codespace-select",children:[r.jsx("option",{value:"",children:"Select a codespace..."}),c.map(N=>r.jsxs("option",{value:N.name,children:[N.name," (",N.repository,") — ",N.state]},N.name)),r.jsx("option",{value:"__create__",children:"Create new from repo..."})]}),m&&r.jsx("span",{className:J.creatingHint,children:"Creating codespace..."}),f&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:J.errorHint,children:f}),r.jsx("input",{type:"text",value:n,onChange:N=>a(N.target.value),placeholder:"Or enter codespace name manually...",className:J.fieldInput,"data-testid":"env-codespace-manual"})]}),d&&!f&&r.jsx("span",{className:J.errorHint,children:d})]})})}function dS({mode:n,environmentId:a,environments:i,onAddEnvironment:l,onUpdateEnvironment:c,onListCodespaces:d,codespaces:f,codespaceError:m,codespaceListError:p,codespaceCreating:v,onCreateCodespace:g}){const{showToast:b}=Na(),x=xt(),_=n==="edit",T=_&&a?i.find(ce=>ce.id===a):void 0,[N,w]=y.useState(""),[k,C]=y.useState("local"),[A,D]=y.useState(""),[E,I]=y.useState(""),[z,U]=y.useState(""),[Y,ae]=y.useState(""),[se,ie]=y.useState(""),[le,q]=y.useState(""),[te,O]=y.useState(""),[P,W]=y.useState(null),re=y.useCallback(()=>{const ce={};if(k==="local"){if(A.trim()&&(ce.host=A.trim()),E.trim()){const ue=Number(E);Number.isInteger(ue)&&(ce.port=ue)}}else if(k==="ssh"){if(ce.host=A.trim(),z.trim()&&(ce.user=z.trim()),E.trim()){const ue=Number(E);Number.isInteger(ue)&&(ce.sshPort=ue)}Y.trim()&&(ce.identityFile=Y.trim())}else k==="docker"?(se.trim()&&(ce.image=se.trim()),le.trim()&&(ce.repo=le.trim())):k==="codespace"&&(ce.codespaceName=te.trim());return ce},[k,A,E,z,Y,se,le,te]),oe=()=>!(!N.trim()||k==="ssh"&&!A.trim()||k==="codespace"&&!te.trim()||(k==="local"||k==="ssh")&&!ff(E)),Ce=()=>{oe()&&(l(N.trim(),k,re()),b("Environment added successfully","success"),x(Vi,{replace:!0}))},je=()=>{x(a?Hi(a):Vi)},Se=y.useCallback((ce,ue)=>{if(!T||!a)return;const fe=hf(T.adapterConfig),tt=ue.trim();tt?fe[ce]=tt:delete fe[ce],c(a,{adapterConfig:fe})},[T,a,c]),Le=y.useCallback((ce,ue)=>{if(!T||!a)return;const fe=hf(T.adapterConfig);if(ue.trim()){const tt=Number(ue);Number.isInteger(tt)&&tt>=ec&&tt<=tc&&(fe[ce]=tt)}else delete fe[ce];c(a,{adapterConfig:fe})},[T,a,c]);if(_){if(!T)return r.jsxs("div",{className:J.container,children:[r.jsxs("div",{className:J.header,children:[r.jsx("div",{className:J.headerTitle,children:r.jsx("span",{className:J.badge,children:"edit environment"})}),r.jsx("div",{className:J.headerActions,children:r.jsx("button",{onClick:je,className:J.btnGhost,children:"Back"})})]}),r.jsx("div",{className:J.body,children:r.jsx("div",{className:J.formContent,children:r.jsx("span",{className:J.readOnlyValue,children:"Environment not found"})})})]});const ce=hf(T.adapterConfig);return r.jsxs("div",{className:J.container,"data-testid":"env-edit-panel",children:[r.jsxs("div",{className:J.header,children:[r.jsx("div",{className:J.headerTitle,children:r.jsx("span",{className:J.badge,children:"edit environment"})}),r.jsx("div",{className:J.headerActions,children:r.jsx("button",{onClick:je,className:J.btnGhost,"data-testid":"env-edit-back",children:"Back"})})]}),r.jsx("div",{className:J.body,children:r.jsxs("div",{className:J.formContent,children:[r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,children:"Name"}),r.jsx(qt,{value:T.displayName,onSave:ue=>{a&&c(a,{displayName:ue})},validate:ue=>ue.trim()===""?"Name cannot be empty":void 0,mode:"edit",fieldId:"name",activeFieldId:P,onActivate:W,placeholder:"Environment name",ariaLabel:"Environment name","data-testid":"env-edit-name"})]}),r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,children:"Adapter Type"}),r.jsx("span",{className:J.readOnlyValue,"data-testid":"env-edit-adapter-type",children:T.adapterType})]}),T.adapterType==="local"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,children:"Host"}),r.jsx(qt,{value:String(ce.host??""),onSave:ue=>Se("host",ue),mode:"edit",fieldId:"host",activeFieldId:P,onActivate:W,placeholder:"(default)",ariaLabel:"Host","data-testid":"env-edit-host"})]}),r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,children:"Port"}),r.jsx(qt,{value:String(ce.port??""),onSave:ue=>Le("port",ue),validate:ue=>ff(ue)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"port",activeFieldId:P,onActivate:W,placeholder:"(default)",ariaLabel:"Port","data-testid":"env-edit-port"})]})]}),T.adapterType==="ssh"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,children:"Host"}),r.jsx(qt,{value:String(ce.host??""),onSave:ue=>Se("host",ue),validate:ue=>ue.trim()===""?"Host is required":void 0,mode:"edit",fieldId:"host",activeFieldId:P,onActivate:W,placeholder:"hostname or IP",ariaLabel:"Host","data-testid":"env-edit-host"})]}),r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,children:"User"}),r.jsx(qt,{value:String(ce.user??""),onSave:ue=>Se("user",ue),mode:"edit",fieldId:"user",activeFieldId:P,onActivate:W,placeholder:"(default)",ariaLabel:"User","data-testid":"env-edit-user"})]}),r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,children:"SSH Port"}),r.jsx(qt,{value:String(ce.sshPort??""),onSave:ue=>Le("sshPort",ue),validate:ue=>ff(ue)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"sshPort",activeFieldId:P,onActivate:W,placeholder:"22",ariaLabel:"SSH Port","data-testid":"env-edit-ssh-port"})]}),r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,children:"Identity File"}),r.jsx(qt,{value:String(ce.identityFile??""),onSave:ue=>Se("identityFile",ue),mode:"edit",fieldId:"identityFile",activeFieldId:P,onActivate:W,placeholder:"~/.ssh/id_rsa",ariaLabel:"Identity File","data-testid":"env-edit-identity-file"})]})]}),T.adapterType==="docker"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,children:"Image"}),r.jsx(qt,{value:String(ce.image??""),onSave:ue=>Se("image",ue),mode:"edit",fieldId:"image",activeFieldId:P,onActivate:W,placeholder:"(default)",ariaLabel:"Image","data-testid":"env-edit-image"})]}),r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,children:"Repo"}),r.jsx(qt,{value:String(ce.repo??""),onSave:ue=>Se("repo",ue),mode:"edit",fieldId:"repo",activeFieldId:P,onActivate:W,placeholder:"(none)",ariaLabel:"Repo","data-testid":"env-edit-repo"})]})]}),T.adapterType==="codespace"&&r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,children:"Codespace Name"}),r.jsx(qt,{value:String(ce.codespaceName??""),onSave:ue=>Se("codespaceName",ue),validate:ue=>ue.trim()===""?"Codespace name is required":void 0,mode:"edit",fieldId:"codespaceName",activeFieldId:P,onActivate:W,placeholder:"codespace-name",ariaLabel:"Codespace Name","data-testid":"env-edit-codespace-name"})]})]})})]})}return r.jsxs("div",{className:J.container,"data-testid":"env-create-panel",children:[r.jsxs("div",{className:J.header,children:[r.jsx("div",{className:J.headerTitle,children:r.jsx("span",{className:J.badge,children:"new environment"})}),r.jsxs("div",{className:J.headerActions,children:[r.jsx("button",{onClick:Ce,disabled:!oe(),className:J.btnPrimary,"data-testid":"env-create-submit",children:"Create"}),r.jsx("button",{onClick:je,className:J.btnGhost,children:"Cancel"})]})]}),r.jsx("div",{className:J.body,children:r.jsxs("div",{className:J.formContent,children:[r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,htmlFor:"env-create-name",children:"Name"}),r.jsx("input",{id:"env-create-name",type:"text",value:N,onChange:ce=>w(ce.target.value),placeholder:"Environment name...",autoFocus:!0,className:J.nameInput,"data-testid":"env-create-name",onKeyDown:ce=>{ce.key==="Enter"&&oe()&&Ce()}})]}),r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,htmlFor:"env-create-adapter",children:"Adapter Type"}),r.jsxs("select",{id:"env-create-adapter",value:k,onChange:ce=>{C(ce.target.value),ce.target.value==="codespace"&&d()},className:J.adapterSelect,"data-testid":"env-create-adapter",children:[r.jsx("option",{value:"local",children:"local"}),r.jsx("option",{value:"ssh",children:"ssh"}),r.jsx("option",{value:"docker",children:"docker"}),r.jsx("option",{value:"codespace",children:"codespace"})]})]}),k==="local"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,htmlFor:"env-create-host",children:"Host"}),r.jsx("input",{id:"env-create-host",type:"text",value:A,onChange:ce=>D(ce.target.value),placeholder:"Host (optional)...",className:J.fieldInput,"data-testid":"env-create-host"})]}),r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,htmlFor:"env-create-port",children:"Port"}),r.jsx("input",{id:"env-create-port",type:"number",min:ec,max:tc,value:E,onChange:ce=>I(ce.target.value),placeholder:"Port (optional)...",className:J.fieldInput,"data-testid":"env-create-port"})]})]}),k==="ssh"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,htmlFor:"env-create-host",children:"Host"}),r.jsx("input",{id:"env-create-host",type:"text",value:A,onChange:ce=>D(ce.target.value),placeholder:"Host (required)...",className:J.fieldInput,"data-testid":"env-create-host"})]}),r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,htmlFor:"env-create-user",children:"User"}),r.jsx("input",{id:"env-create-user",type:"text",value:z,onChange:ce=>U(ce.target.value),placeholder:"User (optional)...",className:J.fieldInput,"data-testid":"env-create-user"})]}),r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,htmlFor:"env-create-port",children:"SSH Port"}),r.jsx("input",{id:"env-create-port",type:"number",min:ec,max:tc,value:E,onChange:ce=>I(ce.target.value),placeholder:"SSH port (optional)...",className:J.fieldInput,"data-testid":"env-create-port"})]}),r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,htmlFor:"env-create-identity",children:"Identity File"}),r.jsx("input",{id:"env-create-identity",type:"text",value:Y,onChange:ce=>ae(ce.target.value),placeholder:"Identity file (optional)...",className:J.fieldInput,"data-testid":"env-create-identity"})]})]}),k==="docker"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,htmlFor:"env-create-image",children:"Image"}),r.jsx("input",{id:"env-create-image",type:"text",value:se,onChange:ce=>ie(ce.target.value),placeholder:"Image (optional)...",className:J.fieldInput,"data-testid":"env-create-image"})]}),r.jsxs("div",{className:J.section,children:[r.jsx("label",{className:J.label,htmlFor:"env-create-repo",children:"Repo"}),r.jsx("input",{id:"env-create-repo",type:"text",value:le,onChange:ce=>q(ce.target.value),placeholder:"Repo (optional)...",className:J.fieldInput,"data-testid":"env-create-repo"})]})]}),k==="codespace"&&r.jsx(PB,{codespaceName:te,onCodespaceNameChange:O,envName:N,onEnvNameChange:w,codespaces:f,codespaceError:m,codespaceListError:p,codespaceCreating:v,onCreateCodespace:g})]})})]})}function GB(){const{environments:n,addEnvironment:a,updateEnvironment:i,listCodespaces:l,codespaces:c,codespaceError:d,codespaceListError:f,codespaceCreating:m,createCodespace:p}=ut();return r.jsx(dS,{mode:"new",environments:n,onAddEnvironment:a,onUpdateEnvironment:i,onListCodespaces:l,codespaces:c,codespaceError:d,codespaceListError:f,codespaceCreating:m,onCreateCodespace:p})}function $B(){const{environmentId:n}=rs(),{environments:a,addEnvironment:i,updateEnvironment:l,listCodespaces:c,codespaces:d,codespaceError:f,codespaceListError:m,codespaceCreating:p,createCodespace:v}=ut();return r.jsx(dS,{mode:"edit",environmentId:n,environments:a,onAddEnvironment:i,onUpdateEnvironment:l,onListCodespaces:c,codespaces:d,codespaceError:f,codespaceListError:m,codespaceCreating:p,onCreateCodespace:v})}const qB="_layout_11u79_1",KB="_content_11u79_8",YB="_tabPanel_11u79_14",il={layout:qB,content:KB,tabPanel:YB};function FB(){const n=$O();return r.jsxs("div",{className:il.layout,children:[r.jsx(us,{segments:n}),r.jsx("div",{className:il.content,children:r.jsx(Ps,{})})]})}const ZB="_container_13sb6_1",XB="_envHeader_13sb6_6",QB="_envTitleRow_13sb6_10",WB="_statusDot_13sb6_16",JB="_envName_13sb6_21",e5="_statusBadge_13sb6_27",t5="_envMeta_13sb6_33",n5="_metaTag_13sb6_39",a5="_actions_13sb6_51",s5="_provisionMessage_13sb6_59",i5="_errorMessage_13sb6_64",o5="_section_13sb6_69",l5="_sectionHeader_13sb6_73",r5="_cardList_13sb6_121",c5="_card_13sb6_121",u5="_cardHeader_13sb6_138",d5="_cardName_13sb6_144",f5="_cardActions_13sb6_149",h5="_cardDescription_13sb6_154",m5="_cardMeta_13sb6_160",p5="_repoLink_13sb6_166",v5="_empty_13sb6_174",g5="_btnPrimary_13sb6_180",y5="_btnOutline_13sb6_214",b5="_btnSmall_13sb6_241",x5="_btnDanger_13sb6_267",Ue={container:ZB,envHeader:XB,envTitleRow:QB,statusDot:WB,envName:JB,statusBadge:e5,envMeta:t5,metaTag:n5,actions:a5,provisionMessage:s5,errorMessage:i5,section:o5,sectionHeader:l5,cardList:r5,card:c5,cardHeader:u5,cardName:d5,cardActions:f5,cardDescription:h5,cardMeta:m5,repoLink:p5,empty:v5,btnPrimary:g5,btnOutline:y5,btnSmall:b5,btnDanger:x5},S5={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function _5(){const{environmentId:n}=rs(),a=xt(),{environments:i,workspaces:l,sessions:c,provisionStatus:d,provisionEnvironment:f,stopEnvironment:m,removeEnvironment:p,archiveWorkspace:v}=ut(),[g,b]=y.useState(!1),[x,_]=y.useState(!1),[T,N]=y.useState(void 0),w=i.find(ie=>ie.id===n);if(!n||!w)return r.jsx(Hn,{to:Vi,replace:!0});const k=l.filter(ie=>ie.environmentId===w.id),C=c.filter(ie=>ie.environmentId===w.id),A=C.reduce((ie,le)=>ie+(le.costUsd??0),0),D=S5[w.status]||"var(--text-tertiary)",E=w.status==="connected",I=w.status==="connecting",z=w.status==="disconnected"||w.status==="error",U=w.id in d?d[w.id]:void 0,Y=()=>{p(w.id),b(!1),a(Vi,{replace:!0})},ae=()=>{_(!1),f(w.id,!0)},se=ie=>{v(ie),N(void 0)};return r.jsxs("div",{className:Ue.container,children:[r.jsx(Us,{isOpen:g,title:"Delete Environment?",description:`"${w.displayName||w.id}" will be permanently removed along with all its data.`,onConfirm:Y,onCancel:()=>b(!1)}),r.jsx(Us,{isOpen:x,title:"Reprovision Environment?",description:"This will kill any active session and force a fresh provision cycle. The environment will be temporarily disconnected.",confirmLabel:"Reprovision",onConfirm:ae,onCancel:()=>_(!1)}),r.jsxs("div",{className:Ue.envHeader,children:[r.jsxs("div",{className:Ue.envTitleRow,children:[r.jsx("span",{className:Ue.statusDot,style:{color:D},children:"●"}),r.jsx("h2",{className:Ue.envName,children:w.displayName||w.id}),r.jsx("span",{className:Ue.statusBadge,style:{color:D},children:w.status})]}),r.jsxs("div",{className:Ue.envMeta,children:[r.jsxs("span",{className:Ue.metaTag,children:["Adapter: ",w.adapterType]}),C.length>0&&r.jsxs("span",{className:Ue.metaTag,children:[C.length," session",C.length!==1?"s":""]}),A>0&&r.jsxs("span",{className:Ue.metaTag,children:["Cost: ",qi(A)]})]})]}),r.jsxs("div",{className:Ue.actions,children:[E&&r.jsxs(r.Fragment,{children:[r.jsx("button",{className:Ue.btnPrimary,onClick:()=>a(lb(w.id)),children:"New Chat"}),r.jsx("button",{className:Ue.btnOutline,onClick:()=>m(w.id),children:"Stop"}),r.jsx("button",{className:Ue.btnOutline,onClick:()=>_(!0),disabled:U!==void 0,"data-testid":"env-reprovision-btn",children:"Reprovision"})]}),z&&r.jsx("button",{className:Ue.btnPrimary,onClick:()=>f(w.id),children:w.status==="error"?"Retry":"Connect"}),I&&U!==void 0&&r.jsx("span",{className:Ue.provisionMessage,children:U.message}),w.status==="error"&&(U==null?void 0:U.stage)==="error"&&r.jsx("span",{className:Ue.errorMessage,children:U.message}),r.jsx("button",{className:Ue.btnOutline,onClick:()=>a(Uk(w.id)),"data-testid":"env-edit-btn",children:"Edit Config"}),r.jsx("button",{className:Ue.btnDanger,onClick:()=>b(!0),children:"Delete"})]}),r.jsxs("div",{className:Ue.section,children:[r.jsxs("div",{className:Ue.sectionHeader,children:[r.jsx("h3",{children:"Workspaces"}),r.jsx("button",{className:Ue.btnPrimary,onClick:()=>a(`${cb}?environment=${encodeURIComponent(w.id)}`),"data-testid":"workspace-create-button",children:"+ New Workspace"})]}),k.length===0&&r.jsx("p",{className:Ue.empty,children:"No workspaces yet. Create one to get started."}),r.jsx("div",{className:Ue.cardList,children:k.map(ie=>r.jsx(T5,{workspace:ie,confirmArchiveId:T,onOpen:()=>a(Ui(ie.id,w.id)),onArchive:()=>N(ie.id),onConfirmArchive:()=>se(ie.id),onCancelArchive:()=>N(void 0)},ie.id))})]})]})}function T5({workspace:n,confirmArchiveId:a,onOpen:i,onArchive:l,onConfirmArchive:c,onCancelArchive:d}){const f=a===n.id,m=n.repoUrl&&/^https?:\/\//.test(n.repoUrl);return r.jsxs("div",{className:Ue.card,"data-testid":"workspace-card",children:[r.jsxs("div",{className:Ue.cardHeader,children:[r.jsx("strong",{className:Ue.cardName,children:n.name}),r.jsxs("div",{className:Ue.cardActions,children:[r.jsx("button",{className:Ue.btnSmall,onClick:i,children:"Open"}),f?r.jsxs(r.Fragment,{children:[r.jsx("button",{className:Ue.btnDanger,onClick:c,children:"Confirm"}),r.jsx("button",{className:Ue.btnSmall,onClick:d,children:"Cancel"})]}):r.jsx("button",{className:Ue.btnSmall,onClick:l,children:"Archive"})]})]}),n.description&&r.jsx("p",{className:Ue.cardDescription,children:n.description}),n.repoUrl&&r.jsx("div",{className:Ue.cardMeta,children:m?r.jsx("a",{href:n.repoUrl,target:"_blank",rel:"noopener noreferrer",className:Ue.repoLink,children:n.repoUrl}):r.jsx("span",{children:n.repoUrl})})]})}const k5={credentials:"Credentials",personas:"Personas",appearance:"Appearance",about:"About",shortcuts:"Shortcuts"};function j5(){const a=Ot().pathname.replace(/^\/settings\/?/,"").split("/")[0],i=k5[a],l=GO(i);return r.jsxs("div",{className:il.layout,children:[r.jsx(us,{segments:l}),r.jsx("div",{className:il.content,children:r.jsx("div",{className:il.tabPanel,children:r.jsx(Ps,{})},a)})]})}const w5="_section_1ingb_14",N5="_sectionTitle_1ingb_26",C5="_sectionDescription_1ingb_35",E5="_tokenList_1ingb_48",A5="_tokenRow_1ingb_55",D5="_tokenBadge_1ingb_68",R5="_tokenName_1ingb_83",M5="_tokenTarget_1ingb_90",O5="_deleteButton_1ingb_99",B5="_addForm_1ingb_113",L5="_formRow_1ingb_119",I5="_input_1ingb_125",z5="_select_1ingb_155",U5="_addButton_1ingb_187",V5="_emptyStateInfo_1ingb_221",H5="_themeOptions_1ingb_229",P5="_themeOption_1ingb_229",G5="_themeOptionSelected_1ingb_254",$5="_themeOptionHeader_1ingb_259",q5="_themeOptionLabel_1ingb_266",K5="_themeOptionDesc_1ingb_273",Y5="_variantToggle_1ingb_279",F5="_variantButton_1ingb_286",Z5="_variantActive_1ingb_305",X5="_themeSwatches_1ingb_311",Q5="_themeSwatch_1ingb_311",W5="_systemToggle_1ingb_325",J5="_systemToggleHint_1ingb_341",eL="_themeActive_1ingb_348",tL="_aboutGrid_1ingb_354",nL="_aboutItem_1ingb_360",aL="_aboutLabel_1ingb_373",sL="_aboutValue_1ingb_379",iL="_aboutDot_1ingb_387",oL="_aboutDotConnected_1ingb_394",lL="_aboutDotDisconnected_1ingb_398",de={section:w5,sectionTitle:N5,sectionDescription:C5,tokenList:E5,tokenRow:A5,tokenBadge:D5,tokenName:R5,tokenTarget:M5,deleteButton:O5,addForm:B5,formRow:L5,input:I5,select:z5,addButton:U5,emptyStateInfo:V5,themeOptions:H5,themeOption:P5,themeOptionSelected:G5,themeOptionHeader:$5,themeOptionLabel:q5,themeOptionDesc:K5,variantToggle:Y5,variantButton:F5,variantActive:Z5,themeSwatches:X5,themeSwatch:Q5,systemToggle:W5,systemToggleHint:J5,themeActive:eL,aboutGrid:tL,aboutItem:nL,aboutLabel:aL,aboutValue:sL,aboutDot:iL,aboutDotConnected:oL,aboutDotDisconnected:lL},rL=[{key:"claude",label:"Claude",description:"Forward Claude credentials for AI agent access.",options:[{value:"off",label:"Off"},{value:"subscription",label:"Subscription"},{value:"api_key",label:"API Key"}]},{key:"github",label:"GitHub",description:"Forward GITHUB_TOKEN and GH_TOKEN for git operations.",options:[{value:"off",label:"Off"},{value:"on",label:"On"}]},{key:"copilot",label:"Copilot",description:"Forward Copilot tokens (COPILOT_GITHUB_TOKEN, CLI config).",options:[{value:"off",label:"Off"},{value:"on",label:"On"}]},{key:"codex",label:"Codex",description:"Forward OPENAI_API_KEY for Codex/OpenAI access.",options:[{value:"off",label:"Off"},{value:"on",label:"On"}]},{key:"goose",label:"Goose",description:"Forward Goose config and API keys for Goose agent access.",options:[{value:"off",label:"Off"},{value:"on",label:"On"}]}];function cL({credentialProviders:n,onUpdateCredentialProviders:a}){const i=(l,c)=>{const d={...n};l==="claude"?d.claude=c:d[l]=c,a(d)};return r.jsxs("section",{className:de.section,children:[r.jsx("h3",{className:de.sectionTitle,children:"Credential Providers"}),r.jsx("p",{className:de.sectionDescription,children:"Enable providers to automatically forward credentials to environments at task start. Credentials are read fresh from the host each time."}),r.jsx("div",{className:de.tokenList,children:rL.map(l=>r.jsxs("div",{className:de.tokenRow,children:[r.jsx("span",{className:de.tokenName,children:l.label}),r.jsx("span",{className:de.tokenTarget,children:l.description}),r.jsx("select",{className:de.select,value:n[l.key],onChange:c=>i(l.key,c.target.value),children:l.options.map(c=>r.jsx("option",{value:c.value,children:c.label},c.value))})]},l.key))})]})}const uL=[{value:"env_var",label:"Environment Variable"},{value:"file",label:"File"}];function dL({tokens:n,onSetToken:a,onDeleteToken:i}){const{showToast:l}=Na(),[c,d]=y.useState(""),[f,m]=y.useState(""),[p,v]=y.useState("env_var"),[g,b]=y.useState(""),[x,_]=y.useState(null),T=k=>{if(k.preventDefault(),!c||!f)return;const C=p==="env_var"?g||c.toUpperCase()+"_TOKEN":"";a(c,f,p,C,p==="file"?g:""),l("Token saved successfully","success"),d(""),m(""),b("")},N=k=>{_(k)},w=()=>{x&&(i(x),l("Token deleted","info")),_(null)};return r.jsxs(r.Fragment,{children:[r.jsx(Us,{isOpen:x!==null,title:"Delete Token?",description:x?`"${x}" will be permanently removed.`:void 0,onConfirm:w,onCancel:()=>_(null)}),r.jsxs("section",{className:de.section,children:[r.jsx("h3",{className:de.sectionTitle,children:"Tokens"}),r.jsx("p",{className:de.sectionDescription,children:"API tokens are auto-pushed to environments when set or updated. Values are write-only."}),n.length===0?r.jsx("div",{className:de.emptyStateInfo,children:"Add your first API token to enable service integrations."}):r.jsx("div",{className:de.tokenList,children:n.map(k=>r.jsxs("div",{className:de.tokenRow,children:[r.jsx("span",{className:de.tokenBadge,children:k.tokenType}),r.jsx("span",{className:de.tokenName,children:k.name}),r.jsx("span",{className:de.tokenTarget,children:k.tokenType==="env_var"?k.envVar:k.filePath}),r.jsx("button",{className:de.deleteButton,onClick:()=>N(k.name),title:`Delete ${k.name}`,children:"×"})]},k.name))}),r.jsxs("form",{className:de.addForm,onSubmit:T,children:[r.jsxs("div",{className:de.formRow,children:[r.jsx("input",{className:de.input,type:"text",placeholder:"Token name",value:c,onChange:k=>d(k.target.value)}),r.jsx("input",{className:de.input,type:"password",placeholder:"Value",value:f,onChange:k=>m(k.target.value)})]}),r.jsxs("div",{className:de.formRow,children:[r.jsx("select",{className:de.select,value:p,onChange:k=>v(k.target.value),children:uL.map(k=>r.jsx("option",{value:k.value,children:k.label},k.value))}),r.jsx("input",{className:de.input,type:"text",placeholder:p==="env_var"?"Env var name (e.g. API_TOKEN)":"File path (e.g. /home/user/.token)",value:g,onChange:k=>b(k.target.value)}),r.jsx("button",{className:de.addButton,type:"submit",children:"Add Token"})]})]})]})]})}function fL(){const{tokens:n,setToken:a,deleteToken:i,credentialProviders:l,updateCredentialProviders:c}=ut();return r.jsxs(r.Fragment,{children:[r.jsx(cL,{credentialProviders:l,onUpdateCredentialProviders:c}),r.jsx(dL,{tokens:n,onSetToken:a,onDeleteToken:i})]})}const hL="_container_10efq_1",mL="_header_10efq_7",pL="_form_10efq_19",vL="_formActions_10efq_87",gL="_editableSection_10efq_94",yL="_list_10efq_105",bL="_card_10efq_111",xL="_cardHeader_10efq_125",SL="_cardTitle_10efq_135",_L="_defaultBadge_10efq_141",TL="_cardActions_10efq_155",kL="_description_10efq_160",jL="_meta_10efq_166",wL="_empty_10efq_212",NL="_typeToggle_10efq_348",CL="_typeBadge_10efq_362",EL="_scriptEditor_10efq_376",AL="_optional_10efq_383",ht={container:hL,header:mL,form:pL,formActions:vL,editableSection:gL,list:yL,card:bL,cardHeader:xL,cardTitle:SL,defaultBadge:_L,cardActions:TL,description:kL,meta:jL,empty:wL,typeToggle:NL,typeBadge:CL,scriptEditor:EL,optional:AL};function DL({personas:n,appDefaultPersonaId:a,onDeletePersona:i,onSetAppDefaultPersonaId:l,onNavigateToNew:c,onNavigateToPersona:d}){const[f,m]=y.useState(null),p=f?n.find(g=>g.id===f):void 0,v=async g=>{await i(g),m(null)};return r.jsxs("div",{className:ht.container,children:[r.jsxs("div",{className:ht.header,children:[r.jsx("h2",{children:"Personas"}),r.jsx(Sa,{variant:"primary",size:"md",onClick:c,"data-testid":"persona-new-button",children:"+ New Persona"})]}),n.length===0?r.jsx("p",{className:ht.empty,children:"No personas yet. Create one to get started."}):r.jsx("div",{className:ht.list,children:n.map(g=>{const b=a===g.id,x=g.type==="script";return r.jsxs("div",{className:ht.card,"data-testid":`persona-card-${g.id}`,onClick:()=>d(g.id),role:"button",tabIndex:0,onKeyDown:_=>{_.currentTarget===_.target&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),d(g.id))},children:[r.jsxs("div",{className:ht.cardHeader,children:[r.jsxs("span",{className:ht.cardTitle,children:[r.jsx("strong",{children:g.name}),r.jsx("span",{className:ht.typeBadge,"data-testid":`persona-type-badge-${g.id}`,children:x?"Script":"Agent"}),b&&r.jsx("span",{className:ht.defaultBadge,"data-testid":`persona-default-badge-${g.id}`,children:"App Default"})]}),r.jsxs("div",{className:ht.cardActions,onClick:_=>_.stopPropagation(),children:[!b&&r.jsx(Sa,{variant:"ghost",size:"sm",onClick:()=>{l(g.id).catch(()=>{})},"data-testid":`persona-set-default-${g.id}`,title:"Set as app default persona",children:"Set Default"}),r.jsx(Sa,{variant:"ghost",size:"sm",onClick:()=>d(g.id),children:"Edit"}),r.jsx(Sa,{variant:"ghost",size:"sm",onClick:()=>m(g.id),"data-testid":`persona-delete-${g.id}`,children:"Delete"})]})]}),g.description&&r.jsx("p",{className:ht.description,children:g.description}),r.jsxs("div",{className:ht.meta,children:[g.runtime&&r.jsxs("span",{children:["Runtime: ",g.runtime]}),g.model&&r.jsxs("span",{children:["Model: ",g.model]}),g.maxTurns>0&&r.jsxs("span",{children:["Max turns: ",g.maxTurns]})]})]},g.id)})}),r.jsx(Us,{isOpen:f!==null,title:"Delete Persona?",description:`"${(p==null?void 0:p.name)??""}" will be permanently removed.`,confirmLabel:"Delete",onConfirm:()=>{f&&v(f).catch(()=>{})},onCancel:()=>m(null)})]})}function RL(){const{personas:n,deletePersona:a,appDefaultPersonaId:i,setAppDefaultPersonaId:l}=ut(),{showToast:c}=Na(),d=xt();return r.jsx(DL,{personas:n,appDefaultPersonaId:i,onDeletePersona:async f=>{try{await a(f)}catch(m){throw console.error("Failed to delete persona",{personaId:f,error:m}),c("Failed to delete persona","error"),m}},onSetAppDefaultPersonaId:async f=>{try{await l(f)}catch(m){console.error("Failed to set app default persona ID",{personaId:f,error:m}),c("Failed to set app default persona","error")}},onNavigateToNew:()=>d(Hk),onNavigateToPersona:f=>d(rb(f))})}const O0=[{value:"claude-code",label:"claude-code"},{value:"codex",label:"codex"},{value:"copilot",label:"copilot"},{value:"goose",label:"goose"},{value:"stub",label:"stub"},{value:"claude-code-acp",label:"claude-code-acp (experimental)"},{value:"codex-acp",label:"codex-acp (experimental)"},{value:"copilot-acp",label:"copilot-acp (experimental)"}],B0=[{value:"genaiscript",label:"genaiscript"}],ML="0";function L0(){const{personaId:n}=rs(),a=xt(),{showToast:i}=Na(),{personas:l,createPersona:c,updatePersona:d,deletePersona:f,appDefaultPersonaId:m,setAppDefaultPersonaId:p}=ut(),v=n===void 0,g=v?void 0:l.find(x=>x.id===n);if(!v&&l.length>0&&!g)return r.jsx(Hn,{to:Gd,replace:!0});const b=[{label:"Settings",url:zi},{label:"Personas",url:Gd},{label:v?"New Persona":(g==null?void 0:g.name)??"Persona",url:void 0}];return r.jsxs("div",{className:ht.container,children:[r.jsx(us,{segments:b}),r.jsx(OL,{existing:g,isNew:v,appDefaultPersonaId:m,onCreatePersona:c,onUpdatePersona:d,onDeletePersona:f,onSetAppDefaultPersonaId:p,onDone:()=>{a(Gd)},showToast:i})]})}function OL({existing:n,isNew:a,appDefaultPersonaId:i,onCreatePersona:l,onUpdatePersona:c,onDeletePersona:d,onSetAppDefaultPersonaId:f,onDone:m,showToast:p}){const v=xt(),[g,b]=y.useState((n==null?void 0:n.name)??""),[x,_]=y.useState((n==null?void 0:n.description)??""),[T,N]=y.useState((n==null?void 0:n.systemPrompt)??""),[w,k]=y.useState((n==null?void 0:n.runtime)??"claude-code"),[C,A]=y.useState((n==null?void 0:n.model)??"sonnet"),[D,E]=y.useState((n==null?void 0:n.maxTurns)??0),[I,z]=y.useState((n==null?void 0:n.type)==="script"?"script":"agent"),[U,Y]=y.useState((n==null?void 0:n.script)??""),[ae,se]=y.useState(!1),[ie,le]=y.useState(null),[q,te]=y.useState(!!a);y.useEffect(()=>{if(!a&&n&&!q){te(!0),b(n.name),_(n.description),N(n.systemPrompt);const ee=n.type==="script"?"script":"agent";k(ee==="script"?n.runtime||"genaiscript":n.runtime),A(n.model),E(n.maxTurns),z(ee),Y(n.script||"")}},[a,n,q]);const O=ee=>{z(ee),ee==="script"?k("genaiscript"):w==="genaiscript"&&k("claude-code")},P=!a&&n===void 0,W=g.trim().length>0&&!P&&T.trim().length>0&&(I==="script"?U.trim().length>0:!!w&&!!C),re=a&&W,oe=!a&&i===(n==null?void 0:n.id),Ce=!a&&n&&!oe&&I==="agent"&&!!w&&!!C,je=(ee,X)=>{if(!ee.trim())return`${X} is required`},Se=ee=>{if(ee.preventDefault(),!(P||!W)){if(n){c(n.id,g,x,T,w,C,D,I,U).then(()=>{p("Persona updated","success"),m()},()=>{p("Failed to save persona","error")});return}l(g,x,T,w,C,D,I,U).then(X=>{p("Persona created","success"),v(rb(X.id),{replace:!0})},()=>{p("Failed to save persona","error")})}},Le=()=>{n&&d(n.id).then(()=>{p("Persona deleted","success"),m()},()=>{p("Failed to delete persona","error")})},ce=async(ee,X,At,pt)=>ee().then(()=>{X(),p(At,"success")},()=>{p(pt,"error")}),ue=(ee,X)=>{if(!n)return;const At=ee==="type"?String(X):I,pt=ee==="runtime"?String(X):ee==="type"?String(X)==="script"?"genaiscript":w==="genaiscript"?"claude-code":w:w,yn=ee==="model"?String(X):C,Ke=ee==="maxTurns"?Number(X):D,Pn=ee==="systemPrompt"?String(X):T,Gn=ee==="script"?String(X):U;ce(()=>c(n.id,ee==="name"?String(X):g,ee==="description"?String(X):x,Pn,pt,yn,Ke,At,Gn),()=>{if(ee==="type"){const Bn=String(X)==="script"?"script":"agent";z(Bn),k(pt)}ee==="runtime"&&k(String(X)),ee==="name"&&b(String(X)),ee==="description"&&_(String(X)),ee==="systemPrompt"&&N(String(X)),ee==="model"&&A(String(X)),ee==="maxTurns"&&E(Number(X)),ee==="script"&&Y(String(X))},"Persona updated","Failed to update persona").catch(()=>{})},fe=ee=>{Se(ee)},tt=()=>{n&&f(n.id).then(()=>{p("Set as app default","success")},()=>{p("Failed to set app default","error")})};return r.jsxs(r.Fragment,{children:[P?r.jsxs("div",{className:ht.form,children:[r.jsx("h3",{children:"Edit Persona"}),r.jsx("p",{children:"Loading persona..."})]}):a?r.jsxs("form",{onSubmit:fe,className:ht.form,children:[r.jsx("h3",{children:"Create Persona"}),r.jsxs("div",{className:ht.typeToggle,"data-testid":"persona-type-toggle",children:[r.jsxs("label",{children:[r.jsx("input",{type:"radio",name:"personaType",value:"agent",checked:I==="agent",onChange:()=>O("agent")}),"Agent"]}),r.jsxs("label",{children:[r.jsx("input",{type:"radio",name:"personaType",value:"script",checked:I==="script",onChange:()=>O("script")}),"Script"]})]}),r.jsxs("label",{children:["Name",r.jsx("input",{type:"text",value:g,onChange:ee=>b(ee.target.value),placeholder:I==="script"?"e.g. Nightly Report":"e.g. Frontend Engineer",required:!0,"data-testid":"persona-detail-name"})]}),r.jsxs("label",{children:["Description",r.jsx("input",{type:"text",value:x,onChange:ee=>_(ee.target.value),placeholder:"Brief description...","data-testid":"persona-detail-description"})]}),r.jsxs("label",{children:["Runtime",r.jsx("select",{value:w,onChange:ee=>k(ee.target.value),"data-testid":"persona-runtime-select",children:(I==="script"?B0:O0).map(ee=>r.jsx("option",{value:ee.value,children:ee.label},ee.value))})]}),I==="agent"&&r.jsxs(r.Fragment,{children:[r.jsxs("label",{children:["Model",r.jsx("input",{type:"text",value:C,onChange:ee=>A(ee.target.value),placeholder:"e.g. sonnet","data-testid":"persona-detail-model"})]}),r.jsxs("label",{children:["Max Turns",r.jsx("input",{type:"number",value:D,onChange:ee=>E(parseInt(ee.target.value,10)||0),min:0,"data-testid":"persona-detail-max-turns"})]}),r.jsxs("label",{children:["System Prompt",r.jsx("textarea",{value:T,onChange:ee=>N(ee.target.value),placeholder:"You are a senior frontend engineer...",rows:10,required:!0,"data-testid":"persona-detail-prompt"})]})]}),I==="script"&&r.jsxs(r.Fragment,{children:[r.jsxs("label",{children:["Model ",r.jsx("span",{className:ht.optional,children:"(optional)"}),r.jsx("input",{type:"text",value:C,onChange:ee=>A(ee.target.value),placeholder:"e.g. sonnet (leave empty for script-only)","data-testid":"persona-detail-model"})]}),r.jsxs("label",{children:["System Prompt",r.jsx("textarea",{value:T,onChange:ee=>N(ee.target.value),placeholder:"Context for the script...",rows:4,required:!0,"data-testid":"persona-detail-prompt"})]}),r.jsxs("label",{children:["Script",r.jsx("textarea",{value:U,onChange:ee=>Y(ee.target.value),placeholder:`script({ model: "openai:gpt-4o" });
|
|
106
|
+
|
|
107
|
+
const grackle = await host.mcpServer({
|
|
108
|
+
id: "grackle",
|
|
109
|
+
url: env.vars.GRACKLE_MCP_URL,
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
$\`Summarize the current tasks.\`;`,rows:20,className:ht.scriptEditor,required:!0,"data-testid":"persona-script-editor"})]})]}),r.jsxs("div",{className:ht.formActions,children:[r.jsx(Sa,{type:"submit",variant:"primary",size:"md",disabled:!re,"data-testid":"persona-detail-save",children:"Create"}),r.jsx(Sa,{type:"button",variant:"outline",size:"md",onClick:m,"data-testid":"persona-detail-cancel",children:"Cancel"})]})]}):n?r.jsxs("div",{className:ht.form,children:[r.jsx("h3",{children:"Edit Persona"}),r.jsxs("div",{className:ht.formActions,children:[r.jsx(Sa,{type:"button",variant:"outline",size:"md",onClick:m,"data-testid":"persona-detail-cancel",children:"Back to Personas"}),Ce&&r.jsx(Sa,{type:"button",variant:"ghost",size:"md",onClick:tt,"data-testid":"persona-detail-set-default",children:"Set as App Default"}),oe&&r.jsx("span",{className:ht.defaultBadge,children:"App Default"}),r.jsx(Sa,{type:"button",variant:"danger",size:"md",onClick:()=>se(!0),"data-testid":"persona-detail-delete",children:"Delete"})]}),r.jsxs("div",{className:ht.editableSection,children:[r.jsxs("label",{children:["Name",r.jsx(qt,{value:g,onSave:ee=>{ue("name",ee)},validate:ee=>je(ee,"Name"),fieldId:"persona-name",activeFieldId:ie,onActivate:le,ariaLabel:"Persona name","data-testid":"persona-detail-name"})]}),r.jsxs("label",{children:["Description",r.jsx(qt,{value:x,onSave:ee=>{ue("description",ee)},fieldId:"persona-description",activeFieldId:ie,onActivate:le,placeholder:"Brief description...",ariaLabel:"Persona description","data-testid":"persona-detail-description"})]}),r.jsxs("label",{children:["Type",r.jsx(fc,{value:I,onSave:ee=>{ue("type",ee)},options:[{value:"agent",label:"Agent"},{value:"script",label:"Script"}],fieldId:"persona-type",activeFieldId:ie,onActivate:le,ariaLabel:"Persona type","data-testid":"persona-type-toggle"})]}),r.jsxs("label",{children:["Runtime",r.jsx(fc,{value:w,onSave:ee=>{ue("runtime",ee)},options:I==="script"?B0:O0,fieldId:"persona-runtime",activeFieldId:ie,onActivate:le,ariaLabel:"Persona runtime","data-testid":"persona-runtime"})]}),r.jsxs("label",{children:["Model",I==="script"?" (optional)":"",r.jsx(qt,{value:C,onSave:ee=>{ue("model",ee)},validate:I==="agent"?ee=>je(ee,"Model"):void 0,fieldId:"persona-model",activeFieldId:ie,onActivate:le,placeholder:I==="script"?"e.g. sonnet (leave empty for script-only)":"e.g. sonnet",ariaLabel:"Persona model","data-testid":"persona-detail-model"})]}),r.jsxs("label",{children:["Max Turns",r.jsx(qt,{value:String(D),onSave:ee=>{ue("maxTurns",parseInt(ee,10)||0)},validate:ee=>/^\d+$/.test(ee.trim())?void 0:"Max Turns must be a non-negative integer",fieldId:"persona-max-turns",activeFieldId:ie,onActivate:le,placeholder:ML,ariaLabel:"Persona max turns","data-testid":"persona-detail-max-turns"})]}),r.jsxs("label",{children:["System Prompt",r.jsx(Vf,{value:T,onSave:ee=>{ue("systemPrompt",ee)},validate:ee=>je(ee,"System Prompt"),fieldId:"persona-system-prompt",activeFieldId:ie,onActivate:le,placeholder:I==="script"?"Context for the script...":"You are a senior frontend engineer...",ariaLabel:"Persona system prompt","data-testid":"persona-detail-prompt"})]}),I==="script"&&r.jsxs("label",{children:["Script",r.jsx(Vf,{value:U,onSave:ee=>{ue("script",ee)},validate:ee=>je(ee,"Script"),fieldId:"persona-script",activeFieldId:ie,onActivate:le,placeholder:`script({ model: "openai:gpt-4o" });
|
|
113
|
+
|
|
114
|
+
const grackle = await host.mcpServer({
|
|
115
|
+
id: "grackle",
|
|
116
|
+
url: env.vars.GRACKLE_MCP_URL,
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
$\`Summarize the current tasks.\`;`,ariaLabel:"Persona script","data-testid":"persona-script-editor"})]})]}),!Ce&&!oe&&r.jsx("p",{style:{fontSize:"var(--font-size-xs)",color:"var(--text-tertiary)",marginTop:"var(--space-xs)"},children:"Only agent personas with a runtime and model can be set as app default."})]}):null,r.jsx(Us,{isOpen:ae,title:"Delete Persona?",description:`"${n==null?void 0:n.name}" will be permanently removed.`,confirmLabel:"Delete",onConfirm:Le,onCancel:()=>se(!1)})]})}function BL(){const{themeId:n,resolvedThemeId:a,setTheme:i,preferSystem:l,setPreferSystem:c}=gb();return r.jsxs("section",{className:de.section,children:[r.jsx("h3",{className:de.sectionTitle,children:"Appearance"}),r.jsx("p",{className:de.sectionDescription,children:"Choose how Grackle looks across the app."}),r.jsx("div",{className:de.themeOptions,children:gc.filter(d=>!d.hidden).map(d=>{const f=!!(d.variantLightId&&d.variantDarkId),m=f?n===d.id||n===d.variantLightId||n===d.variantDarkId:n===d.id,p=f&&a===d.variantLightId;return r.jsxs("button",{type:"button",className:`${de.themeOption} ${m?de.themeOptionSelected:""}`,"aria-pressed":m,onClick:()=>i(d.id),children:[r.jsxs("span",{className:de.themeOptionHeader,children:[r.jsxs("span",{children:[r.jsx("span",{className:de.themeOptionLabel,children:d.label}),r.jsx("span",{className:de.themeOptionDesc,children:d.description})]}),f&&r.jsxs("span",{className:de.variantToggle,children:[r.jsx("span",{role:"button",tabIndex:0,className:`${de.variantButton} ${m&&p?de.variantActive:""}`,onClick:v=>{v.stopPropagation(),c(!1),i(d.variantLightId)},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),v.stopPropagation(),c(!1),i(d.variantLightId))},"aria-label":"Light variant","aria-pressed":m&&p,children:"☼"}),r.jsx("span",{role:"button",tabIndex:0,className:`${de.variantButton} ${m&&!p?de.variantActive:""}`,onClick:v=>{v.stopPropagation(),c(!1),i(d.variantDarkId)},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),v.stopPropagation(),c(!1),i(d.variantDarkId))},"aria-label":"Dark variant","aria-pressed":m&&!p,children:"☾"})]})]}),d.swatches&&r.jsx("span",{className:de.themeSwatches,children:d.swatches.map((v,g)=>r.jsx("span",{className:de.themeSwatch,style:{background:v}},g))})]},d.id)})}),r.jsxs("label",{className:de.systemToggle,children:[r.jsx("input",{type:"checkbox",checked:l,onChange:d=>c(d.target.checked)}),r.jsx("span",{children:"Match system light/dark preference"})]}),r.jsx("p",{className:de.systemToggleHint,children:"Automatically switches between light and dark variants when available."}),r.jsxs("p",{className:de.themeActive,children:["Active theme: ",r.jsx("strong",{children:a})]})]})}function LL(){return r.jsx(BL,{})}function IL({connected:n,environments:a,sessions:i}){const l=a.filter(f=>f.status==="connected").length,c=a.length,d=i.filter(f=>["running","idle"].includes(f.status)).length;return r.jsxs("section",{className:de.section,"data-testid":"about-panel",children:[r.jsx("h3",{className:de.sectionTitle,children:"About"}),r.jsx("p",{className:de.sectionDescription,children:"Connection status and application information."}),r.jsxs("div",{className:de.aboutGrid,children:[r.jsxs("div",{className:de.aboutItem,children:[r.jsx("span",{className:de.aboutLabel,children:"Connection"}),r.jsxs("span",{className:de.aboutValue,children:[r.jsx("span",{className:`${de.aboutDot} ${n?de.aboutDotConnected:de.aboutDotDisconnected}`}),n?"Connected":"Disconnected"]})]}),r.jsxs("div",{className:de.aboutItem,children:[r.jsx("span",{className:de.aboutLabel,children:"Environments"}),r.jsxs("span",{className:de.aboutValue,children:[l,"/",c," connected"]})]}),r.jsxs("div",{className:de.aboutItem,children:[r.jsx("span",{className:de.aboutLabel,children:"Active Sessions"}),r.jsx("span",{className:de.aboutValue,children:d})]}),r.jsxs("div",{className:de.aboutItem,children:[r.jsx("span",{className:de.aboutLabel,children:"Version"}),r.jsx("span",{className:de.aboutValue,children:"0.76.1"})]})]})]})}function zL(){const{connected:n,environments:a,sessions:i}=ut();return r.jsx(IL,{connected:n,environments:a,sessions:i})}const UL="_group_1iprv_1",VL="_groupTitle_1iprv_8",HL="_shortcutList_1iprv_17",PL="_shortcutRow_1iprv_23",GL="_keys_1iprv_36",$L="_kbd_1iprv_43",qL="_description_1iprv_60",Rs={group:UL,groupTitle:VL,shortcutList:HL,shortcutRow:PL,keys:GL,kbd:$L,description:qL},KL=[{title:"Global",shortcuts:[{keys:["?"],description:"Open keyboard shortcuts reference"},{keys:["N"],description:"Create a new task"},{keys:["Escape"],description:"Close dialog or cancel editing"}]},{title:"Task Page",shortcuts:[{keys:["1"],description:"Switch to Overview tab"},{keys:["2"],description:"Switch to Stream tab"},{keys:["3"],description:"Switch to Findings tab"}]},{title:"Workspace Page",shortcuts:[{keys:["1"],description:"Switch to Graph view"},{keys:["2"],description:"Switch to Board view"},{keys:["3"],description:"Switch to Tasks view"}]},{title:"Navigation Lists",shortcuts:[{keys:["←"],description:"Previous tab (horizontal nav)"},{keys:["→"],description:"Next tab (horizontal nav)"},{keys:["↑"],description:"Previous item (vertical nav)"},{keys:["↓"],description:"Next item (vertical nav)"},{keys:["J"],description:"Next item (alias for arrow down/right)"},{keys:["K"],description:"Previous item (alias for arrow up/left)"},{keys:["Home"],description:"Jump to first item"},{keys:["End"],description:"Jump to last item"}]},{title:"Editing",shortcuts:[{keys:["Enter"],description:"Activate / save inline edit"},{keys:["Space"],description:"Activate button or start editing"},{keys:["Escape"],description:"Cancel edit and discard changes"}]},{title:"Chat",shortcuts:[{keys:["Enter"],description:"Send message (when input is focused)"}]}];function YL(){return r.jsxs("section",{className:de.section,"data-testid":"keyboard-shortcuts-panel",children:[r.jsx("h3",{className:de.sectionTitle,children:"Keyboard Shortcuts"}),r.jsx("p",{className:de.sectionDescription,children:"Keyboard shortcuts for navigating and interacting with Grackle. Global shortcuts are suppressed while typing in text fields."}),KL.map(n=>r.jsxs("div",{className:Rs.group,children:[r.jsx("h4",{className:Rs.groupTitle,children:n.title}),r.jsx("div",{className:Rs.shortcutList,children:n.shortcuts.map(a=>r.jsxs("div",{className:Rs.shortcutRow,children:[r.jsx("span",{className:Rs.keys,children:a.keys.map(i=>r.jsx("kbd",{className:Rs.kbd,children:i},i))}),r.jsx("span",{className:Rs.description,children:a.description})]},a.description))})]},n.title))]})}function FL(){return r.jsx(YL,{})}const I0=Gs();function ZL(){const n=xt();return ka({key:"?"},()=>{n(Pk)}),ka({key:"n"},()=>{n(I0)}),ka({key:"N"},()=>{n(I0)}),r.jsx(r.Fragment,{})}const XL="_wizard_1260s_1",QL="_container_1260s_10",WL="_stepContent_1260s_19",JL="_logoArea_1260s_28",eI="_logoImage_1260s_32",tI="_heading_1260s_41",nI="_tagline_1260s_49",aI="_subtitle_1260s_56",sI="_featureList_1260s_64",iI="_runtimeGrid_1260s_89",oI="_runtimeCard_1260s_101",lI="_runtimeName_1260s_133",rI="_runtimeDescription_1260s_139",cI="_buttonRow_1260s_144",uI="_primaryButton_1260s_151",dI="_ghostButton_1260s_185",fI="_dots_1260s_213",hI="_dot_1260s_213",st={wizard:XL,container:QL,stepContent:WL,logoArea:JL,logoImage:eI,heading:tI,tagline:nI,subtitle:aI,featureList:sI,runtimeGrid:iI,runtimeCard:oI,runtimeName:lI,runtimeDescription:rI,buttonRow:cI,primaryButton:uI,ghostButton:dI,dots:fI,dot:hI};function mI({onNext:n}){return r.jsxs("div",{className:st.stepContent,"data-testid":"setup-welcome",children:[r.jsx("div",{className:st.logoArea,children:r.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:st.logoImage})}),r.jsx("h1",{className:st.heading,children:"Welcome to Grackle"}),r.jsx("p",{className:st.tagline,children:"Multi-agent orchestration for software teams"}),r.jsx("button",{type:"button",className:st.primaryButton,onClick:n,"data-testid":"setup-get-started",children:"Get Started"})]})}function pI({onNext:n,onBack:a}){return r.jsxs("div",{className:st.stepContent,"data-testid":"setup-about",children:[r.jsx("h2",{className:st.heading,children:"What is Grackle?"}),r.jsxs("ul",{className:st.featureList,children:[r.jsx("li",{children:"Run Claude, Copilot, and Codex agents side by side"}),r.jsx("li",{children:"Provision and control dev environments — SSH, Codespaces, or local"}),r.jsx("li",{children:"Organize work into workspaces with agent-executable tasks"}),r.jsx("li",{children:"Customize agent behavior with personas, tools, and MCP servers"}),r.jsx("li",{children:"Live-stream agent sessions with full terminal replay"})]}),r.jsxs("div",{className:st.buttonRow,children:[r.jsx("button",{type:"button",className:st.ghostButton,onClick:a,children:"Back"}),r.jsx("button",{type:"button",className:st.primaryButton,onClick:n,"data-testid":"setup-about-next",children:"Next"})]})]})}const vI=[{id:"claude-code",name:"Claude Code",description:"Anthropic's agentic coding tool"},{id:"copilot",name:"Copilot Coding Agent",description:"GitHub's AI pair programmer"},{id:"codex",name:"Codex CLI",description:"OpenAI's coding agent"},{id:"goose",name:"Goose",description:"Block's open-source AI coding agent"}];function gI({currentRuntime:n,onFinish:a,onBack:i,finishDisabled:l}){const[c,d]=y.useState(n||"claude-code");return y.useEffect(()=>{n&&d(n)},[n]),r.jsxs("div",{className:st.stepContent,"data-testid":"setup-runtime",children:[r.jsx("h2",{className:st.heading,children:"Choose Your Runtime"}),r.jsx("p",{className:st.subtitle,children:"Select the primary agent runtime for your workspace. You can change this later."}),r.jsx("div",{className:st.runtimeGrid,children:vI.map(f=>r.jsxs("button",{type:"button",className:st.runtimeCard,"data-selected":c===f.id,"aria-pressed":c===f.id,"data-testid":`runtime-card-${f.id}`,onClick:()=>d(f.id),children:[r.jsx("span",{className:st.runtimeName,children:f.name}),r.jsx("span",{className:st.runtimeDescription,children:f.description})]},f.id))}),r.jsxs("div",{className:st.buttonRow,children:[r.jsx("button",{type:"button",className:st.ghostButton,onClick:i,children:"Back"}),r.jsx("button",{type:"button",className:st.primaryButton,onClick:()=>a(c),disabled:l,"data-testid":"setup-finish",children:"Finish"})]})]})}const yI=3,z0={"claude-code":"sonnet",copilot:"gpt-4o",codex:"o3",goose:""};function bI(){const{personas:n,updatePersona:a,completeOnboarding:i,onboardingCompleted:l}=ut(),c=xt(),[d,f]=y.useState(0),m=n.find(v=>v.id==="claude-code"),p=y.useCallback(v=>{if(m&&v!==m.runtime){const b=z0[v]??"sonnet";a(m.id,void 0,void 0,void 0,v,b).catch(()=>{})}const g=n.find(b=>b.id===zg);if(g&&v!==g.runtime){const b=z0[v]??"sonnet";a(zg,void 0,void 0,void 0,v,b).catch(()=>{})}i(),c("/",{replace:!0})},[m,n,a,i,c]);return l===!0?r.jsx(Hn,{to:"/",replace:!0}):r.jsx("div",{className:st.wizard,"data-testid":"setup-wizard",children:r.jsxs("div",{className:st.container,children:[r.jsx(ea,{mode:"wait",children:r.jsxs(Et.div,{initial:{opacity:0,x:40},animate:{opacity:1,x:0},exit:{opacity:0,x:-40},transition:{duration:.2,ease:"easeInOut"},children:[d===0&&r.jsx(mI,{onNext:()=>f(1)}),d===1&&r.jsx(pI,{onNext:()=>f(2),onBack:()=>f(0)}),d===2&&r.jsx(gI,{currentRuntime:(m==null?void 0:m.runtime)??"claude-code",onFinish:p,onBack:()=>f(1),finishDisabled:!m})]},d)}),r.jsx("div",{className:st.dots,children:Array.from({length:yI},(v,g)=>r.jsx("span",{className:st.dot,"data-active":g===d},g))})]})})}const xI="_root_zndgp_1",SI="_body_zndgp_7",_I="_main_zndgp_19",TI="_sidebarWrapper_zndgp_26",kI="_overlay_zndgp_51",Jo={root:xI,body:SI,main:_I,sidebarWrapper:TI,overlay:kI},jI=y.lazy(()=>W1(()=>import("./KnowledgePage-C7AWqnpx.js"),__vite__mapDeps([0,1,2,3,4])).then(n=>({default:n.KnowledgePage}))),wI=typeof window<"u"&&new URLSearchParams(window.location.search).has("mock");function NI(){const{connected:n,environments:a,sessions:i,tasks:l}=ut(),c=Ot(),f=xb()!==void 0,[m,p]=y.useState(!1),v=y.useCallback(()=>p(g=>!g),[]);return y.useEffect(()=>{p(!1)},[c.pathname]),y.useEffect(()=>{if(!m)return;const g=b=>{b.key==="Escape"&&p(!1)};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[m]),r.jsxs(r.Fragment,{children:[r.jsx(Hj,{connected:n,environments:a,sessions:i,onToggleSidebar:f?v:void 0,sidebarOpen:m}),r.jsx(Fj,{}),r.jsxs("div",{className:Jo.body,children:[f&&r.jsx("div",{className:Jo.sidebarWrapper,"data-sidebar-open":m,children:r.jsx(nw,{})}),f&&m&&r.jsx("div",{className:Jo.overlay,"data-testid":"drawer-overlay",onClick:()=>p(!1)}),r.jsxs("div",{className:Jo.main,children:[r.jsx(Ps,{}),r.jsx(WA,{sessions:i,tasks:l,environments:a})]})]}),r.jsx(dD,{}),r.jsx(ZL,{})]})}function CI(){const{lastSpawnedId:n,environments:a,tasks:i,connected:l,onboardingCompleted:c}=ut(),{showToast:d}=Na();BR(a,d),UR(i,d);const f=xt(),m=Ot();return y.useEffect(()=>{n&&!m.pathname.includes("/tasks/")&&f(ob(n),{replace:!0})},[n,f,m.pathname]),l&&c===!1?r.jsx(Hn,{to:"/setup",replace:!0}):r.jsx(Zj,{children:r.jsx("div",{className:Jo.root,children:r.jsx(NI,{})})})}function mf(){const{workspaceId:n}=rs(),{workspaces:a}=ut(),i=Ot(),l=a.find(p=>p.id===n);if(!(l!=null&&l.environmentId))return a.length===0?void 0:r.jsx(Hn,{to:"/environments",replace:!0});const c=encodeURIComponent(n),d=`/workspaces/${c}`,f=i.pathname.startsWith(d)?i.pathname.slice(d.length):"",m=`/environments/${encodeURIComponent(l.environmentId)}/workspaces/${c}${f}${i.search}${i.hash}`;return r.jsx(Hn,{to:m,replace:!0})}function EI(){return r.jsxs(ak,{children:[r.jsx(ke,{path:"setup",element:r.jsx(bI,{})}),r.jsxs(ke,{element:r.jsx(CI,{}),children:[r.jsx(ke,{index:!0,element:r.jsx(fO,{})}),r.jsx(ke,{path:"chat",element:r.jsx(HO,{})}),r.jsx(ke,{path:"sessions/new",element:r.jsx(ZO,{})}),r.jsx(ke,{path:"sessions/:sessionId",element:r.jsx(WO,{})}),r.jsx(ke,{element:r.jsx($A,{}),children:r.jsx(ke,{path:"knowledge",element:r.jsx(y.Suspense,{fallback:r.jsx(iS,{}),children:r.jsx(jI,{})})})}),r.jsxs(ke,{element:r.jsx(HA,{}),children:[r.jsx(ke,{path:"tasks",element:r.jsx(uO,{})}),r.jsx(ke,{path:"tasks/new",element:r.jsx(D0,{})}),r.jsx(ke,{path:"tasks/:taskId",element:r.jsx(as,{})}),r.jsx(ke,{path:"tasks/:taskId/edit",element:r.jsx(as,{})}),r.jsx(ke,{path:"tasks/:taskId/stream",element:r.jsx(as,{})}),r.jsx(ke,{path:"tasks/:taskId/findings",element:r.jsx(as,{})})]}),r.jsxs(ke,{element:r.jsx(PA,{}),children:[r.jsx(ke,{path:"workspaces",element:r.jsx(Hn,{to:"/environments",replace:!0})}),r.jsx(ke,{path:"workspaces/new",element:r.jsx(eB,{})}),r.jsx(ke,{path:"workspaces/:workspaceId",element:r.jsx(mf,{})}),r.jsx(ke,{path:"workspaces/:workspaceId/tasks/:taskId",element:r.jsx(mf,{})}),r.jsx(ke,{path:"workspaces/:workspaceId/tasks/:taskId/*",element:r.jsx(mf,{})}),r.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId",element:r.jsx(y4,{})}),r.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/new",element:r.jsx(D0,{})}),r.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId",element:r.jsx(as,{})}),r.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit",element:r.jsx(as,{})}),r.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream",element:r.jsx(as,{})}),r.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings",element:r.jsx(as,{})}),r.jsxs(ke,{path:"environments",element:r.jsx(FB,{}),children:[r.jsx(ke,{index:!0,element:r.jsx(dO,{})}),r.jsx(ke,{path:"new",element:r.jsx(GB,{})}),r.jsx(ke,{path:":environmentId",element:r.jsx(_5,{})}),r.jsx(ke,{path:":environmentId/edit",element:r.jsx($B,{})})]})]}),r.jsx(ke,{element:r.jsx(GA,{}),children:r.jsxs(ke,{path:"settings",element:r.jsx(j5,{}),children:[r.jsx(ke,{index:!0,element:r.jsx(Hn,{to:"credentials",replace:!0})}),r.jsx(ke,{path:"environments",element:r.jsx(Hn,{to:"/environments",replace:!0})}),r.jsx(ke,{path:"credentials",element:r.jsx(fL,{})}),r.jsx(ke,{path:"tokens",element:r.jsx(Hn,{to:"../credentials",replace:!0})}),r.jsx(ke,{path:"personas",element:r.jsx(RL,{})}),r.jsx(ke,{path:"personas/new",element:r.jsx(L0,{})}),r.jsx(ke,{path:"personas/:personaId",element:r.jsx(L0,{})}),r.jsx(ke,{path:"appearance",element:r.jsx(LL,{})}),r.jsx(ke,{path:"shortcuts",element:r.jsx(FL,{})}),r.jsx(ke,{path:"about",element:r.jsx(zL,{})})]})}),r.jsx(ke,{path:"*",element:r.jsx(Hn,{to:"/",replace:!0})})]})]})}const AI=1e4;function DI(){const{onboardingCompleted:n}=ut(),[a,i]=y.useState(!1);y.useEffect(()=>{if(n!==void 0)return;const c=setTimeout(()=>i(!0),AI);return()=>clearTimeout(c)},[n]);const l=n===void 0&&!a;return r.jsx(ea,{mode:"wait",children:l?r.jsx(Et.div,{initial:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:r.jsx(iS,{})},"splash"):r.jsx(Et.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.25},style:{minHeight:"100vh"},children:r.jsx(Ck,{children:r.jsx(EI,{})})},"app")})}function RI(){const n=wI?jj:vj;return r.jsx(Dj,{children:r.jsx(Nj,{children:r.jsx(n,{children:r.jsx(DI,{})})})})}Z1.createRoot(document.getElementById("root")).render(r.jsx(y.StrictMode,{children:r.jsx(RI,{})}));export{us as B,ub as K,ut as a,ob as s,Jn as t,xt as u};
|