@grackle-ai/web 0.106.0 → 0.106.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.
|
@@ -1,725 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/KnowledgePage-39s6R_by.js","assets/dagview-tHPW3Rz3.js","assets/grpc-kM-kAEY6.js","assets/markdown-Yr3vTPLR.js","assets/KnowledgePage-BmY14aDt.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as gT,a as vT,b,j as i,d as oy,H as ry,P as ly,i as yT,B as bT,c as xT,C as _T,M as kT,e as ST}from"./dagview-tHPW3Rz3.js";import{c as TT,a as kd,G as jT,b as wT,d as NT,e as CT,f as ET,M as AT,A as _x,D as kx,W as DT,O as MT,g as RT,C as Ci,h as Sx,i as Tx,w as IT,t as OT,p as Ic,j as BT,R as Or,S as cy}from"./grpc-kM-kAEY6.js";import{v as LT,r as zT,t as Oc,i as $T,f as PT,M as Sd,a as Td}from"./markdown-Yr3vTPLR.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))r(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const u of d.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function o(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 r(c){if(c.ep)return;c.ep=!0;const d=o(c);fetch(c.href,d)}})();var Zf={exports:{}},Br={},Kf={exports:{}},Yf={};/**
|
|
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 dy;function UT(){return dy||(dy=1,(function(t){function s(M,H){var ne=M.length;M.push(H);e:for(;0<ne;){var he=ne-1>>>1,W=M[he];if(0<c(W,H))M[he]=H,M[ne]=W,ne=he;else break e}}function o(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var H=M[0],ne=M.pop();if(ne!==H){M[0]=ne;e:for(var he=0,W=M.length,X=W>>>1;he<X;){var de=2*(he+1)-1,Ne=M[de],Ue=de+1,ve=M[Ue];if(0>c(Ne,ne))Ue<W&&0>c(ve,Ne)?(M[he]=ve,M[Ue]=ne,he=Ue):(M[he]=Ne,M[de]=ne,he=de);else if(Ue<W&&0>c(ve,ne))M[he]=ve,M[Ue]=ne,he=Ue;else break e}}return H}function c(M,H){var ne=M.sortIndex-H.sortIndex;return ne!==0?ne:M.id-H.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;t.unstable_now=function(){return d.now()}}else{var u=Date,p=u.now();t.unstable_now=function(){return u.now()-p}}var m=[],g=[],v=1,x=null,y=3,k=!1,S=!1,j=!1,N=!1,T=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function O(M){for(var H=o(g);H!==null;){if(H.callback===null)r(g);else if(H.startTime<=M)r(g),H.sortIndex=H.expirationTime,s(m,H);else break;H=o(g)}}function E(M){if(j=!1,O(M),!S)if(o(m)!==null)S=!0,D||(D=!0,K());else{var H=o(g);H!==null&&oe(E,H.startTime-M)}}var D=!1,P=-1,B=5,z=-1;function J(){return N?!0:!(t.unstable_now()-z<B)}function V(){if(N=!1,D){var M=t.unstable_now();z=M;var H=!0;try{e:{S=!1,j&&(j=!1,C(P),P=-1),k=!0;var ne=y;try{t:{for(O(M),x=o(m);x!==null&&!(x.expirationTime>M&&J());){var he=x.callback;if(typeof he=="function"){x.callback=null,y=x.priorityLevel;var W=he(x.expirationTime<=M);if(M=t.unstable_now(),typeof W=="function"){x.callback=W,O(M),H=!0;break t}x===o(m)&&r(m),O(M)}else r(m);x=o(m)}if(x!==null)H=!0;else{var X=o(g);X!==null&&oe(E,X.startTime-M),H=!1}}break e}finally{x=null,y=ne,k=!1}H=void 0}}finally{H?K():D=!1}}}var K;if(typeof A=="function")K=function(){A(V)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,ee=fe.port2;fe.port1.onmessage=V,K=function(){ee.postMessage(null)}}else K=function(){T(V,0)};function oe(M,H){P=T(function(){M(t.unstable_now())},H)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(M){M.callback=null},t.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<M?Math.floor(1e3/M):5},t.unstable_getCurrentPriorityLevel=function(){return y},t.unstable_next=function(M){switch(y){case 1:case 2:case 3:var H=3;break;default:H=y}var ne=y;y=H;try{return M()}finally{y=ne}},t.unstable_requestPaint=function(){N=!0},t.unstable_runWithPriority=function(M,H){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var ne=y;y=M;try{return H()}finally{y=ne}},t.unstable_scheduleCallback=function(M,H,ne){var he=t.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?he+ne:he):ne=he,M){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=ne+W,M={id:v++,callback:H,priorityLevel:M,startTime:ne,expirationTime:W,sortIndex:-1},ne>he?(M.sortIndex=ne,s(g,M),o(m)===null&&M===o(g)&&(j?(C(P),P=-1):j=!0,oe(E,ne-he))):(M.sortIndex=W,s(m,M),S||k||(S=!0,D||(D=!0,K()))),M},t.unstable_shouldYield=J,t.unstable_wrapCallback=function(M){var H=y;return function(){var ne=y;y=H;try{return M.apply(this,arguments)}finally{y=ne}}}})(Yf)),Yf}var uy;function HT(){return uy||(uy=1,Kf.exports=UT()),Kf.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 fy;function VT(){if(fy)return Br;fy=1;var t=HT(),s=gT(),o=vT();function r(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)n+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+n+" 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 n=e,a=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(a=n.return),e=n.return;while(e)}return n.tag===3?a:null}function u(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function p(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function m(e){if(d(e)!==e)throw Error(r(188))}function g(e){var n=e.alternate;if(!n){if(n=d(e),n===null)throw Error(r(188));return n!==e?null:e}for(var a=e,l=n;;){var f=a.return;if(f===null)break;var h=f.alternate;if(h===null){if(l=f.return,l!==null){a=l;continue}break}if(f.child===h.child){for(h=f.child;h;){if(h===a)return m(f),e;if(h===l)return m(f),n;h=h.sibling}throw Error(r(188))}if(a.return!==l.return)a=f,l=h;else{for(var _=!1,w=f.child;w;){if(w===a){_=!0,a=f,l=h;break}if(w===l){_=!0,l=f,a=h;break}w=w.sibling}if(!_){for(w=h.child;w;){if(w===a){_=!0,a=h,l=f;break}if(w===l){_=!0,l=h,a=f;break}w=w.sibling}if(!_)throw Error(r(189))}}if(a.alternate!==l)throw Error(r(190))}if(a.tag!==3)throw Error(r(188));return a.stateNode.current===a?e:n}function v(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=v(e),n!==null)return n;e=e.sibling}return null}var x=Object.assign,y=Symbol.for("react.element"),k=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),A=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),J=Symbol.for("react.memo_cache_sentinel"),V=Symbol.iterator;function K(e){return e===null||typeof e!="object"?null:(e=V&&e[V]||e["@@iterator"],typeof e=="function"?e:null)}var fe=Symbol.for("react.client.reference");function ee(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===fe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case j:return"Fragment";case T:return"Profiler";case N:return"StrictMode";case E:return"Suspense";case D:return"SuspenseList";case z:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case S:return"Portal";case A:return e.displayName||"Context";case C:return(e._context.displayName||"Context")+".Consumer";case O:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case P:return n=e.displayName||null,n!==null?n:ee(e.type)||"Memo";case B:n=e._payload,e=e._init;try{return ee(e(n))}catch{}}return null}var oe=Array.isArray,M=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},he=[],W=-1;function X(e){return{current:e}}function de(e){0>W||(e.current=he[W],he[W]=null,W--)}function Ne(e,n){W++,he[W]=e.current,e.current=n}var Ue=X(null),ve=X(null),Se=X(null),xe=X(null);function Be(e,n){switch(Ne(Se,n),Ne(ve,e),Ne(Ue,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?E0(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=E0(n),e=A0(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}de(Ue),Ne(Ue,e)}function It(){de(Ue),de(ve),de(Se)}function zn(e){e.memoizedState!==null&&Ne(xe,e);var n=Ue.current,a=A0(n,e.type);n!==a&&(Ne(ve,e),Ne(Ue,a))}function re(e){ve.current===e&&(de(Ue),de(ve)),xe.current===e&&(de(xe),Dr._currentValue=ne)}var Je,Ut;function se(e){if(Je===void 0)try{throw Error()}catch(a){var n=a.stack.trim().match(/\n( *(at )?)/);Je=n&&n[1]||"",Ut=-1<a.stack.indexOf(`
|
|
19
|
-
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
20
|
-
`+Je+e+Ut}var wt=!1;function Ot(e,n){if(!e||wt)return"";wt=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(n){var ie=function(){throw Error()};if(Object.defineProperty(ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ie,[])}catch(Z){var F=Z}Reflect.construct(e,[],ie)}else{try{ie.call()}catch(Z){F=Z}e.call(ie.prototype)}}else{try{throw Error()}catch(Z){F=Z}(ie=e())&&typeof ie.catch=="function"&&ie.catch(function(){})}}catch(Z){if(Z&&F&&typeof Z.stack=="string")return[Z.stack,F.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=l.DetermineComponentFrameRoot(),_=h[0],w=h[1];if(_&&w){var R=_.split(`
|
|
21
|
-
`),G=w.split(`
|
|
22
|
-
`);for(f=l=0;l<R.length&&!R[l].includes("DetermineComponentFrameRoot");)l++;for(;f<G.length&&!G[f].includes("DetermineComponentFrameRoot");)f++;if(l===R.length||f===G.length)for(l=R.length-1,f=G.length-1;1<=l&&0<=f&&R[l]!==G[f];)f--;for(;1<=l&&0<=f;l--,f--)if(R[l]!==G[f]){if(l!==1||f!==1)do if(l--,f--,0>f||R[l]!==G[f]){var Q=`
|
|
23
|
-
`+R[l].replace(" at new "," at ");return e.displayName&&Q.includes("<anonymous>")&&(Q=Q.replace("<anonymous>",e.displayName)),Q}while(1<=l&&0<=f);break}}}finally{wt=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?se(a):""}function Bt(e,n){switch(e.tag){case 26:case 27:case 5:return se(e.type);case 16:return se("Lazy");case 13:return e.child!==n&&n!==null?se("Suspense Fallback"):se("Suspense");case 19:return se("SuspenseList");case 0:case 15:return Ot(e.type,!1);case 11:return Ot(e.type.render,!1);case 1:return Ot(e.type,!0);case 31:return se("Activity");default:return""}}function ze(e){try{var n="",a=null;do n+=Bt(e,a),a=e,e=e.return;while(e);return n}catch(l){return`
|
|
24
|
-
Error generating stack: `+l.message+`
|
|
25
|
-
`+l.stack}}var sn=Object.prototype.hasOwnProperty,ca=t.unstable_scheduleCallback,is=t.unstable_cancelCallback,Ja=t.unstable_shouldYield,da=t.unstable_requestPaint,Jt=t.unstable_now,Bi=t.unstable_getCurrentPriorityLevel,ua=t.unstable_ImmediatePriority,Wa=t.unstable_UserBlockingPriority,ys=t.unstable_NormalPriority,Li=t.unstable_LowPriority,$n=t.unstable_IdlePriority,Ae=t.log,We=t.unstable_setDisableYieldValue,Wt=null,St=null;function mn(e){if(typeof Ae=="function"&&We(e),St&&typeof St.setStrictMode=="function")try{St.setStrictMode(Wt,e)}catch{}}var Xt=Math.clz32?Math.clz32:Pi,zi=Math.log,$i=Math.LN2;function Pi(e){return e>>>=0,e===0?32:31-(zi(e)/$i|0)|0}var Xa=256,Qa=262144,ei=4194304;function bs(e){var n=e&42;if(n!==0)return n;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 ti(e,n,a){var l=e.pendingLanes;if(l===0)return 0;var f=0,h=e.suspendedLanes,_=e.pingedLanes;e=e.warmLanes;var w=l&134217727;return w!==0?(l=w&~h,l!==0?f=bs(l):(_&=w,_!==0?f=bs(_):a||(a=w&~e,a!==0&&(f=bs(a))))):(w=l&~h,w!==0?f=bs(w):_!==0?f=bs(_):a||(a=l&~e,a!==0&&(f=bs(a)))),f===0?0:n!==0&&n!==f&&(n&h)===0&&(h=f&-f,a=n&-n,h>=a||h===32&&(a&4194048)!==0)?n:f}function fa(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function xl(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 _l(){var e=ei;return ei<<=1,(ei&62914560)===0&&(ei=4194304),e}function U(e){for(var n=[],a=0;31>a;a++)n.push(e);return n}function te(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function le(e,n,a,l,f,h){var _=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var w=e.entanglements,R=e.expirationTimes,G=e.hiddenUpdates;for(a=_&~a;0<a;){var Q=31-Xt(a),ie=1<<Q;w[Q]=0,R[Q]=-1;var F=G[Q];if(F!==null)for(G[Q]=null,Q=0;Q<F.length;Q++){var Z=F[Q];Z!==null&&(Z.lane&=-536870913)}a&=~ie}l!==0&&ue(e,l,0),h!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=h&~(_&~n))}function ue(e,n,a){e.pendingLanes|=n,e.suspendedLanes&=~n;var l=31-Xt(n);e.entangledLanes|=n,e.entanglements[l]=e.entanglements[l]|1073741824|a&261930}function ge(e,n){var a=e.entangledLanes|=n;for(e=e.entanglements;a;){var l=31-Xt(a),f=1<<l;f&n|e[l]&n&&(e[l]|=n),a&=~f}}function Ge(e,n){var a=n&-n;return a=(a&42)!==0?1:_e(a),(a&(e.suspendedLanes|n))!==0?0:a}function _e(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 Me(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Xe(){var e=H.p;return e!==0?e:(e=window.event,e===void 0?32:Q0(e.type))}function ht(e,n){var a=H.p;try{return H.p=e,n()}finally{H.p=a}}var Le=Math.random().toString(36).slice(2),Qe="__reactFiber$"+Le,rt="__reactProps$"+Le,vt="__reactContainer$"+Le,xs="__reactEvents$"+Le,Ms="__reactListeners$"+Le,Go="__reactHandles$"+Le,gh="__reactResources$"+Le,Fo="__reactMarker$"+Le;function zd(e){delete e[Qe],delete e[rt],delete e[xs],delete e[Ms],delete e[Go]}function Ui(e){var n=e[Qe];if(n)return n;for(var a=e.parentNode;a;){if(n=a[vt]||a[Qe]){if(a=n.alternate,n.child!==null||a!==null&&a.child!==null)for(e=L0(e);e!==null;){if(a=e[Qe])return a;e=L0(e)}return n}e=a,a=e.parentNode}return null}function Hi(e){if(e=e[Qe]||e[vt]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function Zo(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(r(33))}function Vi(e){var n=e[gh];return n||(n=e[gh]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Qt(e){e[Fo]=!0}var vh=new Set,yh={};function ni(e,n){qi(e,n),qi(e+"Capture",n)}function qi(e,n){for(yh[e]=n,e=0;e<n.length;e++)vh.add(n[e])}var rk=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]*$"),bh={},xh={};function lk(e){return sn.call(xh,e)?!0:sn.call(bh,e)?!1:rk.test(e)?xh[e]=!0:(bh[e]=!0,!1)}function kl(e,n,a){if(lk(n))if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var l=n.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+a)}}function Sl(e,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+a)}}function Rs(e,n,a,l){if(l===null)e.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(n,a,""+l)}}function Pn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function _h(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function ck(e,n,a){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var f=l.get,h=l.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return f.call(this)},set:function(_){a=""+_,h.call(this,_)}}),Object.defineProperty(e,n,{enumerable:l.enumerable}),{getValue:function(){return a},setValue:function(_){a=""+_},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function $d(e){if(!e._valueTracker){var n=_h(e)?"checked":"value";e._valueTracker=ck(e,n,""+e[n])}}function kh(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var a=n.getValue(),l="";return e&&(l=_h(e)?e.checked?"true":"false":e.value),e=l,e!==a?(n.setValue(e),!0):!1}function Tl(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 dk=/[\n"\\]/g;function Un(e){return e.replace(dk,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Pd(e,n,a,l,f,h,_,w){e.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.type=_:e.removeAttribute("type"),n!=null?_==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+Pn(n)):e.value!==""+Pn(n)&&(e.value=""+Pn(n)):_!=="submit"&&_!=="reset"||e.removeAttribute("value"),n!=null?Ud(e,_,Pn(n)):a!=null?Ud(e,_,Pn(a)):l!=null&&e.removeAttribute("value"),f==null&&h!=null&&(e.defaultChecked=!!h),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.name=""+Pn(w):e.removeAttribute("name")}function Sh(e,n,a,l,f,h,_,w){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),n!=null||a!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){$d(e);return}a=a!=null?""+Pn(a):"",n=n!=null?""+Pn(n):a,w||n===e.value||(e.value=n),e.defaultValue=n}l=l??f,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=w?e.checked:!!l,e.defaultChecked=!!l,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(e.name=_),$d(e)}function Ud(e,n,a){n==="number"&&Tl(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Gi(e,n,a,l){if(e=e.options,n){n={};for(var f=0;f<a.length;f++)n["$"+a[f]]=!0;for(a=0;a<e.length;a++)f=n.hasOwnProperty("$"+e[a].value),e[a].selected!==f&&(e[a].selected=f),f&&l&&(e[a].defaultSelected=!0)}else{for(a=""+Pn(a),n=null,f=0;f<e.length;f++){if(e[f].value===a){e[f].selected=!0,l&&(e[f].defaultSelected=!0);return}n!==null||e[f].disabled||(n=e[f])}n!==null&&(n.selected=!0)}}function Th(e,n,a){if(n!=null&&(n=""+Pn(n),n!==e.value&&(e.value=n),a==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=a!=null?""+Pn(a):""}function jh(e,n,a,l){if(n==null){if(l!=null){if(a!=null)throw Error(r(92));if(oe(l)){if(1<l.length)throw Error(r(93));l=l[0]}a=l}a==null&&(a=""),n=a}a=Pn(n),e.defaultValue=a,l=e.textContent,l===a&&l!==""&&l!==null&&(e.value=l),$d(e)}function Fi(e,n){if(n){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=n;return}}e.textContent=n}var uk=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 wh(e,n,a){var l=n.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":l?e.setProperty(n,a):typeof a!="number"||a===0||uk.has(n)?n==="float"?e.cssFloat=a:e[n]=(""+a).trim():e[n]=a+"px"}function Nh(e,n,a){if(n!=null&&typeof n!="object")throw Error(r(62));if(e=e.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||n!=null&&n.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var f in n)l=n[f],n.hasOwnProperty(f)&&a[f]!==l&&wh(e,f,l)}else for(var h in n)n.hasOwnProperty(h)&&wh(e,h,n[h])}function Hd(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 fk=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"]]),pk=/^[\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 jl(e){return pk.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Is(){}var Vd=null;function qd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Zi=null,Ki=null;function Ch(e){var n=Hi(e);if(n&&(e=n.stateNode)){var a=e[rt]||null;e:switch(e=n.stateNode,n.type){case"input":if(Pd(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),n=a.name,a.type==="radio"&&n!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Un(""+n)+'"][type="radio"]'),n=0;n<a.length;n++){var l=a[n];if(l!==e&&l.form===e.form){var f=l[rt]||null;if(!f)throw Error(r(90));Pd(l,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<a.length;n++)l=a[n],l.form===e.form&&kh(l)}break e;case"textarea":Th(e,a.value,a.defaultValue);break e;case"select":n=a.value,n!=null&&Gi(e,!!a.multiple,n,!1)}}}var Gd=!1;function Eh(e,n,a){if(Gd)return e(n,a);Gd=!0;try{var l=e(n);return l}finally{if(Gd=!1,(Zi!==null||Ki!==null)&&(fc(),Zi&&(n=Zi,e=Ki,Ki=Zi=null,Ch(n),e)))for(n=0;n<e.length;n++)Ch(e[n])}}function Ko(e,n){var a=e.stateNode;if(a===null)return null;var l=a[rt]||null;if(l===null)return null;a=l[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(r(231,n,typeof a));return a}var Os=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fd=!1;if(Os)try{var Yo={};Object.defineProperty(Yo,"passive",{get:function(){Fd=!0}}),window.addEventListener("test",Yo,Yo),window.removeEventListener("test",Yo,Yo)}catch{Fd=!1}var pa=null,Zd=null,wl=null;function Ah(){if(wl)return wl;var e,n=Zd,a=n.length,l,f="value"in pa?pa.value:pa.textContent,h=f.length;for(e=0;e<a&&n[e]===f[e];e++);var _=a-e;for(l=1;l<=_&&n[a-l]===f[h-l];l++);return wl=f.slice(e,1<l?1-l:void 0)}function Nl(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Cl(){return!0}function Dh(){return!1}function xn(e){function n(a,l,f,h,_){this._reactName=a,this._targetInst=f,this.type=l,this.nativeEvent=h,this.target=_,this.currentTarget=null;for(var w in e)e.hasOwnProperty(w)&&(a=e[w],this[w]=a?a(h):h[w]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Cl:Dh,this.isPropagationStopped=Dh,this}return x(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Cl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Cl)},persist:function(){},isPersistent:Cl}),n}var si={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},El=xn(si),Jo=x({},si,{view:0,detail:0}),mk=xn(Jo),Kd,Yd,Wo,Al=x({},Jo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wd,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!==Wo&&(Wo&&e.type==="mousemove"?(Kd=e.screenX-Wo.screenX,Yd=e.screenY-Wo.screenY):Yd=Kd=0,Wo=e),Kd)},movementY:function(e){return"movementY"in e?e.movementY:Yd}}),Mh=xn(Al),hk=x({},Al,{dataTransfer:0}),gk=xn(hk),vk=x({},Jo,{relatedTarget:0}),Jd=xn(vk),yk=x({},si,{animationName:0,elapsedTime:0,pseudoElement:0}),bk=xn(yk),xk=x({},si,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),_k=xn(xk),kk=x({},si,{data:0}),Rh=xn(kk),Sk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Tk={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"},jk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wk(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=jk[e])?!!n[e]:!1}function Wd(){return wk}var Nk=x({},Jo,{key:function(e){if(e.key){var n=Sk[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Nl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Tk[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wd,charCode:function(e){return e.type==="keypress"?Nl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Nl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ck=xn(Nk),Ek=x({},Al,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ih=xn(Ek),Ak=x({},Jo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wd}),Dk=xn(Ak),Mk=x({},si,{propertyName:0,elapsedTime:0,pseudoElement:0}),Rk=xn(Mk),Ik=x({},Al,{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}),Ok=xn(Ik),Bk=x({},si,{newState:0,oldState:0}),Lk=xn(Bk),zk=[9,13,27,32],Xd=Os&&"CompositionEvent"in window,Xo=null;Os&&"documentMode"in document&&(Xo=document.documentMode);var $k=Os&&"TextEvent"in window&&!Xo,Oh=Os&&(!Xd||Xo&&8<Xo&&11>=Xo),Bh=" ",Lh=!1;function zh(e,n){switch(e){case"keyup":return zk.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $h(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Yi=!1;function Pk(e,n){switch(e){case"compositionend":return $h(n);case"keypress":return n.which!==32?null:(Lh=!0,Bh);case"textInput":return e=n.data,e===Bh&&Lh?null:e;default:return null}}function Uk(e,n){if(Yi)return e==="compositionend"||!Xd&&zh(e,n)?(e=Ah(),wl=Zd=pa=null,Yi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Oh&&n.locale!=="ko"?null:n.data;default:return null}}var Hk={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 Ph(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!Hk[e.type]:n==="textarea"}function Uh(e,n,a,l){Zi?Ki?Ki.push(l):Ki=[l]:Zi=l,n=bc(n,"onChange"),0<n.length&&(a=new El("onChange","change",null,a,l),e.push({event:a,listeners:n}))}var Qo=null,er=null;function Vk(e){S0(e,0)}function Dl(e){var n=Zo(e);if(kh(n))return e}function Hh(e,n){if(e==="change")return n}var Vh=!1;if(Os){var Qd;if(Os){var eu="oninput"in document;if(!eu){var qh=document.createElement("div");qh.setAttribute("oninput","return;"),eu=typeof qh.oninput=="function"}Qd=eu}else Qd=!1;Vh=Qd&&(!document.documentMode||9<document.documentMode)}function Gh(){Qo&&(Qo.detachEvent("onpropertychange",Fh),er=Qo=null)}function Fh(e){if(e.propertyName==="value"&&Dl(er)){var n=[];Uh(n,er,e,qd(e)),Eh(Vk,n)}}function qk(e,n,a){e==="focusin"?(Gh(),Qo=n,er=a,Qo.attachEvent("onpropertychange",Fh)):e==="focusout"&&Gh()}function Gk(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Dl(er)}function Fk(e,n){if(e==="click")return Dl(n)}function Zk(e,n){if(e==="input"||e==="change")return Dl(n)}function Kk(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var wn=typeof Object.is=="function"?Object.is:Kk;function tr(e,n){if(wn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var a=Object.keys(e),l=Object.keys(n);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var f=a[l];if(!sn.call(n,f)||!wn(e[f],n[f]))return!1}return!0}function Zh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Kh(e,n){var a=Zh(e);e=0;for(var l;a;){if(a.nodeType===3){if(l=e+a.textContent.length,e<=n&&l>=n)return{node:a,offset:n-e};e=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Zh(a)}}function Yh(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Yh(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Jh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=Tl(e.document);n instanceof e.HTMLIFrameElement;){try{var a=typeof n.contentWindow.location.href=="string"}catch{a=!1}if(a)e=n.contentWindow;else break;n=Tl(e.document)}return n}function tu(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var Yk=Os&&"documentMode"in document&&11>=document.documentMode,Ji=null,nu=null,nr=null,su=!1;function Wh(e,n,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;su||Ji==null||Ji!==Tl(l)||(l=Ji,"selectionStart"in l&&tu(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),nr&&tr(nr,l)||(nr=l,l=bc(nu,"onSelect"),0<l.length&&(n=new El("onSelect","select",null,n,a),e.push({event:n,listeners:l}),n.target=Ji)))}function ai(e,n){var a={};return a[e.toLowerCase()]=n.toLowerCase(),a["Webkit"+e]="webkit"+n,a["Moz"+e]="moz"+n,a}var Wi={animationend:ai("Animation","AnimationEnd"),animationiteration:ai("Animation","AnimationIteration"),animationstart:ai("Animation","AnimationStart"),transitionrun:ai("Transition","TransitionRun"),transitionstart:ai("Transition","TransitionStart"),transitioncancel:ai("Transition","TransitionCancel"),transitionend:ai("Transition","TransitionEnd")},au={},Xh={};Os&&(Xh=document.createElement("div").style,"AnimationEvent"in window||(delete Wi.animationend.animation,delete Wi.animationiteration.animation,delete Wi.animationstart.animation),"TransitionEvent"in window||delete Wi.transitionend.transition);function ii(e){if(au[e])return au[e];if(!Wi[e])return e;var n=Wi[e],a;for(a in n)if(n.hasOwnProperty(a)&&a in Xh)return au[e]=n[a];return e}var Qh=ii("animationend"),eg=ii("animationiteration"),tg=ii("animationstart"),Jk=ii("transitionrun"),Wk=ii("transitionstart"),Xk=ii("transitioncancel"),ng=ii("transitionend"),sg=new Map,iu="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(" ");iu.push("scrollEnd");function os(e,n){sg.set(e,n),ni(n,[e])}var Ml=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=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(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Hn=[],Xi=0,ou=0;function Rl(){for(var e=Xi,n=ou=Xi=0;n<e;){var a=Hn[n];Hn[n++]=null;var l=Hn[n];Hn[n++]=null;var f=Hn[n];Hn[n++]=null;var h=Hn[n];if(Hn[n++]=null,l!==null&&f!==null){var _=l.pending;_===null?f.next=f:(f.next=_.next,_.next=f),l.pending=f}h!==0&&ag(a,f,h)}}function Il(e,n,a,l){Hn[Xi++]=e,Hn[Xi++]=n,Hn[Xi++]=a,Hn[Xi++]=l,ou|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function ru(e,n,a,l){return Il(e,n,a,l),Ol(e)}function oi(e,n){return Il(e,null,null,n),Ol(e)}function ag(e,n,a){e.lanes|=a;var l=e.alternate;l!==null&&(l.lanes|=a);for(var f=!1,h=e.return;h!==null;)h.childLanes|=a,l=h.alternate,l!==null&&(l.childLanes|=a),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(f=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,f&&n!==null&&(f=31-Xt(a),e=h.hiddenUpdates,l=e[f],l===null?e[f]=[n]:l.push(n),n.lane=a|536870912),h):null}function Ol(e){if(50<Tr)throw Tr=0,vf=null,Error(r(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var Qi={};function Qk(e,n,a,l){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nn(e,n,a,l){return new Qk(e,n,a,l)}function lu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Bs(e,n){var a=e.alternate;return a===null?(a=Nn(e.tag,n,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=n,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,n=e.dependencies,a.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function ig(e,n){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,n=a.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function Bl(e,n,a,l,f,h){var _=0;if(l=e,typeof e=="function")lu(e)&&(_=1);else if(typeof e=="string")_=aT(e,a,Ue.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case z:return e=Nn(31,a,n,f),e.elementType=z,e.lanes=h,e;case j:return ri(a.children,f,h,n);case N:_=8,f|=24;break;case T:return e=Nn(12,a,n,f|2),e.elementType=T,e.lanes=h,e;case E:return e=Nn(13,a,n,f),e.elementType=E,e.lanes=h,e;case D:return e=Nn(19,a,n,f),e.elementType=D,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case A:_=10;break e;case C:_=9;break e;case O:_=11;break e;case P:_=14;break e;case B:_=16,l=null;break e}_=29,a=Error(r(130,e===null?"null":typeof e,"")),l=null}return n=Nn(_,a,n,f),n.elementType=e,n.type=l,n.lanes=h,n}function ri(e,n,a,l){return e=Nn(7,e,l,n),e.lanes=a,e}function cu(e,n,a){return e=Nn(6,e,null,n),e.lanes=a,e}function og(e){var n=Nn(18,null,null,0);return n.stateNode=e,n}function du(e,n,a){return n=Nn(4,e.children!==null?e.children:[],e.key,n),n.lanes=a,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var rg=new WeakMap;function Vn(e,n){if(typeof e=="object"&&e!==null){var a=rg.get(e);return a!==void 0?a:(n={value:e,source:n,stack:ze(n)},rg.set(e,n),n)}return{value:e,source:n,stack:ze(n)}}var eo=[],to=0,Ll=null,sr=0,qn=[],Gn=0,ma=null,_s=1,ks="";function Ls(e,n){eo[to++]=sr,eo[to++]=Ll,Ll=e,sr=n}function lg(e,n,a){qn[Gn++]=_s,qn[Gn++]=ks,qn[Gn++]=ma,ma=e;var l=_s;e=ks;var f=32-Xt(l)-1;l&=~(1<<f),a+=1;var h=32-Xt(n)+f;if(30<h){var _=f-f%5;h=(l&(1<<_)-1).toString(32),l>>=_,f-=_,_s=1<<32-Xt(n)+f|a<<f|l,ks=h+e}else _s=1<<h|a<<f|l,ks=e}function uu(e){e.return!==null&&(Ls(e,1),lg(e,1,0))}function fu(e){for(;e===Ll;)Ll=eo[--to],eo[to]=null,sr=eo[--to],eo[to]=null;for(;e===ma;)ma=qn[--Gn],qn[Gn]=null,ks=qn[--Gn],qn[Gn]=null,_s=qn[--Gn],qn[Gn]=null}function cg(e,n){qn[Gn++]=_s,qn[Gn++]=ks,qn[Gn++]=ma,_s=n.id,ks=n.overflow,ma=e}var an=null,yt=null,Fe=!1,ha=null,Fn=!1,pu=Error(r(519));function ga(e){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ar(Vn(n,e)),pu}function dg(e){var n=e.stateNode,a=e.type,l=e.memoizedProps;switch(n[Qe]=e,n[rt]=l,a){case"dialog":Pe("cancel",n),Pe("close",n);break;case"iframe":case"object":case"embed":Pe("load",n);break;case"video":case"audio":for(a=0;a<wr.length;a++)Pe(wr[a],n);break;case"source":Pe("error",n);break;case"img":case"image":case"link":Pe("error",n),Pe("load",n);break;case"details":Pe("toggle",n);break;case"input":Pe("invalid",n),Sh(n,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Pe("invalid",n);break;case"textarea":Pe("invalid",n),jh(n,l.value,l.defaultValue,l.children)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||n.textContent===""+a||l.suppressHydrationWarning===!0||N0(n.textContent,a)?(l.popover!=null&&(Pe("beforetoggle",n),Pe("toggle",n)),l.onScroll!=null&&Pe("scroll",n),l.onScrollEnd!=null&&Pe("scrollend",n),l.onClick!=null&&(n.onclick=Is),n=!0):n=!1,n||ga(e,!0)}function ug(e){for(an=e.return;an;)switch(an.tag){case 5:case 31:case 13:Fn=!1;return;case 27:case 3:Fn=!0;return;default:an=an.return}}function no(e){if(e!==an)return!1;if(!Fe)return ug(e),Fe=!0,!1;var n=e.tag,a;if((a=n!==3&&n!==27)&&((a=n===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Mf(e.type,e.memoizedProps)),a=!a),a&&yt&&ga(e),ug(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));yt=B0(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));yt=B0(e)}else n===27?(n=yt,Aa(e.type)?(e=Lf,Lf=null,yt=e):yt=n):yt=an?Kn(e.stateNode.nextSibling):null;return!0}function li(){yt=an=null,Fe=!1}function mu(){var e=ha;return e!==null&&(Tn===null?Tn=e:Tn.push.apply(Tn,e),ha=null),e}function ar(e){ha===null?ha=[e]:ha.push(e)}var hu=X(null),ci=null,zs=null;function va(e,n,a){Ne(hu,n._currentValue),n._currentValue=a}function $s(e){e._currentValue=hu.current,de(hu)}function gu(e,n,a){for(;e!==null;){var l=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,l!==null&&(l.childLanes|=n)):l!==null&&(l.childLanes&n)!==n&&(l.childLanes|=n),e===a)break;e=e.return}}function vu(e,n,a,l){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var h=f.dependencies;if(h!==null){var _=f.child;h=h.firstContext;e:for(;h!==null;){var w=h;h=f;for(var R=0;R<n.length;R++)if(w.context===n[R]){h.lanes|=a,w=h.alternate,w!==null&&(w.lanes|=a),gu(h.return,a,e),l||(_=null);break e}h=w.next}}else if(f.tag===18){if(_=f.return,_===null)throw Error(r(341));_.lanes|=a,h=_.alternate,h!==null&&(h.lanes|=a),gu(_,a,e),_=null}else _=f.child;if(_!==null)_.return=f;else for(_=f;_!==null;){if(_===e){_=null;break}if(f=_.sibling,f!==null){f.return=_.return,_=f;break}_=_.return}f=_}}function so(e,n,a,l){e=null;for(var f=n,h=!1;f!==null;){if(!h){if((f.flags&524288)!==0)h=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var _=f.alternate;if(_===null)throw Error(r(387));if(_=_.memoizedProps,_!==null){var w=f.type;wn(f.pendingProps.value,_.value)||(e!==null?e.push(w):e=[w])}}else if(f===xe.current){if(_=f.alternate,_===null)throw Error(r(387));_.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(Dr):e=[Dr])}f=f.return}e!==null&&vu(n,e,a,l),n.flags|=262144}function zl(e){for(e=e.firstContext;e!==null;){if(!wn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function di(e){ci=e,zs=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function on(e){return fg(ci,e)}function $l(e,n){return ci===null&&di(e),fg(e,n)}function fg(e,n){var a=n._currentValue;if(n={context:n,memoizedValue:a,next:null},zs===null){if(e===null)throw Error(r(308));zs=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else zs=zs.next=n;return a}var eS=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(a,l){e.push(l)}};this.abort=function(){n.aborted=!0,e.forEach(function(a){return a()})}},tS=t.unstable_scheduleCallback,nS=t.unstable_NormalPriority,Ht={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function yu(){return{controller:new eS,data:new Map,refCount:0}}function ir(e){e.refCount--,e.refCount===0&&tS(nS,function(){e.controller.abort()})}var or=null,bu=0,ao=0,io=null;function sS(e,n){if(or===null){var a=or=[];bu=0,ao=Sf(),io={status:"pending",value:void 0,then:function(l){a.push(l)}}}return bu++,n.then(pg,pg),n}function pg(){if(--bu===0&&or!==null){io!==null&&(io.status="fulfilled");var e=or;or=null,ao=0,io=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function aS(e,n){var a=[],l={status:"pending",value:null,reason:null,then:function(f){a.push(f)}};return e.then(function(){l.status="fulfilled",l.value=n;for(var f=0;f<a.length;f++)(0,a[f])(n)},function(f){for(l.status="rejected",l.reason=f,f=0;f<a.length;f++)(0,a[f])(void 0)}),l}var mg=M.S;M.S=function(e,n){Wv=Jt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&sS(e,n),mg!==null&&mg(e,n)};var ui=X(null);function xu(){var e=ui.current;return e!==null?e:gt.pooledCache}function Pl(e,n){n===null?Ne(ui,ui.current):Ne(ui,n.pool)}function hg(){var e=xu();return e===null?null:{parent:Ht._currentValue,pool:e}}var oo=Error(r(460)),_u=Error(r(474)),Ul=Error(r(542)),Hl={then:function(){}};function gg(e){return e=e.status,e==="fulfilled"||e==="rejected"}function vg(e,n,a){switch(a=e[a],a===void 0?e.push(n):a!==n&&(n.then(Is,Is),n=a),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,bg(e),e;default:if(typeof n.status=="string")n.then(Is,Is);else{if(e=gt,e!==null&&100<e.shellSuspendCounter)throw Error(r(482));e=n,e.status="pending",e.then(function(l){if(n.status==="pending"){var f=n;f.status="fulfilled",f.value=l}},function(l){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=l}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,bg(e),e}throw pi=n,oo}}function fi(e){try{var n=e._init;return n(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(pi=a,oo):a}}var pi=null;function yg(){if(pi===null)throw Error(r(459));var e=pi;return pi=null,e}function bg(e){if(e===oo||e===Ul)throw Error(r(483))}var ro=null,rr=0;function Vl(e){var n=rr;return rr+=1,ro===null&&(ro=[]),vg(ro,e,n)}function lr(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function ql(e,n){throw n.$$typeof===y?Error(r(525)):(e=Object.prototype.toString.call(n),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function xg(e){function n($,L){if(e){var q=$.deletions;q===null?($.deletions=[L],$.flags|=16):q.push(L)}}function a($,L){if(!e)return null;for(;L!==null;)n($,L),L=L.sibling;return null}function l($){for(var L=new Map;$!==null;)$.key!==null?L.set($.key,$):L.set($.index,$),$=$.sibling;return L}function f($,L){return $=Bs($,L),$.index=0,$.sibling=null,$}function h($,L,q){return $.index=q,e?(q=$.alternate,q!==null?(q=q.index,q<L?($.flags|=67108866,L):q):($.flags|=67108866,L)):($.flags|=1048576,L)}function _($){return e&&$.alternate===null&&($.flags|=67108866),$}function w($,L,q,ae){return L===null||L.tag!==6?(L=cu(q,$.mode,ae),L.return=$,L):(L=f(L,q),L.return=$,L)}function R($,L,q,ae){var je=q.type;return je===j?Q($,L,q.props.children,ae,q.key):L!==null&&(L.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===B&&fi(je)===L.type)?(L=f(L,q.props),lr(L,q),L.return=$,L):(L=Bl(q.type,q.key,q.props,null,$.mode,ae),lr(L,q),L.return=$,L)}function G($,L,q,ae){return L===null||L.tag!==4||L.stateNode.containerInfo!==q.containerInfo||L.stateNode.implementation!==q.implementation?(L=du(q,$.mode,ae),L.return=$,L):(L=f(L,q.children||[]),L.return=$,L)}function Q($,L,q,ae,je){return L===null||L.tag!==7?(L=ri(q,$.mode,ae,je),L.return=$,L):(L=f(L,q),L.return=$,L)}function ie($,L,q){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=cu(""+L,$.mode,q),L.return=$,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case k:return q=Bl(L.type,L.key,L.props,null,$.mode,q),lr(q,L),q.return=$,q;case S:return L=du(L,$.mode,q),L.return=$,L;case B:return L=fi(L),ie($,L,q)}if(oe(L)||K(L))return L=ri(L,$.mode,q,null),L.return=$,L;if(typeof L.then=="function")return ie($,Vl(L),q);if(L.$$typeof===A)return ie($,$l($,L),q);ql($,L)}return null}function F($,L,q,ae){var je=L!==null?L.key:null;if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return je!==null?null:w($,L,""+q,ae);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case k:return q.key===je?R($,L,q,ae):null;case S:return q.key===je?G($,L,q,ae):null;case B:return q=fi(q),F($,L,q,ae)}if(oe(q)||K(q))return je!==null?null:Q($,L,q,ae,null);if(typeof q.then=="function")return F($,L,Vl(q),ae);if(q.$$typeof===A)return F($,L,$l($,q),ae);ql($,q)}return null}function Z($,L,q,ae,je){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return $=$.get(q)||null,w(L,$,""+ae,je);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case k:return $=$.get(ae.key===null?q:ae.key)||null,R(L,$,ae,je);case S:return $=$.get(ae.key===null?q:ae.key)||null,G(L,$,ae,je);case B:return ae=fi(ae),Z($,L,q,ae,je)}if(oe(ae)||K(ae))return $=$.get(q)||null,Q(L,$,ae,je,null);if(typeof ae.then=="function")return Z($,L,q,Vl(ae),je);if(ae.$$typeof===A)return Z($,L,q,$l(L,ae),je);ql(L,ae)}return null}function be($,L,q,ae){for(var je=null,et=null,ke=L,Oe=L=0,Ve=null;ke!==null&&Oe<q.length;Oe++){ke.index>Oe?(Ve=ke,ke=null):Ve=ke.sibling;var tt=F($,ke,q[Oe],ae);if(tt===null){ke===null&&(ke=Ve);break}e&&ke&&tt.alternate===null&&n($,ke),L=h(tt,L,Oe),et===null?je=tt:et.sibling=tt,et=tt,ke=Ve}if(Oe===q.length)return a($,ke),Fe&&Ls($,Oe),je;if(ke===null){for(;Oe<q.length;Oe++)ke=ie($,q[Oe],ae),ke!==null&&(L=h(ke,L,Oe),et===null?je=ke:et.sibling=ke,et=ke);return Fe&&Ls($,Oe),je}for(ke=l(ke);Oe<q.length;Oe++)Ve=Z(ke,$,Oe,q[Oe],ae),Ve!==null&&(e&&Ve.alternate!==null&&ke.delete(Ve.key===null?Oe:Ve.key),L=h(Ve,L,Oe),et===null?je=Ve:et.sibling=Ve,et=Ve);return e&&ke.forEach(function(Oa){return n($,Oa)}),Fe&&Ls($,Oe),je}function Ce($,L,q,ae){if(q==null)throw Error(r(151));for(var je=null,et=null,ke=L,Oe=L=0,Ve=null,tt=q.next();ke!==null&&!tt.done;Oe++,tt=q.next()){ke.index>Oe?(Ve=ke,ke=null):Ve=ke.sibling;var Oa=F($,ke,tt.value,ae);if(Oa===null){ke===null&&(ke=Ve);break}e&&ke&&Oa.alternate===null&&n($,ke),L=h(Oa,L,Oe),et===null?je=Oa:et.sibling=Oa,et=Oa,ke=Ve}if(tt.done)return a($,ke),Fe&&Ls($,Oe),je;if(ke===null){for(;!tt.done;Oe++,tt=q.next())tt=ie($,tt.value,ae),tt!==null&&(L=h(tt,L,Oe),et===null?je=tt:et.sibling=tt,et=tt);return Fe&&Ls($,Oe),je}for(ke=l(ke);!tt.done;Oe++,tt=q.next())tt=Z(ke,$,Oe,tt.value,ae),tt!==null&&(e&&tt.alternate!==null&&ke.delete(tt.key===null?Oe:tt.key),L=h(tt,L,Oe),et===null?je=tt:et.sibling=tt,et=tt);return e&&ke.forEach(function(hT){return n($,hT)}),Fe&&Ls($,Oe),je}function pt($,L,q,ae){if(typeof q=="object"&&q!==null&&q.type===j&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case k:e:{for(var je=q.key;L!==null;){if(L.key===je){if(je=q.type,je===j){if(L.tag===7){a($,L.sibling),ae=f(L,q.props.children),ae.return=$,$=ae;break e}}else if(L.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===B&&fi(je)===L.type){a($,L.sibling),ae=f(L,q.props),lr(ae,q),ae.return=$,$=ae;break e}a($,L);break}else n($,L);L=L.sibling}q.type===j?(ae=ri(q.props.children,$.mode,ae,q.key),ae.return=$,$=ae):(ae=Bl(q.type,q.key,q.props,null,$.mode,ae),lr(ae,q),ae.return=$,$=ae)}return _($);case S:e:{for(je=q.key;L!==null;){if(L.key===je)if(L.tag===4&&L.stateNode.containerInfo===q.containerInfo&&L.stateNode.implementation===q.implementation){a($,L.sibling),ae=f(L,q.children||[]),ae.return=$,$=ae;break e}else{a($,L);break}else n($,L);L=L.sibling}ae=du(q,$.mode,ae),ae.return=$,$=ae}return _($);case B:return q=fi(q),pt($,L,q,ae)}if(oe(q))return be($,L,q,ae);if(K(q)){if(je=K(q),typeof je!="function")throw Error(r(150));return q=je.call(q),Ce($,L,q,ae)}if(typeof q.then=="function")return pt($,L,Vl(q),ae);if(q.$$typeof===A)return pt($,L,$l($,q),ae);ql($,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,L!==null&&L.tag===6?(a($,L.sibling),ae=f(L,q),ae.return=$,$=ae):(a($,L),ae=cu(q,$.mode,ae),ae.return=$,$=ae),_($)):a($,L)}return function($,L,q,ae){try{rr=0;var je=pt($,L,q,ae);return ro=null,je}catch(ke){if(ke===oo||ke===Ul)throw ke;var et=Nn(29,ke,null,$.mode);return et.lanes=ae,et.return=$,et}finally{}}}var mi=xg(!0),_g=xg(!1),ya=!1;function ku(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Su(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ba(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function xa(e,n,a){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(at&2)!==0){var f=l.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),l.pending=n,n=Ol(e),ag(e,null,a),n}return Il(e,l,n,a),Ol(e)}function cr(e,n,a){if(n=n.updateQueue,n!==null&&(n=n.shared,(a&4194048)!==0)){var l=n.lanes;l&=e.pendingLanes,a|=l,n.lanes=a,ge(e,a)}}function Tu(e,n){var a=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var f=null,h=null;if(a=a.firstBaseUpdate,a!==null){do{var _={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};h===null?f=h=_:h=h.next=_,a=a.next}while(a!==null);h===null?f=h=n:h=h.next=n}else f=h=n;a={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:l.shared,callbacks:l.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=n:e.next=n,a.lastBaseUpdate=n}var ju=!1;function dr(){if(ju){var e=io;if(e!==null)throw e}}function ur(e,n,a,l){ju=!1;var f=e.updateQueue;ya=!1;var h=f.firstBaseUpdate,_=f.lastBaseUpdate,w=f.shared.pending;if(w!==null){f.shared.pending=null;var R=w,G=R.next;R.next=null,_===null?h=G:_.next=G,_=R;var Q=e.alternate;Q!==null&&(Q=Q.updateQueue,w=Q.lastBaseUpdate,w!==_&&(w===null?Q.firstBaseUpdate=G:w.next=G,Q.lastBaseUpdate=R))}if(h!==null){var ie=f.baseState;_=0,Q=G=R=null,w=h;do{var F=w.lane&-536870913,Z=F!==w.lane;if(Z?(He&F)===F:(l&F)===F){F!==0&&F===ao&&(ju=!0),Q!==null&&(Q=Q.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var be=e,Ce=w;F=n;var pt=a;switch(Ce.tag){case 1:if(be=Ce.payload,typeof be=="function"){ie=be.call(pt,ie,F);break e}ie=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=Ce.payload,F=typeof be=="function"?be.call(pt,ie,F):be,F==null)break e;ie=x({},ie,F);break e;case 2:ya=!0}}F=w.callback,F!==null&&(e.flags|=64,Z&&(e.flags|=8192),Z=f.callbacks,Z===null?f.callbacks=[F]:Z.push(F))}else Z={lane:F,tag:w.tag,payload:w.payload,callback:w.callback,next:null},Q===null?(G=Q=Z,R=ie):Q=Q.next=Z,_|=F;if(w=w.next,w===null){if(w=f.shared.pending,w===null)break;Z=w,w=Z.next,Z.next=null,f.lastBaseUpdate=Z,f.shared.pending=null}}while(!0);Q===null&&(R=ie),f.baseState=R,f.firstBaseUpdate=G,f.lastBaseUpdate=Q,h===null&&(f.shared.lanes=0),ja|=_,e.lanes=_,e.memoizedState=ie}}function kg(e,n){if(typeof e!="function")throw Error(r(191,e));e.call(n)}function Sg(e,n){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)kg(a[e],n)}var lo=X(null),Gl=X(0);function Tg(e,n){e=Ks,Ne(Gl,e),Ne(lo,n),Ks=e|n.baseLanes}function wu(){Ne(Gl,Ks),Ne(lo,lo.current)}function Nu(){Ks=Gl.current,de(lo),de(Gl)}var Cn=X(null),Zn=null;function _a(e){var n=e.alternate;Ne(Lt,Lt.current&1),Ne(Cn,e),Zn===null&&(n===null||lo.current!==null||n.memoizedState!==null)&&(Zn=e)}function Cu(e){Ne(Lt,Lt.current),Ne(Cn,e),Zn===null&&(Zn=e)}function jg(e){e.tag===22?(Ne(Lt,Lt.current),Ne(Cn,e),Zn===null&&(Zn=e)):ka()}function ka(){Ne(Lt,Lt.current),Ne(Cn,Cn.current)}function En(e){de(Cn),Zn===e&&(Zn=null),de(Lt)}var Lt=X(0);function Fl(e){for(var n=e;n!==null;){if(n.tag===13){var a=n.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Of(a)||Bf(a)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Ps=0,Ie=null,ut=null,Vt=null,Zl=!1,co=!1,hi=!1,Kl=0,fr=0,uo=null,iS=0;function Et(){throw Error(r(321))}function Eu(e,n){if(n===null)return!1;for(var a=0;a<n.length&&a<e.length;a++)if(!wn(e[a],n[a]))return!1;return!0}function Au(e,n,a,l,f,h){return Ps=h,Ie=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,M.H=e===null||e.memoizedState===null?lv:Gu,hi=!1,h=a(l,f),hi=!1,co&&(h=Ng(n,a,l,f)),wg(e),h}function wg(e){M.H=hr;var n=ut!==null&&ut.next!==null;if(Ps=0,Vt=ut=Ie=null,Zl=!1,fr=0,uo=null,n)throw Error(r(300));e===null||qt||(e=e.dependencies,e!==null&&zl(e)&&(qt=!0))}function Ng(e,n,a,l){Ie=e;var f=0;do{if(co&&(uo=null),fr=0,co=!1,25<=f)throw Error(r(301));if(f+=1,Vt=ut=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}M.H=cv,h=n(a,l)}while(co);return h}function oS(){var e=M.H,n=e.useState()[0];return n=typeof n.then=="function"?pr(n):n,e=e.useState()[0],(ut!==null?ut.memoizedState:null)!==e&&(Ie.flags|=1024),n}function Du(){var e=Kl!==0;return Kl=0,e}function Mu(e,n,a){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~a}function Ru(e){if(Zl){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}Zl=!1}Ps=0,Vt=ut=Ie=null,co=!1,fr=Kl=0,uo=null}function hn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vt===null?Ie.memoizedState=Vt=e:Vt=Vt.next=e,Vt}function zt(){if(ut===null){var e=Ie.alternate;e=e!==null?e.memoizedState:null}else e=ut.next;var n=Vt===null?Ie.memoizedState:Vt.next;if(n!==null)Vt=n,ut=e;else{if(e===null)throw Ie.alternate===null?Error(r(467)):Error(r(310));ut=e,e={memoizedState:ut.memoizedState,baseState:ut.baseState,baseQueue:ut.baseQueue,queue:ut.queue,next:null},Vt===null?Ie.memoizedState=Vt=e:Vt=Vt.next=e}return Vt}function Yl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function pr(e){var n=fr;return fr+=1,uo===null&&(uo=[]),e=vg(uo,e,n),n=Ie,(Vt===null?n.memoizedState:Vt.next)===null&&(n=n.alternate,M.H=n===null||n.memoizedState===null?lv:Gu),e}function Jl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return pr(e);if(e.$$typeof===A)return on(e)}throw Error(r(438,String(e)))}function Iu(e){var n=null,a=Ie.updateQueue;if(a!==null&&(n=a.memoCache),n==null){var l=Ie.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(n={data:l.data.map(function(f){return f.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),a===null&&(a=Yl(),Ie.updateQueue=a),a.memoCache=n,a=n.data[n.index],a===void 0)for(a=n.data[n.index]=Array(e),l=0;l<e;l++)a[l]=J;return n.index++,a}function Us(e,n){return typeof n=="function"?n(e):n}function Wl(e){var n=zt();return Ou(n,ut,e)}function Ou(e,n,a){var l=e.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=a;var f=e.baseQueue,h=l.pending;if(h!==null){if(f!==null){var _=f.next;f.next=h.next,h.next=_}n.baseQueue=f=h,l.pending=null}if(h=e.baseState,f===null)e.memoizedState=h;else{n=f.next;var w=_=null,R=null,G=n,Q=!1;do{var ie=G.lane&-536870913;if(ie!==G.lane?(He&ie)===ie:(Ps&ie)===ie){var F=G.revertLane;if(F===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),ie===ao&&(Q=!0);else if((Ps&F)===F){G=G.next,F===ao&&(Q=!0);continue}else ie={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},R===null?(w=R=ie,_=h):R=R.next=ie,Ie.lanes|=F,ja|=F;ie=G.action,hi&&a(h,ie),h=G.hasEagerState?G.eagerState:a(h,ie)}else F={lane:ie,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},R===null?(w=R=F,_=h):R=R.next=F,Ie.lanes|=ie,ja|=ie;G=G.next}while(G!==null&&G!==n);if(R===null?_=h:R.next=w,!wn(h,e.memoizedState)&&(qt=!0,Q&&(a=io,a!==null)))throw a;e.memoizedState=h,e.baseState=_,e.baseQueue=R,l.lastRenderedState=h}return f===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Bu(e){var n=zt(),a=n.queue;if(a===null)throw Error(r(311));a.lastRenderedReducer=e;var l=a.dispatch,f=a.pending,h=n.memoizedState;if(f!==null){a.pending=null;var _=f=f.next;do h=e(h,_.action),_=_.next;while(_!==f);wn(h,n.memoizedState)||(qt=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),a.lastRenderedState=h}return[h,l]}function Cg(e,n,a){var l=Ie,f=zt(),h=Fe;if(h){if(a===void 0)throw Error(r(407));a=a()}else a=n();var _=!wn((ut||f).memoizedState,a);if(_&&(f.memoizedState=a,qt=!0),f=f.queue,$u(Dg.bind(null,l,f,e),[e]),f.getSnapshot!==n||_||Vt!==null&&Vt.memoizedState.tag&1){if(l.flags|=2048,fo(9,{destroy:void 0},Ag.bind(null,l,f,a,n),null),gt===null)throw Error(r(349));h||(Ps&127)!==0||Eg(l,n,a)}return a}function Eg(e,n,a){e.flags|=16384,e={getSnapshot:n,value:a},n=Ie.updateQueue,n===null?(n=Yl(),Ie.updateQueue=n,n.stores=[e]):(a=n.stores,a===null?n.stores=[e]:a.push(e))}function Ag(e,n,a,l){n.value=a,n.getSnapshot=l,Mg(n)&&Rg(e)}function Dg(e,n,a){return a(function(){Mg(n)&&Rg(e)})}function Mg(e){var n=e.getSnapshot;e=e.value;try{var a=n();return!wn(e,a)}catch{return!0}}function Rg(e){var n=oi(e,2);n!==null&&jn(n,e,2)}function Lu(e){var n=hn();if(typeof e=="function"){var a=e;if(e=a(),hi){mn(!0);try{a()}finally{mn(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Us,lastRenderedState:e},n}function Ig(e,n,a,l){return e.baseState=a,Ou(e,ut,typeof l=="function"?l:Us)}function rS(e,n,a,l,f){if(ec(e))throw Error(r(485));if(e=n.action,e!==null){var h={payload:f,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){h.listeners.push(_)}};M.T!==null?a(!0):h.isTransition=!1,l(h),a=n.pending,a===null?(h.next=n.pending=h,Og(n,h)):(h.next=a.next,n.pending=a.next=h)}}function Og(e,n){var a=n.action,l=n.payload,f=e.state;if(n.isTransition){var h=M.T,_={};M.T=_;try{var w=a(f,l),R=M.S;R!==null&&R(_,w),Bg(e,n,w)}catch(G){zu(e,n,G)}finally{h!==null&&_.types!==null&&(h.types=_.types),M.T=h}}else try{h=a(f,l),Bg(e,n,h)}catch(G){zu(e,n,G)}}function Bg(e,n,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(l){Lg(e,n,l)},function(l){return zu(e,n,l)}):Lg(e,n,a)}function Lg(e,n,a){n.status="fulfilled",n.value=a,zg(n),e.state=a,n=e.pending,n!==null&&(a=n.next,a===n?e.pending=null:(a=a.next,n.next=a,Og(e,a)))}function zu(e,n,a){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do n.status="rejected",n.reason=a,zg(n),n=n.next;while(n!==l)}e.action=null}function zg(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function $g(e,n){return n}function Pg(e,n){if(Fe){var a=gt.formState;if(a!==null){e:{var l=Ie;if(Fe){if(yt){t:{for(var f=yt,h=Fn;f.nodeType!==8;){if(!h){f=null;break t}if(f=Kn(f.nextSibling),f===null){f=null;break t}}h=f.data,f=h==="F!"||h==="F"?f:null}if(f){yt=Kn(f.nextSibling),l=f.data==="F!";break e}}ga(l)}l=!1}l&&(n=a[0])}}return a=hn(),a.memoizedState=a.baseState=n,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$g,lastRenderedState:n},a.queue=l,a=iv.bind(null,Ie,l),l.dispatch=a,l=Lu(!1),h=qu.bind(null,Ie,!1,l.queue),l=hn(),f={state:n,dispatch:null,action:e,pending:null},l.queue=f,a=rS.bind(null,Ie,f,h,a),f.dispatch=a,l.memoizedState=e,[n,a,!1]}function Ug(e){var n=zt();return Hg(n,ut,e)}function Hg(e,n,a){if(n=Ou(e,n,$g)[0],e=Wl(Us)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var l=pr(n)}catch(_){throw _===oo?Ul:_}else l=n;n=zt();var f=n.queue,h=f.dispatch;return a!==n.memoizedState&&(Ie.flags|=2048,fo(9,{destroy:void 0},lS.bind(null,f,a),null)),[l,h,e]}function lS(e,n){e.action=n}function Vg(e){var n=zt(),a=ut;if(a!==null)return Hg(n,a,e);zt(),n=n.memoizedState,a=zt();var l=a.queue.dispatch;return a.memoizedState=e,[n,l,!1]}function fo(e,n,a,l){return e={tag:e,create:a,deps:l,inst:n,next:null},n=Ie.updateQueue,n===null&&(n=Yl(),Ie.updateQueue=n),a=n.lastEffect,a===null?n.lastEffect=e.next=e:(l=a.next,a.next=e,e.next=l,n.lastEffect=e),e}function qg(){return zt().memoizedState}function Xl(e,n,a,l){var f=hn();Ie.flags|=e,f.memoizedState=fo(1|n,{destroy:void 0},a,l===void 0?null:l)}function Ql(e,n,a,l){var f=zt();l=l===void 0?null:l;var h=f.memoizedState.inst;ut!==null&&l!==null&&Eu(l,ut.memoizedState.deps)?f.memoizedState=fo(n,h,a,l):(Ie.flags|=e,f.memoizedState=fo(1|n,h,a,l))}function Gg(e,n){Xl(8390656,8,e,n)}function $u(e,n){Ql(2048,8,e,n)}function cS(e){Ie.flags|=4;var n=Ie.updateQueue;if(n===null)n=Yl(),Ie.updateQueue=n,n.events=[e];else{var a=n.events;a===null?n.events=[e]:a.push(e)}}function Fg(e){var n=zt().memoizedState;return cS({ref:n,nextImpl:e}),function(){if((at&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function Zg(e,n){return Ql(4,2,e,n)}function Kg(e,n){return Ql(4,4,e,n)}function Yg(e,n){if(typeof n=="function"){e=e();var a=n(e);return function(){typeof a=="function"?a():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Jg(e,n,a){a=a!=null?a.concat([e]):null,Ql(4,4,Yg.bind(null,n,e),a)}function Pu(){}function Wg(e,n){var a=zt();n=n===void 0?null:n;var l=a.memoizedState;return n!==null&&Eu(n,l[1])?l[0]:(a.memoizedState=[e,n],e)}function Xg(e,n){var a=zt();n=n===void 0?null:n;var l=a.memoizedState;if(n!==null&&Eu(n,l[1]))return l[0];if(l=e(),hi){mn(!0);try{e()}finally{mn(!1)}}return a.memoizedState=[l,n],l}function Uu(e,n,a){return a===void 0||(Ps&1073741824)!==0&&(He&261930)===0?e.memoizedState=n:(e.memoizedState=a,e=Qv(),Ie.lanes|=e,ja|=e,a)}function Qg(e,n,a,l){return wn(a,n)?a:lo.current!==null?(e=Uu(e,a,l),wn(e,n)||(qt=!0),e):(Ps&42)===0||(Ps&1073741824)!==0&&(He&261930)===0?(qt=!0,e.memoizedState=a):(e=Qv(),Ie.lanes|=e,ja|=e,n)}function ev(e,n,a,l,f){var h=H.p;H.p=h!==0&&8>h?h:8;var _=M.T,w={};M.T=w,qu(e,!1,n,a);try{var R=f(),G=M.S;if(G!==null&&G(w,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var Q=aS(R,l);mr(e,n,Q,Mn(e))}else mr(e,n,l,Mn(e))}catch(ie){mr(e,n,{then:function(){},status:"rejected",reason:ie},Mn())}finally{H.p=h,_!==null&&w.types!==null&&(_.types=w.types),M.T=_}}function dS(){}function Hu(e,n,a,l){if(e.tag!==5)throw Error(r(476));var f=tv(e).queue;ev(e,f,n,ne,a===null?dS:function(){return nv(e),a(l)})}function tv(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Us,lastRenderedState:ne},next:null};var a={};return n.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Us,lastRenderedState:a},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function nv(e){var n=tv(e);n.next===null&&(n=e.alternate.memoizedState),mr(e,n.next.queue,{},Mn())}function Vu(){return on(Dr)}function sv(){return zt().memoizedState}function av(){return zt().memoizedState}function uS(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var a=Mn();e=ba(a);var l=xa(n,e,a);l!==null&&(jn(l,n,a),cr(l,n,a)),n={cache:yu()},e.payload=n;return}n=n.return}}function fS(e,n,a){var l=Mn();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},ec(e)?ov(n,a):(a=ru(e,n,a,l),a!==null&&(jn(a,e,l),rv(a,n,l)))}function iv(e,n,a){var l=Mn();mr(e,n,a,l)}function mr(e,n,a,l){var f={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(ec(e))ov(n,f);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var _=n.lastRenderedState,w=h(_,a);if(f.hasEagerState=!0,f.eagerState=w,wn(w,_))return Il(e,n,f,0),gt===null&&Rl(),!1}catch{}finally{}if(a=ru(e,n,f,l),a!==null)return jn(a,e,l),rv(a,n,l),!0}return!1}function qu(e,n,a,l){if(l={lane:2,revertLane:Sf(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ec(e)){if(n)throw Error(r(479))}else n=ru(e,a,l,2),n!==null&&jn(n,e,2)}function ec(e){var n=e.alternate;return e===Ie||n!==null&&n===Ie}function ov(e,n){co=Zl=!0;var a=e.pending;a===null?n.next=n:(n.next=a.next,a.next=n),e.pending=n}function rv(e,n,a){if((a&4194048)!==0){var l=n.lanes;l&=e.pendingLanes,a|=l,n.lanes=a,ge(e,a)}}var hr={readContext:on,use:Jl,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useLayoutEffect:Et,useInsertionEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useSyncExternalStore:Et,useId:Et,useHostTransitionStatus:Et,useFormState:Et,useActionState:Et,useOptimistic:Et,useMemoCache:Et,useCacheRefresh:Et};hr.useEffectEvent=Et;var lv={readContext:on,use:Jl,useCallback:function(e,n){return hn().memoizedState=[e,n===void 0?null:n],e},useContext:on,useEffect:Gg,useImperativeHandle:function(e,n,a){a=a!=null?a.concat([e]):null,Xl(4194308,4,Yg.bind(null,n,e),a)},useLayoutEffect:function(e,n){return Xl(4194308,4,e,n)},useInsertionEffect:function(e,n){Xl(4,2,e,n)},useMemo:function(e,n){var a=hn();n=n===void 0?null:n;var l=e();if(hi){mn(!0);try{e()}finally{mn(!1)}}return a.memoizedState=[l,n],l},useReducer:function(e,n,a){var l=hn();if(a!==void 0){var f=a(n);if(hi){mn(!0);try{a(n)}finally{mn(!1)}}}else f=n;return l.memoizedState=l.baseState=f,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:f},l.queue=e,e=e.dispatch=fS.bind(null,Ie,e),[l.memoizedState,e]},useRef:function(e){var n=hn();return e={current:e},n.memoizedState=e},useState:function(e){e=Lu(e);var n=e.queue,a=iv.bind(null,Ie,n);return n.dispatch=a,[e.memoizedState,a]},useDebugValue:Pu,useDeferredValue:function(e,n){var a=hn();return Uu(a,e,n)},useTransition:function(){var e=Lu(!1);return e=ev.bind(null,Ie,e.queue,!0,!1),hn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,a){var l=Ie,f=hn();if(Fe){if(a===void 0)throw Error(r(407));a=a()}else{if(a=n(),gt===null)throw Error(r(349));(He&127)!==0||Eg(l,n,a)}f.memoizedState=a;var h={value:a,getSnapshot:n};return f.queue=h,Gg(Dg.bind(null,l,h,e),[e]),l.flags|=2048,fo(9,{destroy:void 0},Ag.bind(null,l,h,a,n),null),a},useId:function(){var e=hn(),n=gt.identifierPrefix;if(Fe){var a=ks,l=_s;a=(l&~(1<<32-Xt(l)-1)).toString(32)+a,n="_"+n+"R_"+a,a=Kl++,0<a&&(n+="H"+a.toString(32)),n+="_"}else a=iS++,n="_"+n+"r_"+a.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Vu,useFormState:Pg,useActionState:Pg,useOptimistic:function(e){var n=hn();n.memoizedState=n.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=a,n=qu.bind(null,Ie,!0,a),a.dispatch=n,[e,n]},useMemoCache:Iu,useCacheRefresh:function(){return hn().memoizedState=uS.bind(null,Ie)},useEffectEvent:function(e){var n=hn(),a={impl:e};return n.memoizedState=a,function(){if((at&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}},Gu={readContext:on,use:Jl,useCallback:Wg,useContext:on,useEffect:$u,useImperativeHandle:Jg,useInsertionEffect:Zg,useLayoutEffect:Kg,useMemo:Xg,useReducer:Wl,useRef:qg,useState:function(){return Wl(Us)},useDebugValue:Pu,useDeferredValue:function(e,n){var a=zt();return Qg(a,ut.memoizedState,e,n)},useTransition:function(){var e=Wl(Us)[0],n=zt().memoizedState;return[typeof e=="boolean"?e:pr(e),n]},useSyncExternalStore:Cg,useId:sv,useHostTransitionStatus:Vu,useFormState:Ug,useActionState:Ug,useOptimistic:function(e,n){var a=zt();return Ig(a,ut,e,n)},useMemoCache:Iu,useCacheRefresh:av};Gu.useEffectEvent=Fg;var cv={readContext:on,use:Jl,useCallback:Wg,useContext:on,useEffect:$u,useImperativeHandle:Jg,useInsertionEffect:Zg,useLayoutEffect:Kg,useMemo:Xg,useReducer:Bu,useRef:qg,useState:function(){return Bu(Us)},useDebugValue:Pu,useDeferredValue:function(e,n){var a=zt();return ut===null?Uu(a,e,n):Qg(a,ut.memoizedState,e,n)},useTransition:function(){var e=Bu(Us)[0],n=zt().memoizedState;return[typeof e=="boolean"?e:pr(e),n]},useSyncExternalStore:Cg,useId:sv,useHostTransitionStatus:Vu,useFormState:Vg,useActionState:Vg,useOptimistic:function(e,n){var a=zt();return ut!==null?Ig(a,ut,e,n):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Iu,useCacheRefresh:av};cv.useEffectEvent=Fg;function Fu(e,n,a,l){n=e.memoizedState,a=a(l,n),a=a==null?n:x({},n,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Zu={enqueueSetState:function(e,n,a){e=e._reactInternals;var l=Mn(),f=ba(l);f.payload=n,a!=null&&(f.callback=a),n=xa(e,f,l),n!==null&&(jn(n,e,l),cr(n,e,l))},enqueueReplaceState:function(e,n,a){e=e._reactInternals;var l=Mn(),f=ba(l);f.tag=1,f.payload=n,a!=null&&(f.callback=a),n=xa(e,f,l),n!==null&&(jn(n,e,l),cr(n,e,l))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var a=Mn(),l=ba(a);l.tag=2,n!=null&&(l.callback=n),n=xa(e,l,a),n!==null&&(jn(n,e,a),cr(n,e,a))}};function dv(e,n,a,l,f,h,_){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,h,_):n.prototype&&n.prototype.isPureReactComponent?!tr(a,l)||!tr(f,h):!0}function uv(e,n,a,l){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(a,l),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(a,l),n.state!==e&&Zu.enqueueReplaceState(n,n.state,null)}function gi(e,n){var a=n;if("ref"in n){a={};for(var l in n)l!=="ref"&&(a[l]=n[l])}if(e=e.defaultProps){a===n&&(a=x({},a));for(var f in e)a[f]===void 0&&(a[f]=e[f])}return a}function fv(e){Ml(e)}function pv(e){console.error(e)}function mv(e){Ml(e)}function tc(e,n){try{var a=e.onUncaughtError;a(n.value,{componentStack:n.stack})}catch(l){setTimeout(function(){throw l})}}function hv(e,n,a){try{var l=e.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Ku(e,n,a){return a=ba(a),a.tag=3,a.payload={element:null},a.callback=function(){tc(e,n)},a}function gv(e){return e=ba(e),e.tag=3,e}function vv(e,n,a,l){var f=a.type.getDerivedStateFromError;if(typeof f=="function"){var h=l.value;e.payload=function(){return f(h)},e.callback=function(){hv(n,a,l)}}var _=a.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(e.callback=function(){hv(n,a,l),typeof f!="function"&&(wa===null?wa=new Set([this]):wa.add(this));var w=l.stack;this.componentDidCatch(l.value,{componentStack:w!==null?w:""})})}function pS(e,n,a,l,f){if(a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(n=a.alternate,n!==null&&so(n,a,f,!0),a=Cn.current,a!==null){switch(a.tag){case 31:case 13:return Zn===null?pc():a.alternate===null&&At===0&&(At=3),a.flags&=-257,a.flags|=65536,a.lanes=f,l===Hl?a.flags|=16384:(n=a.updateQueue,n===null?a.updateQueue=new Set([l]):n.add(l),xf(e,l,f)),!1;case 22:return a.flags|=65536,l===Hl?a.flags|=16384:(n=a.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=n):(a=n.retryQueue,a===null?n.retryQueue=new Set([l]):a.add(l)),xf(e,l,f)),!1}throw Error(r(435,a.tag))}return xf(e,l,f),pc(),!1}if(Fe)return n=Cn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,l!==pu&&(e=Error(r(422),{cause:l}),ar(Vn(e,a)))):(l!==pu&&(n=Error(r(423),{cause:l}),ar(Vn(n,a))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,l=Vn(l,a),f=Ku(e.stateNode,l,f),Tu(e,f),At!==4&&(At=2)),!1;var h=Error(r(520),{cause:l});if(h=Vn(h,a),Sr===null?Sr=[h]:Sr.push(h),At!==4&&(At=2),n===null)return!0;l=Vn(l,a),a=n;do{switch(a.tag){case 3:return a.flags|=65536,e=f&-f,a.lanes|=e,e=Ku(a.stateNode,l,e),Tu(a,e),!1;case 1:if(n=a.type,h=a.stateNode,(a.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(wa===null||!wa.has(h))))return a.flags|=65536,f&=-f,a.lanes|=f,f=gv(f),vv(f,e,a,l),Tu(a,f),!1}a=a.return}while(a!==null);return!1}var Yu=Error(r(461)),qt=!1;function rn(e,n,a,l){n.child=e===null?_g(n,null,a,l):mi(n,e.child,a,l)}function yv(e,n,a,l,f){a=a.render;var h=n.ref;if("ref"in l){var _={};for(var w in l)w!=="ref"&&(_[w]=l[w])}else _=l;return di(n),l=Au(e,n,a,_,h,f),w=Du(),e!==null&&!qt?(Mu(e,n,f),Hs(e,n,f)):(Fe&&w&&uu(n),n.flags|=1,rn(e,n,l,f),n.child)}function bv(e,n,a,l,f){if(e===null){var h=a.type;return typeof h=="function"&&!lu(h)&&h.defaultProps===void 0&&a.compare===null?(n.tag=15,n.type=h,xv(e,n,h,l,f)):(e=Bl(a.type,null,l,n,n.mode,f),e.ref=n.ref,e.return=n,n.child=e)}if(h=e.child,!sf(e,f)){var _=h.memoizedProps;if(a=a.compare,a=a!==null?a:tr,a(_,l)&&e.ref===n.ref)return Hs(e,n,f)}return n.flags|=1,e=Bs(h,l),e.ref=n.ref,e.return=n,n.child=e}function xv(e,n,a,l,f){if(e!==null){var h=e.memoizedProps;if(tr(h,l)&&e.ref===n.ref)if(qt=!1,n.pendingProps=l=h,sf(e,f))(e.flags&131072)!==0&&(qt=!0);else return n.lanes=e.lanes,Hs(e,n,f)}return Ju(e,n,a,l,f)}function _v(e,n,a,l){var f=l.children,h=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((n.flags&128)!==0){if(h=h!==null?h.baseLanes|a:a,e!==null){for(l=n.child=e.child,f=0;l!==null;)f=f|l.lanes|l.childLanes,l=l.sibling;l=f&~h}else l=0,n.child=null;return kv(e,n,h,a,l)}if((a&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Pl(n,h!==null?h.cachePool:null),h!==null?Tg(n,h):wu(),jg(n);else return l=n.lanes=536870912,kv(e,n,h!==null?h.baseLanes|a:a,a,l)}else h!==null?(Pl(n,h.cachePool),Tg(n,h),ka(),n.memoizedState=null):(e!==null&&Pl(n,null),wu(),ka());return rn(e,n,f,a),n.child}function gr(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function kv(e,n,a,l,f){var h=xu();return h=h===null?null:{parent:Ht._currentValue,pool:h},n.memoizedState={baseLanes:a,cachePool:h},e!==null&&Pl(n,null),wu(),jg(n),e!==null&&so(e,n,l,!0),n.childLanes=f,null}function nc(e,n){return n=ac({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function Sv(e,n,a){return mi(n,e.child,null,a),e=nc(n,n.pendingProps),e.flags|=2,En(n),n.memoizedState=null,e}function mS(e,n,a){var l=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Fe){if(l.mode==="hidden")return e=nc(n,l),n.lanes=536870912,gr(null,e);if(Cu(n),(e=yt)?(e=O0(e,Fn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:ma!==null?{id:_s,overflow:ks}:null,retryLane:536870912,hydrationErrors:null},a=og(e),a.return=n,n.child=a,an=n,yt=null)):e=null,e===null)throw ga(n);return n.lanes=536870912,null}return nc(n,l)}var h=e.memoizedState;if(h!==null){var _=h.dehydrated;if(Cu(n),f)if(n.flags&256)n.flags&=-257,n=Sv(e,n,a);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(r(558));else if(qt||so(e,n,a,!1),f=(a&e.childLanes)!==0,qt||f){if(l=gt,l!==null&&(_=Ge(l,a),_!==0&&_!==h.retryLane))throw h.retryLane=_,oi(e,_),jn(l,e,_),Yu;pc(),n=Sv(e,n,a)}else e=h.treeContext,yt=Kn(_.nextSibling),an=n,Fe=!0,ha=null,Fn=!1,e!==null&&cg(n,e),n=nc(n,l),n.flags|=4096;return n}return e=Bs(e.child,{mode:l.mode,children:l.children}),e.ref=n.ref,n.child=e,e.return=n,e}function sc(e,n){var a=n.ref;if(a===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(r(284));(e===null||e.ref!==a)&&(n.flags|=4194816)}}function Ju(e,n,a,l,f){return di(n),a=Au(e,n,a,l,void 0,f),l=Du(),e!==null&&!qt?(Mu(e,n,f),Hs(e,n,f)):(Fe&&l&&uu(n),n.flags|=1,rn(e,n,a,f),n.child)}function Tv(e,n,a,l,f,h){return di(n),n.updateQueue=null,a=Ng(n,l,a,f),wg(e),l=Du(),e!==null&&!qt?(Mu(e,n,h),Hs(e,n,h)):(Fe&&l&&uu(n),n.flags|=1,rn(e,n,a,h),n.child)}function jv(e,n,a,l,f){if(di(n),n.stateNode===null){var h=Qi,_=a.contextType;typeof _=="object"&&_!==null&&(h=on(_)),h=new a(l,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Zu,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=l,h.state=n.memoizedState,h.refs={},ku(n),_=a.contextType,h.context=typeof _=="object"&&_!==null?on(_):Qi,h.state=n.memoizedState,_=a.getDerivedStateFromProps,typeof _=="function"&&(Fu(n,a,_,l),h.state=n.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(_=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),_!==h.state&&Zu.enqueueReplaceState(h,h.state,null),ur(n,l,h,f),dr(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),l=!0}else if(e===null){h=n.stateNode;var w=n.memoizedProps,R=gi(a,w);h.props=R;var G=h.context,Q=a.contextType;_=Qi,typeof Q=="object"&&Q!==null&&(_=on(Q));var ie=a.getDerivedStateFromProps;Q=typeof ie=="function"||typeof h.getSnapshotBeforeUpdate=="function",w=n.pendingProps!==w,Q||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(w||G!==_)&&uv(n,h,l,_),ya=!1;var F=n.memoizedState;h.state=F,ur(n,l,h,f),dr(),G=n.memoizedState,w||F!==G||ya?(typeof ie=="function"&&(Fu(n,a,ie,l),G=n.memoizedState),(R=ya||dv(n,a,R,l,F,G,_))?(Q||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"&&(n.flags|=4194308)):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=l,n.memoizedState=G),h.props=l,h.state=G,h.context=_,l=R):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),l=!1)}else{h=n.stateNode,Su(e,n),_=n.memoizedProps,Q=gi(a,_),h.props=Q,ie=n.pendingProps,F=h.context,G=a.contextType,R=Qi,typeof G=="object"&&G!==null&&(R=on(G)),w=a.getDerivedStateFromProps,(G=typeof w=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(_!==ie||F!==R)&&uv(n,h,l,R),ya=!1,F=n.memoizedState,h.state=F,ur(n,l,h,f),dr();var Z=n.memoizedState;_!==ie||F!==Z||ya||e!==null&&e.dependencies!==null&&zl(e.dependencies)?(typeof w=="function"&&(Fu(n,a,w,l),Z=n.memoizedState),(Q=ya||dv(n,a,Q,l,F,Z,R)||e!==null&&e.dependencies!==null&&zl(e.dependencies))?(G||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(l,Z,R),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(l,Z,R)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||_===e.memoizedProps&&F===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&F===e.memoizedState||(n.flags|=1024),n.memoizedProps=l,n.memoizedState=Z),h.props=l,h.state=Z,h.context=R,l=Q):(typeof h.componentDidUpdate!="function"||_===e.memoizedProps&&F===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&F===e.memoizedState||(n.flags|=1024),l=!1)}return h=l,sc(e,n),l=(n.flags&128)!==0,h||l?(h=n.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,e!==null&&l?(n.child=mi(n,e.child,null,f),n.child=mi(n,null,a,f)):rn(e,n,a,f),n.memoizedState=h.state,e=n.child):e=Hs(e,n,f),e}function wv(e,n,a,l){return li(),n.flags|=256,rn(e,n,a,l),n.child}var Wu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xu(e){return{baseLanes:e,cachePool:hg()}}function Qu(e,n,a){return e=e!==null?e.childLanes&~a:0,n&&(e|=Dn),e}function Nv(e,n,a){var l=n.pendingProps,f=!1,h=(n.flags&128)!==0,_;if((_=h)||(_=e!==null&&e.memoizedState===null?!1:(Lt.current&2)!==0),_&&(f=!0,n.flags&=-129),_=(n.flags&32)!==0,n.flags&=-33,e===null){if(Fe){if(f?_a(n):ka(),(e=yt)?(e=O0(e,Fn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:ma!==null?{id:_s,overflow:ks}:null,retryLane:536870912,hydrationErrors:null},a=og(e),a.return=n,n.child=a,an=n,yt=null)):e=null,e===null)throw ga(n);return Bf(e)?n.lanes=32:n.lanes=536870912,null}var w=l.children;return l=l.fallback,f?(ka(),f=n.mode,w=ac({mode:"hidden",children:w},f),l=ri(l,f,a,null),w.return=n,l.return=n,w.sibling=l,n.child=w,l=n.child,l.memoizedState=Xu(a),l.childLanes=Qu(e,_,a),n.memoizedState=Wu,gr(null,l)):(_a(n),ef(n,w))}var R=e.memoizedState;if(R!==null&&(w=R.dehydrated,w!==null)){if(h)n.flags&256?(_a(n),n.flags&=-257,n=tf(e,n,a)):n.memoizedState!==null?(ka(),n.child=e.child,n.flags|=128,n=null):(ka(),w=l.fallback,f=n.mode,l=ac({mode:"visible",children:l.children},f),w=ri(w,f,a,null),w.flags|=2,l.return=n,w.return=n,l.sibling=w,n.child=l,mi(n,e.child,null,a),l=n.child,l.memoizedState=Xu(a),l.childLanes=Qu(e,_,a),n.memoizedState=Wu,n=gr(null,l));else if(_a(n),Bf(w)){if(_=w.nextSibling&&w.nextSibling.dataset,_)var G=_.dgst;_=G,l=Error(r(419)),l.stack="",l.digest=_,ar({value:l,source:null,stack:null}),n=tf(e,n,a)}else if(qt||so(e,n,a,!1),_=(a&e.childLanes)!==0,qt||_){if(_=gt,_!==null&&(l=Ge(_,a),l!==0&&l!==R.retryLane))throw R.retryLane=l,oi(e,l),jn(_,e,l),Yu;Of(w)||pc(),n=tf(e,n,a)}else Of(w)?(n.flags|=192,n.child=e.child,n=null):(e=R.treeContext,yt=Kn(w.nextSibling),an=n,Fe=!0,ha=null,Fn=!1,e!==null&&cg(n,e),n=ef(n,l.children),n.flags|=4096);return n}return f?(ka(),w=l.fallback,f=n.mode,R=e.child,G=R.sibling,l=Bs(R,{mode:"hidden",children:l.children}),l.subtreeFlags=R.subtreeFlags&65011712,G!==null?w=Bs(G,w):(w=ri(w,f,a,null),w.flags|=2),w.return=n,l.return=n,l.sibling=w,n.child=l,gr(null,l),l=n.child,w=e.child.memoizedState,w===null?w=Xu(a):(f=w.cachePool,f!==null?(R=Ht._currentValue,f=f.parent!==R?{parent:R,pool:R}:f):f=hg(),w={baseLanes:w.baseLanes|a,cachePool:f}),l.memoizedState=w,l.childLanes=Qu(e,_,a),n.memoizedState=Wu,gr(e.child,l)):(_a(n),a=e.child,e=a.sibling,a=Bs(a,{mode:"visible",children:l.children}),a.return=n,a.sibling=null,e!==null&&(_=n.deletions,_===null?(n.deletions=[e],n.flags|=16):_.push(e)),n.child=a,n.memoizedState=null,a)}function ef(e,n){return n=ac({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function ac(e,n){return e=Nn(22,e,null,n),e.lanes=0,e}function tf(e,n,a){return mi(n,e.child,null,a),e=ef(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Cv(e,n,a){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n),gu(e.return,n,a)}function nf(e,n,a,l,f,h){var _=e.memoizedState;_===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:f,treeForkCount:h}:(_.isBackwards=n,_.rendering=null,_.renderingStartTime=0,_.last=l,_.tail=a,_.tailMode=f,_.treeForkCount=h)}function Ev(e,n,a){var l=n.pendingProps,f=l.revealOrder,h=l.tail;l=l.children;var _=Lt.current,w=(_&2)!==0;if(w?(_=_&1|2,n.flags|=128):_&=1,Ne(Lt,_),rn(e,n,l,a),l=Fe?sr:0,!w&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Cv(e,a,n);else if(e.tag===19)Cv(e,a,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(f){case"forwards":for(a=n.child,f=null;a!==null;)e=a.alternate,e!==null&&Fl(e)===null&&(f=a),a=a.sibling;a=f,a===null?(f=n.child,n.child=null):(f=a.sibling,a.sibling=null),nf(n,!1,f,a,h,l);break;case"backwards":case"unstable_legacy-backwards":for(a=null,f=n.child,n.child=null;f!==null;){if(e=f.alternate,e!==null&&Fl(e)===null){n.child=f;break}e=f.sibling,f.sibling=a,a=f,f=e}nf(n,!0,a,null,h,l);break;case"together":nf(n,!1,null,null,void 0,l);break;default:n.memoizedState=null}return n.child}function Hs(e,n,a){if(e!==null&&(n.dependencies=e.dependencies),ja|=n.lanes,(a&n.childLanes)===0)if(e!==null){if(so(e,n,a,!1),(a&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(r(153));if(n.child!==null){for(e=n.child,a=Bs(e,e.pendingProps),n.child=a,a.return=n;e.sibling!==null;)e=e.sibling,a=a.sibling=Bs(e,e.pendingProps),a.return=n;a.sibling=null}return n.child}function sf(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&zl(e)))}function hS(e,n,a){switch(n.tag){case 3:Be(n,n.stateNode.containerInfo),va(n,Ht,e.memoizedState.cache),li();break;case 27:case 5:zn(n);break;case 4:Be(n,n.stateNode.containerInfo);break;case 10:va(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Cu(n),null;break;case 13:var l=n.memoizedState;if(l!==null)return l.dehydrated!==null?(_a(n),n.flags|=128,null):(a&n.child.childLanes)!==0?Nv(e,n,a):(_a(n),e=Hs(e,n,a),e!==null?e.sibling:null);_a(n);break;case 19:var f=(e.flags&128)!==0;if(l=(a&n.childLanes)!==0,l||(so(e,n,a,!1),l=(a&n.childLanes)!==0),f){if(l)return Ev(e,n,a);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Ne(Lt,Lt.current),l)break;return null;case 22:return n.lanes=0,_v(e,n,a,n.pendingProps);case 24:va(n,Ht,e.memoizedState.cache)}return Hs(e,n,a)}function Av(e,n,a){if(e!==null)if(e.memoizedProps!==n.pendingProps)qt=!0;else{if(!sf(e,a)&&(n.flags&128)===0)return qt=!1,hS(e,n,a);qt=(e.flags&131072)!==0}else qt=!1,Fe&&(n.flags&1048576)!==0&&lg(n,sr,n.index);switch(n.lanes=0,n.tag){case 16:e:{var l=n.pendingProps;if(e=fi(n.elementType),n.type=e,typeof e=="function")lu(e)?(l=gi(e,l),n.tag=1,n=jv(null,n,e,l,a)):(n.tag=0,n=Ju(null,n,e,l,a));else{if(e!=null){var f=e.$$typeof;if(f===O){n.tag=11,n=yv(null,n,e,l,a);break e}else if(f===P){n.tag=14,n=bv(null,n,e,l,a);break e}}throw n=ee(e)||e,Error(r(306,n,""))}}return n;case 0:return Ju(e,n,n.type,n.pendingProps,a);case 1:return l=n.type,f=gi(l,n.pendingProps),jv(e,n,l,f,a);case 3:e:{if(Be(n,n.stateNode.containerInfo),e===null)throw Error(r(387));l=n.pendingProps;var h=n.memoizedState;f=h.element,Su(e,n),ur(n,l,null,a);var _=n.memoizedState;if(l=_.cache,va(n,Ht,l),l!==h.cache&&vu(n,[Ht],a,!0),dr(),l=_.element,h.isDehydrated)if(h={element:l,isDehydrated:!1,cache:_.cache},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){n=wv(e,n,l,a);break e}else if(l!==f){f=Vn(Error(r(424)),n),ar(f),n=wv(e,n,l,a);break e}else{switch(e=n.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(yt=Kn(e.firstChild),an=n,Fe=!0,ha=null,Fn=!0,a=_g(n,null,l,a),n.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(li(),l===f){n=Hs(e,n,a);break e}rn(e,n,l,a)}n=n.child}return n;case 26:return sc(e,n),e===null?(a=U0(n.type,null,n.pendingProps,null))?n.memoizedState=a:Fe||(a=n.type,e=n.pendingProps,l=xc(Se.current).createElement(a),l[Qe]=n,l[rt]=e,ln(l,a,e),Qt(l),n.stateNode=l):n.memoizedState=U0(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return zn(n),e===null&&Fe&&(l=n.stateNode=z0(n.type,n.pendingProps,Se.current),an=n,Fn=!0,f=yt,Aa(n.type)?(Lf=f,yt=Kn(l.firstChild)):yt=f),rn(e,n,n.pendingProps.children,a),sc(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Fe&&((f=l=yt)&&(l=GS(l,n.type,n.pendingProps,Fn),l!==null?(n.stateNode=l,an=n,yt=Kn(l.firstChild),Fn=!1,f=!0):f=!1),f||ga(n)),zn(n),f=n.type,h=n.pendingProps,_=e!==null?e.memoizedProps:null,l=h.children,Mf(f,h)?l=null:_!==null&&Mf(f,_)&&(n.flags|=32),n.memoizedState!==null&&(f=Au(e,n,oS,null,null,a),Dr._currentValue=f),sc(e,n),rn(e,n,l,a),n.child;case 6:return e===null&&Fe&&((e=a=yt)&&(a=FS(a,n.pendingProps,Fn),a!==null?(n.stateNode=a,an=n,yt=null,e=!0):e=!1),e||ga(n)),null;case 13:return Nv(e,n,a);case 4:return Be(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=mi(n,null,l,a):rn(e,n,l,a),n.child;case 11:return yv(e,n,n.type,n.pendingProps,a);case 7:return rn(e,n,n.pendingProps,a),n.child;case 8:return rn(e,n,n.pendingProps.children,a),n.child;case 12:return rn(e,n,n.pendingProps.children,a),n.child;case 10:return l=n.pendingProps,va(n,n.type,l.value),rn(e,n,l.children,a),n.child;case 9:return f=n.type._context,l=n.pendingProps.children,di(n),f=on(f),l=l(f),n.flags|=1,rn(e,n,l,a),n.child;case 14:return bv(e,n,n.type,n.pendingProps,a);case 15:return xv(e,n,n.type,n.pendingProps,a);case 19:return Ev(e,n,a);case 31:return mS(e,n,a);case 22:return _v(e,n,a,n.pendingProps);case 24:return di(n),l=on(Ht),e===null?(f=xu(),f===null&&(f=gt,h=yu(),f.pooledCache=h,h.refCount++,h!==null&&(f.pooledCacheLanes|=a),f=h),n.memoizedState={parent:l,cache:f},ku(n),va(n,Ht,f)):((e.lanes&a)!==0&&(Su(e,n),ur(n,null,null,a),dr()),f=e.memoizedState,h=n.memoizedState,f.parent!==l?(f={parent:l,cache:l},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),va(n,Ht,l)):(l=h.cache,va(n,Ht,l),l!==f.cache&&vu(n,[Ht],a,!0))),rn(e,n,n.pendingProps.children,a),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function Vs(e){e.flags|=4}function af(e,n,a,l,f){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(f&335544128)===f)if(e.stateNode.complete)e.flags|=8192;else if(s0())e.flags|=8192;else throw pi=Hl,_u}else e.flags&=-16777217}function Dv(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!F0(n))if(s0())e.flags|=8192;else throw pi=Hl,_u}function ic(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?_l():536870912,e.lanes|=n,go|=n)}function vr(e,n){if(!Fe)switch(e.tailMode){case"hidden":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function bt(e){var n=e.alternate!==null&&e.alternate.child===e.child,a=0,l=0;if(n)for(var f=e.child;f!==null;)a|=f.lanes|f.childLanes,l|=f.subtreeFlags&65011712,l|=f.flags&65011712,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)a|=f.lanes|f.childLanes,l|=f.subtreeFlags,l|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=l,e.childLanes=a,n}function gS(e,n,a){var l=n.pendingProps;switch(fu(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bt(n),null;case 1:return bt(n),null;case 3:return a=n.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),$s(Ht),It(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(no(n)?Vs(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,mu())),bt(n),null;case 26:var f=n.type,h=n.memoizedState;return e===null?(Vs(n),h!==null?(bt(n),Dv(n,h)):(bt(n),af(n,f,null,l,a))):h?h!==e.memoizedState?(Vs(n),bt(n),Dv(n,h)):(bt(n),n.flags&=-16777217):(e=e.memoizedProps,e!==l&&Vs(n),bt(n),af(n,f,e,l,a)),null;case 27:if(re(n),a=Se.current,f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==l&&Vs(n);else{if(!l){if(n.stateNode===null)throw Error(r(166));return bt(n),null}e=Ue.current,no(n)?dg(n):(e=z0(f,l,a),n.stateNode=e,Vs(n))}return bt(n),null;case 5:if(re(n),f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==l&&Vs(n);else{if(!l){if(n.stateNode===null)throw Error(r(166));return bt(n),null}if(h=Ue.current,no(n))dg(n);else{var _=xc(Se.current);switch(h){case 1:h=_.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:h=_.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":h=_.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":h=_.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":h=_.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof l.is=="string"?_.createElement("select",{is:l.is}):_.createElement("select"),l.multiple?h.multiple=!0:l.size&&(h.size=l.size);break;default:h=typeof l.is=="string"?_.createElement(f,{is:l.is}):_.createElement(f)}}h[Qe]=n,h[rt]=l;e:for(_=n.child;_!==null;){if(_.tag===5||_.tag===6)h.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===n)break e;for(;_.sibling===null;){if(_.return===null||_.return===n)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}n.stateNode=h;e:switch(ln(h,f,l),f){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Vs(n)}}return bt(n),af(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,a),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==l&&Vs(n);else{if(typeof l!="string"&&n.stateNode===null)throw Error(r(166));if(e=Se.current,no(n)){if(e=n.stateNode,a=n.memoizedProps,l=null,f=an,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}e[Qe]=n,e=!!(e.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||N0(e.nodeValue,a)),e||ga(n,!0)}else e=xc(e).createTextNode(l),e[Qe]=n,n.stateNode=e}return bt(n),null;case 31:if(a=n.memoizedState,e===null||e.memoizedState!==null){if(l=no(n),a!==null){if(e===null){if(!l)throw Error(r(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[Qe]=n}else li(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;bt(n),e=!1}else a=mu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return n.flags&256?(En(n),n):(En(n),null);if((n.flags&128)!==0)throw Error(r(558))}return bt(n),null;case 13:if(l=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=no(n),l!==null&&l.dehydrated!==null){if(e===null){if(!f)throw Error(r(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(r(317));f[Qe]=n}else li(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;bt(n),f=!1}else f=mu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(En(n),n):(En(n),null)}return En(n),(n.flags&128)!==0?(n.lanes=a,n):(a=l!==null,e=e!==null&&e.memoizedState!==null,a&&(l=n.child,f=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(f=l.alternate.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==f&&(l.flags|=2048)),a!==e&&a&&(n.child.flags|=8192),ic(n,n.updateQueue),bt(n),null);case 4:return It(),e===null&&Nf(n.stateNode.containerInfo),bt(n),null;case 10:return $s(n.type),bt(n),null;case 19:if(de(Lt),l=n.memoizedState,l===null)return bt(n),null;if(f=(n.flags&128)!==0,h=l.rendering,h===null)if(f)vr(l,!1);else{if(At!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(h=Fl(e),h!==null){for(n.flags|=128,vr(l,!1),e=h.updateQueue,n.updateQueue=e,ic(n,e),n.subtreeFlags=0,e=a,a=n.child;a!==null;)ig(a,e),a=a.sibling;return Ne(Lt,Lt.current&1|2),Fe&&Ls(n,l.treeForkCount),n.child}e=e.sibling}l.tail!==null&&Jt()>dc&&(n.flags|=128,f=!0,vr(l,!1),n.lanes=4194304)}else{if(!f)if(e=Fl(h),e!==null){if(n.flags|=128,f=!0,e=e.updateQueue,n.updateQueue=e,ic(n,e),vr(l,!0),l.tail===null&&l.tailMode==="hidden"&&!h.alternate&&!Fe)return bt(n),null}else 2*Jt()-l.renderingStartTime>dc&&a!==536870912&&(n.flags|=128,f=!0,vr(l,!1),n.lanes=4194304);l.isBackwards?(h.sibling=n.child,n.child=h):(e=l.last,e!==null?e.sibling=h:n.child=h,l.last=h)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Jt(),e.sibling=null,a=Lt.current,Ne(Lt,f?a&1|2:a&1),Fe&&Ls(n,l.treeForkCount),e):(bt(n),null);case 22:case 23:return En(n),Nu(),l=n.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(n.flags|=8192):l&&(n.flags|=8192),l?(a&536870912)!==0&&(n.flags&128)===0&&(bt(n),n.subtreeFlags&6&&(n.flags|=8192)):bt(n),a=n.updateQueue,a!==null&&ic(n,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),l=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),l!==a&&(n.flags|=2048),e!==null&&de(ui),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),$s(Ht),bt(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function vS(e,n){switch(fu(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return $s(Ht),It(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return re(n),null;case 31:if(n.memoizedState!==null){if(En(n),n.alternate===null)throw Error(r(340));li()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(En(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(r(340));li()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return de(Lt),null;case 4:return It(),null;case 10:return $s(n.type),null;case 22:case 23:return En(n),Nu(),e!==null&&de(ui),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return $s(Ht),null;case 25:return null;default:return null}}function Mv(e,n){switch(fu(n),n.tag){case 3:$s(Ht),It();break;case 26:case 27:case 5:re(n);break;case 4:It();break;case 31:n.memoizedState!==null&&En(n);break;case 13:En(n);break;case 19:de(Lt);break;case 10:$s(n.type);break;case 22:case 23:En(n),Nu(),e!==null&&de(ui);break;case 24:$s(Ht)}}function yr(e,n){try{var a=n.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var f=l.next;a=f;do{if((a.tag&e)===e){l=void 0;var h=a.create,_=a.inst;l=h(),_.destroy=l}a=a.next}while(a!==f)}}catch(w){ct(n,n.return,w)}}function Sa(e,n,a){try{var l=n.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var h=f.next;l=h;do{if((l.tag&e)===e){var _=l.inst,w=_.destroy;if(w!==void 0){_.destroy=void 0,f=n;var R=a,G=w;try{G()}catch(Q){ct(f,R,Q)}}}l=l.next}while(l!==h)}}catch(Q){ct(n,n.return,Q)}}function Rv(e){var n=e.updateQueue;if(n!==null){var a=e.stateNode;try{Sg(n,a)}catch(l){ct(e,e.return,l)}}}function Iv(e,n,a){a.props=gi(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(l){ct(e,n,l)}}function br(e,n){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof a=="function"?e.refCleanup=a(l):a.current=l}}catch(f){ct(e,n,f)}}function Ss(e,n){var a=e.ref,l=e.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(f){ct(e,n,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(f){ct(e,n,f)}else a.current=null}function Ov(e){var n=e.type,a=e.memoizedProps,l=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(f){ct(e,e.return,f)}}function of(e,n,a){try{var l=e.stateNode;$S(l,e.type,a,n),l[rt]=n}catch(f){ct(e,e.return,f)}}function Bv(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Aa(e.type)||e.tag===4}function rf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Bv(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&&Aa(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 lf(e,n,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,n):(n=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,n.appendChild(e),a=a._reactRootContainer,a!=null||n.onclick!==null||(n.onclick=Is));else if(l!==4&&(l===27&&Aa(e.type)&&(a=e.stateNode,n=null),e=e.child,e!==null))for(lf(e,n,a),e=e.sibling;e!==null;)lf(e,n,a),e=e.sibling}function oc(e,n,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?a.insertBefore(e,n):a.appendChild(e);else if(l!==4&&(l===27&&Aa(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(oc(e,n,a),e=e.sibling;e!==null;)oc(e,n,a),e=e.sibling}function Lv(e){var n=e.stateNode,a=e.memoizedProps;try{for(var l=e.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);ln(n,l,a),n[Qe]=e,n[rt]=a}catch(h){ct(e,e.return,h)}}var qs=!1,Gt=!1,cf=!1,zv=typeof WeakSet=="function"?WeakSet:Set,en=null;function yS(e,n){if(e=e.containerInfo,Af=Nc,e=Jh(e),tu(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var f=l.anchorOffset,h=l.focusNode;l=l.focusOffset;try{a.nodeType,h.nodeType}catch{a=null;break e}var _=0,w=-1,R=-1,G=0,Q=0,ie=e,F=null;t:for(;;){for(var Z;ie!==a||f!==0&&ie.nodeType!==3||(w=_+f),ie!==h||l!==0&&ie.nodeType!==3||(R=_+l),ie.nodeType===3&&(_+=ie.nodeValue.length),(Z=ie.firstChild)!==null;)F=ie,ie=Z;for(;;){if(ie===e)break t;if(F===a&&++G===f&&(w=_),F===h&&++Q===l&&(R=_),(Z=ie.nextSibling)!==null)break;ie=F,F=ie.parentNode}ie=Z}a=w===-1||R===-1?null:{start:w,end:R}}else a=null}a=a||{start:0,end:0}}else a=null;for(Df={focusedElem:e,selectionRange:a},Nc=!1,en=n;en!==null;)if(n=en,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,en=e;else for(;en!==null;){switch(n=en,h=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)f=e[a],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,a=n,f=h.memoizedProps,h=h.memoizedState,l=a.stateNode;try{var be=gi(a.type,f);e=l.getSnapshotBeforeUpdate(be,h),l.__reactInternalSnapshotBeforeUpdate=e}catch(Ce){ct(a,a.return,Ce)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,a=e.nodeType,a===9)If(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":If(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(r(163))}if(e=n.sibling,e!==null){e.return=n.return,en=e;break}en=n.return}}function $v(e,n,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:Fs(e,a),l&4&&yr(5,a);break;case 1:if(Fs(e,a),l&4)if(e=a.stateNode,n===null)try{e.componentDidMount()}catch(_){ct(a,a.return,_)}else{var f=gi(a.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(f,n,e.__reactInternalSnapshotBeforeUpdate)}catch(_){ct(a,a.return,_)}}l&64&&Rv(a),l&512&&br(a,a.return);break;case 3:if(Fs(e,a),l&64&&(e=a.updateQueue,e!==null)){if(n=null,a.child!==null)switch(a.child.tag){case 27:case 5:n=a.child.stateNode;break;case 1:n=a.child.stateNode}try{Sg(e,n)}catch(_){ct(a,a.return,_)}}break;case 27:n===null&&l&4&&Lv(a);case 26:case 5:Fs(e,a),n===null&&l&4&&Ov(a),l&512&&br(a,a.return);break;case 12:Fs(e,a);break;case 31:Fs(e,a),l&4&&Hv(e,a);break;case 13:Fs(e,a),l&4&&Vv(e,a),l&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=NS.bind(null,a),ZS(e,a))));break;case 22:if(l=a.memoizedState!==null||qs,!l){n=n!==null&&n.memoizedState!==null||Gt,f=qs;var h=Gt;qs=l,(Gt=n)&&!h?Zs(e,a,(a.subtreeFlags&8772)!==0):Fs(e,a),qs=f,Gt=h}break;case 30:break;default:Fs(e,a)}}function Pv(e){var n=e.alternate;n!==null&&(e.alternate=null,Pv(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&zd(n)),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 Tt=null,_n=!1;function Gs(e,n,a){for(a=a.child;a!==null;)Uv(e,n,a),a=a.sibling}function Uv(e,n,a){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(Wt,a)}catch{}switch(a.tag){case 26:Gt||Ss(a,n),Gs(e,n,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Gt||Ss(a,n);var l=Tt,f=_n;Aa(a.type)&&(Tt=a.stateNode,_n=!1),Gs(e,n,a),Cr(a.stateNode),Tt=l,_n=f;break;case 5:Gt||Ss(a,n);case 6:if(l=Tt,f=_n,Tt=null,Gs(e,n,a),Tt=l,_n=f,Tt!==null)if(_n)try{(Tt.nodeType===9?Tt.body:Tt.nodeName==="HTML"?Tt.ownerDocument.body:Tt).removeChild(a.stateNode)}catch(h){ct(a,n,h)}else try{Tt.removeChild(a.stateNode)}catch(h){ct(a,n,h)}break;case 18:Tt!==null&&(_n?(e=Tt,R0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),To(e)):R0(Tt,a.stateNode));break;case 4:l=Tt,f=_n,Tt=a.stateNode.containerInfo,_n=!0,Gs(e,n,a),Tt=l,_n=f;break;case 0:case 11:case 14:case 15:Sa(2,a,n),Gt||Sa(4,a,n),Gs(e,n,a);break;case 1:Gt||(Ss(a,n),l=a.stateNode,typeof l.componentWillUnmount=="function"&&Iv(a,n,l)),Gs(e,n,a);break;case 21:Gs(e,n,a);break;case 22:Gt=(l=Gt)||a.memoizedState!==null,Gs(e,n,a),Gt=l;break;default:Gs(e,n,a)}}function Hv(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{To(e)}catch(a){ct(n,n.return,a)}}}function Vv(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{To(e)}catch(a){ct(n,n.return,a)}}function bS(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new zv),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new zv),n;default:throw Error(r(435,e.tag))}}function rc(e,n){var a=bS(e);n.forEach(function(l){if(!a.has(l)){a.add(l);var f=CS.bind(null,e,l);l.then(f,f)}})}function kn(e,n){var a=n.deletions;if(a!==null)for(var l=0;l<a.length;l++){var f=a[l],h=e,_=n,w=_;e:for(;w!==null;){switch(w.tag){case 27:if(Aa(w.type)){Tt=w.stateNode,_n=!1;break e}break;case 5:Tt=w.stateNode,_n=!1;break e;case 3:case 4:Tt=w.stateNode.containerInfo,_n=!0;break e}w=w.return}if(Tt===null)throw Error(r(160));Uv(h,_,f),Tt=null,_n=!1,h=f.alternate,h!==null&&(h.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)qv(n,e),n=n.sibling}var rs=null;function qv(e,n){var a=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:kn(n,e),Sn(e),l&4&&(Sa(3,e,e.return),yr(3,e),Sa(5,e,e.return));break;case 1:kn(n,e),Sn(e),l&512&&(Gt||a===null||Ss(a,a.return)),l&64&&qs&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?l:a.concat(l))));break;case 26:var f=rs;if(kn(n,e),Sn(e),l&512&&(Gt||a===null||Ss(a,a.return)),l&4){var h=a!==null?a.memoizedState:null;if(l=e.memoizedState,a===null)if(l===null)if(e.stateNode===null){e:{l=e.type,a=e.memoizedProps,f=f.ownerDocument||f;t:switch(l){case"title":h=f.getElementsByTagName("title")[0],(!h||h[Fo]||h[Qe]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=f.createElement(l),f.head.insertBefore(h,f.querySelector("head > title"))),ln(h,l,a),h[Qe]=e,Qt(h),l=h;break e;case"link":var _=q0("link","href",f).get(l+(a.href||""));if(_){for(var w=0;w<_.length;w++)if(h=_[w],h.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&h.getAttribute("rel")===(a.rel==null?null:a.rel)&&h.getAttribute("title")===(a.title==null?null:a.title)&&h.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){_.splice(w,1);break t}}h=f.createElement(l),ln(h,l,a),f.head.appendChild(h);break;case"meta":if(_=q0("meta","content",f).get(l+(a.content||""))){for(w=0;w<_.length;w++)if(h=_[w],h.getAttribute("content")===(a.content==null?null:""+a.content)&&h.getAttribute("name")===(a.name==null?null:a.name)&&h.getAttribute("property")===(a.property==null?null:a.property)&&h.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&h.getAttribute("charset")===(a.charSet==null?null:a.charSet)){_.splice(w,1);break t}}h=f.createElement(l),ln(h,l,a),f.head.appendChild(h);break;default:throw Error(r(468,l))}h[Qe]=e,Qt(h),l=h}e.stateNode=l}else G0(f,e.type,e.stateNode);else e.stateNode=V0(f,l,e.memoizedProps);else h!==l?(h===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):h.count--,l===null?G0(f,e.type,e.stateNode):V0(f,l,e.memoizedProps)):l===null&&e.stateNode!==null&&of(e,e.memoizedProps,a.memoizedProps)}break;case 27:kn(n,e),Sn(e),l&512&&(Gt||a===null||Ss(a,a.return)),a!==null&&l&4&&of(e,e.memoizedProps,a.memoizedProps);break;case 5:if(kn(n,e),Sn(e),l&512&&(Gt||a===null||Ss(a,a.return)),e.flags&32){f=e.stateNode;try{Fi(f,"")}catch(be){ct(e,e.return,be)}}l&4&&e.stateNode!=null&&(f=e.memoizedProps,of(e,f,a!==null?a.memoizedProps:f)),l&1024&&(cf=!0);break;case 6:if(kn(n,e),Sn(e),l&4){if(e.stateNode===null)throw Error(r(162));l=e.memoizedProps,a=e.stateNode;try{a.nodeValue=l}catch(be){ct(e,e.return,be)}}break;case 3:if(Sc=null,f=rs,rs=_c(n.containerInfo),kn(n,e),rs=f,Sn(e),l&4&&a!==null&&a.memoizedState.isDehydrated)try{To(n.containerInfo)}catch(be){ct(e,e.return,be)}cf&&(cf=!1,Gv(e));break;case 4:l=rs,rs=_c(e.stateNode.containerInfo),kn(n,e),Sn(e),rs=l;break;case 12:kn(n,e),Sn(e);break;case 31:kn(n,e),Sn(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,rc(e,l)));break;case 13:kn(n,e),Sn(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(cc=Jt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,rc(e,l)));break;case 22:f=e.memoizedState!==null;var R=a!==null&&a.memoizedState!==null,G=qs,Q=Gt;if(qs=G||f,Gt=Q||R,kn(n,e),Gt=Q,qs=G,Sn(e),l&8192)e:for(n=e.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(a===null||R||qs||Gt||vi(e)),a=null,n=e;;){if(n.tag===5||n.tag===26){if(a===null){R=a=n;try{if(h=R.stateNode,f)_=h.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{w=R.stateNode;var ie=R.memoizedProps.style,F=ie!=null&&ie.hasOwnProperty("display")?ie.display:null;w.style.display=F==null||typeof F=="boolean"?"":(""+F).trim()}}catch(be){ct(R,R.return,be)}}}else if(n.tag===6){if(a===null){R=n;try{R.stateNode.nodeValue=f?"":R.memoizedProps}catch(be){ct(R,R.return,be)}}}else if(n.tag===18){if(a===null){R=n;try{var Z=R.stateNode;f?I0(Z,!0):I0(R.stateNode,!1)}catch(be){ct(R,R.return,be)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;a===n&&(a=null),n=n.return}a===n&&(a=null),n.sibling.return=n.return,n=n.sibling}l&4&&(l=e.updateQueue,l!==null&&(a=l.retryQueue,a!==null&&(l.retryQueue=null,rc(e,a))));break;case 19:kn(n,e),Sn(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,rc(e,l)));break;case 30:break;case 21:break;default:kn(n,e),Sn(e)}}function Sn(e){var n=e.flags;if(n&2){try{for(var a,l=e.return;l!==null;){if(Bv(l)){a=l;break}l=l.return}if(a==null)throw Error(r(160));switch(a.tag){case 27:var f=a.stateNode,h=rf(e);oc(e,h,f);break;case 5:var _=a.stateNode;a.flags&32&&(Fi(_,""),a.flags&=-33);var w=rf(e);oc(e,w,_);break;case 3:case 4:var R=a.stateNode.containerInfo,G=rf(e);lf(e,G,R);break;default:throw Error(r(161))}}catch(Q){ct(e,e.return,Q)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Gv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Gv(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Fs(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)$v(e,n.alternate,n),n=n.sibling}function vi(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:Sa(4,n,n.return),vi(n);break;case 1:Ss(n,n.return);var a=n.stateNode;typeof a.componentWillUnmount=="function"&&Iv(n,n.return,a),vi(n);break;case 27:Cr(n.stateNode);case 26:case 5:Ss(n,n.return),vi(n);break;case 22:n.memoizedState===null&&vi(n);break;case 30:vi(n);break;default:vi(n)}e=e.sibling}}function Zs(e,n,a){for(a=a&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var l=n.alternate,f=e,h=n,_=h.flags;switch(h.tag){case 0:case 11:case 15:Zs(f,h,a),yr(4,h);break;case 1:if(Zs(f,h,a),l=h,f=l.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(G){ct(l,l.return,G)}if(l=h,f=l.updateQueue,f!==null){var w=l.stateNode;try{var R=f.shared.hiddenCallbacks;if(R!==null)for(f.shared.hiddenCallbacks=null,f=0;f<R.length;f++)kg(R[f],w)}catch(G){ct(l,l.return,G)}}a&&_&64&&Rv(h),br(h,h.return);break;case 27:Lv(h);case 26:case 5:Zs(f,h,a),a&&l===null&&_&4&&Ov(h),br(h,h.return);break;case 12:Zs(f,h,a);break;case 31:Zs(f,h,a),a&&_&4&&Hv(f,h);break;case 13:Zs(f,h,a),a&&_&4&&Vv(f,h);break;case 22:h.memoizedState===null&&Zs(f,h,a),br(h,h.return);break;case 30:break;default:Zs(f,h,a)}n=n.sibling}}function df(e,n){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&ir(a))}function uf(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&ir(e))}function ls(e,n,a,l){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Fv(e,n,a,l),n=n.sibling}function Fv(e,n,a,l){var f=n.flags;switch(n.tag){case 0:case 11:case 15:ls(e,n,a,l),f&2048&&yr(9,n);break;case 1:ls(e,n,a,l);break;case 3:ls(e,n,a,l),f&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&ir(e)));break;case 12:if(f&2048){ls(e,n,a,l),e=n.stateNode;try{var h=n.memoizedProps,_=h.id,w=h.onPostCommit;typeof w=="function"&&w(_,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(R){ct(n,n.return,R)}}else ls(e,n,a,l);break;case 31:ls(e,n,a,l);break;case 13:ls(e,n,a,l);break;case 23:break;case 22:h=n.stateNode,_=n.alternate,n.memoizedState!==null?h._visibility&2?ls(e,n,a,l):xr(e,n):h._visibility&2?ls(e,n,a,l):(h._visibility|=2,po(e,n,a,l,(n.subtreeFlags&10256)!==0||!1)),f&2048&&df(_,n);break;case 24:ls(e,n,a,l),f&2048&&uf(n.alternate,n);break;default:ls(e,n,a,l)}}function po(e,n,a,l,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=e,_=n,w=a,R=l,G=_.flags;switch(_.tag){case 0:case 11:case 15:po(h,_,w,R,f),yr(8,_);break;case 23:break;case 22:var Q=_.stateNode;_.memoizedState!==null?Q._visibility&2?po(h,_,w,R,f):xr(h,_):(Q._visibility|=2,po(h,_,w,R,f)),f&&G&2048&&df(_.alternate,_);break;case 24:po(h,_,w,R,f),f&&G&2048&&uf(_.alternate,_);break;default:po(h,_,w,R,f)}n=n.sibling}}function xr(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var a=e,l=n,f=l.flags;switch(l.tag){case 22:xr(a,l),f&2048&&df(l.alternate,l);break;case 24:xr(a,l),f&2048&&uf(l.alternate,l);break;default:xr(a,l)}n=n.sibling}}var _r=8192;function mo(e,n,a){if(e.subtreeFlags&_r)for(e=e.child;e!==null;)Zv(e,n,a),e=e.sibling}function Zv(e,n,a){switch(e.tag){case 26:mo(e,n,a),e.flags&_r&&e.memoizedState!==null&&iT(a,rs,e.memoizedState,e.memoizedProps);break;case 5:mo(e,n,a);break;case 3:case 4:var l=rs;rs=_c(e.stateNode.containerInfo),mo(e,n,a),rs=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=_r,_r=16777216,mo(e,n,a),_r=l):mo(e,n,a));break;default:mo(e,n,a)}}function Kv(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function kr(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var l=n[a];en=l,Jv(l,e)}Kv(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Yv(e),e=e.sibling}function Yv(e){switch(e.tag){case 0:case 11:case 15:kr(e),e.flags&2048&&Sa(9,e,e.return);break;case 3:kr(e);break;case 12:kr(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,lc(e)):kr(e);break;default:kr(e)}}function lc(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var l=n[a];en=l,Jv(l,e)}Kv(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:Sa(8,n,n.return),lc(n);break;case 22:a=n.stateNode,a._visibility&2&&(a._visibility&=-3,lc(n));break;default:lc(n)}e=e.sibling}}function Jv(e,n){for(;en!==null;){var a=en;switch(a.tag){case 0:case 11:case 15:Sa(8,a,n);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:ir(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,en=l;else e:for(a=e;en!==null;){l=en;var f=l.sibling,h=l.return;if(Pv(l),l===a){en=null;break e}if(f!==null){f.return=h,en=f;break e}en=h}}}var xS={getCacheForType:function(e){var n=on(Ht),a=n.data.get(e);return a===void 0&&(a=e(),n.data.set(e,a)),a},cacheSignal:function(){return on(Ht).controller.signal}},_S=typeof WeakMap=="function"?WeakMap:Map,at=0,gt=null,$e=null,He=0,lt=0,An=null,Ta=!1,ho=!1,ff=!1,Ks=0,At=0,ja=0,yi=0,pf=0,Dn=0,go=0,Sr=null,Tn=null,mf=!1,cc=0,Wv=0,dc=1/0,uc=null,wa=null,Zt=0,Na=null,vo=null,Ys=0,hf=0,gf=null,Xv=null,Tr=0,vf=null;function Mn(){return(at&2)!==0&&He!==0?He&-He:M.T!==null?Sf():Xe()}function Qv(){if(Dn===0)if((He&536870912)===0||Fe){var e=Qa;Qa<<=1,(Qa&3932160)===0&&(Qa=262144),Dn=e}else Dn=536870912;return e=Cn.current,e!==null&&(e.flags|=32),Dn}function jn(e,n,a){(e===gt&&(lt===2||lt===9)||e.cancelPendingCommit!==null)&&(yo(e,0),Ca(e,He,Dn,!1)),te(e,a),((at&2)===0||e!==gt)&&(e===gt&&((at&2)===0&&(yi|=a),At===4&&Ca(e,He,Dn,!1)),Ts(e))}function e0(e,n,a){if((at&6)!==0)throw Error(r(327));var l=!a&&(n&127)===0&&(n&e.expiredLanes)===0||fa(e,n),f=l?TS(e,n):bf(e,n,!0),h=l;do{if(f===0){ho&&!l&&Ca(e,n,0,!1);break}else{if(a=e.current.alternate,h&&!kS(a)){f=bf(e,n,!1),h=!1;continue}if(f===2){if(h=n,e.errorRecoveryDisabledLanes&h)var _=0;else _=e.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){n=_;e:{var w=e;f=Sr;var R=w.current.memoizedState.isDehydrated;if(R&&(yo(w,_).flags|=256),_=bf(w,_,!1),_!==2){if(ff&&!R){w.errorRecoveryDisabledLanes|=h,yi|=h,f=4;break e}h=Tn,Tn=f,h!==null&&(Tn===null?Tn=h:Tn.push.apply(Tn,h))}f=_}if(h=!1,f!==2)continue}}if(f===1){yo(e,0),Ca(e,n,0,!0);break}e:{switch(l=e,h=f,h){case 0:case 1:throw Error(r(345));case 4:if((n&4194048)!==n)break;case 6:Ca(l,n,Dn,!Ta);break e;case 2:Tn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(f=cc+300-Jt(),10<f)){if(Ca(l,n,Dn,!Ta),ti(l,0,!0)!==0)break e;Ys=n,l.timeoutHandle=D0(t0.bind(null,l,a,Tn,uc,mf,n,Dn,yi,go,Ta,h,"Throttled",-0,0),f);break e}t0(l,a,Tn,uc,mf,n,Dn,yi,go,Ta,h,null,-0,0)}}break}while(!0);Ts(e)}function t0(e,n,a,l,f,h,_,w,R,G,Q,ie,F,Z){if(e.timeoutHandle=-1,ie=n.subtreeFlags,ie&8192||(ie&16785408)===16785408){ie={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Is},Zv(n,h,ie);var be=(h&62914560)===h?cc-Jt():(h&4194048)===h?Wv-Jt():0;if(be=oT(ie,be),be!==null){Ys=h,e.cancelPendingCommit=be(c0.bind(null,e,n,h,a,l,f,_,w,R,Q,ie,null,F,Z)),Ca(e,h,_,!G);return}}c0(e,n,h,a,l,f,_,w,R)}function kS(e){for(var n=e;;){var a=n.tag;if((a===0||a===11||a===15)&&n.flags&16384&&(a=n.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var f=a[l],h=f.getSnapshot;f=f.value;try{if(!wn(h(),f))return!1}catch{return!1}}if(a=n.child,n.subtreeFlags&16384&&a!==null)a.return=n,n=a;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Ca(e,n,a,l){n&=~pf,n&=~yi,e.suspendedLanes|=n,e.pingedLanes&=~n,l&&(e.warmLanes|=n),l=e.expirationTimes;for(var f=n;0<f;){var h=31-Xt(f),_=1<<h;l[h]=-1,f&=~_}a!==0&&ue(e,a,n)}function fc(){return(at&6)===0?(jr(0),!1):!0}function yf(){if($e!==null){if(lt===0)var e=$e.return;else e=$e,zs=ci=null,Ru(e),ro=null,rr=0,e=$e;for(;e!==null;)Mv(e.alternate,e),e=e.return;$e=null}}function yo(e,n){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,HS(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Ys=0,yf(),gt=e,$e=a=Bs(e.current,null),He=n,lt=0,An=null,Ta=!1,ho=fa(e,n),ff=!1,go=Dn=pf=yi=ja=At=0,Tn=Sr=null,mf=!1,(n&8)!==0&&(n|=n&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=n;0<l;){var f=31-Xt(l),h=1<<f;n|=e[f],l&=~h}return Ks=n,Rl(),a}function n0(e,n){Ie=null,M.H=hr,n===oo||n===Ul?(n=yg(),lt=3):n===_u?(n=yg(),lt=4):lt=n===Yu?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,An=n,$e===null&&(At=1,tc(e,Vn(n,e.current)))}function s0(){var e=Cn.current;return e===null?!0:(He&4194048)===He?Zn===null:(He&62914560)===He||(He&536870912)!==0?e===Zn:!1}function a0(){var e=M.H;return M.H=hr,e===null?hr:e}function i0(){var e=M.A;return M.A=xS,e}function pc(){At=4,Ta||(He&4194048)!==He&&Cn.current!==null||(ho=!0),(ja&134217727)===0&&(yi&134217727)===0||gt===null||Ca(gt,He,Dn,!1)}function bf(e,n,a){var l=at;at|=2;var f=a0(),h=i0();(gt!==e||He!==n)&&(uc=null,yo(e,n)),n=!1;var _=At;e:do try{if(lt!==0&&$e!==null){var w=$e,R=An;switch(lt){case 8:yf(),_=6;break e;case 3:case 2:case 9:case 6:Cn.current===null&&(n=!0);var G=lt;if(lt=0,An=null,bo(e,w,R,G),a&&ho){_=0;break e}break;default:G=lt,lt=0,An=null,bo(e,w,R,G)}}SS(),_=At;break}catch(Q){n0(e,Q)}while(!0);return n&&e.shellSuspendCounter++,zs=ci=null,at=l,M.H=f,M.A=h,$e===null&&(gt=null,He=0,Rl()),_}function SS(){for(;$e!==null;)o0($e)}function TS(e,n){var a=at;at|=2;var l=a0(),f=i0();gt!==e||He!==n?(uc=null,dc=Jt()+500,yo(e,n)):ho=fa(e,n);e:do try{if(lt!==0&&$e!==null){n=$e;var h=An;t:switch(lt){case 1:lt=0,An=null,bo(e,n,h,1);break;case 2:case 9:if(gg(h)){lt=0,An=null,r0(n);break}n=function(){lt!==2&<!==9||gt!==e||(lt=7),Ts(e)},h.then(n,n);break e;case 3:lt=7;break e;case 4:lt=5;break e;case 7:gg(h)?(lt=0,An=null,r0(n)):(lt=0,An=null,bo(e,n,h,7));break;case 5:var _=null;switch($e.tag){case 26:_=$e.memoizedState;case 5:case 27:var w=$e;if(_?F0(_):w.stateNode.complete){lt=0,An=null;var R=w.sibling;if(R!==null)$e=R;else{var G=w.return;G!==null?($e=G,mc(G)):$e=null}break t}}lt=0,An=null,bo(e,n,h,5);break;case 6:lt=0,An=null,bo(e,n,h,6);break;case 8:yf(),At=6;break e;default:throw Error(r(462))}}jS();break}catch(Q){n0(e,Q)}while(!0);return zs=ci=null,M.H=l,M.A=f,at=a,$e!==null?0:(gt=null,He=0,Rl(),At)}function jS(){for(;$e!==null&&!Ja();)o0($e)}function o0(e){var n=Av(e.alternate,e,Ks);e.memoizedProps=e.pendingProps,n===null?mc(e):$e=n}function r0(e){var n=e,a=n.alternate;switch(n.tag){case 15:case 0:n=Tv(a,n,n.pendingProps,n.type,void 0,He);break;case 11:n=Tv(a,n,n.pendingProps,n.type.render,n.ref,He);break;case 5:Ru(n);default:Mv(a,n),n=$e=ig(n,Ks),n=Av(a,n,Ks)}e.memoizedProps=e.pendingProps,n===null?mc(e):$e=n}function bo(e,n,a,l){zs=ci=null,Ru(n),ro=null,rr=0;var f=n.return;try{if(pS(e,f,n,a,He)){At=1,tc(e,Vn(a,e.current)),$e=null;return}}catch(h){if(f!==null)throw $e=f,h;At=1,tc(e,Vn(a,e.current)),$e=null;return}n.flags&32768?(Fe||l===1?e=!0:ho||(He&536870912)!==0?e=!1:(Ta=e=!0,(l===2||l===9||l===3||l===6)&&(l=Cn.current,l!==null&&l.tag===13&&(l.flags|=16384))),l0(n,e)):mc(n)}function mc(e){var n=e;do{if((n.flags&32768)!==0){l0(n,Ta);return}e=n.return;var a=gS(n.alternate,n,Ks);if(a!==null){$e=a;return}if(n=n.sibling,n!==null){$e=n;return}$e=n=e}while(n!==null);At===0&&(At=5)}function l0(e,n){do{var a=vS(e.alternate,e);if(a!==null){a.flags&=32767,$e=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!n&&(e=e.sibling,e!==null)){$e=e;return}$e=e=a}while(e!==null);At=6,$e=null}function c0(e,n,a,l,f,h,_,w,R){e.cancelPendingCommit=null;do hc();while(Zt!==0);if((at&6)!==0)throw Error(r(327));if(n!==null){if(n===e.current)throw Error(r(177));if(h=n.lanes|n.childLanes,h|=ou,le(e,a,h,_,w,R),e===gt&&($e=gt=null,He=0),vo=n,Na=e,Ys=a,hf=h,gf=f,Xv=l,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,ES(ys,function(){return m0(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||l){l=M.T,M.T=null,f=H.p,H.p=2,_=at,at|=4;try{yS(e,n,a)}finally{at=_,H.p=f,M.T=l}}Zt=1,d0(),u0(),f0()}}function d0(){if(Zt===1){Zt=0;var e=Na,n=vo,a=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||a){a=M.T,M.T=null;var l=H.p;H.p=2;var f=at;at|=4;try{qv(n,e);var h=Df,_=Jh(e.containerInfo),w=h.focusedElem,R=h.selectionRange;if(_!==w&&w&&w.ownerDocument&&Yh(w.ownerDocument.documentElement,w)){if(R!==null&&tu(w)){var G=R.start,Q=R.end;if(Q===void 0&&(Q=G),"selectionStart"in w)w.selectionStart=G,w.selectionEnd=Math.min(Q,w.value.length);else{var ie=w.ownerDocument||document,F=ie&&ie.defaultView||window;if(F.getSelection){var Z=F.getSelection(),be=w.textContent.length,Ce=Math.min(R.start,be),pt=R.end===void 0?Ce:Math.min(R.end,be);!Z.extend&&Ce>pt&&(_=pt,pt=Ce,Ce=_);var $=Kh(w,Ce),L=Kh(w,pt);if($&&L&&(Z.rangeCount!==1||Z.anchorNode!==$.node||Z.anchorOffset!==$.offset||Z.focusNode!==L.node||Z.focusOffset!==L.offset)){var q=ie.createRange();q.setStart($.node,$.offset),Z.removeAllRanges(),Ce>pt?(Z.addRange(q),Z.extend(L.node,L.offset)):(q.setEnd(L.node,L.offset),Z.addRange(q))}}}}for(ie=[],Z=w;Z=Z.parentNode;)Z.nodeType===1&&ie.push({element:Z,left:Z.scrollLeft,top:Z.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<ie.length;w++){var ae=ie[w];ae.element.scrollLeft=ae.left,ae.element.scrollTop=ae.top}}Nc=!!Af,Df=Af=null}finally{at=f,H.p=l,M.T=a}}e.current=n,Zt=2}}function u0(){if(Zt===2){Zt=0;var e=Na,n=vo,a=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||a){a=M.T,M.T=null;var l=H.p;H.p=2;var f=at;at|=4;try{$v(e,n.alternate,n)}finally{at=f,H.p=l,M.T=a}}Zt=3}}function f0(){if(Zt===4||Zt===3){Zt=0,da();var e=Na,n=vo,a=Ys,l=Xv;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Zt=5:(Zt=0,vo=Na=null,p0(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(wa=null),Me(a),n=n.stateNode,St&&typeof St.onCommitFiberRoot=="function")try{St.onCommitFiberRoot(Wt,n,void 0,(n.current.flags&128)===128)}catch{}if(l!==null){n=M.T,f=H.p,H.p=2,M.T=null;try{for(var h=e.onRecoverableError,_=0;_<l.length;_++){var w=l[_];h(w.value,{componentStack:w.stack})}}finally{M.T=n,H.p=f}}(Ys&3)!==0&&hc(),Ts(e),f=e.pendingLanes,(a&261930)!==0&&(f&42)!==0?e===vf?Tr++:(Tr=0,vf=e):Tr=0,jr(0)}}function p0(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,ir(n)))}function hc(){return d0(),u0(),f0(),m0()}function m0(){if(Zt!==5)return!1;var e=Na,n=hf;hf=0;var a=Me(Ys),l=M.T,f=H.p;try{H.p=32>a?32:a,M.T=null,a=gf,gf=null;var h=Na,_=Ys;if(Zt=0,vo=Na=null,Ys=0,(at&6)!==0)throw Error(r(331));var w=at;if(at|=4,Yv(h.current),Fv(h,h.current,_,a),at=w,jr(0,!1),St&&typeof St.onPostCommitFiberRoot=="function")try{St.onPostCommitFiberRoot(Wt,h)}catch{}return!0}finally{H.p=f,M.T=l,p0(e,n)}}function h0(e,n,a){n=Vn(a,n),n=Ku(e.stateNode,n,2),e=xa(e,n,2),e!==null&&(te(e,2),Ts(e))}function ct(e,n,a){if(e.tag===3)h0(e,e,a);else for(;n!==null;){if(n.tag===3){h0(n,e,a);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(wa===null||!wa.has(l))){e=Vn(a,e),a=gv(2),l=xa(n,a,2),l!==null&&(vv(a,l,n,e),te(l,2),Ts(l));break}}n=n.return}}function xf(e,n,a){var l=e.pingCache;if(l===null){l=e.pingCache=new _S;var f=new Set;l.set(n,f)}else f=l.get(n),f===void 0&&(f=new Set,l.set(n,f));f.has(a)||(ff=!0,f.add(a),e=wS.bind(null,e,n,a),n.then(e,e))}function wS(e,n,a){var l=e.pingCache;l!==null&&l.delete(n),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,gt===e&&(He&a)===a&&(At===4||At===3&&(He&62914560)===He&&300>Jt()-cc?(at&2)===0&&yo(e,0):pf|=a,go===He&&(go=0)),Ts(e)}function g0(e,n){n===0&&(n=_l()),e=oi(e,n),e!==null&&(te(e,n),Ts(e))}function NS(e){var n=e.memoizedState,a=0;n!==null&&(a=n.retryLane),g0(e,a)}function CS(e,n){var a=0;switch(e.tag){case 31:case 13:var l=e.stateNode,f=e.memoizedState;f!==null&&(a=f.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(r(314))}l!==null&&l.delete(n),g0(e,a)}function ES(e,n){return ca(e,n)}var gc=null,xo=null,_f=!1,vc=!1,kf=!1,Ea=0;function Ts(e){e!==xo&&e.next===null&&(xo===null?gc=xo=e:xo=xo.next=e),vc=!0,_f||(_f=!0,DS())}function jr(e,n){if(!kf&&vc){kf=!0;do for(var a=!1,l=gc;l!==null;){if(e!==0){var f=l.pendingLanes;if(f===0)var h=0;else{var _=l.suspendedLanes,w=l.pingedLanes;h=(1<<31-Xt(42|e)+1)-1,h&=f&~(_&~w),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(a=!0,x0(l,h))}else h=He,h=ti(l,l===gt?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(h&3)===0||fa(l,h)||(a=!0,x0(l,h));l=l.next}while(a);kf=!1}}function AS(){v0()}function v0(){vc=_f=!1;var e=0;Ea!==0&&US()&&(e=Ea);for(var n=Jt(),a=null,l=gc;l!==null;){var f=l.next,h=y0(l,n);h===0?(l.next=null,a===null?gc=f:a.next=f,f===null&&(xo=a)):(a=l,(e!==0||(h&3)!==0)&&(vc=!0)),l=f}Zt!==0&&Zt!==5||jr(e),Ea!==0&&(Ea=0)}function y0(e,n){for(var a=e.suspendedLanes,l=e.pingedLanes,f=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var _=31-Xt(h),w=1<<_,R=f[_];R===-1?((w&a)===0||(w&l)!==0)&&(f[_]=xl(w,n)):R<=n&&(e.expiredLanes|=w),h&=~w}if(n=gt,a=He,a=ti(e,e===n?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,a===0||e===n&&(lt===2||lt===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&is(l),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||fa(e,a)){if(n=a&-a,n===e.callbackPriority)return n;switch(l!==null&&is(l),Me(a)){case 2:case 8:a=Wa;break;case 32:a=ys;break;case 268435456:a=$n;break;default:a=ys}return l=b0.bind(null,e),a=ca(a,l),e.callbackPriority=n,e.callbackNode=a,n}return l!==null&&l!==null&&is(l),e.callbackPriority=2,e.callbackNode=null,2}function b0(e,n){if(Zt!==0&&Zt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(hc()&&e.callbackNode!==a)return null;var l=He;return l=ti(e,e===gt?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(e0(e,l,n),y0(e,Jt()),e.callbackNode!=null&&e.callbackNode===a?b0.bind(null,e):null)}function x0(e,n){if(hc())return null;e0(e,n,!0)}function DS(){VS(function(){(at&6)!==0?ca(ua,AS):v0()})}function Sf(){if(Ea===0){var e=ao;e===0&&(e=Xa,Xa<<=1,(Xa&261888)===0&&(Xa=256)),Ea=e}return Ea}function _0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:jl(""+e)}function k0(e,n){var a=n.ownerDocument.createElement("input");return a.name=n.name,a.value=n.value,e.id&&a.setAttribute("form",e.id),n.parentNode.insertBefore(a,n),e=new FormData(e),a.parentNode.removeChild(a),e}function MS(e,n,a,l,f){if(n==="submit"&&a&&a.stateNode===f){var h=_0((f[rt]||null).action),_=l.submitter;_&&(n=(n=_[rt]||null)?_0(n.formAction):_.getAttribute("formAction"),n!==null&&(h=n,_=null));var w=new El("action","action",null,l,f);e.push({event:w,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Ea!==0){var R=_?k0(f,_):new FormData(f);Hu(a,{pending:!0,data:R,method:f.method,action:h},null,R)}}else typeof h=="function"&&(w.preventDefault(),R=_?k0(f,_):new FormData(f),Hu(a,{pending:!0,data:R,method:f.method,action:h},h,R))},currentTarget:f}]})}}for(var Tf=0;Tf<iu.length;Tf++){var jf=iu[Tf],RS=jf.toLowerCase(),IS=jf[0].toUpperCase()+jf.slice(1);os(RS,"on"+IS)}os(Qh,"onAnimationEnd"),os(eg,"onAnimationIteration"),os(tg,"onAnimationStart"),os("dblclick","onDoubleClick"),os("focusin","onFocus"),os("focusout","onBlur"),os(Jk,"onTransitionRun"),os(Wk,"onTransitionStart"),os(Xk,"onTransitionCancel"),os(ng,"onTransitionEnd"),qi("onMouseEnter",["mouseout","mouseover"]),qi("onMouseLeave",["mouseout","mouseover"]),qi("onPointerEnter",["pointerout","pointerover"]),qi("onPointerLeave",["pointerout","pointerover"]),ni("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ni("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ni("onBeforeInput",["compositionend","keypress","textInput","paste"]),ni("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ni("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ni("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wr="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(" "),OS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(wr));function S0(e,n){n=(n&4)!==0;for(var a=0;a<e.length;a++){var l=e[a],f=l.event;l=l.listeners;e:{var h=void 0;if(n)for(var _=l.length-1;0<=_;_--){var w=l[_],R=w.instance,G=w.currentTarget;if(w=w.listener,R!==h&&f.isPropagationStopped())break e;h=w,f.currentTarget=G;try{h(f)}catch(Q){Ml(Q)}f.currentTarget=null,h=R}else for(_=0;_<l.length;_++){if(w=l[_],R=w.instance,G=w.currentTarget,w=w.listener,R!==h&&f.isPropagationStopped())break e;h=w,f.currentTarget=G;try{h(f)}catch(Q){Ml(Q)}f.currentTarget=null,h=R}}}}function Pe(e,n){var a=n[xs];a===void 0&&(a=n[xs]=new Set);var l=e+"__bubble";a.has(l)||(T0(n,e,2,!1),a.add(l))}function wf(e,n,a){var l=0;n&&(l|=4),T0(a,e,l,n)}var yc="_reactListening"+Math.random().toString(36).slice(2);function Nf(e){if(!e[yc]){e[yc]=!0,vh.forEach(function(a){a!=="selectionchange"&&(OS.has(a)||wf(a,!1,e),wf(a,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[yc]||(n[yc]=!0,wf("selectionchange",!1,n))}}function T0(e,n,a,l){switch(Q0(n)){case 2:var f=cT;break;case 8:f=dT;break;default:f=Hf}a=f.bind(null,n,a,e),f=void 0,!Fd||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),l?f!==void 0?e.addEventListener(n,a,{capture:!0,passive:f}):e.addEventListener(n,a,!0):f!==void 0?e.addEventListener(n,a,{passive:f}):e.addEventListener(n,a,!1)}function Cf(e,n,a,l,f){var h=l;if((n&1)===0&&(n&2)===0&&l!==null)e:for(;;){if(l===null)return;var _=l.tag;if(_===3||_===4){var w=l.stateNode.containerInfo;if(w===f)break;if(_===4)for(_=l.return;_!==null;){var R=_.tag;if((R===3||R===4)&&_.stateNode.containerInfo===f)return;_=_.return}for(;w!==null;){if(_=Ui(w),_===null)return;if(R=_.tag,R===5||R===6||R===26||R===27){l=h=_;continue e}w=w.parentNode}}l=l.return}Eh(function(){var G=h,Q=qd(a),ie=[];e:{var F=sg.get(e);if(F!==void 0){var Z=El,be=e;switch(e){case"keypress":if(Nl(a)===0)break e;case"keydown":case"keyup":Z=Ck;break;case"focusin":be="focus",Z=Jd;break;case"focusout":be="blur",Z=Jd;break;case"beforeblur":case"afterblur":Z=Jd;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Z=Mh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Z=gk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Z=Dk;break;case Qh:case eg:case tg:Z=bk;break;case ng:Z=Rk;break;case"scroll":case"scrollend":Z=mk;break;case"wheel":Z=Ok;break;case"copy":case"cut":case"paste":Z=_k;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Z=Ih;break;case"toggle":case"beforetoggle":Z=Lk}var Ce=(n&4)!==0,pt=!Ce&&(e==="scroll"||e==="scrollend"),$=Ce?F!==null?F+"Capture":null:F;Ce=[];for(var L=G,q;L!==null;){var ae=L;if(q=ae.stateNode,ae=ae.tag,ae!==5&&ae!==26&&ae!==27||q===null||$===null||(ae=Ko(L,$),ae!=null&&Ce.push(Nr(L,ae,q))),pt)break;L=L.return}0<Ce.length&&(F=new Z(F,be,null,a,Q),ie.push({event:F,listeners:Ce}))}}if((n&7)===0){e:{if(F=e==="mouseover"||e==="pointerover",Z=e==="mouseout"||e==="pointerout",F&&a!==Vd&&(be=a.relatedTarget||a.fromElement)&&(Ui(be)||be[vt]))break e;if((Z||F)&&(F=Q.window===Q?Q:(F=Q.ownerDocument)?F.defaultView||F.parentWindow:window,Z?(be=a.relatedTarget||a.toElement,Z=G,be=be?Ui(be):null,be!==null&&(pt=d(be),Ce=be.tag,be!==pt||Ce!==5&&Ce!==27&&Ce!==6)&&(be=null)):(Z=null,be=G),Z!==be)){if(Ce=Mh,ae="onMouseLeave",$="onMouseEnter",L="mouse",(e==="pointerout"||e==="pointerover")&&(Ce=Ih,ae="onPointerLeave",$="onPointerEnter",L="pointer"),pt=Z==null?F:Zo(Z),q=be==null?F:Zo(be),F=new Ce(ae,L+"leave",Z,a,Q),F.target=pt,F.relatedTarget=q,ae=null,Ui(Q)===G&&(Ce=new Ce($,L+"enter",be,a,Q),Ce.target=q,Ce.relatedTarget=pt,ae=Ce),pt=ae,Z&&be)t:{for(Ce=BS,$=Z,L=be,q=0,ae=$;ae;ae=Ce(ae))q++;ae=0;for(var je=L;je;je=Ce(je))ae++;for(;0<q-ae;)$=Ce($),q--;for(;0<ae-q;)L=Ce(L),ae--;for(;q--;){if($===L||L!==null&&$===L.alternate){Ce=$;break t}$=Ce($),L=Ce(L)}Ce=null}else Ce=null;Z!==null&&j0(ie,F,Z,Ce,!1),be!==null&&pt!==null&&j0(ie,pt,be,Ce,!0)}}e:{if(F=G?Zo(G):window,Z=F.nodeName&&F.nodeName.toLowerCase(),Z==="select"||Z==="input"&&F.type==="file")var et=Hh;else if(Ph(F))if(Vh)et=Zk;else{et=Gk;var ke=qk}else Z=F.nodeName,!Z||Z.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?G&&Hd(G.elementType)&&(et=Hh):et=Fk;if(et&&(et=et(e,G))){Uh(ie,et,a,Q);break e}ke&&ke(e,F,G),e==="focusout"&&G&&F.type==="number"&&G.memoizedProps.value!=null&&Ud(F,"number",F.value)}switch(ke=G?Zo(G):window,e){case"focusin":(Ph(ke)||ke.contentEditable==="true")&&(Ji=ke,nu=G,nr=null);break;case"focusout":nr=nu=Ji=null;break;case"mousedown":su=!0;break;case"contextmenu":case"mouseup":case"dragend":su=!1,Wh(ie,a,Q);break;case"selectionchange":if(Yk)break;case"keydown":case"keyup":Wh(ie,a,Q)}var Oe;if(Xd)e:{switch(e){case"compositionstart":var Ve="onCompositionStart";break e;case"compositionend":Ve="onCompositionEnd";break e;case"compositionupdate":Ve="onCompositionUpdate";break e}Ve=void 0}else Yi?zh(e,a)&&(Ve="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Ve="onCompositionStart");Ve&&(Oh&&a.locale!=="ko"&&(Yi||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&Yi&&(Oe=Ah()):(pa=Q,Zd="value"in pa?pa.value:pa.textContent,Yi=!0)),ke=bc(G,Ve),0<ke.length&&(Ve=new Rh(Ve,e,null,a,Q),ie.push({event:Ve,listeners:ke}),Oe?Ve.data=Oe:(Oe=$h(a),Oe!==null&&(Ve.data=Oe)))),(Oe=$k?Pk(e,a):Uk(e,a))&&(Ve=bc(G,"onBeforeInput"),0<Ve.length&&(ke=new Rh("onBeforeInput","beforeinput",null,a,Q),ie.push({event:ke,listeners:Ve}),ke.data=Oe)),MS(ie,e,G,a,Q)}S0(ie,n)})}function Nr(e,n,a){return{instance:e,listener:n,currentTarget:a}}function bc(e,n){for(var a=n+"Capture",l=[];e!==null;){var f=e,h=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||h===null||(f=Ko(e,a),f!=null&&l.unshift(Nr(e,f,h)),f=Ko(e,n),f!=null&&l.push(Nr(e,f,h))),e.tag===3)return l;e=e.return}return[]}function BS(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function j0(e,n,a,l,f){for(var h=n._reactName,_=[];a!==null&&a!==l;){var w=a,R=w.alternate,G=w.stateNode;if(w=w.tag,R!==null&&R===l)break;w!==5&&w!==26&&w!==27||G===null||(R=G,f?(G=Ko(a,h),G!=null&&_.unshift(Nr(a,G,R))):f||(G=Ko(a,h),G!=null&&_.push(Nr(a,G,R)))),a=a.return}_.length!==0&&e.push({event:n,listeners:_})}var LS=/\r\n?/g,zS=/\u0000|\uFFFD/g;function w0(e){return(typeof e=="string"?e:""+e).replace(LS,`
|
|
26
|
-
`).replace(zS,"")}function N0(e,n){return n=w0(n),w0(e)===n}function ft(e,n,a,l,f,h){switch(a){case"children":typeof l=="string"?n==="body"||n==="textarea"&&l===""||Fi(e,l):(typeof l=="number"||typeof l=="bigint")&&n!=="body"&&Fi(e,""+l);break;case"className":Sl(e,"class",l);break;case"tabIndex":Sl(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Sl(e,a,l);break;case"style":Nh(e,l,h);break;case"data":if(n!=="object"){Sl(e,"data",l);break}case"src":case"href":if(l===""&&(n!=="a"||a!=="href")){e.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=jl(""+l),e.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(a==="formAction"?(n!=="input"&&ft(e,n,"name",f.name,f,null),ft(e,n,"formEncType",f.formEncType,f,null),ft(e,n,"formMethod",f.formMethod,f,null),ft(e,n,"formTarget",f.formTarget,f,null)):(ft(e,n,"encType",f.encType,f,null),ft(e,n,"method",f.method,f,null),ft(e,n,"target",f.target,f,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=jl(""+l),e.setAttribute(a,l);break;case"onClick":l!=null&&(e.onclick=Is);break;case"onScroll":l!=null&&Pe("scroll",e);break;case"onScrollEnd":l!=null&&Pe("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(a=l.__html,a!=null){if(f.children!=null)throw Error(r(60));e.innerHTML=a}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}a=jl(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""+l):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":l===!0?e.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,l):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(a,l):e.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(a):e.setAttribute(a,l);break;case"popover":Pe("beforetoggle",e),Pe("toggle",e),kl(e,"popover",l);break;case"xlinkActuate":Rs(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Rs(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Rs(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Rs(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Rs(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Rs(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Rs(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Rs(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Rs(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":kl(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=fk.get(a)||a,kl(e,a,l))}}function Ef(e,n,a,l,f,h){switch(a){case"style":Nh(e,l,h);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(a=l.__html,a!=null){if(f.children!=null)throw Error(r(60));e.innerHTML=a}}break;case"children":typeof l=="string"?Fi(e,l):(typeof l=="number"||typeof l=="bigint")&&Fi(e,""+l);break;case"onScroll":l!=null&&Pe("scroll",e);break;case"onScrollEnd":l!=null&&Pe("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Is);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!yh.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(f=a.endsWith("Capture"),n=a.slice(2,f?a.length-7:void 0),h=e[rt]||null,h=h!=null?h[a]:null,typeof h=="function"&&e.removeEventListener(n,h,f),typeof l=="function")){typeof h!="function"&&h!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(n,l,f);break e}a in e?e[a]=l:l===!0?e.setAttribute(a,""):kl(e,a,l)}}}function ln(e,n,a){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Pe("error",e),Pe("load",e);var l=!1,f=!1,h;for(h in a)if(a.hasOwnProperty(h)){var _=a[h];if(_!=null)switch(h){case"src":l=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:ft(e,n,h,_,a,null)}}f&&ft(e,n,"srcSet",a.srcSet,a,null),l&&ft(e,n,"src",a.src,a,null);return;case"input":Pe("invalid",e);var w=h=_=f=null,R=null,G=null;for(l in a)if(a.hasOwnProperty(l)){var Q=a[l];if(Q!=null)switch(l){case"name":f=Q;break;case"type":_=Q;break;case"checked":R=Q;break;case"defaultChecked":G=Q;break;case"value":h=Q;break;case"defaultValue":w=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(r(137,n));break;default:ft(e,n,l,Q,a,null)}}Sh(e,h,w,R,G,_,f,!1);return;case"select":Pe("invalid",e),l=_=h=null;for(f in a)if(a.hasOwnProperty(f)&&(w=a[f],w!=null))switch(f){case"value":h=w;break;case"defaultValue":_=w;break;case"multiple":l=w;default:ft(e,n,f,w,a,null)}n=h,a=_,e.multiple=!!l,n!=null?Gi(e,!!l,n,!1):a!=null&&Gi(e,!!l,a,!0);return;case"textarea":Pe("invalid",e),h=f=l=null;for(_ in a)if(a.hasOwnProperty(_)&&(w=a[_],w!=null))switch(_){case"value":l=w;break;case"defaultValue":f=w;break;case"children":h=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(r(91));break;default:ft(e,n,_,w,a,null)}jh(e,l,f,h);return;case"option":for(R in a)if(a.hasOwnProperty(R)&&(l=a[R],l!=null))switch(R){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:ft(e,n,R,l,a,null)}return;case"dialog":Pe("beforetoggle",e),Pe("toggle",e),Pe("cancel",e),Pe("close",e);break;case"iframe":case"object":Pe("load",e);break;case"video":case"audio":for(l=0;l<wr.length;l++)Pe(wr[l],e);break;case"image":Pe("error",e),Pe("load",e);break;case"details":Pe("toggle",e);break;case"embed":case"source":case"link":Pe("error",e),Pe("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(G in a)if(a.hasOwnProperty(G)&&(l=a[G],l!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:ft(e,n,G,l,a,null)}return;default:if(Hd(n)){for(Q in a)a.hasOwnProperty(Q)&&(l=a[Q],l!==void 0&&Ef(e,n,Q,l,a,void 0));return}}for(w in a)a.hasOwnProperty(w)&&(l=a[w],l!=null&&ft(e,n,w,l,a,null))}function $S(e,n,a,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,h=null,_=null,w=null,R=null,G=null,Q=null;for(Z in a){var ie=a[Z];if(a.hasOwnProperty(Z)&&ie!=null)switch(Z){case"checked":break;case"value":break;case"defaultValue":R=ie;default:l.hasOwnProperty(Z)||ft(e,n,Z,null,l,ie)}}for(var F in l){var Z=l[F];if(ie=a[F],l.hasOwnProperty(F)&&(Z!=null||ie!=null))switch(F){case"type":h=Z;break;case"name":f=Z;break;case"checked":G=Z;break;case"defaultChecked":Q=Z;break;case"value":_=Z;break;case"defaultValue":w=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(r(137,n));break;default:Z!==ie&&ft(e,n,F,Z,l,ie)}}Pd(e,_,w,R,G,Q,h,f);return;case"select":Z=_=w=F=null;for(h in a)if(R=a[h],a.hasOwnProperty(h)&&R!=null)switch(h){case"value":break;case"multiple":Z=R;default:l.hasOwnProperty(h)||ft(e,n,h,null,l,R)}for(f in l)if(h=l[f],R=a[f],l.hasOwnProperty(f)&&(h!=null||R!=null))switch(f){case"value":F=h;break;case"defaultValue":w=h;break;case"multiple":_=h;default:h!==R&&ft(e,n,f,h,l,R)}n=w,a=_,l=Z,F!=null?Gi(e,!!a,F,!1):!!l!=!!a&&(n!=null?Gi(e,!!a,n,!0):Gi(e,!!a,a?[]:"",!1));return;case"textarea":Z=F=null;for(w in a)if(f=a[w],a.hasOwnProperty(w)&&f!=null&&!l.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:ft(e,n,w,null,l,f)}for(_ in l)if(f=l[_],h=a[_],l.hasOwnProperty(_)&&(f!=null||h!=null))switch(_){case"value":F=f;break;case"defaultValue":Z=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(r(91));break;default:f!==h&&ft(e,n,_,f,l,h)}Th(e,F,Z);return;case"option":for(var be in a)if(F=a[be],a.hasOwnProperty(be)&&F!=null&&!l.hasOwnProperty(be))switch(be){case"selected":e.selected=!1;break;default:ft(e,n,be,null,l,F)}for(R in l)if(F=l[R],Z=a[R],l.hasOwnProperty(R)&&F!==Z&&(F!=null||Z!=null))switch(R){case"selected":e.selected=F&&typeof F!="function"&&typeof F!="symbol";break;default:ft(e,n,R,F,l,Z)}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 Ce in a)F=a[Ce],a.hasOwnProperty(Ce)&&F!=null&&!l.hasOwnProperty(Ce)&&ft(e,n,Ce,null,l,F);for(G in l)if(F=l[G],Z=a[G],l.hasOwnProperty(G)&&F!==Z&&(F!=null||Z!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(r(137,n));break;default:ft(e,n,G,F,l,Z)}return;default:if(Hd(n)){for(var pt in a)F=a[pt],a.hasOwnProperty(pt)&&F!==void 0&&!l.hasOwnProperty(pt)&&Ef(e,n,pt,void 0,l,F);for(Q in l)F=l[Q],Z=a[Q],!l.hasOwnProperty(Q)||F===Z||F===void 0&&Z===void 0||Ef(e,n,Q,F,l,Z);return}}for(var $ in a)F=a[$],a.hasOwnProperty($)&&F!=null&&!l.hasOwnProperty($)&&ft(e,n,$,null,l,F);for(ie in l)F=l[ie],Z=a[ie],!l.hasOwnProperty(ie)||F===Z||F==null&&Z==null||ft(e,n,ie,F,l,Z)}function C0(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function PS(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,a=performance.getEntriesByType("resource"),l=0;l<a.length;l++){var f=a[l],h=f.transferSize,_=f.initiatorType,w=f.duration;if(h&&w&&C0(_)){for(_=0,w=f.responseEnd,l+=1;l<a.length;l++){var R=a[l],G=R.startTime;if(G>w)break;var Q=R.transferSize,ie=R.initiatorType;Q&&C0(ie)&&(R=R.responseEnd,_+=Q*(R<w?1:(w-G)/(R-G)))}if(--l,n+=8*(h+_)/(f.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Af=null,Df=null;function xc(e){return e.nodeType===9?e:e.ownerDocument}function E0(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 A0(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function Mf(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Rf=null;function US(){var e=window.event;return e&&e.type==="popstate"?e===Rf?!1:(Rf=e,!0):(Rf=null,!1)}var D0=typeof setTimeout=="function"?setTimeout:void 0,HS=typeof clearTimeout=="function"?clearTimeout:void 0,M0=typeof Promise=="function"?Promise:void 0,VS=typeof queueMicrotask=="function"?queueMicrotask:typeof M0<"u"?function(e){return M0.resolve(null).then(e).catch(qS)}:D0;function qS(e){setTimeout(function(){throw e})}function Aa(e){return e==="head"}function R0(e,n){var a=n,l=0;do{var f=a.nextSibling;if(e.removeChild(a),f&&f.nodeType===8)if(a=f.data,a==="/$"||a==="/&"){if(l===0){e.removeChild(f),To(n);return}l--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")l++;else if(a==="html")Cr(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Cr(a);for(var h=a.firstChild;h;){var _=h.nextSibling,w=h.nodeName;h[Fo]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&h.rel.toLowerCase()==="stylesheet"||a.removeChild(h),h=_}}else a==="body"&&Cr(e.ownerDocument.body);a=f}while(a);To(n)}function I0(e,n){var a=e;e=0;do{var l=a.nextSibling;if(a.nodeType===1?n?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(n?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),l&&l.nodeType===8)if(a=l.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=l}while(a)}function If(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var a=n;switch(n=n.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":If(a),zd(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function GS(e,n,a,l){for(;e.nodeType===1;){var f=a;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Fo])switch(n){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!==f.rel||e.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||e.getAttribute("title")!==(f.title==null?null:f.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(f.src==null?null:f.src)||e.getAttribute("type")!==(f.type==null?null:f.type)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var h=f.name==null?null:""+f.name;if(f.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=Kn(e.nextSibling),e===null)break}return null}function FS(e,n,a){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Kn(e.nextSibling),e===null))return null;return e}function O0(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Kn(e.nextSibling),e===null))return null;return e}function Of(e){return e.data==="$?"||e.data==="$~"}function Bf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function ZS(e,n){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||a.readyState!=="loading")n();else{var l=function(){n(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Kn(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var Lf=null;function B0(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(n===0)return Kn(e.nextSibling);n--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||n++}e=e.nextSibling}return null}function L0(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(n===0)return e;n--}else a!=="/$"&&a!=="/&"||n++}e=e.previousSibling}return null}function z0(e,n,a){switch(n=xc(a),e){case"html":if(e=n.documentElement,!e)throw Error(r(452));return e;case"head":if(e=n.head,!e)throw Error(r(453));return e;case"body":if(e=n.body,!e)throw Error(r(454));return e;default:throw Error(r(451))}}function Cr(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);zd(e)}var Yn=new Map,$0=new Set;function _c(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Js=H.d;H.d={f:KS,r:YS,D:JS,C:WS,L:XS,m:QS,X:tT,S:eT,M:nT};function KS(){var e=Js.f(),n=fc();return e||n}function YS(e){var n=Hi(e);n!==null&&n.tag===5&&n.type==="form"?nv(n):Js.r(e)}var _o=typeof document>"u"?null:document;function P0(e,n,a){var l=_o;if(l&&typeof n=="string"&&n){var f=Un(n);f='link[rel="'+e+'"][href="'+f+'"]',typeof a=="string"&&(f+='[crossorigin="'+a+'"]'),$0.has(f)||($0.add(f),e={rel:e,crossOrigin:a,href:n},l.querySelector(f)===null&&(n=l.createElement("link"),ln(n,"link",e),Qt(n),l.head.appendChild(n)))}}function JS(e){Js.D(e),P0("dns-prefetch",e,null)}function WS(e,n){Js.C(e,n),P0("preconnect",e,n)}function XS(e,n,a){Js.L(e,n,a);var l=_o;if(l&&e&&n){var f='link[rel="preload"][as="'+Un(n)+'"]';n==="image"&&a&&a.imageSrcSet?(f+='[imagesrcset="'+Un(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(f+='[imagesizes="'+Un(a.imageSizes)+'"]')):f+='[href="'+Un(e)+'"]';var h=f;switch(n){case"style":h=ko(e);break;case"script":h=So(e)}Yn.has(h)||(e=x({rel:"preload",href:n==="image"&&a&&a.imageSrcSet?void 0:e,as:n},a),Yn.set(h,e),l.querySelector(f)!==null||n==="style"&&l.querySelector(Er(h))||n==="script"&&l.querySelector(Ar(h))||(n=l.createElement("link"),ln(n,"link",e),Qt(n),l.head.appendChild(n)))}}function QS(e,n){Js.m(e,n);var a=_o;if(a&&e){var l=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+Un(l)+'"][href="'+Un(e)+'"]',h=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=So(e)}if(!Yn.has(h)&&(e=x({rel:"modulepreload",href:e},n),Yn.set(h,e),a.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Ar(h)))return}l=a.createElement("link"),ln(l,"link",e),Qt(l),a.head.appendChild(l)}}}function eT(e,n,a){Js.S(e,n,a);var l=_o;if(l&&e){var f=Vi(l).hoistableStyles,h=ko(e);n=n||"default";var _=f.get(h);if(!_){var w={loading:0,preload:null};if(_=l.querySelector(Er(h)))w.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":n},a),(a=Yn.get(h))&&zf(e,a);var R=_=l.createElement("link");Qt(R),ln(R,"link",e),R._p=new Promise(function(G,Q){R.onload=G,R.onerror=Q}),R.addEventListener("load",function(){w.loading|=1}),R.addEventListener("error",function(){w.loading|=2}),w.loading|=4,kc(_,n,l)}_={type:"stylesheet",instance:_,count:1,state:w},f.set(h,_)}}}function tT(e,n){Js.X(e,n);var a=_o;if(a&&e){var l=Vi(a).hoistableScripts,f=So(e),h=l.get(f);h||(h=a.querySelector(Ar(f)),h||(e=x({src:e,async:!0},n),(n=Yn.get(f))&&$f(e,n),h=a.createElement("script"),Qt(h),ln(h,"link",e),a.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(f,h))}}function nT(e,n){Js.M(e,n);var a=_o;if(a&&e){var l=Vi(a).hoistableScripts,f=So(e),h=l.get(f);h||(h=a.querySelector(Ar(f)),h||(e=x({src:e,async:!0,type:"module"},n),(n=Yn.get(f))&&$f(e,n),h=a.createElement("script"),Qt(h),ln(h,"link",e),a.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(f,h))}}function U0(e,n,a,l){var f=(f=Se.current)?_c(f):null;if(!f)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(n=ko(a.href),a=Vi(f).hoistableStyles,l=a.get(n),l||(l={type:"style",instance:null,count:0,state:null},a.set(n,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=ko(a.href);var h=Vi(f).hoistableStyles,_=h.get(e);if(_||(f=f.ownerDocument||f,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,_),(h=f.querySelector(Er(e)))&&!h._p&&(_.instance=h,_.state.loading=5),Yn.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Yn.set(e,a),h||sT(f,e,a,_.state))),n&&l===null)throw Error(r(528,""));return _}if(n&&l!==null)throw Error(r(529,""));return null;case"script":return n=a.async,a=a.src,typeof a=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=So(a),a=Vi(f).hoistableScripts,l=a.get(n),l||(l={type:"script",instance:null,count:0,state:null},a.set(n,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function ko(e){return'href="'+Un(e)+'"'}function Er(e){return'link[rel="stylesheet"]['+e+"]"}function H0(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function sT(e,n,a,l){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?l.loading=1:(n=e.createElement("link"),l.preload=n,n.addEventListener("load",function(){return l.loading|=1}),n.addEventListener("error",function(){return l.loading|=2}),ln(n,"link",a),Qt(n),e.head.appendChild(n))}function So(e){return'[src="'+Un(e)+'"]'}function Ar(e){return"script[async]"+e}function V0(e,n,a){if(n.count++,n.instance===null)switch(n.type){case"style":var l=e.querySelector('style[data-href~="'+Un(a.href)+'"]');if(l)return n.instance=l,Qt(l),l;var f=x({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Qt(l),ln(l,"style",f),kc(l,a.precedence,e),n.instance=l;case"stylesheet":f=ko(a.href);var h=e.querySelector(Er(f));if(h)return n.state.loading|=4,n.instance=h,Qt(h),h;l=H0(a),(f=Yn.get(f))&&zf(l,f),h=(e.ownerDocument||e).createElement("link"),Qt(h);var _=h;return _._p=new Promise(function(w,R){_.onload=w,_.onerror=R}),ln(h,"link",l),n.state.loading|=4,kc(h,a.precedence,e),n.instance=h;case"script":return h=So(a.src),(f=e.querySelector(Ar(h)))?(n.instance=f,Qt(f),f):(l=a,(f=Yn.get(h))&&(l=x({},a),$f(l,f)),e=e.ownerDocument||e,f=e.createElement("script"),Qt(f),ln(f,"link",l),e.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(r(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(l=n.instance,n.state.loading|=4,kc(l,a.precedence,e));return n.instance}function kc(e,n,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=l.length?l[l.length-1]:null,h=f,_=0;_<l.length;_++){var w=l[_];if(w.dataset.precedence===n)h=w;else if(h!==f)break}h?h.parentNode.insertBefore(e,h.nextSibling):(n=a.nodeType===9?a.head:a,n.insertBefore(e,n.firstChild))}function zf(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function $f(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Sc=null;function q0(e,n,a){if(Sc===null){var l=new Map,f=Sc=new Map;f.set(a,l)}else f=Sc,l=f.get(a),l||(l=new Map,f.set(a,l));if(l.has(e))return l;for(l.set(e,null),a=a.getElementsByTagName(e),f=0;f<a.length;f++){var h=a[f];if(!(h[Fo]||h[Qe]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var _=h.getAttribute(n)||"";_=e+_;var w=l.get(_);w?w.push(h):l.set(_,[h])}}return l}function G0(e,n,a){e=e.ownerDocument||e,e.head.insertBefore(a,n==="title"?e.querySelector("head > title"):null)}function aT(e,n,a){if(a===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return e=n.disabled,typeof n.precedence=="string"&&e==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function F0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function iT(e,n,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var f=ko(l.href),h=n.querySelector(Er(f));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Tc.bind(e),n.then(e,e)),a.state.loading|=4,a.instance=h,Qt(h);return}h=n.ownerDocument||n,l=H0(l),(f=Yn.get(f))&&zf(l,f),h=h.createElement("link"),Qt(h);var _=h;_._p=new Promise(function(w,R){_.onload=w,_.onerror=R}),ln(h,"link",l),a.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,n),(n=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Tc.bind(e),n.addEventListener("load",a),n.addEventListener("error",a))}}var Pf=0;function oT(e,n){return e.stylesheets&&e.count===0&&wc(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var l=setTimeout(function(){if(e.stylesheets&&wc(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+n);0<e.imgBytes&&Pf===0&&(Pf=62500*PS());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&wc(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Pf?50:800)+n);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(f)}}:null}function Tc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)wc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var jc=null;function wc(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,jc=new Map,n.forEach(rT,e),jc=null,Tc.call(e))}function rT(e,n){if(!(n.state.loading&4)){var a=jc.get(e);if(a)var l=a.get(null);else{a=new Map,jc.set(e,a);for(var f=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<f.length;h++){var _=f[h];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(a.set(_.dataset.precedence,_),l=_)}l&&a.set(null,l)}f=n.instance,_=f.getAttribute("data-precedence"),h=a.get(_)||l,h===l&&a.set(null,f),a.set(_,f),this.count++,l=Tc.bind(this),f.addEventListener("load",l),f.addEventListener("error",l),h?h.parentNode.insertBefore(f,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(f,e.firstChild)),n.state.loading|=4}}var Dr={$$typeof:A,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function lT(e,n,a,l,f,h,_,w,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=U(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=U(0),this.hiddenUpdates=U(null),this.identifierPrefix=l,this.onUncaughtError=f,this.onCaughtError=h,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function Z0(e,n,a,l,f,h,_,w,R,G,Q,ie){return e=new lT(e,n,a,_,R,G,Q,ie,w),n=1,h===!0&&(n|=24),h=Nn(3,null,null,n),e.current=h,h.stateNode=e,n=yu(),n.refCount++,e.pooledCache=n,n.refCount++,h.memoizedState={element:l,isDehydrated:a,cache:n},ku(h),e}function K0(e){return e?(e=Qi,e):Qi}function Y0(e,n,a,l,f,h){f=K0(f),l.context===null?l.context=f:l.pendingContext=f,l=ba(n),l.payload={element:a},h=h===void 0?null:h,h!==null&&(l.callback=h),a=xa(e,l,n),a!==null&&(jn(a,e,n),cr(a,e,n))}function J0(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<n?a:n}}function Uf(e,n){J0(e,n),(e=e.alternate)&&J0(e,n)}function W0(e){if(e.tag===13||e.tag===31){var n=oi(e,67108864);n!==null&&jn(n,e,67108864),Uf(e,67108864)}}function X0(e){if(e.tag===13||e.tag===31){var n=Mn();n=_e(n);var a=oi(e,n);a!==null&&jn(a,e,n),Uf(e,n)}}var Nc=!0;function cT(e,n,a,l){var f=M.T;M.T=null;var h=H.p;try{H.p=2,Hf(e,n,a,l)}finally{H.p=h,M.T=f}}function dT(e,n,a,l){var f=M.T;M.T=null;var h=H.p;try{H.p=8,Hf(e,n,a,l)}finally{H.p=h,M.T=f}}function Hf(e,n,a,l){if(Nc){var f=Vf(l);if(f===null)Cf(e,n,l,Cc,a),ey(e,l);else if(fT(f,e,n,a,l))l.stopPropagation();else if(ey(e,l),n&4&&-1<uT.indexOf(e)){for(;f!==null;){var h=Hi(f);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var _=bs(h.pendingLanes);if(_!==0){var w=h;for(w.pendingLanes|=2,w.entangledLanes|=2;_;){var R=1<<31-Xt(_);w.entanglements[1]|=R,_&=~R}Ts(h),(at&6)===0&&(dc=Jt()+500,jr(0))}}break;case 31:case 13:w=oi(h,2),w!==null&&jn(w,h,2),fc(),Uf(h,2)}if(h=Vf(l),h===null&&Cf(e,n,l,Cc,a),h===f)break;f=h}f!==null&&l.stopPropagation()}else Cf(e,n,l,null,a)}}function Vf(e){return e=qd(e),qf(e)}var Cc=null;function qf(e){if(Cc=null,e=Ui(e),e!==null){var n=d(e);if(n===null)e=null;else{var a=n.tag;if(a===13){if(e=u(n),e!==null)return e;e=null}else if(a===31){if(e=p(n),e!==null)return e;e=null}else if(a===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Cc=e,null}function Q0(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(Bi()){case ua:return 2;case Wa:return 8;case ys:case Li:return 32;case $n:return 268435456;default:return 32}default:return 32}}var Gf=!1,Da=null,Ma=null,Ra=null,Mr=new Map,Rr=new Map,Ia=[],uT="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 ey(e,n){switch(e){case"focusin":case"focusout":Da=null;break;case"dragenter":case"dragleave":Ma=null;break;case"mouseover":case"mouseout":Ra=null;break;case"pointerover":case"pointerout":Mr.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rr.delete(n.pointerId)}}function Ir(e,n,a,l,f,h){return e===null||e.nativeEvent!==h?(e={blockedOn:n,domEventName:a,eventSystemFlags:l,nativeEvent:h,targetContainers:[f]},n!==null&&(n=Hi(n),n!==null&&W0(n)),e):(e.eventSystemFlags|=l,n=e.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),e)}function fT(e,n,a,l,f){switch(n){case"focusin":return Da=Ir(Da,e,n,a,l,f),!0;case"dragenter":return Ma=Ir(Ma,e,n,a,l,f),!0;case"mouseover":return Ra=Ir(Ra,e,n,a,l,f),!0;case"pointerover":var h=f.pointerId;return Mr.set(h,Ir(Mr.get(h)||null,e,n,a,l,f)),!0;case"gotpointercapture":return h=f.pointerId,Rr.set(h,Ir(Rr.get(h)||null,e,n,a,l,f)),!0}return!1}function ty(e){var n=Ui(e.target);if(n!==null){var a=d(n);if(a!==null){if(n=a.tag,n===13){if(n=u(a),n!==null){e.blockedOn=n,ht(e.priority,function(){X0(a)});return}}else if(n===31){if(n=p(a),n!==null){e.blockedOn=n,ht(e.priority,function(){X0(a)});return}}else if(n===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ec(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var a=Vf(e.nativeEvent);if(a===null){a=e.nativeEvent;var l=new a.constructor(a.type,a);Vd=l,a.target.dispatchEvent(l),Vd=null}else return n=Hi(a),n!==null&&W0(n),e.blockedOn=a,!1;n.shift()}return!0}function ny(e,n,a){Ec(e)&&a.delete(n)}function pT(){Gf=!1,Da!==null&&Ec(Da)&&(Da=null),Ma!==null&&Ec(Ma)&&(Ma=null),Ra!==null&&Ec(Ra)&&(Ra=null),Mr.forEach(ny),Rr.forEach(ny)}function Ac(e,n){e.blockedOn===n&&(e.blockedOn=null,Gf||(Gf=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,pT)))}var Dc=null;function sy(e){Dc!==e&&(Dc=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Dc===e&&(Dc=null);for(var n=0;n<e.length;n+=3){var a=e[n],l=e[n+1],f=e[n+2];if(typeof l!="function"){if(qf(l||a)===null)continue;break}var h=Hi(a);h!==null&&(e.splice(n,3),n-=3,Hu(h,{pending:!0,data:f,method:a.method,action:l},l,f))}}))}function To(e){function n(R){return Ac(R,e)}Da!==null&&Ac(Da,e),Ma!==null&&Ac(Ma,e),Ra!==null&&Ac(Ra,e),Mr.forEach(n),Rr.forEach(n);for(var a=0;a<Ia.length;a++){var l=Ia[a];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Ia.length&&(a=Ia[0],a.blockedOn===null);)ty(a),a.blockedOn===null&&Ia.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var f=a[l],h=a[l+1],_=f[rt]||null;if(typeof h=="function")_||sy(a);else if(_){var w=null;if(h&&h.hasAttribute("formAction")){if(f=h,_=h[rt]||null)w=_.formAction;else if(qf(f)!==null)continue}else w=_.action;typeof w=="function"?a[l+1]=w:(a.splice(l,3),l-=3),sy(a)}}}function ay(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(_){return f=_})},focusReset:"manual",scroll:"manual"})}function n(){f!==null&&(f(),f=null),l||setTimeout(a,20)}function a(){if(!l&&!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 l=!1,f=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(a,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function Ff(e){this._internalRoot=e}Mc.prototype.render=Ff.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(r(409));var a=n.current,l=Mn();Y0(a,l,e,n,null,null)},Mc.prototype.unmount=Ff.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Y0(e.current,2,null,e,null,null),fc(),n[vt]=null}};function Mc(e){this._internalRoot=e}Mc.prototype.unstable_scheduleHydration=function(e){if(e){var n=Xe();e={blockedOn:null,target:e,priority:n};for(var a=0;a<Ia.length&&n!==0&&n<Ia[a].priority;a++);Ia.splice(a,0,e),a===0&&ty(e)}};var iy=s.version;if(iy!=="19.2.4")throw Error(r(527,iy,"19.2.4"));H.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=g(n),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var mT={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Rc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Rc.isDisabled&&Rc.supportsFiber)try{Wt=Rc.inject(mT),St=Rc}catch{}}return Br.createRoot=function(e,n){if(!c(e))throw Error(r(299));var a=!1,l="",f=fv,h=pv,_=mv;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(_=n.onRecoverableError)),n=Z0(e,1,!1,null,null,a,l,null,f,h,_,ay),e[vt]=n.current,Nf(e),new Ff(n)},Br.hydrateRoot=function(e,n,a){if(!c(e))throw Error(r(299));var l=!1,f="",h=fv,_=pv,w=mv,R=null;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(f=a.identifierPrefix),a.onUncaughtError!==void 0&&(h=a.onUncaughtError),a.onCaughtError!==void 0&&(_=a.onCaughtError),a.onRecoverableError!==void 0&&(w=a.onRecoverableError),a.formState!==void 0&&(R=a.formState)),n=Z0(e,1,!0,n,a??null,l,f,R,h,_,w,ay),n.context=K0(null),a=n.current,l=Mn(),l=_e(l),f=ba(l),f.callback=null,xa(a,f,l),a=l,n.current.lanes=a,te(n,a),Ts(n),e[vt]=n.current,Nf(e),new Mc(n)},Br.version="19.2.4",Br}var py;function qT(){if(py)return Zf.exports;py=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(s){console.error(s)}}return t(),Zf.exports=VT(),Zf.exports}var GT=qT();const FT="modulepreload",ZT=function(t){return"/"+t},my={},KT=function(s,o,r){let c=Promise.resolve();if(o&&o.length>0){let u=function(g){return Promise.all(g.map(v=>Promise.resolve(v).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};document.getElementsByTagName("link");const p=document.querySelector("meta[property=csp-nonce]"),m=(p==null?void 0:p.nonce)||(p==null?void 0:p.getAttribute("nonce"));c=u(o.map(g=>{if(g=ZT(g),g in my)return;my[g]=!0;const v=g.endsWith(".css"),x=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${x}`))return;const y=document.createElement("link");if(y.rel=v?"stylesheet":FT,v||(y.as="script"),y.crossOrigin="",y.href=g,m&&y.setAttribute("nonce",m),document.head.appendChild(y),v)return new Promise((k,S)=>{y.addEventListener("load",k),y.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${g}`)))})}))}function d(u){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=u,window.dispatchEvent(p),!p.defaultPrevented)throw u}return c.then(u=>{for(const p of u||[])p.status==="rejected"&&d(p.reason);return s().catch(d)})},YT=new Proxy(globalThis.fetch,{apply(t,s,o){return Reflect.apply(globalThis.fetch,s,o)}}),jd=TT({baseUrl:"/",fetch:YT}),Ye=kd(jT,jd),dn=kd(wT,jd),Bc=kd(NT,jd),Lc=kd(CT,jd),JT="_bar_1xhb4_1",WT="_input_1xhb4_32",XT="_select_1xhb4_67",QT="_btnPrimary_1xhb4_103",e2="_btnGhost_1xhb4_173",t2="_badge_1xhb4_195",n2="_disconnectHint_1xhb4_205",Rn={bar:JT,input:WT,select:XT,btnPrimary:QT,btnGhost:e2,badge:t2,disconnectHint:n2};function s2(t,s){if(!t)return!1;const o=s.find(r=>r.id===t);return o!==void 0&&(o.status==="disconnected"||o.status==="error")}function a2({environmentId:t,onReconnect:s}){return i.jsxs(i.Fragment,{children:[i.jsx("span",{className:Rn.disconnectHint,"data-testid":"env-disconnect-hint",children:"Environment unavailable"}),i.jsx("button",{type:"button",onClick:()=>s(t),className:Rn.btnGhost,"data-testid":"reconnect-btn",title:"Reconnect the environment to resume messaging",children:"Reconnect"})]})}function nl({mode:t,sessionId:s,environmentId:o,taskId:r,showPersonaSelect:c,personas:d,environments:u,onSendInput:p,onSpawn:m,onStartTask:g,onProvisionEnvironment:v,onShowToast:x}){const[y,k]=b.useState(""),[S,j]=b.useState(""),N=s2(o,u),T=C=>{if(C.preventDefault(),!!y.trim())if(t==="send"){if(!s||N)return;p(s,y),k("")}else if(t==="spawn"){if(!o)return;m(o,y,S),x==null||x("Session started","success"),k(""),j("")}else{if(!r)return;g(r,void 0,o,y),k("")}};return t==="spawn"?i.jsxs("form",{onSubmit:T,className:Rn.bar,children:[i.jsx("span",{className:Rn.badge,children:"new chat"}),i.jsx("input",{type:"text",value:y,onChange:C=>k(C.target.value),placeholder:"Enter prompt...",autoFocus:!0,className:Rn.input,"aria-label":"Enter prompt"}),c&&i.jsxs("select",{value:S,onChange:C=>j(C.target.value),className:Rn.select,"aria-label":"Select persona",children:[i.jsx("option",{value:"",children:"(Default)"}),d.map(C=>i.jsx("option",{value:C.id,children:C.name},C.id))]}),i.jsx("button",{type:"submit",disabled:!y.trim()||!o,className:Rn.btnPrimary,children:"Go"})]}):t==="start"?i.jsxs("form",{onSubmit:T,className:Rn.bar,children:[i.jsx("input",{type:"text",value:y,onChange:C=>k(C.target.value),placeholder:"Type a message...",autoFocus:!0,className:Rn.input,"aria-label":"Type a message"}),i.jsx("button",{type:"submit",disabled:!y.trim(),className:Rn.btnPrimary,children:"Send"})]}):i.jsxs("form",{onSubmit:T,className:Rn.bar,children:[N&&o&&i.jsx(a2,{environmentId:o,onReconnect:v}),i.jsx("input",{type:"text",value:y,onChange:C=>k(C.target.value),placeholder:"Type a message...",autoFocus:!N,disabled:N,className:Rn.input,"aria-label":"Type a message"}),i.jsx("span",{title:N?"Environment is unavailable — reconnect first":void 0,children:i.jsx("button",{type:"submit",disabled:!y.trim()||N,className:Rn.btnPrimary,children:"Send"})})]})}const hy=220,gy=70,i2=40,o2=60,r2="hierarchy",l2="dependency";function c2(t){return b.useMemo(()=>{if(t.length===0)return{nodes:[],edges:[]};const s=new oy.graphlib.Graph({multigraph:!0});s.setDefaultEdgeLabel(()=>({})),s.setGraph({rankdir:"TB",nodesep:i2,ranksep:o2});const o=new Map(t.map(u=>[u.id,u])),r=new Map;for(const u of t)if(u.parentTaskId&&o.has(u.parentTaskId)){const p=r.get(u.parentTaskId)||[];p.push(u),r.set(u.parentTaskId,p)}for(const u of t)s.setNode(u.id,{width:hy,height:gy});const c=[];for(const u of t){if(u.parentTaskId&&o.has(u.parentTaskId)){const p=`hierarchy-${u.parentTaskId}-${u.id}`;s.setEdge(u.parentTaskId,u.id,{},p),c.push({id:p,source:u.parentTaskId,target:u.id,type:"smoothstep",data:{edgeType:r2},style:{stroke:"var(--accent-green)",strokeWidth:2},animated:!1})}for(const p of u.dependsOn)if(o.has(p)){const m=`dependency-${p}-${u.id}`;s.setEdge(p,u.id,{},m),c.push({id:m,source:p,target:u.id,type:"smoothstep",data:{edgeType:l2},style:{stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeDasharray:"6 3"},animated:!1})}}return oy.layout(s),{nodes:t.map(u=>{const p=s.node(u.id),m=r.get(u.id)||[];return{id:u.id,type:"task",position:{x:p.x-hy/2,y:p.y-gy/2},data:{task:u,childCount:m.length,doneChildCount:m.filter(g=>g.status==="complete").length,hasDependencies:u.dependsOn.length>0}}}),edges:c}},[t])}/**
|
|
27
|
-
* @license lucide-react v0.474.0 - ISC
|
|
28
|
-
*
|
|
29
|
-
* This source code is licensed under the ISC license.
|
|
30
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const d2=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),jx=(...t)=>t.filter((s,o,r)=>!!s&&s.trim()!==""&&r.indexOf(s)===o).join(" ").trim();/**
|
|
32
|
-
* @license lucide-react v0.474.0 - ISC
|
|
33
|
-
*
|
|
34
|
-
* This source code is licensed under the ISC license.
|
|
35
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/var u2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
37
|
-
* @license lucide-react v0.474.0 - ISC
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the ISC license.
|
|
40
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const f2=b.forwardRef(({color:t="currentColor",size:s=24,strokeWidth:o=2,absoluteStrokeWidth:r,className:c="",children:d,iconNode:u,...p},m)=>b.createElement("svg",{ref:m,...u2,width:s,height:s,stroke:t,strokeWidth:r?Number(o)*24/Number(s):o,className:jx("lucide",c),...p},[...u.map(([g,v])=>b.createElement(g,v)),...Array.isArray(d)?d:[d]]));/**
|
|
42
|
-
* @license lucide-react v0.474.0 - ISC
|
|
43
|
-
*
|
|
44
|
-
* This source code is licensed under the ISC license.
|
|
45
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const qe=(t,s)=>{const o=b.forwardRef(({className:r,...c},d)=>b.createElement(f2,{ref:d,iconNode:s,className:jx(`lucide-${d2(t)}`,r),...c}));return o.displayName=`${t}`,o};/**
|
|
47
|
-
* @license lucide-react v0.474.0 - ISC
|
|
48
|
-
*
|
|
49
|
-
* This source code is licensed under the ISC license.
|
|
50
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/const p2=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],vy=qe("ArrowDown",p2);/**
|
|
52
|
-
* @license lucide-react v0.474.0 - ISC
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the ISC license.
|
|
55
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/const m2=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],yy=qe("ArrowUp",m2);/**
|
|
57
|
-
* @license lucide-react v0.474.0 - ISC
|
|
58
|
-
*
|
|
59
|
-
* This source code is licensed under the ISC license.
|
|
60
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
-
*/const h2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],g2=qe("Ban",h2);/**
|
|
62
|
-
* @license lucide-react v0.474.0 - ISC
|
|
63
|
-
*
|
|
64
|
-
* This source code is licensed under the ISC license.
|
|
65
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
-
*/const v2=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]],y2=qe("Brain",v2);/**
|
|
67
|
-
* @license lucide-react v0.474.0 - ISC
|
|
68
|
-
*
|
|
69
|
-
* This source code is licensed under the ISC license.
|
|
70
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
-
*/const b2=[["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M17.5 17.5 16 16.3V14",key:"akvzfd"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],x2=qe("CalendarClock",b2);/**
|
|
72
|
-
* @license lucide-react v0.474.0 - ISC
|
|
73
|
-
*
|
|
74
|
-
* This source code is licensed under the ISC license.
|
|
75
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
-
*/const _2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Mi=qe("Check",_2);/**
|
|
77
|
-
* @license lucide-react v0.474.0 - ISC
|
|
78
|
-
*
|
|
79
|
-
* This source code is licensed under the ISC license.
|
|
80
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/const k2=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],wx=qe("ChevronDown",k2);/**
|
|
82
|
-
* @license lucide-react v0.474.0 - ISC
|
|
83
|
-
*
|
|
84
|
-
* This source code is licensed under the ISC license.
|
|
85
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/const S2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],la=qe("ChevronRight",S2);/**
|
|
87
|
-
* @license lucide-react v0.474.0 - ISC
|
|
88
|
-
*
|
|
89
|
-
* This source code is licensed under the ISC license.
|
|
90
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
-
*/const T2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Va=qe("Circle",T2);/**
|
|
92
|
-
* @license lucide-react v0.474.0 - ISC
|
|
93
|
-
*
|
|
94
|
-
* This source code is licensed under the ISC license.
|
|
95
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/const j2=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],w2=qe("ClipboardList",j2);/**
|
|
97
|
-
* @license lucide-react v0.474.0 - ISC
|
|
98
|
-
*
|
|
99
|
-
* This source code is licensed under the ISC license.
|
|
100
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
-
*/const N2=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],Nx=qe("Clipboard",N2);/**
|
|
102
|
-
* @license lucide-react v0.474.0 - ISC
|
|
103
|
-
*
|
|
104
|
-
* This source code is licensed under the ISC license.
|
|
105
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
-
*/const C2=[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]],E2=qe("Cog",C2);/**
|
|
107
|
-
* @license lucide-react v0.474.0 - ISC
|
|
108
|
-
*
|
|
109
|
-
* This source code is licensed under the ISC license.
|
|
110
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
-
*/const A2=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],D2=qe("Copy",A2);/**
|
|
112
|
-
* @license lucide-react v0.474.0 - ISC
|
|
113
|
-
*
|
|
114
|
-
* This source code is licensed under the ISC license.
|
|
115
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
-
*/const M2=[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]],R2=qe("CornerDownRight",M2);/**
|
|
117
|
-
* @license lucide-react v0.474.0 - ISC
|
|
118
|
-
*
|
|
119
|
-
* This source code is licensed under the ISC license.
|
|
120
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
-
*/const I2=[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]],O2=qe("FilePen",I2);/**
|
|
122
|
-
* @license lucide-react v0.474.0 - ISC
|
|
123
|
-
*
|
|
124
|
-
* This source code is licensed under the ISC license.
|
|
125
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
-
*/const B2=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],L2=qe("FileText",B2);/**
|
|
127
|
-
* @license lucide-react v0.474.0 - ISC
|
|
128
|
-
*
|
|
129
|
-
* This source code is licensed under the ISC license.
|
|
130
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
-
*/const z2=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],$2=qe("House",z2);/**
|
|
132
|
-
* @license lucide-react v0.474.0 - ISC
|
|
133
|
-
*
|
|
134
|
-
* This source code is licensed under the ISC license.
|
|
135
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
-
*/const P2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],gm=qe("Info",P2);/**
|
|
137
|
-
* @license lucide-react v0.474.0 - ISC
|
|
138
|
-
*
|
|
139
|
-
* This source code is licensed under the ISC license.
|
|
140
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
-
*/const U2=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],H2=qe("Key",U2);/**
|
|
142
|
-
* @license lucide-react v0.474.0 - ISC
|
|
143
|
-
*
|
|
144
|
-
* This source code is licensed under the ISC license.
|
|
145
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
-
*/const V2=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],q2=qe("Keyboard",V2);/**
|
|
147
|
-
* @license lucide-react v0.474.0 - ISC
|
|
148
|
-
*
|
|
149
|
-
* This source code is licensed under the ISC license.
|
|
150
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
-
*/const G2=[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]],F2=qe("ListChecks",G2);/**
|
|
152
|
-
* @license lucide-react v0.474.0 - ISC
|
|
153
|
-
*
|
|
154
|
-
* This source code is licensed under the ISC license.
|
|
155
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
-
*/const Z2=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],K2=qe("List",Z2);/**
|
|
157
|
-
* @license lucide-react v0.474.0 - ISC
|
|
158
|
-
*
|
|
159
|
-
* This source code is licensed under the ISC license.
|
|
160
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
-
*/const Y2=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],J2=qe("Loader",Y2);/**
|
|
162
|
-
* @license lucide-react v0.474.0 - ISC
|
|
163
|
-
*
|
|
164
|
-
* This source code is licensed under the ISC license.
|
|
165
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
-
*/const W2=[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]],X2=qe("Menu",W2);/**
|
|
167
|
-
* @license lucide-react v0.474.0 - ISC
|
|
168
|
-
*
|
|
169
|
-
* This source code is licensed under the ISC license.
|
|
170
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
-
*/const Q2=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],ej=qe("MessageSquare",Q2);/**
|
|
172
|
-
* @license lucide-react v0.474.0 - ISC
|
|
173
|
-
*
|
|
174
|
-
* This source code is licensed under the ISC license.
|
|
175
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
-
*/const tj=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],nj=qe("Monitor",tj);/**
|
|
177
|
-
* @license lucide-react v0.474.0 - ISC
|
|
178
|
-
*
|
|
179
|
-
* This source code is licensed under the ISC license.
|
|
180
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
-
*/const sj=[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]],aj=qe("Palette",sj);/**
|
|
182
|
-
* @license lucide-react v0.474.0 - ISC
|
|
183
|
-
*
|
|
184
|
-
* This source code is licensed under the ISC license.
|
|
185
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
-
*/const ij=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],oj=qe("Pause",ij);/**
|
|
187
|
-
* @license lucide-react v0.474.0 - ISC
|
|
188
|
-
*
|
|
189
|
-
* This source code is licensed under the ISC license.
|
|
190
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
-
*/const rj=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],lj=qe("Pencil",rj);/**
|
|
192
|
-
* @license lucide-react v0.474.0 - ISC
|
|
193
|
-
*
|
|
194
|
-
* This source code is licensed under the ISC license.
|
|
195
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
-
*/const cj=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],dj=qe("Puzzle",cj);/**
|
|
197
|
-
* @license lucide-react v0.474.0 - ISC
|
|
198
|
-
*
|
|
199
|
-
* This source code is licensed under the ISC license.
|
|
200
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
-
*/const uj=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Cx=qe("Search",uj);/**
|
|
202
|
-
* @license lucide-react v0.474.0 - ISC
|
|
203
|
-
*
|
|
204
|
-
* This source code is licensed under the ISC license.
|
|
205
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
-
*/const fj=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],pj=qe("Settings",fj);/**
|
|
207
|
-
* @license lucide-react v0.474.0 - ISC
|
|
208
|
-
*
|
|
209
|
-
* This source code is licensed under the ISC license.
|
|
210
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
-
*/const mj=[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],hj=qe("SquareCheckBig",mj);/**
|
|
212
|
-
* @license lucide-react v0.474.0 - ISC
|
|
213
|
-
*
|
|
214
|
-
* This source code is licensed under the ISC license.
|
|
215
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
-
*/const gj=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],vm=qe("TriangleAlert",gj);/**
|
|
217
|
-
* @license lucide-react v0.474.0 - ISC
|
|
218
|
-
*
|
|
219
|
-
* This source code is licensed under the ISC license.
|
|
220
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
-
*/const vj=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],yj=qe("User",vj);/**
|
|
222
|
-
* @license lucide-react v0.474.0 - ISC
|
|
223
|
-
*
|
|
224
|
-
* This source code is licensed under the ISC license.
|
|
225
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
-
*/const bj=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Za=qe("X",bj),ym=8,dt=12,nn=14,Nt=16,Pp={not_started:{color:"var(--text-tertiary)",icon:i.jsx(Va,{size:dt}),label:"Not Started"},working:{color:"var(--accent-green)",icon:i.jsx(Va,{size:dt,fill:"currentColor"}),label:"Working"},paused:{color:"var(--accent-yellow)",icon:i.jsx(oj,{size:dt}),label:"Paused"},complete:{color:"var(--accent-green)",icon:i.jsx(Mi,{size:dt}),label:"Complete"},failed:{color:"var(--accent-red)",icon:i.jsx(Za,{size:dt}),label:"Failed"},blocked:{color:"var(--accent-yellow)",icon:i.jsx(g2,{size:dt}),label:"Blocked"}};function qa(t){return t==="blocked"?Pp.blocked:Pp[fl(t)]}const xj={not_started:"statusPending",working:"statusInProgress",paused:"statusWaitingInput",complete:"statusDone",failed:"statusFailed"};function _j(t){return xj[fl(t)]??"statusPending"}const kj=["working","paused","failed","not_started","blocked","complete"],by=["not_started","working","paused","complete","failed"],Sj={pending:"not_started",assigned:"not_started",in_progress:"working",waiting_input:"paused",review:"paused",done:"complete"};function fl(t){return t in Pp&&t!=="blocked"?t:Sj[t]??"not_started"}const Tj={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"},jj="_dagContainer_js4w6_1",wj="_taskNode_js4w6_26",Nj="_taskNodeBorder_js4w6_54",Cj="_taskNodeContent_js4w6_60",Ej="_taskNodeHeader_js4w6_70",Aj="_taskNodeIcon_js4w6_77",Dj="_taskNodeTitle_js4w6_82",Mj="_taskNodeBadges_js4w6_90",Rj="_childBadge_js4w6_95",Ij="_depBadge_js4w6_107",Oj="_handle_js4w6_119",Bj="_emptyCta_js4w6_126",Lj="_ctaDescription_js4w6_137",zj="_ctaButton_js4w6_144",bn={dagContainer:jj,taskNode:wj,taskNodeBorder:Nj,taskNodeContent:Cj,taskNodeHeader:Ej,taskNodeIcon:Aj,taskNodeTitle:Dj,taskNodeBadges:Mj,childBadge:Rj,depBadge:Ij,handle:Oj,emptyCta:Bj,ctaDescription:Lj,ctaButton:zj};function $j({data:t}){const{task:s,childCount:o,doneChildCount:r,hasDependencies:c}=t,d=qa(s.status);return i.jsxs("div",{className:bn.taskNode,"data-task-id":s.id,"data-task-title":s.title,children:[i.jsx(ry,{type:"target",position:ly.Top,className:bn.handle}),i.jsx("div",{className:bn.taskNodeBorder,style:{backgroundColor:d.color}}),i.jsxs("div",{className:bn.taskNodeContent,children:[i.jsxs("div",{className:bn.taskNodeHeader,children:[i.jsx("span",{className:bn.taskNodeIcon,style:{color:d.color},children:d.icon}),i.jsx("span",{className:bn.taskNodeTitle,children:s.title})]}),i.jsxs("div",{className:bn.taskNodeBadges,children:[o>0&&i.jsxs("span",{className:bn.childBadge,children:[r,"/",o]}),c&&i.jsx("span",{className:bn.depBadge,children:"dep"})]})]}),i.jsx(ry,{type:"source",position:ly.Bottom,className:bn.handle})]})}/**
|
|
227
|
-
* react-router v7.13.2
|
|
228
|
-
*
|
|
229
|
-
* Copyright (c) Remix Software Inc.
|
|
230
|
-
*
|
|
231
|
-
* This source code is licensed under the MIT license found in the
|
|
232
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
233
|
-
*
|
|
234
|
-
* @license MIT
|
|
235
|
-
*/var xy="popstate";function _y(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function Pj(t={}){function s(r,c){var g;let d=(g=c.state)==null?void 0:g.masked,{pathname:u,search:p,hash:m}=d||r.location;return Up("",{pathname:u,search:p,hash:m},c.state&&c.state.usr||null,c.state&&c.state.key||"default",d?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function o(r,c){return typeof c=="string"?c:sl(c)}return Hj(s,o,null,t)}function _t(t,s){if(t===!1||t===null||typeof t>"u")throw new Error(s)}function ns(t,s){if(!t){typeof console<"u"&&console.warn(s);try{throw new Error(s)}catch{}}}function Uj(){return Math.random().toString(36).substring(2,10)}function ky(t,s){return{usr:t.state,key:t.key,idx:s,masked:t.unstable_mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function Up(t,s,o=null,r,c){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof s=="string"?Po(s):s,state:o,key:s&&s.key||r||Uj(),unstable_mask:c}}function sl({pathname:t="/",search:s="",hash:o=""}){return s&&s!=="?"&&(t+=s.charAt(0)==="?"?s:"?"+s),o&&o!=="#"&&(t+=o.charAt(0)==="#"?o:"#"+o),t}function Po(t){let s={};if(t){let o=t.indexOf("#");o>=0&&(s.hash=t.substring(o),t=t.substring(0,o));let r=t.indexOf("?");r>=0&&(s.search=t.substring(r),t=t.substring(0,r)),t&&(s.pathname=t)}return s}function Hj(t,s,o,r={}){let{window:c=document.defaultView,v5Compat:d=!1}=r,u=c.history,p="POP",m=null,g=v();g==null&&(g=0,u.replaceState({...u.state,idx:g},""));function v(){return(u.state||{idx:null}).idx}function x(){p="POP";let N=v(),T=N==null?null:N-g;g=N,m&&m({action:p,location:j.location,delta:T})}function y(N,T){p="PUSH";let C=_y(N)?N:Up(j.location,N,T);g=v()+1;let A=ky(C,g),O=j.createHref(C.unstable_mask||C);try{u.pushState(A,"",O)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;c.location.assign(O)}d&&m&&m({action:p,location:j.location,delta:1})}function k(N,T){p="REPLACE";let C=_y(N)?N:Up(j.location,N,T);g=v();let A=ky(C,g),O=j.createHref(C.unstable_mask||C);u.replaceState(A,"",O),d&&m&&m({action:p,location:j.location,delta:0})}function S(N){return Vj(N)}let j={get action(){return p},get location(){return t(c,u)},listen(N){if(m)throw new Error("A history only accepts one active listener");return c.addEventListener(xy,x),m=N,()=>{c.removeEventListener(xy,x),m=null}},createHref(N){return s(c,N)},createURL:S,encodeLocation(N){let T=S(N);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:y,replace:k,go(N){return u.go(N)}};return j}function Vj(t,s=!1){let o="http://localhost";typeof window<"u"&&(o=window.location.origin!=="null"?window.location.origin:window.location.href),_t(o,"No window.location.(origin|href) available to create URL");let r=typeof t=="string"?t:sl(t);return r=r.replace(/ $/,"%20"),!s&&r.startsWith("//")&&(r=o+r),new URL(r,o)}function Ex(t,s,o="/"){return qj(t,s,o,!1)}function qj(t,s,o,r){let c=typeof s=="string"?Po(s):s,d=aa(c.pathname||"/",o);if(d==null)return null;let u=Ax(t);Gj(u);let p=null;for(let m=0;p==null&&m<u.length;++m){let g=Mx(d);p=ew(u[m],g,r)}return p}function Ax(t,s=[],o=[],r="",c=!1){let d=(u,p,m=c,g)=>{let v={relativePath:g===void 0?u.path||"":g,caseSensitive:u.caseSensitive===!0,childrenIndex:p,route:u};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(r)&&m)return;_t(v.relativePath.startsWith(r),`Absolute route path "${v.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(r.length)}let x=Cs([r,v.relativePath]),y=o.concat(v);u.children&&u.children.length>0&&(_t(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),Ax(u.children,s,y,x,m)),!(u.path==null&&!u.index)&&s.push({path:x,score:Xj(x,u.index),routesMeta:y})};return t.forEach((u,p)=>{var m;if(u.path===""||!((m=u.path)!=null&&m.includes("?")))d(u,p);else for(let g of Dx(u.path))d(u,p,!0,g)}),s}function Dx(t){let s=t.split("/");if(s.length===0)return[];let[o,...r]=s,c=o.endsWith("?"),d=o.replace(/\?$/,"");if(r.length===0)return c?[d,""]:[d];let u=Dx(r.join("/")),p=[];return p.push(...u.map(m=>m===""?d:[d,m].join("/"))),c&&p.push(...u),p.map(m=>t.startsWith("/")&&m===""?"/":m)}function Gj(t){t.sort((s,o)=>s.score!==o.score?o.score-s.score:Qj(s.routesMeta.map(r=>r.childrenIndex),o.routesMeta.map(r=>r.childrenIndex)))}var Fj=/^:[\w-]+$/,Zj=3,Kj=2,Yj=1,Jj=10,Wj=-2,Sy=t=>t==="*";function Xj(t,s){let o=t.split("/"),r=o.length;return o.some(Sy)&&(r+=Wj),s&&(r+=Kj),o.filter(c=>!Sy(c)).reduce((c,d)=>c+(Fj.test(d)?Zj:d===""?Yj:Jj),r)}function Qj(t,s){return t.length===s.length&&t.slice(0,-1).every((r,c)=>r===s[c])?t[t.length-1]-s[s.length-1]:0}function ew(t,s,o=!1){let{routesMeta:r}=t,c={},d="/",u=[];for(let p=0;p<r.length;++p){let m=r[p],g=p===r.length-1,v=d==="/"?s:s.slice(d.length)||"/",x=al({path:m.relativePath,caseSensitive:m.caseSensitive,end:g},v),y=m.route;if(!x&&g&&o&&!r[r.length-1].route.index&&(x=al({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},v)),!x)return null;Object.assign(c,x.params),u.push({params:c,pathname:Cs([d,x.pathname]),pathnameBase:iw(Cs([d,x.pathnameBase])),route:y}),x.pathnameBase!=="/"&&(d=Cs([d,x.pathnameBase]))}return u}function al(t,s){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[o,r]=tw(t.path,t.caseSensitive,t.end),c=s.match(o);if(!c)return null;let d=c[0],u=d.replace(/(.)\/+$/,"$1"),p=c.slice(1);return{params:r.reduce((g,{paramName:v,isOptional:x},y)=>{if(v==="*"){let S=p[y]||"";u=d.slice(0,d.length-S.length).replace(/(.)\/+$/,"$1")}const k=p[y];return x&&!k?g[v]=void 0:g[v]=(k||"").replace(/%2F/g,"/"),g},{}),pathname:d,pathnameBase:u,pattern:t}}function tw(t,s=!1,o=!0){ns(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let r=[],c="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,p,m,g,v)=>{if(r.push({paramName:p,isOptional:m!=null}),m){let x=v.charAt(g+u.length);return x&&x!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(r.push({paramName:"*"}),c+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?c+="\\/*$":t!==""&&t!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,s?void 0:"i"),r]}function Mx(t){try{return t.split("/").map(s=>decodeURIComponent(s).replace(/\//g,"%2F")).join("/")}catch(s){return ns(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${s}).`),t}}function aa(t,s){if(s==="/")return t;if(!t.toLowerCase().startsWith(s.toLowerCase()))return null;let o=s.endsWith("/")?s.length-1:s.length,r=t.charAt(o);return r&&r!=="/"?null:t.slice(o)||"/"}var nw=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function sw(t,s="/"){let{pathname:o,search:r="",hash:c=""}=typeof t=="string"?Po(t):t,d;return o?(o=o.replace(/\/\/+/g,"/"),o.startsWith("/")?d=Ty(o.substring(1),"/"):d=Ty(o,s)):d=s,{pathname:d,search:ow(r),hash:rw(c)}}function Ty(t,s){let o=s.replace(/\/+$/,"").split("/");return t.split("/").forEach(c=>{c===".."?o.length>1&&o.pop():c!=="."&&o.push(c)}),o.length>1?o.join("/"):"/"}function Jf(t,s,o,r){return`Cannot include a '${t}' character in a manually specified \`to.${s}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${o}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function aw(t){return t.filter((s,o)=>o===0||s.route.path&&s.route.path.length>0)}function bm(t){let s=aw(t);return s.map((o,r)=>r===s.length-1?o.pathname:o.pathnameBase)}function wd(t,s,o,r=!1){let c;typeof t=="string"?c=Po(t):(c={...t},_t(!c.pathname||!c.pathname.includes("?"),Jf("?","pathname","search",c)),_t(!c.pathname||!c.pathname.includes("#"),Jf("#","pathname","hash",c)),_t(!c.search||!c.search.includes("#"),Jf("#","search","hash",c)));let d=t===""||c.pathname==="",u=d?"/":c.pathname,p;if(u==null)p=o;else{let x=s.length-1;if(!r&&u.startsWith("..")){let y=u.split("/");for(;y[0]==="..";)y.shift(),x-=1;c.pathname=y.join("/")}p=x>=0?s[x]:"/"}let m=sw(c,p),g=u&&u!=="/"&&u.endsWith("/"),v=(d||u===".")&&o.endsWith("/");return!m.pathname.endsWith("/")&&(g||v)&&(m.pathname+="/"),m}var Cs=t=>t.join("/").replace(/\/\/+/g,"/"),iw=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),ow=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,rw=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,lw=class{constructor(t,s,o,r=!1){this.status=t,this.statusText=s||"",this.internal=r,o instanceof Error?(this.data=o.toString(),this.error=o):this.data=o}};function cw(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function dw(t){return t.map(s=>s.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Rx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ix(t,s){let o=t;if(typeof o!="string"||!nw.test(o))return{absoluteURL:void 0,isExternal:!1,to:o};let r=o,c=!1;if(Rx)try{let d=new URL(window.location.href),u=o.startsWith("//")?new URL(d.protocol+o):new URL(o),p=aa(u.pathname,s);u.origin===d.origin&&p!=null?o=p+u.search+u.hash:c=!0}catch{ns(!1,`<Link to="${o}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:c,to:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ox=["POST","PUT","PATCH","DELETE"];new Set(Ox);var uw=["GET",...Ox];new Set(uw);var Uo=b.createContext(null);Uo.displayName="DataRouter";var Nd=b.createContext(null);Nd.displayName="DataRouterState";var fw=b.createContext(!1),Bx=b.createContext({isTransitioning:!1});Bx.displayName="ViewTransition";var pw=b.createContext(new Map);pw.displayName="Fetchers";var mw=b.createContext(null);mw.displayName="Await";var Ln=b.createContext(null);Ln.displayName="Navigation";var pl=b.createContext(null);pl.displayName="Location";var ss=b.createContext({outlet:null,matches:[],isDataRoute:!1});ss.displayName="Route";var xm=b.createContext(null);xm.displayName="RouteError";var Lx="REACT_ROUTER_ERROR",hw="REDIRECT",gw="ROUTE_ERROR_RESPONSE";function vw(t){if(t.startsWith(`${Lx}:${hw}:{`))try{let s=JSON.parse(t.slice(28));if(typeof s=="object"&&s&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.location=="string"&&typeof s.reloadDocument=="boolean"&&typeof s.replace=="boolean")return s}catch{}}function yw(t){if(t.startsWith(`${Lx}:${gw}:{`))try{let s=JSON.parse(t.slice(40));if(typeof s=="object"&&s&&typeof s.status=="number"&&typeof s.statusText=="string")return new lw(s.status,s.statusText,s.data)}catch{}}function bw(t,{relative:s}={}){_t(Ri(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:r}=b.useContext(Ln),{hash:c,pathname:d,search:u}=ml(t,{relative:s}),p=d;return o!=="/"&&(p=d==="/"?o:Cs([o,d])),r.createHref({pathname:p,search:u,hash:c})}function Ri(){return b.useContext(pl)!=null}function Yt(){return _t(Ri(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(pl).location}function Dt(t){_t(Ri(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:s}=Yt();return b.useMemo(()=>al(t,Mx(s)),[s,t])}var zx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function $x(t){b.useContext(Ln).static||b.useLayoutEffect(t)}function Cd(){let{isDataRoute:t}=b.useContext(ss);return t?Iw():xw()}function xw(){_t(Ri(),"useNavigate() may be used only in the context of a <Router> component.");let t=b.useContext(Uo),{basename:s,navigator:o}=b.useContext(Ln),{matches:r}=b.useContext(ss),{pathname:c}=Yt(),d=JSON.stringify(bm(r)),u=b.useRef(!1);return $x(()=>{u.current=!0}),b.useCallback((m,g={})=>{if(ns(u.current,zx),!u.current)return;if(typeof m=="number"){o.go(m);return}let v=wd(m,JSON.parse(d),c,g.relative==="path");t==null&&s!=="/"&&(v.pathname=v.pathname==="/"?s:Cs([s,v.pathname])),(g.replace?o.replace:o.push)(v,g.state,g)},[s,o,d,c,t])}var _w=b.createContext(null);function kw(t){let s=b.useContext(ss).outlet;return b.useMemo(()=>s&&b.createElement(_w.Provider,{value:t},s),[s,t])}function as(){let{matches:t}=b.useContext(ss),s=t[t.length-1];return s?s.params:{}}function ml(t,{relative:s}={}){let{matches:o}=b.useContext(ss),{pathname:r}=Yt(),c=JSON.stringify(bm(o));return b.useMemo(()=>wd(t,JSON.parse(c),r,s==="path"),[t,c,r,s])}function Sw(t,s){return Px(t,s)}function Px(t,s,o){var N;_t(Ri(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=b.useContext(Ln),{matches:c}=b.useContext(ss),d=c[c.length-1],u=d?d.params:{},p=d?d.pathname:"/",m=d?d.pathnameBase:"/",g=d&&d.route;{let T=g&&g.path||"";Hx(p,!g||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${T}">) 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.
|
|
236
|
-
|
|
237
|
-
Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let v=Yt(),x;if(s){let T=typeof s=="string"?Po(s):s;_t(m==="/"||((N=T.pathname)==null?void 0:N.startsWith(m)),`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 "${m}" but pathname "${T.pathname}" was given in the \`location\` prop.`),x=T}else x=v;let y=x.pathname||"/",k=y;if(m!=="/"){let T=m.replace(/^\//,"").split("/");k="/"+y.replace(/^\//,"").split("/").slice(T.length).join("/")}let S=Ex(t,{pathname:k});ns(g||S!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),ns(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.length-1].route.lazy!==void 0,`Matched leaf route at location "${x.pathname}${x.search}${x.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 j=Cw(S&&S.map(T=>Object.assign({},T,{params:Object.assign({},u,T.params),pathname:Cs([m,r.encodeLocation?r.encodeLocation(T.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?m:Cs([m,r.encodeLocation?r.encodeLocation(T.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),c,o);return s&&j?b.createElement(pl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...x},navigationType:"POP"}},j):j}function Tw(){let t=Rw(),s=cw(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),o=t instanceof Error?t.stack:null,r="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:r},d={padding:"2px 4px",backgroundColor:r},u=null;return console.error("Error handled by React Router default ErrorBoundary:",t),u=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:d},"ErrorBoundary")," or"," ",b.createElement("code",{style:d},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},s),o?b.createElement("pre",{style:c},o):null,u)}var jw=b.createElement(Tw,null),Ux=class extends b.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,s){return s.location!==t.location||s.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:s.error,location:s.location,revalidation:t.revalidation||s.revalidation}}componentDidCatch(t,s){this.props.onError?this.props.onError(t,s):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const o=yw(t.digest);o&&(t=o)}let s=t!==void 0?b.createElement(ss.Provider,{value:this.props.routeContext},b.createElement(xm.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?b.createElement(ww,{error:t},s):s}};Ux.contextType=fw;var Wf=new WeakMap;function ww({children:t,error:s}){let{basename:o}=b.useContext(Ln);if(typeof s=="object"&&s&&"digest"in s&&typeof s.digest=="string"){let r=vw(s.digest);if(r){let c=Wf.get(s);if(c)throw c;let d=Ix(r.location,o);if(Rx&&!Wf.get(s))if(d.isExternal||r.reloadDocument)window.location.href=d.absoluteURL||d.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(d.to,{replace:r.replace}));throw Wf.set(s,u),u}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d.absoluteURL||d.to}`})}}return t}function Nw({routeContext:t,match:s,children:o}){let r=b.useContext(Uo);return r&&r.static&&r.staticContext&&(s.route.errorElement||s.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=s.route.id),b.createElement(ss.Provider,{value:t},o)}function Cw(t,s=[],o){let r=o==null?void 0:o.state;if(t==null){if(!r)return null;if(r.errors)t=r.matches;else if(s.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let c=t,d=r==null?void 0:r.errors;if(d!=null){let v=c.findIndex(x=>x.route.id&&(d==null?void 0:d[x.route.id])!==void 0);_t(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),c=c.slice(0,Math.min(c.length,v+1))}let u=!1,p=-1;if(o&&r){u=r.renderFallback;for(let v=0;v<c.length;v++){let x=c[v];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(p=v),x.route.id){let{loaderData:y,errors:k}=r,S=x.route.loader&&!y.hasOwnProperty(x.route.id)&&(!k||k[x.route.id]===void 0);if(x.route.lazy||S){o.isStatic&&(u=!0),p>=0?c=c.slice(0,p+1):c=[c[0]];break}}}}let m=o==null?void 0:o.onError,g=r&&m?(v,x)=>{var y,k;m(v,{location:r.location,params:((k=(y=r.matches)==null?void 0:y[0])==null?void 0:k.params)??{},unstable_pattern:dw(r.matches),errorInfo:x})}:void 0;return c.reduceRight((v,x,y)=>{let k,S=!1,j=null,N=null;r&&(k=d&&x.route.id?d[x.route.id]:void 0,j=x.route.errorElement||jw,u&&(p<0&&y===0?(Hx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,N=null):p===y&&(S=!0,N=x.route.hydrateFallbackElement||null)));let T=s.concat(c.slice(0,y+1)),C=()=>{let A;return k?A=j:S?A=N:x.route.Component?A=b.createElement(x.route.Component,null):x.route.element?A=x.route.element:A=v,b.createElement(Nw,{match:x,routeContext:{outlet:v,matches:T,isDataRoute:r!=null},children:A})};return r&&(x.route.ErrorBoundary||x.route.errorElement||y===0)?b.createElement(Ux,{location:r.location,revalidation:r.revalidation,component:j,error:k,children:C(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:g}):C()},null)}function _m(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ew(t){let s=b.useContext(Uo);return _t(s,_m(t)),s}function Aw(t){let s=b.useContext(Nd);return _t(s,_m(t)),s}function Dw(t){let s=b.useContext(ss);return _t(s,_m(t)),s}function km(t){let s=Dw(t),o=s.matches[s.matches.length-1];return _t(o.route.id,`${t} can only be used on routes that contain a unique "id"`),o.route.id}function Mw(){return km("useRouteId")}function Rw(){var r;let t=b.useContext(xm),s=Aw("useRouteError"),o=km("useRouteError");return t!==void 0?t:(r=s.errors)==null?void 0:r[o]}function Iw(){let{router:t}=Ew("useNavigate"),s=km("useNavigate"),o=b.useRef(!1);return $x(()=>{o.current=!0}),b.useCallback(async(c,d={})=>{ns(o.current,zx),o.current&&(typeof c=="number"?await t.navigate(c):await t.navigate(c,{fromRouteId:s,...d}))},[t,s])}var jy={};function Hx(t,s,o){!s&&!jy[t]&&(jy[t]=!0,ns(!1,o))}b.memo(Ow);function Ow({routes:t,future:s,state:o,isStatic:r,onError:c}){return Px(t,void 0,{state:o,isStatic:r,onError:c})}function ts({to:t,replace:s,state:o,relative:r}){_t(Ri(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=b.useContext(Ln);ns(!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}=b.useContext(ss),{pathname:u}=Yt(),p=Cd(),m=wd(t,bm(d),u,r==="path"),g=JSON.stringify(m);return b.useEffect(()=>{p(JSON.parse(g),{replace:s,state:o,relative:r})},[p,g,r,s,o]),null}function Ka(t){return kw(t.context)}function we(t){_t(!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 Bw({basename:t="/",children:s=null,location:o,navigationType:r="POP",navigator:c,static:d=!1,unstable_useTransitions:u}){_t(!Ri(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=t.replace(/^\/*/,"/"),m=b.useMemo(()=>({basename:p,navigator:c,static:d,unstable_useTransitions:u,future:{}}),[p,c,d,u]);typeof o=="string"&&(o=Po(o));let{pathname:g="/",search:v="",hash:x="",state:y=null,key:k="default",unstable_mask:S}=o,j=b.useMemo(()=>{let N=aa(g,p);return N==null?null:{location:{pathname:N,search:v,hash:x,state:y,key:k,unstable_mask:S},navigationType:r}},[p,g,v,x,y,k,r,S]);return ns(j!=null,`<Router basename="${p}"> is not able to match the URL "${g}${v}${x}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:b.createElement(Ln.Provider,{value:m},b.createElement(pl.Provider,{children:s,value:j}))}function Lw({children:t,location:s}){return Sw(Hp(t),s)}function Hp(t,s=[]){let o=[];return b.Children.forEach(t,(r,c)=>{if(!b.isValidElement(r))return;let d=[...s,c];if(r.type===b.Fragment){o.push.apply(o,Hp(r.props.children,d));return}_t(r.type===we,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),_t(!r.props.index||!r.props.children,"An index route cannot have child routes.");let u={id:r.props.id||d.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(u.children=Hp(r.props.children,d)),o.push(u)}),o}var Qc="get",ed="application/x-www-form-urlencoded";function Ed(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function zw(t){return Ed(t)&&t.tagName.toLowerCase()==="button"}function $w(t){return Ed(t)&&t.tagName.toLowerCase()==="form"}function Pw(t){return Ed(t)&&t.tagName.toLowerCase()==="input"}function Uw(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Hw(t,s){return t.button===0&&(!s||s==="_self")&&!Uw(t)}function Vp(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((s,o)=>{let r=t[o];return s.concat(Array.isArray(r)?r.map(c=>[o,c]):[[o,r]])},[]))}function Vw(t,s){let o=Vp(t);return s&&s.forEach((r,c)=>{o.has(c)||s.getAll(c).forEach(d=>{o.append(c,d)})}),o}var zc=null;function qw(){if(zc===null)try{new FormData(document.createElement("form"),0),zc=!1}catch{zc=!0}return zc}var Gw=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Xf(t){return t!=null&&!Gw.has(t)?(ns(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ed}"`),null):t}function Fw(t,s){let o,r,c,d,u;if($w(t)){let p=t.getAttribute("action");r=p?aa(p,s):null,o=t.getAttribute("method")||Qc,c=Xf(t.getAttribute("enctype"))||ed,d=new FormData(t)}else if(zw(t)||Pw(t)&&(t.type==="submit"||t.type==="image")){let p=t.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=t.getAttribute("formaction")||p.getAttribute("action");if(r=m?aa(m,s):null,o=t.getAttribute("formmethod")||p.getAttribute("method")||Qc,c=Xf(t.getAttribute("formenctype"))||Xf(p.getAttribute("enctype"))||ed,d=new FormData(p,t),!qw()){let{name:g,type:v,value:x}=t;if(v==="image"){let y=g?`${g}.`:"";d.append(`${y}x`,"0"),d.append(`${y}y`,"0")}else g&&d.append(g,x)}}else{if(Ed(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=Qc,r=null,c=ed,u=t}return d&&c==="text/plain"&&(u=d,d=void 0),{action:r,method:o.toLowerCase(),encType:c,formData:d,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Sm(t,s){if(t===!1||t===null||typeof t>"u")throw new Error(s)}function Zw(t,s,o,r){let c=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return o?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${r}`:c.pathname=`${c.pathname}.${r}`:c.pathname==="/"?c.pathname=`_root.${r}`:s&&aa(c.pathname,s)==="/"?c.pathname=`${s.replace(/\/$/,"")}/_root.${r}`:c.pathname=`${c.pathname.replace(/\/$/,"")}.${r}`,c}async function Kw(t,s){if(t.id in s)return s[t.id];try{let o=await import(t.module);return s[t.id]=o,o}catch(o){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(o),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Yw(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function Jw(t,s,o){let r=await Promise.all(t.map(async c=>{let d=s.routes[c.route.id];if(d){let u=await Kw(d,o);return u.links?u.links():[]}return[]}));return eN(r.flat(1).filter(Yw).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function wy(t,s,o,r,c,d){let u=(m,g)=>o[g]?m.route.id!==o[g].route.id:!0,p=(m,g)=>{var v;return o[g].pathname!==m.pathname||((v=o[g].route.path)==null?void 0:v.endsWith("*"))&&o[g].params["*"]!==m.params["*"]};return d==="assets"?s.filter((m,g)=>u(m,g)||p(m,g)):d==="data"?s.filter((m,g)=>{var x;let v=r.routes[m.route.id];if(!v||!v.hasLoader)return!1;if(u(m,g)||p(m,g))return!0;if(m.route.shouldRevalidate){let y=m.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:((x=o[0])==null?void 0:x.params)||{},nextUrl:new URL(t,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function Ww(t,s,{includeHydrateFallback:o}={}){return Xw(t.map(r=>{let c=s.routes[r.route.id];if(!c)return[];let d=[c.module];return c.clientActionModule&&(d=d.concat(c.clientActionModule)),c.clientLoaderModule&&(d=d.concat(c.clientLoaderModule)),o&&c.hydrateFallbackModule&&(d=d.concat(c.hydrateFallbackModule)),c.imports&&(d=d.concat(c.imports)),d}).flat(1))}function Xw(t){return[...new Set(t)]}function Qw(t){let s={},o=Object.keys(t).sort();for(let r of o)s[r]=t[r];return s}function eN(t,s){let o=new Set;return new Set(s),t.reduce((r,c)=>{let d=JSON.stringify(Qw(c));return o.has(d)||(o.add(d),r.push({key:d,link:c})),r},[])}function Vx(){let t=b.useContext(Uo);return Sm(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function tN(){let t=b.useContext(Nd);return Sm(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var Tm=b.createContext(void 0);Tm.displayName="FrameworkContext";function qx(){let t=b.useContext(Tm);return Sm(t,"You must render this element inside a <HydratedRouter> element"),t}function nN(t,s){let o=b.useContext(Tm),[r,c]=b.useState(!1),[d,u]=b.useState(!1),{onFocus:p,onBlur:m,onMouseEnter:g,onMouseLeave:v,onTouchStart:x}=s,y=b.useRef(null);b.useEffect(()=>{if(t==="render"&&u(!0),t==="viewport"){let j=T=>{T.forEach(C=>{u(C.isIntersecting)})},N=new IntersectionObserver(j,{threshold:.5});return y.current&&N.observe(y.current),()=>{N.disconnect()}}},[t]),b.useEffect(()=>{if(r){let j=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(j)}}},[r]);let k=()=>{c(!0)},S=()=>{c(!1),u(!1)};return o?t!=="intent"?[d,y,{}]:[d,y,{onFocus:Lr(p,k),onBlur:Lr(m,S),onMouseEnter:Lr(g,k),onMouseLeave:Lr(v,S),onTouchStart:Lr(x,k)}]:[!1,y,{}]}function Lr(t,s){return o=>{t&&t(o),o.defaultPrevented||s(o)}}function sN({page:t,...s}){let{router:o}=Vx(),r=b.useMemo(()=>Ex(o.routes,t,o.basename),[o.routes,t,o.basename]);return r?b.createElement(iN,{page:t,matches:r,...s}):null}function aN(t){let{manifest:s,routeModules:o}=qx(),[r,c]=b.useState([]);return b.useEffect(()=>{let d=!1;return Jw(t,s,o).then(u=>{d||c(u)}),()=>{d=!0}},[t,s,o]),r}function iN({page:t,matches:s,...o}){let r=Yt(),{future:c,manifest:d,routeModules:u}=qx(),{basename:p}=Vx(),{loaderData:m,matches:g}=tN(),v=b.useMemo(()=>wy(t,s,g,d,r,"data"),[t,s,g,d,r]),x=b.useMemo(()=>wy(t,s,g,d,r,"assets"),[t,s,g,d,r]),y=b.useMemo(()=>{if(t===r.pathname+r.search+r.hash)return[];let j=new Set,N=!1;if(s.forEach(C=>{var O;let A=d.routes[C.route.id];!A||!A.hasLoader||(!v.some(E=>E.route.id===C.route.id)&&C.route.id in m&&((O=u[C.route.id])!=null&&O.shouldRevalidate)||A.hasClientLoader?N=!0:j.add(C.route.id))}),j.size===0)return[];let T=Zw(t,p,c.unstable_trailingSlashAwareDataRequests,"data");return N&&j.size>0&&T.searchParams.set("_routes",s.filter(C=>j.has(C.route.id)).map(C=>C.route.id).join(",")),[T.pathname+T.search]},[p,c.unstable_trailingSlashAwareDataRequests,m,r,d,v,s,t,u]),k=b.useMemo(()=>Ww(x,d),[x,d]),S=aN(x);return b.createElement(b.Fragment,null,y.map(j=>b.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...o})),k.map(j=>b.createElement("link",{key:j,rel:"modulepreload",href:j,...o})),S.map(({key:j,link:N})=>b.createElement("link",{key:j,nonce:o.nonce,...N,crossOrigin:N.crossOrigin??o.crossOrigin})))}function oN(...t){return s=>{t.forEach(o=>{typeof o=="function"?o(s):o!=null&&(o.current=s)})}}var rN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{rN&&(window.__reactRouterVersion="7.13.2")}catch{}function lN({basename:t,children:s,unstable_useTransitions:o,window:r}){let c=b.useRef();c.current==null&&(c.current=Pj({window:r,v5Compat:!0}));let d=c.current,[u,p]=b.useState({action:d.action,location:d.location}),m=b.useCallback(g=>{o===!1?p(g):b.startTransition(()=>p(g))},[o]);return b.useLayoutEffect(()=>d.listen(m),[d,m]),b.createElement(Bw,{basename:t,children:s,location:u.location,navigationType:u.action,navigator:d,unstable_useTransitions:o})}var Gx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,jm=b.forwardRef(function({onClick:s,discover:o="render",prefetch:r="none",relative:c,reloadDocument:d,replace:u,unstable_mask:p,state:m,target:g,to:v,preventScrollReset:x,viewTransition:y,unstable_defaultShouldRevalidate:k,...S},j){let{basename:N,navigator:T,unstable_useTransitions:C}=b.useContext(Ln),A=typeof v=="string"&&Gx.test(v),O=Ix(v,N);v=O.to;let E=bw(v,{relative:c}),D=Yt(),P=null;if(p){let oe=wd(p,[],D.unstable_mask?D.unstable_mask.pathname:"/",!0);N!=="/"&&(oe.pathname=oe.pathname==="/"?N:Cs([N,oe.pathname])),P=T.createHref(oe)}let[B,z,J]=nN(r,S),V=fN(v,{replace:u,unstable_mask:p,state:m,target:g,preventScrollReset:x,relative:c,viewTransition:y,unstable_defaultShouldRevalidate:k,unstable_useTransitions:C});function K(oe){s&&s(oe),oe.defaultPrevented||V(oe)}let fe=!(O.isExternal||d),ee=b.createElement("a",{...S,...J,href:(fe?P:void 0)||O.absoluteURL||E,onClick:fe?K:s,ref:oN(j,z),target:g,"data-discover":!A&&o==="render"?"true":void 0});return B&&!A?b.createElement(b.Fragment,null,ee,b.createElement(sN,{page:E})):ee});jm.displayName="Link";var cN=b.forwardRef(function({"aria-current":s="page",caseSensitive:o=!1,className:r="",end:c=!1,style:d,to:u,viewTransition:p,children:m,...g},v){let x=ml(u,{relative:g.relative}),y=Yt(),k=b.useContext(Nd),{navigator:S,basename:j}=b.useContext(Ln),N=k!=null&&vN(x)&&p===!0,T=S.encodeLocation?S.encodeLocation(x).pathname:x.pathname,C=y.pathname,A=k&&k.navigation&&k.navigation.location?k.navigation.location.pathname:null;o||(C=C.toLowerCase(),A=A?A.toLowerCase():null,T=T.toLowerCase()),A&&j&&(A=aa(A,j)||A);const O=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let E=C===T||!c&&C.startsWith(T)&&C.charAt(O)==="/",D=A!=null&&(A===T||!c&&A.startsWith(T)&&A.charAt(T.length)==="/"),P={isActive:E,isPending:D,isTransitioning:N},B=E?s:void 0,z;typeof r=="function"?z=r(P):z=[r,E?"active":null,D?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let J=typeof d=="function"?d(P):d;return b.createElement(jm,{...g,"aria-current":B,className:z,ref:v,style:J,to:u,viewTransition:p},typeof m=="function"?m(P):m)});cN.displayName="NavLink";var dN=b.forwardRef(({discover:t="render",fetcherKey:s,navigate:o,reloadDocument:r,replace:c,state:d,method:u=Qc,action:p,onSubmit:m,relative:g,preventScrollReset:v,viewTransition:x,unstable_defaultShouldRevalidate:y,...k},S)=>{let{unstable_useTransitions:j}=b.useContext(Ln),N=hN(),T=gN(p,{relative:g}),C=u.toLowerCase()==="get"?"get":"post",A=typeof p=="string"&&Gx.test(p),O=E=>{if(m&&m(E),E.defaultPrevented)return;E.preventDefault();let D=E.nativeEvent.submitter,P=(D==null?void 0:D.getAttribute("formmethod"))||u,B=()=>N(D||E.currentTarget,{fetcherKey:s,method:P,navigate:o,replace:c,state:d,relative:g,preventScrollReset:v,viewTransition:x,unstable_defaultShouldRevalidate:y});j&&o!==!1?b.startTransition(()=>B()):B()};return b.createElement("form",{ref:S,method:C,action:T,onSubmit:r?m:O,...k,"data-discover":!A&&t==="render"?"true":void 0})});dN.displayName="Form";function uN(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Fx(t){let s=b.useContext(Uo);return _t(s,uN(t)),s}function fN(t,{target:s,replace:o,unstable_mask:r,state:c,preventScrollReset:d,relative:u,viewTransition:p,unstable_defaultShouldRevalidate:m,unstable_useTransitions:g}={}){let v=Cd(),x=Yt(),y=ml(t,{relative:u});return b.useCallback(k=>{if(Hw(k,s)){k.preventDefault();let S=o!==void 0?o:sl(x)===sl(y),j=()=>v(t,{replace:S,unstable_mask:r,state:c,preventScrollReset:d,relative:u,viewTransition:p,unstable_defaultShouldRevalidate:m});g?b.startTransition(()=>j()):j()}},[x,v,y,o,r,c,s,t,d,u,p,m,g])}function wm(t){ns(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 s=b.useRef(Vp(t)),o=b.useRef(!1),r=Yt(),c=b.useMemo(()=>Vw(r.search,o.current?null:s.current),[r.search]),d=Cd(),u=b.useCallback((p,m)=>{const g=Vp(typeof p=="function"?p(new URLSearchParams(c)):p);o.current=!0,d("?"+g,m)},[d,c]);return[c,u]}var pN=0,mN=()=>`__${String(++pN)}__`;function hN(){let{router:t}=Fx("useSubmit"),{basename:s}=b.useContext(Ln),o=Mw(),r=t.fetch,c=t.navigate;return b.useCallback(async(d,u={})=>{let{action:p,method:m,encType:g,formData:v,body:x}=Fw(d,s);if(u.navigate===!1){let y=u.fetcherKey||mN();await r(y,o,u.action||p,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:v,body:x,formMethod:u.method||m,formEncType:u.encType||g,flushSync:u.flushSync})}else await c(u.action||p,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:v,body:x,formMethod:u.method||m,formEncType:u.encType||g,replace:u.replace,state:u.state,fromRouteId:o,flushSync:u.flushSync,viewTransition:u.viewTransition})},[r,c,s,o])}function gN(t,{relative:s}={}){let{basename:o}=b.useContext(Ln),r=b.useContext(ss);_t(r,"useFormAction must be used inside a RouteContext");let[c]=r.matches.slice(-1),d={...ml(t||".",{relative:s})},u=Yt();if(t==null){d.search=u.search;let p=new URLSearchParams(d.search),m=p.getAll("index");if(m.some(v=>v==="")){p.delete("index"),m.filter(x=>x).forEach(x=>p.append("index",x));let v=p.toString();d.search=v?`?${v}`:""}}return(!t||t===".")&&c.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),o!=="/"&&(d.pathname=d.pathname==="/"?o:Cs([o,d.pathname])),sl(d)}function vN(t,{relative:s}={}){let o=b.useContext(Bx);_t(o!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Fx("useViewTransitionState"),c=ml(t,{relative:s});if(!o.isTransitioning)return!1;let d=aa(o.currentLocation.pathname,r)||o.currentLocation.pathname,u=aa(o.nextLocation.pathname,r)||o.nextLocation.pathname;return al(c.pathname,u)!=null||al(c.pathname,d)!=null}function mt(){const t=Cd();return b.useCallback((s,o)=>{typeof s=="number"?t(s):t(s,o)},[t])}function Nm(t){return`/sessions/${encodeURIComponent(t)}`}function Ei(t,s){return s?`/environments/${encodeURIComponent(s)}/workspaces/${encodeURIComponent(t)}`:`/workspaces/${encodeURIComponent(t)}`}function On(t,s,o,r){const c=encodeURIComponent(t);let d;return o&&r?d=`/environments/${encodeURIComponent(r)}/workspaces/${encodeURIComponent(o)}/tasks/${c}`:o?d=`/workspaces/${encodeURIComponent(o)}/tasks/${c}`:d=`/tasks/${c}`,s?`${d}/${s}`:d}function Ii(t,s,o){const r=new URLSearchParams;t&&r.set("workspace",t),s&&r.set("parent",s);const c=r.toString();if(t&&o){const d=`/environments/${encodeURIComponent(o)}/workspaces/${encodeURIComponent(t)}/tasks/new`;return s?`${d}?parent=${encodeURIComponent(s)}`:d}return c?`/tasks/new?${c}`:"/tasks/new"}function Zx(t){return`/sessions/new?${new URLSearchParams({env:t}).toString()}`}const Ro="/environments",yN="/environments/new";function Ai(t){return`/environments/${encodeURIComponent(t)}`}function bN(t){return`/environments/${encodeURIComponent(t)}/edit`}const wi="/settings",xN="/settings/credentials",Qf="/settings/personas",_N="/settings/personas/new";function Kx(t){return`/settings/personas/${encodeURIComponent(t)}`}const ep="/settings/schedules",kN="/settings/schedules/new";function Yx(t){return`/settings/schedules/${encodeURIComponent(t)}`}const SN="/settings/shortcuts",TN="/pair",jN="/chat",Di="/",wN="/tasks",Jx="/workspaces/new",Wx="/knowledge",Ad="/findings";function NN(t,s){return t&&s?`/environments/${encodeURIComponent(s)}/workspaces/${encodeURIComponent(t)}/findings`:Ad}function qp(t,s,o){const r=encodeURIComponent(t);return s&&o?`/environments/${encodeURIComponent(o)}/workspaces/${encodeURIComponent(s)}/findings/${r}`:`/findings/${r}`}const CN=Tj,EN={task:$j};function AN({workspaceId:t,environmentId:s,tasks:o,resolvedThemeId:r}){const c=mt(),d=b.useMemo(()=>o.filter(x=>x.workspaceId===t),[o,t]),{nodes:u,edges:p}=c2(d),m=b.useMemo(()=>{const x=getComputedStyle(document.documentElement),y={};for(const[k,S]of Object.entries(CN))y[k]=x.getPropertyValue(S).trim()||"#6b7a8d";return y},[r]),g=b.useCallback((x,y)=>{c(On(y.id,void 0,t,s))},[c,t,s]),v=b.useCallback(x=>{const y=x.data;return m[y.task.status]||m.pending},[m]);return d.length===0?i.jsxs("div",{className:bn.emptyCta,children:[i.jsx("button",{className:bn.ctaButton,onClick:()=>c(Ii(t,void 0,s)),children:"Create Task"}),i.jsx("div",{className:bn.ctaDescription,children:"Create tasks to see the dependency graph"})]}):i.jsx("div",{className:bn.dagContainer,children:i.jsxs(yT,{nodes:u,edges:p,nodeTypes:EN,onNodeClick:g,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,children:[i.jsx(bT,{variant:xT.Dots,gap:24,size:1,color:"var(--text-disabled)"}),i.jsx(_T,{showInteractive:!1}),i.jsx(kT,{nodeColor:v,maskColor:"var(--bg-overlay)",style:{background:"var(--bg-inset)"}})]})})}const DN="_breadcrumbs_17or2_1",MN="_list_17or2_11",RN="_item_17or2_21",IN="_separator_17or2_28",ON="_link_17or2_34",BN="_current_17or2_57",jo={breadcrumbs:DN,list:MN,item:RN,separator:IN,link:ON,current:BN};function vs({segments:t}){return i.jsx("nav",{className:jo.breadcrumbs,"aria-label":"Breadcrumb","data-testid":"breadcrumbs",children:i.jsx("ol",{className:jo.list,children:t.map((s,o)=>{const r=o===t.length-1;return i.jsxs("li",{className:jo.item,children:[o>0&&i.jsx("span",{className:jo.separator,"aria-hidden":"true",children:i.jsx(la,{size:dt})}),s.url&&!r?i.jsx(jm,{className:jo.link,to:s.url,title:s.label,children:s.label}):i.jsx("span",{className:jo.current,"aria-current":"page",title:s.label,children:s.label})]},o)})})})}const LN="_btn_dwk2o_1",zN="_sm_dwk2o_22",$N="_md_dwk2o_28",PN="_lg_dwk2o_34",UN="_primary_dwk2o_40",HN="_danger_dwk2o_55",VN="_outline_dwk2o_70",qN="_ghost_dwk2o_80",tp={btn:LN,sm:zN,md:$N,lg:PN,primary:UN,danger:HN,outline:VN,ghost:qN},tn=b.forwardRef(function({variant:s="primary",size:o="md",className:r,children:c,...d},u){const p=[tp.btn,tp[s],tp[o],r].filter(Boolean).join(" ");return i.jsx("button",{ref:u,className:p,...d,children:c})}),GN="_copyButton_1bqk0_1",FN={copyButton:GN},ZN=2e3;function KN({text:t,className:s,"data-testid":o}){const[r,c]=b.useState(!1),d=b.useRef(void 0);b.useEffect(()=>()=>{d.current!==void 0&&clearTimeout(d.current)},[]);const u=b.useCallback(async()=>{try{await navigator.clipboard.writeText(t),c(!0),d.current!==void 0&&clearTimeout(d.current),d.current=setTimeout(()=>{c(!1),d.current=void 0},ZN)}catch{}},[t]);return i.jsx("button",{type:"button",className:`${FN.copyButton} ${s??""}`,onClick:()=>{u().catch(()=>{})},"aria-label":r?"Copied":"Copy to clipboard","data-testid":o??"copy-button",children:r?i.jsx(Mi,{size:nn,"aria-hidden":"true"}):i.jsx(Nx,{size:nn,"aria-hidden":"true"})})}const YN="_banner_bxqlh_1",JN="_label_bxqlh_15",WN="_text_bxqlh_25",XN="_link_bxqlh_29",$c={banner:YN,label:JN,text:WN,link:XN};function QN(){return i.jsxs("div",{className:$c.banner,"data-testid":"demo-banner",children:[i.jsx("span",{className:$c.label,children:"DEMO"}),i.jsxs("span",{className:$c.text,children:["This is an interactive demo with mock data."," ",i.jsx("a",{href:"https://github.com/nick-pape/grackle",target:"_blank",rel:"noopener noreferrer",className:$c.link,children:"Install Grackle"})," ","to use it for real."]})]})}const eC="_container_og0yp_1",tC="_chevronButton_og0yp_6",nC="_mainButton_og0yp_6",sC="_sm_og0yp_34",aC="_md_og0yp_34",iC="_lg_og0yp_34",oC="_primary_og0yp_57",rC="_danger_og0yp_70",lC="_outline_og0yp_83",cC="_ghost_og0yp_92",dC="_dropdown_og0yp_100",uC="_option_og0yp_113",fC="_optionLabel_og0yp_130",pC="_optionDesc_og0yp_135",Ws={container:eC,chevronButton:tC,mainButton:nC,sm:sC,md:aC,lg:iC,primary:oC,danger:rC,outline:lC,ghost:cC,dropdown:dC,option:uC,optionLabel:fC,optionDesc:pC};function Xx({label:t,onClick:s,options:o,variant:r="primary",size:c="md","data-testid":d}){const[u,p]=b.useState(!1),m=b.useRef(null);b.useEffect(()=>{if(!u)return;function y(k){m.current&&k.target instanceof Node&&!m.current.contains(k.target)&&p(!1)}return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[u]),b.useEffect(()=>{if(!u)return;function y(k){k.key==="Escape"&&p(!1)}return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[u]);const g=Ws[r]||"",v=Ws[c]||"",x=()=>{u&&p(!1),s()};return i.jsxs("div",{ref:m,className:Ws.container,"data-testid":d,children:[i.jsx("button",{type:"button",className:`${Ws.mainButton} ${g} ${v}`,onClick:x,"data-testid":d?`${d}-main`:void 0,children:t}),i.jsx("button",{type:"button",className:`${Ws.chevronButton} ${g} ${v}`,onClick:()=>p(y=>!y),"aria-label":`More options for ${t}`,"aria-haspopup":"menu","aria-expanded":u,"data-testid":d?`${d}-chevron`:void 0,children:i.jsx(wx,{size:nn,"aria-hidden":"true"})}),u&&i.jsx("div",{className:Ws.dropdown,"data-testid":d?`${d}-menu`:void 0,children:o.map((y,k)=>i.jsxs("button",{type:"button",className:Ws.option,onClick:()=>{y.onClick(),p(!1)},children:[i.jsx("span",{className:Ws.optionLabel,children:y.label}),y.description&&i.jsx("span",{className:Ws.optionDesc,children:y.description})]},k))})]})}function Gp(){Gp=function(c,d){return new o(c,void 0,d)};var t=RegExp.prototype,s=new WeakMap;function o(c,d,u){var p=new RegExp(c,d);return s.set(p,u||s.get(c)),ld(p,o.prototype)}function r(c,d){var u=s.get(d);return Object.keys(u).reduce(function(p,m){var g=u[m];if(typeof g=="number")p[m]=c[g];else{for(var v=0;c[g[v]]===void 0&&v+1<g.length;)v++;p[m]=c[g[v]]}return p},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&&ld(c,d)})(o,RegExp),o.prototype.exec=function(c){var d=t.exec.call(this,c);if(d){d.groups=r(d,this);var u=d.indices;u&&(u.groups=r(u,this))}return d},o.prototype[Symbol.replace]=function(c,d){if(typeof d=="string"){var u=s.get(this);return t[Symbol.replace].call(this,c,d.replace(/\$<([^>]+)>/g,function(m,g){var v=u[g];return"$"+(Array.isArray(v)?v.join("$"):v)}))}if(typeof d=="function"){var p=this;return t[Symbol.replace].call(this,c,function(){var m=arguments;return typeof m[m.length-1]!="object"&&(m=[].slice.call(m)).push(r(m,p)),d.apply(this,m)})}return t[Symbol.replace].call(this,c,d)},Gp.apply(this,arguments)}function ld(t,s){return ld=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},ld(t,s)}function Ny(t,s){(s==null||s>t.length)&&(s=t.length);for(var o=0,r=new Array(s);o<s;o++)r[o]=t[o];return r}function np(t,s){var o=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(o)return(o=o.call(t)).next.bind(o);if(Array.isArray(t)||(o=(function(c,d){if(c){if(typeof c=="string")return Ny(c,d);var u=Object.prototype.toString.call(c).slice(8,-1);return u==="Object"&&c.constructor&&(u=c.constructor.name),u==="Map"||u==="Set"?Array.from(c):u==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u)?Ny(c,d):void 0}})(t))||s){o&&(t=o);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
238
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var mC=(function(t){return function(s){return s===void 0&&(s={}),(function(r,c){if(c&&!r.registered(c))throw new Error('The default language "'+c+'" is not registered with refractor.')})(t,s.defaultLanguage),function(r){LT(r,"element",o)};function o(r,c,d){var u,p;if(d&&d.tagName==="pre"&&r.tagName==="code"){var m=(r==null||(u=r.data)==null?void 0:u.meta)||(r==null||(p=r.properties)==null?void 0:p.metastring)||"";r.properties.className?typeof r.properties.className=="boolean"?r.properties.className=[]:Array.isArray(r.properties.className)||(r.properties.className=[r.properties.className]):r.properties.className=[];var g,v,x=(function(E){for(var D,P=np(E.properties.className);!(D=P()).done;){var B=D.value;if(B.slice(0,9)==="language-")return B.slice(9).toLowerCase()}return null})(r);if(!x&&s.defaultLanguage&&r.properties.className.push("language-"+(x=s.defaultLanguage)),r.properties.className.push("code-highlight"),x)try{var y,k;k=(y=x)!=null&&y.includes("diff-")?x.split("-")[1]:x,g=t.highlight(Oc(r),k),d.properties.className=(d.properties.className||[]).concat("language-"+k)}catch(E){if(!s.ignoreMissing||!/Unknown language/.test(E.message))throw E;g=r}else g=r;g.children=(v=1,function E(D){return D.reduce(function(P,B){if(B.type==="text"){var z=B.value,J=(z.match(/\n/g)||"").length;if(J===0)B.position={start:{line:v,column:1},end:{line:v,column:1}},P.push(B);else for(var V,K=z.split(`
|
|
239
|
-
`),fe=np(K.entries());!(V=fe()).done;){var ee=V.value,oe=ee[0],M=ee[1];P.push({type:"text",value:oe===K.length-1?M:M+`
|
|
240
|
-
`,position:{start:{line:v+oe,column:1},end:{line:v+oe,column:1}}})}return v+=J,P}if(Object.prototype.hasOwnProperty.call(B,"children")){var H=v;return B.children=E(B.children),P.push(B),B.position={start:{line:H,column:1},end:{line:v,column:1}},P}return P.push(B),P},[])})(g.children),g.position=g.children.length>0?{start:{line:g.children[0].position.start.line,column:0},end:{line:g.children[g.children.length-1].position.end.line,column:0}}:{start:{line:0,column:0},end:{line:0,column:0}};for(var S,j=(function(E){var D=/{([\d,-]+)}/,P=E.split(",").map(function(J){return J.trim()}).join();if(D.test(P)){var B=D.exec(P)[1],z=$T(B);return function(J){return z.includes(J+1)}}return function(){return!1}})(m),N=(function(E){var D=Gp(/showLineNumbers=(\d+)/i,{lines:1});if(D.test(E)){var P=D.exec(E);return Number(P.groups.lines)}return 1})(m),T=(function(E){for(var D=new Array(E),P=0;P<E;P++)D[P]={type:"element",tagName:"span",properties:{className:[]},children:[]};return D})(g.position.end.line),C=["showlinenumbers=false",'showlinenumbers="false"',"showlinenumbers={false}"],A=function(){var E,D,P=S.value,B=P[0],z=P[1];z.properties.className=["code-line"];var J=PT(g,function(V){return V.position.start.line<=B+1&&V.position.end.line>=B+1});z.children=J.children,(m.toLowerCase().includes("showLineNumbers".toLowerCase())||s.showLineNumbers===!0||typeof s.showLineNumbers=="object"&&s.showLineNumbers.includes(x))&&!C.some(function(V){return m.toLowerCase().includes(V)})&&(z.properties.line=[(B+N).toString()],z.properties.className.push("line-number")),j(B)&&z.properties.className.push("highlight-line"),(x==="diff"||(E=x)!=null&&E.includes("diff-"))&&Oc(z).substring(0,1)==="-"?z.properties.className.push("deleted"):(x==="diff"||(D=x)!=null&&D.includes("diff-"))&&Oc(z).substring(0,1)==="+"&&z.properties.className.push("inserted")},O=np(T.entries());!(S=O()).done;)A();T.length>0&&Oc(T[T.length-1]).trim()===""&&T.pop(),r.children=T}}}})(zT);function Io(t){if(t>=1e6)return`${(t/1e6).toFixed(1)}M`;if(t>=1e3){const s=Number((t/1e3).toFixed(1));return s>=1e3?`${(t/1e6).toFixed(1)}M`:`${s.toFixed(1)}k`}return String(t)}function Ns(t){if(t===0)return"-";const s=t/1e5;if(s<.01){const o=t<5?5:4;return`$${s.toFixed(o)}`}return`$${s.toFixed(2)}`}const Cy=new Set(["grackle"]);function Ho(t){if(t.startsWith("mcp__")){const o=t.indexOf("__",5);if(o>5){const r=t.slice(5,o);if(Cy.has(r))return t.slice(o+2)}}const s=t.indexOf("-");if(s>0){const o=t.slice(0,s);if(Cy.has(o))return t.slice(s+1)}return t}const hC={read:"file-read",view:"file-read",edit:"file-edit",file_change:"file-edit",write:"file-write",bash:"shell",powershell:"shell",command_execution:"shell",grep:"search",glob:"search",todowrite:"todo",update_plan:"todo",todo_write:"todo",report_intent:"metadata",finding_post:"finding",finding_list:"finding",task_list:"task",task_create:"task",task_show:"task",task_update:"task",task_start:"task",task_complete:"task",task_resume:"task",task_delete:"task",workpad_write:"workpad",workpad_read:"workpad",knowledge_search:"knowledge",knowledge_get_node:"knowledge",knowledge_create_node:"knowledge",ipc_spawn:"ipc",ipc_write:"ipc",ipc_close:"ipc",ipc_list_fds:"ipc",ipc_terminate:"ipc",ipc_create_stream:"ipc",ipc_attach:"ipc",ipc_share_stream:"ipc",ipc_list_streams:"ipc",toolsearch:"tool-search",agent:"agent",task:"agent",read_agent:"agent"};function gC(t){const s=Ho(t);return hC[s.toLowerCase()]??"generic"}const vC="_card_qkm9i_2",yC="_cardBlue_qkm9i_20",bC="_cardOrange_qkm9i_24",xC="_cardGreen_qkm9i_28",_C="_cardPurple_qkm9i_32",kC="_cardNeutral_qkm9i_36",SC="_cardRed_qkm9i_40",TC="_cardTeal_qkm9i_44",jC="_header_qkm9i_48",wC="_icon_qkm9i_55",NC="_toolName_qkm9i_64",CC="_fileName_qkm9i_71",EC="_badge_qkm9i_80",AC="_spacer_qkm9i_87",DC="_bodyToggle_qkm9i_91",MC="_chevron_qkm9i_109",RC="_chevronExpanded_qkm9i_115",IC="_pre_qkm9i_119",OC="_diffAdd_qkm9i_143",BC="_diffRemove_qkm9i_155",LC="_diffContext_qkm9i_167",zC="_diffHeader_qkm9i_176",$C="_diffLine_qkm9i_182",PC="_exitOk_qkm9i_188",UC="_exitError_qkm9i_194",HC="_exitPending_qkm9i_200",VC="_inProgress_qkm9i_228",qC="_metadata_qkm9i_232",GC="_metadataPrefix_qkm9i_239",I={card:vC,cardBlue:yC,cardOrange:bC,cardGreen:xC,cardPurple:_C,cardNeutral:kC,cardRed:SC,cardTeal:TC,header:jC,icon:wC,toolName:NC,fileName:CC,badge:EC,spacer:AC,bodyToggle:DC,chevron:MC,chevronExpanded:RC,pre:IC,diffAdd:OC,diffRemove:BC,diffContext:LC,diffHeader:zC,diffLine:$C,exitOk:PC,exitError:UC,exitPending:HC,inProgress:VC,metadata:qC,metadataPrefix:GC};function FC(t){if(t==null||typeof t!="object")return"";const s=t;return typeof s.file_path=="string"?s.file_path:typeof s.path=="string"?s.path:""}function ZC(t){const s=t.split(/[/\\]/);return s[s.length-1]||t}const sp=5;function Ey({tool:t,args:s,result:o,isError:r,writeVariant:c}){const[d,u]=b.useState(!1),p=FC(s),m=ZC(p),g=o===void 0,v=r?I.cardRed:c?I.cardGreen:I.cardBlue,x=c?"var(--accent-green)":"var(--accent-blue)",y=c?i.jsx(O2,{size:nn}):i.jsx(L2,{size:nn}),k=c?"tool-card-file-write":"tool-card-file-read",S=(o==null?void 0:o.split(`
|
|
241
|
-
`))??[],j=S.length>sp,N=d?S:S.slice(0,sp);return i.jsxs("div",{className:`${I.card} ${v} ${g?I.inProgress:""}`,"data-testid":k,children:[i.jsxs("div",{className:I.header,children:[i.jsx("span",{className:I.icon,children:y}),i.jsx("span",{className:I.toolName,style:{color:x},children:t}),m&&i.jsx("span",{className:I.fileName,title:p,children:m}),!g&&S.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:I.spacer}),i.jsxs("span",{className:I.badge,children:[S.length," lines"]})]})]}),r&&o&&i.jsx("pre",{className:I.pre,"data-testid":"tool-card-error",children:o}),!r&&!g&&S.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:I.pre,"data-testid":"tool-card-content",children:N.map((T,C)=>i.jsxs("span",{className:I.diffLine,children:[i.jsx("span",{style:{color:"var(--text-tertiary)",userSelect:"none",marginRight:"var(--space-sm)",display:"inline-block",width:"3ch",textAlign:"right"},children:C+1}),T]},C))}),j&&i.jsxs("button",{type:"button",className:I.bodyToggle,onClick:()=>{u(T=>!T)},"aria-expanded":d,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${I.chevron} ${d?I.chevronExpanded:""}`,"aria-hidden":"true",children:i.jsx(la,{size:dt})}),d?"collapse":`${S.length-sp} more lines`]})]})]})}function KC(t){const s=t.split(`
|
|
242
|
-
`),o=[];for(const r of s)r.startsWith("diff --git")||r.startsWith("index ")||(r.startsWith("--- ")||r.startsWith("+++ "))&&!r.startsWith("---- ")&&!r.startsWith("++++ ")||(r.startsWith("@@")?o.push({type:"header",content:r}):r.startsWith("+")?o.push({type:"add",content:r.slice(1)}):r.startsWith("-")?o.push({type:"remove",content:r.slice(1)}):r.startsWith(" ")?o.push({type:"context",content:r.slice(1)}):r===""&&o.push({type:"context",content:""}));return o}function YC(t,s){const o=t.split(`
|
|
243
|
-
`),r=s.split(`
|
|
244
|
-
`),c=[];for(const d of o)c.push({type:"remove",content:d});for(const d of r)c.push({type:"add",content:d});return c}function JC(t){let s=0,o=0;for(const r of t)r.type==="add"&&s++,r.type==="remove"&&o++;return{added:s,removed:o}}function WC(t){if(t==null||typeof t!="object")return"";const s=t;return typeof s.file_path=="string"&&s.file_path||typeof s.path=="string"&&s.path||""}function XC(t){if(t===void 0||typeof t!="object"||t===null)return;const s=t,o=(typeof s.old_string=="string"?s.old_string:void 0)??(typeof s.old_str=="string"?s.old_str:void 0),r=(typeof s.new_string=="string"?s.new_string:void 0)??(typeof s.new_str=="string"?s.new_str:void 0);if(o!==void 0&&r!==void 0)return{oldStr:o,newStr:r}}function QC(t){const s=t.split(/[/\\]/);return s[s.length-1]||t}function eE(t,s){if(s){let r=s;if(s.trimStart().startsWith("{"))try{const c=JSON.parse(s);typeof c.detailedContent=="string"&&(r=c.detailedContent)}catch{}if(r.includes("@@")||r.startsWith("diff ")){const c=KC(r);if(c.length>0)return c}}const o=XC(t);if(o)return YC(o.oldStr,o.newStr)}const ap=5;function tE({tool:t,args:s,result:o,isError:r,detailedResult:c}){const[d,u]=b.useState(!1),p=WC(s),m=QC(p),g=o===void 0,v=eE(s,c),x=v?JC(v):null,y=((v==null?void 0:v.length)??0)>ap,k=d?v:v==null?void 0:v.slice(0,ap);return i.jsxs("div",{className:`${I.card} ${r?I.cardRed:I.cardOrange} ${g?I.inProgress:""}`,"data-testid":"tool-card-file-edit",children:[i.jsxs("div",{className:I.header,children:[i.jsx("span",{className:I.icon,children:i.jsx(lj,{size:nn})}),i.jsx("span",{className:I.toolName,style:{color:"var(--accent-yellow)"},children:t}),m&&i.jsx("span",{className:I.fileName,title:p,children:m}),x&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:I.spacer}),i.jsxs("span",{className:I.badge,"data-testid":"tool-card-diff-stats",children:[i.jsxs("span",{style:{color:"var(--accent-green)"},children:["+",x.added]})," ",i.jsxs("span",{style:{color:"var(--accent-red)"},children:["−",x.removed]})]})]})]}),r&&o&&i.jsx("pre",{className:I.pre,"data-testid":"tool-card-error",children:o}),!r&&k&&k.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:I.pre,"data-testid":"tool-card-diff",children:k.map((S,j)=>{let N=I.diffContext;return S.type==="add"&&(N=I.diffAdd),S.type==="remove"&&(N=I.diffRemove),S.type==="header"&&(N=I.diffHeader),i.jsx("span",{className:`${I.diffLine} ${N}`,children:S.content},j)})}),y&&i.jsxs("button",{type:"button",className:I.bodyToggle,onClick:()=>{u(S=>!S)},"aria-expanded":d,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${I.chevron} ${d?I.chevronExpanded:""}`,"aria-hidden":"true",children:i.jsx(la,{size:dt})}),d?"collapse":`${((v==null?void 0:v.length)??0)-ap} more lines`]})]}),!r&&!v&&!g&&o&&i.jsx("pre",{className:I.pre,"data-testid":"tool-card-content",children:o})]})}const nE=/^\[exit (\d+)\]\s*/;function sE(t){const s=nE.exec(t);return s?{exitCode:Number(s[1]),output:t.slice(s[0].length)}:{exitCode:void 0,output:t}}function aE(t){if(t==null||typeof t!="object")return"";const s=t;return typeof s.command=="string"?s.command:""}function iE(t){const s=/pwsh(?:\.exe)?["']?\s+-Command\s+'([^']*)'\s*$/i.exec(t);if(s)return s[1];const o=/pwsh(?:\.exe)?["']?\s+-Command\s+"([^"]*)"\s*$/i.exec(t);return o?o[1]:t}const ip=3;function oE({tool:t,args:s,result:o,isError:r}){const[c,d]=b.useState(!1),u=aE(s),p=iE(u),m=o===void 0,g=o?sE(o):null,v=(g==null?void 0:g.output.split(`
|
|
245
|
-
`))??[],x=v.length>ip,y=c?v:v.slice(0,ip),k=g==null?void 0:g.exitCode,S=r||k!==void 0&&k!==0;return i.jsxs("div",{className:`${I.card} ${S?I.cardRed:I.cardNeutral}`,"data-testid":"tool-card-shell",children:[i.jsxs("div",{className:I.header,children:[i.jsx("span",{className:I.icon,style:{color:"var(--text-secondary)",fontFamily:"var(--font-mono)",fontWeight:"bold"},children:"$"}),i.jsx("span",{className:I.fileName,style:{flex:1,color:"var(--text-primary)"},title:u!==p?u:void 0,"data-testid":"tool-card-command",children:p}),k!==void 0&&i.jsxs("span",{className:k===0?I.exitOk:I.exitError,"data-testid":"tool-card-exit-code",children:[k===0?i.jsx(Mi,{size:dt,"aria-hidden":"true"}):i.jsx(Za,{size:dt,"aria-hidden":"true"})," ","exit ",k]}),m&&i.jsx("span",{className:I.exitPending,"data-testid":"tool-card-pending",children:i.jsx(J2,{size:dt,"aria-hidden":"true"})})]}),!m&&g&&g.output.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:I.pre,"data-testid":"tool-card-output",children:y.join(`
|
|
246
|
-
`)}),x&&i.jsxs("button",{type:"button",className:I.bodyToggle,onClick:()=>{d(j=>!j)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${I.chevron} ${c?I.chevronExpanded:""}`,"aria-hidden":"true",children:i.jsx(la,{size:dt})}),c?"collapse":`${v.length-ip} more lines`]})]})]})}function rE(t){if(t==null||typeof t!="object")return{pattern:"",path:""};const s=t,o=typeof s.pattern=="string"?s.pattern:"",r=typeof s.path=="string"?s.path:"";return{pattern:o,path:r}}const op=5;function lE({tool:t,args:s,result:o,isError:r}){const[c,d]=b.useState(!1),{pattern:u,path:p}=rE(s),m=o===void 0,g=(o==null?void 0:o.split(`
|
|
247
|
-
`).filter(y=>y.length>0))??[],v=g.length>op,x=c?g:g.slice(0,op);return i.jsxs("div",{className:`${I.card} ${r?I.cardRed:I.cardPurple} ${m?I.inProgress:""}`,"data-testid":"tool-card-search",children:[i.jsxs("div",{className:I.header,children:[i.jsx("span",{className:I.icon,children:i.jsx(Cx,{size:nn})}),i.jsx("span",{className:I.toolName,style:{color:"var(--accent-purple, #a78bfa)"},children:t}),u&&i.jsxs("span",{className:I.fileName,"data-testid":"tool-card-pattern",children:['"',u,'"']}),p&&i.jsxs("span",{className:I.fileName,style:{flexShrink:1},"data-testid":"tool-card-search-path",children:["in ",p]}),!m&&!r&&g.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:I.spacer}),i.jsxs("span",{className:I.badge,"data-testid":"tool-card-match-count",children:[g.length," ",g.length===1?"match":"matches"]})]})]}),r&&o&&i.jsx("pre",{className:I.pre,"data-testid":"tool-card-error",children:o}),!r&&!m&&x.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:I.pre,"data-testid":"tool-card-results",children:x.join(`
|
|
248
|
-
`)}),v&&i.jsxs("button",{type:"button",className:I.bodyToggle,onClick:()=>{d(y=>!y)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${I.chevron} ${c?I.chevronExpanded:""}`,"aria-hidden":"true",children:i.jsx(la,{size:dt})}),c?"collapse":`${g.length-op} more matches`]})]})]})}const cE="_progressBar_14f5c_1",dE="_progressFill_14f5c_9",uE="_activeTask_14f5c_16",fE="_activeIcon_14f5c_27",pE="_todoPulse_14f5c_1",mE="_activeText_14f5c_34",hE="_checklist_14f5c_48",gE="_item_14f5c_55",vE="_itemIcon_14f5c_65",yE="_itemText_14f5c_73",bE="_pending_14f5c_78",xE="_in_progress_14f5c_85",_E="_completed_14f5c_97",kE="_emptyMessage_14f5c_108",cs={progressBar:cE,progressFill:dE,activeTask:uE,activeIcon:fE,todoPulse:pE,activeText:mE,checklist:hE,item:gE,itemIcon:vE,itemText:yE,pending:bE,in_progress:xE,completed:_E,emptyMessage:kE},SE=/^[-*]\s*\[([ xX~!/])\]\s*(.+)$/;function TE(t){if(t===void 0||typeof t!="object"||t===null)return[];const s=t;return Array.isArray(s.todos)?s.todos.filter(o=>typeof o=="object"&&o!==null&&typeof o.content=="string"&&typeof o.status=="string").map(o=>({content:o.content,activeForm:typeof o.activeForm=="string"?o.activeForm:void 0,status:Ay(o.status)})):Array.isArray(s.plan)?s.plan.filter(o=>typeof o=="object"&&o!==null&&typeof o.step=="string"&&typeof o.status=="string").map(o=>({content:o.step,status:Ay(o.status)})):typeof s.content=="string"?jE(s.content):[]}function Ay(t){switch(t.toLowerCase()){case"completed":case"done":case"complete":return"completed";case"in_progress":case"in-progress":case"working":case"active":return"in_progress";default:return"pending"}}function jE(t){const s=t.split(`
|
|
249
|
-
`),o=[];for(const r of s){const c=SE.exec(r.trim());if(c){const d=c[1],u=c[2].trim();let p="pending";d==="x"||d==="X"?p="completed":(d==="~"||d==="/"||d==="!")&&(p="in_progress"),o.push({content:u,status:p})}}return o}function wE(t){switch(t){case"completed":return i.jsx(Mi,{size:dt});case"in_progress":return i.jsx(Va,{size:dt,fill:"currentColor"});default:return i.jsx(Va,{size:dt})}}function NE({args:t}){const s=TE(t),o=s.filter(d=>d.status==="completed").length,r=s.find(d=>d.status==="in_progress"),c=s.length===0;return i.jsxs("div",{className:`${I.card} ${I.cardBlue}`,"data-testid":"tool-card-todo",children:[i.jsxs("div",{className:I.header,children:[i.jsx("span",{className:I.icon,children:i.jsx(F2,{size:nn})}),i.jsx("span",{className:I.toolName,style:{color:"var(--accent-blue)"},children:c?"Todos cleared":"Todos"}),!c&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:I.spacer}),i.jsxs("span",{className:I.badge,"data-testid":"tool-card-todo-progress",children:[o,"/",s.length]})]})]}),!c&&i.jsx("div",{className:cs.progressBar,"data-testid":"tool-card-todo-bar",children:i.jsx("div",{className:cs.progressFill,style:{width:`${o/s.length*100}%`}})}),r&&i.jsxs("div",{className:cs.activeTask,"data-testid":"tool-card-todo-active",children:[i.jsx("span",{className:cs.activeIcon,children:i.jsx(Va,{size:dt,fill:"currentColor"})}),i.jsx("span",{className:cs.activeText,children:r.activeForm||r.content})]}),!c&&i.jsx("div",{className:cs.checklist,"data-testid":"tool-card-todo-list",children:s.map((d,u)=>i.jsxs("div",{className:`${cs.item} ${cs[d.status]}`,"data-testid":"tool-card-todo-item",children:[i.jsx("span",{className:cs.itemIcon,children:wE(d.status)}),i.jsx("span",{className:cs.itemText,children:d.content})]},u))}),c&&i.jsx("div",{className:cs.emptyMessage,children:"All items completed and cleared."})]})}function CE(t,s){if(s==null||typeof s!="object")return"";const o=s;if(typeof o.intent=="string")return o.intent;for(const r of Object.values(o))if(typeof r=="string")return r;return t}function EE({tool:t,args:s}){const o=CE(t,s);return i.jsxs("div",{className:I.metadata,"data-testid":"tool-card-metadata",children:[i.jsx("span",{className:I.metadataPrefix,children:i.jsx(R2,{size:dt})}),o]})}function AE(t){if(t==null||typeof t!="object")return{};const s=t;return{title:typeof s.title=="string"?s.title:void 0,category:typeof s.category=="string"?s.category:void 0,tags:Array.isArray(s.tags)?s.tags:void 0}}function DE(t){if(!t)return{};try{const s=JSON.parse(t);if(Array.isArray(s))return{list:s.filter(o=>o!==null&&typeof o=="object")};if(typeof s=="object"&&s!==null)return{single:s}}catch{}return{}}const rp=5,lp=5;function ME({tool:t,args:s,result:o,isError:r}){const[c,d]=b.useState(!1),u=Ho(t),p=AE(s),m=o===void 0,{single:g,list:v}=DE(o),x=(g==null?void 0:g.title)??p.title,y=v?void 0:(g==null?void 0:g.category)??p.category,k=v?void 0:(g==null?void 0:g.tags)??p.tags;return i.jsxs("div",{className:`${I.card} ${r?I.cardRed:I.cardPurple} ${m?I.inProgress:""}`,"data-testid":"tool-card-finding",children:[i.jsxs("div",{className:I.header,children:[i.jsx("span",{className:I.icon,"aria-hidden":"true",children:"💡"}),i.jsx("span",{className:I.toolName,style:{color:"var(--accent-purple, #a78bfa)"},children:u}),x&&i.jsxs("span",{className:I.fileName,"data-testid":"tool-card-finding-title",children:['"',x,'"']}),y&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:I.spacer}),i.jsx("span",{className:I.badge,"data-testid":"tool-card-finding-category",children:y})]}),v&&!y&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:I.spacer}),i.jsxs("span",{className:I.badge,"data-testid":"tool-card-finding-count",children:[v.length," ",v.length===1?"finding":"findings"]})]})]}),k&&k.length>0&&i.jsx("div",{className:I.pre,style:{padding:"4px 8px",whiteSpace:"normal"},"data-testid":"tool-card-finding-tags",children:k.map((S,j)=>i.jsxs("span",{style:{display:"inline-block",marginRight:"6px",opacity:.7,fontSize:"0.85em"},children:["#",S]},j))}),m&&!x&&s!==null&&s!==void 0&&i.jsx("pre",{className:I.pre,"data-testid":"tool-card-args",children:JSON.stringify(s,null,2)}),r&&o&&i.jsx("pre",{className:I.pre,"data-testid":"tool-card-error",children:o}),!r&&(g==null?void 0:g.content)&&i.jsx(i.Fragment,{children:(()=>{const S=g.content.split(`
|
|
250
|
-
`),j=S.length>lp,N=c?g.content:S.slice(0,lp).join(`
|
|
251
|
-
`);return i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:I.pre,"data-testid":"tool-card-finding-content",children:N}),j&&i.jsxs("button",{type:"button",className:I.bodyToggle,onClick:()=>{d(T=>!T)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${I.chevron} ${c?I.chevronExpanded:""}`,children:"▸"}),c?"collapse":`${S.length-lp} more lines`]})]})})()}),!r&&v&&v.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:I.pre,"data-testid":"tool-card-finding-list",children:(c?v:v.slice(0,rp)).map((S,j)=>`${S.category?`[${S.category}] `:""}${S.title??S.id??`Finding ${j+1}`}`).join(`
|
|
252
|
-
`)}),v.length>rp&&i.jsxs("button",{type:"button",className:I.bodyToggle,onClick:()=>{d(S=>!S)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${I.chevron} ${c?I.chevronExpanded:""}`,children:"▸"}),c?"collapse":`${v.length-rp} more findings`]})]})]})}function RE(t){if(t==null||typeof t!="object")return{};const s=t;return{taskId:typeof s.taskId=="string"?s.taskId:void 0,title:typeof s.title=="string"?s.title:void 0,status:typeof s.status=="string"?s.status:void 0}}function IE(t){if(!t)return{};try{const s=JSON.parse(t);if(Array.isArray(s))return{list:s.filter(o=>o!==null&&typeof o=="object")};if(typeof s=="object"&&s!==null){const o=s;return typeof o.sessionId=="string"?{sessionId:o.sessionId,single:o}:{single:o}}}catch{}return{}}function Dy(t){switch(t){case"complete":case"completed":return"✓";case"working":case"in_progress":return"●";case"paused":return"⏸";case"failed":return"✗";default:return"○"}}function OE(t){switch(t){case"complete":case"completed":return"var(--accent-green, #4ade80)";case"working":case"in_progress":return"var(--accent-blue, #60a5fa)";case"failed":return"var(--accent-red, #f87171)";case"paused":return"var(--text-tertiary, #888)";default:return"var(--text-secondary, #aaa)"}}const cp=5;function BE({tool:t,args:s,result:o,isError:r}){const[c,d]=b.useState(!1),u=Ho(t),p=RE(s),m=o===void 0,{single:g,list:v,sessionId:x}=IE(o),y=(g==null?void 0:g.title)??p.title,k=(g==null?void 0:g.status)??p.status;return i.jsxs("div",{className:`${I.card} ${r?I.cardRed:I.cardBlue} ${m?I.inProgress:""}`,"data-testid":"tool-card-task",children:[i.jsxs("div",{className:I.header,children:[i.jsx("span",{className:I.icon,"aria-hidden":"true",children:"📋"}),i.jsx("span",{className:I.toolName,style:{color:"var(--accent-blue)"},children:u}),y&&i.jsxs("span",{className:I.fileName,"data-testid":"tool-card-task-title",children:['"',y,'"']}),!y&&p.taskId&&i.jsx("span",{className:I.fileName,"data-testid":"tool-card-task-id",children:p.taskId}),k&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:I.spacer}),i.jsxs("span",{className:I.badge,style:{color:OE(k)},"data-testid":"tool-card-task-status",children:[Dy(k)," ",k]})]}),v&&!k&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:I.spacer}),i.jsxs("span",{className:I.badge,"data-testid":"tool-card-task-count",children:[v.length," ",v.length===1?"task":"tasks"]})]})]}),m&&!y&&!p.taskId&&s!==null&&s!==void 0&&i.jsx("pre",{className:I.pre,"data-testid":"tool-card-args",children:JSON.stringify(s,null,2)}),r&&o&&i.jsx("pre",{className:I.pre,"data-testid":"tool-card-error",children:o}),!r&&x&&i.jsxs("div",{className:I.pre,style:{padding:"4px 8px",fontSize:"0.85em"},"data-testid":"tool-card-task-session",children:["session: ",x]}),!r&&g&&!v&&!x&&i.jsx("pre",{className:I.pre,"data-testid":"tool-card-task-detail",children:[g.id?`id: ${g.id}`:null,g.status?`status: ${g.status}`:null,g.branch?`branch: ${g.branch}`:null,g.latestSessionId?`session: ${g.latestSessionId}`:null].filter(Boolean).join(`
|
|
253
|
-
`)}),!r&&v&&v.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:I.pre,"data-testid":"tool-card-task-list",children:(c?v:v.slice(0,cp)).map(S=>{const j=Dy(S.status),N=S.title??S.id??"untitled";return`${j} ${N}`}).join(`
|
|
254
|
-
`)}),v.length>cp&&i.jsxs("button",{type:"button",className:I.bodyToggle,onClick:()=>{d(S=>!S)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${I.chevron} ${c?I.chevronExpanded:""}`,children:"▸"}),c?"collapse":`${v.length-cp} more tasks`]})]})]})}function LE(t){if(t==null||typeof t!="object")return{};const s=t;return{status:typeof s.status=="string"?s.status:void 0,summary:typeof s.summary=="string"?s.summary:void 0}}function zE(t){if(!t)return{};try{const s=JSON.parse(t);if(typeof s!="object"||s===null)return{};const o=s,r=typeof o.workpad=="object"&&o.workpad!==null?o.workpad:o;return{status:typeof r.status=="string"?r.status:void 0,summary:typeof r.summary=="string"?r.summary:void 0,extra:typeof r.extra=="object"&&r.extra!==null?r.extra:void 0}}catch{}return{}}function $E({tool:t,args:s,result:o,isError:r}){const[c,d]=b.useState(!1),u=Ho(t),p=LE(s),m=o===void 0,g=zE(o),v=g.status??p.status,x=g.summary??p.summary;return i.jsxs("div",{className:`${I.card} ${r?I.cardRed:I.cardGreen} ${m?I.inProgress:""}`,"data-testid":"tool-card-workpad",children:[i.jsxs("div",{className:I.header,children:[i.jsx("span",{className:I.icon,"aria-hidden":"true",children:"📓"}),i.jsx("span",{className:I.toolName,style:{color:"var(--accent-green, #4ade80)"},children:u}),v&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:I.spacer}),i.jsx("span",{className:I.badge,"data-testid":"tool-card-workpad-status",children:v})]})]}),x&&i.jsx("pre",{className:I.pre,style:{whiteSpace:"pre-wrap"},"data-testid":"tool-card-workpad-summary",children:x}),m&&!x&&s!==null&&s!==void 0&&i.jsx("pre",{className:I.pre,"data-testid":"tool-card-args",children:JSON.stringify(s,null,2)}),r&&o&&i.jsx("pre",{className:I.pre,"data-testid":"tool-card-error",children:o}),!r&&!m&&o&&!x&&!v&&!g.extra&&i.jsx("pre",{className:I.pre,"data-testid":"tool-card-result",children:o}),!r&&g.extra&&i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:I.bodyToggle,onClick:()=>{d(y=>!y)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${I.chevron} ${c?I.chevronExpanded:""}`,children:"▸"}),c?"collapse":"extra data"]}),c&&i.jsx("pre",{className:I.pre,"data-testid":"tool-card-workpad-extra",children:JSON.stringify(g.extra,null,2)})]})]})}function PE(t){if(t==null||typeof t!="object")return{};const s=t;return{query:typeof s.query=="string"?s.query:void 0,id:typeof s.id=="string"?s.id:void 0}}function UE(t){if(!t)return{};try{const s=JSON.parse(t);if(typeof s!="object"||s===null)return{};const o=s;if(Array.isArray(o.results))return{results:o.results.filter(r=>r!==null&&typeof r=="object")};if(typeof o.node=="object"&&o.node!==null){const r=Array.isArray(o.edges)?o.edges.length:0;return{node:o.node,edgeCount:r}}if(typeof o.id=="string")return{node:o}}catch{}return{}}const dp=5;function HE({tool:t,args:s,result:o,isError:r}){const[c,d]=b.useState(!1),u=Ho(t),p=PE(s),m=o===void 0,g=UE(o);return i.jsxs("div",{className:`${I.card} ${r?I.cardRed:I.cardPurple} ${m?I.inProgress:""}`,"data-testid":"tool-card-knowledge",children:[i.jsxs("div",{className:I.header,children:[i.jsx("span",{className:I.icon,"aria-hidden":"true",children:"🧠"}),i.jsx("span",{className:I.toolName,style:{color:"var(--accent-purple, #a78bfa)"},children:u}),p.query&&i.jsxs("span",{className:I.fileName,"data-testid":"tool-card-knowledge-query",children:['"',p.query,'"']}),p.id&&!p.query&&i.jsx("span",{className:I.fileName,"data-testid":"tool-card-knowledge-id",children:p.id}),g.results&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:I.spacer}),i.jsxs("span",{className:I.badge,"data-testid":"tool-card-knowledge-count",children:[g.results.length," ",g.results.length===1?"result":"results"]})]}),g.node&&g.edgeCount!==void 0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:I.spacer}),i.jsxs("span",{className:I.badge,"data-testid":"tool-card-knowledge-edges",children:[g.edgeCount," ",g.edgeCount===1?"edge":"edges"]})]})]}),m&&s!==null&&s!==void 0&&!p.query&&!p.id&&i.jsx("pre",{className:I.pre,"data-testid":"tool-card-args",children:JSON.stringify(s,null,2)}),r&&o&&i.jsx("pre",{className:I.pre,"data-testid":"tool-card-error",children:o}),!r&&g.results&&g.results.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:I.pre,"data-testid":"tool-card-knowledge-results",children:(c?g.results:g.results.slice(0,dp)).map(v=>{var k,S,j;const x=((k=v.node)==null?void 0:k.title)??((S=v.node)==null?void 0:S.label)??((j=v.node)==null?void 0:j.id)??"node",y=v.score!==void 0?` (${(v.score*100).toFixed(0)}%)`:"";return`${x}${y}`}).join(`
|
|
255
|
-
`)}),g.results.length>dp&&i.jsxs("button",{type:"button",className:I.bodyToggle,onClick:()=>{d(v=>!v)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${I.chevron} ${c?I.chevronExpanded:""}`,children:"▸"}),c?"collapse":`${g.results.length-dp} more results`]})]}),!r&&g.node&&!g.results&&i.jsx("pre",{className:I.pre,"data-testid":"tool-card-knowledge-node",children:[g.node.id?`id: ${g.node.id}`:null,g.node.title?`title: ${g.node.title}`:null,g.node.category?`category: ${g.node.category}`:null,g.node.kind?`kind: ${g.node.kind}`:null,g.node.content?`content: ${g.node.content.length>100?g.node.content.slice(0,100)+"...":g.node.content}`:null].filter(Boolean).join(`
|
|
256
|
-
`)})]})}function VE(t){if(t==null||typeof t!="object")return{};const s=t;return{fd:typeof s.fd=="number"?s.fd:void 0,pipe:typeof s.pipe=="string"?s.pipe:void 0,prompt:typeof s.prompt=="string"?s.prompt:void 0,name:typeof s.name=="string"?s.name:void 0,message:typeof s.message=="string"?s.message:void 0}}function qE(t){if(!t)return{};try{const s=JSON.parse(t);if(typeof s!="object"||s===null)return{};const o=s;return{sessionId:typeof o.sessionId=="string"?o.sessionId:void 0,fd:typeof o.fd=="number"?o.fd:void 0,fds:Array.isArray(o.fds)?o.fds.filter(r=>r!==null&&typeof r=="object"):void 0,success:typeof o.success=="boolean"?o.success:void 0,output:typeof o.output=="string"?o.output:void 0}}catch{}return{}}function GE({tool:t,args:s,result:o,isError:r}){const[c,d]=b.useState(!1),u=Ho(t),p=VE(s),m=o===void 0,g=qE(o);let v="";p.pipe?v=`[${p.pipe}]`:p.fd!==void 0?v=`fd:${p.fd}`:p.name&&(v=`"${p.name}"`);const x=p.prompt?p.prompt.length>60?`${p.prompt.slice(0,60)}...`:p.prompt:void 0;return i.jsxs("div",{className:`${I.card} ${r?I.cardRed:I.cardOrange} ${m?I.inProgress:""}`,"data-testid":"tool-card-ipc",children:[i.jsxs("div",{className:I.header,children:[i.jsx("span",{className:I.icon,"aria-hidden":"true",children:"🔀"}),i.jsx("span",{className:I.toolName,style:{color:"var(--accent-yellow, #fbbf24)"},children:u}),v&&i.jsx("span",{className:I.fileName,"data-testid":"tool-card-ipc-info",children:v}),x&&i.jsx("span",{className:I.fileName,title:p.prompt,"data-testid":"tool-card-ipc-prompt",children:x}),g.fds&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:I.spacer}),i.jsxs("span",{className:I.badge,"data-testid":"tool-card-ipc-fd-count",children:[g.fds.length," ",g.fds.length===1?"fd":"fds"]})]}),g.success!==void 0&&!g.fds&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:I.spacer}),i.jsx("span",{className:I.badge,style:{color:g.success?"var(--accent-green, #4ade80)":"var(--accent-red, #f87171)"},"data-testid":"tool-card-ipc-success",children:g.success?"✓ ok":"✗ failed"})]})]}),m&&!x&&!v&&s!==null&&s!==void 0&&i.jsx("pre",{className:I.pre,"data-testid":"tool-card-args",children:JSON.stringify(s,null,2)}),r&&o&&i.jsx("pre",{className:I.pre,"data-testid":"tool-card-error",children:o}),!r&&g.sessionId&&i.jsxs("div",{className:I.pre,style:{padding:"4px 8px",fontSize:"0.85em"},"data-testid":"tool-card-ipc-session",children:["session: ",g.sessionId,g.fd!==void 0&&` | fd: ${g.fd}`]}),!r&&g.output&&i.jsx("pre",{className:I.pre,"data-testid":"tool-card-ipc-output",children:g.output}),!r&&g.fds&&g.fds.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:I.pre,"data-testid":"tool-card-ipc-fds",children:(c?g.fds:g.fds.slice(0,5)).map(y=>{const k=[`fd:${y.fd??"?"}`,y.permission??"",y.deliveryMode??""];return y.streamName&&k.push(y.streamName),y.owned&&k.push("(owned)"),k.filter(Boolean).join(" ")}).join(`
|
|
257
|
-
`)}),g.fds.length>5&&i.jsxs("button",{type:"button",className:I.bodyToggle,onClick:()=>{d(y=>!y)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${I.chevron} ${c?I.chevronExpanded:""}`,children:"▸"}),c?"collapse":`${g.fds.length-5} more fds`]})]})]})}function FE(t){if(t==null||typeof t!="object")return"";const s=t;return typeof s.query=="string"?s.query:""}const up=8;function ZE({args:t,result:s,isError:o}){const[r,c]=b.useState(!1),d=FE(t),u=s===void 0,p=(s==null?void 0:s.split(`
|
|
258
|
-
`))??[],m=p.length>up,g=r?s:p.slice(0,up).join(`
|
|
259
|
-
`);return i.jsxs("div",{className:`${I.card} ${o?I.cardRed:I.cardNeutral} ${u?I.inProgress:""}`,"data-testid":"tool-card-tool-search",children:[i.jsxs("div",{className:I.header,children:[i.jsx("span",{className:I.icon,"aria-hidden":"true",children:"🔧"}),i.jsx("span",{className:I.toolName,children:"ToolSearch"}),d&&i.jsxs("span",{className:I.fileName,"data-testid":"tool-card-tool-search-query",children:['"',d,'"']}),!u&&!o&&s&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:I.spacer}),i.jsxs("span",{className:I.badge,"data-testid":"tool-card-tool-search-count",children:[p.length," lines"]})]})]}),u&&!d&&t!==null&&t!==void 0&&i.jsx("pre",{className:I.pre,"data-testid":"tool-card-args",children:JSON.stringify(t,null,2)}),o&&s&&i.jsx("pre",{className:I.pre,"data-testid":"tool-card-error",children:s}),!o&&!u&&s&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:I.pre,"data-testid":"tool-card-tool-search-result",children:g}),m&&i.jsxs("button",{type:"button",className:I.bodyToggle,onClick:()=>{c(v=>!v)},"aria-expanded":r,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${I.chevron} ${r?I.chevronExpanded:""}`,children:"▸"}),r?"collapse":`${p.length-up} more lines`]})]})]})}function KE(t){const s=/^mcp__([^_]+(?:_[^_]+)*)__(.+)$/.exec(t);return s?{display:`${s[1]} / ${s[2]}`,isMcp:!0}:{display:t,isMcp:!1}}function YE(t){if(t==null)return"";if(typeof t!="object")return String(t);const s=t;if(typeof s.command=="string")return s.command;if(typeof s.file_path=="string")return s.file_path;if(typeof s.path=="string")return s.path;if(typeof s.query=="string")return s.query;if(typeof s.url=="string")return s.url;try{const o=JSON.stringify(t);return o.length>120?`${o.slice(0,120)}…`:o}catch{return""}}const fp=5;function JE({tool:t,args:s,result:o,isError:r}){const[c,d]=b.useState(!1),{display:u}=KE(t),p=YE(s),m=o===void 0,g=(o==null?void 0:o.split(`
|
|
260
|
-
`))??[],v=g.length>fp,x=c?o:g.slice(0,fp).join(`
|
|
261
|
-
`);let y="";if(s!=null)try{y=JSON.stringify(s,null,2)}catch{y=String(s)}return i.jsxs("div",{className:`${I.card} ${r?I.cardRed:I.cardBlue} ${m?I.inProgress:""}`,"data-testid":"tool-card-generic",children:[i.jsxs("div",{className:I.header,children:[i.jsx("span",{className:I.icon,children:i.jsx(E2,{size:nn,"aria-hidden":"true"})}),i.jsx("span",{className:I.toolName,style:{color:"var(--accent-blue)"},children:u}),p&&i.jsx("span",{className:I.fileName,children:p})]}),m&&y&&i.jsx("pre",{className:I.pre,"data-testid":"tool-card-args",children:y}),r&&o&&i.jsx("pre",{className:I.pre,"data-testid":"tool-card-error",children:o}),!r&&!m&&o&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:I.pre,"data-testid":"tool-card-result",children:x}),v&&i.jsxs("button",{type:"button",className:I.bodyToggle,onClick:()=>{d(k=>!k)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${I.chevron} ${c?I.chevronExpanded:""}`,"aria-hidden":"true",children:i.jsx(la,{size:dt})}),c?"collapse":`${g.length-fp} more lines`]})]})]})}const WE="_badgePill_o7eqc_1",XE="_modelBadge_o7eqc_14",QE="_backgroundBadge_o7eqc_26",eA="_backgroundDot_o7eqc_36",tA="_backgroundDotPulsing_o7eqc_41",nA="_description_o7eqc_55",sA="_statusLine_o7eqc_62",aA="_statusCompleted_o7eqc_72",iA="_statusRunning_o7eqc_77",oA="_statusError_o7eqc_83",rA="_promptToggle_o7eqc_88",ds={badgePill:WE,modelBadge:XE,backgroundBadge:QE,backgroundDot:eA,backgroundDotPulsing:tA,description:nA,statusLine:sA,statusCompleted:aA,statusRunning:iA,statusError:oA,promptToggle:rA};function lA(t,s){if(s==null||typeof s!="object")return{};const o=s;return t.toLowerCase()==="read_agent"?{agentId:typeof o.agent_id=="string"?o.agent_id:void 0,isPoll:!0}:typeof o.agent_type=="string"||typeof o.name=="string"?{agentType:typeof o.agent_type=="string"?o.agent_type:void 0,description:typeof o.description=="string"?o.description:void 0,prompt:typeof o.prompt=="string"?o.prompt:void 0,isBackground:o.mode==="background",agentName:typeof o.name=="string"?o.name:void 0}:{agentType:typeof o.subagent_type=="string"?o.subagent_type:void 0,description:typeof o.description=="string"?o.description:void 0,prompt:typeof o.prompt=="string"?o.prompt:void 0,isBackground:o.run_in_background===!0,model:typeof o.model=="string"?o.model:void 0,isResume:typeof o.resume=="string"&&o.resume.length>0}}const cA=/^Agent\s+(completed|running|failed|error)\.\s*agent_id:\s*(\S+),?\s*([^\n]*)(?:\n\n([\s\S]*))?$/i;function dA(t){const s=cA.exec(t);if(!s)return;const o=s[4];return{status:s[1].toLowerCase(),agentId:s[2].replace(/,$/,""),metadata:s[3].trim(),content:o?o.trim():void 0}}const pp=5;function uA({tool:t,args:s,result:o,isError:r}){const[c,d]=b.useState(!1),[u,p]=b.useState(!1),m=lA(t,s),g=o===void 0,v=m.isPoll&&o?dA(o):void 0,x=(v==null?void 0:v.content)??o,y=(x==null?void 0:x.split(`
|
|
262
|
-
`))??[],k=y.length>pp,S=c?x:y.slice(0,pp).join(`
|
|
263
|
-
`),j=m.isPoll?"Subagent":"Agent";return i.jsxs("div",{className:`${I.card} ${r?I.cardRed:I.cardTeal} ${g?I.inProgress:""}`,"data-testid":"tool-card-agent",children:[i.jsxs("div",{className:I.header,children:[i.jsx("span",{className:I.icon,style:{color:"var(--accent-teal, #2dd4bf)"},children:"▶"}),i.jsx("span",{className:I.toolName,style:{color:"var(--accent-teal, #2dd4bf)"},children:j}),m.agentType&&i.jsx("span",{className:ds.badgePill,"data-testid":"tool-card-agent-type",children:m.agentType}),m.model&&i.jsx("span",{className:ds.modelBadge,"data-testid":"tool-card-agent-model",children:m.model}),m.isBackground&&i.jsxs("span",{className:ds.backgroundBadge,"data-testid":"tool-card-agent-background",children:[i.jsx("span",{className:g?ds.backgroundDotPulsing:ds.backgroundDot,children:"●"}),"BG"]}),m.agentName&&i.jsx("span",{className:I.fileName,"data-testid":"tool-card-agent-name",children:m.agentName}),m.agentId&&i.jsx("span",{className:I.fileName,"data-testid":"tool-card-agent-id",children:m.agentId}),i.jsx("span",{className:I.spacer}),g&&!m.isBackground&&i.jsx("span",{className:I.exitPending,"data-testid":"tool-card-pending",children:"●"})]}),m.description&&i.jsx("div",{className:ds.description,"data-testid":"tool-card-agent-description",children:m.isResume?`Resuming: ${m.description}`:m.description}),v&&i.jsxs("div",{className:ds.statusLine,"data-testid":"tool-card-agent-status",children:[i.jsx("span",{className:v.status==="completed"?ds.statusCompleted:v.status==="running"?ds.statusRunning:ds.statusError,children:v.status}),v.metadata&&i.jsx("span",{children:v.metadata})]}),m.prompt&&i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:ds.promptToggle,onClick:()=>{p(N=>!N)},"aria-expanded":u,"data-testid":"tool-card-prompt-toggle",children:[i.jsx("span",{className:`${I.chevron} ${u?I.chevronExpanded:""}`,children:"▸"}),"prompt"]}),u&&i.jsx("pre",{className:I.pre,"data-testid":"tool-card-prompt",children:m.prompt})]}),r&&o&&i.jsx("pre",{className:I.pre,"data-testid":"tool-card-error",children:o}),!r&&!g&&x&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:I.pre,"data-testid":"tool-card-result",children:S}),k&&i.jsxs("button",{type:"button",className:I.bodyToggle,onClick:()=>{d(N=>!N)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${I.chevron} ${c?I.chevronExpanded:""}`,children:"▸"}),c?"collapse":`${y.length-pp} more lines`]})]})]})}function mp(t){switch(gC(t.tool)){case"file-read":return i.jsx(Ey,{...t});case"file-edit":return i.jsx(tE,{...t});case"file-write":return i.jsx(Ey,{...t,writeVariant:!0});case"shell":return i.jsx(oE,{...t});case"search":return i.jsx(lE,{...t});case"todo":return i.jsx(NE,{...t});case"metadata":return i.jsx(EE,{...t});case"finding":return i.jsx(ME,{...t});case"task":return i.jsx(BE,{...t});case"workpad":return i.jsx($E,{...t});case"knowledge":return i.jsx(HE,{...t});case"ipc":return i.jsx(GE,{...t});case"tool-search":return i.jsx(ZE,{...t});case"agent":return i.jsx(uA,{...t});default:return i.jsx(JE,{...t})}}const fA="_systemContextEvent_hmqlm_1",pA="_systemContextHeader_hmqlm_7",mA="_systemContextBadge_hmqlm_28",hA="_systemContextToggle_hmqlm_37",gA="_systemContextPre_hmqlm_43",vA="_systemContextEllipsis_hmqlm_54",yA="_systemEvent_hmqlm_58",bA="_systemTimestamp_hmqlm_65",xA="_textEvent_hmqlm_69",_A="_codeBlockWrapper_hmqlm_156",kA="_codeBlockCopyButton_hmqlm_159",SA="_errorEvent_hmqlm_163",TA="_statusEvent_hmqlm_171",jA="_userInputEvent_hmqlm_180",wA="_userInputContent_hmqlm_186",NA="_signalEvent_hmqlm_203",CA="_signalBadge_hmqlm_214",EA="_signalContent_hmqlm_223",AA="_usageEvent_hmqlm_228",DA="_usageBadge_hmqlm_235",MA="_defaultEvent_hmqlm_244",Pt={systemContextEvent:fA,systemContextHeader:pA,systemContextBadge:mA,systemContextToggle:hA,systemContextPre:gA,systemContextEllipsis:vA,systemEvent:yA,systemTimestamp:bA,textEvent:xA,codeBlockWrapper:_A,codeBlockCopyButton:kA,errorEvent:SA,statusEvent:TA,userInputEvent:jA,userInputContent:wA,signalEvent:NA,signalBadge:CA,signalContent:EA,usageEvent:AA,usageBadge:DA,defaultEvent:MA},My=3;function RA({content:t}){const[s,o]=b.useState(!1),r=t.split(`
|
|
264
|
-
`),c=r.length>My,d=s?t:r.slice(0,My).join(`
|
|
265
|
-
`);return i.jsxs("div",{className:Pt.systemContextEvent,"data-testid":"system-context-event",children:[i.jsxs("button",{type:"button",className:Pt.systemContextHeader,onClick:()=>{o(u=>!u)},"aria-expanded":s,children:[i.jsx("span",{className:Pt.systemContextBadge,children:"SYSTEM PROMPT"}),c&&i.jsx("span",{className:Pt.systemContextToggle,"aria-hidden":"true",children:s?i.jsx(wx,{size:dt}):i.jsx(la,{size:dt})})]}),i.jsxs("pre",{className:Pt.systemContextPre,children:[d,!s&&c&&i.jsx("span",{className:Pt.systemContextEllipsis,children:"…"})]})]})}function IA({time:t,content:s}){return i.jsxs("div",{className:Pt.systemEvent,children:[i.jsxs("span",{className:Pt.systemTimestamp,children:["[",t,"]"]})," ",s]})}function Fp(t){return typeof t=="string"?t:typeof t=="number"?String(t):Array.isArray(t)?t.map(Fp).join(""):t!=null&&typeof t=="object"&&"props"in t?Fp(t.props.children):""}function OA({children:t,node:s,...o}){const r=Fp(t);return i.jsxs("div",{className:Pt.codeBlockWrapper,children:[i.jsx("pre",{...o,children:t}),i.jsx(KN,{text:r,"data-testid":"copy-code-block",className:Pt.codeBlockCopyButton})]})}const BA={pre:OA};function LA({content:t}){return i.jsx("div",{className:Pt.textEvent,children:i.jsx(Sd,{remarkPlugins:[Td],rehypePlugins:[mC],components:BA,children:t})})}function zA({content:t}){return i.jsxs("div",{className:Pt.errorEvent,children:["Error: ",t]})}function $A({content:t}){return i.jsxs("div",{className:Pt.statusEvent,children:["--- ",t," ---"]})}function PA({content:t}){return i.jsx("div",{className:Pt.userInputEvent,children:i.jsx("span",{className:Pt.userInputContent,children:t})})}function UA({content:t}){return i.jsxs("div",{className:Pt.signalEvent,"data-testid":"signal-event",children:[i.jsx("span",{className:Pt.signalBadge,children:"SIGNAL"}),i.jsx("span",{className:Pt.signalContent,children:t})]})}function HA({content:t}){let s=t;try{const o=JSON.parse(t),r=Number(o.input_tokens)||0,c=Number(o.output_tokens)||0,d=Io(r+c),u=Ns(Number(o.cost_millicents)||0);s=`${d} tokens · ${u}`}catch{}return i.jsx("div",{className:Pt.usageEvent,"data-testid":"usage-event",children:i.jsx("span",{className:Pt.usageBadge,children:s})})}function VA({content:t}){return i.jsx("div",{className:Pt.defaultEvent,children:t})}function qA({event:t,toolUseCtx:s,settled:o}){const r=new Date(t.timestamp).toLocaleTimeString();switch(t.eventType){case"system":{if(t.raw)try{if(JSON.parse(t.raw).systemContext===!0)return i.jsx(RA,{content:t.content})}catch{}return i.jsx(IA,{time:r,content:t.content})}case"text":case"output":return i.jsx(LA,{content:t.content});case"tool_use":{let c="",d={};try{const u=JSON.parse(t.content);c=u.tool||"",d=u.args}catch{}return i.jsx(mp,{tool:c,args:d,result:o?"":void 0})}case"tool_result":{let c=!1;if(t.raw)try{c=JSON.parse(t.raw).is_error===!0}catch{}let d=t.content;if(t.content.trimStart().startsWith("{"))try{const u=JSON.parse(t.content);typeof u.content=="string"&&(d=u.content)}catch{}return s?i.jsx(mp,{tool:s.tool,args:s.args,result:d,isError:c,detailedResult:s.detailedResult}):i.jsx(mp,{tool:"Tool output",args:void 0,result:d,isError:c})}case"error":return i.jsx(zA,{content:t.content});case"status":return i.jsx($A,{content:t.content});case"user_input":return i.jsx(PA,{content:t.content});case"signal":return i.jsx(UA,{content:t.content});case"usage":return i.jsx(HA,{content:t.content});default:return i.jsx(VA,{content:t.content})}}const Cm=b.createContext({});function Em(t){const s=b.useRef(null);return s.current===null&&(s.current=t()),s.current}const Dd=b.createContext(null),Am=b.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class GA extends b.Component{getSnapshotBeforeUpdate(s){const o=this.props.childRef.current;if(o&&s.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=o.offsetHeight||0,r.width=o.offsetWidth||0,r.top=o.offsetTop,r.left=o.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function FA({children:t,isPresent:s}){const o=b.useId(),r=b.useRef(null),c=b.useRef({width:0,height:0,top:0,left:0}),{nonce:d}=b.useContext(Am);return b.useInsertionEffect(()=>{const{width:u,height:p,top:m,left:g}=c.current;if(s||!r.current||!u||!p)return;r.current.dataset.motionPopId=o;const v=document.createElement("style");return d&&(v.nonce=d),document.head.appendChild(v),v.sheet&&v.sheet.insertRule(`
|
|
266
|
-
[data-motion-pop-id="${o}"] {
|
|
267
|
-
position: absolute !important;
|
|
268
|
-
width: ${u}px !important;
|
|
269
|
-
height: ${p}px !important;
|
|
270
|
-
top: ${m}px !important;
|
|
271
|
-
left: ${g}px !important;
|
|
272
|
-
}
|
|
273
|
-
`),()=>{document.head.removeChild(v)}},[s]),i.jsx(GA,{isPresent:s,childRef:r,sizeRef:c,children:b.cloneElement(t,{ref:r})})}const ZA=({children:t,initial:s,isPresent:o,onExitComplete:r,custom:c,presenceAffectsLayout:d,mode:u})=>{const p=Em(KA),m=b.useId(),g=b.useCallback(x=>{p.set(x,!0);for(const y of p.values())if(!y)return;r&&r()},[p,r]),v=b.useMemo(()=>({id:m,initial:s,isPresent:o,custom:c,onExitComplete:g,register:x=>(p.set(x,!1),()=>p.delete(x))}),d?[Math.random(),g]:[o,g]);return b.useMemo(()=>{p.forEach((x,y)=>p.set(y,!1))},[o]),b.useEffect(()=>{!o&&!p.size&&r&&r()},[o]),u==="popLayout"&&(t=i.jsx(FA,{isPresent:o,children:t})),i.jsx(Dd.Provider,{value:v,children:t})};function KA(){return new Map}function Qx(t=!0){const s=b.useContext(Dd);if(s===null)return[!0,null];const{isPresent:o,onExitComplete:r,register:c}=s,d=b.useId();b.useEffect(()=>{t&&c(d)},[t]);const u=b.useCallback(()=>t&&r&&r(d),[d,r,t]);return!o&&r?[!1,u]:[!0]}const Pc=t=>t.key||"";function Ry(t){const s=[];return b.Children.forEach(t,o=>{b.isValidElement(o)&&s.push(o)}),s}const Dm=typeof window<"u",e_=Dm?b.useLayoutEffect:b.useEffect,gs=({children:t,custom:s,initial:o=!0,onExitComplete:r,presenceAffectsLayout:c=!0,mode:d="sync",propagate:u=!1})=>{const[p,m]=Qx(u),g=b.useMemo(()=>Ry(t),[t]),v=u&&!p?[]:g.map(Pc),x=b.useRef(!0),y=b.useRef(g),k=Em(()=>new Map),[S,j]=b.useState(g),[N,T]=b.useState(g);e_(()=>{x.current=!1,y.current=g;for(let O=0;O<N.length;O++){const E=Pc(N[O]);v.includes(E)?k.delete(E):k.get(E)!==!0&&k.set(E,!1)}},[N,v.length,v.join("-")]);const C=[];if(g!==S){let O=[...g];for(let E=0;E<N.length;E++){const D=N[E],P=Pc(D);v.includes(P)||(O.splice(E,0,D),C.push(D))}d==="wait"&&C.length&&(O=C),T(Ry(O)),j(g);return}const{forceRender:A}=b.useContext(Cm);return i.jsx(i.Fragment,{children:N.map(O=>{const E=Pc(O),D=u&&!p?!1:g===N||v.includes(E),P=()=>{if(k.has(E))k.set(E,!0);else return;let B=!0;k.forEach(z=>{z||(B=!1)}),B&&(A==null||A(),T(y.current),u&&(m==null||m()),r&&r())};return i.jsx(ZA,{isPresent:D,initial:!x.current||o?void 0:!1,custom:D?void 0:s,presenceAffectsLayout:c,mode:d,onExitComplete:D?void 0:P,children:O},E)})})},In=t=>t;let t_=In;const YA={useManualTiming:!1};function JA(t){let s=new Set,o=new Set,r=!1,c=!1;const d=new WeakSet;let u={delta:0,timestamp:0,isProcessing:!1};function p(g){d.has(g)&&(m.schedule(g),t()),g(u)}const m={schedule:(g,v=!1,x=!1)=>{const k=x&&r?s:o;return v&&d.add(g),k.has(g)||k.add(g),g},cancel:g=>{o.delete(g),d.delete(g)},process:g=>{if(u=g,r){c=!0;return}r=!0,[s,o]=[o,s],s.forEach(p),s.clear(),r=!1,c&&(c=!1,m.process(g))}};return m}const Uc=["read","resolveKeyframes","update","preRender","render","postRender"],WA=40;function n_(t,s){let o=!1,r=!0;const c={delta:0,timestamp:0,isProcessing:!1},d=()=>o=!0,u=Uc.reduce((T,C)=>(T[C]=JA(d),T),{}),{read:p,resolveKeyframes:m,update:g,preRender:v,render:x,postRender:y}=u,k=()=>{const T=performance.now();o=!1,c.delta=r?1e3/60:Math.max(Math.min(T-c.timestamp,WA),1),c.timestamp=T,c.isProcessing=!0,p.process(c),m.process(c),g.process(c),v.process(c),x.process(c),y.process(c),c.isProcessing=!1,o&&s&&(r=!1,t(k))},S=()=>{o=!0,r=!0,c.isProcessing||t(k)};return{schedule:Uc.reduce((T,C)=>{const A=u[C];return T[C]=(O,E=!1,D=!1)=>(o||S(),A.schedule(O,E,D)),T},{}),cancel:T=>{for(let C=0;C<Uc.length;C++)u[Uc[C]].cancel(T)},state:c,steps:u}}const{schedule:kt,cancel:Ga,state:cn,steps:hp}=n_(typeof requestAnimationFrame<"u"?requestAnimationFrame:In,!0),s_=b.createContext({strict:!1}),Iy={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"]},Oo={};for(const t in Iy)Oo[t]={isEnabled:s=>Iy[t].some(o=>!!s[o])};function XA(t){for(const s in t)Oo[s]={...Oo[s],...t[s]}}const QA=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 cd(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||QA.has(t)}let a_=t=>!cd(t);function eD(t){t&&(a_=s=>s.startsWith("on")?!cd(s):t(s))}try{eD(require("@emotion/is-prop-valid").default)}catch{}function tD(t,s,o){const r={};for(const c in t)c==="values"&&typeof t.values=="object"||(a_(c)||o===!0&&cd(c)||!s&&!cd(c)||t.draggable&&c.startsWith("onDrag"))&&(r[c]=t[c]);return r}function nD(t){if(typeof Proxy>"u")return t;const s=new Map,o=(...r)=>t(...r);return new Proxy(o,{get:(r,c)=>c==="create"?t:(s.has(c)||s.set(c,t(c)),s.get(c))})}const Md=b.createContext({});function il(t){return typeof t=="string"||Array.isArray(t)}function Rd(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const Mm=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Rm=["initial",...Mm];function Id(t){return Rd(t.animate)||Rm.some(s=>il(t[s]))}function i_(t){return!!(Id(t)||t.variants)}function sD(t,s){if(Id(t)){const{initial:o,animate:r}=t;return{initial:o===!1||il(o)?o:void 0,animate:il(r)?r:void 0}}return t.inherit!==!1?s:{}}function aD(t){const{initial:s,animate:o}=sD(t,b.useContext(Md));return b.useMemo(()=>({initial:s,animate:o}),[Oy(s),Oy(o)])}function Oy(t){return Array.isArray(t)?t.join(" "):t}const iD=Symbol.for("motionComponentSymbol");function Co(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function oD(t,s,o){return b.useCallback(r=>{r&&t.onMount&&t.onMount(r),s&&(r?s.mount(r):s.unmount()),o&&(typeof o=="function"?o(r):Co(o)&&(o.current=r))},[s])}const Im=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),rD="framerAppearId",o_="data-"+Im(rD),{schedule:Om}=n_(queueMicrotask,!1),r_=b.createContext({});function lD(t,s,o,r,c){var d,u;const{visualElement:p}=b.useContext(Md),m=b.useContext(s_),g=b.useContext(Dd),v=b.useContext(Am).reducedMotion,x=b.useRef(null);r=r||m.renderer,!x.current&&r&&(x.current=r(t,{visualState:s,parent:p,props:o,presenceContext:g,blockInitialAnimation:g?g.initial===!1:!1,reducedMotionConfig:v}));const y=x.current,k=b.useContext(r_);y&&!y.projection&&c&&(y.type==="html"||y.type==="svg")&&cD(x.current,o,c,k);const S=b.useRef(!1);b.useInsertionEffect(()=>{y&&S.current&&y.update(o,g)});const j=o[o_],N=b.useRef(!!j&&!(!((d=window.MotionHandoffIsComplete)===null||d===void 0)&&d.call(window,j))&&((u=window.MotionHasOptimisedAnimation)===null||u===void 0?void 0:u.call(window,j)));return e_(()=>{y&&(S.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),Om.render(y.render),N.current&&y.animationState&&y.animationState.animateChanges())}),b.useEffect(()=>{y&&(!N.current&&y.animationState&&y.animationState.animateChanges(),N.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)===null||T===void 0||T.call(window,j)}),N.current=!1))}),y}function cD(t,s,o,r){const{layoutId:c,layout:d,drag:u,dragConstraints:p,layoutScroll:m,layoutRoot:g}=s;t.projection=new o(t.latestValues,s["data-framer-portal-id"]?void 0:l_(t.parent)),t.projection.setOptions({layoutId:c,layout:d,alwaysMeasureLayout:!!u||p&&Co(p),visualElement:t,animationType:typeof d=="string"?d:"both",initialPromotionConfig:r,layoutScroll:m,layoutRoot:g})}function l_(t){if(t)return t.options.allowProjection!==!1?t.projection:l_(t.parent)}function dD({preloadedFeatures:t,createVisualElement:s,useRender:o,useVisualState:r,Component:c}){var d,u;t&&XA(t);function p(g,v){let x;const y={...b.useContext(Am),...g,layoutId:uD(g)},{isStatic:k}=y,S=aD(g),j=r(g,k);if(!k&&Dm){fD();const N=pD(y);x=N.MeasureLayout,S.visualElement=lD(c,j,y,s,N.ProjectionNode)}return i.jsxs(Md.Provider,{value:S,children:[x&&S.visualElement?i.jsx(x,{visualElement:S.visualElement,...y}):null,o(c,g,oD(j,S.visualElement,v),j,k,S.visualElement)]})}p.displayName=`motion.${typeof c=="string"?c:`create(${(u=(d=c.displayName)!==null&&d!==void 0?d:c.name)!==null&&u!==void 0?u:""})`}`;const m=b.forwardRef(p);return m[iD]=c,m}function uD({layoutId:t}){const s=b.useContext(Cm).id;return s&&t!==void 0?s+"-"+t:t}function fD(t,s){b.useContext(s_).strict}function pD(t){const{drag:s,layout:o}=Oo;if(!s&&!o)return{};const r={...s,...o};return{MeasureLayout:s!=null&&s.isEnabled(t)||o!=null&&o.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const mD=["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 Bm(t){return typeof t!="string"||t.includes("-")?!1:!!(mD.indexOf(t)>-1||/[A-Z]/u.test(t))}function By(t){const s=[{},{}];return t==null||t.values.forEach((o,r)=>{s[0][r]=o.get(),s[1][r]=o.getVelocity()}),s}function Lm(t,s,o,r){if(typeof s=="function"){const[c,d]=By(r);s=s(o!==void 0?o:t.custom,c,d)}if(typeof s=="string"&&(s=t.variants&&t.variants[s]),typeof s=="function"){const[c,d]=By(r);s=s(o!==void 0?o:t.custom,c,d)}return s}const Zp=t=>Array.isArray(t),hD=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),gD=t=>Zp(t)?t[t.length-1]||0:t,fn=t=>!!(t&&t.getVelocity);function td(t){const s=fn(t)?t.get():t;return hD(s)?s.toValue():s}function vD({scrapeMotionValuesFromProps:t,createRenderState:s,onUpdate:o},r,c,d){const u={latestValues:yD(r,c,d,t),renderState:s()};return o&&(u.onMount=p=>o({props:r,current:p,...u}),u.onUpdate=p=>o(p)),u}const c_=t=>(s,o)=>{const r=b.useContext(Md),c=b.useContext(Dd),d=()=>vD(t,s,r,c);return o?d():Em(d)};function yD(t,s,o,r){const c={},d=r(t,{});for(const y in d)c[y]=td(d[y]);let{initial:u,animate:p}=t;const m=Id(t),g=i_(t);s&&g&&!m&&t.inherit!==!1&&(u===void 0&&(u=s.initial),p===void 0&&(p=s.animate));let v=o?o.initial===!1:!1;v=v||u===!1;const x=v?p:u;if(x&&typeof x!="boolean"&&!Rd(x)){const y=Array.isArray(x)?x:[x];for(let k=0;k<y.length;k++){const S=Lm(t,y[k]);if(S){const{transitionEnd:j,transition:N,...T}=S;for(const C in T){let A=T[C];if(Array.isArray(A)){const O=v?A.length-1:0;A=A[O]}A!==null&&(c[C]=A)}for(const C in j)c[C]=j[C]}}}return c}const Vo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Oi=new Set(Vo),d_=t=>s=>typeof s=="string"&&s.startsWith(t),u_=d_("--"),bD=d_("var(--"),zm=t=>bD(t)?xD.test(t.split("/*")[0].trim()):!1,xD=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,f_=(t,s)=>s&&typeof t=="number"?s.transform(t):t,ia=(t,s,o)=>o>s?s:o<t?t:o,qo={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},ol={...qo,transform:t=>ia(0,1,t)},Hc={...qo,default:1},hl=t=>({test:s=>typeof s=="string"&&s.endsWith(t)&&s.split(" ").length===1,parse:parseFloat,transform:s=>`${s}${t}`}),Ua=hl("deg"),Es=hl("%"),Ee=hl("px"),_D=hl("vh"),kD=hl("vw"),Ly={...Es,parse:t=>Es.parse(t)/100,transform:t=>Es.transform(t*100)},SD={borderWidth:Ee,borderTopWidth:Ee,borderRightWidth:Ee,borderBottomWidth:Ee,borderLeftWidth:Ee,borderRadius:Ee,radius:Ee,borderTopLeftRadius:Ee,borderTopRightRadius:Ee,borderBottomRightRadius:Ee,borderBottomLeftRadius:Ee,width:Ee,maxWidth:Ee,height:Ee,maxHeight:Ee,top:Ee,right:Ee,bottom:Ee,left:Ee,padding:Ee,paddingTop:Ee,paddingRight:Ee,paddingBottom:Ee,paddingLeft:Ee,margin:Ee,marginTop:Ee,marginRight:Ee,marginBottom:Ee,marginLeft:Ee,backgroundPositionX:Ee,backgroundPositionY:Ee},TD={rotate:Ua,rotateX:Ua,rotateY:Ua,rotateZ:Ua,scale:Hc,scaleX:Hc,scaleY:Hc,scaleZ:Hc,skew:Ua,skewX:Ua,skewY:Ua,distance:Ee,translateX:Ee,translateY:Ee,translateZ:Ee,x:Ee,y:Ee,z:Ee,perspective:Ee,transformPerspective:Ee,opacity:ol,originX:Ly,originY:Ly,originZ:Ee},zy={...qo,transform:Math.round},$m={...SD,...TD,zIndex:zy,size:Ee,fillOpacity:ol,strokeOpacity:ol,numOctaves:zy},jD={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},wD=Vo.length;function ND(t,s,o){let r="",c=!0;for(let d=0;d<wD;d++){const u=Vo[d],p=t[u];if(p===void 0)continue;let m=!0;if(typeof p=="number"?m=p===(u.startsWith("scale")?1:0):m=parseFloat(p)===0,!m||o){const g=f_(p,$m[u]);if(!m){c=!1;const v=jD[u]||u;r+=`${v}(${g}) `}o&&(s[u]=g)}}return r=r.trim(),o?r=o(s,c?"":r):c&&(r="none"),r}function Pm(t,s,o){const{style:r,vars:c,transformOrigin:d}=t;let u=!1,p=!1;for(const m in s){const g=s[m];if(Oi.has(m)){u=!0;continue}else if(u_(m)){c[m]=g;continue}else{const v=f_(g,$m[m]);m.startsWith("origin")?(p=!0,d[m]=v):r[m]=v}}if(s.transform||(u||o?r.transform=ND(s,t.transform,o):r.transform&&(r.transform="none")),p){const{originX:m="50%",originY:g="50%",originZ:v=0}=d;r.transformOrigin=`${m} ${g} ${v}`}}const CD={offset:"stroke-dashoffset",array:"stroke-dasharray"},ED={offset:"strokeDashoffset",array:"strokeDasharray"};function AD(t,s,o=1,r=0,c=!0){t.pathLength=1;const d=c?CD:ED;t[d.offset]=Ee.transform(-r);const u=Ee.transform(s),p=Ee.transform(o);t[d.array]=`${u} ${p}`}function $y(t,s,o){return typeof t=="string"?t:Ee.transform(s+o*t)}function DD(t,s,o){const r=$y(s,t.x,t.width),c=$y(o,t.y,t.height);return`${r} ${c}`}function Um(t,{attrX:s,attrY:o,attrScale:r,originX:c,originY:d,pathLength:u,pathSpacing:p=1,pathOffset:m=0,...g},v,x){if(Pm(t,g,x),v){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:y,style:k,dimensions:S}=t;y.transform&&(S&&(k.transform=y.transform),delete y.transform),S&&(c!==void 0||d!==void 0||k.transform)&&(k.transformOrigin=DD(S,c!==void 0?c:.5,d!==void 0?d:.5)),s!==void 0&&(y.x=s),o!==void 0&&(y.y=o),r!==void 0&&(y.scale=r),u!==void 0&&AD(y,u,p,m,!1)}const Hm=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),p_=()=>({...Hm(),attrs:{}}),Vm=t=>typeof t=="string"&&t.toLowerCase()==="svg";function m_(t,{style:s,vars:o},r,c){Object.assign(t.style,s,c&&c.getProjectionStyles(r));for(const d in o)t.style.setProperty(d,o[d])}const h_=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 g_(t,s,o,r){m_(t,s,void 0,r);for(const c in s.attrs)t.setAttribute(h_.has(c)?c:Im(c),s.attrs[c])}const dd={};function MD(t){Object.assign(dd,t)}function v_(t,{layout:s,layoutId:o}){return Oi.has(t)||t.startsWith("origin")||(s||o!==void 0)&&(!!dd[t]||t==="opacity")}function qm(t,s,o){var r;const{style:c}=t,d={};for(const u in c)(fn(c[u])||s.style&&fn(s.style[u])||v_(u,t)||((r=o==null?void 0:o.getValue(u))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(d[u]=c[u]);return d}function y_(t,s,o){const r=qm(t,s,o);for(const c in t)if(fn(t[c])||fn(s[c])){const d=Vo.indexOf(c)!==-1?"attr"+c.charAt(0).toUpperCase()+c.substring(1):c;r[d]=t[c]}return r}function RD(t,s){try{s.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{s.dimensions={x:0,y:0,width:0,height:0}}}const Py=["x","y","width","height","cx","cy","r"],ID={useVisualState:c_({scrapeMotionValuesFromProps:y_,createRenderState:p_,onUpdate:({props:t,prevProps:s,current:o,renderState:r,latestValues:c})=>{if(!o)return;let d=!!t.drag;if(!d){for(const p in c)if(Oi.has(p)){d=!0;break}}if(!d)return;let u=!s;if(s)for(let p=0;p<Py.length;p++){const m=Py[p];t[m]!==s[m]&&(u=!0)}u&&kt.read(()=>{RD(o,r),kt.render(()=>{Um(r,c,Vm(o.tagName),t.transformTemplate),g_(o,r)})})}})},OD={useVisualState:c_({scrapeMotionValuesFromProps:qm,createRenderState:Hm})};function b_(t,s,o){for(const r in s)!fn(s[r])&&!v_(r,o)&&(t[r]=s[r])}function BD({transformTemplate:t},s){return b.useMemo(()=>{const o=Hm();return Pm(o,s,t),Object.assign({},o.vars,o.style)},[s])}function LD(t,s){const o=t.style||{},r={};return b_(r,o,t),Object.assign(r,BD(t,s)),r}function zD(t,s){const o={},r=LD(t,s);return t.drag&&t.dragListener!==!1&&(o.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(o.tabIndex=0),o.style=r,o}function $D(t,s,o,r){const c=b.useMemo(()=>{const d=p_();return Um(d,s,Vm(r),t.transformTemplate),{...d.attrs,style:{...d.style}}},[s]);if(t.style){const d={};b_(d,t.style,t),c.style={...d,...c.style}}return c}function PD(t=!1){return(o,r,c,{latestValues:d},u)=>{const m=(Bm(o)?$D:zD)(r,d,u,o),g=tD(r,typeof o=="string",t),v=o!==b.Fragment?{...g,...m,ref:c}:{},{children:x}=r,y=b.useMemo(()=>fn(x)?x.get():x,[x]);return b.createElement(o,{...v,children:y})}}function UD(t,s){return function(r,{forwardMotionProps:c}={forwardMotionProps:!1}){const u={...Bm(r)?ID:OD,preloadedFeatures:t,useRender:PD(c),createVisualElement:s,Component:r};return dD(u)}}function x_(t,s){if(!Array.isArray(s))return!1;const o=s.length;if(o!==t.length)return!1;for(let r=0;r<o;r++)if(s[r]!==t[r])return!1;return!0}function Od(t,s,o){const r=t.getProps();return Lm(r,s,o!==void 0?o:r.custom,t)}function Gm(t,s){return t?t[s]||t.default||t:void 0}const __=new Set(["width","height","top","left","right","bottom",...Vo]);let nd;function HD(){nd=void 0}const As={now:()=>(nd===void 0&&As.set(cn.isProcessing||YA.useManualTiming?cn.timestamp:performance.now()),nd),set:t=>{nd=t,queueMicrotask(HD)}};function Fm(t,s){t.indexOf(s)===-1&&t.push(s)}function Zm(t,s){const o=t.indexOf(s);o>-1&&t.splice(o,1)}class Km{constructor(){this.subscriptions=[]}add(s){return Fm(this.subscriptions,s),()=>Zm(this.subscriptions,s)}notify(s,o,r){const c=this.subscriptions.length;if(c)if(c===1)this.subscriptions[0](s,o,r);else for(let d=0;d<c;d++){const u=this.subscriptions[d];u&&u(s,o,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function k_(t,s){return s?t*(1e3/s):0}const Uy=30,VD=t=>!isNaN(parseFloat(t));class qD{constructor(s,o={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,c=!0)=>{const d=As.now();this.updatedAt!==d&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),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(s),this.owner=o.owner}setCurrent(s){this.current=s,this.updatedAt=As.now(),this.canTrackVelocity===null&&s!==void 0&&(this.canTrackVelocity=VD(this.current))}setPrevFrameValue(s=this.current){this.prevFrameValue=s,this.prevUpdatedAt=this.updatedAt}onChange(s){return this.on("change",s)}on(s,o){this.events[s]||(this.events[s]=new Km);const r=this.events[s].add(o);return s==="change"?()=>{r(),kt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const s in this.events)this.events[s].clear()}attach(s,o){this.passiveEffect=s,this.stopPassiveEffect=o}set(s,o=!0){!o||!this.passiveEffect?this.updateAndNotify(s,o):this.passiveEffect(s,this.updateAndNotify)}setWithVelocity(s,o,r){this.set(o),this.prev=void 0,this.prevFrameValue=s,this.prevUpdatedAt=this.updatedAt-r}jump(s,o=!0){this.updateAndNotify(s),this.prev=s,this.prevUpdatedAt=this.prevFrameValue=void 0,o&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const s=As.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||s-this.updatedAt>Uy)return 0;const o=Math.min(this.updatedAt-this.prevUpdatedAt,Uy);return k_(parseFloat(this.current)-parseFloat(this.prevFrameValue),o)}start(s){return this.stop(),new Promise(o=>{this.hasAnimated=!0,this.animation=s(o),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 rl(t,s){return new qD(t,s)}function GD(t,s,o){t.hasValue(s)?t.getValue(s).set(o):t.addValue(s,rl(o))}function FD(t,s){const o=Od(t,s);let{transitionEnd:r={},transition:c={},...d}=o||{};d={...d,...r};for(const u in d){const p=gD(d[u]);GD(t,u,p)}}function ZD(t){return!!(fn(t)&&t.add)}function Kp(t,s){const o=t.getValue("willChange");if(ZD(o))return o.add(s)}function S_(t){return t.props[o_]}function Ym(t){let s;return()=>(s===void 0&&(s=t()),s)}const KD=Ym(()=>window.ScrollTimeline!==void 0);class YD{constructor(s){this.stop=()=>this.runAll("stop"),this.animations=s.filter(Boolean)}get finished(){return Promise.all(this.animations.map(s=>"finished"in s?s.finished:s))}getAll(s){return this.animations[0][s]}setAll(s,o){for(let r=0;r<this.animations.length;r++)this.animations[r][s]=o}attachTimeline(s,o){const r=this.animations.map(c=>{if(KD()&&c.attachTimeline)return c.attachTimeline(s);if(typeof o=="function")return o(c)});return()=>{r.forEach((c,d)=>{c&&c(),this.animations[d].stop()})}}get time(){return this.getAll("time")}set time(s){this.setAll("time",s)}get speed(){return this.getAll("speed")}set speed(s){this.setAll("speed",s)}get startTime(){return this.getAll("startTime")}get duration(){let s=0;for(let o=0;o<this.animations.length;o++)s=Math.max(s,this.animations[o].duration);return s}runAll(s){this.animations.forEach(o=>o[s]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class JD extends YD{then(s,o){return Promise.all(this.animations).then(s).catch(o)}}const ta=t=>t*1e3,na=t=>t/1e3;function Jm(t){return typeof t=="function"}function Hy(t,s){t.timeline=s,t.onfinish=null}const Wm=t=>Array.isArray(t)&&typeof t[0]=="number",WD={linearEasing:void 0};function XD(t,s){const o=Ym(t);return()=>{var r;return(r=WD[s])!==null&&r!==void 0?r:o()}}const ud=XD(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Bo=(t,s,o)=>{const r=s-t;return r===0?1:(o-t)/r},T_=(t,s,o=10)=>{let r="";const c=Math.max(Math.round(s/o),2);for(let d=0;d<c;d++)r+=t(Bo(0,c-1,d))+", ";return`linear(${r.substring(0,r.length-2)})`};function j_(t){return!!(typeof t=="function"&&ud()||!t||typeof t=="string"&&(t in Yp||ud())||Wm(t)||Array.isArray(t)&&t.every(j_))}const Gr=([t,s,o,r])=>`cubic-bezier(${t}, ${s}, ${o}, ${r})`,Yp={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Gr([0,.65,.55,1]),circOut:Gr([.55,0,1,.45]),backIn:Gr([.31,.01,.66,-.59]),backOut:Gr([.33,1.53,.69,.99])};function w_(t,s){if(t)return typeof t=="function"&&ud()?T_(t,s):Wm(t)?Gr(t):Array.isArray(t)?t.map(o=>w_(o,s)||Yp.easeOut):Yp[t]}const N_=(t,s,o)=>(((1-3*o+3*s)*t+(3*o-6*s))*t+3*s)*t,QD=1e-7,e4=12;function t4(t,s,o,r,c){let d,u,p=0;do u=s+(o-s)/2,d=N_(u,r,c)-t,d>0?o=u:s=u;while(Math.abs(d)>QD&&++p<e4);return u}function gl(t,s,o,r){if(t===s&&o===r)return In;const c=d=>t4(d,0,1,t,o);return d=>d===0||d===1?d:N_(c(d),s,r)}const C_=t=>s=>s<=.5?t(2*s)/2:(2-t(2*(1-s)))/2,E_=t=>s=>1-t(1-s),A_=gl(.33,1.53,.69,.99),Xm=E_(A_),D_=C_(Xm),M_=t=>(t*=2)<1?.5*Xm(t):.5*(2-Math.pow(2,-10*(t-1))),Qm=t=>1-Math.sin(Math.acos(t)),R_=E_(Qm),I_=C_(Qm),O_=t=>/^0[^.\s]+$/u.test(t);function n4(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||O_(t):!0}const Jr=t=>Math.round(t*1e5)/1e5,eh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function s4(t){return t==null}const a4=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,th=(t,s)=>o=>!!(typeof o=="string"&&a4.test(o)&&o.startsWith(t)||s&&!s4(o)&&Object.prototype.hasOwnProperty.call(o,s)),B_=(t,s,o)=>r=>{if(typeof r!="string")return r;const[c,d,u,p]=r.match(eh);return{[t]:parseFloat(c),[s]:parseFloat(d),[o]:parseFloat(u),alpha:p!==void 0?parseFloat(p):1}},i4=t=>ia(0,255,t),gp={...qo,transform:t=>Math.round(i4(t))},ji={test:th("rgb","red"),parse:B_("red","green","blue"),transform:({red:t,green:s,blue:o,alpha:r=1})=>"rgba("+gp.transform(t)+", "+gp.transform(s)+", "+gp.transform(o)+", "+Jr(ol.transform(r))+")"};function o4(t){let s="",o="",r="",c="";return t.length>5?(s=t.substring(1,3),o=t.substring(3,5),r=t.substring(5,7),c=t.substring(7,9)):(s=t.substring(1,2),o=t.substring(2,3),r=t.substring(3,4),c=t.substring(4,5),s+=s,o+=o,r+=r,c+=c),{red:parseInt(s,16),green:parseInt(o,16),blue:parseInt(r,16),alpha:c?parseInt(c,16)/255:1}}const Jp={test:th("#"),parse:o4,transform:ji.transform},Eo={test:th("hsl","hue"),parse:B_("hue","saturation","lightness"),transform:({hue:t,saturation:s,lightness:o,alpha:r=1})=>"hsla("+Math.round(t)+", "+Es.transform(Jr(s))+", "+Es.transform(Jr(o))+", "+Jr(ol.transform(r))+")"},un={test:t=>ji.test(t)||Jp.test(t)||Eo.test(t),parse:t=>ji.test(t)?ji.parse(t):Eo.test(t)?Eo.parse(t):Jp.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ji.transform(t):Eo.transform(t)},r4=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function l4(t){var s,o;return isNaN(t)&&typeof t=="string"&&(((s=t.match(eh))===null||s===void 0?void 0:s.length)||0)+(((o=t.match(r4))===null||o===void 0?void 0:o.length)||0)>0}const L_="number",z_="color",c4="var",d4="var(",Vy="${}",u4=/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 ll(t){const s=t.toString(),o=[],r={color:[],number:[],var:[]},c=[];let d=0;const p=s.replace(u4,m=>(un.test(m)?(r.color.push(d),c.push(z_),o.push(un.parse(m))):m.startsWith(d4)?(r.var.push(d),c.push(c4),o.push(m)):(r.number.push(d),c.push(L_),o.push(parseFloat(m))),++d,Vy)).split(Vy);return{values:o,split:p,indexes:r,types:c}}function $_(t){return ll(t).values}function P_(t){const{split:s,types:o}=ll(t),r=s.length;return c=>{let d="";for(let u=0;u<r;u++)if(d+=s[u],c[u]!==void 0){const p=o[u];p===L_?d+=Jr(c[u]):p===z_?d+=un.transform(c[u]):d+=c[u]}return d}}const f4=t=>typeof t=="number"?0:t;function p4(t){const s=$_(t);return P_(t)(s.map(f4))}const Fa={test:l4,parse:$_,createTransformer:P_,getAnimatableNone:p4},m4=new Set(["brightness","contrast","saturate","opacity"]);function h4(t){const[s,o]=t.slice(0,-1).split("(");if(s==="drop-shadow")return t;const[r]=o.match(eh)||[];if(!r)return t;const c=o.replace(r,"");let d=m4.has(s)?1:0;return r!==o&&(d*=100),s+"("+d+c+")"}const g4=/\b([a-z-]*)\(.*?\)/gu,Wp={...Fa,getAnimatableNone:t=>{const s=t.match(g4);return s?s.map(h4).join(" "):t}},v4={...$m,color:un,backgroundColor:un,outlineColor:un,fill:un,stroke:un,borderColor:un,borderTopColor:un,borderRightColor:un,borderBottomColor:un,borderLeftColor:un,filter:Wp,WebkitFilter:Wp},nh=t=>v4[t];function U_(t,s){let o=nh(t);return o!==Wp&&(o=Fa),o.getAnimatableNone?o.getAnimatableNone(s):void 0}const y4=new Set(["auto","none","0"]);function b4(t,s,o){let r=0,c;for(;r<t.length&&!c;){const d=t[r];typeof d=="string"&&!y4.has(d)&&ll(d).values.length&&(c=t[r]),r++}if(c&&o)for(const d of s)t[d]=U_(o,c)}const qy=t=>t===qo||t===Ee,Gy=(t,s)=>parseFloat(t.split(", ")[s]),Fy=(t,s)=>(o,{transform:r})=>{if(r==="none"||!r)return 0;const c=r.match(/^matrix3d\((.+)\)$/u);if(c)return Gy(c[1],s);{const d=r.match(/^matrix\((.+)\)$/u);return d?Gy(d[1],t):0}},x4=new Set(["x","y","z"]),_4=Vo.filter(t=>!x4.has(t));function k4(t){const s=[];return _4.forEach(o=>{const r=t.getValue(o);r!==void 0&&(s.push([o,r.get()]),r.set(o.startsWith("scale")?1:0))}),s}const Lo={width:({x:t},{paddingLeft:s="0",paddingRight:o="0"})=>t.max-t.min-parseFloat(s)-parseFloat(o),height:({y:t},{paddingTop:s="0",paddingBottom:o="0"})=>t.max-t.min-parseFloat(s)-parseFloat(o),top:(t,{top:s})=>parseFloat(s),left:(t,{left:s})=>parseFloat(s),bottom:({y:t},{top:s})=>parseFloat(s)+(t.max-t.min),right:({x:t},{left:s})=>parseFloat(s)+(t.max-t.min),x:Fy(4,13),y:Fy(5,14)};Lo.translateX=Lo.x;Lo.translateY=Lo.y;const Ni=new Set;let Xp=!1,Qp=!1;function H_(){if(Qp){const t=Array.from(Ni).filter(r=>r.needsMeasurement),s=new Set(t.map(r=>r.element)),o=new Map;s.forEach(r=>{const c=k4(r);c.length&&(o.set(r,c),r.render())}),t.forEach(r=>r.measureInitialState()),s.forEach(r=>{r.render();const c=o.get(r);c&&c.forEach(([d,u])=>{var p;(p=r.getValue(d))===null||p===void 0||p.set(u)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Qp=!1,Xp=!1,Ni.forEach(t=>t.complete()),Ni.clear()}function V_(){Ni.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Qp=!0)})}function S4(){V_(),H_()}class sh{constructor(s,o,r,c,d,u=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...s],this.onComplete=o,this.name=r,this.motionValue=c,this.element=d,this.isAsync=u}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ni.add(this),Xp||(Xp=!0,kt.read(V_),kt.resolveKeyframes(H_))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:s,name:o,element:r,motionValue:c}=this;for(let d=0;d<s.length;d++)if(s[d]===null)if(d===0){const u=c==null?void 0:c.get(),p=s[s.length-1];if(u!==void 0)s[0]=u;else if(r&&o){const m=r.readValue(o,p);m!=null&&(s[0]=m)}s[0]===void 0&&(s[0]=p),c&&u===void 0&&c.set(s[0])}else s[d]=s[d-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ni.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ni.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const q_=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),T4=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function j4(t){const s=T4.exec(t);if(!s)return[,];const[,o,r,c]=s;return[`--${o??r}`,c]}function G_(t,s,o=1){const[r,c]=j4(t);if(!r)return;const d=window.getComputedStyle(s).getPropertyValue(r);if(d){const u=d.trim();return q_(u)?parseFloat(u):u}return zm(c)?G_(c,s,o+1):c}const F_=t=>s=>s.test(t),w4={test:t=>t==="auto",parse:t=>t},Z_=[qo,Ee,Es,Ua,kD,_D,w4],Zy=t=>Z_.find(F_(t));class K_ extends sh{constructor(s,o,r,c,d){super(s,o,r,c,d,!0)}readKeyframes(){const{unresolvedKeyframes:s,element:o,name:r}=this;if(!o||!o.current)return;super.readKeyframes();for(let m=0;m<s.length;m++){let g=s[m];if(typeof g=="string"&&(g=g.trim(),zm(g))){const v=G_(g,o.current);v!==void 0&&(s[m]=v),m===s.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!__.has(r)||s.length!==2)return;const[c,d]=s,u=Zy(c),p=Zy(d);if(u!==p)if(qy(u)&&qy(p))for(let m=0;m<s.length;m++){const g=s[m];typeof g=="string"&&(s[m]=parseFloat(g))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:s,name:o}=this,r=[];for(let c=0;c<s.length;c++)n4(s[c])&&r.push(c);r.length&&b4(s,r,o)}measureInitialState(){const{element:s,unresolvedKeyframes:o,name:r}=this;if(!s||!s.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Lo[r](s.measureViewportBox(),window.getComputedStyle(s.current)),o[0]=this.measuredOrigin;const c=o[o.length-1];c!==void 0&&s.getValue(r,c).jump(c,!1)}measureEndState(){var s;const{element:o,name:r,unresolvedKeyframes:c}=this;if(!o||!o.current)return;const d=o.getValue(r);d&&d.jump(this.measuredOrigin,!1);const u=c.length-1,p=c[u];c[u]=Lo[r](o.measureViewportBox(),window.getComputedStyle(o.current)),p!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=p),!((s=this.removedTransforms)===null||s===void 0)&&s.length&&this.removedTransforms.forEach(([m,g])=>{o.getValue(m).set(g)}),this.resolveNoneKeyframes()}}const Ky=(t,s)=>s==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Fa.test(t)||t==="0")&&!t.startsWith("url("));function N4(t){const s=t[0];if(t.length===1)return!0;for(let o=0;o<t.length;o++)if(t[o]!==s)return!0}function C4(t,s,o,r){const c=t[0];if(c===null)return!1;if(s==="display"||s==="visibility")return!0;const d=t[t.length-1],u=Ky(c,s),p=Ky(d,s);return!u||!p?!1:N4(t)||(o==="spring"||Jm(o))&&r}const E4=t=>t!==null;function Bd(t,{repeat:s,repeatType:o="loop"},r){const c=t.filter(E4),d=s&&o!=="loop"&&s%2===1?0:c.length-1;return!d||r===void 0?c[d]:r}const A4=40;class Y_{constructor({autoplay:s=!0,delay:o=0,type:r="keyframes",repeat:c=0,repeatDelay:d=0,repeatType:u="loop",...p}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=As.now(),this.options={autoplay:s,delay:o,type:r,repeat:c,repeatDelay:d,repeatType:u,...p},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>A4?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&S4(),this._resolved}onKeyframesResolved(s,o){this.resolvedAt=As.now(),this.hasAttemptedResolve=!0;const{name:r,type:c,velocity:d,delay:u,onComplete:p,onUpdate:m,isGenerator:g}=this.options;if(!g&&!C4(s,r,c,d))if(u)this.options.duration=0;else{m&&m(Bd(s,this.options,o)),p&&p(),this.resolveFinishedPromise();return}const v=this.initPlayback(s,o);v!==!1&&(this._resolved={keyframes:s,finalKeyframe:o,...v},this.onPostResolved())}onPostResolved(){}then(s,o){return this.currentFinishedPromise.then(s,o)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(s=>{this.resolveFinishedPromise=s})}}const em=2e4;function J_(t){let s=0;const o=50;let r=t.next(s);for(;!r.done&&s<em;)s+=o,r=t.next(s);return s>=em?1/0:s}const Ct=(t,s,o)=>t+(s-t)*o;function vp(t,s,o){return o<0&&(o+=1),o>1&&(o-=1),o<1/6?t+(s-t)*6*o:o<1/2?s:o<2/3?t+(s-t)*(2/3-o)*6:t}function D4({hue:t,saturation:s,lightness:o,alpha:r}){t/=360,s/=100,o/=100;let c=0,d=0,u=0;if(!s)c=d=u=o;else{const p=o<.5?o*(1+s):o+s-o*s,m=2*o-p;c=vp(m,p,t+1/3),d=vp(m,p,t),u=vp(m,p,t-1/3)}return{red:Math.round(c*255),green:Math.round(d*255),blue:Math.round(u*255),alpha:r}}function fd(t,s){return o=>o>0?s:t}const yp=(t,s,o)=>{const r=t*t,c=o*(s*s-r)+r;return c<0?0:Math.sqrt(c)},M4=[Jp,ji,Eo],R4=t=>M4.find(s=>s.test(t));function Yy(t){const s=R4(t);if(!s)return!1;let o=s.parse(t);return s===Eo&&(o=D4(o)),o}const Jy=(t,s)=>{const o=Yy(t),r=Yy(s);if(!o||!r)return fd(t,s);const c={...o};return d=>(c.red=yp(o.red,r.red,d),c.green=yp(o.green,r.green,d),c.blue=yp(o.blue,r.blue,d),c.alpha=Ct(o.alpha,r.alpha,d),ji.transform(c))},I4=(t,s)=>o=>s(t(o)),vl=(...t)=>t.reduce(I4),tm=new Set(["none","hidden"]);function O4(t,s){return tm.has(t)?o=>o<=0?t:s:o=>o>=1?s:t}function B4(t,s){return o=>Ct(t,s,o)}function ah(t){return typeof t=="number"?B4:typeof t=="string"?zm(t)?fd:un.test(t)?Jy:$4:Array.isArray(t)?W_:typeof t=="object"?un.test(t)?Jy:L4:fd}function W_(t,s){const o=[...t],r=o.length,c=t.map((d,u)=>ah(d)(d,s[u]));return d=>{for(let u=0;u<r;u++)o[u]=c[u](d);return o}}function L4(t,s){const o={...t,...s},r={};for(const c in o)t[c]!==void 0&&s[c]!==void 0&&(r[c]=ah(t[c])(t[c],s[c]));return c=>{for(const d in r)o[d]=r[d](c);return o}}function z4(t,s){var o;const r=[],c={color:0,var:0,number:0};for(let d=0;d<s.values.length;d++){const u=s.types[d],p=t.indexes[u][c[u]],m=(o=t.values[p])!==null&&o!==void 0?o:0;r[d]=m,c[u]++}return r}const $4=(t,s)=>{const o=Fa.createTransformer(s),r=ll(t),c=ll(s);return r.indexes.var.length===c.indexes.var.length&&r.indexes.color.length===c.indexes.color.length&&r.indexes.number.length>=c.indexes.number.length?tm.has(t)&&!c.values.length||tm.has(s)&&!r.values.length?O4(t,s):vl(W_(z4(r,c),c.values),o):fd(t,s)};function X_(t,s,o){return typeof t=="number"&&typeof s=="number"&&typeof o=="number"?Ct(t,s,o):ah(t)(t,s)}const P4=5;function Q_(t,s,o){const r=Math.max(s-P4,0);return k_(o-t(r),s-r)}const Mt={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},bp=.001;function U4({duration:t=Mt.duration,bounce:s=Mt.bounce,velocity:o=Mt.velocity,mass:r=Mt.mass}){let c,d,u=1-s;u=ia(Mt.minDamping,Mt.maxDamping,u),t=ia(Mt.minDuration,Mt.maxDuration,na(t)),u<1?(c=g=>{const v=g*u,x=v*t,y=v-o,k=nm(g,u),S=Math.exp(-x);return bp-y/k*S},d=g=>{const x=g*u*t,y=x*o+o,k=Math.pow(u,2)*Math.pow(g,2)*t,S=Math.exp(-x),j=nm(Math.pow(g,2),u);return(-c(g)+bp>0?-1:1)*((y-k)*S)/j}):(c=g=>{const v=Math.exp(-g*t),x=(g-o)*t+1;return-bp+v*x},d=g=>{const v=Math.exp(-g*t),x=(o-g)*(t*t);return v*x});const p=5/t,m=V4(c,d,p);if(t=ta(t),isNaN(m))return{stiffness:Mt.stiffness,damping:Mt.damping,duration:t};{const g=Math.pow(m,2)*r;return{stiffness:g,damping:u*2*Math.sqrt(r*g),duration:t}}}const H4=12;function V4(t,s,o){let r=o;for(let c=1;c<H4;c++)r=r-t(r)/s(r);return r}function nm(t,s){return t*Math.sqrt(1-s*s)}const q4=["duration","bounce"],G4=["stiffness","damping","mass"];function Wy(t,s){return s.some(o=>t[o]!==void 0)}function F4(t){let s={velocity:Mt.velocity,stiffness:Mt.stiffness,damping:Mt.damping,mass:Mt.mass,isResolvedFromDuration:!1,...t};if(!Wy(t,G4)&&Wy(t,q4))if(t.visualDuration){const o=t.visualDuration,r=2*Math.PI/(o*1.2),c=r*r,d=2*ia(.05,1,1-(t.bounce||0))*Math.sqrt(c);s={...s,mass:Mt.mass,stiffness:c,damping:d}}else{const o=U4(t);s={...s,...o,mass:Mt.mass},s.isResolvedFromDuration=!0}return s}function e1(t=Mt.visualDuration,s=Mt.bounce){const o=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:s}:t;let{restSpeed:r,restDelta:c}=o;const d=o.keyframes[0],u=o.keyframes[o.keyframes.length-1],p={done:!1,value:d},{stiffness:m,damping:g,mass:v,duration:x,velocity:y,isResolvedFromDuration:k}=F4({...o,velocity:-na(o.velocity||0)}),S=y||0,j=g/(2*Math.sqrt(m*v)),N=u-d,T=na(Math.sqrt(m/v)),C=Math.abs(N)<5;r||(r=C?Mt.restSpeed.granular:Mt.restSpeed.default),c||(c=C?Mt.restDelta.granular:Mt.restDelta.default);let A;if(j<1){const E=nm(T,j);A=D=>{const P=Math.exp(-j*T*D);return u-P*((S+j*T*N)/E*Math.sin(E*D)+N*Math.cos(E*D))}}else if(j===1)A=E=>u-Math.exp(-T*E)*(N+(S+T*N)*E);else{const E=T*Math.sqrt(j*j-1);A=D=>{const P=Math.exp(-j*T*D),B=Math.min(E*D,300);return u-P*((S+j*T*N)*Math.sinh(B)+E*N*Math.cosh(B))/E}}const O={calculatedDuration:k&&x||null,next:E=>{const D=A(E);if(k)p.done=E>=x;else{let P=0;j<1&&(P=E===0?ta(S):Q_(A,E,D));const B=Math.abs(P)<=r,z=Math.abs(u-D)<=c;p.done=B&&z}return p.value=p.done?u:D,p},toString:()=>{const E=Math.min(J_(O),em),D=T_(P=>O.next(E*P).value,E,30);return E+"ms "+D}};return O}function Xy({keyframes:t,velocity:s=0,power:o=.8,timeConstant:r=325,bounceDamping:c=10,bounceStiffness:d=500,modifyTarget:u,min:p,max:m,restDelta:g=.5,restSpeed:v}){const x=t[0],y={done:!1,value:x},k=B=>p!==void 0&&B<p||m!==void 0&&B>m,S=B=>p===void 0?m:m===void 0||Math.abs(p-B)<Math.abs(m-B)?p:m;let j=o*s;const N=x+j,T=u===void 0?N:u(N);T!==N&&(j=T-x);const C=B=>-j*Math.exp(-B/r),A=B=>T+C(B),O=B=>{const z=C(B),J=A(B);y.done=Math.abs(z)<=g,y.value=y.done?T:J};let E,D;const P=B=>{k(y.value)&&(E=B,D=e1({keyframes:[y.value,S(y.value)],velocity:Q_(A,B,y.value),damping:c,stiffness:d,restDelta:g,restSpeed:v}))};return P(0),{calculatedDuration:null,next:B=>{let z=!1;return!D&&E===void 0&&(z=!0,O(B),P(B)),E!==void 0&&B>=E?D.next(B-E):(!z&&O(B),y)}}}const Z4=gl(.42,0,1,1),K4=gl(0,0,.58,1),t1=gl(.42,0,.58,1),Y4=t=>Array.isArray(t)&&typeof t[0]!="number",J4={linear:In,easeIn:Z4,easeInOut:t1,easeOut:K4,circIn:Qm,circInOut:I_,circOut:R_,backIn:Xm,backInOut:D_,backOut:A_,anticipate:M_},Qy=t=>{if(Wm(t)){t_(t.length===4);const[s,o,r,c]=t;return gl(s,o,r,c)}else if(typeof t=="string")return J4[t];return t};function W4(t,s,o){const r=[],c=o||X_,d=t.length-1;for(let u=0;u<d;u++){let p=c(t[u],t[u+1]);if(s){const m=Array.isArray(s)?s[u]||In:s;p=vl(m,p)}r.push(p)}return r}function X4(t,s,{clamp:o=!0,ease:r,mixer:c}={}){const d=t.length;if(t_(d===s.length),d===1)return()=>s[0];if(d===2&&s[0]===s[1])return()=>s[1];const u=t[0]===t[1];t[0]>t[d-1]&&(t=[...t].reverse(),s=[...s].reverse());const p=W4(s,r,c),m=p.length,g=v=>{if(u&&v<t[0])return s[0];let x=0;if(m>1)for(;x<t.length-2&&!(v<t[x+1]);x++);const y=Bo(t[x],t[x+1],v);return p[x](y)};return o?v=>g(ia(t[0],t[d-1],v)):g}function Q4(t,s){const o=t[t.length-1];for(let r=1;r<=s;r++){const c=Bo(0,s,r);t.push(Ct(o,1,c))}}function eM(t){const s=[0];return Q4(s,t.length-1),s}function tM(t,s){return t.map(o=>o*s)}function nM(t,s){return t.map(()=>s||t1).splice(0,t.length-1)}function pd({duration:t=300,keyframes:s,times:o,ease:r="easeInOut"}){const c=Y4(r)?r.map(Qy):Qy(r),d={done:!1,value:s[0]},u=tM(o&&o.length===s.length?o:eM(s),t),p=X4(u,s,{ease:Array.isArray(c)?c:nM(s,c)});return{calculatedDuration:t,next:m=>(d.value=p(m),d.done=m>=t,d)}}const sM=t=>{const s=({timestamp:o})=>t(o);return{start:()=>kt.update(s,!0),stop:()=>Ga(s),now:()=>cn.isProcessing?cn.timestamp:As.now()}},aM={decay:Xy,inertia:Xy,tween:pd,keyframes:pd,spring:e1},iM=t=>t/100;class ih extends Y_{constructor(s){super(s),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:m}=this.options;m&&m()};const{name:o,motionValue:r,element:c,keyframes:d}=this.options,u=(c==null?void 0:c.KeyframeResolver)||sh,p=(m,g)=>this.onKeyframesResolved(m,g);this.resolver=new u(d,p,o,r,c),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(s){const{type:o="keyframes",repeat:r=0,repeatDelay:c=0,repeatType:d,velocity:u=0}=this.options,p=Jm(o)?o:aM[o]||pd;let m,g;p!==pd&&typeof s[0]!="number"&&(m=vl(iM,X_(s[0],s[1])),s=[0,100]);const v=p({...this.options,keyframes:s});d==="mirror"&&(g=p({...this.options,keyframes:[...s].reverse(),velocity:-u})),v.calculatedDuration===null&&(v.calculatedDuration=J_(v));const{calculatedDuration:x}=v,y=x+c,k=y*(r+1)-c;return{generator:v,mirroredGenerator:g,mapPercentToKeyframes:m,calculatedDuration:x,resolvedDuration:y,totalDuration:k}}onPostResolved(){const{autoplay:s=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!s?this.pause():this.state=this.pendingPlayState}tick(s,o=!1){const{resolved:r}=this;if(!r){const{keyframes:B}=this.options;return{done:!0,value:B[B.length-1]}}const{finalKeyframe:c,generator:d,mirroredGenerator:u,mapPercentToKeyframes:p,keyframes:m,calculatedDuration:g,totalDuration:v,resolvedDuration:x}=r;if(this.startTime===null)return d.next(0);const{delay:y,repeat:k,repeatType:S,repeatDelay:j,onUpdate:N}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,s):this.speed<0&&(this.startTime=Math.min(s-v/this.speed,this.startTime)),o?this.currentTime=s:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(s-this.startTime)*this.speed;const T=this.currentTime-y*(this.speed>=0?1:-1),C=this.speed>=0?T<0:T>v;this.currentTime=Math.max(T,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=v);let A=this.currentTime,O=d;if(k){const B=Math.min(this.currentTime,v)/x;let z=Math.floor(B),J=B%1;!J&&B>=1&&(J=1),J===1&&z--,z=Math.min(z,k+1),!!(z%2)&&(S==="reverse"?(J=1-J,j&&(J-=j/x)):S==="mirror"&&(O=u)),A=ia(0,1,J)*x}const E=C?{done:!1,value:m[0]}:O.next(A);p&&(E.value=p(E.value));let{done:D}=E;!C&&g!==null&&(D=this.speed>=0?this.currentTime>=v:this.currentTime<=0);const P=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&D);return P&&c!==void 0&&(E.value=Bd(m,this.options,c)),N&&N(E.value),P&&this.finish(),E}get duration(){const{resolved:s}=this;return s?na(s.calculatedDuration):0}get time(){return na(this.currentTime)}set time(s){s=ta(s),this.currentTime=s,this.holdTime!==null||this.speed===0?this.holdTime=s:this.driver&&(this.startTime=this.driver.now()-s/this.speed)}get speed(){return this.playbackSpeed}set speed(s){const o=this.playbackSpeed!==s;this.playbackSpeed=s,o&&(this.time=na(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:s=sM,onPlay:o,startTime:r}=this.options;this.driver||(this.driver=s(d=>this.tick(d))),o&&o();const c=this.driver.now();this.holdTime!==null?this.startTime=c-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=c):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var s;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(s=this.currentTime)!==null&&s!==void 0?s:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:s}=this.options;s&&s()}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(s){return this.startTime=0,this.tick(s,!0)}}const oM=new Set(["opacity","clipPath","filter","transform"]);function rM(t,s,o,{delay:r=0,duration:c=300,repeat:d=0,repeatType:u="loop",ease:p="easeInOut",times:m}={}){const g={[s]:o};m&&(g.offset=m);const v=w_(p,c);return Array.isArray(v)&&(g.easing=v),t.animate(g,{delay:r,duration:c,easing:Array.isArray(v)?"linear":v,fill:"both",iterations:d+1,direction:u==="reverse"?"alternate":"normal"})}const lM=Ym(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),md=10,cM=2e4;function dM(t){return Jm(t.type)||t.type==="spring"||!j_(t.ease)}function uM(t,s){const o=new ih({...s,keyframes:t,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:t[0]};const c=[];let d=0;for(;!r.done&&d<cM;)r=o.sample(d),c.push(r.value),d+=md;return{times:void 0,keyframes:c,duration:d-md,ease:"linear"}}const n1={anticipate:M_,backInOut:D_,circInOut:I_};function fM(t){return t in n1}class eb extends Y_{constructor(s){super(s);const{name:o,motionValue:r,element:c,keyframes:d}=this.options;this.resolver=new K_(d,(u,p)=>this.onKeyframesResolved(u,p),o,r,c),this.resolver.scheduleResolve()}initPlayback(s,o){let{duration:r=300,times:c,ease:d,type:u,motionValue:p,name:m,startTime:g}=this.options;if(!p.owner||!p.owner.current)return!1;if(typeof d=="string"&&ud()&&fM(d)&&(d=n1[d]),dM(this.options)){const{onComplete:x,onUpdate:y,motionValue:k,element:S,...j}=this.options,N=uM(s,j);s=N.keyframes,s.length===1&&(s[1]=s[0]),r=N.duration,c=N.times,d=N.ease,u="keyframes"}const v=rM(p.owner.current,m,s,{...this.options,duration:r,times:c,ease:d});return v.startTime=g??this.calcStartTime(),this.pendingTimeline?(Hy(v,this.pendingTimeline),this.pendingTimeline=void 0):v.onfinish=()=>{const{onComplete:x}=this.options;p.set(Bd(s,this.options,o)),x&&x(),this.cancel(),this.resolveFinishedPromise()},{animation:v,duration:r,times:c,type:u,ease:d,keyframes:s}}get duration(){const{resolved:s}=this;if(!s)return 0;const{duration:o}=s;return na(o)}get time(){const{resolved:s}=this;if(!s)return 0;const{animation:o}=s;return na(o.currentTime||0)}set time(s){const{resolved:o}=this;if(!o)return;const{animation:r}=o;r.currentTime=ta(s)}get speed(){const{resolved:s}=this;if(!s)return 1;const{animation:o}=s;return o.playbackRate}set speed(s){const{resolved:o}=this;if(!o)return;const{animation:r}=o;r.playbackRate=s}get state(){const{resolved:s}=this;if(!s)return"idle";const{animation:o}=s;return o.playState}get startTime(){const{resolved:s}=this;if(!s)return null;const{animation:o}=s;return o.startTime}attachTimeline(s){if(!this._resolved)this.pendingTimeline=s;else{const{resolved:o}=this;if(!o)return In;const{animation:r}=o;Hy(r,s)}return In}play(){if(this.isStopped)return;const{resolved:s}=this;if(!s)return;const{animation:o}=s;o.playState==="finished"&&this.updateFinishedPromise(),o.play()}pause(){const{resolved:s}=this;if(!s)return;const{animation:o}=s;o.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:s}=this;if(!s)return;const{animation:o,keyframes:r,duration:c,type:d,ease:u,times:p}=s;if(o.playState==="idle"||o.playState==="finished")return;if(this.time){const{motionValue:g,onUpdate:v,onComplete:x,element:y,...k}=this.options,S=new ih({...k,keyframes:r,duration:c,type:d,ease:u,times:p,isGenerator:!0}),j=ta(this.time);g.setWithVelocity(S.sample(j-md).value,S.sample(j).value,md)}const{onStop:m}=this.options;m&&m(),this.cancel()}complete(){const{resolved:s}=this;s&&s.animation.finish()}cancel(){const{resolved:s}=this;s&&s.animation.cancel()}static supports(s){const{motionValue:o,name:r,repeatDelay:c,repeatType:d,damping:u,type:p}=s;if(!o||!o.owner||!(o.owner.current instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:g}=o.owner.getProps();return lM()&&r&&oM.has(r)&&!m&&!g&&!c&&d!=="mirror"&&u!==0&&p!=="inertia"}}const pM={type:"spring",stiffness:500,damping:25,restSpeed:10},mM=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),hM={type:"keyframes",duration:.8},gM={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},vM=(t,{keyframes:s})=>s.length>2?hM:Oi.has(t)?t.startsWith("scale")?mM(s[1]):pM:gM;function yM({when:t,delay:s,delayChildren:o,staggerChildren:r,staggerDirection:c,repeat:d,repeatType:u,repeatDelay:p,from:m,elapsed:g,...v}){return!!Object.keys(v).length}const oh=(t,s,o,r={},c,d)=>u=>{const p=Gm(r,t)||{},m=p.delay||r.delay||0;let{elapsed:g=0}=r;g=g-ta(m);let v={keyframes:Array.isArray(o)?o:[null,o],ease:"easeOut",velocity:s.getVelocity(),...p,delay:-g,onUpdate:y=>{s.set(y),p.onUpdate&&p.onUpdate(y)},onComplete:()=>{u(),p.onComplete&&p.onComplete()},name:t,motionValue:s,element:d?void 0:c};yM(p)||(v={...v,...vM(t,v)}),v.duration&&(v.duration=ta(v.duration)),v.repeatDelay&&(v.repeatDelay=ta(v.repeatDelay)),v.from!==void 0&&(v.keyframes[0]=v.from);let x=!1;if((v.type===!1||v.duration===0&&!v.repeatDelay)&&(v.duration=0,v.delay===0&&(x=!0)),x&&!d&&s.get()!==void 0){const y=Bd(v.keyframes,p);if(y!==void 0)return kt.update(()=>{v.onUpdate(y),v.onComplete()}),new JD([])}return!d&&eb.supports(v)?new eb(v):new ih(v)};function bM({protectedKeys:t,needsAnimating:s},o){const r=t.hasOwnProperty(o)&&s[o]!==!0;return s[o]=!1,r}function s1(t,s,{delay:o=0,transitionOverride:r,type:c}={}){var d;let{transition:u=t.getDefaultTransition(),transitionEnd:p,...m}=s;r&&(u=r);const g=[],v=c&&t.animationState&&t.animationState.getState()[c];for(const x in m){const y=t.getValue(x,(d=t.latestValues[x])!==null&&d!==void 0?d:null),k=m[x];if(k===void 0||v&&bM(v,x))continue;const S={delay:o,...Gm(u||{},x)};let j=!1;if(window.MotionHandoffAnimation){const T=S_(t);if(T){const C=window.MotionHandoffAnimation(T,x,kt);C!==null&&(S.startTime=C,j=!0)}}Kp(t,x),y.start(oh(x,y,k,t.shouldReduceMotion&&__.has(x)?{type:!1}:S,t,j));const N=y.animation;N&&g.push(N)}return p&&Promise.all(g).then(()=>{kt.update(()=>{p&&FD(t,p)})}),g}function sm(t,s,o={}){var r;const c=Od(t,s,o.type==="exit"?(r=t.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:d=t.getDefaultTransition()||{}}=c||{};o.transitionOverride&&(d=o.transitionOverride);const u=c?()=>Promise.all(s1(t,c,o)):()=>Promise.resolve(),p=t.variantChildren&&t.variantChildren.size?(g=0)=>{const{delayChildren:v=0,staggerChildren:x,staggerDirection:y}=d;return xM(t,s,v+g,x,y,o)}:()=>Promise.resolve(),{when:m}=d;if(m){const[g,v]=m==="beforeChildren"?[u,p]:[p,u];return g().then(()=>v())}else return Promise.all([u(),p(o.delay)])}function xM(t,s,o=0,r=0,c=1,d){const u=[],p=(t.variantChildren.size-1)*r,m=c===1?(g=0)=>g*r:(g=0)=>p-g*r;return Array.from(t.variantChildren).sort(_M).forEach((g,v)=>{g.notify("AnimationStart",s),u.push(sm(g,s,{...d,delay:o+m(v)}).then(()=>g.notify("AnimationComplete",s)))}),Promise.all(u)}function _M(t,s){return t.sortNodePosition(s)}function kM(t,s,o={}){t.notify("AnimationStart",s);let r;if(Array.isArray(s)){const c=s.map(d=>sm(t,d,o));r=Promise.all(c)}else if(typeof s=="string")r=sm(t,s,o);else{const c=typeof s=="function"?Od(t,s,o.custom):s;r=Promise.all(s1(t,c,o))}return r.then(()=>{t.notify("AnimationComplete",s)})}const SM=Rm.length;function a1(t){if(!t)return;if(!t.isControllingVariants){const o=t.parent?a1(t.parent)||{}:{};return t.props.initial!==void 0&&(o.initial=t.props.initial),o}const s={};for(let o=0;o<SM;o++){const r=Rm[o],c=t.props[r];(il(c)||c===!1)&&(s[r]=c)}return s}const TM=[...Mm].reverse(),jM=Mm.length;function wM(t){return s=>Promise.all(s.map(({animation:o,options:r})=>kM(t,o,r)))}function NM(t){let s=wM(t),o=tb(),r=!0;const c=m=>(g,v)=>{var x;const y=Od(t,v,m==="exit"?(x=t.presenceContext)===null||x===void 0?void 0:x.custom:void 0);if(y){const{transition:k,transitionEnd:S,...j}=y;g={...g,...j,...S}}return g};function d(m){s=m(t)}function u(m){const{props:g}=t,v=a1(t.parent)||{},x=[],y=new Set;let k={},S=1/0;for(let N=0;N<jM;N++){const T=TM[N],C=o[T],A=g[T]!==void 0?g[T]:v[T],O=il(A),E=T===m?C.isActive:null;E===!1&&(S=N);let D=A===v[T]&&A!==g[T]&&O;if(D&&r&&t.manuallyAnimateOnMount&&(D=!1),C.protectedKeys={...k},!C.isActive&&E===null||!A&&!C.prevProp||Rd(A)||typeof A=="boolean")continue;const P=CM(C.prevProp,A);let B=P||T===m&&C.isActive&&!D&&O||N>S&&O,z=!1;const J=Array.isArray(A)?A:[A];let V=J.reduce(c(T),{});E===!1&&(V={});const{prevResolvedValues:K={}}=C,fe={...K,...V},ee=H=>{B=!0,y.has(H)&&(z=!0,y.delete(H)),C.needsAnimating[H]=!0;const ne=t.getValue(H);ne&&(ne.liveStyle=!1)};for(const H in fe){const ne=V[H],he=K[H];if(k.hasOwnProperty(H))continue;let W=!1;Zp(ne)&&Zp(he)?W=!x_(ne,he):W=ne!==he,W?ne!=null?ee(H):y.add(H):ne!==void 0&&y.has(H)?ee(H):C.protectedKeys[H]=!0}C.prevProp=A,C.prevResolvedValues=V,C.isActive&&(k={...k,...V}),r&&t.blockInitialAnimation&&(B=!1),B&&(!(D&&P)||z)&&x.push(...J.map(H=>({animation:H,options:{type:T}})))}if(y.size){const N={};y.forEach(T=>{const C=t.getBaseTarget(T),A=t.getValue(T);A&&(A.liveStyle=!0),N[T]=C??null}),x.push({animation:N})}let j=!!x.length;return r&&(g.initial===!1||g.initial===g.animate)&&!t.manuallyAnimateOnMount&&(j=!1),r=!1,j?s(x):Promise.resolve()}function p(m,g){var v;if(o[m].isActive===g)return Promise.resolve();(v=t.variantChildren)===null||v===void 0||v.forEach(y=>{var k;return(k=y.animationState)===null||k===void 0?void 0:k.setActive(m,g)}),o[m].isActive=g;const x=u(m);for(const y in o)o[y].protectedKeys={};return x}return{animateChanges:u,setActive:p,setAnimateFunction:d,getState:()=>o,reset:()=>{o=tb(),r=!0}}}function CM(t,s){return typeof s=="string"?s!==t:Array.isArray(s)?!x_(s,t):!1}function bi(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function tb(){return{animate:bi(!0),whileInView:bi(),whileHover:bi(),whileTap:bi(),whileDrag:bi(),whileFocus:bi(),exit:bi()}}class Ya{constructor(s){this.isMounted=!1,this.node=s}update(){}}class EM extends Ya{constructor(s){super(s),s.animationState||(s.animationState=NM(s))}updateAnimationControlsSubscription(){const{animate:s}=this.node.getProps();Rd(s)&&(this.unmountControls=s.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:s}=this.node.getProps(),{animate:o}=this.node.prevProps||{};s!==o&&this.updateAnimationControlsSubscription()}unmount(){var s;this.node.animationState.reset(),(s=this.unmountControls)===null||s===void 0||s.call(this)}}let AM=0;class DM extends Ya{constructor(){super(...arguments),this.id=AM++}update(){if(!this.node.presenceContext)return;const{isPresent:s,onExitComplete:o}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||s===r)return;const c=this.node.animationState.setActive("exit",!s);o&&!s&&c.then(()=>o(this.id))}mount(){const{register:s}=this.node.presenceContext||{};s&&(this.unmount=s(this.id))}unmount(){}}const MM={animation:{Feature:EM},exit:{Feature:DM}},hs={x:!1,y:!1};function i1(){return hs.x||hs.y}function RM(t){return t==="x"||t==="y"?hs[t]?null:(hs[t]=!0,()=>{hs[t]=!1}):hs.x||hs.y?null:(hs.x=hs.y=!0,()=>{hs.x=hs.y=!1})}const rh=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function cl(t,s,o,r={passive:!0}){return t.addEventListener(s,o,r),()=>t.removeEventListener(s,o)}function yl(t){return{point:{x:t.pageX,y:t.pageY}}}const IM=t=>s=>rh(s)&&t(s,yl(s));function Wr(t,s,o,r){return cl(t,s,IM(o),r)}const nb=(t,s)=>Math.abs(t-s);function OM(t,s){const o=nb(t.x,s.x),r=nb(t.y,s.y);return Math.sqrt(o**2+r**2)}class o1{constructor(s,o,{transformPagePoint:r,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 x=_p(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,k=OM(x.offset,{x:0,y:0})>=3;if(!y&&!k)return;const{point:S}=x,{timestamp:j}=cn;this.history.push({...S,timestamp:j});const{onStart:N,onMove:T}=this.handlers;y||(N&&N(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),T&&T(this.lastMoveEvent,x)},this.handlePointerMove=(x,y)=>{this.lastMoveEvent=x,this.lastMoveEventInfo=xp(y,this.transformPagePoint),kt.update(this.updatePoint,!0)},this.handlePointerUp=(x,y)=>{this.end();const{onEnd:k,onSessionEnd:S,resumeAnimation:j}=this.handlers;if(this.dragSnapToOrigin&&j&&j(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const N=_p(x.type==="pointercancel"?this.lastMoveEventInfo:xp(y,this.transformPagePoint),this.history);this.startEvent&&k&&k(x,N),S&&S(x,N)},!rh(s))return;this.dragSnapToOrigin=d,this.handlers=o,this.transformPagePoint=r,this.contextWindow=c||window;const u=yl(s),p=xp(u,this.transformPagePoint),{point:m}=p,{timestamp:g}=cn;this.history=[{...m,timestamp:g}];const{onSessionStart:v}=o;v&&v(s,_p(p,this.history)),this.removeListeners=vl(Wr(this.contextWindow,"pointermove",this.handlePointerMove),Wr(this.contextWindow,"pointerup",this.handlePointerUp),Wr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(s){this.handlers=s}end(){this.removeListeners&&this.removeListeners(),Ga(this.updatePoint)}}function xp(t,s){return s?{point:s(t.point)}:t}function sb(t,s){return{x:t.x-s.x,y:t.y-s.y}}function _p({point:t},s){return{point:t,delta:sb(t,r1(s)),offset:sb(t,BM(s)),velocity:LM(s,.1)}}function BM(t){return t[0]}function r1(t){return t[t.length-1]}function LM(t,s){if(t.length<2)return{x:0,y:0};let o=t.length-1,r=null;const c=r1(t);for(;o>=0&&(r=t[o],!(c.timestamp-r.timestamp>ta(s)));)o--;if(!r)return{x:0,y:0};const d=na(c.timestamp-r.timestamp);if(d===0)return{x:0,y:0};const u={x:(c.x-r.x)/d,y:(c.y-r.y)/d};return u.x===1/0&&(u.x=0),u.y===1/0&&(u.y=0),u}const l1=1e-4,zM=1-l1,$M=1+l1,c1=.01,PM=0-c1,UM=0+c1;function Bn(t){return t.max-t.min}function HM(t,s,o){return Math.abs(t-s)<=o}function ab(t,s,o,r=.5){t.origin=r,t.originPoint=Ct(s.min,s.max,t.origin),t.scale=Bn(o)/Bn(s),t.translate=Ct(o.min,o.max,t.origin)-t.originPoint,(t.scale>=zM&&t.scale<=$M||isNaN(t.scale))&&(t.scale=1),(t.translate>=PM&&t.translate<=UM||isNaN(t.translate))&&(t.translate=0)}function Xr(t,s,o,r){ab(t.x,s.x,o.x,r?r.originX:void 0),ab(t.y,s.y,o.y,r?r.originY:void 0)}function ib(t,s,o){t.min=o.min+s.min,t.max=t.min+Bn(s)}function VM(t,s,o){ib(t.x,s.x,o.x),ib(t.y,s.y,o.y)}function ob(t,s,o){t.min=s.min-o.min,t.max=t.min+Bn(s)}function Qr(t,s,o){ob(t.x,s.x,o.x),ob(t.y,s.y,o.y)}function qM(t,{min:s,max:o},r){return s!==void 0&&t<s?t=r?Ct(s,t,r.min):Math.max(t,s):o!==void 0&&t>o&&(t=r?Ct(o,t,r.max):Math.min(t,o)),t}function rb(t,s,o){return{min:s!==void 0?t.min+s:void 0,max:o!==void 0?t.max+o-(t.max-t.min):void 0}}function GM(t,{top:s,left:o,bottom:r,right:c}){return{x:rb(t.x,o,c),y:rb(t.y,s,r)}}function lb(t,s){let o=s.min-t.min,r=s.max-t.max;return s.max-s.min<t.max-t.min&&([o,r]=[r,o]),{min:o,max:r}}function FM(t,s){return{x:lb(t.x,s.x),y:lb(t.y,s.y)}}function ZM(t,s){let o=.5;const r=Bn(t),c=Bn(s);return c>r?o=Bo(s.min,s.max-r,t.min):r>c&&(o=Bo(t.min,t.max-c,s.min)),ia(0,1,o)}function KM(t,s){const o={};return s.min!==void 0&&(o.min=s.min-t.min),s.max!==void 0&&(o.max=s.max-t.min),o}const am=.35;function YM(t=am){return t===!1?t=0:t===!0&&(t=am),{x:cb(t,"left","right"),y:cb(t,"top","bottom")}}function cb(t,s,o){return{min:db(t,s),max:db(t,o)}}function db(t,s){return typeof t=="number"?t:t[s]||0}const ub=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ao=()=>({x:ub(),y:ub()}),fb=()=>({min:0,max:0}),$t=()=>({x:fb(),y:fb()});function es(t){return[t("x"),t("y")]}function d1({top:t,left:s,right:o,bottom:r}){return{x:{min:s,max:o},y:{min:t,max:r}}}function JM({x:t,y:s}){return{top:s.min,right:t.max,bottom:s.max,left:t.min}}function WM(t,s){if(!s)return t;const o=s({x:t.left,y:t.top}),r=s({x:t.right,y:t.bottom});return{top:o.y,left:o.x,bottom:r.y,right:r.x}}function kp(t){return t===void 0||t===1}function im({scale:t,scaleX:s,scaleY:o}){return!kp(t)||!kp(s)||!kp(o)}function Si(t){return im(t)||u1(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function u1(t){return pb(t.x)||pb(t.y)}function pb(t){return t&&t!=="0%"}function hd(t,s,o){const r=t-o,c=s*r;return o+c}function mb(t,s,o,r,c){return c!==void 0&&(t=hd(t,c,r)),hd(t,o,r)+s}function om(t,s=0,o=1,r,c){t.min=mb(t.min,s,o,r,c),t.max=mb(t.max,s,o,r,c)}function f1(t,{x:s,y:o}){om(t.x,s.translate,s.scale,s.originPoint),om(t.y,o.translate,o.scale,o.originPoint)}const hb=.999999999999,gb=1.0000000000001;function XM(t,s,o,r=!1){const c=o.length;if(!c)return;s.x=s.y=1;let d,u;for(let p=0;p<c;p++){d=o[p],u=d.projectionDelta;const{visualElement:m}=d.options;m&&m.props.style&&m.props.style.display==="contents"||(r&&d.options.layoutScroll&&d.scroll&&d!==d.root&&Mo(t,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),u&&(s.x*=u.x.scale,s.y*=u.y.scale,f1(t,u)),r&&Si(d.latestValues)&&Mo(t,d.latestValues))}s.x<gb&&s.x>hb&&(s.x=1),s.y<gb&&s.y>hb&&(s.y=1)}function Do(t,s){t.min=t.min+s,t.max=t.max+s}function vb(t,s,o,r,c=.5){const d=Ct(t.min,t.max,c);om(t,s,o,d,r)}function Mo(t,s){vb(t.x,s.x,s.scaleX,s.scale,s.originX),vb(t.y,s.y,s.scaleY,s.scale,s.originY)}function p1(t,s){return d1(WM(t.getBoundingClientRect(),s))}function QM(t,s,o){const r=p1(t,o),{scroll:c}=s;return c&&(Do(r.x,c.offset.x),Do(r.y,c.offset.y)),r}const m1=({current:t})=>t?t.ownerDocument.defaultView:null,eR=new WeakMap;class tR{constructor(s){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=$t(),this.visualElement=s}start(s,{snapToCursor:o=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const c=v=>{const{dragSnapToOrigin:x}=this.getProps();x?this.pauseAnimation():this.stopAnimation(),o&&this.snapToCursor(yl(v).point)},d=(v,x)=>{const{drag:y,dragPropagation:k,onDragStart:S}=this.getProps();if(y&&!k&&(this.openDragLock&&this.openDragLock(),this.openDragLock=RM(y),!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),es(N=>{let T=this.getAxisMotionValue(N).get()||0;if(Es.test(T)){const{projection:C}=this.visualElement;if(C&&C.layout){const A=C.layout.layoutBox[N];A&&(T=Bn(A)*(parseFloat(T)/100))}}this.originPoint[N]=T}),S&&kt.postRender(()=>S(v,x)),Kp(this.visualElement,"transform");const{animationState:j}=this.visualElement;j&&j.setActive("whileDrag",!0)},u=(v,x)=>{const{dragPropagation:y,dragDirectionLock:k,onDirectionLock:S,onDrag:j}=this.getProps();if(!y&&!this.openDragLock)return;const{offset:N}=x;if(k&&this.currentDirection===null){this.currentDirection=nR(N),this.currentDirection!==null&&S&&S(this.currentDirection);return}this.updateAxis("x",x.point,N),this.updateAxis("y",x.point,N),this.visualElement.render(),j&&j(v,x)},p=(v,x)=>this.stop(v,x),m=()=>es(v=>{var x;return this.getAnimationState(v)==="paused"&&((x=this.getAxisMotionValue(v).animation)===null||x===void 0?void 0:x.play())}),{dragSnapToOrigin:g}=this.getProps();this.panSession=new o1(s,{onSessionStart:c,onStart:d,onMove:u,onSessionEnd:p,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,contextWindow:m1(this.visualElement)})}stop(s,o){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:c}=o;this.startAnimation(c);const{onDragEnd:d}=this.getProps();d&&kt.postRender(()=>d(s,o))}cancel(){this.isDragging=!1;const{projection:s,animationState:o}=this.visualElement;s&&(s.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),o&&o.setActive("whileDrag",!1)}updateAxis(s,o,r){const{drag:c}=this.getProps();if(!r||!Vc(s,c,this.currentDirection))return;const d=this.getAxisMotionValue(s);let u=this.originPoint[s]+r[s];this.constraints&&this.constraints[s]&&(u=qM(u,this.constraints[s],this.elastic[s])),d.set(u)}resolveConstraints(){var s;const{dragConstraints:o,dragElastic:r}=this.getProps(),c=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)===null||s===void 0?void 0:s.layout,d=this.constraints;o&&Co(o)?this.constraints||(this.constraints=this.resolveRefConstraints()):o&&c?this.constraints=GM(c.layoutBox,o):this.constraints=!1,this.elastic=YM(r),d!==this.constraints&&c&&this.constraints&&!this.hasMutatedConstraints&&es(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=KM(c.layoutBox[u],this.constraints[u]))})}resolveRefConstraints(){const{dragConstraints:s,onMeasureDragConstraints:o}=this.getProps();if(!s||!Co(s))return!1;const r=s.current,{projection:c}=this.visualElement;if(!c||!c.layout)return!1;const d=QM(r,c.root,this.visualElement.getTransformPagePoint());let u=FM(c.layout.layoutBox,d);if(o){const p=o(JM(u));this.hasMutatedConstraints=!!p,p&&(u=d1(p))}return u}startAnimation(s){const{drag:o,dragMomentum:r,dragElastic:c,dragTransition:d,dragSnapToOrigin:u,onDragTransitionEnd:p}=this.getProps(),m=this.constraints||{},g=es(v=>{if(!Vc(v,o,this.currentDirection))return;let x=m&&m[v]||{};u&&(x={min:0,max:0});const y=c?200:1e6,k=c?40:1e7,S={type:"inertia",velocity:r?s[v]:0,bounceStiffness:y,bounceDamping:k,timeConstant:750,restDelta:1,restSpeed:10,...d,...x};return this.startAxisValueAnimation(v,S)});return Promise.all(g).then(p)}startAxisValueAnimation(s,o){const r=this.getAxisMotionValue(s);return Kp(this.visualElement,s),r.start(oh(s,r,0,o,this.visualElement,!1))}stopAnimation(){es(s=>this.getAxisMotionValue(s).stop())}pauseAnimation(){es(s=>{var o;return(o=this.getAxisMotionValue(s).animation)===null||o===void 0?void 0:o.pause()})}getAnimationState(s){var o;return(o=this.getAxisMotionValue(s).animation)===null||o===void 0?void 0:o.state}getAxisMotionValue(s){const o=`_drag${s.toUpperCase()}`,r=this.visualElement.getProps(),c=r[o];return c||this.visualElement.getValue(s,(r.initial?r.initial[s]:void 0)||0)}snapToCursor(s){es(o=>{const{drag:r}=this.getProps();if(!Vc(o,r,this.currentDirection))return;const{projection:c}=this.visualElement,d=this.getAxisMotionValue(o);if(c&&c.layout){const{min:u,max:p}=c.layout.layoutBox[o];d.set(s[o]-Ct(u,p,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:s,dragConstraints:o}=this.getProps(),{projection:r}=this.visualElement;if(!Co(o)||!r||!this.constraints)return;this.stopAnimation();const c={x:0,y:0};es(u=>{const p=this.getAxisMotionValue(u);if(p&&this.constraints!==!1){const m=p.get();c[u]=ZM({min:m,max:m},this.constraints[u])}});const{transformTemplate:d}=this.visualElement.getProps();this.visualElement.current.style.transform=d?d({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),es(u=>{if(!Vc(u,s,null))return;const p=this.getAxisMotionValue(u),{min:m,max:g}=this.constraints[u];p.set(Ct(m,g,c[u]))})}addListeners(){if(!this.visualElement.current)return;eR.set(this.visualElement,this);const s=this.visualElement.current,o=Wr(s,"pointerdown",m=>{const{drag:g,dragListener:v=!0}=this.getProps();g&&v&&this.start(m)}),r=()=>{const{dragConstraints:m}=this.getProps();Co(m)&&m.current&&(this.constraints=this.resolveRefConstraints())},{projection:c}=this.visualElement,d=c.addEventListener("measure",r);c&&!c.layout&&(c.root&&c.root.updateScroll(),c.updateLayout()),kt.read(r);const u=cl(window,"resize",()=>this.scalePositionWithinConstraints()),p=c.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:g})=>{this.isDragging&&g&&(es(v=>{const x=this.getAxisMotionValue(v);x&&(this.originPoint[v]+=m[v].translate,x.set(x.get()+m[v].translate))}),this.visualElement.render())}));return()=>{u(),o(),d(),p&&p()}}getProps(){const s=this.visualElement.getProps(),{drag:o=!1,dragDirectionLock:r=!1,dragPropagation:c=!1,dragConstraints:d=!1,dragElastic:u=am,dragMomentum:p=!0}=s;return{...s,drag:o,dragDirectionLock:r,dragPropagation:c,dragConstraints:d,dragElastic:u,dragMomentum:p}}}function Vc(t,s,o){return(s===!0||s===t)&&(o===null||o===t)}function nR(t,s=10){let o=null;return Math.abs(t.y)>s?o="y":Math.abs(t.x)>s&&(o="x"),o}class sR extends Ya{constructor(s){super(s),this.removeGroupControls=In,this.removeListeners=In,this.controls=new tR(s)}mount(){const{dragControls:s}=this.node.getProps();s&&(this.removeGroupControls=s.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||In}unmount(){this.removeGroupControls(),this.removeListeners()}}const yb=t=>(s,o)=>{t&&kt.postRender(()=>t(s,o))};class aR extends Ya{constructor(){super(...arguments),this.removePointerDownListener=In}onPointerDown(s){this.session=new o1(s,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:m1(this.node)})}createPanHandlers(){const{onPanSessionStart:s,onPanStart:o,onPan:r,onPanEnd:c}=this.node.getProps();return{onSessionStart:yb(s),onStart:yb(o),onMove:r,onEnd:(d,u)=>{delete this.session,c&&kt.postRender(()=>c(d,u))}}}mount(){this.removePointerDownListener=Wr(this.node.current,"pointerdown",s=>this.onPointerDown(s))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const sd={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function bb(t,s){return s.max===s.min?0:t/(s.max-s.min)*100}const zr={correct:(t,s)=>{if(!s.target)return t;if(typeof t=="string")if(Ee.test(t))t=parseFloat(t);else return t;const o=bb(t,s.target.x),r=bb(t,s.target.y);return`${o}% ${r}%`}},iR={correct:(t,{treeScale:s,projectionDelta:o})=>{const r=t,c=Fa.parse(t);if(c.length>5)return r;const d=Fa.createTransformer(t),u=typeof c[0]!="number"?1:0,p=o.x.scale*s.x,m=o.y.scale*s.y;c[0+u]/=p,c[1+u]/=m;const g=Ct(p,m,.5);return typeof c[2+u]=="number"&&(c[2+u]/=g),typeof c[3+u]=="number"&&(c[3+u]/=g),d(c)}};class oR extends b.Component{componentDidMount(){const{visualElement:s,layoutGroup:o,switchLayoutGroup:r,layoutId:c}=this.props,{projection:d}=s;MD(rR),d&&(o.group&&o.group.add(d),r&&r.register&&c&&r.register(d),d.root.didUpdate(),d.addEventListener("animationComplete",()=>{this.safeToRemove()}),d.setOptions({...d.options,onExitComplete:()=>this.safeToRemove()})),sd.hasEverUpdated=!0}getSnapshotBeforeUpdate(s){const{layoutDependency:o,visualElement:r,drag:c,isPresent:d}=this.props,u=r.projection;return u&&(u.isPresent=d,c||s.layoutDependency!==o||o===void 0?u.willUpdate():this.safeToRemove(),s.isPresent!==d&&(d?u.promote():u.relegate()||kt.postRender(()=>{const p=u.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:s}=this.props.visualElement;s&&(s.root.didUpdate(),Om.postRender(()=>{!s.currentAnimation&&s.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:s,layoutGroup:o,switchLayoutGroup:r}=this.props,{projection:c}=s;c&&(c.scheduleCheckAfterUnmount(),o&&o.group&&o.group.remove(c),r&&r.deregister&&r.deregister(c))}safeToRemove(){const{safeToRemove:s}=this.props;s&&s()}render(){return null}}function h1(t){const[s,o]=Qx(),r=b.useContext(Cm);return i.jsx(oR,{...t,layoutGroup:r,switchLayoutGroup:b.useContext(r_),isPresent:s,safeToRemove:o})}const rR={borderRadius:{...zr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:zr,borderTopRightRadius:zr,borderBottomLeftRadius:zr,borderBottomRightRadius:zr,boxShadow:iR};function lR(t,s,o){const r=fn(t)?t:rl(t);return r.start(oh("",r,s,o)),r.animation}function cR(t){return t instanceof SVGElement&&t.tagName!=="svg"}const dR=(t,s)=>t.depth-s.depth;class uR{constructor(){this.children=[],this.isDirty=!1}add(s){Fm(this.children,s),this.isDirty=!0}remove(s){Zm(this.children,s),this.isDirty=!0}forEach(s){this.isDirty&&this.children.sort(dR),this.isDirty=!1,this.children.forEach(s)}}function fR(t,s){const o=As.now(),r=({timestamp:c})=>{const d=c-o;d>=s&&(Ga(r),t(d-s))};return kt.read(r,!0),()=>Ga(r)}const g1=["TopLeft","TopRight","BottomLeft","BottomRight"],pR=g1.length,xb=t=>typeof t=="string"?parseFloat(t):t,_b=t=>typeof t=="number"||Ee.test(t);function mR(t,s,o,r,c,d){c?(t.opacity=Ct(0,o.opacity!==void 0?o.opacity:1,hR(r)),t.opacityExit=Ct(s.opacity!==void 0?s.opacity:1,0,gR(r))):d&&(t.opacity=Ct(s.opacity!==void 0?s.opacity:1,o.opacity!==void 0?o.opacity:1,r));for(let u=0;u<pR;u++){const p=`border${g1[u]}Radius`;let m=kb(s,p),g=kb(o,p);if(m===void 0&&g===void 0)continue;m||(m=0),g||(g=0),m===0||g===0||_b(m)===_b(g)?(t[p]=Math.max(Ct(xb(m),xb(g),r),0),(Es.test(g)||Es.test(m))&&(t[p]+="%")):t[p]=g}(s.rotate||o.rotate)&&(t.rotate=Ct(s.rotate||0,o.rotate||0,r))}function kb(t,s){return t[s]!==void 0?t[s]:t.borderRadius}const hR=v1(0,.5,R_),gR=v1(.5,.95,In);function v1(t,s,o){return r=>r<t?0:r>s?1:o(Bo(t,s,r))}function Sb(t,s){t.min=s.min,t.max=s.max}function Jn(t,s){Sb(t.x,s.x),Sb(t.y,s.y)}function Tb(t,s){t.translate=s.translate,t.scale=s.scale,t.originPoint=s.originPoint,t.origin=s.origin}function jb(t,s,o,r,c){return t-=s,t=hd(t,1/o,r),c!==void 0&&(t=hd(t,1/c,r)),t}function vR(t,s=0,o=1,r=.5,c,d=t,u=t){if(Es.test(s)&&(s=parseFloat(s),s=Ct(u.min,u.max,s/100)-u.min),typeof s!="number")return;let p=Ct(d.min,d.max,r);t===d&&(p-=s),t.min=jb(t.min,s,o,p,c),t.max=jb(t.max,s,o,p,c)}function wb(t,s,[o,r,c],d,u){vR(t,s[o],s[r],s[c],s.scale,d,u)}const yR=["x","scaleX","originX"],bR=["y","scaleY","originY"];function Nb(t,s,o,r){wb(t.x,s,yR,o?o.x:void 0,r?r.x:void 0),wb(t.y,s,bR,o?o.y:void 0,r?r.y:void 0)}function Cb(t){return t.translate===0&&t.scale===1}function y1(t){return Cb(t.x)&&Cb(t.y)}function Eb(t,s){return t.min===s.min&&t.max===s.max}function xR(t,s){return Eb(t.x,s.x)&&Eb(t.y,s.y)}function Ab(t,s){return Math.round(t.min)===Math.round(s.min)&&Math.round(t.max)===Math.round(s.max)}function b1(t,s){return Ab(t.x,s.x)&&Ab(t.y,s.y)}function Db(t){return Bn(t.x)/Bn(t.y)}function Mb(t,s){return t.translate===s.translate&&t.scale===s.scale&&t.originPoint===s.originPoint}class _R{constructor(){this.members=[]}add(s){Fm(this.members,s),s.scheduleRender()}remove(s){if(Zm(this.members,s),s===this.prevLead&&(this.prevLead=void 0),s===this.lead){const o=this.members[this.members.length-1];o&&this.promote(o)}}relegate(s){const o=this.members.findIndex(c=>s===c);if(o===0)return!1;let r;for(let c=o;c>=0;c--){const d=this.members[c];if(d.isPresent!==!1){r=d;break}}return r?(this.promote(r),!0):!1}promote(s,o){const r=this.lead;if(s!==r&&(this.prevLead=r,this.lead=s,s.show(),r)){r.instance&&r.scheduleRender(),s.scheduleRender(),s.resumeFrom=r,o&&(s.resumeFrom.preserveOpacity=!0),r.snapshot&&(s.snapshot=r.snapshot,s.snapshot.latestValues=r.animationValues||r.latestValues),s.root&&s.root.isUpdating&&(s.isLayoutDirty=!0);const{crossfade:c}=s.options;c===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(s=>{const{options:o,resumingFrom:r}=s;o.onExitComplete&&o.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(s=>{s.instance&&s.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function kR(t,s,o){let r="";const c=t.x.translate/s.x,d=t.y.translate/s.y,u=(o==null?void 0:o.z)||0;if((c||d||u)&&(r=`translate3d(${c}px, ${d}px, ${u}px) `),(s.x!==1||s.y!==1)&&(r+=`scale(${1/s.x}, ${1/s.y}) `),o){const{transformPerspective:g,rotate:v,rotateX:x,rotateY:y,skewX:k,skewY:S}=o;g&&(r=`perspective(${g}px) ${r}`),v&&(r+=`rotate(${v}deg) `),x&&(r+=`rotateX(${x}deg) `),y&&(r+=`rotateY(${y}deg) `),k&&(r+=`skewX(${k}deg) `),S&&(r+=`skewY(${S}deg) `)}const p=t.x.scale*s.x,m=t.y.scale*s.y;return(p!==1||m!==1)&&(r+=`scale(${p}, ${m})`),r||"none"}const Ti={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Fr=typeof window<"u"&&window.MotionDebug!==void 0,Sp=["","X","Y","Z"],SR={visibility:"hidden"},Rb=1e3;let TR=0;function Tp(t,s,o,r){const{latestValues:c}=s;c[t]&&(o[t]=c[t],s.setStaticValue(t,0),r&&(r[t]=0))}function x1(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:s}=t.options;if(!s)return;const o=S_(s);if(window.MotionHasOptimisedAnimation(o,"transform")){const{layout:c,layoutId:d}=t.options;window.MotionCancelOptimisedAnimation(o,"transform",kt,!(c||d))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&x1(r)}function _1({attachResizeListener:t,defaultParent:s,measureScroll:o,checkIsScrollRoot:r,resetTransform:c}){return class{constructor(u={},p=s==null?void 0:s()){this.id=TR++,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,Fr&&(Ti.totalNodes=Ti.resolvedTargetDeltas=Ti.recalculatedProjection=0),this.nodes.forEach(NR),this.nodes.forEach(MR),this.nodes.forEach(RR),this.nodes.forEach(CR),Fr&&window.MotionDebug.record(Ti)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=u,this.root=p?p.root||p:this,this.path=p?[...p.path,p]:[],this.parent=p,this.depth=p?p.depth+1:0;for(let m=0;m<this.path.length;m++)this.path[m].shouldResetTransform=!0;this.root===this&&(this.nodes=new uR)}addEventListener(u,p){return this.eventHandlers.has(u)||this.eventHandlers.set(u,new Km),this.eventHandlers.get(u).add(p)}notifyListeners(u,...p){const m=this.eventHandlers.get(u);m&&m.notify(...p)}hasListeners(u){return this.eventHandlers.has(u)}mount(u,p=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=cR(u),this.instance=u;const{layoutId:m,layout:g,visualElement:v}=this.options;if(v&&!v.current&&v.mount(u),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),p&&(g||m)&&(this.isLayoutDirty=!0),t){let x;const y=()=>this.root.updateBlockedByResize=!1;t(u,()=>{this.root.updateBlockedByResize=!0,x&&x(),x=fR(y,250),sd.hasAnimatedSinceResize&&(sd.hasAnimatedSinceResize=!1,this.nodes.forEach(Ob))})}m&&this.root.registerSharedNode(m,this),this.options.animate!==!1&&v&&(m||g)&&this.addEventListener("didUpdate",({delta:x,hasLayoutChanged:y,hasRelativeTargetChanged:k,layout:S})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const j=this.options.transition||v.getDefaultTransition()||zR,{onLayoutAnimationStart:N,onLayoutAnimationComplete:T}=v.getProps(),C=!this.targetLayout||!b1(this.targetLayout,S)||k,A=!y&&k;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||A||y&&(C||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(x,A);const O={...Gm(j,"layout"),onPlay:N,onComplete:T};(v.shouldReduceMotion||this.options.layoutRoot)&&(O.delay=0,O.type=!1),this.startAnimation(O)}else y||Ob(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=S})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const u=this.getStack();u&&u.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Ga(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(IR),this.animationId++)}getTransformTemplate(){const{visualElement:u}=this.options;return u&&u.getProps().transformTemplate}willUpdate(u=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&x1(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let v=0;v<this.path.length;v++){const x=this.path[v];x.shouldResetTransform=!0,x.updateScroll("snapshot"),x.options.layoutRoot&&x.willUpdate(!1)}const{layoutId:p,layout:m}=this.options;if(p===void 0&&!m)return;const g=this.getTransformTemplate();this.prevTransformTemplateValue=g?g(this.latestValues,""):void 0,this.updateSnapshot(),u&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Ib);return}this.isUpdating||this.nodes.forEach(AR),this.isUpdating=!1,this.nodes.forEach(DR),this.nodes.forEach(jR),this.nodes.forEach(wR),this.clearAllSnapshots();const p=As.now();cn.delta=ia(0,1e3/60,p-cn.timestamp),cn.timestamp=p,cn.isProcessing=!0,hp.update.process(cn),hp.preRender.process(cn),hp.render.process(cn),cn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Om.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ER),this.sharedNodes.forEach(OR)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,kt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){kt.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 m=0;m<this.path.length;m++)this.path[m].updateScroll();const u=this.layout;this.layout=this.measure(!1),this.layoutCorrected=$t(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:p}=this.options;p&&p.notify("LayoutMeasure",this.layout.layoutBox,u?u.layoutBox:void 0)}updateScroll(u="measure"){let p=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===u&&(p=!1),p){const m=r(this.instance);this.scroll={animationId:this.root.animationId,phase:u,isRoot:m,offset:o(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!c)return;const u=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,p=this.projectionDelta&&!y1(this.projectionDelta),m=this.getTransformTemplate(),g=m?m(this.latestValues,""):void 0,v=g!==this.prevTransformTemplateValue;u&&(p||Si(this.latestValues)||v)&&(c(this.instance,g),this.shouldResetTransform=!1,this.scheduleRender())}measure(u=!0){const p=this.measurePageBox();let m=this.removeElementScroll(p);return u&&(m=this.removeTransform(m)),$R(m),{animationId:this.root.animationId,measuredBox:p,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:p}=this.options;if(!p)return $t();const m=p.measureViewportBox();if(!(((u=this.scroll)===null||u===void 0?void 0:u.wasRoot)||this.path.some(PR))){const{scroll:v}=this.root;v&&(Do(m.x,v.offset.x),Do(m.y,v.offset.y))}return m}removeElementScroll(u){var p;const m=$t();if(Jn(m,u),!((p=this.scroll)===null||p===void 0)&&p.wasRoot)return m;for(let g=0;g<this.path.length;g++){const v=this.path[g],{scroll:x,options:y}=v;v!==this.root&&x&&y.layoutScroll&&(x.wasRoot&&Jn(m,u),Do(m.x,x.offset.x),Do(m.y,x.offset.y))}return m}applyTransform(u,p=!1){const m=$t();Jn(m,u);for(let g=0;g<this.path.length;g++){const v=this.path[g];!p&&v.options.layoutScroll&&v.scroll&&v!==v.root&&Mo(m,{x:-v.scroll.offset.x,y:-v.scroll.offset.y}),Si(v.latestValues)&&Mo(m,v.latestValues)}return Si(this.latestValues)&&Mo(m,this.latestValues),m}removeTransform(u){const p=$t();Jn(p,u);for(let m=0;m<this.path.length;m++){const g=this.path[m];if(!g.instance||!Si(g.latestValues))continue;im(g.latestValues)&&g.updateSnapshot();const v=$t(),x=g.measurePageBox();Jn(v,x),Nb(p,g.latestValues,g.snapshot?g.snapshot.layoutBox:void 0,v)}return Si(this.latestValues)&&Nb(p,this.latestValues),p}setTargetDelta(u){this.targetDelta=u,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(u){this.options={...this.options,...u,crossfade:u.crossfade!==void 0?u.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!==cn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(u=!1){var p;const m=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=m.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=m.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=m.isSharedProjectionDirty);const g=!!this.resumingFrom||this!==m;if(!(u||g&&this.isSharedProjectionDirty||this.isProjectionDirty||!((p=this.parent)===null||p===void 0)&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:x,layoutId:y}=this.options;if(!(!this.layout||!(x||y))){if(this.resolvedRelativeTargetAt=cn.timestamp,!this.targetDelta&&!this.relativeTarget){const k=this.getClosestProjectingParent();k&&k.layout&&this.animationProgress!==1?(this.relativeParent=k,this.forceRelativeParentToResolveTarget(),this.relativeTarget=$t(),this.relativeTargetOrigin=$t(),Qr(this.relativeTargetOrigin,this.layout.layoutBox,k.layout.layoutBox),Jn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=$t(),this.targetWithTransforms=$t()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),VM(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Jn(this.target,this.layout.layoutBox),f1(this.target,this.targetDelta)):Jn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const k=this.getClosestProjectingParent();k&&!!k.resumingFrom==!!this.resumingFrom&&!k.options.layoutScroll&&k.target&&this.animationProgress!==1?(this.relativeParent=k,this.forceRelativeParentToResolveTarget(),this.relativeTarget=$t(),this.relativeTargetOrigin=$t(),Qr(this.relativeTargetOrigin,this.target,k.target),Jn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Fr&&Ti.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||im(this.parent.latestValues)||u1(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 u;const p=this.getLead(),m=!!this.resumingFrom||this!==p;let g=!0;if((this.isProjectionDirty||!((u=this.parent)===null||u===void 0)&&u.isProjectionDirty)&&(g=!1),m&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(g=!1),this.resolvedRelativeTargetAt===cn.timestamp&&(g=!1),g)return;const{layout:v,layoutId:x}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(v||x))return;Jn(this.layoutCorrected,this.layout.layoutBox);const y=this.treeScale.x,k=this.treeScale.y;XM(this.layoutCorrected,this.treeScale,this.path,m),p.layout&&!p.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(p.target=p.layout.layoutBox,p.targetWithTransforms=$t());const{target:S}=p;if(!S){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Tb(this.prevProjectionDelta.x,this.projectionDelta.x),Tb(this.prevProjectionDelta.y,this.projectionDelta.y)),Xr(this.projectionDelta,this.layoutCorrected,S,this.latestValues),(this.treeScale.x!==y||this.treeScale.y!==k||!Mb(this.projectionDelta.x,this.prevProjectionDelta.x)||!Mb(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",S)),Fr&&Ti.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(u=!0){var p;if((p=this.options.visualElement)===null||p===void 0||p.scheduleRender(),u){const m=this.getStack();m&&m.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ao(),this.projectionDelta=Ao(),this.projectionDeltaWithTransform=Ao()}setAnimationOrigin(u,p=!1){const m=this.snapshot,g=m?m.latestValues:{},v={...this.latestValues},x=Ao();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const y=$t(),k=m?m.source:void 0,S=this.layout?this.layout.source:void 0,j=k!==S,N=this.getStack(),T=!N||N.members.length<=1,C=!!(j&&!T&&this.options.crossfade===!0&&!this.path.some(LR));this.animationProgress=0;let A;this.mixTargetDelta=O=>{const E=O/1e3;Bb(x.x,u.x,E),Bb(x.y,u.y,E),this.setTargetDelta(x),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Qr(y,this.layout.layoutBox,this.relativeParent.layout.layoutBox),BR(this.relativeTarget,this.relativeTargetOrigin,y,E),A&&xR(this.relativeTarget,A)&&(this.isProjectionDirty=!1),A||(A=$t()),Jn(A,this.relativeTarget)),j&&(this.animationValues=v,mR(v,g,this.latestValues,E,C,T)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=E},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(u){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Ga(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=kt.update(()=>{sd.hasAnimatedSinceResize=!0,this.currentAnimation=lR(0,Rb,{...u,onUpdate:p=>{this.mixTargetDelta(p),u.onUpdate&&u.onUpdate(p)},onComplete:()=>{u.onComplete&&u.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 u=this.getStack();u&&u.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Rb),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const u=this.getLead();let{targetWithTransforms:p,target:m,layout:g,latestValues:v}=u;if(!(!p||!m||!g)){if(this!==u&&this.layout&&g&&k1(this.options.animationType,this.layout.layoutBox,g.layoutBox)){m=this.target||$t();const x=Bn(this.layout.layoutBox.x);m.x.min=u.target.x.min,m.x.max=m.x.min+x;const y=Bn(this.layout.layoutBox.y);m.y.min=u.target.y.min,m.y.max=m.y.min+y}Jn(p,m),Mo(p,v),Xr(this.projectionDeltaWithTransform,this.layoutCorrected,p,v)}}registerSharedNode(u,p){this.sharedNodes.has(u)||this.sharedNodes.set(u,new _R),this.sharedNodes.get(u).add(p);const g=p.options.initialPromotionConfig;p.promote({transition:g?g.transition:void 0,preserveFollowOpacity:g&&g.shouldPreserveFollowOpacity?g.shouldPreserveFollowOpacity(p):void 0})}isLead(){const u=this.getStack();return u?u.lead===this:!0}getLead(){var u;const{layoutId:p}=this.options;return p?((u=this.getStack())===null||u===void 0?void 0:u.lead)||this:this}getPrevLead(){var u;const{layoutId:p}=this.options;return p?(u=this.getStack())===null||u===void 0?void 0:u.prevLead:void 0}getStack(){const{layoutId:u}=this.options;if(u)return this.root.sharedNodes.get(u)}promote({needsReset:u,transition:p,preserveFollowOpacity:m}={}){const g=this.getStack();g&&g.promote(this,m),u&&(this.projectionDelta=void 0,this.needsReset=!0),p&&this.setOptions({transition:p})}relegate(){const u=this.getStack();return u?u.relegate(this):!1}resetSkewAndRotation(){const{visualElement:u}=this.options;if(!u)return;let p=!1;const{latestValues:m}=u;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(p=!0),!p)return;const g={};m.z&&Tp("z",u,g,this.animationValues);for(let v=0;v<Sp.length;v++)Tp(`rotate${Sp[v]}`,u,g,this.animationValues),Tp(`skew${Sp[v]}`,u,g,this.animationValues);u.render();for(const v in g)u.setStaticValue(v,g[v]),this.animationValues&&(this.animationValues[v]=g[v]);u.scheduleRender()}getProjectionStyles(u){var p,m;if(!this.instance||this.isSVG)return;if(!this.isVisible)return SR;const g={visibility:""},v=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,g.opacity="",g.pointerEvents=td(u==null?void 0:u.pointerEvents)||"",g.transform=v?v(this.latestValues,""):"none",g;const x=this.getLead();if(!this.projectionDelta||!this.layout||!x.target){const j={};return this.options.layoutId&&(j.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,j.pointerEvents=td(u==null?void 0:u.pointerEvents)||""),this.hasProjected&&!Si(this.latestValues)&&(j.transform=v?v({},""):"none",this.hasProjected=!1),j}const y=x.animationValues||x.latestValues;this.applyTransformsToTarget(),g.transform=kR(this.projectionDeltaWithTransform,this.treeScale,y),v&&(g.transform=v(y,g.transform));const{x:k,y:S}=this.projectionDelta;g.transformOrigin=`${k.origin*100}% ${S.origin*100}% 0`,x.animationValues?g.opacity=x===this?(m=(p=y.opacity)!==null&&p!==void 0?p:this.latestValues.opacity)!==null&&m!==void 0?m:1:this.preserveOpacity?this.latestValues.opacity:y.opacityExit:g.opacity=x===this?y.opacity!==void 0?y.opacity:"":y.opacityExit!==void 0?y.opacityExit:0;for(const j in dd){if(y[j]===void 0)continue;const{correct:N,applyTo:T}=dd[j],C=g.transform==="none"?y[j]:N(y[j],x);if(T){const A=T.length;for(let O=0;O<A;O++)g[T[O]]=C}else g[j]=C}return this.options.layoutId&&(g.pointerEvents=x===this?td(u==null?void 0:u.pointerEvents)||"":"none"),g}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(u=>{var p;return(p=u.currentAnimation)===null||p===void 0?void 0:p.stop()}),this.root.nodes.forEach(Ib),this.root.sharedNodes.clear()}}}function jR(t){t.updateLayout()}function wR(t){var s;const o=((s=t.resumeFrom)===null||s===void 0?void 0:s.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&o&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:c}=t.layout,{animationType:d}=t.options,u=o.source!==t.layout.source;d==="size"?es(x=>{const y=u?o.measuredBox[x]:o.layoutBox[x],k=Bn(y);y.min=r[x].min,y.max=y.min+k}):k1(d,o.layoutBox,r)&&es(x=>{const y=u?o.measuredBox[x]:o.layoutBox[x],k=Bn(r[x]);y.max=y.min+k,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[x].max=t.relativeTarget[x].min+k)});const p=Ao();Xr(p,r,o.layoutBox);const m=Ao();u?Xr(m,t.applyTransform(c,!0),o.measuredBox):Xr(m,r,o.layoutBox);const g=!y1(p);let v=!1;if(!t.resumeFrom){const x=t.getClosestProjectingParent();if(x&&!x.resumeFrom){const{snapshot:y,layout:k}=x;if(y&&k){const S=$t();Qr(S,o.layoutBox,y.layoutBox);const j=$t();Qr(j,r,k.layoutBox),b1(S,j)||(v=!0),x.options.layoutRoot&&(t.relativeTarget=j,t.relativeTargetOrigin=S,t.relativeParent=x)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:o,delta:m,layoutDelta:p,hasLayoutChanged:g,hasRelativeTargetChanged:v})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function NR(t){Fr&&Ti.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function CR(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ER(t){t.clearSnapshot()}function Ib(t){t.clearMeasurements()}function AR(t){t.isLayoutDirty=!1}function DR(t){const{visualElement:s}=t.options;s&&s.getProps().onBeforeLayoutMeasure&&s.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ob(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function MR(t){t.resolveTargetDelta()}function RR(t){t.calcProjection()}function IR(t){t.resetSkewAndRotation()}function OR(t){t.removeLeadSnapshot()}function Bb(t,s,o){t.translate=Ct(s.translate,0,o),t.scale=Ct(s.scale,1,o),t.origin=s.origin,t.originPoint=s.originPoint}function Lb(t,s,o,r){t.min=Ct(s.min,o.min,r),t.max=Ct(s.max,o.max,r)}function BR(t,s,o,r){Lb(t.x,s.x,o.x,r),Lb(t.y,s.y,o.y,r)}function LR(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const zR={duration:.45,ease:[.4,0,.1,1]},zb=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),$b=zb("applewebkit/")&&!zb("chrome/")?Math.round:In;function Pb(t){t.min=$b(t.min),t.max=$b(t.max)}function $R(t){Pb(t.x),Pb(t.y)}function k1(t,s,o){return t==="position"||t==="preserve-aspect"&&!HM(Db(s),Db(o),.2)}function PR(t){var s;return t!==t.root&&((s=t.scroll)===null||s===void 0?void 0:s.wasRoot)}const UR=_1({attachResizeListener:(t,s)=>cl(t,"resize",s),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),jp={current:void 0},S1=_1({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!jp.current){const t=new UR({});t.mount(window),t.setOptions({layoutScroll:!0}),jp.current=t}return jp.current},resetTransform:(t,s)=>{t.style.transform=s!==void 0?s:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),HR={pan:{Feature:aR},drag:{Feature:sR,ProjectionNode:S1,MeasureLayout:h1}};function VR(t,s,o){var r;if(t instanceof Element)return[t];if(typeof t=="string"){let c=document;const d=(r=void 0)!==null&&r!==void 0?r:c.querySelectorAll(t);return d?Array.from(d):[]}return Array.from(t)}function T1(t,s){const o=VR(t),r=new AbortController,c={passive:!0,...s,signal:r.signal};return[o,c,()=>r.abort()]}function Ub(t){return s=>{s.pointerType==="touch"||i1()||t(s)}}function qR(t,s,o={}){const[r,c,d]=T1(t,o),u=Ub(p=>{const{target:m}=p,g=s(p);if(typeof g!="function"||!m)return;const v=Ub(x=>{g(x),m.removeEventListener("pointerleave",v)});m.addEventListener("pointerleave",v,c)});return r.forEach(p=>{p.addEventListener("pointerenter",u,c)}),d}function Hb(t,s,o){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",o==="Start");const c="onHover"+o,d=r[c];d&&kt.postRender(()=>d(s,yl(s)))}class GR extends Ya{mount(){const{current:s}=this.node;s&&(this.unmount=qR(s,o=>(Hb(this.node,o,"Start"),r=>Hb(this.node,r,"End"))))}unmount(){}}class FR extends Ya{constructor(){super(...arguments),this.isActive=!1}onFocus(){let s=!1;try{s=this.node.current.matches(":focus-visible")}catch{s=!0}!s||!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=vl(cl(this.node.current,"focus",()=>this.onFocus()),cl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const j1=(t,s)=>s?t===s?!0:j1(t,s.parentElement):!1,ZR=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function KR(t){return ZR.has(t.tagName)||t.tabIndex!==-1}const Zr=new WeakSet;function Vb(t){return s=>{s.key==="Enter"&&t(s)}}function wp(t,s){t.dispatchEvent(new PointerEvent("pointer"+s,{isPrimary:!0,bubbles:!0}))}const YR=(t,s)=>{const o=t.currentTarget;if(!o)return;const r=Vb(()=>{if(Zr.has(o))return;wp(o,"down");const c=Vb(()=>{wp(o,"up")}),d=()=>wp(o,"cancel");o.addEventListener("keyup",c,s),o.addEventListener("blur",d,s)});o.addEventListener("keydown",r,s),o.addEventListener("blur",()=>o.removeEventListener("keydown",r),s)};function qb(t){return rh(t)&&!i1()}function JR(t,s,o={}){const[r,c,d]=T1(t,o),u=p=>{const m=p.currentTarget;if(!qb(p)||Zr.has(m))return;Zr.add(m);const g=s(p),v=(k,S)=>{window.removeEventListener("pointerup",x),window.removeEventListener("pointercancel",y),!(!qb(k)||!Zr.has(m))&&(Zr.delete(m),typeof g=="function"&&g(k,{success:S}))},x=k=>{v(k,o.useGlobalTarget||j1(m,k.target))},y=k=>{v(k,!1)};window.addEventListener("pointerup",x,c),window.addEventListener("pointercancel",y,c)};return r.forEach(p=>{!KR(p)&&p.getAttribute("tabindex")===null&&(p.tabIndex=0),(o.useGlobalTarget?window:p).addEventListener("pointerdown",u,c),p.addEventListener("focus",g=>YR(g,c),c)}),d}function Gb(t,s,o){const{props:r}=t;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",o==="Start");const c="onTap"+(o==="End"?"":o),d=r[c];d&&kt.postRender(()=>d(s,yl(s)))}class WR extends Ya{mount(){const{current:s}=this.node;s&&(this.unmount=JR(s,o=>(Gb(this.node,o,"Start"),(r,{success:c})=>Gb(this.node,r,c?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const rm=new WeakMap,Np=new WeakMap,XR=t=>{const s=rm.get(t.target);s&&s(t)},QR=t=>{t.forEach(XR)};function e3({root:t,...s}){const o=t||document;Np.has(o)||Np.set(o,{});const r=Np.get(o),c=JSON.stringify(s);return r[c]||(r[c]=new IntersectionObserver(QR,{root:t,...s})),r[c]}function t3(t,s,o){const r=e3(s);return rm.set(t,o),r.observe(t),()=>{rm.delete(t),r.unobserve(t)}}const n3={some:0,all:1};class s3 extends Ya{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:s={}}=this.node.getProps(),{root:o,margin:r,amount:c="some",once:d}=s,u={root:o?o.current:void 0,rootMargin:r,threshold:typeof c=="number"?c:n3[c]},p=m=>{const{isIntersecting:g}=m;if(this.isInView===g||(this.isInView=g,d&&!g&&this.hasEnteredView))return;g&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",g);const{onViewportEnter:v,onViewportLeave:x}=this.node.getProps(),y=g?v:x;y&&y(m)};return t3(this.node.current,u,p)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:s,prevProps:o}=this.node;["amount","margin","root"].some(a3(s,o))&&this.startObserver()}unmount(){}}function a3({viewport:t={}},{viewport:s={}}={}){return o=>t[o]!==s[o]}const i3={inView:{Feature:s3},tap:{Feature:WR},focus:{Feature:FR},hover:{Feature:GR}},o3={layout:{ProjectionNode:S1,MeasureLayout:h1}},gd={current:null},lh={current:!1};function w1(){if(lh.current=!0,!!Dm)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),s=()=>gd.current=t.matches;t.addListener(s),s()}else gd.current=!1}const r3=[...Z_,un,Fa],l3=t=>r3.find(F_(t)),Fb=new WeakMap;function c3(t,s,o){for(const r in s){const c=s[r],d=o[r];if(fn(c))t.addValue(r,c);else if(fn(d))t.addValue(r,rl(c,{owner:t}));else if(d!==c)if(t.hasValue(r)){const u=t.getValue(r);u.liveStyle===!0?u.jump(c):u.hasAnimated||u.set(c)}else{const u=t.getStaticValue(r);t.addValue(r,rl(u!==void 0?u:c,{owner:t}))}}for(const r in o)s[r]===void 0&&t.removeValue(r);return s}const Zb=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class d3{scrapeMotionValuesFromProps(s,o,r){return{}}constructor({parent:s,props:o,presenceContext:r,reducedMotionConfig:c,blockInitialAnimation:d,visualState:u},p={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=sh,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 k=As.now();this.renderScheduledAt<k&&(this.renderScheduledAt=k,kt.render(this.render,!1,!0))};const{latestValues:m,renderState:g,onUpdate:v}=u;this.onUpdate=v,this.latestValues=m,this.baseTarget={...m},this.initialValues=o.initial?{...m}:{},this.renderState=g,this.parent=s,this.props=o,this.presenceContext=r,this.depth=s?s.depth+1:0,this.reducedMotionConfig=c,this.options=p,this.blockInitialAnimation=!!d,this.isControllingVariants=Id(o),this.isVariantNode=i_(o),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(s&&s.current);const{willChange:x,...y}=this.scrapeMotionValuesFromProps(o,{},this);for(const k in y){const S=y[k];m[k]!==void 0&&fn(S)&&S.set(m[k],!1)}}mount(s){this.current=s,Fb.set(s,this),this.projection&&!this.projection.instance&&this.projection.mount(s),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((o,r)=>this.bindToMotionValue(r,o)),lh.current||w1(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:gd.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Fb.delete(this.current),this.projection&&this.projection.unmount(),Ga(this.notifyUpdate),Ga(this.render),this.valueSubscriptions.forEach(s=>s()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const s in this.events)this.events[s].clear();for(const s in this.features){const o=this.features[s];o&&(o.unmount(),o.isMounted=!1)}this.current=null}bindToMotionValue(s,o){this.valueSubscriptions.has(s)&&this.valueSubscriptions.get(s)();const r=Oi.has(s),c=o.on("change",p=>{this.latestValues[s]=p,this.props.onUpdate&&kt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),d=o.on("renderRequest",this.scheduleRender);let u;window.MotionCheckAppearSync&&(u=window.MotionCheckAppearSync(this,s,o)),this.valueSubscriptions.set(s,()=>{c(),d(),u&&u(),o.owner&&o.stop()})}sortNodePosition(s){return!this.current||!this.sortInstanceNodePosition||this.type!==s.type?0:this.sortInstanceNodePosition(this.current,s.current)}updateFeatures(){let s="animation";for(s in Oo){const o=Oo[s];if(!o)continue;const{isEnabled:r,Feature:c}=o;if(!this.features[s]&&c&&r(this.props)&&(this.features[s]=new c(this)),this.features[s]){const d=this.features[s];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):$t()}getStaticValue(s){return this.latestValues[s]}setStaticValue(s,o){this.latestValues[s]=o}update(s,o){(s.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=s,this.prevPresenceContext=this.presenceContext,this.presenceContext=o;for(let r=0;r<Zb.length;r++){const c=Zb[r];this.propEventSubscriptions[c]&&(this.propEventSubscriptions[c](),delete this.propEventSubscriptions[c]);const d="on"+c,u=s[d];u&&(this.propEventSubscriptions[c]=this.on(c,u))}this.prevMotionValues=c3(this,this.scrapeMotionValuesFromProps(s,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(s){return this.props.variants?this.props.variants[s]: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(s){const o=this.getClosestVariantNode();if(o)return o.variantChildren&&o.variantChildren.add(s),()=>o.variantChildren.delete(s)}addValue(s,o){const r=this.values.get(s);o!==r&&(r&&this.removeValue(s),this.bindToMotionValue(s,o),this.values.set(s,o),this.latestValues[s]=o.get())}removeValue(s){this.values.delete(s);const o=this.valueSubscriptions.get(s);o&&(o(),this.valueSubscriptions.delete(s)),delete this.latestValues[s],this.removeValueFromRenderState(s,this.renderState)}hasValue(s){return this.values.has(s)}getValue(s,o){if(this.props.values&&this.props.values[s])return this.props.values[s];let r=this.values.get(s);return r===void 0&&o!==void 0&&(r=rl(o===null?void 0:o,{owner:this}),this.addValue(s,r)),r}readValue(s,o){var r;let c=this.latestValues[s]!==void 0||!this.current?this.latestValues[s]:(r=this.getBaseTargetFromProps(this.props,s))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,s,this.options);return c!=null&&(typeof c=="string"&&(q_(c)||O_(c))?c=parseFloat(c):!l3(c)&&Fa.test(o)&&(c=U_(s,o)),this.setBaseTarget(s,fn(c)?c.get():c)),fn(c)?c.get():c}setBaseTarget(s,o){this.baseTarget[s]=o}getBaseTarget(s){var o;const{initial:r}=this.props;let c;if(typeof r=="string"||typeof r=="object"){const u=Lm(this.props,r,(o=this.presenceContext)===null||o===void 0?void 0:o.custom);u&&(c=u[s])}if(r&&c!==void 0)return c;const d=this.getBaseTargetFromProps(this.props,s);return d!==void 0&&!fn(d)?d:this.initialValues[s]!==void 0&&c===void 0?void 0:this.baseTarget[s]}on(s,o){return this.events[s]||(this.events[s]=new Km),this.events[s].add(o)}notify(s,...o){this.events[s]&&this.events[s].notify(...o)}}class N1 extends d3{constructor(){super(...arguments),this.KeyframeResolver=K_}sortInstanceNodePosition(s,o){return s.compareDocumentPosition(o)&2?1:-1}getBaseTargetFromProps(s,o){return s.style?s.style[o]:void 0}removeValueFromRenderState(s,{vars:o,style:r}){delete o[s],delete r[s]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:s}=this.props;fn(s)&&(this.childSubscription=s.on("change",o=>{this.current&&(this.current.textContent=`${o}`)}))}}function u3(t){return window.getComputedStyle(t)}class f3 extends N1{constructor(){super(...arguments),this.type="html",this.renderInstance=m_}readValueFromInstance(s,o){if(Oi.has(o)){const r=nh(o);return r&&r.default||0}else{const r=u3(s),c=(u_(o)?r.getPropertyValue(o):r[o])||0;return typeof c=="string"?c.trim():c}}measureInstanceViewportBox(s,{transformPagePoint:o}){return p1(s,o)}build(s,o,r){Pm(s,o,r.transformTemplate)}scrapeMotionValuesFromProps(s,o,r){return qm(s,o,r)}}class p3 extends N1{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=$t}getBaseTargetFromProps(s,o){return s[o]}readValueFromInstance(s,o){if(Oi.has(o)){const r=nh(o);return r&&r.default||0}return o=h_.has(o)?o:Im(o),s.getAttribute(o)}scrapeMotionValuesFromProps(s,o,r){return y_(s,o,r)}build(s,o,r){Um(s,o,this.isSVGTag,r.transformTemplate)}renderInstance(s,o,r,c){g_(s,o,r,c)}mount(s){this.isSVGTag=Vm(s.tagName),super.mount(s)}}const m3=(t,s)=>Bm(t)?new p3(s):new f3(s,{allowProjection:t!==b.Fragment}),h3=UD({...MM,...i3,...HR,...o3},m3),Rt=nD(h3);function g3(){!lh.current&&w1();const[t]=b.useState(gd.current);return t}const v3="_overlay_cmicx_1",y3="_dialog_cmicx_11",b3="_title_cmicx_30",x3="_description_cmicx_38",_3="_actions_cmicx_45",k3="_cancelButton_cmicx_52",S3="_confirmButton_cmicx_79",xi={overlay:v3,dialog:y3,title:b3,description:x3,actions:_3,cancelButton:k3,confirmButton:S3};function oa({isOpen:t,title:s,description:o,confirmLabel:r="Delete",onConfirm:c,onCancel:d}){const u=b.useId(),p=b.useId();return i.jsx(gs,{children:t&&i.jsx(Rt.div,{className:xi.overlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},onClick:d,onKeyDown:m=>{m.key==="Escape"&&d()},role:"dialog","aria-modal":"true","aria-labelledby":u,"aria-describedby":o?p:void 0,children:i.jsxs(Rt.div,{className:xi.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:m=>m.stopPropagation(),children:[i.jsx("h3",{id:u,className:xi.title,children:s}),o&&i.jsx("p",{id:p,className:xi.description,children:o}),i.jsxs("div",{className:xi.actions,children:[i.jsx("button",{type:"button",className:xi.cancelButton,onClick:d,autoFocus:!0,children:"Cancel"}),i.jsx("button",{type:"button",className:xi.confirmButton,onClick:c,children:r})]})]})})})}const T3="_skeleton_1gqp4_9",j3="_circular_1gqp4_17",w3="_textContainer_1gqp4_26",N3="_card_1gqp4_31",vd={skeleton:T3,circular:j3,textContainer:w3,card:N3};function Te({width:t="100%",height:s="1rem",borderRadius:o,variant:r="rectangular",className:c}){const d=[vd.skeleton,r==="circular"?vd.circular:"",c??""].filter(Boolean).join(" ");return i.jsx("div",{className:d,style:{width:t,height:s,...o&&r!=="circular"?{borderRadius:o}:{}},"aria-hidden":"true","data-testid":"skeleton"})}function lm({lines:t=3,lastLineWidth:s="60%",lineHeight:o="0.75rem",gap:r="var(--space-sm)",className:c}){return i.jsx("div",{className:`${vd.textContainer} ${c??""}`,style:{gap:r},"aria-hidden":"true","data-testid":"skeleton-text",children:Array.from({length:t},(d,u)=>i.jsx(Te,{width:u===t-1&&t>1?s:"100%",height:o},u))})}function yd({lines:t=2,className:s}){return i.jsxs("div",{className:`${vd.card} ${s??""}`,"aria-hidden":"true","data-testid":"skeleton-card",children:[i.jsx(Te,{width:"40%",height:"1.25rem"}),i.jsx(lm,{lines:t})]})}const C3="_spinner_1uyt1_1",E3="_spin_1uyt1_1",A3="_sm_1uyt1_14",D3="_md_1uyt1_20",M3="_lg_1uyt1_26",R3="_xl_1uyt1_32",Kb={spinner:C3,spin:E3,sm:A3,md:D3,lg:M3,xl:R3};function C1({size:t="md",className:s,label:o="Loading",liveRegion:r=!1}){return i.jsx("span",{className:`${Kb.spinner} ${Kb[t]} ${s??""}`,role:r?"status":void 0,"aria-label":o,"aria-hidden":r?void 0:!0})}const I3="_splash_1bn1g_1",O3="_logo_1bn1g_11",Yb={splash:I3,logo:O3};function E1(){return i.jsxs("div",{className:Yb.splash,"data-testid":"splash-screen",children:[i.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:Yb.logo}),i.jsx(C1,{size:"xl",label:"Loading Grackle",liveRegion:!0})]})}const B3="_wrapper_4e5yt_1",L3="_wrapperBlock_4e5yt_6",z3="_tooltip_4e5yt_11",$3="_visible_4e5yt_31",P3="_top_4e5yt_41",U3="_bottom_4e5yt_48",H3="_left_4e5yt_55",V3="_right_4e5yt_62",$r={wrapper:B3,wrapperBlock:L3,tooltip:z3,visible:$3,top:P3,bottom:U3,left:H3,right:V3},q3=300,qc=6;function zo({text:t,placement:s="top",delayMs:o=q3,inline:r=!0,children:c,className:d,"data-testid":u}){const[p,m]=b.useState(!1),[g,v]=b.useState({top:0,left:0}),x=b.useRef(null),y=b.useRef(null),k=b.useRef(void 0),S=b.useId(),j=typeof document<"u",N=b.useCallback(()=>{if(!x.current||!y.current)return;const z=x.current.getBoundingClientRect(),J=y.current.getBoundingClientRect();let V=0,K=0;switch(s){case"top":V=z.top-J.height-qc,K=z.left+z.width/2-J.width/2;break;case"bottom":V=z.bottom+qc,K=z.left+z.width/2-J.width/2;break;case"left":V=z.top+z.height/2-J.height/2,K=z.left-J.width-qc;break;case"right":V=z.top+z.height/2-J.height/2,K=z.right+qc;break}v({top:V,left:K})},[s]),T=b.useCallback(z=>{k.current!==void 0&&clearTimeout(k.current),k.current=setTimeout(()=>{N(),m(!0),k.current=void 0},z)},[N]),C=b.useCallback(()=>{T(o)},[o,T]),A=b.useCallback(()=>{T(0)},[T]),O=b.useCallback(()=>{k.current!==void 0&&(clearTimeout(k.current),k.current=void 0),m(!1)},[]);b.useEffect(()=>{if(!p)return;const z=J=>{J.key==="Escape"&&O()};return document.addEventListener("keydown",z),window.addEventListener("scroll",N,!0),window.addEventListener("resize",N),()=>{document.removeEventListener("keydown",z),window.removeEventListener("scroll",N,!0),window.removeEventListener("resize",N)}},[p,O,N]),b.useEffect(()=>()=>{k.current!==void 0&&clearTimeout(k.current)},[]);const E=r?"span":"div",D=[r?$r.wrapper:$r.wrapperBlock,d].filter(Boolean).join(" ");let P=c;if(b.isValidElement(c)){const z=c,J=z.props["aria-describedby"],V=p?J?`${J} ${S}`:S:J;P=b.cloneElement(z,{"aria-describedby":V})}const B=i.jsx("div",{ref:y,id:S,role:"tooltip",className:`${$r.tooltip} ${$r[s]} ${p?$r.visible:""}`,style:{top:g.top,left:g.left},"data-testid":u??"tooltip",children:t});return i.jsxs(E,{ref:x,className:D,onMouseEnter:C,onMouseLeave:O,onFocus:A,onBlur:O,children:[P,j?ST.createPortal(B,document.body):null]})}const G3="_attemptSelector_ggigl_1",F3="_attemptLabel_ggigl_17",Z3="_attemptButton_ggigl_21",K3="_attemptActive_ggigl_38",Y3="_attemptStatus_ggigl_44",Pr={attemptSelector:G3,attemptLabel:F3,attemptButton:Z3,attemptActive:K3,attemptStatus:Y3};function J3({taskSessions:t,selectedSessionId:s,onSelect:o}){if(!(t.length<2))return i.jsxs("div",{className:Pr.attemptSelector,"data-testid":"attempt-selector",children:[i.jsx("span",{className:Pr.attemptLabel,children:"Attempts:"}),t.map((r,c)=>{const d=r.id===s,u=r.status==="stopped"&&r.endReason==="completed"?"✓":r.status==="stopped"?"✗":r.status==="running"||r.status==="idle"?"●":"";return i.jsxs("button",{className:`${Pr.attemptButton} ${d?Pr.attemptActive:""}`,onClick:()=>o(r.id),title:`Attempt #${c+1} — ${r.status}`,"aria-label":`Attempt #${c+1}, ${r.status}`,"aria-pressed":d,"data-testid":`attempt-${c+1}`,children:["#",c+1,u&&i.jsx("span",{className:Pr.attemptStatus,children:u})]},r.id)})]})}const W3="_row_ldkru_1",X3="_hoverActions_ldkru_5",Q3="_hoverButton_ldkru_31",e6="_selectingRow_ldkru_72",t6="_selected_ldkru_83",n6="_checkboxArea_ldkru_90",s6="_checkbox_ldkru_90",a6="_contentArea_ldkru_106",us={row:W3,hoverActions:X3,hoverButton:Q3,selectingRow:e6,selected:t6,checkboxArea:n6,checkbox:s6,contentArea:a6};function i6({copyText:t,isContentBearing:s,isSelecting:o,isSelected:r,checkboxLabel:c,onSelect:d,onToggle:u,onCopied:p,children:m}){const[g,v]=b.useState(!1),x=b.useRef(void 0);b.useEffect(()=>()=>{x.current!==void 0&&clearTimeout(x.current)},[]);const y=b.useCallback(async()=>{try{await navigator.clipboard.writeText(t),v(!0),p==null||p(),x.current!==void 0&&clearTimeout(x.current),x.current=setTimeout(()=>{v(!1)},2e3)}catch{}},[t,p]),k=b.useCallback(S=>{!o||S.target.closest("a, button, input, textarea, select, [role=button]")||(S.preventDefault(),u(S.shiftKey))},[o,u]);return s?o?i.jsxs("div",{className:`${us.row} ${us.selectingRow} ${r?us.selected:""}`,onClick:k,"data-testid":"event-selectable-row",children:[i.jsx("div",{className:us.checkboxArea,children:i.jsx("input",{type:"checkbox",checked:r,onChange:S=>{u(S.nativeEvent.shiftKey)},onClick:S=>{S.stopPropagation()},className:us.checkbox,"aria-label":c??"Select this event","data-testid":"event-select-checkbox"})}),i.jsx("div",{className:us.contentArea,children:m})]}):i.jsxs("div",{className:us.row,"data-testid":"event-hover-row",children:[i.jsxs("div",{className:us.hoverActions,"data-testid":"event-hover-actions",children:[i.jsx("button",{type:"button",className:us.hoverButton,onClick:()=>{y().catch(()=>{})},"aria-label":"Copy event content","data-testid":"event-hover-copy",children:g?i.jsx(Mi,{size:dt,"aria-hidden":"true"}):i.jsx(Nx,{size:dt,"aria-hidden":"true"})}),i.jsx("button",{type:"button",className:us.hoverButton,onClick:d,"aria-label":"Select this event","data-testid":"event-hover-select",children:i.jsx(hj,{size:dt,"aria-hidden":"true"})})]}),m]}):i.jsx("div",{className:us.row,children:m})}const o6="_bar_1vah7_1",r6="_left_1vah7_21",l6="_right_1vah7_27",c6="_count_1vah7_33",d6="_toggleButton_1vah7_40",u6="_copyButton_1vah7_68",f6="_cancelButton_1vah7_108",_i={bar:o6,left:r6,right:l6,count:c6,toggleButton:d6,copyButton:u6,cancelButton:f6};function p6({selectedCount:t,totalSelectable:s,onSelectAll:o,onDeselectAll:r,onCopy:c,onCancel:d}){const u=t>0&&t>=s;return i.jsxs(Rt.div,{className:_i.bar,initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:12},transition:{duration:.15},"data-testid":"floating-action-bar",children:[i.jsxs("div",{className:_i.left,children:[i.jsxs("span",{className:_i.count,"data-testid":"floating-bar-count",children:[t," selected"]}),i.jsx("button",{type:"button",className:_i.toggleButton,onClick:u?r:o,"data-testid":"floating-bar-select-all",children:u?"Deselect all":"Select all"})]}),i.jsxs("div",{className:_i.right,children:[i.jsxs("button",{type:"button",className:_i.copyButton,onClick:c,disabled:t===0,"data-testid":"floating-bar-copy",children:[i.jsx(D2,{size:dt,"aria-hidden":"true"}),"Copy"]}),i.jsx("button",{type:"button",className:_i.cancelButton,onClick:d,"aria-label":"Cancel selection","data-testid":"floating-bar-cancel",children:i.jsx(Za,{size:dt,"aria-hidden":"true"})})]})]})}const A1=50;function m6(t,s,o,r,c=A1){return r?t<c:s-t-o<c}function h6(t,s){const o=s-t;return o>0?o:0}function g6({scrollRef:t,contentLength:s,isReversed:o,paused:r}){const[c,d]=b.useState(!0),u=b.useRef(0),p=b.useRef(!1),m=b.useRef(0);b.useEffect(()=>{const v=t.current;if(!v)return;let x=!0;const y=()=>{m.current||(m.current=requestAnimationFrame(()=>{m.current=0;const k=m6(v.scrollTop,v.scrollHeight,v.clientHeight,o,A1);k!==x&&(x=k,d(k))}))};return v.addEventListener("scroll",y,{passive:!0}),()=>{v.removeEventListener("scroll",y),m.current&&(cancelAnimationFrame(m.current),m.current=0)}},[t,o]),b.useLayoutEffect(()=>{const v=t.current;!v||p.current||(p.current=!0,o?v.scrollTop=0:v.scrollTop=v.scrollHeight,d(!0))},[t,o]),b.useLayoutEffect(()=>{const v=t.current;if(v){if(r){u.current=v.scrollHeight;return}if(o&&!c){const x=h6(u.current,v.scrollHeight);x>0&&(v.scrollTop+=x)}c&&(o?v.scrollTo({top:0,behavior:"smooth"}):v.scrollTo({top:v.scrollHeight,behavior:"smooth"})),u.current=v.scrollHeight}},[s,c,o,r,t]);const g=b.useCallback(()=>{const v=t.current;if(!v)return;const x=o?0:v.scrollHeight;v.scrollTo({top:x,behavior:"smooth"}),d(!0)},[t,o]);return{isAtAnchor:c,scrollToAnchor:g}}const v6=new Set(["text","output","user_input","tool_use","tool_result","error"]);function dl(t){return v6.has(t.eventType)}function y6(t){var s;switch(t.eventType){case"tool_result":{if((s=t.toolUseCtx)!=null&&s.detailedResult)return t.toolUseCtx.detailedResult;let o=t.content;if(t.content.trimStart().startsWith("{"))try{const r=JSON.parse(t.content);typeof r.content=="string"&&(o=r.content)}catch{}return o}case"tool_use":try{const o=JSON.parse(t.content),r=o.tool??"tool",c=o.args!==void 0?JSON.stringify(o.args,void 0,2):"";return`${r}
|
|
274
|
-
${c}`}catch{return t.content}default:return t.content}}function Jb(t){if(t==null)return"";if(typeof t!="object")return String(t);const s=t;return typeof s.command=="string"?`\`${s.command}\``:typeof s.file_path=="string"||typeof s.filePath=="string"?`\`${s.file_path??s.filePath}\``:typeof s.path=="string"?`\`${s.path}\``:typeof s.query=="string"?`\`${s.query}\``:typeof s.pattern=="string"?`\`${s.pattern}\``:""}function b6(t){var o;const s=[];for(const r of t){if(!dl(r))continue;const c=new Date(r.timestamp).toLocaleTimeString();switch(r.eventType){case"text":case"output":{s.push(`**Assistant** (${c}):
|
|
275
|
-
${r.content}`);break}case"user_input":{s.push(`**User** (${c}):
|
|
276
|
-
${r.content}`);break}case"tool_result":{let d=((o=r.toolUseCtx)==null?void 0:o.detailedResult)??void 0;if(!d&&(d=r.content,r.content.trimStart().startsWith("{")))try{const u=JSON.parse(r.content);typeof u.content=="string"&&(d=u.content)}catch{}if(r.toolUseCtx){const u=Jb(r.toolUseCtx.args),p=u?`**Tool: ${r.toolUseCtx.tool}** ${u}`:`**Tool: ${r.toolUseCtx.tool}**`;s.push(`${p} (${c}):
|
|
277
|
-
${d}`)}else s.push(`**Tool output** (${c}):
|
|
278
|
-
${d}`);break}case"tool_use":{let d="tool",u;try{const g=JSON.parse(r.content);d=g.tool??"tool",u=g.args}catch{}const p=Jb(u),m=p?`**Tool: ${d}** ${p}`:`**Tool: ${d}**`;u!==void 0?s.push(`${m} (${c}):
|
|
279
|
-
\`\`\`json
|
|
280
|
-
${JSON.stringify(u,void 0,2)}
|
|
281
|
-
\`\`\``):s.push(`${m} (${c}):`);break}case"error":{s.push(`**Error** (${c}):
|
|
282
|
-
${r.content}`);break}}}return s.join(`
|
|
283
|
-
|
|
284
|
-
`)}function x6({events:t,formatForClipboard:s}){const[o,r]=b.useState(!1),[c,d]=b.useState(new Set),u=b.useRef(void 0),p=b.useMemo(()=>c.size,[c]),m=b.useCallback(S=>{r(!0),S!==void 0?(d(new Set([S])),u.current=S):(d(new Set),u.current=void 0)},[]),g=b.useCallback(()=>{r(!1),d(new Set),u.current=void 0},[]),v=b.useCallback((S,j)=>{if(j&&u.current!==void 0){const N=Math.min(u.current,S),T=Math.max(u.current,S);d(C=>{const A=new Set(C);for(let O=N;O<=T;O++)O<t.length&&dl(t[O])&&A.add(O);return A})}else d(N=>{const T=new Set(N);return T.has(S)?T.delete(S):T.add(S),T.size===0?(r(!1),u.current=void 0):u.current=S,T})},[t]),x=b.useCallback(()=>{const S=new Set;for(let j=0;j<t.length;j++)dl(t[j])&&S.add(j);d(S)},[t]),y=b.useCallback(()=>{d(new Set)},[]),k=b.useCallback(async()=>{const j=[...c].sort((T,C)=>T-C).filter(T=>T<t.length).map(T=>t[T]);if(j.length===0)return!1;const N=s(j);try{return await navigator.clipboard.writeText(N),!0}catch{return!1}},[c,t,s]);return{isSelecting:o,selectedIndices:c,selectedCount:p,enterSelectionMode:m,cancelSelection:g,toggleEvent:v,selectAll:x,deselectAll:y,copySelected:k}}const _6="_wrapper_1cdza_1",k6="_scrollContainer_1cdza_9",S6="_selectingPadding_1cdza_16",T6="_toolbar_1cdza_20",j6="_directionToggle_1cdza_27",w6="_scrollToAnchor_1cdza_65",N6="_scrollToAnchorBottom_1cdza_89",C6="_scrollToAnchorTop_1cdza_93",E6="_eventOverflowWarning_1cdza_97",ea={wrapper:_6,scrollContainer:k6,selectingPadding:S6,toolbar:T6,directionToggle:j6,scrollToAnchor:w6,scrollToAnchorBottom:N6,scrollToAnchorTop:C6,eventOverflowWarning:E6};function A6(t){const s=new Date(t.timestamp).toLocaleTimeString();switch(t.eventType){case"text":case"output":return`Select message from assistant at ${s}`;case"user_input":return`Select message from user at ${s}`;case"tool_result":case"tool_use":return`Select tool event at ${s}`;case"error":return`Select error at ${s}`;default:return`Select event at ${s}`}}const D1="grackle-stream-direction";function D6(){try{return localStorage.getItem(D1)==="reversed"}catch{return!1}}function M6({eventsDropped:t}){return t<=0?i.jsx(i.Fragment,{}):i.jsxs("div",{className:ea.eventOverflowWarning,role:"alert",children:[i.jsx(vm,{size:nn,"aria-hidden":"true"})," ",t.toLocaleString()," older event",t===1?"":"s"," were dropped — only the most recent 5,000 are shown. Full history is available in the session log."]})}function ch({events:t,eventsDropped:s,emptyState:o,onShowToast:r}){const c=b.useRef(null),[d,u]=b.useState(D6),p=g3(),m=x6({events:t,formatForClipboard:b6}),g=b.useMemo(()=>t.filter(dl).length,[t]),v=b.useMemo(()=>d?[...t].reverse():t,[t,d]),{isAtAnchor:x,scrollToAnchor:y}=g6({scrollRef:c,contentLength:t.length,isReversed:d,paused:m.isSelecting}),k=()=>{const T=!d;u(T);try{localStorage.setItem(D1,T?"reversed":"default")}catch{}};b.useEffect(()=>{if(!m.isSelecting)return;const T=C=>{C.key==="Escape"&&m.cancelSelection()};return window.addEventListener("keydown",T),()=>{window.removeEventListener("keydown",T)}},[m.isSelecting,m.cancelSelection]);const S=b.useCallback(async()=>{await m.copySelected()&&(r==null||r(`Copied ${m.selectedCount} message${m.selectedCount===1?"":"s"} to clipboard`,"success"))},[m,r]),j=p?0:.2,N=d?-8:8;return i.jsxs("div",{className:ea.wrapper,children:[i.jsx("div",{className:ea.toolbar,children:i.jsx(zo,{text:d?"Showing newest first":"Showing oldest first",children:i.jsx("button",{className:ea.directionToggle,onClick:k,"aria-label":d?"Switch to newest at bottom":"Switch to newest at top","data-testid":"direction-toggle",children:d?i.jsx(vy,{size:nn,"aria-hidden":"true"}):i.jsx(yy,{size:nn,"aria-hidden":"true"})})})}),i.jsxs("div",{ref:c,className:`${ea.scrollContainer} ${m.isSelecting?ea.selectingPadding:""}`,"data-testid":"event-stream-scroll",children:[t.length===0&&o,i.jsx(M6,{eventsDropped:s}),i.jsx(gs,{initial:!1,children:v.map((T,C)=>{const A=d?t.length-1-C:C;return i.jsx(Rt.div,{initial:{opacity:0,y:N},animate:{opacity:1,y:0},transition:{duration:j,ease:"easeOut"},children:i.jsx(i6,{copyText:y6(T),isContentBearing:dl(T),isSelecting:m.isSelecting,isSelected:m.selectedIndices.has(A),checkboxLabel:A6(T),onSelect:()=>{m.enterSelectionMode(A)},onToggle:O=>{m.toggleEvent(A,O)},onCopied:()=>{r==null||r("Copied to clipboard","success")},children:i.jsx(qA,{event:T,toolUseCtx:T.toolUseCtx,settled:T.settled})})},`${T.sessionId}-${T.timestamp}-${A}`)})})]}),i.jsx(gs,{children:m.isSelecting&&i.jsx(p6,{selectedCount:m.selectedCount,totalSelectable:g,onSelectAll:m.selectAll,onDeselectAll:m.deselectAll,onCopy:()=>{S().catch(()=>{})},onCancel:m.cancelSelection})}),i.jsx(gs,{children:!x&&i.jsxs(Rt.button,{className:`${ea.scrollToAnchor} ${d?ea.scrollToAnchorTop:ea.scrollToAnchorBottom}`,onClick:y,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:[d?i.jsx(yy,{size:nn,"aria-hidden":"true"}):i.jsx(vy,{size:nn,"aria-hidden":"true"})," New events"]})})]})}function dh(t){const{value:s,onSave:o,validate:r,fieldId:c,activeFieldId:d,onActivate:u,enterToSave:p=!0,trimOnSave:m=!0}=t,[g,v]=b.useState(""),[x,y]=b.useState(""),k=b.useRef(!1),S=d===c,j=b.useCallback(P=>{v(P),y("")},[]),N=b.useCallback(()=>{y("")},[]),T=b.useCallback(()=>{k.current=!1,u==null||u(null),v(""),y("")},[u]),C=b.useCallback(()=>{const P=m?g.trim():g;if(r){const z=r(g);if(z){y(z);return}}const B=m?s.trim():s;if(P===B){T();return}o(P),T()},[g,s,m,r,o,T]),A=b.useCallback(()=>{k.current=!0,u==null||u(c),v(s),y("")},[c,s,u]),O=b.useCallback(P=>{if(k.current){k.current=!1;return}P.relatedTarget instanceof HTMLElement&&P.relatedTarget.dataset.editAction===c||C()},[c,C]),E=b.useCallback(P=>{P.key==="Escape"?T():P.key==="Enter"&&p&&C()},[T,p,C]),D=(()=>{if(!S)return!1;const P=m?s.trim():s;return(m?g.trim():g)!==P})();return b.useEffect(()=>{!S&&(g!==""||x!=="")&&(v(""),y(""))},[S,g,x]),{isEditing:S,draft:g,error:x,isDirty:D,startEdit:A,cancelEdit:T,save:C,setDraft:j,clearError:N,handleBlur:O,handleKeyDown:E,ignoreInitialBlurRef:k}}const R6="_editFieldWrapper_yuzty_1",I6="_editInput_yuzty_10",O6="_editTextarea_yuzty_42",B6="_editSelect_yuzty_78",L6="_editError_yuzty_111",z6="_editInputInvalid_yuzty_118",$6="_editHint_yuzty_123",P6="_unsavedDot_yuzty_132",U6="_metaValueClickable_yuzty_140",H6="_editButton_yuzty_159",V6="_metaPlaceholder_yuzty_175",q6="_worktreeToggle_yuzty_180",st={editFieldWrapper:R6,editInput:I6,editTextarea:O6,editSelect:B6,editError:L6,editInputInvalid:z6,editHint:$6,unsavedDot:P6,metaValueClickable:U6,editButton:H6,metaPlaceholder:V6,worktreeToggle:q6};function Ft(t){const{value:s,onSave:o,validate:r,mode:c="edit",fieldId:d="text",activeFieldId:u,onActivate:p,onChange:m,renderDisplay:g,placeholder:v,maxLength:x,ariaLabel:y,"data-testid":k}=t,S=b.useRef(null),j=dh({value:s,onSave:o,validate:r,fieldId:d,activeFieldId:u,onActivate:p,enterToSave:!0,trimOnSave:!0});if(b.useEffect(()=>{if(j.isEditing){const T=window.setTimeout(()=>{var C;(C=S.current)==null||C.focus()},0);return()=>window.clearTimeout(T)}},[j.isEditing]),c==="create"){const T=A=>{m==null||m(A.target.value)},C=r==null?void 0:r(s);return i.jsxs("div",{className:st.editFieldWrapper,children:[i.jsx("input",{className:`${st.editInput} ${C?st.editInputInvalid:""}`,value:s,onChange:T,maxLength:x,placeholder:v,"aria-label":y,"data-testid":k?`${k}-input`:void 0}),C&&i.jsx("span",{className:st.editError,"data-testid":"edit-error",children:C})]})}if(j.isEditing)return i.jsxs("div",{className:st.editFieldWrapper,children:[i.jsx("input",{ref:S,className:`${st.editInput} ${j.error?st.editInputInvalid:""}`,value:j.draft,onChange:T=>j.setDraft(T.target.value),onBlur:j.handleBlur,onKeyDown:j.handleKeyDown,maxLength:x,placeholder:v,"aria-label":y,"data-testid":k?`${k}-input`:void 0}),j.isDirty&&i.jsx("span",{className:st.unsavedDot,title:"Unsaved changes"}),j.error&&i.jsx("span",{className:st.editError,"data-testid":"edit-error",children:j.error}),i.jsx("span",{className:st.editHint,children:"Enter to save · Esc to cancel"})]});const N=g==null?void 0:g(s);return i.jsxs("span",{role:"button",tabIndex:0,className:st.metaValueClickable,onClick:()=>j.startEdit(),onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),j.startEdit())},title:"Click to edit","aria-label":y,"data-testid":k?`${k}-button`:void 0,children:[N!==void 0?N:s?i.jsx("span",{children:s}):i.jsx("span",{className:st.metaPlaceholder,children:v||"None"}),i.jsx("span",{className:st.editButton,"aria-hidden":"true",children:"✏️"})]})}function cm(t){const{value:s,onSave:o,validate:r,mode:c="edit",fieldId:d="textarea",activeFieldId:u,onActivate:p,onChange:m,renderDisplay:g,placeholder:v,ariaLabel:x,"data-testid":y}=t,k=b.useRef(null),S=dh({value:s,onSave:o,validate:r,fieldId:d,activeFieldId:u,onActivate:p,enterToSave:!1,trimOnSave:!1});if(b.useEffect(()=>{if(S.isEditing){const N=window.setTimeout(()=>{var T;(T=k.current)==null||T.focus()},0);return()=>window.clearTimeout(N)}},[S.isEditing]),c==="create"){const N=C=>{m==null||m(C.target.value)},T=r==null?void 0:r(s);return i.jsxs("div",{className:st.editFieldWrapper,children:[i.jsx("textarea",{className:`${st.editTextarea} ${T?st.editInputInvalid:""}`,value:s,onChange:N,placeholder:v,"aria-label":x,"data-testid":y?`${y}-input`:void 0}),T&&i.jsx("span",{className:st.editError,"data-testid":"edit-error",children:T})]})}if(S.isEditing)return i.jsxs("div",{className:st.editFieldWrapper,children:[i.jsx("textarea",{ref:k,className:`${st.editTextarea} ${S.error?st.editInputInvalid:""}`,value:S.draft,onChange:N=>S.setDraft(N.target.value),onBlur:S.handleBlur,onKeyDown:S.handleKeyDown,title:x,"aria-label":x,"data-testid":y?`${y}-input`:void 0}),S.isDirty&&i.jsx("span",{className:st.unsavedDot,title:"Unsaved changes"}),S.error&&i.jsx("span",{className:st.editError,"data-testid":"edit-error",children:S.error}),i.jsx("span",{className:st.editHint,children:"Tab to save · Esc to cancel"})]});const j=g==null?void 0:g(s);return i.jsxs("span",{role:"button",tabIndex:0,className:st.metaValueClickable,onClick:()=>S.startEdit(),onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),S.startEdit())},title:"Click to edit","aria-label":x,"data-testid":y?`${y}-button`:void 0,children:[j!==void 0?j:s?i.jsx("span",{children:s}):i.jsx("span",{className:st.metaPlaceholder,children:v||"None"}),i.jsx("span",{className:st.editButton,"aria-hidden":"true",children:"✏️"})]})}function ul(t){var A;const{value:s,onSave:o,mode:r="edit",options:c,fieldId:d="select",activeFieldId:u,onActivate:p,onChange:m,renderDisplay:g,placeholder:v,ariaLabel:x,"data-testid":y}=t,k=b.useRef(null),S=dh({value:s,onSave:o,fieldId:d,activeFieldId:u,onActivate:p,enterToSave:!1,trimOnSave:!1});b.useEffect(()=>{if(S.isEditing){const O=window.setTimeout(()=>{var E;(E=k.current)==null||E.focus()},0);return()=>window.clearTimeout(O)}},[S.isEditing]);const j=b.useCallback(O=>{const E=O.target.value;S.ignoreInitialBlurRef.current=!1,E!==s&&o(E),S.cancelEdit()},[s,o,S]),N=b.useCallback(O=>{if(S.ignoreInitialBlurRef.current){S.ignoreInitialBlurRef.current=!1;return}O.relatedTarget instanceof HTMLElement&&O.relatedTarget.dataset.editAction===d||S.cancelEdit()},[d,S]);if(r==="create")return i.jsx("select",{className:st.editSelect,value:s,onChange:O=>m==null?void 0:m(O.target.value),"aria-label":x,"data-testid":y?`${y}-select`:void 0,children:c.map(O=>i.jsx("option",{value:O.value,children:O.label},O.value))});if(S.isEditing)return i.jsx("select",{ref:k,className:st.editSelect,value:S.draft,onChange:j,onBlur:N,title:x,"aria-label":x,"data-testid":y?`${y}-select`:void 0,children:c.map(O=>i.jsx("option",{value:O.value,children:O.label},O.value))});const T=g==null?void 0:g(s),C=(A=c.find(O=>O.value===s))==null?void 0:A.label;return i.jsxs("button",{type:"button",className:st.metaValueClickable,onClick:()=>S.startEdit(),title:"Click to change","aria-label":x,"data-testid":y?`${y}-button`:void 0,children:[T!==void 0?T:C?i.jsx("span",{children:C}):i.jsx("span",{className:st.metaPlaceholder,children:v||"None"}),i.jsx("span",{className:st.editButton,"aria-hidden":"true",children:"✏️"})]})}function G6(t){const{checked:s,onChange:o,label:r,ariaLabel:c,"data-testid":d}=t;return i.jsxs("label",{className:st.worktreeToggle,"data-testid":d,children:[i.jsx("input",{type:"checkbox",checked:s,onChange:u=>o(u.target.checked),"aria-label":c}),i.jsx("span",{children:r})]})}const F6="_nav_1snmp_1",Z6="_searchForm_1snmp_8",K6="_searchInput_1snmp_15",Y6="_searchButton_1snmp_33",J6="_clearButton_1snmp_68",W6="_workspaceSelect_1snmp_85",X6="_listHeader_1snmp_99",Q6="_nodeList_1snmp_108",e5="_nodeItem_1snmp_116",t5="_indicator_1snmp_129",n5="_label_1snmp_136",s5="_badge_1snmp_145",Wn={nav:F6,searchForm:Z6,searchInput:K6,searchButton:Y6,clearButton:J6,workspaceSelect:W6,listHeader:X6,nodeList:Q6,nodeItem:e5,indicator:t5,label:n5,badge:s5};function a5({nodes:t,workspaces:s,loading:o,searchQuery:r,onSearch:c,onClearSearch:d,onSelectNode:u,onWorkspaceChange:p}){const[m,g]=b.useState(""),v=b.useCallback(S=>{S.preventDefault(),m.trim()&&c(m.trim())},[m,c]),x=b.useCallback(()=>{g(""),d()},[d]),y=b.useCallback(S=>{u(S)},[u]),k=b.useCallback(S=>{g(""),p(S)},[p]);return i.jsxs("div",{className:Wn.nav,"data-testid":"knowledge-nav",children:[i.jsxs("form",{className:Wn.searchForm,onSubmit:v,children:[i.jsx("input",{className:Wn.searchInput,type:"text",placeholder:"Search...",value:m,onChange:S=>{g(S.target.value)},"data-testid":"knowledge-search-input","aria-label":"Search knowledge nodes"}),i.jsx("button",{type:"submit",className:Wn.searchButton,disabled:o,children:"Go"})]}),r&&i.jsx("button",{type:"button",className:Wn.clearButton,onClick:x,children:"Clear search"}),i.jsxs("select",{className:Wn.workspaceSelect,onChange:S=>{k(S.target.value)},"data-testid":"knowledge-workspace-filter","aria-label":"Filter by workspace",children:[i.jsx("option",{value:"",children:"All workspaces"}),s.map(S=>i.jsx("option",{value:S.id,children:S.name},S.id))]}),i.jsxs("div",{className:Wn.listHeader,children:["Nodes (",t.length,")"]}),i.jsx("ul",{className:Wn.nodeList,children:t.map(S=>i.jsxs("li",{className:Wn.nodeItem,onClick:()=>{y(S.id)},onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),y(S.id))},role:"button",tabIndex:0,children:[i.jsx("span",{className:Wn.indicator,style:{backgroundColor:S.kind==="reference"?"#4A9EFF":S.category==="decision"?"#22C55E":S.category==="concept"?"#A855F7":S.category==="snippet"?"#6B7280":"#EAB308"}}),i.jsx("span",{className:Wn.label,children:S.label}),i.jsx("span",{className:Wn.badge,children:S.kind==="reference"?S.sourceType:S.category})]},S.id))})]})}const i5="_container_1mq5u_1",o5="_hamburger_1mq5u_33",r5="_brand_1mq5u_49",l5="_brandLogo_1mq5u_68",c5="_info_1mq5u_75",d5="_connectionLabel_1mq5u_90",u5="_connectionDot_1mq5u_103",f5="_connected_1mq5u_106",p5="_disconnected_1mq5u_110",Xs={container:i5,hamburger:o5,brand:r5,brandLogo:l5,info:c5,connectionLabel:d5,connectionDot:u5,connected:f5,disconnected:p5};function m5({connected:t,environments:s,sessions:o,onToggleSidebar:r,sidebarOpen:c}){const d=mt(),u=s.length,p=s.filter(g=>g.status==="connected").length,m=o.filter(g=>["running","idle"].includes(g.status)).length;return i.jsxs("div",{className:Xs.container,children:[r&&i.jsx("button",{type:"button",className:Xs.hamburger,onClick:r,"aria-label":"Toggle sidebar","aria-expanded":c,children:i.jsx(X2,{size:Nt,"aria-hidden":"true"})}),i.jsx(zo,{text:"Home",placement:"bottom",children:i.jsxs("button",{type:"button",className:Xs.brand,onClick:()=>d(Di),"data-testid":"statusbar-brand",children:[i.jsx("img",{src:"/icon-192x192.png",alt:"",className:Xs.brandLogo,"aria-hidden":"true","data-testid":"statusbar-logo"}),"Grackle"]})}),i.jsxs("div",{className:Xs.info,children:[i.jsxs("span",{"aria-label":t?"Connected":"Disconnected",children:[i.jsx("span",{className:`${Xs.connectionDot} ${t?Xs.connected:Xs.disconnected}`,"aria-hidden":"true",children:i.jsx(Va,{size:ym,fill:"currentColor"})})," ",i.jsx("span",{className:Xs.connectionLabel,"aria-hidden":"true",children:t?"Connected":"Disconnected"})]}),i.jsxs("span",{children:[p,"/",u," env",u!==1?"s":""]}),i.jsxs("span",{children:[m," active"]})]})]})}const h5="_nav_13gkc_1",g5="_tab_13gkc_35",v5="_tabIcon_13gkc_68",y5="_tabLabel_13gkc_79",b5="_tabActive_13gkc_84",Ur={nav:h5,tab:g5,tabIcon:v5,tabLabel:y5,tabActive:b5},ad=[{view:"dashboard",label:"Dashboard",icon:i.jsx($2,{size:Nt}),route:Di,testId:"sidebar-tab-dashboard"},{view:"chat",label:"Chat",icon:i.jsx(ej,{size:Nt}),route:jN,testId:"sidebar-tab-chat"},{view:"tasks",label:"Tasks",icon:i.jsx(w2,{size:Nt}),route:wN,testId:"sidebar-tab-tasks"},{view:"environments",label:"Environments",icon:i.jsx(nj,{size:Nt}),route:Ro,testId:"sidebar-tab-environments"},{view:"knowledge",label:"Knowledge",icon:i.jsx(y2,{size:Nt}),route:Wx,testId:"sidebar-tab-knowledge"},{view:"findings",label:"Findings",icon:i.jsx(Cx,{size:Nt}),route:Ad,testId:"sidebar-tab-findings"},{view:"settings",label:"Settings",icon:i.jsx(pj,{size:Nt}),route:xN,testId:"sidebar-tab-settings"}];function x5(t){return t===Di||t==="/"?"dashboard":t.startsWith("/chat")||t.startsWith("/sessions")?"chat":t.startsWith("/workspaces")||t.startsWith("/environments")?"environments":t.startsWith(Wx)?"knowledge":t.startsWith(Ad)?"findings":t.startsWith(wi)?"settings":"tasks"}function _5({tabs:t=ad}){const s=Yt(),o=mt(),r=b.useRef(null),c=x5(s.pathname),d=b.useCallback(p=>{o(p.route)},[o]),u=b.useCallback(p=>{var y,k;const m=(y=r.current)==null?void 0:y.querySelectorAll('[role="tab"]');if(!m)return;const g=Array.from(m).findIndex(S=>S===document.activeElement),v=g>=0?g:t.findIndex(S=>S.view===c);let x=v;if(p.key==="ArrowRight"||p.key==="j"||p.key==="J")p.preventDefault(),x=(v+1)%t.length;else if(p.key==="ArrowLeft"||p.key==="k"||p.key==="K")p.preventDefault(),x=(v-1+t.length)%t.length;else if(p.key==="Home")p.preventDefault(),x=0;else if(p.key==="End")p.preventDefault(),x=t.length-1;else return;o(t[x].route),(k=m[x])==null||k.focus()},[c,o,t]);return i.jsx("nav",{className:Ur.nav,ref:r,role:"tablist","aria-orientation":"horizontal","aria-label":"App navigation",onKeyDown:u,"data-testid":"sidebar-nav",children:t.map(p=>{const m=p.view===c;return i.jsx(zo,{text:p.label,placement:"bottom",children:i.jsxs("button",{role:"tab",type:"button","aria-selected":m,tabIndex:m?0:-1,className:`${Ur.tab} ${m?Ur.tabActive:""}`,onClick:()=>d(p),"data-testid":p.testId,"aria-label":p.label,children:[i.jsx("span",{className:Ur.tabIcon,"aria-hidden":"true",children:p.icon}),i.jsx("span",{className:Ur.tabLabel,children:p.label})]})},p.view)})})}const k5="_container_pi6ii_1",S5="_content_pi6ii_66",Wb={container:k5,content:S5},T5=320,M1=220,R1=600,I1="grackle-sidebar-width";function j5(){try{const t=localStorage.getItem(I1);if(t!==null){const s=Number(t);if(Number.isFinite(s)&&s>=M1&&s<=R1)return s}}catch{}return T5}function w5(t){try{localStorage.setItem(I1,String(t))}catch{}}function N5({content:t}){const[s]=b.useState(j5),o=b.useRef(null);if(b.useEffect(()=>{const r=o.current;if(!r)return;const c=new ResizeObserver(d=>{for(const u of d){const p=u.borderBoxSize[0];if(p){const m=Math.round(p.inlineSize);m>=M1&&m<=R1&&w5(m)}}});return c.observe(r),()=>{c.disconnect()}},[]),t!==void 0)return i.jsx("div",{className:Wb.container,ref:o,"data-testid":"sidebar",style:{width:s},children:i.jsx("div",{className:Wb.content,children:t})})}const C5="_bar_tnfsh_1",E5="_btnPrimary_tnfsh_32",A5="_statusText_tnfsh_85",D5="_statusCompleted_tnfsh_90",M5="_statusFailed_tnfsh_94",R5="_statusBlocked_tnfsh_98",I5="_hintText_tnfsh_103",jt={bar:C5,btnPrimary:E5,statusText:A5,statusCompleted:D5,statusFailed:M5,statusBlocked:R5,hintText:I5};function O5({sessions:t,tasks:s,environments:o}){const r=mt(),c=Yt(),d=Dt("/sessions/:sessionId"),u=Dt("/tasks/:taskId"),p=Dt("/tasks/:taskId/stream"),m=Dt("/tasks/:taskId/findings"),g=Dt("/tasks/:taskId/edit"),v=Dt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId"),x=Dt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream"),y=Dt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings"),k=Dt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit"),S=Dt("/sessions/new"),j=Dt("/environments/:environmentId/workspaces/:workspaceId"),N=Dt("/tasks/new"),T=Dt("/chat"),C=Dt("/"),A=Dt("/settings/*"),O=d==null?void 0:d.params.sessionId,E=(u==null?void 0:u.params.taskId)??(p==null?void 0:p.params.taskId)??(m==null?void 0:m.params.taskId)??(v==null?void 0:v.params.taskId)??(x==null?void 0:x.params.taskId)??(y==null?void 0:y.params.taskId)??(k==null?void 0:k.params.taskId),D=v??x??y??k,P=(D==null?void 0:D.params.environmentId)??(j==null?void 0:j.params.environmentId),B=c.pathname.startsWith("/environments")&&!j&&!D,z=!!T,J=!!S,V=!!j&&!v&&!x&&!y&&!k,K=!!N;if(!!C&&!J&&!V&&!K||!!A||(!!g||!!k)||K||B||J)return i.jsx(i.Fragment,{});if(z)return o.find(H=>H.adapterType==="local"&&H.status==="connected")?i.jsx(i.Fragment,{}):i.jsx("div",{className:jt.bar,children:i.jsx("span",{className:jt.hintText,children:"Add a local environment to start chatting"})});if(V)return i.jsx("div",{className:jt.bar,children:i.jsx("span",{className:jt.hintText,children:"Select a task or click + to create one"})});if(E){const M=s.find(he=>he.id===E);if(!M)return i.jsx("div",{className:jt.bar,children:i.jsx("span",{className:jt.hintText,children:"Loading..."})});const H=new Map(s.map(he=>[he.id,he])),ne=M.dependsOn.some(he=>{const W=H.get(he);return W!==void 0&&W.status!=="complete"});if(M.status==="not_started"){const he=ne?M.dependsOn.map(W=>H.get(W)).filter(W=>W&&W.status!=="complete").map(W=>W.title):[];return i.jsx("div",{className:jt.bar,children:ne?i.jsxs("span",{className:jt.statusBlocked,children:["Blocked by: ",he.join(", ")]}):i.jsx("span",{className:jt.hintText,children:"Use the buttons above to start or manage this task"})})}if(M.status==="working"||M.status==="paused"){const he=M.latestSessionId||void 0,W=he?t.find(de=>de.id===he):void 0;return W&&W.status!=="stopped"?i.jsx(i.Fragment,{}):i.jsx("div",{className:jt.bar,children:i.jsx("span",{className:jt.hintText,children:"Waiting for agent..."})})}if(M.status==="complete")return i.jsxs("div",{className:jt.bar,children:[i.jsx("span",{className:`${jt.statusText} ${jt.statusCompleted}`,children:"Task completed"}),i.jsx("button",{onClick:()=>r(Ii(M.workspaceId,void 0,P)),className:jt.btnPrimary,children:"+ New Task"})]});if(M.status==="failed")return i.jsx("div",{className:jt.bar,children:i.jsx("span",{className:`${jt.statusText} ${jt.statusFailed}`,children:"Task failed"})})}if(O){const M=t.find(he=>he.id===O),H=(M==null?void 0:M.status)==="stopped";if(M!==void 0&&!H)return i.jsx(i.Fragment,{});if(H)return i.jsxs("div",{className:jt.bar,children:[i.jsxs("span",{className:`${jt.statusText} ${jt.hintText}`,children:["Session ",M.endReason||M.status]}),i.jsx("button",{onClick:()=>r(Zx(M.environmentId)),className:jt.btnPrimary,children:"+ New Chat"})]})}return i.jsx("div",{className:jt.bar,children:i.jsx("span",{className:jt.hintText,children:"Loading..."})})}const B5="_nav_14i94_1",L5="_tab_14i94_24",z5="_tabActive_14i94_62",$5="_tabLabel_14i94_75",P5="_statusDot_14i94_81",U5="_pulse_14i94_87",H5="_addButton_14i94_99",V5="_empty_14i94_132",Ba={nav:B5,tab:L5,tabActive:z5,tabLabel:$5,statusDot:P5,pulse:U5,addButton:H5,empty:V5},q5={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function G5({environments:t}){const s=mt(),o=b.useRef(null),r=Dt("/environments/:environmentId"),c=Dt("/environments/:environmentId/edit"),d=Dt("/environments/:environmentId/workspaces/:workspaceId"),u=Dt("/environments/:environmentId/workspaces/:workspaceId/*"),p=(r==null?void 0:r.params.environmentId)??(c==null?void 0:c.params.environmentId)??(d==null?void 0:d.params.environmentId)??(u==null?void 0:u.params.environmentId),m=p==="new"?void 0:p,g=b.useCallback(y=>{s(Ai(y))},[s]),v=b.useCallback(y=>{var T;const k=(T=o.current)==null?void 0:T.querySelectorAll('[role="tab"]');if(!k||k.length===0)return;const S=Array.from(k).findIndex(C=>C===document.activeElement),j=S>=0?S:t.findIndex(C=>C.id===m);let N=j;if(y.key==="ArrowDown"||y.key==="j"||y.key==="J")y.preventDefault(),N=(j+1)%k.length;else if(y.key==="ArrowUp"||y.key==="k"||y.key==="K")y.preventDefault(),N=(j-1+k.length)%k.length;else if(y.key==="Home")y.preventDefault(),N=0;else if(y.key==="End")y.preventDefault(),N=k.length-1;else return;N<t.length&&s(Ai(t[N].id)),k[N].focus()},[m,t,s]),x=m??(t.length>0?t[0].id:void 0);return i.jsxs("div",{className:Ba.nav,"data-testid":"environment-nav",children:[i.jsx("nav",{ref:o,role:"tablist","aria-orientation":"vertical","aria-label":"Environments",onKeyDown:v,children:t.map(y=>{const k=y.id===m,S=y.id===x,j=q5[y.status]||"var(--text-tertiary)",N=y.status==="connected";return i.jsxs("button",{role:"tab",type:"button","aria-selected":k,tabIndex:S?0:-1,className:`${Ba.tab} ${k?Ba.tabActive:""}`,onClick:()=>g(y.id),"data-testid":"env-nav-item",children:[i.jsx("span",{className:`${Ba.statusDot} ${N?Ba.pulse:""}`,style:{color:j},"aria-hidden":"true",children:i.jsx(Va,{size:ym,fill:"currentColor"})}),i.jsx("span",{className:Ba.tabLabel,title:y.displayName||y.id,children:y.displayName||y.id})]},y.id)})}),i.jsx("button",{type:"button",className:Ba.addButton,onClick:()=>s(yN),title:"Add environment","data-testid":"env-nav-add",children:"+ Add Environment"}),t.length===0&&i.jsx("div",{className:Ba.empty,children:"No environments yet."})]})}function $o(t){const s=new Date(t),o=new Date,r=o.getTime()-s.getTime(),c=Math.floor(r/1e3),d=Math.floor(c/60),u=Math.floor(d/60),p=Math.floor(u/24);if(c<60)return"just now";if(d<60)return`${d}m ago`;if(u<24)return`${u}h ago`;if(p===1)return"yesterday";if(p<7)return`${p} days ago`;const m=s.getFullYear()===o.getFullYear(),g=s.toLocaleString("en-US",{month:"short"}),v=s.getDate();return m?`${g} ${v}`:`${g} ${v} ${s.getFullYear()}`}function O1(t){const s=new Date(t);if(Number.isNaN(s.getTime()))return"—";const o=new Date,r=s.getTime()-o.getTime();if(r<=0)return"overdue";const c=Math.floor(r/1e3),d=Math.floor(c/60),u=Math.floor(d/60),p=Math.floor(u/24);if(c<60)return`in ${c}s`;if(d<60)return`in ${d}m`;if(u<24)return`in ${u}h`;if(p<7)return`in ${p} day${p===1?"":"s"}`;const m=s.getFullYear()===o.getFullYear(),g=s.toLocaleString("en-US",{month:"short"}),v=s.getDate();return m?`${g} ${v}`:`${g} ${v} ${s.getFullYear()}`}const Xb={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 bd(t){return Xb[t]||Xb.general}const F5="_nav_dlm8m_1",Z5="_categoryPills_dlm8m_24",K5="_categoryPill_dlm8m_24",Y5="_tab_dlm8m_42",J5="_tabActive_dlm8m_80",W5="_tabContent_dlm8m_93",X5="_tabLabel_dlm8m_100",Q5="_tabMeta_dlm8m_106",eI="_categoryDot_dlm8m_111",tI="_empty_dlm8m_118",js={nav:F5,categoryPills:Z5,categoryPill:K5,tab:Y5,tabActive:J5,tabContent:W5,tabLabel:X5,tabMeta:Q5,categoryDot:eI,empty:tI};function nI({findings:t,workspaceId:s,environmentId:o}){const r=mt(),c=b.useRef(null),d=Dt("/findings/:findingId"),u=Dt("/environments/:environmentId/workspaces/:workspaceId/findings/:findingId"),p=(d==null?void 0:d.params.findingId)??(u==null?void 0:u.params.findingId),m=b.useMemo(()=>{const y=new Set(t.map(k=>k.category).filter(Boolean));return Array.from(y).sort()},[t]),g=b.useCallback(y=>{r(qp(y,s,o))},[r,s,o]),v=b.useCallback(y=>{var T;const k=(T=c.current)==null?void 0:T.querySelectorAll('[role="tab"]');if(!k||k.length===0)return;const S=Array.from(k).findIndex(C=>C===document.activeElement),j=S>=0?S:t.findIndex(C=>C.id===p);let N=j;if(y.key==="ArrowDown"||y.key==="j"||y.key==="J")y.preventDefault(),N=(j+1)%k.length;else if(y.key==="ArrowUp"||y.key==="k"||y.key==="K")y.preventDefault(),N=(j-1+k.length)%k.length;else if(y.key==="Home")y.preventDefault(),N=0;else if(y.key==="End")y.preventDefault(),N=k.length-1;else return;N<t.length&&r(qp(t[N].id,s,o)),k[N].focus()},[p,t,r,s,o]),x=p??(t.length>0?t[0].id:void 0);return i.jsxs("div",{className:js.nav,"data-testid":"findings-nav",children:[m.length>1&&i.jsx("div",{className:js.categoryPills,"data-testid":"findings-nav-categories",children:m.map(y=>i.jsx("span",{className:js.categoryPill,style:{color:bd(y).text},children:y},y))}),i.jsx("nav",{ref:c,role:"tablist","aria-orientation":"vertical","aria-label":"Findings",onKeyDown:v,children:t.map(y=>{const k=y.id===p,S=y.id===x;return i.jsxs("button",{role:"tab",type:"button","aria-selected":k,tabIndex:S?0:-1,className:`${js.tab} ${k?js.tabActive:""}`,onClick:()=>g(y.id),"data-testid":"finding-nav-item",children:[i.jsx("span",{className:js.categoryDot,style:{color:bd(y.category).text},"aria-hidden":"true",children:i.jsx(Va,{size:ym,fill:"currentColor"})}),i.jsxs("span",{className:js.tabContent,children:[i.jsx("span",{className:js.tabLabel,title:y.title,children:y.title}),i.jsx("span",{className:js.tabMeta,title:y.createdAt,children:$o(y.createdAt)})]})]},y.id)})}),t.length===0&&i.jsx("div",{className:js.empty,children:"No findings yet. Agents will post discoveries here."})]})}function sI(t){if(t.length===0)return[];const s=[...t].sort((r,c)=>r[0]-c[0]),o=[[s[0][0],s[0][1]]];for(let r=1;r<s.length;r++){const c=o[o.length-1],[d,u]=s[r];d<=c[1]+1?c[1]=Math.max(c[1],u):o.push([d,u])}return o}function B1({text:t,indices:s,highlightClass:o}){if(!s||s.length===0)return i.jsx(i.Fragment,{children:t});const r=sI(s),c=[];let d=0;for(const[u,p]of r)u>d&&c.push(i.jsx("span",{children:t.slice(d,u)},`p${d}`)),c.push(i.jsx("mark",{className:o,children:t.slice(u,p+1)},`m${u}`)),d=p+1;return d<t.length&&c.push(i.jsx("span",{children:t.slice(d)},`p${d}`)),i.jsx(i.Fragment,{children:c})}function aI(t){const s=new Map(t.map(r=>[r.id,{...r,children:[]}])),o=[];for(const r of s.values())r.parentTaskId&&s.has(r.parentTaskId)?s.get(r.parentTaskId).children.push(r):o.push(r);for(const r of s.values())r.children.sort((c,d)=>c.sortOrder-d.sortOrder);return o.sort((r,c)=>r.sortOrder-c.sortOrder)}function iI(t,s){const o=new Map;for(const d of t){const p=d.dependsOn.length>0&&d.dependsOn.some(g=>s.get(g)!=="complete")?"blocked":d.status,m=o.get(p);m?m.push(d):o.set(p,[d])}const r=[],c=new Set;for(const d of kj){c.add(d);const u=o.get(d);if(u&&u.length>0){u.sort((m,g)=>m.sortOrder-g.sortOrder);const p=qa(d);r.push({status:d,label:p.label,style:p,tasks:u})}}for(const[d,u]of o)if(!c.has(d)&&u.length>0){u.sort((m,g)=>m.sortOrder-g.sortOrder);const p=qa(d);r.push({status:d,label:p.label,style:p,tasks:u})}return r}const oI="_container_z4i38_1",rI="_header_z4i38_5",lI="_headerActions_z4i38_17",cI="_searchInput_z4i38_23",dI="_searchHighlight_z4i38_56",uI="_groupToggle_z4i38_62",fI="_groupToggleActive_z4i38_89",pI="_addButton_z4i38_93",mI="_taskRow_z4i38_120",hI="_selected_z4i38_140",gI="_expandArrow_z4i38_150",vI="_expanded_z4i38_157",yI="_leafSpacer_z4i38_161",bI="_taskStatusIcon_z4i38_166",xI="_taskTitle_z4i38_170",_I="_workspaceBadge_z4i38_177",kI="_childCountBadge_z4i38_195",SI="_dependencyBadge_z4i38_208",TI="_blockedBadge_z4i38_220",jI="_addChildButton_z4i38_225",wI="_emptyState_z4i38_268",NI="_statusGroupHeader_z4i38_275",CI="_statusGroupIcon_z4i38_294",EI="_statusGroupLabel_z4i38_298",AI="_statusGroupCount_z4i38_303",Ze={container:oI,header:rI,headerActions:lI,searchInput:cI,searchHighlight:dI,groupToggle:uI,groupToggleActive:fI,addButton:pI,taskRow:mI,selected:hI,expandArrow:gI,expanded:vI,leafSpacer:yI,taskStatusIcon:bI,taskTitle:xI,workspaceBadge:_I,childCountBadge:kI,dependencyBadge:SI,blockedBadge:TI,addChildButton:jI,emptyState:wI,statusGroupHeader:NI,statusGroupIcon:CI,statusGroupLabel:EI,statusGroupCount:AI},DI=[{name:"title",weight:2},{name:"description",weight:1}],L1=16,MI=16,z1="grackle-task-group-by-status";function Qb(){try{return localStorage.getItem(z1)==="true"}catch{return!1}}function RI(t){try{localStorage.setItem(z1,String(t))}catch{}}function II({group:t,isExpanded:s,onToggle:o,selectedTaskId:r,navigate:c,titleHighlights:d,workspaceNames:u}){return i.jsxs("div",{"data-testid":`status-group-${t.status}`,children:[i.jsxs("div",{className:Ze.statusGroupHeader,role:"button",tabIndex:0,"aria-expanded":s,onClick:o,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),o())},children:[i.jsx("span",{className:`${Ze.expandArrow} ${s?Ze.expanded:""}`,"aria-hidden":"true",children:i.jsx(la,{size:dt})}),i.jsx("span",{className:Ze.statusGroupIcon,style:{color:t.style.color},"aria-hidden":"true",children:t.style.icon}),i.jsx("span",{className:Ze.statusGroupLabel,children:t.label}),i.jsx("span",{className:Ze.statusGroupCount,children:t.tasks.length})]}),i.jsx(gs,{children:s&&i.jsx(Rt.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},style:{overflow:"hidden"},children:t.tasks.map(p=>{const m=qa(p.status),g=r===p.id,v=p.parentTaskId||!p.workspaceId?void 0:u.get(p.workspaceId);return i.jsxs("div",{onClick:()=>c(On(p.id)),role:"button",tabIndex:0,"aria-label":p.title,onKeyDown:x=>{x.currentTarget===x.target&&(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),c(On(p.id)))},className:`${Ze.taskRow} ${g?Ze.selected:""}`,style:{"--task-indent":`${L1}px`},"data-task-id":p.id,children:[i.jsx("span",{className:Ze.leafSpacer}),i.jsx("span",{className:Ze.taskStatusIcon,style:{color:m.color},"aria-hidden":"true","data-testid":`task-status-${fl(p.status)}`,children:m.icon}),i.jsx("span",{className:Ze.taskTitle,title:p.title,children:i.jsx(B1,{text:p.title,indices:d.get(p.id),highlightClass:Ze.searchHighlight})}),v&&i.jsx("span",{className:Ze.workspaceBadge,title:v,children:v})]},p.id)})})})]})}function $1({node:t,depth:s,expandedTasks:o,toggleTask:r,selectedTaskId:c,navigate:d,taskStatusById:u,titleHighlights:p,workspaceNames:m}){const g=qa(t.status),v=t.dependsOn.length>0&&t.dependsOn.some(T=>u.get(T)!=="complete"),x=o.has(t.id),y=t.children.length>0,k=c===t.id,S=L1+s*MI,N=s===0&&!t.parentTaskId&&t.workspaceId?m.get(t.workspaceId):void 0;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{onClick:()=>d(On(t.id)),role:"button",tabIndex:0,"aria-label":t.title,onKeyDown:T=>{T.currentTarget===T.target&&(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),d(On(t.id)))},className:`${Ze.taskRow} ${k?Ze.selected:""}`,style:{"--task-indent":`${S}px`},"data-task-id":t.id,children:[y&&i.jsx("span",{className:`${Ze.expandArrow} ${x?Ze.expanded:""}`,role:"button",tabIndex:0,"aria-label":x?"Collapse task":"Expand task",onClick:T=>{T.stopPropagation(),r(t.id)},onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),T.stopPropagation(),r(t.id))},children:i.jsx(la,{size:dt,"aria-hidden":"true"})}),!y&&i.jsx("span",{className:Ze.leafSpacer}),i.jsx("span",{className:Ze.taskStatusIcon,style:{color:g.color},"aria-hidden":"true","data-testid":`task-status-${fl(t.status)}`,children:g.icon}),i.jsx("span",{className:Ze.taskTitle,title:t.title,children:i.jsx(B1,{text:t.title,indices:p.get(t.id),highlightClass:Ze.searchHighlight})}),N&&i.jsx("span",{className:Ze.workspaceBadge,title:N,children:N}),y&&i.jsxs("span",{className:Ze.childCountBadge,children:[t.children.filter(T=>T.status==="complete").length,"/",t.children.length]}),t.dependsOn.length>0&&i.jsx("span",{className:`${Ze.dependencyBadge} ${v?Ze.blockedBadge:""}`,title:`Depends on: ${t.dependsOn.join(", ")}`,children:v?"blocked":"dep"}),s<AT&&i.jsx(zo,{text:"Add child task",children:i.jsx("button",{onClick:T=>{T.stopPropagation(),d(Ii(t.workspaceId,t.id))},"aria-label":"Add child task",className:Ze.addChildButton,children:"+"})})]}),i.jsx(gs,{children:y&&x&&i.jsx(Rt.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.15},style:{overflow:"hidden"},children:t.children.map(T=>i.jsx($1,{node:T,depth:s+1,expandedTasks:o,toggleTask:r,selectedTaskId:c,navigate:d,taskStatusById:u,titleHighlights:p,workspaceNames:m},T.id))})})]})}function OI({workspaces:t,tasks:s}){const o=mt(),[r,c]=b.useState(new Set),[d,u]=b.useState(new Set),[p,m]=b.useState(Qb),[g,v]=b.useState(Qb),[x,y]=b.useState(new Map),k=Dt("/tasks/:taskId/*"),S=(k==null?void 0:k.params.taskId)!=="new"?k==null?void 0:k.params.taskId:void 0,j=b.useMemo(()=>new Map(s.map(ee=>[ee.id,ee.status])),[s]),N=b.useMemo(()=>new Map(t.map(ee=>[ee.id,ee.name])),[t]),T=()=>{const ee=!p;RI(ee),m(ee),ee&&(v(!0),y(new Map))},C=ee=>{y(oe=>{const M=new Map(oe),H=M.has(ee)?M.get(ee):g;return M.set(ee,!H),M})},A=ee=>x.has(ee)?x.get(ee):g,O=ee=>{c(oe=>{const M=new Set(oe);return M.has(ee)?(M.delete(ee),u(H=>new Set(H).add(ee))):(M.add(ee),u(H=>{const ne=new Set(H);return ne.delete(ee),ne})),M})};b.useEffect(()=>{const ee=new Set(s.filter(oe=>oe.parentTaskId).map(oe=>oe.parentTaskId));ee.size>0&&c(oe=>{const M=new Set(oe);for(const H of ee)d.has(H)||M.add(H);return M})},[s,d]);const[E,D]=b.useState(""),{directMatchTaskIds:P,treeMatchTaskIds:B,titleHighlights:z}=b.useMemo(()=>{if(!E.trim())return{directMatchTaskIds:null,treeMatchTaskIds:null,titleHighlights:new Map};const ee=ET(s,E,DI),oe=new Set(ee.map(he=>he.item.id)),M=new Map;for(const he of ee){const W=he.matches.find(X=>X.key==="title");W&&M.set(he.item.id,W.indices)}const H=new Set(oe),ne=new Map(s.map(he=>[he.id,he]));for(const he of[...oe]){let W=ne.get(he);for(;W!=null&&W.parentTaskId;)H.add(W.parentTaskId),W=ne.get(W.parentTaskId)}return{directMatchTaskIds:oe,treeMatchTaskIds:H,titleHighlights:M}},[E,s]),J=P!==null,V=J?p?P:B:null,K=V?s.filter(ee=>V.has(ee.id)):s,fe=p?[]:aI(K);return i.jsxs("div",{className:Ze.container,children:[i.jsxs("div",{className:Ze.header,children:[i.jsx("span",{children:"Tasks"}),i.jsxs("div",{className:Ze.headerActions,children:[i.jsx(zo,{text:p?"Switch to tree view":"Group tasks by status",children:i.jsx("button",{className:`${Ze.groupToggle} ${p?Ze.groupToggleActive:""}`,onClick:T,"aria-label":p?"Switch to tree view":"Group tasks by status","aria-pressed":p,"data-testid":"task-group-by-status-toggle",children:i.jsx(K2,{size:nn})})}),i.jsx(zo,{text:"New task",children:i.jsx("button",{className:Ze.addButton,onClick:()=>o(Ii()),"aria-label":"New task","data-testid":"new-task-button",children:"+"})})]})]}),s.length>0&&i.jsx("input",{type:"text",value:E,onChange:ee=>D(ee.target.value),placeholder:"Filter...","aria-label":"Filter tasks",className:Ze.searchInput,"data-testid":"sidebar-search"}),p?iI(K,j).map(ee=>i.jsx(II,{group:ee,isExpanded:A(ee.status),onToggle:()=>C(ee.status),selectedTaskId:S,navigate:o,titleHighlights:z,workspaceNames:N},ee.status)):fe.map(ee=>i.jsx($1,{node:ee,depth:0,expandedTasks:r,toggleTask:O,selectedTaskId:S,navigate:o,taskStatusById:j,titleHighlights:z,workspaceNames:N},ee.id)),K.length===0&&!J&&i.jsx("div",{className:Ze.emptyState,children:"No tasks yet. Click + to create one."}),K.length===0&&J&&i.jsx("div",{className:Ze.emptyState,children:"No matching tasks"})]})}const BI="_toast_ed2dk_1",LI="_success_ed2dk_18",zI="_icon_ed2dk_22",$I="_error_ed2dk_25",PI="_warning_ed2dk_32",UI="_info_ed2dk_38",HI="_message_ed2dk_53",VI="_close_ed2dk_60",Hr={toast:BI,success:LI,icon:zI,error:$I,warning:PI,info:UI,message:HI,close:VI},qI={success:i.jsx(Mi,{size:Nt}),error:i.jsx(Za,{size:Nt}),warning:i.jsx(vm,{size:Nt}),info:i.jsx(gm,{size:Nt})};function GI({toast:t,onDismiss:s}){return b.useEffect(()=>{const o=setTimeout(()=>s(t.id),t.duration);return()=>clearTimeout(o)},[t.id,t.duration,s]),i.jsxs(Rt.div,{className:`${Hr.toast} ${Hr[t.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:[i.jsx("span",{className:Hr.icon,"aria-hidden":"true",children:qI[t.variant]}),i.jsx("span",{className:Hr.message,children:t.message}),i.jsx("button",{type:"button",className:Hr.close,onClick:()=>s(t.id),"aria-label":"Dismiss notification",children:i.jsx(Za,{size:nn,"aria-hidden":"true"})})]})}const FI="_container_qqse2_1",ZI={container:FI};function KI({toasts:t,onDismiss:s}){return i.jsx("div",{className:ZI.container,"data-testid":"toast-container",children:i.jsx(gs,{children:t.map(o=>i.jsx(GI,{toast:o,onDismiss:s},o.id))})})}const YI="_callout_e5awm_1",JI="_success_e5awm_11",WI="_icon_e5awm_15",XI="_error_e5awm_18",QI="_warning_e5awm_25",eO="_info_e5awm_32",tO="_content_e5awm_48",nO="_close_e5awm_53",Vr={callout:YI,success:JI,icon:WI,error:XI,warning:QI,info:eO,content:tO,close:nO},sO={success:i.jsx(Mi,{size:Nt}),error:i.jsx(Za,{size:Nt}),warning:i.jsx(vm,{size:Nt}),info:i.jsx(gm,{size:Nt})};function aO({variant:t="info",children:s,dismissible:o=!1,className:r}){const[c,d]=b.useState(!1);return i.jsx(i.Fragment,{children:!c&&i.jsxs("div",{className:[Vr.callout,Vr[t],r].filter(Boolean).join(" "),role:t==="error"||t==="warning"?"alert":"status",children:[i.jsx("span",{className:Vr.icon,"aria-hidden":"true",children:sO[t]}),i.jsx("span",{className:Vr.content,children:s}),o&&i.jsx("button",{type:"button",className:Vr.close,onClick:()=>d(!0),"aria-label":"Dismiss",children:i.jsx(Za,{size:nn,"aria-hidden":"true"})})]})})}function iO({currentVersion:t,latestVersion:s,updateAvailable:o,isDocker:r}){if(!o)return i.jsx(i.Fragment,{});const c=r?"docker pull ghcr.io/nick-pape/grackle:latest && docker restart grackle":`npm install -g @grackle-ai/cli@${s}`;return i.jsx("div",{"data-testid":"update-banner",children:i.jsxs(aO,{variant:"info",dismissible:!0,children:[i.jsxs("strong",{children:["Grackle v",s]})," is available (you have v",t,")."," ","Run: ",i.jsx("code",{children:c})]})})}const oO="_container_de44x_1",rO="_emptyState_de44x_8",lO="_card_de44x_14",cO="_cardClickable_de44x_34",dO="_cardHeader_de44x_42",uO="_categoryBadge_de44x_54",fO="_findingTitle_de44x_62",pO="_findingDate_de44x_68",mO="_findingContent_de44x_80",hO="_tags_de44x_86",gO="_tag_de44x_86",fs={container:oO,emptyState:rO,card:lO,cardClickable:cO,cardHeader:dO,categoryBadge:uO,findingTitle:fO,findingDate:pO,findingContent:mO,tags:hO,tag:gO};function P1({findings:t,onFindingClick:s}){return t.length===0?i.jsx("div",{className:fs.emptyState,children:"No findings yet. Agents will post discoveries here."}):i.jsx("div",{className:fs.container,children:t.map((o,r)=>{const c=bd(o.category),d=s?Rt.button:Rt.div;return i.jsxs(d,{type:s?"button":void 0,className:`${fs.card} ${s?fs.cardClickable:""}`,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:r*.05,duration:.2},onClick:s?()=>{s(o.id)}:void 0,children:[i.jsxs("div",{className:fs.cardHeader,children:[i.jsx("span",{className:fs.categoryBadge,style:{background:c.bg,color:c.text},children:o.category}),i.jsx("span",{className:fs.findingTitle,children:o.title}),i.jsx("span",{className:fs.findingDate,title:o.createdAt,children:$o(o.createdAt)})]}),i.jsx("div",{className:fs.findingContent,children:o.content.length>300?o.content.slice(0,300)+"...":o.content}),o.tags.length>0&&i.jsx("div",{className:fs.tags,children:o.tags.map(u=>i.jsx("span",{className:fs.tag,style:{color:c.text,textShadow:`0 0 8px ${c.text}`},children:u},u))})]},o.id)})})}const vO="_container_1ingb_1",yO="_heading_1ingb_7",bO="_section_1ingb_14",xO="_sectionTitle_1ingb_26",_O="_sectionDescription_1ingb_35",kO="_emptyState_1ingb_41",SO="_tokenList_1ingb_48",TO="_tokenRow_1ingb_55",jO="_tokenBadge_1ingb_68",wO="_tokenName_1ingb_83",NO="_tokenTarget_1ingb_90",CO="_deleteButton_1ingb_99",EO="_addForm_1ingb_113",AO="_formRow_1ingb_119",DO="_input_1ingb_125",MO="_select_1ingb_155",RO="_addButton_1ingb_187",IO="_emptyStateInfo_1ingb_221",OO="_themeOptions_1ingb_229",BO="_themeOption_1ingb_229",LO="_themeOptionSelected_1ingb_254",zO="_themeOptionHeader_1ingb_259",$O="_themeOptionLabel_1ingb_266",PO="_themeOptionDesc_1ingb_273",UO="_variantToggle_1ingb_279",HO="_variantButton_1ingb_286",VO="_variantActive_1ingb_305",qO="_themeSwatches_1ingb_311",GO="_themeSwatch_1ingb_311",FO="_systemToggle_1ingb_325",ZO="_systemToggleHint_1ingb_341",KO="_themeActive_1ingb_348",YO="_aboutGrid_1ingb_354",JO="_aboutItem_1ingb_360",WO="_aboutLabel_1ingb_373",XO="_aboutValue_1ingb_379",QO="_aboutDot_1ingb_387",eB="_aboutDotConnected_1ingb_394",tB="_aboutDotDisconnected_1ingb_398",me={container:vO,heading:yO,section:bO,sectionTitle:xO,sectionDescription:_O,emptyState:kO,tokenList:SO,tokenRow:TO,tokenBadge:jO,tokenName:wO,tokenTarget:NO,deleteButton:CO,addForm:EO,formRow:AO,input:DO,select:MO,addButton:RO,emptyStateInfo:IO,themeOptions:OO,themeOption:BO,themeOptionSelected:LO,themeOptionHeader:zO,themeOptionLabel:$O,themeOptionDesc:PO,variantToggle:UO,variantButton:HO,variantActive:VO,themeSwatches:qO,themeSwatch:GO,systemToggle:FO,systemToggleHint:ZO,themeActive:KO,aboutGrid:YO,aboutItem:JO,aboutLabel:WO,aboutValue:XO,aboutDot:QO,aboutDotConnected:eB,aboutDotDisconnected:tB},nB=[{value:"env_var",label:"Environment Variable"},{value:"file",label:"File"}];function sB({tokens:t,onSetToken:s,onDeleteToken:o,onShowToast:r}){const[c,d]=b.useState(""),[u,p]=b.useState(""),[m,g]=b.useState("env_var"),[v,x]=b.useState(""),[y,k]=b.useState(null),S=T=>{if(T.preventDefault(),!c||!u)return;const C=m==="env_var"?v||c.toUpperCase()+"_TOKEN":"";s(c,u,m,C,m==="file"?v:""),r==null||r("Token saved successfully","success"),d(""),p(""),x("")},j=T=>{k(T)},N=()=>{y&&(o(y),r==null||r("Token deleted","info")),k(null)};return i.jsxs(i.Fragment,{children:[i.jsx(oa,{isOpen:y!==null,title:"Delete Token?",description:y?`"${y}" will be permanently removed.`:void 0,onConfirm:N,onCancel:()=>k(null)}),i.jsxs("section",{className:me.section,children:[i.jsx("h3",{className:me.sectionTitle,children:"Tokens"}),i.jsx("p",{className:me.sectionDescription,children:"API tokens are auto-pushed to environments when set or updated. Values are write-only."}),t.length===0?i.jsx("div",{className:me.emptyStateInfo,children:"Add your first API token to enable service integrations."}):i.jsx("div",{className:me.tokenList,children:t.map(T=>i.jsxs("div",{className:me.tokenRow,children:[i.jsx("span",{className:me.tokenBadge,children:T.tokenType}),i.jsx("span",{className:me.tokenName,children:T.name}),i.jsx("span",{className:me.tokenTarget,children:T.tokenType==="env_var"?T.envVar:T.filePath}),i.jsx("button",{className:me.deleteButton,onClick:()=>j(T.name),title:`Delete ${T.name}`,"aria-label":`Delete ${T.name}`,children:i.jsx(Za,{size:nn,"aria-hidden":"true"})})]},T.name))}),i.jsxs("form",{className:me.addForm,onSubmit:S,children:[i.jsxs("div",{className:me.formRow,children:[i.jsx("input",{className:me.input,type:"text",placeholder:"Token name",value:c,onChange:T=>d(T.target.value)}),i.jsx("input",{className:me.input,type:"password",placeholder:"Value",value:u,onChange:T=>p(T.target.value)})]}),i.jsxs("div",{className:me.formRow,children:[i.jsx("select",{className:me.select,value:m,onChange:T=>g(T.target.value),children:nB.map(T=>i.jsx("option",{value:T.value,children:T.label},T.value))}),i.jsx("input",{className:me.input,type:"text",placeholder:m==="env_var"?"Env var name (e.g. API_TOKEN)":"File path (e.g. /home/user/.token)",value:v,onChange:T=>x(T.target.value)}),i.jsx("button",{className:me.addButton,type:"submit",children:"Add Token"})]})]})]})]})}const Ld=[{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"]}],U1=new Set(Ld.map(t=>t.id)),ex="grackle";function dm(t){return Ld.find(s=>s.id===t)}function aB({themeId:t,resolvedThemeId:s,onSetTheme:o,preferSystem:r,onSetPreferSystem:c}){return i.jsxs("section",{className:me.section,children:[i.jsx("h3",{className:me.sectionTitle,children:"Appearance"}),i.jsx("p",{className:me.sectionDescription,children:"Choose how Grackle looks across the app."}),i.jsx("div",{className:me.themeOptions,children:Ld.filter(d=>!d.hidden).map(d=>{const u=!!(d.variantLightId&&d.variantDarkId),p=u?t===d.id||t===d.variantLightId||t===d.variantDarkId:t===d.id,m=u&&s===d.variantLightId;return i.jsxs("button",{type:"button",className:`${me.themeOption} ${p?me.themeOptionSelected:""}`,"aria-pressed":p,onClick:()=>o(d.id),children:[i.jsxs("span",{className:me.themeOptionHeader,children:[i.jsxs("span",{children:[i.jsx("span",{className:me.themeOptionLabel,children:d.label}),i.jsx("span",{className:me.themeOptionDesc,children:d.description})]}),u&&i.jsxs("span",{className:me.variantToggle,children:[i.jsx("span",{role:"button",tabIndex:0,className:`${me.variantButton} ${p&&m?me.variantActive:""}`,onClick:g=>{g.stopPropagation(),c(!1),o(d.variantLightId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),c(!1),o(d.variantLightId))},"aria-label":"Light variant","aria-pressed":p&&m,children:"☼"}),i.jsx("span",{role:"button",tabIndex:0,className:`${me.variantButton} ${p&&!m?me.variantActive:""}`,onClick:g=>{g.stopPropagation(),c(!1),o(d.variantDarkId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),c(!1),o(d.variantDarkId))},"aria-label":"Dark variant","aria-pressed":p&&!m,children:"☾"})]})]}),d.swatches&&i.jsx("span",{className:me.themeSwatches,children:d.swatches.map((g,v)=>i.jsx("span",{className:me.themeSwatch,style:{background:g}},v))})]},d.id)})}),i.jsxs("label",{className:me.systemToggle,children:[i.jsx("input",{type:"checkbox",checked:r,onChange:d=>c(d.target.checked)}),i.jsx("span",{children:"Match system light/dark preference"})]}),i.jsx("p",{className:me.systemToggleHint,children:"Automatically switches between light and dark variants when available."}),i.jsxs("p",{className:me.themeActive,children:["Active theme: ",i.jsx("strong",{children:s})]})]})}function iB({connected:t,environments:s,sessions:o}){const r=s.filter(u=>u.status==="connected").length,c=s.length,d=o.filter(u=>["running","idle"].includes(u.status)).length;return i.jsxs("section",{className:me.section,"data-testid":"about-panel",children:[i.jsx("h3",{className:me.sectionTitle,children:"About"}),i.jsx("p",{className:me.sectionDescription,children:"Connection status and application information."}),i.jsxs("div",{className:me.aboutGrid,children:[i.jsxs("div",{className:me.aboutItem,children:[i.jsx("span",{className:me.aboutLabel,children:"Connection"}),i.jsxs("span",{className:me.aboutValue,children:[i.jsx("span",{className:`${me.aboutDot} ${t?me.aboutDotConnected:me.aboutDotDisconnected}`}),t?"Connected":"Disconnected"]})]}),i.jsxs("div",{className:me.aboutItem,children:[i.jsx("span",{className:me.aboutLabel,children:"Environments"}),i.jsxs("span",{className:me.aboutValue,children:[r,"/",c," connected"]})]}),i.jsxs("div",{className:me.aboutItem,children:[i.jsx("span",{className:me.aboutLabel,children:"Active Sessions"}),i.jsx("span",{className:me.aboutValue,children:d})]}),i.jsxs("div",{className:me.aboutItem,children:[i.jsx("span",{className:me.aboutLabel,children:"Version"}),i.jsx("span",{className:me.aboutValue,children:"0.105.0"})]})]})]})}const oB="_container_cddyd_1",rB="_header_cddyd_8",lB="_headerTitle_cddyd_35",cB="_badge_cddyd_44",dB="_headerActions_cddyd_54",uB="_body_cddyd_61",fB="_formContent_cddyd_73",pB="_section_cddyd_85",mB="_label_cddyd_91",hB="_titleInput_cddyd_98",gB="_descriptionTextarea_cddyd_131",vB="_parentContext_cddyd_167",yB="_parentLabel_cddyd_175",bB="_parentName_cddyd_182",xB="_personaSelect_cddyd_186",_B="_depList_cddyd_220",kB="_depItem_cddyd_226",SB="_depItemSelected_cddyd_248",TB="_noDeps_cddyd_252",jB="_btnPrimary_cddyd_258",wB="_btnGhost_cddyd_289",nt={container:oB,header:rB,headerTitle:lB,badge:cB,headerActions:dB,body:uB,formContent:fB,section:pB,label:mB,titleInput:hB,descriptionTextarea:gB,parentContext:vB,parentLabel:yB,parentName:bB,personaSelect:xB,depList:_B,depItem:kB,depItemSelected:SB,noDeps:TB,btnPrimary:jB,btnGhost:wB};function H1({mode:t,taskId:s,workspaceId:o,parentTaskId:r,environmentId:c,tasks:d,workspaces:u,personas:p,onCreateTask:m,onUpdateTask:g,onEditDone:v,onShowToast:x}){const y=mt(),k=t==="edit",S=k&&s?d.find(xe=>xe.id===s):void 0,j=k?(S==null?void 0:S.workspaceId)??"":o??"",[N,T]=b.useState(j),C=j||N,A=u.find(xe=>xe.id===C),O=c??(A==null?void 0:A.linkedEnvironmentIds[0]),E=!k&&!o,D=k?(S==null?void 0:S.parentTaskId)??"":r??"",P=D?d.find(xe=>xe.id===D):void 0,[B,z]=b.useState((S==null?void 0:S.title)??""),[J,V]=b.useState((S==null?void 0:S.description)??""),[K,fe]=b.useState((S==null?void 0:S.dependsOn)??[]),[ee,oe]=b.useState((S==null?void 0:S.defaultPersonaId)??""),[M,H]=b.useState((S==null?void 0:S.canDecompose)??!1),[ne,he]=b.useState(!1),W=b.useRef(!1);b.useEffect(()=>{k&&S&&!W.current&&(W.current=!0,z(S.title),V(S.description),fe(S.dependsOn),oe(S.defaultPersonaId),H(S.canDecompose))},[k,S]);const X=d.filter(xe=>xe.workspaceId===C&&(!k||xe.id!==s)&&xe.id!==D),de=B.trim().length>0&&(!k||S!==void 0)&&C.length>0,Ne=xe=>{fe(Be=>Be.includes(xe)?Be.filter(It=>It!==xe):[...Be,xe])},Ue=()=>{!de||ne||k&&S===void 0||(k&&s?(g(s,B.trim(),J,K,ee),x==null||x("Task updated","success"),v?v():y(On(s,void 0,C,O),{replace:!0})):(he(!0),m(C,B.trim(),J,K.length>0?K:void 0,D||void 0,ee,M,()=>{x==null||x("Task created","success"),y(o?Ei(o,O):"/tasks",{replace:!0})},xe=>{x==null||x(xe,"error"),he(!1)})))},ve=()=>{if(v){v();return}y(k&&s?On(s,void 0,C,O):o?Ei(o,O):"/tasks")},Se=k?"edit task":D?"child task":"new task";return i.jsxs("div",{className:nt.container,children:[i.jsxs("div",{className:nt.header,children:[i.jsxs("div",{className:nt.headerTitle,children:[i.jsx("span",{className:nt.badge,children:Se}),P&&i.jsxs("span",{className:nt.parentContext,children:[i.jsx("span",{className:nt.parentLabel,children:"Child of"}),i.jsx("span",{className:nt.parentName,children:P.title})]})]}),i.jsxs("div",{className:nt.headerActions,children:[i.jsx("button",{onClick:Ue,disabled:!de||ne,className:nt.btnPrimary,"data-testid":"task-edit-save",children:ne?"Creating…":k?"Save Changes":"Create"}),i.jsx("button",{onClick:ve,className:nt.btnGhost,children:"Cancel"})]})]}),i.jsx("div",{className:nt.body,children:i.jsxs("div",{className:nt.formContent,children:[E&&i.jsxs("div",{className:nt.section,children:[i.jsx("label",{className:nt.label,htmlFor:"task-edit-workspace",children:"Workspace"}),i.jsxs("select",{id:"task-edit-workspace",value:N,onChange:xe=>T(xe.target.value),className:nt.personaSelect,"data-testid":"task-edit-workspace",children:[i.jsx("option",{value:"",children:"Select a workspace..."}),u.map(xe=>i.jsx("option",{value:xe.id,children:xe.name},xe.id))]})]}),i.jsxs("div",{className:nt.section,children:[i.jsx("label",{className:nt.label,htmlFor:"task-edit-title",children:"Title"}),i.jsx("input",{id:"task-edit-title",type:"text",value:B,onChange:xe=>z(xe.target.value),placeholder:"Task title...",autoFocus:!0,className:nt.titleInput,"data-testid":"task-edit-title",onKeyDown:xe=>{xe.key==="Enter"&&de&&Ue()}})]}),i.jsxs("div",{className:nt.section,children:[i.jsx("label",{className:nt.label,htmlFor:"task-edit-description",children:"Description"}),i.jsx("textarea",{id:"task-edit-description",value:J,onChange:xe=>V(xe.target.value),placeholder:"Describe the task... (markdown supported)",className:nt.descriptionTextarea,"data-testid":"task-edit-description",rows:8})]}),i.jsxs("div",{className:nt.section,children:[i.jsx("label",{className:nt.label,htmlFor:"task-edit-persona",children:"Default Persona"}),i.jsxs("select",{id:"task-edit-persona",value:ee,onChange:xe=>oe(xe.target.value),className:nt.personaSelect,"data-testid":"task-edit-persona",children:[i.jsx("option",{value:"",children:"(Inherit)"}),p.map(xe=>i.jsx("option",{value:xe.id,children:xe.name},xe.id))]})]}),!k&&i.jsx("div",{className:nt.section,children:i.jsxs("label",{className:nt.depItem,"data-testid":"task-edit-can-decompose",children:[i.jsx("input",{type:"checkbox",checked:M,onChange:xe=>H(xe.target.checked)}),"Can spawn subtasks"]})}),i.jsxs("div",{className:nt.section,children:[i.jsx("div",{className:nt.label,children:"Dependencies"}),X.length===0?i.jsx("div",{className:nt.noDeps,children:"No other tasks in this workspace"}):i.jsx("div",{className:nt.depList,children:X.map(xe=>{const Be=K.includes(xe.id);return i.jsxs("label",{className:`${nt.depItem} ${Be?nt.depItemSelected:""}`,"data-testid":`dep-option-${xe.id}`,children:[i.jsx("input",{type:"checkbox",checked:Be,onChange:()=>Ne(xe.id)}),xe.title,i.jsxs("span",{style:{opacity:.5,fontSize:"11px",marginLeft:"4px"},children:["(",xe.status,")"]})]},xe.id)})})]})]})})]})}const NB="_actionButtons_1rjka_1",CB="_btnPrimary_1rjka_8",EB="_btnDanger_1rjka_39",AB="_btnGhost_1rjka_78",Kt={actionButtons:NB,btnPrimary:CB,btnDanger:EB,btnGhost:AB};function DB({task:t,sessionId:s,isBlocked:o,onStart:r,onResume:c,onStop:d,onPause:u,onDelete:p,onEdit:m}){if(t.status==="not_started")return o?i.jsxs("div",{className:Kt.actionButtons,"data-testid":"task-action-buttons",children:[i.jsx("button",{onClick:m,className:Kt.btnGhost,"data-testid":"task-action-edit",children:"Edit"}),i.jsx("button",{onClick:p,className:Kt.btnDanger,"data-testid":"task-action-delete",children:"Delete"})]}):i.jsxs("div",{className:Kt.actionButtons,"data-testid":"task-action-buttons",children:[i.jsx("button",{"data-testid":"task-header-start",onClick:r,className:Kt.btnPrimary,children:"Start"}),i.jsx("button",{onClick:m,className:Kt.btnGhost,"data-testid":"task-action-edit",children:"Edit"}),i.jsx("button",{onClick:p,className:Kt.btnDanger,"data-testid":"task-action-delete",children:"Delete"})]});if(t.status==="working")return i.jsxs("div",{className:Kt.actionButtons,"data-testid":"task-action-buttons",children:[i.jsx("button",{onClick:d,className:Kt.btnDanger,"data-testid":"task-action-stop",children:"Stop"}),i.jsx("button",{onClick:u,disabled:!s,className:Kt.btnGhost,"data-testid":"task-action-pause",children:"Pause"})]});if(t.status==="paused")return i.jsxs("div",{className:Kt.actionButtons,"data-testid":"task-action-buttons",children:[i.jsx("button",{onClick:d,className:Kt.btnPrimary,"data-testid":"task-action-stop",children:"Stop"}),i.jsx("button",{onClick:c,className:Kt.btnGhost,"data-testid":"task-action-resume",children:"Resume"}),i.jsx("button",{onClick:p,className:Kt.btnDanger,"data-testid":"task-action-delete",children:"Delete"})]});if(t.status==="complete")return i.jsx("div",{className:Kt.actionButtons,"data-testid":"task-action-buttons",children:i.jsx("button",{onClick:p,className:Kt.btnDanger,"data-testid":"task-action-delete",children:"Delete"})});if(t.status==="failed")return i.jsxs("div",{className:Kt.actionButtons,"data-testid":"task-action-buttons",children:[i.jsx("button",{onClick:r,className:Kt.btnPrimary,"data-testid":"task-header-start",children:"Retry"}),i.jsx("button",{onClick:p,className:Kt.btnDanger,"data-testid":"task-action-delete",children:"Delete"})]})}const MB="_workpadSection_y8nj9_1",RB="_workpadLabel_y8nj9_9",IB="_workpadStatus_y8nj9_17",OB="_workpadSummary_y8nj9_23",BB="_workpadExtra_y8nj9_29",La={workpadSection:MB,workpadLabel:RB,workpadStatus:IB,workpadSummary:OB,workpadExtra:BB};function LB({workpad:t}){if(!t)return;let s;try{const o=JSON.parse(t);if(o==null||typeof o!="object"||Array.isArray(o))return;s=o}catch{return i.jsxs("div",{className:La.workpadSection,"data-testid":"workpad-panel",children:[i.jsx("div",{className:La.workpadLabel,children:"Workpad"}),i.jsx("div",{className:La.workpadExtra,children:t})]})}if(!(!s.status&&!s.summary&&!s.extra))return i.jsxs("div",{className:La.workpadSection,"data-testid":"workpad-panel",children:[i.jsx("div",{className:La.workpadLabel,children:"Workpad"}),s.status&&i.jsx("div",{className:La.workpadStatus,"data-testid":"workpad-status",children:s.status}),s.summary&&i.jsx("div",{className:La.workpadSummary,"data-testid":"workpad-summary",children:s.summary}),s.extra&&Object.keys(s.extra).length>0&&i.jsx("div",{className:La.workpadExtra,"data-testid":"workpad-extra",children:JSON.stringify(s.extra,null,2)})]})}const zB="_overviewDashboard_r05qm_1",$B="_overviewHero_r05qm_7",PB="_statusBadge_r05qm_14",UB="_statusPending_r05qm_26",HB="_statusAssigned_r05qm_31",VB="_statusInProgress_r05qm_36",qB="_statusReview_r05qm_41",GB="_statusDone_r05qm_46",FB="_statusFailed_r05qm_51",ZB="_statusWaitingInput_r05qm_56",KB="_overviewBranchPill_r05qm_61",YB="_branchLink_r05qm_76",JB="_overviewSection_r05qm_87",WB="_overviewLabel_r05qm_93",XB="_overviewValue_r05qm_100",QB="_overviewMuted_r05qm_105",eL="_overviewMarkdown_r05qm_111",tL="_envRow_r05qm_180",nL="_envDot_r05qm_186",sL="_envDotGreen_r05qm_193",aL="_envDotYellow_r05qm_197",iL="_envDotRed_r05qm_201",oL="_envDotGray_r05qm_205",rL="_depList_r05qm_209",lL="_depItem_r05qm_215",cL="_depBlocked_r05qm_222",dL="_depDone_r05qm_226",uL="_timeline_r05qm_230",fL="_timelineRow_r05qm_236",pL="_timelineKey_r05qm_243",mL="_timelineValue_r05qm_249",hL="_timelineDelta_r05qm_253",gL="_reviewNotes_r05qm_264",ye={overviewDashboard:zB,overviewHero:$B,statusBadge:PB,statusPending:UB,statusAssigned:HB,statusInProgress:VB,statusReview:qB,statusDone:GB,statusFailed:FB,statusWaitingInput:ZB,overviewBranchPill:KB,branchLink:YB,overviewSection:JB,overviewLabel:WB,overviewValue:XB,overviewMuted:QB,overviewMarkdown:eL,envRow:tL,envDot:nL,envDotGreen:sL,envDotYellow:aL,envDotRed:iL,envDotGray:oL,depList:rL,depItem:lL,depBlocked:cL,depDone:dL,timeline:uL,timelineRow:fL,timelineKey:pL,timelineValue:mL,timelineDelta:hL,reviewNotes:gL};function Gc(t){if(!t)return"—";const s=new Date(t);return isNaN(s.getTime())?"—":s.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})}function Cp(t,s){if(!t||!s)return;const o=new Date(s).getTime()-new Date(t).getTime();if(isNaN(o)||o<0)return;const r=Math.floor(o/6e4),c=Math.floor(o%6e4/1e3);if(r===0)return`${c}s`;const d=Math.floor(r/60),u=r%60;return d===0?`${r}m ${c}s`:`${d}h ${u}m`}function tx(t){const s=t.toLowerCase();return s==="ready"||s==="running"||s==="available"||s==="connected"?ye.envDotGreen:s==="provisioning"||s==="starting"||s==="pending"||s==="connecting"?ye.envDotYellow:s==="error"||s==="failed"||s==="disconnected"?ye.envDotRed:ye.envDotGray}function vL({status:t}){const s=qa(t),o=_j(t);return i.jsx("span",{className:`${ye.statusBadge} ${ye[o]??ye.statusPending}`,"data-testid":"task-overview-status-badge",children:s.label})}function yL({task:t,tasksById:s,environments:o,workspaces:r,taskSessions:c,selectedEnvId:d,taskUsage:u,treeUsage:p}){const m=c.length>0?c[c.length-1]:void 0,g=(m==null?void 0:m.environmentId)??"",v=g?o.find(S=>S.id===g):void 0,x=r.find(S=>S.id===t.workspaceId),y=o.find(S=>S.id===d),k=t.branch&&(x!=null&&x.repoUrl)?`${x.repoUrl.replace(/\/$/,"")}/tree/${encodeURIComponent(t.branch)}`:void 0;return i.jsxs("div",{className:ye.overviewDashboard,"data-testid":"task-overview-panel",children:[i.jsxs("div",{className:ye.overviewHero,children:[i.jsx(vL,{status:t.status}),t.branch&&i.jsx("span",{className:ye.overviewBranchPill,"data-testid":"task-overview-branch",children:k?i.jsxs("a",{href:k,target:"_blank",rel:"noreferrer noopener",className:ye.branchLink,children:["🔗"," ",t.branch]}):i.jsxs("span",{children:["🔗"," ",t.branch]})})]}),typeof t.description=="string"&&t.description&&i.jsxs("div",{className:ye.overviewSection,"data-testid":"task-overview-description",children:[i.jsx("div",{className:ye.overviewLabel,children:"Description"}),i.jsx("div",{className:ye.overviewMarkdown,children:i.jsx(Sd,{remarkPlugins:[Td],children:t.description})})]}),t.workpad&&i.jsx(LB,{workpad:t.workpad}),i.jsxs("div",{className:ye.overviewSection,children:[i.jsx("div",{className:ye.overviewLabel,children:"Environment"}),g&&v?i.jsxs("div",{className:ye.envRow,"data-testid":"task-overview-environment",children:[i.jsx("span",{className:`${ye.envDot} ${tx(v.status)}`,title:v.status,"aria-label":`Status: ${v.status}`,role:"img"}),i.jsx("span",{className:ye.overviewValue,children:v.displayName})]}):y?i.jsxs("div",{className:ye.envRow,"data-testid":"task-overview-environment",children:[i.jsx("span",{className:`${ye.envDot} ${tx(y.status)}`,title:y.status,"aria-label":`Status: ${y.status}`,role:"img"}),i.jsx("span",{className:ye.overviewValue,children:y.displayName}),i.jsx("span",{className:ye.overviewMuted,children:"(workspace default)"})]}):i.jsx("div",{className:ye.overviewMuted,children:"Set in workspace settings"})]}),i.jsxs("div",{className:ye.overviewSection,"data-testid":"task-overview-dependencies",children:[i.jsx("div",{className:ye.overviewLabel,children:"Dependencies"}),t.dependsOn.length===0?i.jsx("div",{className:ye.overviewMuted,children:"None"}):i.jsx("div",{className:ye.depList,children:t.dependsOn.map(S=>{const j=s.get(S),N=(j==null?void 0:j.status)==="complete";return i.jsxs("div",{className:`${ye.depItem} ${N?ye.depDone:ye.depBlocked}`,children:[i.jsx("span",{children:N?"✓":"○"}),i.jsx("span",{children:(j==null?void 0:j.title)??S})]},S)})})]}),i.jsxs("div",{className:ye.overviewSection,"data-testid":"task-overview-timeline",children:[i.jsx("div",{className:ye.overviewLabel,children:"Timeline"}),i.jsxs("div",{className:ye.timeline,children:[t.createdAt&&i.jsxs("div",{className:ye.timelineRow,children:[i.jsx("span",{className:ye.timelineKey,children:"Created"}),i.jsx("span",{className:ye.timelineValue,children:Gc(t.createdAt)})]}),t.assignedAt&&(()=>{const S=Cp(t.createdAt,t.assignedAt);return i.jsxs("div",{className:ye.timelineRow,children:[i.jsx("span",{className:ye.timelineKey,children:"Assigned"}),i.jsx("span",{className:ye.timelineValue,children:Gc(t.assignedAt)}),S!==void 0&&i.jsx("span",{className:ye.timelineDelta,children:S})]})})(),t.startedAt&&(()=>{const S=Cp(t.assignedAt??t.createdAt,t.startedAt);return i.jsxs("div",{className:ye.timelineRow,children:[i.jsx("span",{className:ye.timelineKey,children:"Started"}),i.jsx("span",{className:ye.timelineValue,children:Gc(t.startedAt)}),S!==void 0&&i.jsx("span",{className:ye.timelineDelta,children:S})]})})(),t.completedAt&&(()=>{const S=Cp(t.startedAt,t.completedAt);return i.jsxs("div",{className:ye.timelineRow,children:[i.jsx("span",{className:ye.timelineKey,children:"Completed"}),i.jsx("span",{className:ye.timelineValue,children:Gc(t.completedAt)}),S!==void 0&&i.jsx("span",{className:ye.timelineDelta,children:S})]})})(),!t.createdAt&&!t.assignedAt&&!t.startedAt&&!t.completedAt&&i.jsx("div",{className:ye.overviewMuted,children:"No timing data"})]})]}),u&&u.costMillicents>0&&i.jsxs("div",{className:ye.overviewSection,"data-testid":"task-overview-usage",children:[i.jsx("div",{className:ye.overviewLabel,children:"Usage"}),i.jsxs("div",{className:ye.timeline,children:[i.jsxs("div",{className:ye.timelineRow,children:[i.jsx("span",{className:ye.timelineKey,children:"Cost"}),i.jsx("span",{className:ye.timelineValue,children:Ns(u.costMillicents)}),i.jsxs("span",{className:ye.timelineDelta,children:[u.sessionCount," session",u.sessionCount!==1?"s":""]})]}),p&&p.costMillicents>u.costMillicents&&i.jsxs("div",{className:ye.timelineRow,children:[i.jsx("span",{className:ye.timelineKey,children:"Total (incl. subtasks)"}),i.jsx("span",{className:ye.timelineValue,children:Ns(p.costMillicents)}),i.jsxs("span",{className:ye.timelineDelta,children:[p.sessionCount," session",p.sessionCount!==1?"s":""]})]})]})]}),(t.tokenBudget>0||t.costBudgetMillicents>0)&&i.jsxs("div",{className:ye.overviewSection,"data-testid":"task-overview-budget",children:[i.jsx("div",{className:ye.overviewLabel,children:"Budget"}),i.jsxs("div",{className:ye.timeline,children:[t.tokenBudget>0&&i.jsxs("div",{className:ye.timelineRow,children:[i.jsx("span",{className:ye.timelineKey,children:"Tokens"}),i.jsxs("span",{className:ye.timelineValue,children:[Io(((u==null?void 0:u.inputTokens)??0)+((u==null?void 0:u.outputTokens)??0))," / ",Io(t.tokenBudget)]})]}),t.costBudgetMillicents>0&&i.jsxs("div",{className:ye.timelineRow,children:[i.jsx("span",{className:ye.timelineKey,children:"Cost"}),i.jsxs("span",{className:ye.timelineValue,children:[Ns((u==null?void 0:u.costMillicents)??0)," / ",Ns(t.costBudgetMillicents)]})]})]})]}),t.reviewNotes&&i.jsxs("div",{className:ye.overviewSection,"data-testid":"task-overview-review-notes",children:[i.jsx("div",{className:ye.overviewLabel,children:"Review Notes"}),i.jsx("div",{className:ye.reviewNotes,children:t.reviewNotes})]})]})}function bL({plugins:t,loading:s,onSetPluginEnabled:o}){return i.jsxs("div",{className:me.container,"data-testid":"plugins-panel",children:[i.jsx("h2",{className:me.heading,children:"Plugins"}),i.jsxs("div",{className:me.section,children:[i.jsx("p",{className:me.sectionDescription,children:"Enable or disable optional Grackle plugins. A server restart is required for changes to take effect."}),s&&i.jsx("p",{className:me.emptyState,children:"Loading plugins..."}),!s&&t.length===0&&i.jsx("p",{className:me.emptyState,children:"No plugins found."}),!s&&t.map(r=>{const c=r.enabled!==r.loaded;return i.jsxs("div",{className:me.tokenRow,"data-testid":`plugin-row-${r.name}`,children:[i.jsxs("div",{style:{flex:1},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx("span",{className:me.tokenName,children:r.name}),r.required&&i.jsx("span",{className:me.tokenBadge,title:"Required — cannot be disabled",children:"required"})]}),i.jsx("div",{className:me.tokenTarget,children:r.description}),c&&i.jsx("div",{style:{fontSize:"var(--font-size-xs)",color:"var(--accent-yellow)",marginTop:"2px"},"data-testid":`plugin-restart-notice-${r.name}`,children:"Restart Grackle to apply changes"})]}),i.jsx("label",{style:{display:"flex",alignItems:"center",gap:"6px",cursor:r.required?"not-allowed":"pointer"},title:r.required?"Core is required and cannot be disabled":void 0,children:i.jsx("input",{type:"checkbox",checked:r.enabled,disabled:r.required,onChange:d=>o(r.name,d.target.checked),"data-testid":`plugin-toggle-${r.name}`,"aria-label":`Enable or disable ${r.name} plugin`,style:{accentColor:"var(--accent-green)",width:"16px",height:"16px"}})})]},r.name)})]})]})}const xL="_container_legrg_1",_L="_header_legrg_8",kL="_headerTitle_legrg_35",SL="_badge_legrg_44",TL="_headerActions_legrg_54",jL="_body_legrg_61",wL="_formContent_legrg_73",NL="_section_legrg_85",CL="_label_legrg_91",EL="_nameInput_legrg_98",AL="_fieldInput_legrg_131",DL="_adapterSelect_legrg_164",ML="_readOnlyValue_legrg_198",RL="_codespaceSection_legrg_204",IL="_codespaceActions_legrg_210",OL="_creatingHint_legrg_216",BL="_errorHint_legrg_222",LL="_btnPrimary_legrg_235",zL="_btnGhost_legrg_266",ce={container:xL,header:_L,headerTitle:kL,badge:SL,headerActions:TL,body:jL,formContent:wL,section:NL,label:CL,nameInput:EL,fieldInput:AL,adapterSelect:DL,readOnlyValue:ML,codespaceSection:RL,codespaceActions:IL,creatingHint:OL,errorHint:BL,btnPrimary:LL,btnGhost:zL},id=1,od=65535;function Ep(t){if(!t.trim())return!0;const s=Number(t);return Number.isInteger(s)&&s>=id&&s<=od}function Ap(t){try{const s=JSON.parse(t);if(typeof s=="object"&&s!==null&&!Array.isArray(s))return s}catch{}return{}}function $L({codespaceName:t,onCodespaceNameChange:s,envName:o,onEnvNameChange:r,codespaces:c,codespaceError:d,codespaceListError:u,codespaceCreating:p,onCreateCodespace:m}){const[g,v]=b.useState("pick"),[x,y]=b.useState(""),[k,S]=b.useState("");return g==="create"?i.jsxs("div",{className:ce.codespaceSection,children:[i.jsxs("div",{className:ce.section,children:[i.jsx("label",{className:ce.label,children:"Repository"}),i.jsx("input",{type:"text",value:x,onChange:j=>y(j.target.value),placeholder:"owner/repo",className:ce.fieldInput,"data-testid":"env-codespace-repo"})]}),i.jsxs("div",{className:ce.section,children:[i.jsx("label",{className:ce.label,children:"Machine Type"}),i.jsx("input",{type:"text",value:k,onChange:j=>S(j.target.value),placeholder:"Machine type (optional)...",className:ce.fieldInput,"data-testid":"env-codespace-machine"})]}),i.jsxs("div",{className:ce.codespaceActions,children:[i.jsx("button",{onClick:()=>{x.trim()&&(m(x.trim(),k.trim()||void 0),v("pick"),y(""),S(""))},disabled:!x.trim(),className:ce.btnPrimary,children:"Create"}),i.jsx("button",{onClick:()=>{v("pick"),y(""),S("")},className:ce.btnGhost,children:"Cancel"})]})]}):i.jsx("div",{className:ce.codespaceSection,children:i.jsxs("div",{className:ce.section,children:[i.jsx("label",{className:ce.label,children:"Codespace"}),!u&&i.jsxs("select",{value:t,onChange:j=>{j.target.value==="__create__"?(v("create"),s("")):(s(j.target.value),j.target.value&&!o.trim()&&r(j.target.value))},disabled:p,className:ce.adapterSelect,"data-testid":"env-codespace-select",children:[i.jsx("option",{value:"",children:"Select a codespace..."}),c.map(j=>i.jsxs("option",{value:j.name,children:[j.name," (",j.repository,") — ",j.state]},j.name)),i.jsx("option",{value:"__create__",children:"Create new from repo..."})]}),p&&i.jsx("span",{className:ce.creatingHint,children:"Creating codespace..."}),u&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:ce.errorHint,children:u}),i.jsx("input",{type:"text",value:t,onChange:j=>s(j.target.value),placeholder:"Or enter codespace name manually...",className:ce.fieldInput,"data-testid":"env-codespace-manual"})]}),d&&!u&&i.jsx("span",{className:ce.errorHint,children:d})]})})}function V1({mode:t,environmentId:s,environments:o,onAddEnvironment:r,onUpdateEnvironment:c,onListCodespaces:d,codespaces:u,codespaceError:p,codespaceListError:m,codespaceCreating:g,onCreateCodespace:v,onShowToast:x}){const y=mt(),k=t==="edit",S=k&&s?o.find(ve=>ve.id===s):void 0,[j,N]=b.useState(""),[T,C]=b.useState("local"),[A,O]=b.useState(""),[E,D]=b.useState(""),[P,B]=b.useState(""),[z,J]=b.useState(""),[V,K]=b.useState(""),[fe,ee]=b.useState(""),[oe,M]=b.useState(""),[H,ne]=b.useState(null),he=b.useCallback(()=>{const ve={};if(T==="local"){if(A.trim()&&(ve.host=A.trim()),E.trim()){const Se=Number(E);Number.isInteger(Se)&&(ve.port=Se)}}else if(T==="ssh"){if(ve.host=A.trim(),P.trim()&&(ve.user=P.trim()),E.trim()){const Se=Number(E);Number.isInteger(Se)&&(ve.sshPort=Se)}z.trim()&&(ve.identityFile=z.trim())}else T==="docker"?(V.trim()&&(ve.image=V.trim()),fe.trim()&&(ve.repo=fe.trim())):T==="codespace"&&(ve.codespaceName=oe.trim());return ve},[T,A,E,P,z,V,fe,oe]),W=()=>!(!j.trim()||T==="ssh"&&!A.trim()||T==="codespace"&&!oe.trim()||(T==="local"||T==="ssh")&&!Ep(E)),X=()=>{W()&&(r(j.trim(),T,he()),x==null||x("Environment added successfully","success"),y(Ro,{replace:!0}))},de=()=>{y(s?Ai(s):Ro)},Ne=b.useCallback((ve,Se)=>{if(!S||!s)return;const xe=Ap(S.adapterConfig),Be=Se.trim();Be?xe[ve]=Be:delete xe[ve],c(s,{adapterConfig:xe})},[S,s,c]),Ue=b.useCallback((ve,Se)=>{if(!S||!s)return;const xe=Ap(S.adapterConfig);if(Se.trim()){const Be=Number(Se);Number.isInteger(Be)&&Be>=id&&Be<=od&&(xe[ve]=Be)}else delete xe[ve];c(s,{adapterConfig:xe})},[S,s,c]);if(k){if(!S)return i.jsxs("div",{className:ce.container,children:[i.jsxs("div",{className:ce.header,children:[i.jsx("div",{className:ce.headerTitle,children:i.jsx("span",{className:ce.badge,children:"edit environment"})}),i.jsx("div",{className:ce.headerActions,children:i.jsx("button",{onClick:de,className:ce.btnGhost,children:"Back"})})]}),i.jsx("div",{className:ce.body,children:i.jsx("div",{className:ce.formContent,children:i.jsx("span",{className:ce.readOnlyValue,children:"Environment not found"})})})]});const ve=Ap(S.adapterConfig);return i.jsxs("div",{className:ce.container,"data-testid":"env-edit-panel",children:[i.jsxs("div",{className:ce.header,children:[i.jsx("div",{className:ce.headerTitle,children:i.jsx("span",{className:ce.badge,children:"edit environment"})}),i.jsx("div",{className:ce.headerActions,children:i.jsx("button",{onClick:de,className:ce.btnGhost,"data-testid":"env-edit-back",children:"Back"})})]}),i.jsx("div",{className:ce.body,children:i.jsxs("div",{className:ce.formContent,children:[i.jsxs("div",{className:ce.section,children:[i.jsx("label",{className:ce.label,children:"Name"}),i.jsx(Ft,{value:S.displayName,onSave:Se=>{s&&c(s,{displayName:Se})},validate:Se=>Se.trim()===""?"Name cannot be empty":void 0,mode:"edit",fieldId:"name",activeFieldId:H,onActivate:ne,placeholder:"Environment name",ariaLabel:"Environment name","data-testid":"env-edit-name"})]}),i.jsxs("div",{className:ce.section,children:[i.jsx("label",{className:ce.label,children:"Adapter Type"}),i.jsx("span",{className:ce.readOnlyValue,"data-testid":"env-edit-adapter-type",children:S.adapterType})]}),S.adapterType==="local"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:ce.section,children:[i.jsx("label",{className:ce.label,children:"Host"}),i.jsx(Ft,{value:String(ve.host??""),onSave:Se=>Ne("host",Se),mode:"edit",fieldId:"host",activeFieldId:H,onActivate:ne,placeholder:"(default)",ariaLabel:"Host","data-testid":"env-edit-host"})]}),i.jsxs("div",{className:ce.section,children:[i.jsx("label",{className:ce.label,children:"Port"}),i.jsx(Ft,{value:String(ve.port??""),onSave:Se=>Ue("port",Se),validate:Se=>Ep(Se)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"port",activeFieldId:H,onActivate:ne,placeholder:"(default)",ariaLabel:"Port","data-testid":"env-edit-port"})]})]}),S.adapterType==="ssh"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:ce.section,children:[i.jsx("label",{className:ce.label,children:"Host"}),i.jsx(Ft,{value:String(ve.host??""),onSave:Se=>Ne("host",Se),validate:Se=>Se.trim()===""?"Host is required":void 0,mode:"edit",fieldId:"host",activeFieldId:H,onActivate:ne,placeholder:"hostname or IP",ariaLabel:"Host","data-testid":"env-edit-host"})]}),i.jsxs("div",{className:ce.section,children:[i.jsx("label",{className:ce.label,children:"User"}),i.jsx(Ft,{value:String(ve.user??""),onSave:Se=>Ne("user",Se),mode:"edit",fieldId:"user",activeFieldId:H,onActivate:ne,placeholder:"(default)",ariaLabel:"User","data-testid":"env-edit-user"})]}),i.jsxs("div",{className:ce.section,children:[i.jsx("label",{className:ce.label,children:"SSH Port"}),i.jsx(Ft,{value:String(ve.sshPort??""),onSave:Se=>Ue("sshPort",Se),validate:Se=>Ep(Se)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"sshPort",activeFieldId:H,onActivate:ne,placeholder:"22",ariaLabel:"SSH Port","data-testid":"env-edit-ssh-port"})]}),i.jsxs("div",{className:ce.section,children:[i.jsx("label",{className:ce.label,children:"Identity File"}),i.jsx(Ft,{value:String(ve.identityFile??""),onSave:Se=>Ne("identityFile",Se),mode:"edit",fieldId:"identityFile",activeFieldId:H,onActivate:ne,placeholder:"~/.ssh/id_rsa",ariaLabel:"Identity File","data-testid":"env-edit-identity-file"})]})]}),S.adapterType==="docker"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:ce.section,children:[i.jsx("label",{className:ce.label,children:"Image"}),i.jsx(Ft,{value:String(ve.image??""),onSave:Se=>Ne("image",Se),mode:"edit",fieldId:"image",activeFieldId:H,onActivate:ne,placeholder:"(default)",ariaLabel:"Image","data-testid":"env-edit-image"})]}),i.jsxs("div",{className:ce.section,children:[i.jsx("label",{className:ce.label,children:"Repo"}),i.jsx(Ft,{value:String(ve.repo??""),onSave:Se=>Ne("repo",Se),mode:"edit",fieldId:"repo",activeFieldId:H,onActivate:ne,placeholder:"(none)",ariaLabel:"Repo","data-testid":"env-edit-repo"})]})]}),S.adapterType==="codespace"&&i.jsxs("div",{className:ce.section,children:[i.jsx("label",{className:ce.label,children:"Codespace Name"}),i.jsx(Ft,{value:String(ve.codespaceName??""),onSave:Se=>Ne("codespaceName",Se),validate:Se=>Se.trim()===""?"Codespace name is required":void 0,mode:"edit",fieldId:"codespaceName",activeFieldId:H,onActivate:ne,placeholder:"codespace-name",ariaLabel:"Codespace Name","data-testid":"env-edit-codespace-name"})]})]})})]})}return i.jsxs("div",{className:ce.container,"data-testid":"env-create-panel",children:[i.jsxs("div",{className:ce.header,children:[i.jsx("div",{className:ce.headerTitle,children:i.jsx("span",{className:ce.badge,children:"new environment"})}),i.jsxs("div",{className:ce.headerActions,children:[i.jsx("button",{onClick:X,disabled:!W(),className:ce.btnPrimary,"data-testid":"env-create-submit",children:"Create"}),i.jsx("button",{onClick:de,className:ce.btnGhost,children:"Cancel"})]})]}),i.jsx("div",{className:ce.body,children:i.jsxs("div",{className:ce.formContent,children:[i.jsxs("div",{className:ce.section,children:[i.jsx("label",{className:ce.label,htmlFor:"env-create-name",children:"Name"}),i.jsx("input",{id:"env-create-name",type:"text",value:j,onChange:ve=>N(ve.target.value),placeholder:"Environment name...",autoFocus:!0,className:ce.nameInput,"data-testid":"env-create-name",onKeyDown:ve=>{ve.key==="Enter"&&W()&&X()}})]}),i.jsxs("div",{className:ce.section,children:[i.jsx("label",{className:ce.label,htmlFor:"env-create-adapter",children:"Adapter Type"}),i.jsxs("select",{id:"env-create-adapter",value:T,onChange:ve=>{C(ve.target.value),ve.target.value==="codespace"&&d()},className:ce.adapterSelect,"data-testid":"env-create-adapter",children:[i.jsx("option",{value:"local",children:"local"}),i.jsx("option",{value:"ssh",children:"ssh"}),i.jsx("option",{value:"docker",children:"docker"}),i.jsx("option",{value:"codespace",children:"codespace"})]})]}),T==="local"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:ce.section,children:[i.jsx("label",{className:ce.label,htmlFor:"env-create-host",children:"Host"}),i.jsx("input",{id:"env-create-host",type:"text",value:A,onChange:ve=>O(ve.target.value),placeholder:"Host (optional)...",className:ce.fieldInput,"data-testid":"env-create-host"})]}),i.jsxs("div",{className:ce.section,children:[i.jsx("label",{className:ce.label,htmlFor:"env-create-port",children:"Port"}),i.jsx("input",{id:"env-create-port",type:"number",min:id,max:od,value:E,onChange:ve=>D(ve.target.value),placeholder:"Port (optional)...",className:ce.fieldInput,"data-testid":"env-create-port"})]})]}),T==="ssh"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:ce.section,children:[i.jsx("label",{className:ce.label,htmlFor:"env-create-host",children:"Host"}),i.jsx("input",{id:"env-create-host",type:"text",value:A,onChange:ve=>O(ve.target.value),placeholder:"Host (required)...",className:ce.fieldInput,"data-testid":"env-create-host"})]}),i.jsxs("div",{className:ce.section,children:[i.jsx("label",{className:ce.label,htmlFor:"env-create-user",children:"User"}),i.jsx("input",{id:"env-create-user",type:"text",value:P,onChange:ve=>B(ve.target.value),placeholder:"User (optional)...",className:ce.fieldInput,"data-testid":"env-create-user"})]}),i.jsxs("div",{className:ce.section,children:[i.jsx("label",{className:ce.label,htmlFor:"env-create-port",children:"SSH Port"}),i.jsx("input",{id:"env-create-port",type:"number",min:id,max:od,value:E,onChange:ve=>D(ve.target.value),placeholder:"SSH port (optional)...",className:ce.fieldInput,"data-testid":"env-create-port"})]}),i.jsxs("div",{className:ce.section,children:[i.jsx("label",{className:ce.label,htmlFor:"env-create-identity",children:"Identity File"}),i.jsx("input",{id:"env-create-identity",type:"text",value:z,onChange:ve=>J(ve.target.value),placeholder:"Identity file (optional)...",className:ce.fieldInput,"data-testid":"env-create-identity"})]})]}),T==="docker"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:ce.section,children:[i.jsx("label",{className:ce.label,htmlFor:"env-create-image",children:"Image"}),i.jsx("input",{id:"env-create-image",type:"text",value:V,onChange:ve=>K(ve.target.value),placeholder:"Image (optional)...",className:ce.fieldInput,"data-testid":"env-create-image"})]}),i.jsxs("div",{className:ce.section,children:[i.jsx("label",{className:ce.label,htmlFor:"env-create-repo",children:"Repo"}),i.jsx("input",{id:"env-create-repo",type:"text",value:fe,onChange:ve=>ee(ve.target.value),placeholder:"Repo (optional)...",className:ce.fieldInput,"data-testid":"env-create-repo"})]})]}),T==="codespace"&&i.jsx($L,{codespaceName:oe,onCodespaceNameChange:M,envName:j,onEnvNameChange:N,codespaces:u,codespaceError:p,codespaceListError:m,codespaceCreating:g,onCreateCodespace:v})]})})]})}const PL="_group_1iprv_1",UL="_groupTitle_1iprv_8",HL="_shortcutList_1iprv_17",VL="_shortcutRow_1iprv_23",qL="_keys_1iprv_36",GL="_kbd_1iprv_43",FL="_description_1iprv_60",ki={group:PL,groupTitle:UL,shortcutList:HL,shortcutRow:VL,keys:qL,kbd:GL,description:FL},ZL=[{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 KL(){return i.jsxs("section",{className:me.section,"data-testid":"keyboard-shortcuts-panel",children:[i.jsx("h3",{className:me.sectionTitle,children:"Keyboard Shortcuts"}),i.jsx("p",{className:me.sectionDescription,children:"Keyboard shortcuts for navigating and interacting with Grackle. Global shortcuts are suppressed while typing in text fields."}),ZL.map(t=>i.jsxs("div",{className:ki.group,children:[i.jsx("h4",{className:ki.groupTitle,children:t.title}),i.jsx("div",{className:ki.shortcutList,children:t.shortcuts.map(s=>i.jsxs("div",{className:ki.shortcutRow,children:[i.jsx("span",{className:ki.keys,children:s.keys.map(o=>i.jsx("kbd",{className:ki.kbd,children:o},o))}),i.jsx("span",{className:ki.description,children:s.description})]},s.description))})]},t.title))]})}const YL=[{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 JL({credentialProviders:t,onUpdateCredentialProviders:s}){const o=(r,c)=>{const d={...t};r==="claude"?d.claude=c:d[r]=c,s(d)};return i.jsxs("section",{className:me.section,children:[i.jsx("h3",{className:me.sectionTitle,children:"Credential Providers"}),i.jsx("p",{className:me.sectionDescription,children:"Enable providers to automatically forward credentials to environments at task start. Credentials are read fresh from the host each time."}),i.jsx("div",{className:me.tokenList,children:YL.map(r=>i.jsxs("div",{className:me.tokenRow,children:[i.jsx("span",{className:me.tokenName,children:r.label}),i.jsx("span",{className:me.tokenTarget,children:r.description}),i.jsx("select",{className:me.select,value:t[r.key],onChange:c=>o(r.key,c.target.value),children:r.options.map(c=>i.jsx("option",{value:c.value,children:c.label},c.value))})]},r.key))})]})}const WL="_container_10efq_1",XL="_header_10efq_7",QL="_list_10efq_105",e8="_card_10efq_111",t8="_cardHeader_10efq_125",n8="_cardTitle_10efq_135",s8="_defaultBadge_10efq_141",a8="_cardActions_10efq_155",i8="_description_10efq_160",o8="_meta_10efq_166",r8="_empty_10efq_212",l8="_typeBadge_10efq_362",Xn={container:WL,header:XL,list:QL,card:e8,cardHeader:t8,cardTitle:n8,defaultBadge:s8,cardActions:a8,description:i8,meta:o8,empty:r8,typeBadge:l8};function c8({personas:t,appDefaultPersonaId:s,onDeletePersona:o,onSetAppDefaultPersonaId:r,onNavigateToNew:c,onNavigateToPersona:d}){const[u,p]=b.useState(null),m=u?t.find(v=>v.id===u):void 0,g=async v=>{await o(v),p(null)};return i.jsxs("div",{className:Xn.container,children:[i.jsxs("div",{className:Xn.header,children:[i.jsx("h2",{children:"Personas"}),i.jsx(tn,{variant:"primary",size:"md",onClick:c,"data-testid":"persona-new-button",children:"+ New Persona"})]}),t.length===0?i.jsx("p",{className:Xn.empty,children:"No personas yet. Create one to get started."}):i.jsx("div",{className:Xn.list,children:t.map(v=>{const x=s===v.id,y=v.type==="script";return i.jsxs("div",{className:Xn.card,"data-testid":`persona-card-${v.id}`,onClick:()=>d(v.id),role:"button",tabIndex:0,onKeyDown:k=>{k.currentTarget===k.target&&(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),d(v.id))},children:[i.jsxs("div",{className:Xn.cardHeader,children:[i.jsxs("span",{className:Xn.cardTitle,children:[i.jsx("strong",{children:v.name}),i.jsx("span",{className:Xn.typeBadge,"data-testid":`persona-type-badge-${v.id}`,children:y?"Script":"Agent"}),x&&i.jsx("span",{className:Xn.defaultBadge,"data-testid":`persona-default-badge-${v.id}`,children:"App Default"})]}),i.jsxs("div",{className:Xn.cardActions,onClick:k=>k.stopPropagation(),children:[!x&&i.jsx(tn,{variant:"ghost",size:"sm",onClick:()=>{r(v.id).catch(()=>{})},"data-testid":`persona-set-default-${v.id}`,title:"Set as app default persona",children:"Set Default"}),i.jsx(tn,{variant:"ghost",size:"sm",onClick:()=>d(v.id),children:"Edit"}),i.jsx(tn,{variant:"ghost",size:"sm",onClick:()=>p(v.id),"data-testid":`persona-delete-${v.id}`,children:"Delete"})]})]}),v.description&&i.jsx("p",{className:Xn.description,children:v.description}),i.jsxs("div",{className:Xn.meta,children:[v.runtime&&i.jsxs("span",{children:["Runtime: ",v.runtime]}),v.model&&i.jsxs("span",{children:["Model: ",v.model]}),v.maxTurns>0&&i.jsxs("span",{children:["Max turns: ",v.maxTurns]})]})]},v.id)})}),i.jsx(oa,{isOpen:u!==null,title:"Delete Persona?",description:`"${(m==null?void 0:m.name)??""}" will be permanently removed.`,confirmLabel:"Delete",onConfirm:()=>{u&&g(u).catch(()=>{})},onCancel:()=>p(null)})]})}const d8="_container_uy08i_1",u8="_header_uy08i_7",f8="_count_uy08i_13",p8="_presets_uy08i_18",m8="_presetButton_uy08i_24",h8="_filterInput_uy08i_41",g8="_groups_uy08i_53",v8="_group_uy08i_53",y8="_groupHeader_uy08i_68",b8="_groupName_uy08i_77",x8="_groupCount_uy08i_81",_8="_toolList_uy08i_87",k8="_toolItem_uy08i_95",S8="_toolName_uy08i_103",gn={container:d8,header:u8,count:f8,presets:p8,presetButton:m8,filterInput:h8,groups:g8,group:v8,groupHeader:y8,groupName:b8,groupCount:x8,toolList:_8,toolItem:k8,toolName:S8},T8=(()=>{const t=new Map;for(const s of _x){const o=s==="get_version_status"?"version":s.split("_")[0];t.has(o)||t.set(o,[]),t.get(o).push(s)}return[...t.entries()].sort(([s],[o])=>s.localeCompare(o)).map(([s,o])=>({group:s,tools:o.sort()}))})(),j8=[{name:"default",label:"Default",tools:kx},{name:"worker",label:"Worker",tools:DT},{name:"orchestrator",label:"Orchestrator",tools:MT},{name:"admin",label:"Admin",tools:RT}];function nx({selectedTools:t,onChange:s,disabled:o}){const[r,c]=b.useState(""),d=b.useMemo(()=>new Set(t),[t]),u=b.useCallback(v=>{if(o)return;const x=new Set(d);x.has(v)?x.delete(v):x.add(v),s([...x].sort())},[d,s,o]),p=b.useCallback((v,x)=>{if(o)return;const y=new Set(d);for(const k of v)x?y.delete(k):y.add(k);s([...y].sort())},[d,s,o]),m=b.useCallback(v=>{o||s([...v].sort())},[s,o]),g=r.toLowerCase();return i.jsxs("div",{className:gn.container,"data-testid":"mcp-tool-selector",children:[i.jsx("div",{className:gn.header,children:i.jsx("span",{className:gn.count,children:t.length===0?`Using default (${kx.length} tools)`:`${t.length} of ${_x.size} tools selected`})}),i.jsxs("div",{className:gn.presets,"data-testid":"mcp-tool-presets",children:[j8.map(v=>i.jsx("button",{type:"button",className:gn.presetButton,disabled:o,onClick:()=>m(v.tools),"data-testid":`preset-${v.name}`,children:v.label},v.name)),i.jsx("button",{type:"button",className:gn.presetButton,disabled:o,onClick:()=>s([]),"data-testid":"preset-clear",children:"Clear"})]}),i.jsx("input",{type:"text",className:gn.filterInput,placeholder:"Filter tools...",value:r,onChange:v=>c(v.target.value),disabled:o,"data-testid":"mcp-tool-filter"}),i.jsx("div",{className:gn.groups,children:T8.map(({group:v,tools:x})=>{const y=g?x.filter(S=>S.toLowerCase().includes(g)):x;if(y.length===0)return null;const k=y.every(S=>d.has(S));return i.jsxs("div",{className:gn.group,"data-testid":`tool-group-${v}`,children:[i.jsxs("label",{className:gn.groupHeader,children:[i.jsx("input",{type:"checkbox",checked:k,onChange:()=>p(y,k),disabled:o,"data-testid":`group-toggle-${v}`}),i.jsx("span",{className:gn.groupName,children:v}),i.jsxs("span",{className:gn.groupCount,children:["(",y.filter(S=>d.has(S)).length,"/",y.length,")"]})]}),i.jsx("div",{className:gn.toolList,children:y.map(S=>i.jsxs("label",{className:gn.toolItem,children:[i.jsx("input",{type:"checkbox",checked:d.has(S),onChange:()=>u(S),disabled:o,"data-testid":`tool-${S}`}),i.jsx("span",{className:gn.toolName,children:S})]},S))})]},v)})})]})}const w8="_container_1gfuq_1",N8="_header_1gfuq_7",C8="_list_1gfuq_19",E8="_card_1gfuq_25",A8="_cardHeader_1gfuq_40",D8="_cardTitle_1gfuq_46",M8="_statusBadge_1gfuq_56",R8="_enabled_1gfuq_68",I8="_disabled_1gfuq_71",O8="_cardActions_1gfuq_75",B8="_cardMeta_1gfuq_80",L8="_empty_1gfuq_98",Qn={container:w8,header:N8,list:C8,card:E8,cardHeader:A8,cardTitle:D8,statusBadge:M8,enabled:R8,disabled:I8,cardActions:O8,cardMeta:B8,empty:L8};function z8({schedules:t,personas:s,onDeleteSchedule:o,onToggleEnabled:r,onNavigateToNew:c,onNavigateToSchedule:d}){const[u,p]=b.useState(null),m=u?t.find(y=>y.id===u):void 0,g=async y=>{await o(y),p(null)},v=b.useMemo(()=>{const y=new Map;for(const k of s)y.set(k.id,k.name);return y},[s]),x=y=>v.get(y)??y;return i.jsxs("div",{className:Qn.container,children:[i.jsxs("div",{className:Qn.header,children:[i.jsx("h2",{children:"Schedules"}),i.jsx(tn,{variant:"primary",size:"md",onClick:c,"data-testid":"schedule-new-button",children:"+ New Schedule"})]}),t.length===0?i.jsx("p",{className:Qn.empty,"data-testid":"schedule-empty-state",children:"No schedules yet. Create one to run tasks on a recurring cadence."}):i.jsx("div",{className:Qn.list,children:t.map(y=>i.jsxs("div",{className:Qn.card,"data-testid":`schedule-card-${y.id}`,onClick:()=>d(y.id),role:"button",tabIndex:0,onKeyDown:k=>{k.currentTarget===k.target&&(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),d(y.id))},children:[i.jsxs("div",{className:Qn.cardHeader,children:[i.jsxs("span",{className:Qn.cardTitle,children:[i.jsx("strong",{children:y.title}),i.jsx("span",{className:`${Qn.statusBadge} ${y.enabled?Qn.enabled:Qn.disabled}`,"data-testid":`schedule-status-badge-${y.id}`,children:y.enabled?"Enabled":"Disabled"})]}),i.jsxs("div",{className:Qn.cardActions,onClick:k=>k.stopPropagation(),children:[i.jsx(tn,{variant:"ghost",size:"sm",onClick:()=>{(async()=>{await r(y.id,{enabled:!y.enabled})})().catch(()=>{})},"data-testid":`schedule-toggle-${y.id}`,title:y.enabled?"Disable schedule":"Enable schedule",children:y.enabled?"Disable":"Enable"}),i.jsx(tn,{variant:"ghost",size:"sm",onClick:()=>d(y.id),"data-testid":`schedule-edit-${y.id}`,children:"Edit"}),i.jsx(tn,{variant:"ghost",size:"sm",onClick:()=>p(y.id),"data-testid":`schedule-delete-${y.id}`,children:"Delete"})]})]}),i.jsxs("div",{className:Qn.cardMeta,children:[i.jsx("span",{"data-testid":`schedule-expression-${y.id}`,children:y.scheduleExpression}),y.personaId&&i.jsxs("span",{"data-testid":`schedule-persona-${y.id}`,children:["Persona: ",x(y.personaId)]}),i.jsxs("span",{"data-testid":`schedule-last-run-${y.id}`,children:["Last run: ",y.lastRunAt?$o(y.lastRunAt):"Never"]}),y.enabled&&y.nextRunAt?i.jsxs("span",{"data-testid":`schedule-next-run-${y.id}`,children:["Next run: ",O1(y.nextRunAt)]}):null,y.runCount>0&&i.jsxs("span",{"data-testid":`schedule-run-count-${y.id}`,children:["Runs: ",y.runCount]})]})]},y.id))}),i.jsx(oa,{isOpen:u!==null,title:"Delete Schedule?",description:`"${(m==null?void 0:m.title)??""}" will be permanently removed. Tasks already created by this schedule will not be affected.`,confirmLabel:"Delete",onConfirm:()=>{u&&g(u).catch(()=>{})},onCancel:()=>p(null)})]})}const $8="_nav_1bhou_1",P8="_tab_1bhou_24",U8="_tabIcon_1bhou_62",H8="_tabActive_1bhou_68",Fc={nav:$8,tab:P8,tabIcon:U8,tabActive:H8},Qs=[{path:"credentials",label:"Credentials",icon:i.jsx(H2,{size:Nt})},{path:"personas",label:"Personas",icon:i.jsx(yj,{size:Nt})},{path:"schedules",label:"Schedules",icon:i.jsx(x2,{size:Nt})},{path:"appearance",label:"Appearance",icon:i.jsx(aj,{size:Nt})},{path:"shortcuts",label:"Shortcuts",icon:i.jsx(q2,{size:Nt})},{path:"plugins",label:"Plugins",icon:i.jsx(dj,{size:Nt})},{path:"about",label:"About",icon:i.jsx(gm,{size:Nt})}];function V8(){var u;const t=Yt(),s=mt(),o=b.useRef(null),r=((u=Qs.find(p=>{const m=`${wi}/${p.path}`;return t.pathname===m||t.pathname.startsWith(`${m}/`)}))==null?void 0:u.path)??Qs[0].path,c=b.useCallback(p=>{s(`${wi}/${p}`)},[s]),d=b.useCallback(p=>{var k,S;const m=(k=o.current)==null?void 0:k.querySelectorAll('[role="tab"]');if(!m)return;const g=Array.from(m).findIndex(j=>j===document.activeElement),v=g>=0?g:Qs.findIndex(j=>j.path===r);let x=v;if(p.key==="ArrowDown"||p.key==="j"||p.key==="J")p.preventDefault(),x=(v+1)%Qs.length;else if(p.key==="ArrowUp"||p.key==="k"||p.key==="K")p.preventDefault(),x=(v-1+Qs.length)%Qs.length;else if(p.key==="Home")p.preventDefault(),x=0;else if(p.key==="End")p.preventDefault(),x=Qs.length-1;else return;const y=Qs[x].path;s(`${wi}/${y}`),(S=m[x])==null||S.focus()},[r,s]);return i.jsx("nav",{className:Fc.nav,ref:o,role:"tablist","aria-orientation":"vertical","aria-label":"Settings",onKeyDown:d,children:Qs.map(p=>{const m=p.path===r;return i.jsxs("button",{role:"tab",type:"button","aria-selected":m,tabIndex:m?0:-1,className:`${Fc.tab} ${m?Fc.tabActive:""}`,onClick:()=>c(p.path),children:[i.jsx("span",{className:Fc.tabIcon,"aria-hidden":"true",children:p.icon}),p.label]},p.path)})})}function q8({tasks:t,taskStatusById:s,sessionStatusByTaskId:o}){const r=new Map;for(const d of t)if(d.parentTaskId){const u=r.get(d.parentTaskId);u?u.push(d):r.set(d.parentTaskId,[d])}const c=new Map(by.map(d=>[d,[]]));for(const d of t){const u=fl(d.status),p=d.dependsOn.length>0&&d.dependsOn.some(S=>s.get(S)!=="complete"),m=r.get(d.id)??[],g=m.length,v=m.filter(S=>S.status==="complete").length;let x;if(u==="paused"&&o){const S=o.get(d.id);S==="idle"?x="Needs input":S==="completed"&&(x="Ready to complete")}const y={task:d,isBlocked:p,childCount:g,doneChildCount:v,pausedSubBadge:x},k=c.get(u);k?k.push(y):c.get("not_started").push(y)}for(const d of c.values())d.sort((u,p)=>u.task.sortOrder-p.task.sortOrder);return by.map(d=>{const u=qa(d);return{status:d,label:u.label,style:u,tasks:c.get(d)??[]}})}const G8="_boardContainer_1c4y1_1",F8="_column_1c4y1_17",Z8="_columnHeader_1c4y1_34",K8="_columnIcon_1c4y1_47",Y8="_columnLabel_1c4y1_52",J8="_columnCount_1c4y1_57",W8="_cardList_1c4y1_67",X8="_emptyPlaceholder_1c4y1_76",Q8="_card_1c4y1_67",e7="_cardHeader_1c4y1_107",t7="_cardStatusIcon_1c4y1_113",n7="_cardTitle_1c4y1_119",s7="_cardBadges_1c4y1_127",a7="_badge_1c4y1_134",i7="_blockedBadge_1c4y1_146",o7="_childBadge_1c4y1_151",r7="_depBadge_1c4y1_155",l7="_parentBadge_1c4y1_159",c7="_pausedSubBadge_1c4y1_166",d7="_personaBadge_1c4y1_170",u7="_envBadge_1c4y1_174",f7="_emptyCta_1c4y1_178",p7="_ctaButton_1c4y1_188",m7="_ctaDescription_1c4y1_204",it={boardContainer:G8,column:F8,columnHeader:Z8,columnIcon:K8,columnLabel:Y8,columnCount:J8,cardList:W8,emptyPlaceholder:X8,card:Q8,cardHeader:e7,cardStatusIcon:t7,cardTitle:n7,cardBadges:s7,badge:a7,blockedBadge:i7,childBadge:o7,depBadge:r7,parentBadge:l7,pausedSubBadge:c7,personaBadge:d7,envBadge:u7,emptyCta:f7,ctaButton:p7,ctaDescription:m7};function h7({workspaceId:t,environmentId:s,tasks:o,sessions:r,personas:c,environments:d}){const u=mt(),p=b.useMemo(()=>o.filter(y=>y.workspaceId===t),[o,t]),m=b.useMemo(()=>new Map(o.map(y=>[y.id,y.status])),[o]),g=b.useMemo(()=>new Map(p.map(y=>[y.id,y])),[p]),v=b.useMemo(()=>{const y=new Map(r.map(C=>[C.id,C])),k=new Map(c.map(C=>[C.id,C])),S=new Map(d.map(C=>[C.id,C])),j=new Map,N=new Map,T=new Map;for(const C of p)if(C.latestSessionId){const A=y.get(C.latestSessionId);if(A){if(j.set(C.id,A.endReason||A.status),A.personaId){const O=k.get(A.personaId);O&&N.set(C.id,O.name)}if(A.environmentId){const O=S.get(A.environmentId);O&&T.set(C.id,O.displayName)}}}return{sessionStatusByTaskId:j,personaNameByTaskId:N,environmentNameByTaskId:T}},[p,r,c,d]),x=b.useMemo(()=>q8({tasks:p,taskStatusById:m,sessionStatusByTaskId:v.sessionStatusByTaskId}),[p,m,v]);return p.length===0?i.jsxs("div",{className:it.emptyCta,"data-testid":"board-empty-cta",children:[i.jsx("button",{className:it.ctaButton,onClick:()=>u(Ii(t,void 0,s)),children:"Create Task"}),i.jsx("div",{className:it.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}):i.jsx("div",{className:it.boardContainer,"data-testid":"board-container",children:x.map(y=>i.jsxs("section",{className:it.column,"data-testid":`board-column-${y.status}`,"aria-label":`${y.label}, ${y.tasks.length} ${y.tasks.length===1?"task":"tasks"}`,children:[i.jsxs("div",{className:it.columnHeader,children:[i.jsx("span",{className:it.columnIcon,style:{color:y.style.color},children:y.style.icon}),i.jsx("span",{className:it.columnLabel,children:y.label}),i.jsx("span",{className:it.columnCount,"data-testid":`board-count-${y.status}`,children:y.tasks.length})]}),i.jsx("div",{className:it.cardList,children:y.tasks.length===0?i.jsx("div",{className:it.emptyPlaceholder,children:"No tasks"}):i.jsx(gs,{mode:"popLayout",children:y.tasks.map(k=>i.jsx(Rt.div,{layout:!0,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},children:i.jsx(g7,{boardTask:k,tasksById:g,personaName:v.personaNameByTaskId.get(k.task.id),envName:v.environmentNameByTaskId.get(k.task.id),onClick:()=>u(On(k.task.id,void 0,t,s))})},k.task.id))})})]},y.status))})}function g7({boardTask:t,tasksById:s,personaName:o,envName:r,onClick:c}){const{task:d,isBlocked:u,childCount:p,doneChildCount:m,pausedSubBadge:g}=t,v=qa(d.status),x=d.parentTaskId?s.get(d.parentTaskId):void 0;return i.jsxs("div",{className:it.card,tabIndex:0,role:"button","data-testid":`board-card-${d.id}`,onClick:c,onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),c())},children:[i.jsxs("div",{className:it.cardHeader,children:[i.jsx("span",{className:it.cardStatusIcon,style:{color:v.color},children:v.icon}),i.jsx("span",{className:it.cardTitle,children:d.title})]}),i.jsxs("div",{className:it.cardBadges,children:[x&&i.jsx("span",{className:`${it.badge} ${it.parentBadge}`,title:x.title,children:x.title}),p>0&&i.jsxs("span",{className:`${it.badge} ${it.childBadge}`,children:[m,"/",p]}),u&&i.jsx("span",{className:`${it.badge} ${it.blockedBadge}`,children:"blocked"}),d.dependsOn.length>0&&!u&&i.jsx("span",{className:`${it.badge} ${it.depBadge}`,children:"dep"}),g&&i.jsx("span",{className:`${it.badge} ${it.pausedSubBadge}`,children:g}),o&&i.jsx("span",{className:`${it.badge} ${it.personaBadge}`,children:o}),r&&i.jsx("span",{className:`${it.badge} ${it.envBadge}`,children:r})]})]})}const v7="_formContent_ymnez_1",y7="_section_ymnez_13",b7="_label_ymnez_19",x7="_titleInput_ymnez_26",_7="_descriptionTextarea_ymnez_58",k7="_selectField_ymnez_94",S7="_checkboxRow_ymnez_128",T7="_checkboxLabel_ymnez_141",j7="_fieldError_ymnez_146",xt={formContent:v7,section:y7,label:b7,titleInput:x7,descriptionTextarea:_7,selectField:k7,checkboxRow:S7,checkboxLabel:T7,fieldError:j7};function w7(t,s){return{name:(t==null?void 0:t.name)??"",description:(t==null?void 0:t.description)??"",repoUrl:(t==null?void 0:t.repoUrl)??"",environmentId:(t==null?void 0:t.linkedEnvironmentIds[0])??s??"",defaultPersonaId:(t==null?void 0:t.defaultPersonaId)??"",useWorktrees:(t==null?void 0:t.useWorktrees)??!0,workingDirectory:(t==null?void 0:t.workingDirectory)??""}}const N7=100;function C7({values:t,onChange:s,environments:o,personas:r,errors:c,disabled:d,autoFocusName:u}){const p=(m,g)=>{s({...t,[m]:g})};return i.jsxs("div",{className:xt.formContent,children:[i.jsxs("div",{className:xt.section,children:[i.jsx("label",{className:xt.label,htmlFor:"ws-name",children:"Name"}),i.jsx("input",{id:"ws-name",className:xt.titleInput,type:"text",value:t.name,onChange:m=>p("name",m.target.value),placeholder:"Workspace name",maxLength:N7,autoFocus:u,disabled:d,"data-testid":"workspace-form-name"}),(c==null?void 0:c.name)&&i.jsx("span",{className:xt.fieldError,"data-testid":"workspace-form-error-name",children:c.name})]}),i.jsxs("div",{className:xt.section,children:[i.jsx("label",{className:xt.label,htmlFor:"ws-description",children:"Description"}),i.jsx("textarea",{id:"ws-description",className:xt.descriptionTextarea,value:t.description,onChange:m=>p("description",m.target.value),placeholder:"Optional description (Markdown supported)",disabled:d,"data-testid":"workspace-form-description"})]}),i.jsxs("div",{className:xt.section,children:[i.jsx("label",{className:xt.label,htmlFor:"ws-repo",children:"Repository URL"}),i.jsx("input",{id:"ws-repo",className:xt.titleInput,type:"text",value:t.repoUrl,onChange:m=>p("repoUrl",m.target.value),placeholder:"https://github.com/org/repo",disabled:d,"data-testid":"workspace-form-repo"}),(c==null?void 0:c.repoUrl)&&i.jsx("span",{className:xt.fieldError,"data-testid":"workspace-form-error-repoUrl",children:c.repoUrl})]}),i.jsxs("div",{className:xt.section,children:[i.jsx("label",{className:xt.label,htmlFor:"ws-environment",children:"Environment"}),i.jsxs("select",{id:"ws-environment",className:xt.selectField,value:t.environmentId,onChange:m=>p("environmentId",m.target.value),disabled:d,"data-testid":"workspace-form-environment",children:[i.jsx("option",{value:"",children:"Select environment…"}),o.map(m=>i.jsx("option",{value:m.id,children:m.displayName||m.id},m.id))]}),(c==null?void 0:c.environmentId)&&i.jsx("span",{className:xt.fieldError,"data-testid":"workspace-form-error-environmentId",children:c.environmentId})]}),i.jsxs("div",{className:xt.section,children:[i.jsx("label",{className:xt.label,htmlFor:"ws-persona",children:"Default Persona"}),i.jsxs("select",{id:"ws-persona",className:xt.selectField,value:t.defaultPersonaId,onChange:m=>p("defaultPersonaId",m.target.value),disabled:d,"data-testid":"workspace-form-persona",children:[i.jsx("option",{value:"",children:"(Inherit)"}),r.map(m=>i.jsx("option",{value:m.id,children:m.name},m.id))]})]}),i.jsx("div",{className:xt.section,children:i.jsxs("label",{className:xt.checkboxRow,children:[i.jsx("input",{type:"checkbox",checked:t.useWorktrees,onChange:m=>p("useWorktrees",m.target.checked),disabled:d,"data-testid":"workspace-form-worktrees"}),i.jsx("span",{className:xt.checkboxLabel,children:"Enable worktree isolation"})]})}),i.jsxs("div",{className:xt.section,children:[i.jsx("label",{className:xt.label,htmlFor:"ws-workdir",children:"Working Directory"}),i.jsx("input",{id:"ws-workdir",className:xt.titleInput,type:"text",value:t.workingDirectory,onChange:m=>p("workingDirectory",m.target.value),placeholder:"Default (server default)",disabled:d,"data-testid":"workspace-form-workdir"})]})]})}const q1=b.createContext(void 0),E7=4e3;function A7({children:t}){const[s,o]=b.useState([]),r=b.useRef(0),c=b.useCallback(u=>{o(p=>p.filter(m=>m.id!==u))},[]),d=b.useCallback((u,p="info",m=E7)=>{const g=`toast-${++r.current}`;o(v=>[...v,{id:g,message:u,variant:p,duration:m}])},[]);return i.jsx(q1.Provider,{value:{toasts:s,showToast:d,dismissToast:c},children:t})}function pn(){const t=b.useContext(q1);if(!t)throw new Error("useToast must be used within ToastProvider");return t}const um="grackle-theme",G1="grackle-prefer-system",F1="(prefers-color-scheme: dark)";let Kr=[],rd;function Dp(){rd=void 0;for(const t of Kr)t()}function fm(){return typeof window>"u"?!1:window.matchMedia(F1).matches}function el(){if(typeof localStorage>"u")return ex;try{const t=localStorage.getItem(um);if(t!==null&&U1.has(t))return t}catch{}return ex}function xd(){if(typeof localStorage>"u")return!1;try{return localStorage.getItem(G1)==="true"}catch{return!1}}function pm(t){return Ld.find(s=>s.variantLightId===t||s.variantDarkId===t)}function Z1(t,s){const o=dm(t);if(o!=null&&o.variantDarkId)return s&&o.variantLightId?fm()?o.variantDarkId:o.variantLightId:o.variantDarkId;if(o!=null&&o.hidden&&s){const r=pm(t);if(r!=null&&r.variantLightId&&r.variantDarkId)return fm()?r.variantDarkId:r.variantLightId}return t}function No(t,s,o=!1){o&&document.documentElement.classList.add("no-transitions"),document.documentElement.dataset.theme=Z1(t,s),o&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove("no-transitions")}))}typeof document<"u"&&No(el(),xd());function D7(){return rd===void 0&&(rd={themeId:el(),systemDark:fm(),preferSystem:xd()}),rd}function M7(t){return Kr=[...Kr,t],()=>{Kr=Kr.filter(s=>s!==t)}}function R7(){const t=b.useSyncExternalStore(M7,D7),{themeId:s,preferSystem:o}=t,r=Z1(s,o),c=b.useCallback(u=>{if(U1.has(u)){try{localStorage.setItem(um,u)}catch{}No(u,xd(),!0),Dp()}},[]),d=b.useCallback(u=>{try{localStorage.setItem(G1,u?"true":"false")}catch{}if(u){const p=el(),m=dm(p);if(m!=null&&m.hidden){const g=pm(p);if(g)try{localStorage.setItem(um,g.id)}catch{}}}No(el(),u,!0),Dp()},[]);return b.useEffect(()=>{No(s,o)},[s,o]),b.useEffect(()=>{if(typeof window>"u")return;const u=window.matchMedia(F1),p=()=>{const m=el(),g=xd();if(g){const v=dm(m);if(v!=null&&v.variantDarkId&&v.variantLightId&&No(m,g),v!=null&&v.hidden){const x=pm(m);x!=null&&x.variantDarkId&&x.variantLightId&&No(m,g)}}Dp()};return u.addEventListener("change",p),()=>{u.removeEventListener("change",p)}},[]),{themeId:s,setTheme:c,resolvedThemeId:r,preferSystem:o,setPreferSystem:d}}const K1=b.createContext(void 0);function I7({children:t}){const s=R7();return i.jsx(K1.Provider,{value:s,children:t})}function Y1(){const t=b.useContext(K1);if(!t)throw new Error("useThemeContext must be used within ThemeProvider");return t}const J1=b.createContext(void 0),W1=b.createContext(void 0);function O7({children:t}){const[s,o]=b.useState(void 0),r=b.useCallback(c=>{o(c)},[]);return i.jsx(W1.Provider,{value:r,children:i.jsx(J1.Provider,{value:s,children:t})})}function B7(){return b.useContext(J1)}function L7(){const t=b.useContext(W1);if(t===void 0)throw new Error("useSidebarSetter must be used within a SidebarProvider");return t}const uh=b.createContext(void 0);function ot(){const t=b.useContext(uh);if(!t)throw new Error("useGrackle must be used within GrackleProvider");return t}function X1(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Q1(t,s){return console.warn(`[ws] Malformed "${t}" message: ${s}`),!1}function z7(t){return X1(t)&&typeof t.sessionId=="string"&&typeof t.eventType=="string"&&typeof t.timestamp=="string"&&typeof t.content=="string"&&(t.raw===void 0||typeof t.raw=="string")}const $7=new Set(["off","subscription","api_key"]),Zc=new Set(["off","on"]);function P7(t){return X1(t)&&$7.has(t.claude)&&Zc.has(t.github)&&Zc.has(t.copilot)&&Zc.has(t.codex)&&Zc.has(t.goose)}function ek(t){switch(t){case"waiting_input":return"idle";case"completed":return"stopped";case"killed":return"stopped";case"failed":return"stopped";case"interrupted":return"stopped";case"terminated":return"stopped";default:return t}}function tk(t){switch(t){case"completed":return"completed";case"killed":return"killed";case"failed":return"interrupted";case"interrupted":return"interrupted";case"terminated":return"terminated";default:return}}const wo=5e3;function U7(t,s){const o=[];let r=t;const c=new Set;for(;r&&s.has(r)&&!c.has(r);){c.add(r);const d=s.get(r);o.unshift(d),r=d.parentTaskId||void 0}return o}const ra={label:"Home",url:Di};function H7(t){return t?[ra,{label:"Settings",url:wi},{label:t,url:void 0}]:[ra,{label:"Settings",url:void 0}]}const fh={label:"Environments",url:Ro};function V7(){return[ra,{label:"Environments",url:void 0}]}function q7(){return[ra,{label:"New Chat",url:void 0}]}function G7(t){return[ra,{label:`Session ${t.slice(0,8)}`,url:void 0}]}function F7(t,s,o,r){const c=o.find(u=>u.id===t),d=r.find(u=>u.id===s);return[ra,fh,{label:(d==null?void 0:d.displayName)??"Environment",url:Ai(s)},{label:(c==null?void 0:c.name)??"Workspace",url:void 0}]}function Z7(t,s,o,r,c){const d=U7(t,c),u=c.get(t),p=u==null?void 0:u.workspaceId,m=p?o.find(k=>k.id===p):void 0,g=s??(m==null?void 0:m.linkedEnvironmentIds[0]),v=g?r.find(k=>k.id===g):void 0,x=[ra];v&&g&&(x.push(fh),x.push({label:v.displayName,url:Ai(g)})),m&&g&&x.push({label:m.name,url:Ei(m.id,g)});for(let k=0;k<d.length-1;k++)x.push({label:d[k].title,url:On(d[k].id,void 0,p,g)});const y=d[d.length-1];return x.push({label:(y==null?void 0:y.title)??t,url:void 0}),x}const K7={label:"Findings",url:Ad};function Y7(){return[ra,{label:"Findings",url:void 0}]}function nk(t,s,o,r,c){const d=[ra];if(s&&o){const u=r.find(m=>m.id===s),p=c.find(m=>m.id===o);d.push(fh),p&&d.push({label:p.displayName,url:Ai(o)}),u&&d.push({label:u.name,url:Ei(s,o)}),d.push({label:"Findings",url:NN(s,o)})}else d.push(K7);return d.push({label:t,url:void 0}),d}function ph(t){const s=[];for(const o of t){const r=s[s.length-1];o.eventType==="text"&&(r==null?void 0:r.eventType)==="text"?s[s.length-1]={...r,content:r.content+o.content}:s.push(o)}return s}function Kc(t){if(typeof t.id=="string")return t.id;const s=t.data;if(s&&typeof s.toolCallId=="string")return s.toolCallId;const o=t.item;if(o&&typeof o.id=="string")return o.id}function J7(t){if(typeof t.tool_use_id=="string")return t.tool_use_id;const s=t.data;if(s&&typeof s.toolCallId=="string")return s.toolCallId;const o=t.item;if(o&&typeof o.id=="string")return o.id}function mh(t){const s=new Map;for(const v of t)if(v.raw)try{s.set(v,JSON.parse(v.raw))}catch{}const o=new Map;for(const v of t){if(v.eventType!=="tool_use")continue;const x=s.get(v),y=x?Kc(x):void 0;if(y)try{const k=JSON.parse(v.content);o.set(y,{tool:k.tool,args:k.args})}catch{}}const r=new Set,c=new Set,d=t.map((v,x)=>{if(v.eventType!=="tool_result")return v;const y=s.get(v),k=y?J7(y):void 0;if(!k)return v;const S=o.get(k);if(!S)return v;r.add(k),c.add(x);let j;const N=v.content.trim();if(N.startsWith("{"))try{const T=JSON.parse(N);typeof T.detailedContent=="string"&&(j=T.detailedContent)}catch{}return{...v,toolUseCtx:{...S,detailedResult:j}}}),u=[];for(let v=0;v<d.length;v++){if(d[v].eventType!=="tool_use")continue;const x=s.get(d[v]),y=x?Kc(x):void 0;y&&r.has(y)||u.push(v)}const p=[];for(let v=0;v<d.length;v++)d[v].eventType!=="tool_result"||c.has(v)||p.push(v);let m=0;for(const v of u){for(;m<p.length&&p[m]<v;)m++;if(m>=p.length)break;const x=p[m];if(x!==v+1)continue;const y=d[v],k=d[x];let S;try{const j=JSON.parse(y.content);S={tool:j.tool,args:j.args}}catch{}if(S){let j;const N=k.content.trim();if(N.startsWith("{"))try{const A=JSON.parse(N);typeof A.detailedContent=="string"&&(j=A.detailedContent)}catch{}d[x]={...k,toolUseCtx:{...S,detailedResult:j}},c.add(x);const T=s.get(y),C=T?Kc(T):void 0;C?r.add(C):(r.add(`__seq_${v}`),s.set(y,{...T??{},__seqId:`__seq_${v}`})),m++}}const g=d.filter(v=>{if(v.eventType!=="tool_use")return!0;const x=s.get(v);if(!x)return!0;const y=Kc(x);if(y&&r.has(y))return!1;const k=x.__seqId;return!(k&&r.has(k))});for(let v=0;v<g.length;v++){if(g[v].eventType!=="tool_use")continue;let x=!1;for(let y=v+1;y<g.length;y++)if(g[y].eventType!=="tool_use"){x=!0;break}x&&(g[v]={...g[v],settled:!0})}return g}function W7(t,s,o){const r=t.filter(m=>m.status==="running"||m.status==="idle"||m.status==="waiting").length,c=sk(s),d=s.filter(m=>mm(m,c)).length,u=s.filter(m=>m.status==="paused"||m.status==="failed"||mm(m,c)).length,p=o.filter(m=>m.status==="disconnected"||m.status==="error").length;return{activeSessions:r,blockedTasks:d,attentionTasks:u,unhealthyEnvironments:p}}function sk(t){const s=new Map;for(const o of t)s.set(o.id,o.status);return s}function mm(t,s){return t.dependsOn.some(o=>s.get(o)!=="complete")}function X7(t,s){var u;const o=new Map;for(const p of s)o.set(p.id,p);const r=sk(t),c=[];for(const p of t){const m=p.workspaceId?((u=o.get(p.workspaceId))==null?void 0:u.name)??"Unknown":"Unknown";p.status==="failed"?c.push({task:p,reason:"failed",workspaceName:m}):mm(p,r)?c.push({task:p,reason:"blocked",workspaceName:m}):p.status==="paused"&&c.push({task:p,reason:"paused",workspaceName:m})}const d={failed:0,blocked:1,paused:2};return c.sort((p,m)=>(d[p.reason]??3)-(d[m.reason]??3)),c}function Q7(t,s){const o=new Map;for(const r of s)o.set(r.id,r);return t.filter(r=>r.status==="running"||r.status==="idle"||r.status==="waiting").map(r=>{var c;return{session:r,environmentName:((c=o.get(r.environmentId))==null?void 0:c.displayName)??"Unknown"}})}function ez(t,s,o){const r=new Map;for(const c of s){if(!c.workspaceId)continue;let d=r.get(c.workspaceId);d||(d={totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0},r.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 t.map(c=>{const d=r.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 ws=[{id:"kn-auth-flow",label:"Authentication Flow",kind:"knowledge",category:"concept",content:"The application uses JWT Bearer tokens for stateless authentication. Access tokens expire after 24h. Refresh tokens are stored in the database and rotated on use. The auth middleware verifies tokens and attaches the decoded payload to req.user.",tags:["auth","jwt","security"],workspaceId:"proj-alpha",createdAt:"2026-02-25T10:30:00Z",updatedAt:"2026-02-27T08:15:00Z",val:5},{id:"kn-db-schema",label:"Database Schema",kind:"knowledge",category:"concept",content:"PostgreSQL database with tables: users, sessions, refresh_tokens, audit_log. Uses UUID primary keys, TIMESTAMPTZ for all timestamps, and JSONB for flexible metadata columns. Connection pooling via pg-pool with per-tenant isolation.",tags:["database","postgres","schema"],workspaceId:"proj-alpha",createdAt:"2026-02-23T11:00:00Z",updatedAt:"2026-02-26T22:45:00Z",val:4},{id:"kn-error-handling",label:"Error Response Pattern",kind:"knowledge",category:"concept",content:"All API errors follow the shape { error: string, code: string, details?: unknown }. HTTP status codes map to: 400 (validation), 401 (unauthenticated), 403 (forbidden), 404 (not found), 409 (conflict), 429 (rate limited), 500 (internal).",tags:["api","errors","patterns"],workspaceId:"proj-alpha",createdAt:"2026-02-27T08:17:00Z",updatedAt:"2026-02-27T08:17:00Z",val:3},{id:"kn-rate-limiting",label:"Rate Limiting Strategy",kind:"knowledge",category:"concept",content:"Token-bucket algorithm with in-memory state per client IP. Default rate: 100 requests/minute, burst: 20. Returns 429 with Retry-After header. Redis adapter available for multi-instance deployments.",tags:["api","rate-limiting","infrastructure"],workspaceId:"proj-alpha",createdAt:"2026-02-27T09:00:00Z",updatedAt:"2026-02-27T09:00:00Z",val:2},{id:"kn-etl-pipeline",label:"ETL Pipeline Architecture",kind:"knowledge",category:"concept",content:"Data pipelines follow an Extract-Transform-Load pattern with pluggable stages. Each stage reads from a source (Postgres, S3, API), transforms via configurable mappers, and loads into a target (Parquet, BigQuery, S3). Incremental loads use high-watermark tracking.",tags:["etl","pipeline","architecture"],workspaceId:"proj-beta",createdAt:"2026-02-26T08:00:00Z",updatedAt:"2026-02-27T09:05:00Z",val:4},{id:"kn-parquet-format",label:"Parquet Output Format",kind:"knowledge",category:"concept",content:"Parquet files are written with row-group buffering (configurable batch size, default 10000 rows). Supports Snappy, ZSTD, and GZIP compression. Schema is derived from the internal column type system using Arrow type mapping.",tags:["parquet","data-format","compression"],workspaceId:"proj-beta",createdAt:"2026-02-26T08:05:00Z",updatedAt:"2026-02-26T08:15:00Z",val:3},{id:"kn-jwt-over-session",label:"JWT over Session Auth",kind:"knowledge",category:"decision",content:"Chose JWT tokens over server-side sessions for stateless auth. Rationale: (1) no session store needed, (2) works across microservices without shared state, (3) supports mobile clients natively. Trade-off: tokens can't be revoked instantly (mitigated by short expiry + refresh rotation).",tags:["auth","decision","jwt"],workspaceId:"proj-alpha",createdAt:"2026-02-25T10:00:00Z",updatedAt:"2026-02-25T10:00:00Z",val:3},{id:"kn-pg-pool-decision",label:"pg-pool over Knex",kind:"knowledge",category:"decision",content:"Chose pg-pool over Knex for connection pooling. pg-pool gives direct control over idle timeout, max connections, and health check queries. Knex wraps pg-pool and adds query-building overhead we don't need since we write raw SQL with parameterized queries.",tags:["database","decision","postgres"],workspaceId:"proj-alpha",createdAt:"2026-02-23T11:30:00Z",updatedAt:"2026-02-23T11:30:00Z",val:2},{id:"kn-watermark-decision",label:"Local Watermark Storage",kind:"knowledge",category:"decision",content:"Currently using local SQLite for watermark storage. This works for single-worker pipelines but needs to move to a shared store (Redis or Postgres) for production multi-worker scenarios. Tracked as a follow-up task.",tags:["pipeline","decision","watermarks"],workspaceId:"proj-beta",createdAt:"2026-02-27T09:05:00Z",updatedAt:"2026-02-27T09:05:00Z",val:2},{id:"kn-jwt-middleware",label:"JWT Verify Middleware",kind:"knowledge",category:"snippet",content:`\`\`\`typescript
|
|
285
|
-
export function verifyToken(req: Request, res: Response, next: NextFunction): void {
|
|
286
|
-
const header = req.headers.authorization;
|
|
287
|
-
if (!header?.startsWith("Bearer ")) {
|
|
288
|
-
res.status(401).json({ error: "Missing token" });
|
|
289
|
-
return;
|
|
290
|
-
}
|
|
291
|
-
const decoded = jwt.verify(header.slice(7), JWT_SECRET) as JwtPayload;
|
|
292
|
-
req.user = decoded;
|
|
293
|
-
next();
|
|
294
|
-
}
|
|
295
|
-
\`\`\``,tags:["auth","jwt","middleware","typescript"],workspaceId:"proj-alpha",createdAt:"2026-02-27T08:15:14Z",updatedAt:"2026-02-27T08:15:14Z",val:2},{id:"kn-audit-schema",label:"Audit Log Schema",kind:"knowledge",category:"snippet",content:`\`\`\`sql
|
|
296
|
-
CREATE TABLE audit_log (
|
|
297
|
-
id BIGSERIAL PRIMARY KEY,
|
|
298
|
-
user_id UUID REFERENCES users(id),
|
|
299
|
-
action TEXT NOT NULL,
|
|
300
|
-
entity_type TEXT NOT NULL,
|
|
301
|
-
entity_id TEXT NOT NULL,
|
|
302
|
-
old_value JSONB,
|
|
303
|
-
new_value JSONB,
|
|
304
|
-
ip_address INET,
|
|
305
|
-
created_at TIMESTAMPTZ DEFAULT now()
|
|
306
|
-
);
|
|
307
|
-
\`\`\``,tags:["database","audit","schema","sql"],workspaceId:"proj-alpha",createdAt:"2026-02-26T22:45:15Z",updatedAt:"2026-02-26T22:45:15Z",val:2},{id:"kn-n1-query",label:"N+1 Query in User List",kind:"knowledge",category:"insight",content:"GET /api/users performs a separate query for each user's role metadata, resulting in N+1 queries. For 500 users this adds ~2 seconds of latency. Solution: use a JOIN or batch lookup to fetch all role data in a single query.",tags:["performance","database","n+1"],workspaceId:"proj-alpha",createdAt:"2026-02-22T09:30:00Z",updatedAt:"2026-02-22T09:30:00Z",val:2},{id:"kn-session-race",label:"Session Cleanup Race Condition",kind:"knowledge",category:"insight",content:"When two concurrent requests hit /api/logout, the second call throws a 500 because the session row has already been deleted. Fix: use DELETE ... RETURNING or add IF EXISTS guard to make the operation idempotent.",tags:["bug","concurrency","sessions"],workspaceId:"proj-alpha",createdAt:"2026-02-26T22:50:00Z",updatedAt:"2026-02-26T22:50:00Z",val:2},{id:"kn-ref-task-001",label:"JWT Auth Task",kind:"reference",sourceType:"task",sourceId:"task-001",content:"Implement JWT authentication across all protected routes, replacing session-based auth.",workspaceId:"proj-alpha",createdAt:"2026-02-25T10:00:00Z",updatedAt:"2026-02-27T08:15:00Z",val:3},{id:"kn-ref-task-006",label:"Parquet Export Task",kind:"reference",sourceType:"task",sourceId:"task-006",content:"Add Parquet export support for pipeline outputs, enabling downstream Spark consumption.",workspaceId:"proj-beta",createdAt:"2026-02-26T08:00:00Z",updatedAt:"2026-02-27T09:00:00Z",val:3},{id:"kn-ref-sess-001",label:"Auth Middleware Session",kind:"reference",sourceType:"session",sourceId:"sess-001",content:"Active session implementing JWT auth middleware, rewrote auth.ts, login.ts, and test suite.",workspaceId:"proj-alpha",createdAt:"2026-02-27T08:15:00Z",updatedAt:"2026-02-27T08:15:42Z",val:2}],za=[{source:"kn-auth-flow",target:"kn-jwt-over-session",type:"decided_by"},{source:"kn-auth-flow",target:"kn-jwt-middleware",type:"implemented_by"},{source:"kn-auth-flow",target:"kn-ref-task-001",type:"tracked_in"},{source:"kn-auth-flow",target:"kn-error-handling",type:"relates_to"},{source:"kn-jwt-over-session",target:"kn-ref-task-001",type:"motivated_by"},{source:"kn-db-schema",target:"kn-pg-pool-decision",type:"decided_by"},{source:"kn-db-schema",target:"kn-audit-schema",type:"contains"},{source:"kn-db-schema",target:"kn-n1-query",type:"affected_by"},{source:"kn-db-schema",target:"kn-session-race",type:"affected_by"},{source:"kn-rate-limiting",target:"kn-error-handling",type:"relates_to"},{source:"kn-rate-limiting",target:"kn-auth-flow",type:"depends_on"},{source:"kn-etl-pipeline",target:"kn-parquet-format",type:"outputs_to"},{source:"kn-etl-pipeline",target:"kn-watermark-decision",type:"decided_by"},{source:"kn-etl-pipeline",target:"kn-ref-task-006",type:"tracked_in"},{source:"kn-parquet-format",target:"kn-ref-task-006",type:"tracked_in"},{source:"kn-watermark-decision",target:"kn-etl-pipeline",type:"relates_to"},{source:"kn-ref-task-001",target:"kn-ref-sess-001",type:"has_session"},{source:"kn-jwt-middleware",target:"kn-ref-sess-001",type:"created_in"},{source:"kn-audit-schema",target:"kn-db-schema",type:"part_of"}],tz=new Map(ws.map(t=>[t.id,t]));function Mp(t){const s=tz.get(t);if(!s)throw new Error(`MOCK_KNOWLEDGE_NODES is missing node "${t}"`);return s}const sx={"kn-auth-flow":{node:Mp("kn-auth-flow"),edges:[{fromId:"kn-auth-flow",toId:"kn-jwt-over-session",type:"decided_by"},{fromId:"kn-auth-flow",toId:"kn-jwt-middleware",type:"implemented_by"},{fromId:"kn-auth-flow",toId:"kn-ref-task-001",type:"tracked_in"},{fromId:"kn-auth-flow",toId:"kn-error-handling",type:"relates_to"},{fromId:"kn-rate-limiting",toId:"kn-auth-flow",type:"depends_on"}]},"kn-db-schema":{node:Mp("kn-db-schema"),edges:[{fromId:"kn-db-schema",toId:"kn-pg-pool-decision",type:"decided_by"},{fromId:"kn-db-schema",toId:"kn-audit-schema",type:"contains"},{fromId:"kn-db-schema",toId:"kn-n1-query",type:"affected_by"},{fromId:"kn-db-schema",toId:"kn-session-race",type:"affected_by"},{fromId:"kn-audit-schema",toId:"kn-db-schema",type:"part_of"}]},"kn-etl-pipeline":{node:Mp("kn-etl-pipeline"),edges:[{fromId:"kn-etl-pipeline",toId:"kn-parquet-format",type:"outputs_to"},{fromId:"kn-etl-pipeline",toId:"kn-watermark-decision",type:"decided_by"},{fromId:"kn-etl-pipeline",toId:"kn-ref-task-006",type:"tracked_in"},{fromId:"kn-watermark-decision",toId:"kn-etl-pipeline",type:"relates_to"}]}},nz=[{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},{id:"error-env",displayName:"Error Test",adapterType:"local",adapterConfig:"{}",status:"connected",bootstrapped:!0}],sz=[{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,costMillicents:41e3},{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,costMillicents:22e3},{id:"sess-002",environmentId:"env-docker-01",runtime:"copilot",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,costMillicents:18e3},{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,costMillicents:31e3},{id:"sess-004",environmentId:"env-docker-01",runtime:"codex",status:"running",prompt:"Implement rate limiting for the public API",startedAt:"2026-02-27T09:00:00Z",inputTokens:18900,outputTokens:4500,costMillicents:1e4},{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,costMillicents:38e3}],az=[{sessionId:"sess-001-prev",eventType:"status",timestamp:"2026-02-26T14:00:01Z",content:"running"},{sessionId:"sess-001-prev",eventType:"system",timestamp:"2026-02-26T14:00:02Z",content:`You are a senior backend engineer. Focus on security best practices and thorough testing.
|
|
308
|
-
Project: acme/alpha — Node.js + Express REST API
|
|
309
|
-
Task: Implement auth middleware using JWT tokens`,raw:JSON.stringify({systemContext:!0})},{sessionId:"sess-001-prev",eventType:"text",timestamp:"2026-02-26T14:00:05Z",content:"I'll start by reading the current authentication middleware to understand what needs to change."},{sessionId:"sess-001-prev",eventType:"tool_use",timestamp:"2026-02-26T14:00:06Z",content:JSON.stringify({tool:"Read",args:{file_path:"src/middleware/auth.ts"}}),raw:JSON.stringify({id:"tu-prev-001",type:"tool_use"})},{sessionId:"sess-001-prev",eventType:"tool_result",timestamp:"2026-02-26T14:00:07Z",content:`import session from "express-session";
|
|
310
|
-
import type { Request, Response, NextFunction } from "express";
|
|
311
|
-
|
|
312
|
-
export function requireAuth(req: Request, res: Response, next: NextFunction): void {
|
|
313
|
-
if (!req.session?.userId) {
|
|
314
|
-
res.status(401).json({ error: "Not authenticated" });
|
|
315
|
-
return;
|
|
316
|
-
}
|
|
317
|
-
next();
|
|
318
|
-
}`,raw:JSON.stringify({tool_use_id:"tu-prev-001"})},{sessionId:"sess-001-prev",eventType:"text",timestamp:"2026-02-26T14:00:10Z",content:"The current auth uses express-session with server-side session storage. Let me find all files that depend on this pattern."},{sessionId:"sess-001-prev",eventType:"tool_use",timestamp:"2026-02-26T14:00:11Z",content:JSON.stringify({tool:"Grep",args:{pattern:"req\\.session",path:"src/"}}),raw:JSON.stringify({id:"tu-prev-002",type:"tool_use"})},{sessionId:"sess-001-prev",eventType:"tool_result",timestamp:"2026-02-26T14:00:12Z",content:`src/middleware/auth.ts:4: if (!req.session?.userId) {
|
|
319
|
-
src/routes/login.ts:18: req.session.userId = user.id;
|
|
320
|
-
src/routes/login.ts:19: req.session.role = user.role;
|
|
321
|
-
src/routes/protected.ts:7: const userId = req.session.userId;`,raw:JSON.stringify({tool_use_id:"tu-prev-002"})},{sessionId:"sess-001-prev",eventType:"usage",timestamp:"2026-02-26T14:30:00Z",content:JSON.stringify({input_tokens:42100,output_tokens:6350,cost_millicents:21e3})},{sessionId:"sess-001-prev",eventType:"text",timestamp:"2026-02-26T14:30:02Z",content:"Found 3 files using session-based auth. Now let me read the login route and the protected route to understand the full flow before making changes."},{sessionId:"sess-001-prev",eventType:"tool_use",timestamp:"2026-02-26T14:30:03Z",content:JSON.stringify({tool:"Read",args:{file_path:"src/routes/login.ts"}}),raw:JSON.stringify({id:"tu-prev-003",type:"tool_use"})},{sessionId:"sess-001-prev",eventType:"tool_result",timestamp:"2026-02-26T14:30:04Z",content:`import { Router } from "express";
|
|
322
|
-
import bcrypt from "bcrypt";
|
|
323
|
-
import { db } from "../db.js";
|
|
324
|
-
|
|
325
|
-
const router = Router();
|
|
326
|
-
|
|
327
|
-
router.post("/login", async (req, res) => {
|
|
328
|
-
const { email, password } = req.body;
|
|
329
|
-
const user = await db.users.findByEmail(email);
|
|
330
|
-
if (!user || !await bcrypt.compare(password, user.passwordHash)) {
|
|
331
|
-
return res.status(401).json({ error: "Invalid credentials" });
|
|
332
|
-
}
|
|
333
|
-
req.session.userId = user.id;
|
|
334
|
-
req.session.role = user.role;
|
|
335
|
-
res.json({ ok: true });
|
|
336
|
-
});
|
|
337
|
-
|
|
338
|
-
export default router;`,raw:JSON.stringify({tool_use_id:"tu-prev-003"})},{sessionId:"sess-001-prev",eventType:"error",timestamp:"2026-02-26T15:12:00Z",content:"Context window exceeded before completing implementation"},{sessionId:"sess-001-prev",eventType:"status",timestamp:"2026-02-26T15:12:01Z",content:"interrupted"},{sessionId:"sess-001",eventType:"status",timestamp:"2026-02-27T08:15:01Z",content:"running"},{sessionId:"sess-001",eventType:"system",timestamp:"2026-02-27T08:15:02Z",content:`You are a senior backend engineer. Focus on security best practices and thorough testing.
|
|
339
|
-
Project: acme/alpha — Node.js + Express REST API
|
|
340
|
-
Task: Implement auth middleware using JWT tokens
|
|
341
|
-
|
|
342
|
-
Note: A previous session attempted this task but was interrupted. Pick up where it left off.`,raw:JSON.stringify({systemContext:!0})},{sessionId:"sess-001",eventType:"text",timestamp:"2026-02-27T08:15:04Z",content:"I'll pick up the JWT auth migration. The previous session identified 3 files that need updating. Let me verify the current state and start implementing."},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:04.5Z",content:JSON.stringify({tool:"TodoWrite",args:{todos:[{content:"Install jsonwebtoken package",activeForm:"Installing jsonwebtoken",status:"pending"},{content:"Rewrite auth middleware for JWT",activeForm:"Rewriting auth middleware",status:"pending"},{content:"Update login route to issue tokens",activeForm:"Updating login route",status:"pending"},{content:"Update protected routes",activeForm:"Updating protected routes",status:"pending"},{content:"Fix and update tests",activeForm:"Fixing tests",status:"pending"},{content:"Run full test suite",activeForm:"Running tests",status:"pending"}]}})},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:05Z",content:JSON.stringify({tool:"Grep",args:{pattern:"express-session|req\\.session",path:"src/",output_mode:"files_with_matches"}}),raw:JSON.stringify({id:"tu-001-01",type:"tool_use"})},{sessionId:"sess-001",eventType:"tool_result",timestamp:"2026-02-27T08:15:06Z",content:`src/middleware/auth.ts
|
|
343
|
-
src/routes/login.ts
|
|
344
|
-
src/routes/protected.ts`,raw:JSON.stringify({tool_use_id:"tu-001-01"})},{sessionId:"sess-001",eventType:"text",timestamp:"2026-02-27T08:15:08Z",content:"Good, same 3 files. Let me install the JWT library first, then rewrite the middleware."},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:09Z",content:JSON.stringify({tool:"Bash",args:{command:"npm install jsonwebtoken && npm install -D @types/jsonwebtoken"}}),raw:JSON.stringify({id:"tu-001-02",type:"tool_use"})},{sessionId:"sess-001",eventType:"tool_result",timestamp:"2026-02-27T08:15:11Z",content:`added 12 packages in 3.2s
|
|
345
|
-
|
|
346
|
-
added 1 package in 0.8s`,raw:JSON.stringify({tool_use_id:"tu-001-02"})},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:11.5Z",content:JSON.stringify({tool:"TodoWrite",args:{todos:[{content:"Install jsonwebtoken package",activeForm:"Installing jsonwebtoken",status:"completed"},{content:"Rewrite auth middleware for JWT",activeForm:"Rewriting auth middleware",status:"in_progress"},{content:"Update login route to issue tokens",activeForm:"Updating login route",status:"pending"},{content:"Update protected routes",activeForm:"Updating protected routes",status:"pending"},{content:"Fix and update tests",activeForm:"Fixing tests",status:"pending"},{content:"Run full test suite",activeForm:"Running tests",status:"pending"}]}})},{sessionId:"sess-001",eventType:"text",timestamp:"2026-02-27T08:15:12Z",content:"Now I'll rewrite the auth middleware to use JWT verification instead of session checks."},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:13Z",content:JSON.stringify({tool:"Write",args:{file_path:"src/middleware/auth.ts",content:`import jwt from "jsonwebtoken";
|
|
347
|
-
import type { Request, Response, NextFunction } from "express";
|
|
348
|
-
|
|
349
|
-
const JWT_SECRET = process.env.JWT_SECRET || "change-me";
|
|
350
|
-
|
|
351
|
-
export interface JwtPayload {
|
|
352
|
-
userId: string;
|
|
353
|
-
role: string;
|
|
354
|
-
iat: number;
|
|
355
|
-
exp: number;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
export function verifyToken(req: Request, res: Response, next: NextFunction): void {
|
|
359
|
-
const header = req.headers.authorization;
|
|
360
|
-
if (!header?.startsWith("Bearer ")) {
|
|
361
|
-
res.status(401).json({ error: "Missing or malformed token" });
|
|
362
|
-
return;
|
|
363
|
-
}
|
|
364
|
-
try {
|
|
365
|
-
const decoded = jwt.verify(header.slice(7), JWT_SECRET) as JwtPayload;
|
|
366
|
-
req.user = decoded;
|
|
367
|
-
next();
|
|
368
|
-
} catch (err) {
|
|
369
|
-
if (err instanceof jwt.TokenExpiredError) {
|
|
370
|
-
res.status(401).json({ error: "Token expired" });
|
|
371
|
-
} else {
|
|
372
|
-
res.status(403).json({ error: "Invalid token" });
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
`}}),raw:JSON.stringify({id:"tu-001-03",type:"tool_use"})},{sessionId:"sess-001",eventType:"tool_result",timestamp:"2026-02-27T08:15:14Z",content:"File written: src/middleware/auth.ts (32 lines)",raw:JSON.stringify({tool_use_id:"tu-001-03"})},{sessionId:"sess-001",eventType:"text",timestamp:"2026-02-27T08:15:16Z",content:`Now I need to update the login route to issue JWT tokens instead of setting session data.
|
|
377
|
-
|
|
378
|
-
The new login flow will:
|
|
379
|
-
1. Validate credentials (unchanged)
|
|
380
|
-
2. Generate a JWT with \`userId\` and \`role\` claims
|
|
381
|
-
3. Return the token in the response body
|
|
382
|
-
4. Include a refresh token for long-lived sessions`},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:17Z",content:JSON.stringify({tool:"Write",args:{file_path:"src/routes/login.ts",content:`import { Router } from "express";
|
|
383
|
-
import bcrypt from "bcrypt";
|
|
384
|
-
import jwt from "jsonwebtoken";
|
|
385
|
-
import crypto from "node:crypto";
|
|
386
|
-
import { db } from "../db.js";
|
|
387
|
-
|
|
388
|
-
const JWT_SECRET = process.env.JWT_SECRET || "change-me";
|
|
389
|
-
const ACCESS_TOKEN_EXPIRY = "24h";
|
|
390
|
-
const REFRESH_TOKEN_BYTES = 48;
|
|
391
|
-
|
|
392
|
-
const router = Router();
|
|
393
|
-
|
|
394
|
-
router.post("/login", async (req, res) => {
|
|
395
|
-
const { email, password } = req.body;
|
|
396
|
-
const user = await db.users.findByEmail(email);
|
|
397
|
-
if (!user || !(await bcrypt.compare(password, user.passwordHash))) {
|
|
398
|
-
return res.status(401).json({ error: "Invalid credentials" });
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
const accessToken = jwt.sign(
|
|
402
|
-
{ userId: user.id, role: user.role },
|
|
403
|
-
JWT_SECRET,
|
|
404
|
-
{ expiresIn: ACCESS_TOKEN_EXPIRY },
|
|
405
|
-
);
|
|
406
|
-
|
|
407
|
-
const refreshToken = crypto.randomBytes(REFRESH_TOKEN_BYTES).toString("hex");
|
|
408
|
-
await db.refreshTokens.create({ userId: user.id, token: refreshToken });
|
|
409
|
-
|
|
410
|
-
res.json({ accessToken, refreshToken, expiresIn: ACCESS_TOKEN_EXPIRY });
|
|
411
|
-
});
|
|
412
|
-
|
|
413
|
-
export default router;
|
|
414
|
-
`}}),raw:JSON.stringify({id:"tu-001-04",type:"tool_use"})},{sessionId:"sess-001",eventType:"tool_result",timestamp:"2026-02-27T08:15:18Z",content:"File written: src/routes/login.ts (33 lines)",raw:JSON.stringify({tool_use_id:"tu-001-04"})},{sessionId:"sess-001",eventType:"text",timestamp:"2026-02-27T08:15:20Z",content:"Let me update the protected route to use the new `req.user` shape from the JWT payload."},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:21Z",content:JSON.stringify({tool:"Edit",args:{file_path:"src/routes/protected.ts",old_string:"const userId = req.session.userId;",new_string:"const { userId } = req.user as JwtPayload;"}}),raw:JSON.stringify({id:"tu-001-05",type:"tool_use"})},{sessionId:"sess-001",eventType:"tool_result",timestamp:"2026-02-27T08:15:22Z",content:"Updated src/routes/protected.ts",raw:JSON.stringify({tool_use_id:"tu-001-05"})},{sessionId:"sess-001",eventType:"text",timestamp:"2026-02-27T08:15:24Z",content:"Now let me run the existing tests to make sure nothing is broken, then I'll add new JWT-specific tests."},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:25Z",content:JSON.stringify({tool:"Bash",args:{command:"npm test"}}),raw:JSON.stringify({id:"tu-001-06",type:"tool_use"})},{sessionId:"sess-001",eventType:"tool_result",timestamp:"2026-02-27T08:15:30Z",content:` PASS src/routes/__tests__/login.test.ts
|
|
415
|
-
PASS src/routes/__tests__/protected.test.ts
|
|
416
|
-
FAIL src/middleware/__tests__/auth.test.ts
|
|
417
|
-
x should reject missing session (12ms)
|
|
418
|
-
x should allow valid session (8ms)
|
|
419
|
-
|
|
420
|
-
2 failed, 12 passed, 14 total
|
|
421
|
-
|
|
422
|
-
Test Suites: 1 failed, 2 passed, 3 total`,raw:JSON.stringify({tool_use_id:"tu-001-06",is_error:!0})},{sessionId:"sess-001",eventType:"text",timestamp:"2026-02-27T08:15:32Z",content:`Two tests failed because they still test the old session-based auth. I need to rewrite those tests for JWT.
|
|
423
|
-
|
|
424
|
-
Let me update the auth middleware tests:`},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:33Z",content:JSON.stringify({tool:"Write",args:{file_path:"src/middleware/__tests__/auth.test.ts",content:`import { describe, it, expect } from "vitest";
|
|
425
|
-
import jwt from "jsonwebtoken";
|
|
426
|
-
import { verifyToken } from "../auth.js";
|
|
427
|
-
import { createMockReqRes } from "../../test-utils/mock-express.js";
|
|
428
|
-
|
|
429
|
-
const SECRET = "test-secret";
|
|
430
|
-
process.env.JWT_SECRET = SECRET;
|
|
431
|
-
|
|
432
|
-
describe("verifyToken", () => {
|
|
433
|
-
it("should reject requests without Authorization header", () => {
|
|
434
|
-
const { req, res, next } = createMockReqRes();
|
|
435
|
-
verifyToken(req, res, next);
|
|
436
|
-
expect(res.status).toHaveBeenCalledWith(401);
|
|
437
|
-
});
|
|
438
|
-
|
|
439
|
-
it("should reject expired tokens", () => {
|
|
440
|
-
const token = jwt.sign({ userId: "u1", role: "user" }, SECRET, { expiresIn: "-1h" });
|
|
441
|
-
const { req, res, next } = createMockReqRes({ authorization: \`Bearer \${token}\` });
|
|
442
|
-
verifyToken(req, res, next);
|
|
443
|
-
expect(res.status).toHaveBeenCalledWith(401);
|
|
444
|
-
});
|
|
445
|
-
|
|
446
|
-
it("should accept valid tokens and attach user to request", () => {
|
|
447
|
-
const token = jwt.sign({ userId: "u1", role: "admin" }, SECRET, { expiresIn: "1h" });
|
|
448
|
-
const { req, res, next } = createMockReqRes({ authorization: \`Bearer \${token}\` });
|
|
449
|
-
verifyToken(req, res, next);
|
|
450
|
-
expect(next).toHaveBeenCalled();
|
|
451
|
-
expect(req.user).toMatchObject({ userId: "u1", role: "admin" });
|
|
452
|
-
});
|
|
453
|
-
});
|
|
454
|
-
`}}),raw:JSON.stringify({id:"tu-001-07",type:"tool_use"})},{sessionId:"sess-001",eventType:"tool_result",timestamp:"2026-02-27T08:15:34Z",content:"File written: src/middleware/__tests__/auth.test.ts (32 lines)",raw:JSON.stringify({tool_use_id:"tu-001-07"})},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:35Z",content:JSON.stringify({tool:"Bash",args:{command:"npm test"}}),raw:JSON.stringify({id:"tu-001-08",type:"tool_use"})},{sessionId:"sess-001",eventType:"tool_result",timestamp:"2026-02-27T08:15:40Z",content:` PASS src/routes/__tests__/login.test.ts
|
|
455
|
-
PASS src/routes/__tests__/protected.test.ts
|
|
456
|
-
PASS src/middleware/__tests__/auth.test.ts
|
|
457
|
-
|
|
458
|
-
Test Suites: 3 passed, 3 total
|
|
459
|
-
Tests: 14 passed, 14 total`,raw:JSON.stringify({tool_use_id:"tu-001-08"})},{sessionId:"sess-001",eventType:"usage",timestamp:"2026-02-27T08:15:41Z",content:JSON.stringify({input_tokens:42600,output_tokens:8100,cost_millicents:22e3})},{sessionId:"sess-001",eventType:"text",timestamp:"2026-02-27T08:15:42Z",content:`All 14 tests pass. Here's a summary of the changes:
|
|
460
|
-
|
|
461
|
-
### Changes made
|
|
462
|
-
|
|
463
|
-
| File | Action |
|
|
464
|
-
|------|--------|
|
|
465
|
-
| \`src/middleware/auth.ts\` | Rewrote to verify JWT Bearer tokens |
|
|
466
|
-
| \`src/routes/login.ts\` | Now issues JWT access + refresh tokens |
|
|
467
|
-
| \`src/routes/protected.ts\` | Updated to read \`req.user\` from JWT payload |
|
|
468
|
-
| \`src/middleware/__tests__/auth.test.ts\` | Updated tests for JWT verification |
|
|
469
|
-
|
|
470
|
-
### Key decisions
|
|
471
|
-
- **Access token expiry**: 24 hours (configurable via \`JWT_SECRET\` env var)
|
|
472
|
-
- **Refresh tokens**: 48-byte random hex, stored in DB
|
|
473
|
-
- **Error handling**: Distinguishes expired tokens (401) from invalid tokens (403)`},{sessionId:"sess-002",eventType:"status",timestamp:"2026-02-27T07:30:01Z",content:"running"},{sessionId:"sess-002",eventType:"system",timestamp:"2026-02-27T07:30:02Z",content:`You are a QA engineer. Write comprehensive tests covering happy paths, edge cases, error scenarios, and security.
|
|
474
|
-
Project: acme/alpha — Node.js + Express REST API
|
|
475
|
-
Task: Write unit tests for the user registration endpoint`,raw:JSON.stringify({systemContext:!0})},{sessionId:"sess-002",eventType:"text",timestamp:"2026-02-27T07:30:04Z",content:"I'll write thorough tests for `POST /api/register`. Let me first read the registration endpoint to understand its behavior."},{sessionId:"sess-002",eventType:"tool_use",timestamp:"2026-02-27T07:30:05Z",content:JSON.stringify({tool:"Read",args:{file_path:"src/routes/register.ts"}}),raw:JSON.stringify({id:"tu-002-01",type:"tool_use"})},{sessionId:"sess-002",eventType:"tool_result",timestamp:"2026-02-27T07:30:06Z",content:`import { Router } from "express";
|
|
476
|
-
import bcrypt from "bcrypt";
|
|
477
|
-
import { db } from "../db.js";
|
|
478
|
-
import { validateEmail, validatePassword } from "../utils/validators.js";
|
|
479
|
-
|
|
480
|
-
const SALT_ROUNDS = 12;
|
|
481
|
-
const router = Router();
|
|
482
|
-
|
|
483
|
-
router.post("/register", async (req, res) => {
|
|
484
|
-
const { name, email, password } = req.body;
|
|
485
|
-
|
|
486
|
-
if (!name || !email || !password) {
|
|
487
|
-
return res.status(400).json({ error: "Missing required fields" });
|
|
488
|
-
}
|
|
489
|
-
if (!validateEmail(email)) {
|
|
490
|
-
return res.status(400).json({ error: "Invalid email format" });
|
|
491
|
-
}
|
|
492
|
-
if (!validatePassword(password)) {
|
|
493
|
-
return res.status(400).json({ error: "Password too weak" });
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
const existing = await db.users.findByEmail(email);
|
|
497
|
-
if (existing) {
|
|
498
|
-
return res.status(409).json({ error: "Email already registered" });
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
const passwordHash = await bcrypt.hash(password, SALT_ROUNDS);
|
|
502
|
-
const user = await db.users.create({ name, email, passwordHash });
|
|
503
|
-
res.status(201).json({ id: user.id, name: user.name, email: user.email });
|
|
504
|
-
});
|
|
505
|
-
|
|
506
|
-
export default router;`,raw:JSON.stringify({tool_use_id:"tu-002-01"})},{sessionId:"sess-002",eventType:"text",timestamp:"2026-02-27T07:30:10Z",content:`Good. The endpoint validates input, checks for duplicates, hashes the password, and creates the user. I'll write tests covering:
|
|
507
|
-
|
|
508
|
-
1. **Happy path** - valid registration
|
|
509
|
-
2. **Missing fields** - each required field missing
|
|
510
|
-
3. **Invalid email** - malformed email format
|
|
511
|
-
4. **Weak password** - password validation failure
|
|
512
|
-
5. **Duplicate email** - conflict with existing user
|
|
513
|
-
6. **SQL injection** - malicious email input
|
|
514
|
-
7. **XSS payload** - HTML in the name field
|
|
515
|
-
8. **Response shape** - correct status codes and body structure`},{sessionId:"sess-002",eventType:"tool_use",timestamp:"2026-02-27T07:30:12Z",content:JSON.stringify({tool:"Write",args:{file_path:"src/routes/__tests__/register.test.ts",content:"// [test content - 8 test cases as described above]"}}),raw:JSON.stringify({id:"tu-002-02",type:"tool_use"})},{sessionId:"sess-002",eventType:"tool_result",timestamp:"2026-02-27T07:30:13Z",content:"File written: src/routes/__tests__/register.test.ts (142 lines)",raw:JSON.stringify({tool_use_id:"tu-002-02"})},{sessionId:"sess-002",eventType:"tool_use",timestamp:"2026-02-27T07:31:00Z",content:JSON.stringify({tool:"Bash",args:{command:"npm test -- --testPathPattern=register"}}),raw:JSON.stringify({id:"tu-002-03",type:"tool_use"})},{sessionId:"sess-002",eventType:"tool_result",timestamp:"2026-02-27T07:31:30Z",content:` PASS src/routes/__tests__/register.test.ts
|
|
516
|
-
POST /api/register
|
|
517
|
-
✓ should register a valid user (28ms)
|
|
518
|
-
✓ should reject missing name (4ms)
|
|
519
|
-
✓ should reject missing email (3ms)
|
|
520
|
-
✓ should reject missing password (3ms)
|
|
521
|
-
✓ should reject invalid email format (5ms)
|
|
522
|
-
✓ should reject weak password (4ms)
|
|
523
|
-
✓ should reject duplicate email (12ms)
|
|
524
|
-
✓ should sanitize HTML in name field (6ms)
|
|
525
|
-
|
|
526
|
-
Tests: 8 passed, 8 total`,raw:JSON.stringify({tool_use_id:"tu-002-03"})},{sessionId:"sess-002",eventType:"usage",timestamp:"2026-02-27T07:32:00Z",content:JSON.stringify({input_tokens:31400,output_tokens:9800,cost_millicents:18e3})},{sessionId:"sess-002",eventType:"text",timestamp:"2026-02-27T07:32:30Z",content:"All 8 test cases pass. Created `src/routes/__tests__/register.test.ts` with comprehensive coverage for the registration endpoint including input validation, duplicate detection, and security edge cases."},{sessionId:"sess-002",eventType:"status",timestamp:"2026-02-27T07:33:00Z",content:"completed"},{sessionId:"sess-003",eventType:"status",timestamp:"2026-02-26T22:45:01Z",content:"running"},{sessionId:"sess-003",eventType:"system",timestamp:"2026-02-26T22:45:02Z",content:`You are a database engineer. Focus on safe migrations, zero-downtime deployments, and data integrity.
|
|
527
|
-
Project: acme/alpha — Node.js + Express + PostgreSQL
|
|
528
|
-
Task: Add audit_log table and migrate schema`,raw:JSON.stringify({systemContext:!0})},{sessionId:"sess-003",eventType:"text",timestamp:"2026-02-26T22:45:05Z",content:"I need to add an `audit_log` table for tracking all write operations. Let me review the current schema first."},{sessionId:"sess-003",eventType:"tool_use",timestamp:"2026-02-26T22:45:06Z",content:JSON.stringify({tool:"Read",args:{file_path:"migrations/001_initial.sql"}}),raw:JSON.stringify({id:"tu-003-01",type:"tool_use"})},{sessionId:"sess-003",eventType:"tool_result",timestamp:"2026-02-26T22:45:07Z",content:`CREATE TABLE users (
|
|
529
|
-
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
530
|
-
name TEXT NOT NULL,
|
|
531
|
-
email TEXT UNIQUE NOT NULL,
|
|
532
|
-
password_hash TEXT NOT NULL,
|
|
533
|
-
role TEXT DEFAULT 'user',
|
|
534
|
-
created_at TIMESTAMPTZ DEFAULT now(),
|
|
535
|
-
updated_at TIMESTAMPTZ DEFAULT now()
|
|
536
|
-
);
|
|
537
|
-
|
|
538
|
-
CREATE TABLE sessions (
|
|
539
|
-
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
540
|
-
user_id UUID REFERENCES users(id),
|
|
541
|
-
expires_at TIMESTAMPTZ NOT NULL,
|
|
542
|
-
created_at TIMESTAMPTZ DEFAULT now()
|
|
543
|
-
);`,raw:JSON.stringify({tool_use_id:"tu-003-01"})},{sessionId:"sess-003",eventType:"text",timestamp:"2026-02-26T22:45:12Z",content:"I see the schema. I'll create a migration that:\n1. Adds a `last_login_at` column to `users`\n2. Adds an index on `sessions.expires_at` for efficient cleanup queries\n3. Creates the `audit_log` table\n\nLet me write the migration file:"},{sessionId:"sess-003",eventType:"tool_use",timestamp:"2026-02-26T22:45:14Z",content:JSON.stringify({tool:"Write",args:{file_path:"migrations/002_audit_log.sql",content:`-- Migration: 002_audit_log
|
|
544
|
-
-- Add audit logging and user activity tracking
|
|
545
|
-
|
|
546
|
-
BEGIN;
|
|
547
|
-
|
|
548
|
-
-- 1. Add last_login_at to users
|
|
549
|
-
ALTER TABLE users ADD COLUMN last_login_at TIMESTAMPTZ;
|
|
550
|
-
|
|
551
|
-
-- 2. Index for session cleanup queries
|
|
552
|
-
CREATE INDEX CONCURRENTLY idx_sessions_expires_at ON sessions (expires_at);
|
|
553
|
-
|
|
554
|
-
-- 3. Audit log table
|
|
555
|
-
CREATE TABLE audit_log (
|
|
556
|
-
id BIGSERIAL PRIMARY KEY,
|
|
557
|
-
user_id UUID REFERENCES users(id),
|
|
558
|
-
action TEXT NOT NULL,
|
|
559
|
-
entity_type TEXT NOT NULL,
|
|
560
|
-
entity_id TEXT NOT NULL,
|
|
561
|
-
old_value JSONB,
|
|
562
|
-
new_value JSONB,
|
|
563
|
-
ip_address INET,
|
|
564
|
-
created_at TIMESTAMPTZ DEFAULT now()
|
|
565
|
-
);
|
|
566
|
-
|
|
567
|
-
CREATE INDEX idx_audit_log_user ON audit_log (user_id);
|
|
568
|
-
CREATE INDEX idx_audit_log_entity ON audit_log (entity_type, entity_id);
|
|
569
|
-
CREATE INDEX idx_audit_log_created ON audit_log (created_at);
|
|
570
|
-
|
|
571
|
-
COMMIT;
|
|
572
|
-
`}}),raw:JSON.stringify({id:"tu-003-02",type:"tool_use"})},{sessionId:"sess-003",eventType:"tool_result",timestamp:"2026-02-26T22:45:15Z",content:"File written: migrations/002_audit_log.sql (29 lines)",raw:JSON.stringify({tool_use_id:"tu-003-02"})},{sessionId:"sess-003",eventType:"text",timestamp:"2026-02-26T22:46:00Z",content:"Now I need to implement the audit middleware that logs write operations. This will intercept POST, PUT, PATCH, and DELETE requests."},{sessionId:"sess-003",eventType:"tool_use",timestamp:"2026-02-26T22:46:02Z",content:JSON.stringify({tool:"Bash",args:{command:"npm run migrate -- --dry-run"}}),raw:JSON.stringify({id:"tu-003-03",type:"tool_use"})},{sessionId:"sess-003",eventType:"tool_result",timestamp:"2026-02-26T22:46:10Z",content:`Dry run: would apply 002_audit_log.sql
|
|
573
|
-
- ALTER TABLE users ADD COLUMN last_login_at
|
|
574
|
-
- CREATE INDEX CONCURRENTLY idx_sessions_expires_at
|
|
575
|
-
- CREATE TABLE audit_log
|
|
576
|
-
- 3 indexes on audit_log
|
|
577
|
-
|
|
578
|
-
WARNING: CREATE INDEX CONCURRENTLY cannot run inside a transaction block.
|
|
579
|
-
Please split this into a separate migration step.`,raw:JSON.stringify({tool_use_id:"tu-003-03",is_error:!0})},{sessionId:"sess-003",eventType:"text",timestamp:"2026-02-26T22:46:15Z",content:"Good catch from the dry run! `CREATE INDEX CONCURRENTLY` can't run inside a transaction. I need to split the migration into two files: one for the transactional DDL and another for the concurrent index creation."},{sessionId:"sess-003",eventType:"usage",timestamp:"2026-02-26T23:00:00Z",content:JSON.stringify({input_tokens:56300,output_tokens:14200,cost_millicents:31e3})},{sessionId:"sess-003",eventType:"status",timestamp:"2026-02-26T23:10:00Z",content:"interrupted"},{sessionId:"sess-004",eventType:"status",timestamp:"2026-02-27T09:00:01Z",content:"running"},{sessionId:"sess-004",eventType:"system",timestamp:"2026-02-27T09:00:02Z",content:`You are a backend engineer specializing in API infrastructure.
|
|
580
|
-
Project: acme/data-pipeline — ETL pipelines for analytics
|
|
581
|
-
Task: Implement rate limiting for the public API using a token-bucket algorithm`,raw:JSON.stringify({systemContext:!0})},{sessionId:"sess-004",eventType:"text",timestamp:"2026-02-27T09:00:05Z",content:"I'll implement rate limiting using a token-bucket algorithm. Let me first survey the existing API infrastructure to find the right integration point."},{sessionId:"sess-004",eventType:"tool_use",timestamp:"2026-02-27T09:00:05.5Z",content:JSON.stringify({tool:"TodoWrite",args:{todos:[{content:"Survey middleware structure",activeForm:"Surveying middleware",status:"in_progress"},{content:"Implement token-bucket algorithm",activeForm:"Implementing token bucket",status:"pending"},{content:"Add rate limit middleware to app",activeForm:"Adding middleware",status:"pending"},{content:"Write tests for rate limiting",activeForm:"Writing tests",status:"pending"},{content:"Add Redis adapter for multi-instance",activeForm:"Adding Redis adapter",status:"pending"}]}})},{sessionId:"sess-004",eventType:"tool_use",timestamp:"2026-02-27T09:00:06Z",content:JSON.stringify({tool:"Glob",args:{pattern:"src/middleware/**/*.ts"}}),raw:JSON.stringify({id:"tu-004-01",type:"tool_use"})},{sessionId:"sess-004",eventType:"tool_result",timestamp:"2026-02-27T09:00:07Z",content:`src/middleware/cors.ts
|
|
582
|
-
src/middleware/error-handler.ts
|
|
583
|
-
src/middleware/logger.ts
|
|
584
|
-
src/middleware/request-id.ts`,raw:JSON.stringify({tool_use_id:"tu-004-01"})},{sessionId:"sess-004",eventType:"tool_use",timestamp:"2026-02-27T09:00:09Z",content:JSON.stringify({tool:"TodoWrite",args:{todos:[{content:"Survey middleware structure",activeForm:"Surveying middleware",status:"completed"},{content:"Implement token-bucket algorithm",activeForm:"Implementing token bucket",status:"in_progress"},{content:"Add rate limit middleware to app",activeForm:"Adding middleware",status:"pending"},{content:"Write tests for rate limiting",activeForm:"Writing tests",status:"pending"},{content:"Add Redis adapter for multi-instance",activeForm:"Adding Redis adapter",status:"pending"}]}})},{sessionId:"sess-004",eventType:"text",timestamp:"2026-02-27T09:00:10Z",content:`Good middleware structure already in place. I'll add a \`rate-limiter.ts\` module that:
|
|
585
|
-
|
|
586
|
-
- Uses an **in-memory token bucket** per client IP
|
|
587
|
-
- Supports configurable rate (requests/second) and burst size
|
|
588
|
-
- Returns \`429 Too Many Requests\` with \`Retry-After\` header
|
|
589
|
-
- Has a Redis adapter option for multi-instance deployments
|
|
590
|
-
|
|
591
|
-
Let me implement it:`},{sessionId:"sess-004",eventType:"tool_use",timestamp:"2026-02-27T09:00:12Z",content:JSON.stringify({tool:"Write",args:{file_path:"src/middleware/rate-limiter.ts",content:"// Token bucket rate limiter implementation"}}),raw:JSON.stringify({id:"tu-004-02",type:"tool_use"})},{sessionId:"sess-004",eventType:"tool_result",timestamp:"2026-02-27T09:00:13Z",content:"File written: src/middleware/rate-limiter.ts (87 lines)",raw:JSON.stringify({tool_use_id:"tu-004-02"})},{sessionId:"sess-004",eventType:"text",timestamp:"2026-02-27T09:00:18Z",content:"Now I need to wire the rate limiter into the Express middleware stack. It should go after the request-ID middleware but before route handlers."},{sessionId:"sess-005",eventType:"status",timestamp:"2026-02-27T06:00:01Z",content:"running"},{sessionId:"sess-005",eventType:"system",timestamp:"2026-02-27T06:00:02Z",content:`You are a database specialist. Focus on connection management, performance, and multi-tenant isolation.
|
|
592
|
-
Project: acme/alpha — Node.js + Express + PostgreSQL
|
|
593
|
-
Task: Refactor database connection pooling for multi-tenant isolation`,raw:JSON.stringify({systemContext:!0})},{sessionId:"sess-005",eventType:"text",timestamp:"2026-02-27T06:00:05Z",content:"I'll refactor the DB layer to support per-tenant connection pools. This is needed because the current single-pool design means one slow tenant can exhaust connections for everyone."},{sessionId:"sess-005",eventType:"tool_use",timestamp:"2026-02-27T06:00:06Z",content:JSON.stringify({tool:"Read",args:{file_path:"src/db/pool.ts"}}),raw:JSON.stringify({id:"tu-005-01",type:"tool_use"})},{sessionId:"sess-005",eventType:"tool_result",timestamp:"2026-02-27T06:00:07Z",content:`import pg from "pg";
|
|
594
|
-
|
|
595
|
-
const pool = new pg.Pool({
|
|
596
|
-
connectionString: process.env.DATABASE_URL,
|
|
597
|
-
max: 20,
|
|
598
|
-
idleTimeoutMillis: 30000,
|
|
599
|
-
});
|
|
600
|
-
|
|
601
|
-
export { pool };`,raw:JSON.stringify({tool_use_id:"tu-005-01"})},{sessionId:"sess-005",eventType:"text",timestamp:"2026-02-27T06:00:12Z",content:`The current pool is a single shared instance with \`max: 20\`. For multi-tenant isolation, I need:
|
|
602
|
-
|
|
603
|
-
1. **A \`PoolManager\` class** that creates and caches per-tenant pools
|
|
604
|
-
2. **Configurable limits** per tenant (max connections, idle timeout)
|
|
605
|
-
3. **Health checks** with automatic pool eviction for unhealthy connections
|
|
606
|
-
4. **Graceful shutdown** that drains all pools`},{sessionId:"sess-005",eventType:"tool_use",timestamp:"2026-02-27T06:00:14Z",content:JSON.stringify({tool:"Grep",args:{pattern:"import.*pool|from.*pool",path:"src/",output_mode:"content"}}),raw:JSON.stringify({id:"tu-005-02",type:"tool_use"})},{sessionId:"sess-005",eventType:"tool_result",timestamp:"2026-02-27T06:00:15Z",content:`src/db/index.ts:1:import { pool } from "./pool.js";
|
|
607
|
-
src/routes/users.ts:2:import { pool } from "../db/pool.js";
|
|
608
|
-
src/routes/register.ts:3:import { pool } from "../db/pool.js";
|
|
609
|
-
src/routes/admin.ts:4:import { pool } from "../db/pool.js";
|
|
610
|
-
src/services/billing.ts:2:import { pool } from "../db/pool.js";
|
|
611
|
-
src/services/analytics.ts:1:import { pool } from "../db/pool.js";`,raw:JSON.stringify({tool_use_id:"tu-005-02"})},{sessionId:"sess-005",eventType:"text",timestamp:"2026-02-27T06:00:20Z",content:`Six files import the pool directly. I'll need to:
|
|
612
|
-
1. Create a new \`PoolManager\` abstraction
|
|
613
|
-
2. Update all consumers to use \`getPool(tenantId)\` instead of the global pool
|
|
614
|
-
3. Add middleware to extract tenant ID from the request
|
|
615
|
-
|
|
616
|
-
This is a significant refactor. Let me start with the PoolManager class.`},{sessionId:"sess-005",eventType:"usage",timestamp:"2026-02-27T06:30:00Z",content:JSON.stringify({input_tokens:67800,output_tokens:19300,cost_millicents:38e3})},{sessionId:"sess-005",eventType:"status",timestamp:"2026-02-27T06:30:01Z",content:"suspended"}],iz=[{id:"proj-alpha",name:"Workspace Alpha",description:"Core platform API and authentication services",repoUrl:"https://github.com/acme/alpha",linkedEnvironmentIds:["env-local-01","env-docker-01"],status:"active",workingDirectory:"",useWorktrees:!0,defaultPersonaId:"",tokenBudget:0,costBudgetMillicents:0,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",linkedEnvironmentIds:["env-docker-01"],status:"active",workingDirectory:"",useWorktrees:!0,defaultPersonaId:"",tokenBudget:0,costBudgetMillicents:0,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:"",linkedEnvironmentIds:["env-local-01"],status:"archived",workingDirectory:"",useWorktrees:!0,defaultPersonaId:"",tokenBudget:0,costBudgetMillicents:0,createdAt:"2025-11-20T09:00:00Z",updatedAt:"2025-11-20T09:00:00Z"}],oz=[{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:JSON.stringify({status:"in_progress",summary:"Design and implement JWT-based authentication with access/refresh tokens, replacing session-based auth.",extra:{approach:"Replace express-session with JWT Bearer tokens. Access tokens expire in 24h, refresh tokens stored in DB.",files_changed:["src/middleware/auth.ts","src/routes/login.ts","src/routes/protected.ts"],decisions:["Chose jsonwebtoken over jose for consistency with existing codebase","24h access token expiry — long enough for dev sessions, short enough for security","Refresh tokens are 48-byte random hex stored in DB with user association"],blockers:"Need to verify token rotation strategy with security team before merging"}}),tokenBudget:0,costBudgetMillicents:0},{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:"",tokenBudget:0,costBudgetMillicents:0},{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:"",tokenBudget:0,costBudgetMillicents:0},{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:"",tokenBudget:0,costBudgetMillicents:0},{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:"",tokenBudget:0,costBudgetMillicents:0},{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:"",tokenBudget:0,costBudgetMillicents:0},{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:"",tokenBudget:0,costBudgetMillicents:0},{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:"",tokenBudget:0,costBudgetMillicents:0},{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:JSON.stringify({status:"in_progress",summary:"Plan for adding Parquet export support, including compression options and performance benchmarks.",extra:{approach:"Use apache-arrow npm package for Parquet write support. Map internal column types to Arrow type system.",compression:{supported:["snappy","zstd","gzip"],default:"snappy"},benchmarks:{"1M rows snappy":"2.3s","1M rows zstd":"3.1s","1M rows gzip":"4.8s"}}}),tokenBudget:0,costBudgetMillicents:0},{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:"",tokenBudget:0,costBudgetMillicents:0},{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:"",tokenBudget:0,costBudgetMillicents:0},{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:"",tokenBudget:0,costBudgetMillicents:0},{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:"",tokenBudget:0,costBudgetMillicents:0},{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:"",tokenBudget:0,costBudgetMillicents:0},{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:"",tokenBudget:0,costBudgetMillicents:0},{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:"",tokenBudget:0,costBudgetMillicents:0},{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:"",tokenBudget:0,costBudgetMillicents:0}],Yc=[{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"}],rz=[{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:""}],lz=[{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-6",maxTurns:50,mcpServers:"[]",createdAt:"2026-02-20T10:00:00Z",updatedAt:"2026-02-20T10:00:00Z",type:"agent",script:"",allowedMcpTools:["task_create","task_update","task_list","finding_post","finding_list","knowledge_search","knowledge_create_node","session_spawn"]},{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-6",maxTurns:100,mcpServers:"[]",createdAt:"2026-02-20T10:05:00Z",updatedAt:"2026-02-20T10:05:00Z",type:"agent",script:"",allowedMcpTools:[]},{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-6",maxTurns:30,mcpServers:"[]",createdAt:"2026-02-20T10:10:00Z",updatedAt:"2026-02-20T10:10:00Z",type:"agent",script:"",allowedMcpTools:["finding_post","finding_list","knowledge_search"]},{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-6",maxTurns:80,mcpServers:"[]",createdAt:"2026-02-20T10:15:00Z",updatedAt:"2026-02-20T10:15:00Z",type:"agent",script:"",allowedMcpTools:[]},{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));
|
|
617
|
-
for (const f of files) {
|
|
618
|
-
const eslintResult = await host.exec("npx", ["eslint", "--fix", f.filename]);
|
|
619
|
-
if (eslintResult.exitCode !== 0) {
|
|
620
|
-
env.findings.push({ category: "lint", title: \`Lint issues in \${f.filename}\`, content: eslintResult.stderr });
|
|
621
|
-
}
|
|
622
|
-
const prettierResult = await host.exec("npx", ["prettier", "--write", f.filename]);
|
|
623
|
-
if (prettierResult.exitCode !== 0) {
|
|
624
|
-
env.findings.push({ category: "format", title: \`Prettier issues in \${f.filename}\`, content: prettierResult.stderr });
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
env.findings.push({ category: "summary", title: "Lint & format pass complete", content: \`Ran ESLint and Prettier on \${files.length} files\` });`,allowedMcpTools:[]}],cz={"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 Re(t){return new Date(Date.now()+t).toISOString()}const ax=[{label:"API Refactor",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Re(0),content:"running"}},{delayMs:600,event:{eventType:"text",timestamp:Re(600),content:"I'll start by finding all API route files that need refactoring."}},{delayMs:1200,event:{eventType:"tool_use",timestamp:Re(1200),content:JSON.stringify({tool:"Glob",args:{pattern:"src/routes/**/*.ts"}}),raw:JSON.stringify({id:"stream-a-01",type:"tool_use"})}},{delayMs:1600,event:{eventType:"tool_result",timestamp:Re(1600),content:`src/routes/users.ts
|
|
628
|
-
src/routes/auth.ts
|
|
629
|
-
src/routes/billing.ts
|
|
630
|
-
src/routes/admin.ts
|
|
631
|
-
src/routes/health.ts`,raw:JSON.stringify({tool_use_id:"stream-a-01"})}},{delayMs:2200,event:{eventType:"text",timestamp:Re(2200),content:`Found 5 route files. Let me refactor users.ts to use Express Router with a middleware chain.
|
|
632
|
-
|
|
633
|
-
\`\`\`typescript
|
|
634
|
-
const router = Router();
|
|
635
|
-
router.use(authenticate);
|
|
636
|
-
router.use(validateBody);
|
|
637
|
-
|
|
638
|
-
router.get("/", listUsers);
|
|
639
|
-
router.post("/", createUser);
|
|
640
|
-
router.get("/:id", getUser);
|
|
641
|
-
router.put("/:id", updateUser);
|
|
642
|
-
router.delete("/:id", deleteUser);
|
|
643
|
-
\`\`\``}},{delayMs:3200,event:{eventType:"tool_use",timestamp:Re(3200),content:JSON.stringify({tool:"Bash",args:{command:"npm test -- --testPathPattern=routes"}}),raw:JSON.stringify({id:"stream-a-02",type:"tool_use"})}},{delayMs:4e3,event:{eventType:"tool_result",timestamp:Re(4e3),content:` PASS src/routes/__tests__/users.test.ts
|
|
644
|
-
PASS src/routes/__tests__/auth.test.ts
|
|
645
|
-
PASS src/routes/__tests__/billing.test.ts
|
|
646
|
-
|
|
647
|
-
Test Suites: 3 passed, 3 total
|
|
648
|
-
Tests: 22 passed, 22 total`,raw:JSON.stringify({tool_use_id:"stream-a-02"})}},{delayMs:4500,event:{eventType:"usage",timestamp:Re(4500),content:JSON.stringify({input_tokens:28400,output_tokens:7200,cost_millicents:15e3})}},{delayMs:5e3,event:{eventType:"text",timestamp:Re(5e3),content:"All 22 tests pass. The route refactoring is complete."}},{delayMs:5500,event:{eventType:"status",timestamp:Re(5500),content:"completed"}}]},{label:"Database Migration",pauseForInput:!0,pauseAfterStep:4,steps:[{delayMs:0,event:{eventType:"status",timestamp:Re(0),content:"running"}},{delayMs:600,event:{eventType:"text",timestamp:Re(600),content:"Scanning the current database schema to plan the migration."}},{delayMs:1200,event:{eventType:"tool_use",timestamp:Re(1200),content:JSON.stringify({tool:"Read",args:{file_path:"migrations/001_initial.sql"}}),raw:JSON.stringify({id:"stream-b-01",type:"tool_use"})}},{delayMs:1800,event:{eventType:"tool_result",timestamp:Re(1800),content:`CREATE TABLE users (
|
|
649
|
-
id UUID PRIMARY KEY,
|
|
650
|
-
name TEXT NOT NULL,
|
|
651
|
-
email TEXT UNIQUE NOT NULL,
|
|
652
|
-
created_at TIMESTAMPTZ DEFAULT now()
|
|
653
|
-
);
|
|
654
|
-
|
|
655
|
-
CREATE TABLE sessions (
|
|
656
|
-
id UUID PRIMARY KEY,
|
|
657
|
-
user_id UUID REFERENCES users(id),
|
|
658
|
-
expires_at TIMESTAMPTZ NOT NULL
|
|
659
|
-
);`,raw:JSON.stringify({tool_use_id:"stream-b-01"})}},{delayMs:2600,event:{eventType:"text",timestamp:Re(2600),content:`I found the tables to modify:
|
|
660
|
-
- **users**: add column \`last_login_at\`
|
|
661
|
-
- **sessions**: add index on \`expires_at\`
|
|
662
|
-
- **audit_log**: new table
|
|
663
|
-
|
|
664
|
-
This migration will add a NOT NULL column to the \`users\` table. The table has **50,000+ rows** which may lock the table briefly.
|
|
665
|
-
|
|
666
|
-
Please confirm to proceed.`}}],resumeSteps:[{delayMs:500,event:{eventType:"text",timestamp:Re(0),content:"Proceeding with migration."}},{delayMs:1200,event:{eventType:"tool_use",timestamp:Re(700),content:JSON.stringify({tool:"Bash",args:{command:"npm run migrate"}}),raw:JSON.stringify({id:"stream-b-02",type:"tool_use"})}},{delayMs:2200,event:{eventType:"tool_result",timestamp:Re(1700),content:`Applying 002_add_last_login.sql... done
|
|
667
|
-
Applying 003_sessions_index.sql... done
|
|
668
|
-
Applying 004_audit_log.sql... done
|
|
669
|
-
|
|
670
|
-
3 migrations applied successfully.`,raw:JSON.stringify({tool_use_id:"stream-b-02"})}},{delayMs:2800,event:{eventType:"text",timestamp:Re(2300),content:"All 3 migrations applied successfully. The `audit_log` table is ready."}},{delayMs:3200,event:{eventType:"status",timestamp:Re(2700),content:"completed"}}]},{label:"Test Writer",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Re(0),content:"running"}},{delayMs:600,event:{eventType:"text",timestamp:Re(600),content:"I'll generate tests for `src/services/billing.ts`. Let me read the implementation first."}},{delayMs:1200,event:{eventType:"tool_use",timestamp:Re(1200),content:JSON.stringify({tool:"Read",args:{file_path:"src/services/billing.ts"}}),raw:JSON.stringify({id:"stream-c-01",type:"tool_use"})}},{delayMs:1800,event:{eventType:"tool_result",timestamp:Re(1800),content:`import { StripeClient } from "./stripe-client.js";
|
|
671
|
-
import type { Invoice, LineItem } from "../types/billing.js";
|
|
672
|
-
|
|
673
|
-
export class BillingService {
|
|
674
|
-
constructor(private stripe: StripeClient) {}
|
|
675
|
-
|
|
676
|
-
async calculateMonthlyTotal(userId: string): Promise<number> {
|
|
677
|
-
const invoices = await this.stripe.listInvoices(userId);
|
|
678
|
-
return invoices.reduce((sum, inv) => sum + inv.total, 0);
|
|
679
|
-
}
|
|
680
|
-
}`,raw:JSON.stringify({tool_use_id:"stream-c-01"})}},{delayMs:2400,event:{eventType:"text",timestamp:Re(2400),content:"The billing service imports from `./stripe-client.js`. Let me check if that module exists."}},{delayMs:2800,event:{eventType:"tool_use",timestamp:Re(2800),content:JSON.stringify({tool:"Read",args:{file_path:"src/services/stripe-client.ts"}}),raw:JSON.stringify({id:"stream-c-02",type:"tool_use"})}},{delayMs:3200,event:{eventType:"tool_result",timestamp:Re(3200),content:"Error: ENOENT: no such file or directory, open 'src/services/stripe-client.ts'",raw:JSON.stringify({tool_use_id:"stream-c-02",is_error:!0})}},{delayMs:3600,event:{eventType:"error",timestamp:Re(3600),content:"Cannot resolve import 'src/services/stripe-client.ts' — module not found. The billing service depends on a Stripe client that doesn't exist in this environment."}},{delayMs:4e3,event:{eventType:"status",timestamp:Re(4e3),content:"failed"}}]},{label:"Fix Auth Bug",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Re(0),content:"running"}},{delayMs:600,event:{eventType:"text",timestamp:Re(600),content:"Let me investigate the authentication bug..."}},{delayMs:1200,event:{eventType:"tool_use",timestamp:Re(1200),content:JSON.stringify({tool:"Read",args:{file_path:"/src/middleware/auth.ts"}}),raw:JSON.stringify({id:"tool-mock-001"})}},{delayMs:1800,event:{eventType:"tool_result",timestamp:Re(1800),content:`import jwt from "jsonwebtoken";
|
|
681
|
-
import type { Request, Response, NextFunction } from "express";
|
|
682
|
-
|
|
683
|
-
const JWT_SECRET = process.env.JWT_SECRET || "change-me";
|
|
684
|
-
|
|
685
|
-
export function verifyToken(req: Request, res: Response, next: NextFunction): void {
|
|
686
|
-
const header = req.headers.authorization;
|
|
687
|
-
if (!header?.startsWith("Bearer ")) {
|
|
688
|
-
res.status(401).json({ error: "Missing token" });
|
|
689
|
-
return;
|
|
690
|
-
}
|
|
691
|
-
try {
|
|
692
|
-
const decoded = jwt.verify(header.slice(7), JWT_SECRET);
|
|
693
|
-
if (decoded.exp > Date.now() / 1000) {
|
|
694
|
-
res.status(403).json({ error: "Token expired" });
|
|
695
|
-
return;
|
|
696
|
-
}
|
|
697
|
-
req.user = decoded;
|
|
698
|
-
next();
|
|
699
|
-
} catch {
|
|
700
|
-
res.status(403).json({ error: "Invalid token" });
|
|
701
|
-
}
|
|
702
|
-
}`,raw:JSON.stringify({tool_use_id:"tool-mock-001",is_error:!1})}},{delayMs:2600,event:{eventType:"text",timestamp:Re(2600),content:"Found the issue — the token expiry check on line 14 is using `>` instead of `<`. A token is expired when `exp < now`, but the code checks `exp > now` which means it rejects *valid* tokens and accepts *expired* ones. Let me fix it."}},{delayMs:3400,event:{eventType:"tool_use",timestamp:Re(3400),content:JSON.stringify({tool:"Edit",args:{file_path:"/src/middleware/auth.ts",old_string:" if (decoded.exp > Date.now() / 1000) {",new_string:" if (decoded.exp < Date.now() / 1000) {"}}),raw:JSON.stringify({id:"tool-mock-002"})}},{delayMs:4e3,event:{eventType:"tool_result",timestamp:Re(4e3),content:"File updated successfully",raw:JSON.stringify({tool_use_id:"tool-mock-002",is_error:!1})}},{delayMs:4600,event:{eventType:"tool_use",timestamp:Re(4600),content:JSON.stringify({tool:"Bash",args:{command:"npm test -- --grep auth"}}),raw:JSON.stringify({id:"tool-mock-003"})}},{delayMs:5800,event:{eventType:"tool_result",timestamp:Re(5800),content:`[exit 0] > jest --grep auth
|
|
703
|
-
|
|
704
|
-
PASS src/auth.test.ts
|
|
705
|
-
✓ validates JWT token (12ms)
|
|
706
|
-
✓ rejects expired token (3ms)
|
|
707
|
-
✓ handles missing header (1ms)
|
|
708
|
-
|
|
709
|
-
Tests: 3 passed, 3 total
|
|
710
|
-
Time: 1.234s`,raw:JSON.stringify({tool_use_id:"tool-mock-003",is_error:!1})}},{delayMs:6400,event:{eventType:"tool_use",timestamp:Re(6400),content:JSON.stringify({tool:"Grep",args:{pattern:"decoded\\.exp",path:"src/"}}),raw:JSON.stringify({id:"tool-mock-004"})}},{delayMs:7e3,event:{eventType:"tool_result",timestamp:Re(7e3),content:`src/middleware/auth.ts:14: if (decoded.exp < Date.now() / 1000) {
|
|
711
|
-
src/utils/token-refresh.ts:28: const remaining = decoded.exp - Date.now() / 1000;`,raw:JSON.stringify({tool_use_id:"tool-mock-004",is_error:!1})}},{delayMs:7800,event:{eventType:"text",timestamp:Re(7800),content:"Fixed. The token expiry comparison was inverted — `decoded.exp > Date.now()` should have been `<` (a token is expired when its `exp` is in the past). The other occurrence in `token-refresh.ts` uses subtraction (not comparison), so it was already correct. All 3 auth tests pass."}},{delayMs:8400,event:{eventType:"usage",timestamp:Re(8400),content:JSON.stringify({input_tokens:42600,output_tokens:1850,cost_millicents:12e3})}},{delayMs:8800,event:{eventType:"status",timestamp:Re(8800),content:"completed"}}]}],ps={onConnect:async()=>{},onDisconnect:()=>{},handleEvent:()=>!1},ix=400;function dz({children:t}){const[s,o]=b.useState(nz),[r,c]=b.useState(sz),[d,u]=b.useState(az),[p,m]=b.useState(void 0),[g,v]=b.useState(iz),[x,y]=b.useState(""),[k,S]=b.useState(oz),[j,N]=b.useState(Yc),[T,C]=b.useState(void 0),A=!1,[O,E]=b.useState(rz),[D,P]=b.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),[B,z]=b.useState(lz),[J,V]=b.useState([]),[K]=b.useState(cz),[fe,ee]=b.useState(""),[oe,M]=b.useState(ws),[H,ne]=b.useState(za),[he,W]=b.useState(void 0),[X,de]=b.useState(void 0),[Ne,Ue]=b.useState(""),ve=b.useRef(void 0),Se=b.useRef(0),xe=b.useRef(0),Be=b.useRef(new Set),It=b.useRef(new Map),zn=b.useRef(k);zn.current=k;const re=b.useRef(new Map),Je=b.useRef(new Map),Ut=b.useCallback(U=>(Se.current+=1,`mock-${U}-${String(Se.current).padStart(3,"0")}`),[]),se=b.useCallback(()=>{const U=ax[xe.current%ax.length];return xe.current+=1,U},[]),wt=b.useCallback((U,te,le)=>{const ue=setTimeout(()=>{var ge;Be.current.delete(ue),le&&((ge=It.current.get(le))==null||ge.delete(ue)),U()},te);Be.current.add(ue),le&&(It.current.has(le)||It.current.set(le,new Set),It.current.get(le).add(ue))},[]),Ot=b.useCallback(U=>{const te=It.current.get(U);te&&(te.forEach(le=>{clearTimeout(le),Be.current.delete(le)}),It.current.delete(U))},[]),Bt=b.useCallback((U,te,le)=>{c(ue=>ue.map(ge=>ge.id===U?{...ge,status:te,...le!==void 0?{endReason:le}:{}}:ge))},[]),ze=b.useCallback(U=>{u(te=>[...te,U])},[]),sn=b.useCallback((U,te,le)=>{te.forEach((ue,ge)=>{wt(()=>{const Ge={sessionId:U,...ue.event,timestamp:new Date().toISOString()};if(ze(Ge),ue.event.eventType==="status"){const _e=ek(ue.event.content),Me=tk(ue.event.content);Bt(U,_e,Me)}ge===te.length-1&&le&&le()},ue.delayMs,U)})},[wt,ze,Bt]),ca=b.useCallback(async(U,te,le,ue)=>{console.log("[MockGrackle] spawn",{environmentId:U,prompt:te,runtime:ue});const ge=Ut("sess"),Ge={id:ge,environmentId:U,runtime:ue||"claude-code",status:"running",prompt:te,startedAt:new Date().toISOString()};c(Me=>[...Me,Ge]),m(ge);const _e=se();if(console.log(`[MockGrackle] Playing scenario: ${_e.label}`),_e.pauseForInput){const Me=_e.pauseAfterStep??_e.steps.length-1,Xe=_e.steps.slice(0,Me+1),ht=Xe.length>0?Xe[Xe.length-1].delayMs:0;sn(ge,Xe),wt(()=>{Bt(ge,"idle"),ze({sessionId:ge,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},ht+ix,ge),_e.resumeSteps&&re.current.set(ge,_e.resumeSteps)}else sn(ge,_e.steps)},[Ut,se,sn,wt,Bt,ze]),is=b.useCallback(async U=>{console.log("[MockGrackle] kill",U),Ot(U),re.current.delete(U),Bt(U,"stopped","killed"),ze({sessionId:U,eventType:"status",timestamp:new Date().toISOString(),content:"killed"}),S(te=>te.map(le=>le.latestSessionId===U&&le.status==="working"?{...le,status:"not_started"}:le))},[Ot,Bt,ze]),Ja=b.useCallback(async U=>{console.log("[MockGrackle] stopGraceful",U),Ot(U),re.current.delete(U),Bt(U,"stopped","terminated"),ze({sessionId:U,eventType:"status",timestamp:new Date().toISOString(),content:"terminated"}),S(te=>te.map(le=>le.latestSessionId===U&&le.status==="working"?{...le,status:"not_started"}:le))},[Ot,Bt,ze]),da=b.useCallback(()=>{console.log("[MockGrackle] refresh")},[]),Jt=b.useCallback(async U=>{console.log("[MockGrackle] loadSessionEvents",U)},[]),Bi=b.useCallback(()=>{console.log("[MockGrackle] clearEvents"),u([])},[]),ua=b.useCallback(async(U,te,le,ue,ge,Ge,_e,Me,Xe)=>{console.log("[MockGrackle] createWorkspace",{name:U,description:te});const ht={id:Ut("proj"),name:U,description:te||"",repoUrl:le||"",linkedEnvironmentIds:ue?[ue]:[],status:"active",workingDirectory:_e||"",useWorktrees:Ge??!0,defaultPersonaId:ge||"",tokenBudget:0,costBudgetMillicents:0,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};v(Le=>[...Le,ht]),Me&&Me()},[Ut]),Wa=b.useCallback(async U=>{console.log("[MockGrackle] archiveWorkspace",U),v(te=>te.map(le=>le.id===U?{...le,status:"archived"}:le))},[]),ys=b.useCallback(async U=>{console.log("[MockGrackle] loadTasks",U)},[]),Li=b.useCallback(async(U,te,le,ue,ge,Ge,_e,Me,Xe)=>{console.log("[MockGrackle] createTask",{workspaceId:U,title:te,parentTaskId:ge}),S(ht=>{const Qe=ht.filter(Ms=>Ms.workspaceId===U).reduce((Ms,Go)=>Math.max(Ms,Go.sortOrder),0),rt=ge?ht.find(Ms=>Ms.id===ge):void 0;if(ge&&!rt)return console.warn("[MockGrackle] Parent task not found:",ge),ht;if(rt&&!rt.canDecompose)return console.warn("[MockGrackle] Parent task does not have decomposition rights:",ge),ht;const vt=rt?rt.depth+1:0,xs={id:Ut("task"),workspaceId:U,title:te,description:le||"",status:"not_started",branch:"",latestSessionId:"",dependsOn:ue||[],reviewNotes:void 0,sortOrder:Qe+1,createdAt:new Date().toISOString(),parentTaskId:ge||"",depth:vt,childTaskIds:[],canDecompose:_e??!ge,defaultPersonaId:Ge||"",workpad:"",tokenBudget:0,costBudgetMillicents:0};return[...ht,xs]}),Me&&Me()},[Ut]),$n=b.useCallback(async(U,te,le,ue)=>{var ht;console.log("[MockGrackle] startTask",{taskId:U});const ge=zn.current.find(Le=>Le.id===U),Ge=(ge==null?void 0:ge.title)??"",_e=Ut("sess"),Me={id:_e,environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:Ge||U,startedAt:new Date().toISOString()};c(Le=>[...Le,Me]),S(Le=>Le.map(Qe=>Qe.id===U?{...Qe,status:"working",latestSessionId:_e,branch:`mock/${U.slice(0,8)}`}:Qe));const Xe=se();if(console.log(`[MockGrackle] Playing task scenario: ${Xe.label}`),Xe.pauseForInput){const Le=Xe.pauseAfterStep??Xe.steps.length-1,Qe=Xe.steps.slice(0,Le+1),rt=Qe.length>0?Qe[Qe.length-1].delayMs:0;if(sn(_e,Qe),wt(()=>{Bt(_e,"idle"),ze({sessionId:_e,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},rt+ix,_e),Xe.resumeSteps){const vt=[...Xe.resumeSteps];re.current.set(_e,vt);const xs=vt.reduce((Ms,Go)=>Math.max(Ms,Go.delayMs),0);Je.current.set(_e,{taskId:U,delayAfterResume:xs+200})}}else{const Le=Xe.steps.length>0?Xe.steps[Xe.steps.length-1].delayMs:0;sn(_e,Xe.steps);const Qe=(ht=Xe.steps[Xe.steps.length-1])==null?void 0:ht.event.content;wt(()=>{Qe==="completed"?S(rt=>rt.map(vt=>vt.id===U&&vt.status==="working"?{...vt,status:"paused"}:vt)):Qe==="failed"&&S(rt=>rt.map(vt=>vt.id===U&&vt.status==="working"?{...vt,status:"failed"}:vt))},Le+100,_e)}},[Ut,se,sn,wt,Bt,ze]),Ae=b.useCallback(async(U,te)=>{console.log("[MockGrackle] sendInput",{sessionId:U,text:te}),ze({sessionId:U,eventType:"output",timestamp:new Date().toISOString(),content:`User input: ${te}`}),Bt(U,"running"),ze({sessionId:U,eventType:"status",timestamp:new Date().toISOString(),content:"running"});const le=re.current.get(U);if(le)re.current.delete(U),sn(U,le);else{const ge=[{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"}}];sn(U,ge)}const ue=Je.current.get(U);ue&&(Je.current.delete(U),wt(()=>{S(ge=>ge.map(Ge=>Ge.id===ue.taskId&&Ge.status==="working"?{...Ge,status:"paused"}:Ge))},ue.delayAfterResume,U))},[ze,Bt,sn,wt]),We=b.useCallback(async U=>{console.log("[MockGrackle] completeTask",U),S(te=>te.map(le=>le.id===U?{...le,status:"complete"}:le))},[]),Wt=b.useCallback(async U=>{console.log("[MockGrackle] resumeTask",U)},[]),St=b.useCallback(async(U,te,le,ue,ge)=>{console.log("[MockGrackle] updateTask",{taskId:U,title:te}),S(Ge=>Ge.map(_e=>_e.id===U?{..._e,title:te.trim()||_e.title,description:le,dependsOn:ue,...ge!==void 0?{defaultPersonaId:ge}:{}}:_e))},[]),mn=b.useCallback(async U=>{console.log("[MockGrackle] deleteTask",U),S(te=>te.filter(le=>le.id!==U))},[]),Xt=b.useCallback(async U=>{console.log("[MockGrackle] loadFindings",U),N(Yc.filter(te=>te.workspaceId===U))},[]),zi=b.useCallback(async()=>{console.log("[MockGrackle] loadAllFindings"),N([...Yc])},[]),$i=b.useCallback(async U=>{console.log("[MockGrackle] loadFinding",U);const te=Yc.find(le=>le.id===U);C(te)},[]),Pi=b.useCallback(async(U,te,le,ue,ge)=>{console.log("[MockGrackle] postFinding",{workspaceId:U,title:te});const Ge={id:Ut("find"),workspaceId:U,taskId:"",sessionId:"",category:ue||"general",title:te,content:le,tags:ge||[],createdAt:new Date().toISOString()};N(_e=>[..._e,Ge])},[Ut]),Xa=b.useCallback(async()=>{console.log("[MockGrackle] loadEnvironments")},[]),Qa=b.useCallback(async(U,te,le)=>{console.log("[MockGrackle] addEnvironment",{displayName:U,adapterType:te,adapterConfig:le})},[]),ei=b.useCallback(async(U,te)=>{console.log("[MockGrackle] updateEnvironment",{environmentId:U,...te}),o(le=>le.map(ue=>ue.id!==U?ue:{...ue,...te.displayName!==void 0?{displayName:te.displayName}:{},...te.adapterConfig!==void 0?{adapterConfig:JSON.stringify(te.adapterConfig)}:{}}))},[]),bs=b.useCallback(async()=>{console.log("[MockGrackle] loadTokens")},[]),ti=b.useCallback(async(U,te,le,ue,ge)=>{console.log("[MockGrackle] setToken",{name:U,tokenType:le}),E(Ge=>[...Ge.filter(Me=>Me.name!==U),{name:U,tokenType:le,envVar:ue,filePath:ge,expiresAt:""}])},[]),fa=b.useCallback(async U=>{console.log("[MockGrackle] deleteToken",U),E(te=>te.filter(le=>le.name!==U))},[]),xl=b.useCallback(async U=>{console.log("[MockGrackle] updateCredentialProviders",U),P(U)},[]);b.useEffect(()=>()=>{Be.current.forEach(clearTimeout),Be.current.clear()},[]);const _l=b.useMemo(()=>({connected:!0,environments:{environments:s,environmentsLoading:!1,provisionStatus:{},operationError:"",clearOperationError:()=>{},loadEnvironments:Xa,addEnvironment:Qa,updateEnvironment:ei,provisionEnvironment:async(U,te)=>{},stopEnvironment:async()=>{},removeEnvironment:async()=>{},domainHook:ps},sessions:{sessions:r,sessionsLoading:!1,events:d,eventsDropped:0,lastSpawnedId:p,taskSessions:K,spawn:ca,sendInput:Ae,kill:is,stopGraceful:Ja,loadSessionEvents:Jt,clearEvents:Bi,loadTaskSessions:async U=>{console.log("[MockGrackle] loadTaskSessions",U)},domainHook:ps},workspaces:{workspaces:g,workspacesLoading:!1,workspaceCreating:!1,loadWorkspaces:async()=>{console.log("[MockGrackle] loadWorkspaces")},createWorkspace:ua,archiveWorkspace:Wa,updateWorkspace:async(U,te)=>{console.log("[MockGrackle] updateWorkspace",{workspaceId:U,...te}),v(le=>le.map(ue=>ue.id!==U?ue:{...ue,...te.name!==void 0?{name:te.name}:{},...te.description!==void 0?{description:te.description}:{},...te.repoUrl!==void 0?{repoUrl:te.repoUrl}:{},...te.environmentId!==void 0?{environmentId:te.environmentId}:{},...te.workingDirectory!==void 0?{workingDirectory:te.workingDirectory}:{},...te.useWorktrees!==void 0?{useWorktrees:te.useWorktrees}:{},...te.defaultPersonaId!==void 0?{defaultPersonaId:te.defaultPersonaId}:{},updatedAt:new Date().toISOString()}))},linkEnvironment:async(U,te)=>{if(console.log("[MockGrackle] linkEnvironment",{workspaceId:U,environmentId:te}),te==="error-env"){y("Failed to link environment");return}y(""),v(le=>le.map(ue=>ue.id!==U||ue.linkedEnvironmentIds.includes(te)?ue:{...ue,linkedEnvironmentIds:[...ue.linkedEnvironmentIds,te]}))},unlinkEnvironment:async(U,te)=>{if(console.log("[MockGrackle] unlinkEnvironment",{workspaceId:U,environmentId:te}),te==="error-env"){y("Failed to unlink environment");return}y(""),v(le=>le.map(ue=>ue.id!==U?ue:{...ue,linkedEnvironmentIds:ue.linkedEnvironmentIds.filter(ge=>ge!==te)}))},linkOperationError:x,clearLinkOperationError:()=>{y("")},domainHook:ps},tasks:{tasks:k,tasksLoading:!1,taskStartingId:void 0,loadTasks:ys,loadAllTasks:async()=>{console.log("[MockGrackle] loadAllTasks")},createTask:Li,startTask:$n,stopTask:async U=>{console.log("[MockGrackle] stopTask",{taskId:U}),await We(U)},completeTask:We,resumeTask:Wt,updateTask:St,deleteTask:mn,domainHook:ps},findings:{findings:j,selectedFinding:T,findingLoading:A,findingsLoading:!1,loadFindings:Xt,loadAllFindings:zi,loadFinding:$i,postFinding:Pi,domainHook:ps},tokens:{tokens:O,tokensLoading:!1,loadTokens:bs,setToken:ti,deleteToken:fa,domainHook:ps},credentials:{credentialProviders:D,credentialsLoading:!1,updateCredentialProviders:xl,domainHook:ps},codespaces:{codespaces:[],codespaceError:"",codespaceListError:"",codespaceCreating:!1,listCodespaces:async()=>{},createCodespace:async()=>{},domainHook:ps},personas:{personas:B,personasLoading:!1,createPersona:async(U,te,le,ue,ge,Ge,_e,Me,Xe)=>{console.log("[MockGrackle] createPersona",{name:U});const ht={id:`mock-persona-${Date.now()}`,name:U,description:te,systemPrompt:le,toolConfig:"{}",runtime:ue??"claude-code",model:ge||"",maxTurns:Ge||0,mcpServers:"[]",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),type:_e||"agent",script:Me||"",allowedMcpTools:Xe||[]};return z(Le=>[...Le,ht]),ht},updatePersona:async(U,te,le,ue,ge,Ge,_e,Me,Xe,ht)=>{console.log("[MockGrackle] updatePersona",{personaId:U,name:te});const Le=B.find(vt=>vt.id===U);if(!Le)throw new Error(`Persona not found: ${U}`);const Qe=new Date().toISOString(),rt={...Le,...te!==void 0?{name:te}:{},...le!==void 0?{description:le}:{},...ue!==void 0?{systemPrompt:ue}:{},...ge!==void 0?{runtime:ge}:{},...Ge!==void 0?{model:Ge}:{},..._e!==void 0?{maxTurns:_e}:{},...Me!==void 0?{type:Me}:{},...Xe!==void 0?{script:Xe}:{},...ht!==void 0?{allowedMcpTools:ht}:{},updatedAt:Qe};return z(vt=>vt.map(xs=>xs.id===U?rt:xs)),rt},deletePersona:async U=>{console.log("[MockGrackle] deletePersona",U),z(te=>te.filter(le=>le.id!==U))},domainHook:ps},schedules:{schedules:J,schedulesLoading:!1,createSchedule:async(U,te,le,ue,ge,Ge)=>{console.log("[MockGrackle] createSchedule",{title:U});const _e={id:`mock-schedule-${Date.now()}`,title:U,description:te,scheduleExpression:le,personaId:ue,environmentId:ge??"",workspaceId:Ge??"",parentTaskId:"",enabled:!0,lastRunAt:"",nextRunAt:new Date(Date.now()+6e4).toISOString(),runCount:0,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};return V(Me=>[...Me,_e]),_e},updateSchedule:async(U,te)=>{console.log("[MockGrackle] updateSchedule",{scheduleId:U,fields:te});let le;if(V(ue=>ue.map(ge=>ge.id!==U?ge:(le={...ge,...te,updatedAt:new Date().toISOString()},le))),!le)throw new Error(`Schedule not found: ${U}`);return le},deleteSchedule:async U=>{console.log("[MockGrackle] deleteSchedule",U),V(te=>te.filter(le=>le.id!==U))},domainHook:ps},knowledge:{graphData:{nodes:oe,links:H},selectedNode:he,loading:!1,selectedId:X,searchQuery:Ne,search:async U=>{if(console.log("[MockGrackle] knowledge.search",U),!U.trim()){Ue(U);return}Ue(U);const te=ve.current,le=te?ws.filter(_e=>!_e.workspaceId||_e.workspaceId===te):ws,ue=U.toLowerCase(),ge=le.filter(_e=>{var Me,Xe,ht;return _e.label.toLowerCase().includes(ue)||((Me=_e.content)==null?void 0:Me.toLowerCase().includes(ue))||((Xe=_e.tags)==null?void 0:Xe.some(Le=>Le.toLowerCase().includes(ue)))||((ht=_e.category)==null?void 0:ht.toLowerCase().includes(ue))});M(ge);const Ge=new Set(ge.map(_e=>_e.id));ne(za.filter(_e=>Ge.has(_e.source)&&Ge.has(_e.target))),de(void 0),W(void 0)},clearSearch:()=>{console.log("[MockGrackle] knowledge.clearSearch"),Ue("");const U=ve.current,te=U?ws.filter(ue=>!ue.workspaceId||ue.workspaceId===U):ws;M(te);const le=new Set(te.map(ue=>ue.id));ne(za.filter(ue=>le.has(ue.source)&&le.has(ue.target)))},selectNode:async U=>{console.log("[MockGrackle] knowledge.selectNode",U),de(U);const te=U in sx?sx[U]:void 0;if(te)W(te);else{const le=ws.find(ue=>ue.id===U);if(le){const ue=za.filter(ge=>ge.source===U||ge.target===U).map(ge=>({fromId:ge.source,toId:ge.target,type:ge.type}));W({node:le,edges:ue})}}},clearSelection:()=>{console.log("[MockGrackle] knowledge.clearSelection"),de(void 0),W(void 0)},expandNode:async U=>{console.log("[MockGrackle] knowledge.expandNode",U),M(te=>{const le=new Set(te.map(Me=>Me.id)),ue=za.filter(Me=>Me.source===U||Me.target===U),ge=new Set;for(const Me of ue)le.has(Me.source)||ge.add(Me.source),le.has(Me.target)||ge.add(Me.target);if(ge.size===0)return te;const Ge=ws.filter(Me=>ge.has(Me.id)),_e=new Set([...le,...ge]);return ne(Me=>{const Xe=new Set(Me.map(Le=>`${Le.source}|${Le.target}|${Le.type}`)),ht=za.filter(Le=>_e.has(Le.source)&&_e.has(Le.target)&&!Xe.has(`${Le.source}|${Le.target}|${Le.type}`));return ht.length>0?[...Me,...ht]:Me}),[...te,...Ge]})},loadRecent:async U=>{if(console.log("[MockGrackle] knowledge.loadRecent",U),ve.current=U,U){const te=ws.filter(ue=>!ue.workspaceId||ue.workspaceId===U);M(te);const le=new Set(te.map(ue=>ue.id));ne(za.filter(ue=>le.has(ue.source)&&le.has(ue.target)))}else M(ws),ne(za);Ue("")},handleEvent:()=>!1,domainHook:ps},plugins:{plugins:[{name:"core",description:"Core infrastructure",enabled:!0,required:!0,loaded:!0},{name:"orchestration",description:"Task orchestration",enabled:!0,required:!1,loaded:!0},{name:"scheduling",description:"Scheduled triggers",enabled:!0,required:!1,loaded:!0},{name:"knowledge",description:"Knowledge graph",enabled:!1,required:!1,loaded:!1}],pluginsLoading:!1,loadPlugins:async()=>{console.log("[MockGrackle] loadPlugins")},setPluginEnabled:async(U,te)=>{console.log("[MockGrackle] setPluginEnabled",U,te)}},appDefaultPersonaId:fe,setAppDefaultPersonaId:async U=>{console.log("[MockGrackle] setAppDefaultPersonaId",U),ee(U)},onboardingCompleted:!0,completeOnboarding:async()=>{console.log("[MockGrackle] completeOnboarding")},usageCache:{"workspace:proj-alpha":{inputTokens:214500,outputTokens:44850,costMillicents:112e3,sessionCount:4},"workspace:proj-beta":{inputTokens:86700,outputTokens:23800,costMillicents:48e3,sessionCount:3},"task:task-001":{inputTokens:126800,outputTokens:20850,costMillicents:63e3,sessionCount:2},"task:task-006":{inputTokens:18900,outputTokens:4500,costMillicents:1e4,sessionCount:1},"task_tree:task-001":{inputTokens:126800,outputTokens:20850,costMillicents:63e3,sessionCount:2},"task_tree:task-006":{inputTokens:18900,outputTokens:4500,costMillicents:1e4,sessionCount:1}},loadUsage:async(U,te)=>{console.log(`[MockGrackle] loadUsage(${U}, ${te})`)},refresh:da}),[s,r,d,p,K,g,x,k,j,T,O,D,B,J,fe,oe,H,he,X,Ne,ca,Ae,is,Ja,Jt,Bi,ua,Wa,ys,Li,$n,We,Wt,St,mn,Xt,zi,$i,Pi,Xa,Qa,ei,bs,ti,fa,xl,da]);return i.jsx(uh.Provider,{value:_l,children:t})}const uz=3e3;function fz(t){const[s,o]=b.useState(!1),r=b.useRef(t.onSessionEvent);r.current=t.onSessionEvent;const c=b.useRef(t.onDomainEvent);c.current=t.onDomainEvent;const d=b.useRef(t.onConnect);d.current=t.onConnect;const u=b.useRef(t.onDisconnect);return u.current=t.onDisconnect,b.useEffect(()=>{let p=!1,m;async function g(){var v,x;if(!p){try{const y=Ye.streamEvents({});o(!0),Promise.resolve((v=d.current)==null?void 0:v.call(d)).catch(()=>{});for await(const k of y){if(p)break;const S=k.event;if(S.case==="sessionEvent"){const j=S.value;r.current({sessionId:j.sessionId,type:j.type,timestamp:j.timestamp,content:j.content,raw:j.raw})}else if(S.case==="domainEvent"){const j=S.value;c.current({id:j.id,type:j.type,timestamp:j.timestamp,payloadJson:j.payloadJson})}}}catch(y){if(y instanceof Ci&&y.code===Sx.Unauthenticated){window.location.href=TN;return}}p||(o(!1),(x=u.current)==null||x.call(u),m=setTimeout(()=>{g().catch(()=>{})},uz))}}return g().catch(()=>{}),()=>{p=!0,clearTimeout(m),o(!1)}},[]),{connected:s}}const hm=["core","orchestration","scheduling"],ak=b.createContext({pluginNames:[...hm],loading:!1,error:void 0});function pz({children:t}){const[s,o]=b.useState([...hm]),[r,c]=b.useState(!0),[d,u]=b.useState(void 0);return b.useEffect(()=>{let p=!1;return fetch("/api/manifest").then(async m=>{if(!m.ok)throw new Error(`Manifest fetch returned ${m.status}`);return m.json()}).then(m=>{p||(o(m.plugins.map(g=>g.name)),c(!1))}).catch(m=>{p||(o([...hm]),u(m instanceof Error?m:new Error(String(m))),c(!1))}),()=>{p=!0}},[]),i.jsx(ak.Provider,{value:{pluginNames:s,loading:r,error:d},children:t})}function hh(){return b.useContext(ak)}const mz=new Set(["dashboard","chat","environments","settings"]),hz=new Set(["tasks","findings"]),gz=new Set(["knowledge"]),ik={core:{navItems:ad.filter(t=>mz.has(t.view)),domainHookKeys:["environments","sessions","workspaces","tokens","credentials","codespaces","plugins"]},orchestration:{navItems:ad.filter(t=>hz.has(t.view)),domainHookKeys:["tasks","findings","personas","notifications"]},scheduling:{navItems:[],domainHookKeys:["schedules"]},knowledge:{navItems:ad.filter(t=>gz.has(t.view)),domainHookKeys:["knowledge"]}};function vz(t){return t.flatMap(s=>{var o;return((o=ik[s])==null?void 0:o.navItems)??[]})}function yz(t){return new Set(t.flatMap(s=>{var o;return((o=ik[s])==null?void 0:o.domainHookKeys)??[]}))}function bz(t){return{id:t.id,displayName:t.displayName,adapterType:t.adapterType,adapterConfig:t.adapterConfig||"{}",status:t.status,bootstrapped:t.bootstrapped}}function ox(t){return{id:t.id,environmentId:t.environmentId,runtime:t.runtime,status:t.status,prompt:t.prompt,startedAt:t.startedAt,endedAt:t.endedAt||void 0,error:t.error||void 0,endReason:t.endReason||void 0,personaId:t.personaId||void 0,inputTokens:t.inputTokens,outputTokens:t.outputTokens,costMillicents:t.costMillicents}}function xz(t){return{sessionId:t.sessionId,eventType:Tx(t.type),timestamp:t.timestamp,content:t.content,raw:t.raw||void 0}}function _z(t){return{id:t.id,name:t.name,description:t.description,repoUrl:t.repoUrl,linkedEnvironmentIds:[...t.linkedEnvironmentIds],status:IT(t.status),workingDirectory:t.workingDirectory,useWorktrees:t.useWorktrees,defaultPersonaId:t.defaultPersonaId,tokenBudget:t.tokenBudget,costBudgetMillicents:t.costBudgetMillicents,createdAt:t.createdAt,updatedAt:t.updatedAt}}function rx(t){return{id:t.id,workspaceId:t.workspaceId??void 0,title:t.title,description:t.description,status:OT(t.status),branch:t.branch,latestSessionId:t.latestSessionId,dependsOn:[...t.dependsOn],sortOrder:t.sortOrder,createdAt:t.createdAt,startedAt:t.startedAt||void 0,completedAt:t.completedAt||void 0,parentTaskId:t.parentTaskId,depth:t.depth,childTaskIds:[...t.childTaskIds],canDecompose:t.canDecompose,defaultPersonaId:t.defaultPersonaId,workpad:t.workpad,tokenBudget:t.tokenBudget,costBudgetMillicents:t.costBudgetMillicents}}function Rp(t){return{id:t.id,workspaceId:t.workspaceId,taskId:t.taskId,sessionId:t.sessionId,category:t.category,title:t.title,content:t.content,tags:[...t.tags],createdAt:t.createdAt}}function kz(t){return{name:t.name,tokenType:t.type,envVar:t.envVar,filePath:t.filePath,expiresAt:t.expiresAt}}function Sz(t){return{claude:BT(t.claude),github:Ic(t.github),copilot:Ic(t.copilot),codex:Ic(t.codex),goose:Ic(t.goose)}}function Tz(t){return{name:t.name,repository:t.repository,state:t.state,gitStatus:t.gitStatus}}function Ip(t){return{id:t.id,name:t.name,description:t.description,systemPrompt:t.systemPrompt,toolConfig:t.toolConfig?JSON.stringify({allowedTools:[...t.toolConfig.allowedTools],disallowedTools:[...t.toolConfig.disallowedTools]}):"{}",runtime:t.runtime,model:t.model,maxTurns:t.maxTurns,mcpServers:JSON.stringify(t.mcpServers.map(s=>({name:s.name,command:s.command,args:[...s.args],tools:[...s.tools]}))),createdAt:t.createdAt,updatedAt:t.updatedAt,type:t.type||"agent",script:t.script,allowedMcpTools:[...t.allowedMcpTools]}}function jz(t){return{inputTokens:t.inputTokens,outputTokens:t.outputTokens,costMillicents:t.costMillicents,sessionCount:t.sessionCount}}function Op(t){return{id:t.id,title:t.title,description:t.description,scheduleExpression:t.scheduleExpression,personaId:t.personaId,environmentId:t.environmentId,workspaceId:t.workspaceId,parentTaskId:t.parentTaskId,enabled:t.enabled,lastRunAt:t.lastRunAt,nextRunAt:t.nextRunAt,runCount:t.runCount,createdAt:t.createdAt,updatedAt:t.updatedAt}}function Jc(t,s=0){return{id:t.id,label:t.title||t.label||t.id,kind:t.kind,category:t.category||void 0,sourceType:t.sourceType||void 0,sourceId:t.sourceId||void 0,content:t.content||void 0,tags:t.tags.length>0?[...t.tags]:void 0,workspaceId:t.workspaceId||void 0,createdAt:t.createdAt||void 0,updatedAt:t.updatedAt||void 0,val:s}}function Bp(t){return{source:t.fromId,target:t.toId,type:t.type}}function Ds(){const[t,s]=b.useState(!1),o=b.useRef(0),r=b.useCallback(c=>(o.current++,o.current===1&&s(!0),c.finally(()=>{o.current--,o.current===0&&s(!1)})),[]);return{loading:t,track:r}}const lx=5e3;function qr(t){return t instanceof Ci?t.message:"Operation failed"}function wz(){const[t,s]=b.useState([]),{loading:o,track:r}=Ds(),[c,d]=b.useState({}),[u,p]=b.useState(""),m=b.useCallback(()=>{p("")},[]),g=b.useCallback(async()=>{try{const C=await r(Ye.listEnvironments({}));s(C.environments.map(bz))}catch{}},[r]),v=b.useCallback(C=>{switch(C.type){case"environment.added":return!0;case"environment.removed":{const A=C.payload.environmentId;return A&&(s(O=>O.filter(E=>E.id!==A)),d(O=>{const E={...O};return delete E[A],E})),!0}case"environment.changed":return g().catch(()=>{}),!0;case"environment.provision_progress":{const A=C.payload;if(typeof A.environmentId!="string"||typeof A.stage!="string"||typeof A.message!="string"||typeof A.progress!="number")return Q1("environment.provision_progress","invalid payload"),!0;if(d(O=>({...O,[A.environmentId]:{stage:A.stage,message:A.message,progress:A.progress}})),A.stage==="ready"){const O=A.environmentId;setTimeout(()=>{d(E=>{const D={...E};return delete D[O],D})},lx)}return!0}default:return!1}},[g]),x=b.useCallback(C=>{var A;if(C.type==="environments"){const O=Array.isArray((A=C.payload)==null?void 0:A.environments)?C.payload.environments:[];return s(O),!0}return!1},[]),y=b.useCallback(async(C,A,O)=>{p("");try{await Ye.addEnvironment({displayName:C,adapterType:A,adapterConfig:JSON.stringify(O??{})})}catch(E){p(qr(E))}},[]),k=b.useCallback(async(C,A)=>{p("");try{await Ye.updateEnvironment({id:C,displayName:A.displayName,adapterConfig:A.adapterConfig?JSON.stringify(A.adapterConfig):void 0})}catch(O){p(qr(O))}},[]),S=b.useCallback(async(C,A)=>{p("");try{const O=Ye.provisionEnvironment({id:C,force:A??!1});for await(const E of O)d(D=>({...D,[C]:{stage:E.stage,message:E.message,progress:E.progress}})),E.stage==="ready"&&setTimeout(()=>{d(D=>{const P={...D};return delete P[C],P})},lx)}catch(O){d(E=>{const D={...E};return delete D[C],D}),p(qr(O))}},[]),j=b.useCallback(async C=>{p("");try{await Ye.stopEnvironment({id:C})}catch(A){p(qr(A))}},[]),N=b.useCallback(async C=>{p("");try{await Ye.removeEnvironment({id:C})}catch(A){p(qr(A))}},[]);return{environments:t,environmentsLoading:o,provisionStatus:c,operationError:u,clearOperationError:m,loadEnvironments:g,addEnvironment:y,updateEnvironment:k,provisionEnvironment:S,stopEnvironment:j,removeEnvironment:N,handleEvent:v,handleLegacyMessage:x,domainHook:{onConnect:()=>g(),onDisconnect:()=>{},handleEvent:v}}}const Lp=new Set(["pending","running","idle"]),Nz=new Set(["completed","failed","interrupted","hibernating","suspended"]),cx=["pending","running","idle"];function Cz(){const[t,s]=b.useState([]),{loading:o,track:r}=Ds(),[c,d]=b.useState([]),[u,p]=b.useState(0),[m,g]=b.useState(void 0),[v,x]=b.useState({}),y=b.useCallback(async()=>{try{const z=(await r(Ye.listSessions({}))).sessions.map(ox);s(J=>{const V=new Map(J.map(K=>[K.id,K]));return z.map(K=>{const fe=V.get(K.id),ee=fe==null?void 0:fe.status;return!ee||ee===K.status?K:Nz.has(ee)&&Lp.has(K.status)?{...K,status:ee,...fe.endReason!==void 0?{endReason:fe.endReason}:{}}:Lp.has(ee)&&Lp.has(K.status)&&cx.indexOf(ee)>cx.indexOf(K.status)?{...K,status:ee}:K})})}catch{}},[r]),k=b.useCallback(B=>{if(B.type!=="session_event")return!1;if(!z7(B.payload))return Q1("session_event","payload is not a valid SessionEvent"),!0;const z=B.payload;let J=0;if(d(V=>{const K=[...V,z];return K.length>wo?(J=K.length-wo,K.slice(-wo)):K}),J>0&&p(V=>V+J),z.eventType==="usage")try{const V=JSON.parse(z.content),K=Number(V.input_tokens)||0,fe=Number(V.output_tokens)||0,ee=Number(V.cost_millicents)||0;(K>0||fe>0||ee>0)&&s(oe=>oe.map(M=>M.id===z.sessionId?{...M,inputTokens:(M.inputTokens??0)+K,outputTokens:(M.outputTokens??0)+fe,costMillicents:(M.costMillicents??0)+ee}:M))}catch{}if(z.eventType==="status"){const V=ek(z.content),K=tk(z.content);s(fe=>fe.some(oe=>oe.id===z.sessionId)?fe.map(oe=>oe.id===z.sessionId?{...oe,status:V,...K!==void 0?{endReason:K}:{}}:oe):[...fe,{id:z.sessionId,environmentId:"",runtime:"",status:V,prompt:"",startedAt:z.timestamp,...K!==void 0?{endReason:K}:{}}])}return!0},[]),S=b.useCallback(B=>{k({type:"session_event",payload:B})},[k]),j=b.useCallback(B=>{var z,J,V,K,fe;switch(B.type){case"sessions":{const ee=Array.isArray((z=B.payload)==null?void 0:z.sessions)?B.payload.sessions:[];return s(ee),!0}case"spawned":{const ee=(J=B.payload)==null?void 0:J.sessionId;return typeof ee=="string"&&ee&&g(ee),y().catch(()=>{}),!0}case"session_events":{const ee=Array.isArray((V=B.payload)==null?void 0:V.events)?B.payload.events:[];return ee.length>0&&d(ee),!0}case"task_sessions":{const ee=(K=B.payload)==null?void 0:K.taskId;if(typeof ee=="string"&&ee){const oe=Array.isArray((fe=B.payload)==null?void 0:fe.sessions)?B.payload.sessions:[];x(M=>({...M,[ee]:oe}))}return!0}default:return!1}},[y]),N=b.useCallback(async(B,z,J,V)=>{try{const K=await Ye.spawnAgent({environmentId:B,prompt:z,personaId:J||"",workingDirectory:V||""});g(K.id),await y()}catch{}},[y]),T=b.useCallback(async(B,z)=>{try{await Ye.sendInput({sessionId:B,text:z})}catch{}},[]),C=b.useCallback(async B=>{try{await Ye.killAgent({id:B,graceful:!1})}catch{}},[]),A=b.useCallback(async B=>{try{await Ye.killAgent({id:B,graceful:!0})}catch{}},[]),O=b.useCallback(async B=>{try{const J=(await Ye.getSessionEvents({id:B})).events.map(xz);if(J.length>0){let V=0;d(K=>{const fe=new Set;for(const M of K)M.sessionId===B&&fe.add(`${M.timestamp}|${M.eventType}`);const ee=J.filter(M=>!fe.has(`${M.timestamp}|${M.eventType}`)),oe=[...K,...ee].sort((M,H)=>M.sessionId!==H.sessionId?0:M.timestamp.localeCompare(H.timestamp));return oe.length>wo?(V=oe.length-wo,oe.slice(-wo)):oe}),V>0&&p(K=>K+V)}}catch{}},[]),E=b.useCallback(()=>{d([]),p(0)},[]),D=b.useCallback(async B=>{try{const J=(await Ye.getTaskSessions({id:B})).sessions.map(ox);x(V=>({...V,[B]:J}))}catch{}},[]);return{sessions:t,sessionsLoading:o,events:c,eventsDropped:u,lastSpawnedId:m,taskSessions:v,loadSessions:y,spawn:N,sendInput:T,kill:C,stopGraceful:A,loadSessionEvents:O,clearEvents:E,loadTaskSessions:D,handleMessage:k,handleSessionEvent:S,handleLegacyMessage:j,domainHook:{onConnect:()=>y(),onDisconnect:()=>{E()},handleEvent:()=>!1}}}function dx(t){return t instanceof Ci?t.message:"Operation failed"}function Ez(){const[t,s]=b.useState([]),{loading:o,track:r}=Ds(),[c,d]=b.useState(!1),[u,p]=b.useState(""),m=b.useCallback(async()=>{try{const C=await r(Ye.listWorkspaces({}));s(C.workspaces.map(_z))}catch{}},[r]),g=b.useCallback(C=>{switch(C.type){case"workspace.created":return d(!1),m().catch(()=>{}),!0;case"workspace.archived":case"workspace.updated":return m().catch(()=>{}),!0;default:return!1}},[m]),v=b.useCallback(()=>{d(!1)},[]),x=b.useCallback(async(C,A,O,E,D,P,B,z,J)=>{d(!0);try{await Ye.createWorkspace({name:C,description:A||"",repoUrl:O||"",environmentId:E||"",defaultPersonaId:D||void 0,useWorktrees:P??!0,workingDirectory:B||void 0}),d(!1),z==null||z()}catch(V){d(!1);const K=V instanceof Ci?V.message:"Failed to create workspace";J==null||J(K)}},[]),y=b.useCallback(async C=>{try{await Ye.archiveWorkspace({id:C})}catch{}},[]),k=b.useCallback(async(C,A)=>{try{await Ye.updateWorkspace({id:C,...A})}catch{}},[]),S=b.useCallback(()=>{p("")},[]),j=b.useCallback(async(C,A)=>{try{p(""),await Ye.linkEnvironment({workspaceId:C,environmentId:A}),await m().catch(()=>{})}catch(O){p(dx(O))}},[m]),N=b.useCallback(async(C,A)=>{try{p(""),await Ye.unlinkEnvironment({workspaceId:C,environmentId:A}),await m().catch(()=>{})}catch(O){p(dx(O))}},[m]);return{workspaces:t,workspacesLoading:o,workspaceCreating:c,loadWorkspaces:m,createWorkspace:x,archiveWorkspace:y,updateWorkspace:k,linkEnvironment:j,unlinkEnvironment:N,linkOperationError:u,clearLinkOperationError:S,handleEvent:g,onDisconnect:v,domainHook:{onConnect:()=>m(),onDisconnect:v,handleEvent:g}}}function Az(){const[t,s]=b.useState([]),{loading:o,track:r}=Ds(),[c,d]=b.useState(void 0),u=b.useRef({}),p=b.useCallback(async E=>{try{const P=(await dn.listTasks({workspaceId:E})).tasks.map(rx);s(B=>[...B.filter(z=>z.workspaceId!==E),...P])}catch{}},[]),m=b.useCallback(async()=>{try{const D=(await r(dn.listTasks({}))).tasks.map(rx);s(P=>{const B=new Set(D.map(z=>z.id));return[...P.filter(z=>!B.has(z.id)),...D]})}catch{}},[r]),g=b.useCallback((E,D)=>{const P=B=>{clearTimeout(u.current[B]),u.current[B]=setTimeout(()=>{delete u.current[B],p(B).catch(()=>{})},200)};E?P(E):D&&s(B=>{const z=B.find(J=>J.id===D);return z!=null&&z.workspaceId?P(z.workspaceId):m().catch(()=>{}),B})},[p,m]),v=b.useCallback(E=>{const D=E.payload;switch(E.type){case"task.created":{const P=typeof D.workspaceId=="string"?D.workspaceId:"";return P&&p(P).catch(()=>{}),!0}case"task.started":{const P=typeof D.taskId=="string"?D.taskId:"",B=typeof D.sessionId=="string"?D.sessionId:"",z=typeof D.workspaceId=="string"?D.workspaceId:"";return d(J=>P&&J===P?void 0:J),B&&P&&s(J=>J.map(V=>V.id===P?{...V,latestSessionId:B}:V)),g(z,P),!0}case"task.completed":case"task.deleted":case"task.reparented":case"task.updated":{const P=typeof D.workspaceId=="string"?D.workspaceId:"",B=typeof D.taskId=="string"?D.taskId:"";return d(z=>B&&z===B?void 0:z),g(P,B),!0}default:return!1}},[p,g]),x=b.useCallback(()=>{d(void 0)},[]),y=b.useCallback(E=>{var D,P;if(E.type==="tasks"){const B=Array.isArray((D=E.payload)==null?void 0:D.tasks)?E.payload.tasks:[],z=typeof((P=E.payload)==null?void 0:P.workspaceId)=="string"&&E.payload.workspaceId?E.payload.workspaceId:"";return s(z?J=>[...J.filter(V=>V.workspaceId!==z),...B]:J=>{const V=new Set(B.map(K=>K.id));return[...J.filter(K=>!V.has(K.id)),...B]}),!0}return!1},[]),k=b.useCallback(async(E,D,P,B,z,J,V,K,fe)=>{try{await dn.createTask({workspaceId:E,title:D,description:P||"",dependsOn:B||[],parentTaskId:z||"",defaultPersonaId:J||void 0,canDecompose:V??void 0}),K==null||K()}catch(ee){const oe=ee instanceof Ci?ee.message:"Failed to create task";fe==null||fe(oe)}},[]),S=b.useCallback(async(E,D,P,B)=>{d(E);try{await dn.startTask({taskId:E,personaId:D||"",environmentId:P||"",notes:B||""})}catch(z){if(z instanceof Ci&&z.code===Sx.ResourceExhausted)return;d(void 0)}},[]),j=b.useCallback(async E=>{try{await dn.stopTask({id:E})}catch{}},[]),N=b.useCallback(async E=>{try{await dn.completeTask({id:E})}catch{}},[]),T=b.useCallback(async E=>{try{await dn.resumeTask({id:E})}catch{}},[]),C=b.useCallback(async(E,D,P,B,z)=>{try{await dn.updateTask({id:E,title:D,description:P,dependsOn:B,...z!==void 0?{defaultPersonaId:z}:{}})}catch{}},[]),A=b.useCallback(async E=>{try{await dn.deleteTask({id:E})}catch{}},[]);return{tasks:t,tasksLoading:o,taskStartingId:c,loadTasks:p,loadAllTasks:m,createTask:k,startTask:S,stopTask:j,completeTask:N,resumeTask:T,updateTask:C,deleteTask:A,handleEvent:v,onDisconnect:x,handleLegacyMessage:y,domainHook:{onConnect:()=>m(),onDisconnect:x,handleEvent:v}}}function Dz(){const[t,s]=b.useState([]),[o,r]=b.useState(void 0),[c,d]=b.useState(!1),{loading:u,track:p}=Ds(),m=b.useCallback(async S=>{try{const j=await p(dn.queryFindings({workspaceId:S}));s(j.findings.map(Rp))}catch{}},[p]),g=b.useCallback(async()=>{try{const S=await p(dn.queryFindings({workspaceId:""}));s(S.findings.map(Rp))}catch{}},[p]),v=b.useCallback(async S=>{r(void 0),d(!0);try{const j=await dn.getFinding({id:S});r(Rp(j))}catch{r(void 0)}finally{d(!1)}},[]),x=b.useCallback(S=>{if(S.type==="finding.posted"){const j=typeof S.payload.workspaceId=="string"?S.payload.workspaceId:"";return j&&m(j).catch(()=>{}),!0}return!1},[m]),y=b.useCallback(async(S,j,N,T,C)=>{try{await dn.postFinding({workspaceId:S,title:j,content:N,category:T??"general",tags:C??[]})}catch{}},[]);return{findings:t,selectedFinding:o,findingLoading:c,findingsLoading:u,loadFindings:m,loadAllFindings:g,loadFinding:v,postFinding:y,handleEvent:x,domainHook:{onConnect:()=>g(),onDisconnect:()=>{},handleEvent:x}}}function Mz(){const[t,s]=b.useState([]),{loading:o,track:r}=Ds(),c=b.useCallback(async()=>{try{const g=await r(Ye.listTokens({}));s(g.tokens.map(kz))}catch{}},[r]),d=b.useCallback(g=>g.type==="token.changed"?(c().catch(()=>{}),!0):!1,[c]),u=b.useCallback(async(g,v,x,y,k)=>{try{await Ye.setToken({name:g,value:v,type:x,envVar:y,filePath:k})}catch{}},[]),p=b.useCallback(async g=>{try{await Ye.deleteToken({name:g})}catch{}},[]);return{tokens:t,tokensLoading:o,loadTokens:c,setToken:u,deleteToken:p,handleEvent:d,domainHook:{onConnect:()=>c(),onDisconnect:()=>{},handleEvent:d}}}function Rz(){const[t,s]=b.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),{loading:o,track:r}=Ds(),c=b.useCallback(async()=>{try{const m=await r(Ye.getCredentialProviders({}));s(Sz(m))}catch{}},[r]),d=b.useCallback(m=>m.type==="credential.providers_changed"?(P7(m.payload)&&s(m.payload),!0):!1,[]),u=b.useCallback(async m=>{const g=[{provider:"claude",value:m.claude},{provider:"github",value:m.github},{provider:"copilot",value:m.copilot},{provider:"codex",value:m.codex},{provider:"goose",value:m.goose}];await Promise.allSettled(g.map(({provider:v,value:x})=>Ye.setCredentialProvider({provider:v,value:x})))},[]);return{credentialProviders:t,credentialsLoading:o,loadCredentials:c,updateCredentialProviders:u,handleEvent:d,domainHook:{onConnect:()=>c(),onDisconnect:()=>{},handleEvent:d}}}function Iz(){const[t,s]=b.useState([]),[o,r]=b.useState(""),[c,d]=b.useState(""),[u,p]=b.useState(!1),m=b.useCallback(async()=>{try{const x=await Ye.listCodespaces({});s(x.codespaces.map(Tz)),d(x.error)}catch{}},[]),g=b.useCallback(async(x,y)=>{p(!0),r("");try{await Ye.createCodespace({repo:x,machine:y??""}),p(!1),await m()}catch(k){p(!1);const S=k instanceof Ci?k.message:"Failed to create codespace";r(S)}},[m]);return{codespaces:t,codespaceError:o,codespaceListError:c,codespaceCreating:u,listCodespaces:m,createCodespace:g,domainHook:{onConnect:()=>m(),onDisconnect:()=>{},handleEvent:()=>!1}}}function Oz(){const[t,s]=b.useState([]),{loading:o,track:r}=Ds(),c=b.useCallback(async()=>{try{const v=await r(dn.listPersonas({}));s(v.personas.map(Ip))}catch{}},[r]),d=b.useCallback(v=>{switch(v.type){case"persona.created":case"persona.updated":case"persona.deleted":return c().catch(()=>{}),!0;default:return!1}},[c]),u=b.useCallback(async(v,x,y,k,S,j,N,T,C)=>{const A=await dn.createPersona({name:v,description:x,systemPrompt:y,runtime:k||"",model:S||"",maxTurns:j||0,type:N||"agent",script:T||"",allowedMcpTools:C||[]}),O=Ip(A);return s(E=>[...E.filter(D=>D.id!==O.id),O]),O},[]),p=b.useCallback(async(v,x,y,k,S,j,N,T,C,A)=>{const O={id:v};x!==void 0&&(O.name=x),y!==void 0&&(O.description=y),k!==void 0&&(O.systemPrompt=k),S!==void 0&&(O.runtime=S),j!==void 0&&(O.model=j),N!==void 0&&(O.maxTurns=N),T!==void 0&&(O.type=T),C!==void 0&&(O.script=C),A!==void 0&&(O.allowedMcpTools={tools:A});const E=await dn.updatePersona(O),D=Ip(E);return s(P=>P.map(B=>B.id===D.id?D:B)),D},[]),m=b.useCallback(async v=>{await dn.deletePersona({id:v}),s(x=>x.filter(y=>y.id!==v))},[]);return{personas:t,personasLoading:o,loadPersonas:c,createPersona:u,updatePersona:p,deletePersona:m,handleEvent:d,domainHook:{onConnect:()=>c(),onDisconnect:()=>{},handleEvent:d}}}function Bz(){const[t,s]=b.useState([]),{loading:o,track:r}=Ds(),c=b.useRef(void 0),d=b.useCallback(async()=>{try{const x=await r(Bc.listSchedules({}));s(x.schedules.map(Op))}catch{}},[r]),u=b.useCallback(x=>{switch(x.type){case"schedule.created":case"schedule.updated":case"schedule.deleted":return d().catch(()=>{}),!0;case"schedule.fired":return clearTimeout(c.current),c.current=setTimeout(()=>{d().catch(()=>{})},500),!0;default:return!1}},[d]),p=b.useCallback(async(x,y,k,S,j,N,T)=>{const C=await Bc.createSchedule({title:x,description:y,scheduleExpression:k,personaId:S,environmentId:j||"",workspaceId:N||"",parentTaskId:T||""}),A=Op(C);return s(O=>[...O.filter(E=>E.id!==A.id),A]),A},[]),m=b.useCallback(async(x,y)=>{const k={id:x};y.title!==void 0&&(k.title=y.title),y.description!==void 0&&(k.description=y.description),y.scheduleExpression!==void 0&&(k.scheduleExpression=y.scheduleExpression),y.personaId!==void 0&&(k.personaId=y.personaId),y.environmentId!==void 0&&(k.environmentId=y.environmentId),y.enabled!==void 0&&(k.enabled=y.enabled);const S=await Bc.updateSchedule(k),j=Op(S);return s(N=>N.map(T=>T.id===j.id?j:T)),j},[]),g=b.useCallback(async x=>{await Bc.deleteSchedule({id:x}),s(y=>y.filter(k=>k.id!==x))},[]);return{schedules:t,schedulesLoading:o,loadSchedules:d,createSchedule:p,updateSchedule:m,deleteSchedule:g,handleEvent:u,domainHook:{onConnect:()=>d(),onDisconnect:()=>{clearTimeout(c.current)},handleEvent:u}}}function Lz(t){if(t)try{return JSON.parse(t)}catch{return}}function zz(){const[t,s]=b.useState(new Map),[o,r]=b.useState([]),[c,d]=b.useState(void 0),[u,p]=b.useState(void 0),[m,g]=b.useState(!1),[v,x]=b.useState(""),y=b.useRef(""),k=b.useCallback(async E=>{const D=E??"";y.current=D,x(""),g(!0);try{const P=await Lc.listRecentKnowledgeNodes({limit:30,workspaceId:D}),B=new Map,z=[];for(const J of P.nodes)B.set(J.id,Jc(J));for(const J of P.edges)z.push(Bp(J));for(const J of z){const V=B.get(J.source);V&&(V.val+=1);const K=B.get(J.target);K&&(K.val+=1)}s(B),r(z)}catch{}finally{g(!1)}},[]),S=b.useCallback(async E=>{if(E.trim()){x(E),p(void 0),d(void 0),g(!0);try{const D=await Lc.searchKnowledge({query:E,limit:20,workspaceId:y.current}),P=new Map,B=[];for(const z of D.results){z.node&&P.set(z.node.id,Jc(z.node,z.edges.length));for(const J of z.edges)B.push(Bp(J))}s(P),r(B)}catch{}finally{g(!1)}}},[]),j=b.useCallback(()=>{k(y.current).catch(()=>{})},[k]),N=b.useCallback(async E=>{p(E);try{const D=await Lc.getKnowledgeNode({id:E});if(!D.node){d(void 0);return}d({node:Jc(D.node,D.edges.length),edges:D.edges.map(P=>({fromId:P.fromId,toId:P.toId,type:P.type,metadata:Lz(P.metadataJson)}))})}catch{d(void 0)}},[]),T=b.useCallback(()=>{p(void 0),d(void 0)},[]),C=b.useCallback(async E=>{try{const D=await Lc.expandKnowledgeNode({id:E,depth:1});s(P=>{const B=new Map(P);for(const z of D.nodes)B.has(z.id)||B.set(z.id,Jc(z));return B}),r(P=>{const B=new Set(P.map(J=>`${J.source}:${J.target}:${J.type}`)),z=[];for(const J of D.edges){const V=Bp(J),K=`${V.source}:${V.target}:${V.type}`;B.has(K)||z.push(V)}return[...P,...z]})}catch{}},[]),A=b.useCallback(E=>!1,[]),O={onConnect:async()=>{},onDisconnect:()=>{},handleEvent:A};return{graphData:{nodes:[...t.values()],links:o},selectedNode:c,selectedId:u,loading:m,searchQuery:v,search:S,clearSearch:j,selectNode:N,clearSelection:T,expandNode:C,loadRecent:k,handleEvent:A,domainHook:O}}function $z(){const t=b.useRef("default");b.useEffect(()=>{typeof Notification>"u"||(t.current=Notification.permission)},[]);function s(r){if(r.type!=="notification.escalated")return!1;if(typeof Notification>"u")return!0;if(t.current==="default")return Notification.requestPermission().then(u=>{t.current=u}).catch(()=>{}),!0;if(t.current!=="granted")return!0;const c=r.payload,d=new Notification(c.title||"Agent needs input",{body:c.message||"An agent is waiting for your input.",tag:c.escalationId,icon:"/icon-192x192.png"});return d.onclick=()=>{window.focus(),c.taskUrl&&(window.location.href=c.taskUrl),d.close()},!0}return{handleEvent:s,domainHook:{onConnect:async()=>{},onDisconnect:()=>{},handleEvent:s}}}function Pz(){const[t,s]=b.useState([]),{loading:o,track:r}=Ds(),c=b.useCallback(async()=>{try{const m=await r(Ye.listPlugins({}));s(m.plugins.map(g=>({name:g.name,description:g.description,enabled:g.enabled,required:g.required,loaded:g.loaded})))}catch{}},[r]),d=b.useCallback(m=>m.type==="plugin.changed"?(c().catch(()=>{}),!0):!1,[c]),u=b.useCallback(async(m,g)=>{try{const v=await Ye.setPluginEnabled({name:m,enabled:g});s(x=>x.map(y=>y.name===v.name?{...y,enabled:v.enabled}:y))}catch{}},[]);return{plugins:t,pluginsLoading:o,loadPlugins:c,setPluginEnabled:u,domainHook:{onConnect:()=>c(),onDisconnect:()=>{},handleEvent:d}}}function Uz(){const[t,s]=b.useState(""),[o,r]=b.useState(void 0),[c,d]=b.useState({}),{pluginNames:u}=hh(),p=yz(u),m=wz(),g=Cz(),v=Ez(),x=Az(),y=Dz(),k=Mz(),S=Rz(),j=Iz(),N=Oz(),T=Bz(),C=zz(),A=$z(),O=Pz(),E=[...p.has("environments")?[m.domainHook]:[],...p.has("sessions")?[g.domainHook]:[],...p.has("workspaces")?[v.domainHook]:[],...p.has("tasks")?[x.domainHook]:[],...p.has("findings")?[y.domainHook]:[],...p.has("tokens")?[k.domainHook]:[],...p.has("credentials")?[S.domainHook]:[],...p.has("codespaces")?[j.domainHook]:[],...p.has("personas")?[N.domainHook]:[],...p.has("schedules")?[T.domainHook]:[],...p.has("knowledge")?[C.domainHook]:[],...p.has("notifications")?[A.domainHook]:[],...p.has("plugins")?[O.domainHook]:[]],{connected:D}=fz({onSessionEvent:M=>{g.handleSessionEvent({sessionId:M.sessionId,eventType:Tx(M.type),timestamp:M.timestamp,content:M.content,raw:M.raw||void 0})},onDomainEvent:M=>{try{const H=JSON.parse(M.payloadJson);K({id:M.id,type:M.type,timestamp:M.timestamp,payload:H})}catch{console.warn("[grackle] Failed to parse domain event payloadJson:",M.payloadJson)}},onConnect:fe,onDisconnect:ee}),P="default_persona_id",B="onboarding_completed",z=b.useCallback(async M=>{const H=await Ye.setSetting({key:P,value:M});s(H.value)},[]),J=b.useCallback(async()=>{r(!0);try{await Ye.setSetting({key:B,value:"true"})}catch{}},[]),V=b.useCallback(async(M,H)=>{try{const ne=await Ye.getUsage({scope:M,id:H}),he=`${M}:${H}`;d(W=>({...W,[he]:jz(ne)}))}catch{}},[]);function K(M){const H=M.payload.key,ne=M.payload.value;if(M.type==="setting.changed"){H===P&&s(ne??""),H===B&&r(ne==="true");return}for(const he of E)if(he.handleEvent(M))break;(M.type==="environment.removed"||M.type==="environment.changed"||M.type==="task.started")&&g.loadSessions().catch(()=>{})}async function fe(){for(const M of E)M.onConnect().catch(()=>{});try{const M=await Ye.getSetting({key:P});s(M.value)}catch{}try{const M=await Ye.getSetting({key:B});r(M.value==="true")}catch{}}function ee(){E.forEach(M=>M.onDisconnect())}const oe=b.useCallback(()=>{m.loadEnvironments().catch(()=>{}),g.loadSessions().catch(()=>{}),v.loadWorkspaces().catch(()=>{}),k.loadTokens().catch(()=>{})},[m.loadEnvironments,g.loadSessions,v.loadWorkspaces,k.loadTokens]);return{connected:D,environments:{environments:m.environments,environmentsLoading:m.environmentsLoading,provisionStatus:m.provisionStatus,operationError:m.operationError,clearOperationError:m.clearOperationError,loadEnvironments:m.loadEnvironments,addEnvironment:m.addEnvironment,updateEnvironment:m.updateEnvironment,provisionEnvironment:m.provisionEnvironment,stopEnvironment:m.stopEnvironment,removeEnvironment:m.removeEnvironment,domainHook:m.domainHook},sessions:{sessions:g.sessions,sessionsLoading:g.sessionsLoading,events:g.events,eventsDropped:g.eventsDropped,lastSpawnedId:g.lastSpawnedId,taskSessions:g.taskSessions,spawn:g.spawn,sendInput:g.sendInput,kill:g.kill,stopGraceful:g.stopGraceful,loadSessionEvents:g.loadSessionEvents,clearEvents:g.clearEvents,loadTaskSessions:g.loadTaskSessions,domainHook:g.domainHook},workspaces:{workspaces:v.workspaces,workspacesLoading:v.workspacesLoading,workspaceCreating:v.workspaceCreating,loadWorkspaces:v.loadWorkspaces,createWorkspace:v.createWorkspace,archiveWorkspace:v.archiveWorkspace,updateWorkspace:v.updateWorkspace,linkEnvironment:v.linkEnvironment,unlinkEnvironment:v.unlinkEnvironment,linkOperationError:v.linkOperationError,clearLinkOperationError:v.clearLinkOperationError,domainHook:v.domainHook},tasks:{tasks:x.tasks,tasksLoading:x.tasksLoading,taskStartingId:x.taskStartingId,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,domainHook:x.domainHook},findings:{findings:y.findings,selectedFinding:y.selectedFinding,findingLoading:y.findingLoading,findingsLoading:y.findingsLoading,loadFindings:y.loadFindings,loadAllFindings:y.loadAllFindings,loadFinding:y.loadFinding,postFinding:y.postFinding,domainHook:y.domainHook},tokens:{tokens:k.tokens,tokensLoading:k.tokensLoading,loadTokens:k.loadTokens,setToken:k.setToken,deleteToken:k.deleteToken,domainHook:k.domainHook},credentials:{credentialProviders:S.credentialProviders,credentialsLoading:S.credentialsLoading,updateCredentialProviders:S.updateCredentialProviders,domainHook:S.domainHook},codespaces:{codespaces:j.codespaces,codespaceError:j.codespaceError,codespaceListError:j.codespaceListError,codespaceCreating:j.codespaceCreating,listCodespaces:j.listCodespaces,createCodespace:j.createCodespace,domainHook:j.domainHook},personas:{personas:N.personas,personasLoading:N.personasLoading,createPersona:N.createPersona,updatePersona:N.updatePersona,deletePersona:N.deletePersona,domainHook:N.domainHook},schedules:{schedules:T.schedules,schedulesLoading:T.schedulesLoading,createSchedule:T.createSchedule,updateSchedule:T.updateSchedule,deleteSchedule:T.deleteSchedule,domainHook:T.domainHook},knowledge:C,plugins:{plugins:O.plugins,pluginsLoading:O.pluginsLoading,loadPlugins:O.loadPlugins,setPluginEnabled:O.setPluginEnabled},appDefaultPersonaId:t,setAppDefaultPersonaId:z,onboardingCompleted:o,completeOnboarding:J,usageCache:c,loadUsage:V,refresh:oe}}function Hz({children:t}){const s=Uz();return i.jsx(uh.Provider,{value:s,children:t})}function Vz(t,s){const o=b.useRef(null);b.useEffect(()=>{const r=o.current;if(o.current=t,r===null)return;const c=new Map;for(const u of r)c.set(u.id,u);const d=new Set;for(const u of t){d.add(u.id);const p=c.get(u.id);if(p&&p.status!==u.status&&u.status!=="sleeping"){if(u.status==="connecting"){s("Provisioning environment…","info");continue}u.status==="connected"?s("Environment connected","success"):u.status==="error"?s("Environment provision failed","error"):u.status==="disconnected"&&(p.status==="connected"?s("Environment disconnected","warning"):s("Environment stopped","info"))}}for(const u of r)d.has(u.id)||s("Environment removed","info")},[t,s])}function qz(t,s,o){const r=b.useRef(t);b.useEffect(()=>{t&&t!==r.current&&(o(t,"error"),s()),r.current=t},[t,s,o])}const Gz={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 Fz(t){return Gz[t]}function Zz(t,s){if(t===void 0)return[];const o=[],r=new Map;for(const d of t)r.set(d.id,d);const c=new Set;for(const d of s){c.add(d.id);const u=r.get(d.id);if(!u||u.status===d.status)continue;const p=Fz(d.status);p&&o.push(p)}for(const d of t)c.has(d.id)||o.push({message:"Task deleted",variant:"info"});return o}function Kz(t,s){const o=b.useRef(void 0);b.useEffect(()=>{const r=o.current;o.current=t;const c=Zz(r,t);for(const d of c)s(d.message,d.variant)},[t,s])}const Yz="_dashboard_16pzm_1",Jz="_kpiStrip_16pzm_11",Wz="_kpiCard_16pzm_23",Xz="_kpiValue_16pzm_68",Qz="_kpiLabel_16pzm_76",e$="_bodyGrid_16pzm_84",t$="_section_16pzm_96",n$="_sectionHeader_16pzm_109",s$="_sectionIcon_16pzm_118",a$="_sectionTitle_16pzm_123",i$="_sectionCount_16pzm_131",o$="_sectionBody_16pzm_138",r$="_emptyHint_16pzm_143",l$="_sessionRow_16pzm_150",c$="_sessionPrompt_16pzm_177",d$="_sessionEnv_16pzm_186",u$="_sessionRuntime_16pzm_192",f$="_sessionStatus_16pzm_198",p$="_statusDot_16pzm_207",m$="_attentionRow_16pzm_233",h$="_attentionTitle_16pzm_259",g$="_attentionMeta_16pzm_267",v$="_reasonBadge_16pzm_274",y$="_bottomGrid_16pzm_301",b$="_envRow_16pzm_312",x$="_envName_16pzm_323",_$="_envStatusBadge_16pzm_333",k$="_workspaceRow_16pzm_369",S$="_workspaceTop_16pzm_395",T$="_workspaceName_16pzm_401",j$="_workspaceCounts_16pzm_407",w$="_progressBar_16pzm_415",N$="_progressFill_16pzm_422",pe={dashboard:Yz,kpiStrip:Jz,kpiCard:Wz,kpiValue:Xz,kpiLabel:Qz,bodyGrid:e$,section:t$,sectionHeader:n$,sectionIcon:s$,sectionTitle:a$,sectionCount:i$,sectionBody:o$,emptyHint:r$,sessionRow:l$,sessionPrompt:c$,sessionEnv:d$,sessionRuntime:u$,sessionStatus:f$,statusDot:p$,attentionRow:m$,attentionTitle:h$,attentionMeta:g$,reasonBadge:v$,bottomGrid:y$,envRow:b$,envName:x$,envStatusBadge:_$,workspaceRow:k$,workspaceTop:S$,workspaceName:T$,workspaceCounts:j$,progressBar:w$,progressFill:N$};function C$(){return i.jsxs("div",{className:pe.dashboard,"aria-hidden":"true",children:[i.jsx("div",{className:pe.kpiStrip,children:Array.from({length:4},(t,s)=>i.jsxs("div",{className:pe.kpiCard,children:[i.jsx(Te,{width:"3rem",height:"2rem"}),i.jsx(Te,{width:"80%",height:"0.75rem"})]},s))}),i.jsxs("div",{className:pe.bodyGrid,children:[i.jsxs("div",{className:pe.section,children:[i.jsxs("div",{className:pe.sectionHeader,children:[i.jsx(Te,{width:"1rem",height:"1rem",variant:"circular"}),i.jsx(Te,{width:"8rem",height:"0.75rem"}),i.jsx("span",{className:pe.sectionCount,children:i.jsx(Te,{width:"1rem",height:"0.75rem"})})]}),i.jsx("div",{className:pe.sectionBody,children:Array.from({length:3},(t,s)=>i.jsxs("div",{className:pe.sessionRow,style:{cursor:"default"},children:[i.jsx(Te,{width:"60%",height:"0.875rem"}),i.jsx(Te,{width:"4rem",height:"0.75rem"}),i.jsx(Te,{width:"3rem",height:"0.75rem"}),i.jsx(Te,{width:"3rem",height:"0.75rem"})]},s))})]}),i.jsxs("div",{className:pe.section,children:[i.jsxs("div",{className:pe.sectionHeader,children:[i.jsx(Te,{width:"1rem",height:"1rem",variant:"circular"}),i.jsx(Te,{width:"8rem",height:"0.75rem"}),i.jsx("span",{className:pe.sectionCount,children:i.jsx(Te,{width:"1rem",height:"0.75rem"})})]}),i.jsx("div",{className:pe.sectionBody,children:Array.from({length:2},(t,s)=>i.jsxs("div",{className:pe.attentionRow,style:{cursor:"default"},children:[i.jsxs("div",{className:pe.attentionTitle,children:[i.jsx(Te,{width:"3rem",height:"0.875rem",borderRadius:"var(--radius-sm)"}),i.jsx(Te,{width:"70%",height:"0.875rem"})]}),i.jsx("div",{className:pe.attentionMeta,children:i.jsx(Te,{width:"5rem",height:"0.625rem"})})]},s))})]})]}),i.jsxs("div",{className:pe.bottomGrid,children:[i.jsxs("div",{className:pe.section,children:[i.jsxs("div",{className:pe.sectionHeader,children:[i.jsx(Te,{width:"1rem",height:"1rem",variant:"circular"}),i.jsx(Te,{width:"9rem",height:"0.75rem"}),i.jsx("span",{className:pe.sectionCount,children:i.jsx(Te,{width:"1rem",height:"0.75rem"})})]}),i.jsx("div",{className:pe.sectionBody,children:Array.from({length:2},(t,s)=>i.jsxs("div",{className:pe.envRow,children:[i.jsx(Te,{width:"60%",height:"0.875rem"}),i.jsx(Te,{width:"4rem",height:"0.875rem",borderRadius:"var(--radius-sm)"})]},s))})]}),i.jsxs("div",{className:pe.section,children:[i.jsxs("div",{className:pe.sectionHeader,children:[i.jsx(Te,{width:"1rem",height:"1rem",variant:"circular"}),i.jsx(Te,{width:"6rem",height:"0.75rem"}),i.jsx("span",{className:pe.sectionCount,children:i.jsx(Te,{width:"1rem",height:"0.75rem"})})]}),i.jsx("div",{className:pe.sectionBody,children:Array.from({length:2},(t,s)=>i.jsxs("div",{className:pe.workspaceRow,style:{cursor:"default"},children:[i.jsxs("div",{className:pe.workspaceTop,children:[i.jsx(Te,{width:"50%",height:"0.875rem"}),i.jsx(Te,{width:"2rem",height:"0.75rem"})]}),i.jsx("div",{className:pe.progressBar,children:i.jsx("div",{className:pe.progressFill,style:{width:"0%"}})})]},s))})]})]})]})}const E$={hidden:{opacity:0,y:12},visible:t=>({opacity:1,y:0,transition:{delay:t*.06,duration:.3,ease:"easeOut"}})},Wc={hidden:{opacity:0,y:16},visible:t=>({opacity:1,y:0,transition:{delay:.15+t*.08,duration:.35,ease:"easeOut"}})};function A$(t,s,o,r){const c=[`${t} of ${s} tasks completed`];return o>0&&c.push(`${o} in progress`),r>0&&c.push(`${r} failed`),c.join(", ")}function Xc({value:t,label:s,accent:o,index:r,testId:c}){return i.jsxs(Rt.div,{className:pe.kpiCard,"data-accent":o,"data-testid":c,variants:E$,initial:"hidden",animate:"visible",custom:r,children:[i.jsx("span",{className:pe.kpiValue,children:t}),i.jsx("span",{className:pe.kpiLabel,children:s})]})}function D$(){const{workspaces:{workspaces:t,workspacesLoading:s},tasks:{tasks:o,tasksLoading:r,loadTasks:c},sessions:{sessions:d,sessionsLoading:u},environments:{environments:p,environmentsLoading:m}}=ot(),g=mt(),v=b.useRef(new Set);b.useEffect(()=>{for(const N of t)v.current.has(N.id)||(v.current.add(N.id),c(N.id).catch(()=>{}))},[t,c]);const x=b.useMemo(()=>W7(d,o,p),[d,o,p]),y=b.useMemo(()=>Q7(d,p),[d,p]),k=b.useMemo(()=>X7(o,t),[o,t]),S=b.useMemo(()=>ez(t,o),[t,o,p]);return d.length===0&&o.length===0&&p.length===0&&t.length===0&&(u||r||m||s)?i.jsx(C$,{}):i.jsxs("div",{className:pe.dashboard,"data-testid":"dashboard",children:[i.jsxs("div",{className:pe.kpiStrip,"data-testid":"dashboard-kpi-strip",children:[i.jsx(Xc,{value:x.activeSessions,label:"Active Sessions",accent:"green",index:0,testId:"kpi-active-sessions"}),i.jsx(Xc,{value:x.blockedTasks,label:"Blocked Tasks",accent:"yellow",index:1,testId:"kpi-blocked-tasks"}),i.jsx(Xc,{value:x.attentionTasks,label:"Needs Attention",accent:"red",index:2,testId:"kpi-attention-tasks"}),i.jsx(Xc,{value:x.unhealthyEnvironments,label:"Unhealthy Envs",accent:"blue",index:3,testId:"kpi-unhealthy-envs"})]}),i.jsxs("div",{className:pe.bodyGrid,children:[i.jsxs(Rt.div,{className:pe.section,variants:Wc,initial:"hidden",animate:"visible",custom:0,"data-testid":"dashboard-active-sessions",children:[i.jsxs("div",{className:pe.sectionHeader,children:[i.jsx("span",{className:pe.sectionIcon,"aria-hidden":"true",children:"●"}),i.jsx("span",{className:pe.sectionTitle,children:"Active Sessions"}),i.jsx("span",{className:pe.sectionCount,children:y.length})]}),i.jsx("div",{className:pe.sectionBody,children:y.length===0?i.jsx("div",{className:pe.emptyHint,children:"No active sessions"}):y.map(({session:N,environmentName:T})=>i.jsxs("button",{type:"button",className:pe.sessionRow,onClick:()=>g(Nm(N.id)),"data-testid":"session-row",children:[i.jsx("span",{className:pe.sessionPrompt,title:N.prompt,children:N.prompt||"—"}),i.jsx("span",{className:pe.sessionEnv,children:T}),i.jsx("span",{className:pe.sessionRuntime,children:N.runtime}),i.jsxs("span",{className:pe.sessionStatus,children:[i.jsx("span",{className:pe.statusDot,"data-status":N.status}),N.status]})]},N.id))})]}),i.jsxs(Rt.div,{className:pe.section,variants:Wc,initial:"hidden",animate:"visible",custom:1,"data-testid":"dashboard-needs-attention",children:[i.jsxs("div",{className:pe.sectionHeader,children:[i.jsx("span",{className:pe.sectionIcon,"aria-hidden":"true",children:"⚑"}),i.jsx("span",{className:pe.sectionTitle,children:"Needs Attention"}),i.jsx("span",{className:pe.sectionCount,children:k.length})]}),i.jsx("div",{className:pe.sectionBody,children:k.length===0?i.jsx("div",{className:pe.emptyHint,children:"All clear"}):k.map(({task:N,reason:T,workspaceName:C})=>i.jsxs("button",{type:"button",className:pe.attentionRow,onClick:()=>g(On(N.id)),"data-testid":"attention-row",children:[i.jsxs("div",{className:pe.attentionTitle,children:[i.jsx("span",{className:pe.reasonBadge,"data-reason":T,children:T}),N.title]}),i.jsx("div",{className:pe.attentionMeta,children:i.jsx("span",{children:C})})]},N.id))})]})]}),i.jsxs("div",{className:pe.bottomGrid,children:[i.jsxs(Rt.div,{className:pe.section,variants:Wc,initial:"hidden",animate:"visible",custom:2,"data-testid":"dashboard-env-health",children:[i.jsxs("div",{className:pe.sectionHeader,children:[i.jsx("span",{className:pe.sectionIcon,"aria-hidden":"true",children:"◈"}),i.jsx("span",{className:pe.sectionTitle,children:"Environment Health"}),i.jsx("span",{className:pe.sectionCount,children:p.length})]}),i.jsx("div",{className:pe.sectionBody,children:p.length===0?i.jsx("div",{className:pe.emptyHint,children:"No environments configured"}):p.map(N=>i.jsxs("div",{className:pe.envRow,"data-testid":"dashboard-env-row",children:[i.jsx("span",{className:pe.envName,children:N.displayName}),i.jsx("span",{className:pe.envStatusBadge,"data-status":N.status,children:N.status})]},N.id))})]}),i.jsxs(Rt.div,{className:pe.section,variants:Wc,initial:"hidden",animate:"visible",custom:3,"data-testid":"dashboard-workspace-snapshot",children:[i.jsxs("div",{className:pe.sectionHeader,children:[i.jsx("span",{className:pe.sectionIcon,"aria-hidden":"true",children:"▦"}),i.jsx("span",{className:pe.sectionTitle,children:"Workspaces"}),i.jsx("span",{className:pe.sectionCount,children:t.length})]}),i.jsx("div",{className:pe.sectionBody,children:S.length===0?i.jsx("div",{className:pe.emptyHint,children:"No workspaces yet"}):S.map(({workspace:N,totalTasks:T,completedTasks:C,workingTasks:A,failedTasks:O})=>{const E=T>0?Math.round(C/T*100):0;return i.jsxs("button",{type:"button",className:pe.workspaceRow,onClick:()=>g(Ei(N.id,N.linkedEnvironmentIds[0])),"data-testid":"workspace-row",children:[i.jsxs("div",{className:pe.workspaceTop,children:[i.jsx("span",{className:pe.workspaceName,children:N.name}),i.jsxs("span",{className:pe.workspaceCounts,"aria-label":A$(C,T,A,O),children:[C,"/",T,A>0&&i.jsxs("span",{style:{color:"var(--accent-green)"},"aria-hidden":"true",children:["▸",A]}),O>0&&i.jsxs("span",{style:{color:"var(--accent-red)"},"aria-hidden":"true",children:["✗",O]})]})]}),T>0&&i.jsx("div",{className:pe.progressBar,children:i.jsx("div",{className:pe.progressFill,style:{width:`${E}%`}})})]},N.id)})})]})]})]})}const M$="_panelContainer_1udy7_1",R$="_emptyState_1udy7_8",I$="_workspaceSummary_1udy7_17",O$="_workspaceSummaryTitle_1udy7_28",B$="_workspaceSummarySubtitle_1udy7_32",L$="_header_1udy7_36",z$="_headerInfo_1udy7_71",$$="_headerTitle_1udy7_106",P$="_taskStatusBadge_1udy7_128",U$="_taskBranch_1udy7_137",H$="_taskBlockedBadge_1udy7_143",V$="_tabBar_1udy7_277",q$="_tab_1udy7_277",G$="_active_1udy7_303",F$="_eventScroll_1udy7_308",Z$="_tabContent_1udy7_314",K$="_noContext_1udy7_319",Y$="_overviewContent_1udy7_325",J$="_overviewDashboard_1udy7_334",W$="_overviewHero_1udy7_340",X$="_overviewSection_1udy7_347",Q$="_overviewLabel_1udy7_353",eP="_envRow_1udy7_360",tP="_timeline_1udy7_366",nP="_timelineRow_1udy7_372",sP="_waitingMessage_1udy7_379",aP="_errorMessage_1udy7_383",iP="_emptyCta_1udy7_387",oP="_ctaTitle_1udy7_399",rP="_ctaDescription_1udy7_405",lP="_ctaButton_1udy7_412",cP="_workspaceHeader_1udy7_533",dP="_workspaceName_1udy7_558",uP="_workspaceMeta_1udy7_571",fP="_metaRow_1udy7_579",pP="_metaLabel_1udy7_592",mP="_metaValue_1udy7_607",hP="_archiveButton_1udy7_617",gP="_repoLink_1udy7_647",vP="_metaToggle_1udy7_657",yP="_metaToggleArrow_1udy7_678",bP="_metaToggleArrowOpen_1udy7_683",xP="_progressBarContainer_1udy7_687",_P="_progressBar_1udy7_687",kP="_progressFill_1udy7_703",SP="_progressLabel_1udy7_710",TP="_metaTimestamps_1udy7_717",jP="_metaTimestamp_1udy7_717",wP="_metaPlaceholder_1udy7_739",NP="_linkedEnvList_1udy7_744",CP="_linkedEnvChip_1udy7_750",EP="_chipDismiss_1udy7_762",AP="_linkError_1udy7_777",DP="_linkEnvSelect_1udy7_782",Y={panelContainer:M$,emptyState:R$,workspaceSummary:I$,workspaceSummaryTitle:O$,workspaceSummarySubtitle:B$,header:L$,headerInfo:z$,headerTitle:$$,taskStatusBadge:P$,taskBranch:U$,taskBlockedBadge:H$,tabBar:V$,tab:q$,active:G$,eventScroll:F$,tabContent:Z$,noContext:K$,overviewContent:Y$,overviewDashboard:J$,overviewHero:W$,overviewSection:X$,overviewLabel:Q$,envRow:eP,timeline:tP,timelineRow:nP,waitingMessage:sP,errorMessage:aP,emptyCta:iP,ctaTitle:oP,ctaDescription:rP,ctaButton:lP,workspaceHeader:cP,workspaceName:dP,workspaceMeta:uP,metaRow:fP,metaLabel:pP,metaValue:mP,archiveButton:hP,repoLink:gP,metaToggle:vP,metaToggleArrow:yP,metaToggleArrowOpen:bP,progressBarContainer:xP,progressBar:_P,progressFill:kP,progressLabel:SP,metaTimestamps:TP,metaTimestamp:jP,metaPlaceholder:wP,linkedEnvList:NP,linkedEnvChip:CP,chipDismiss:EP,linkError:AP,linkEnvSelect:DP};function MP(){return i.jsx("div",{className:Y.emptyState,children:"Select a task or click + to create one"})}function RP(){return i.jsx("div",{className:Y.emptyState,children:"Select an environment to manage its workspaces, or add a new one."})}function IP(){const{workspaces:{workspaces:t},environments:{environments:s}}=ot(),o=mt(),r=s.length>0;return t.length>0?i.jsx(D$,{}):i.jsxs("div",{className:Y.emptyCta,"data-testid":"welcome-cta",children:[i.jsx("div",{className:Y.ctaTitle,children:"Welcome to Grackle"}),i.jsx("div",{className:Y.ctaDescription,children:"Organize your work into workspaces and let agents tackle the tasks."}),i.jsx("button",{className:Y.ctaButton,onClick:()=>o(Jx),disabled:!r,"data-testid":"welcome-create-button",children:"Create Your First Workspace"}),!r&&i.jsx("div",{className:Y.ctaDescription,children:"Add an environment first before creating a workspace."})]})}const OP="_panelContainer_19poq_1",BP="_chatHeader_19poq_8",LP="_chatHeaderInfo_19poq_37",zP="_emptyState_19poq_43",$P="_emptyTitle_19poq_55",PP="_emptyDescription_19poq_61",UP="_emptyHint_19poq_67",Ha={panelContainer:OP,chatHeader:BP,chatHeaderInfo:LP,emptyState:zP,emptyTitle:$P,emptyDescription:PP,emptyHint:UP};function HP(){return i.jsx("div",{className:Ha.panelContainer,"aria-hidden":"true",children:i.jsxs("div",{style:{flex:1,overflow:"hidden",padding:"var(--space-md)",display:"flex",flexDirection:"column",gap:"var(--space-md)"},children:[i.jsx(Te,{width:"65%",height:"2.5rem",borderRadius:"var(--radius-sm)"}),i.jsx(Te,{width:"85%",height:"4rem",borderRadius:"var(--radius-sm)"}),i.jsx(Te,{width:"45%",height:"2rem",borderRadius:"var(--radius-sm)"}),i.jsx(Te,{width:"75%",height:"3rem",borderRadius:"var(--radius-sm)"}),i.jsx(Te,{width:"55%",height:"2.5rem",borderRadius:"var(--radius-sm)"})]})})}function VP({hasLocalEnvironment:t}){return i.jsxs("div",{className:Ha.emptyState,"data-testid":"chat-empty-state",children:[i.jsx("div",{className:Ha.emptyTitle,children:"Welcome to Grackle"}),i.jsx("div",{className:Ha.emptyDescription,children:t?"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."}),!t&&i.jsx("div",{className:Ha.emptyHint,children:"Go to Settings → Environments to add one."})]})}function qP(){const{tasks:{tasks:t,tasksLoading:s,startTask:o},sessions:{sessions:r,sessionsLoading:c,events:d,eventsDropped:u,taskSessions:p,loadTaskSessions:m,loadSessionEvents:g,kill:v,stopGraceful:x,sendInput:y,spawn:k},environments:{environments:S,provisionEnvironment:j},personas:{personas:N}}=ot(),{showToast:T}=pn(),C=b.useRef(void 0),[A,O]=b.useState(),E=t.find(K=>K.id===Or),D=E!=null&&E.latestSessionId?r.find(K=>K.id===E.latestSessionId)??(p[Or]??[]).find(K=>K.id===E.latestSessionId):void 0;b.useEffect(()=>{m(Or).catch(()=>{})},[m]),b.useEffect(()=>{E!=null&&E.latestSessionId&&m(Or).catch(()=>{})},[E==null?void 0:E.latestSessionId,m]),b.useEffect(()=>{D&&D.id!==C.current&&(C.current=D.id,g(D.id).catch(()=>{}))},[D==null?void 0:D.id,g]);const P=b.useMemo(()=>{if(!D)return[];const K=d.filter(fe=>fe.sessionId===D.id);return mh(ph(K))},[d,D==null?void 0:D.id]),B=S.find(K=>K.adapterType==="local"&&K.status==="connected"),z=D!==void 0&&D.status!=="stopped"&&D.status!=="suspended",J=(D==null?void 0:D.status)==="idle";b.useEffect(()=>{A&&D&&J&&(y(D.id,A).catch(()=>{}),O(void 0))},[A,J,D==null?void 0:D.id,y]);const V=b.useCallback((K,fe,ee,oe)=>{oe&&O(oe),o(K,fe,ee).catch(()=>{})},[o]);return!E&&(c||s)?i.jsx(HP,{}):i.jsxs("div",{className:Ha.panelContainer,"data-testid":"chat-page",children:[z&&i.jsxs("div",{className:Ha.chatHeader,children:[i.jsxs("span",{className:Ha.chatHeaderInfo,children:["Session: ",D.id.slice(0,8)," | ",D.runtime," | ",D.status]}),i.jsx(Xx,{label:"Stop",onClick:()=>{x(D.id).catch(()=>{})},variant:"danger",size:"sm","data-testid":"stop-split-button",options:[{label:"Stop",description:"Graceful shutdown",onClick:()=>{x(D.id).catch(()=>{})}},{label:"Kill",description:"Force kill",onClick:()=>{v(D.id).catch(()=>{})}}]})]}),i.jsx(ch,{events:P,eventsDropped:u,emptyState:i.jsx(VP,{hasLocalEnvironment:!!B}),onShowToast:T}),B&&z&&i.jsx(nl,{mode:"send",sessionId:D.id,environmentId:D.environmentId,personas:N,environments:S,onSendInput:(K,fe)=>{y(K,fe).catch(()=>{})},onSpawn:(K,fe,ee)=>{k(K,fe,ee).catch(()=>{})},onStartTask:(K,fe,ee)=>{o(K,fe,ee).catch(()=>{})},onProvisionEnvironment:K=>{j(K).catch(()=>{})},onShowToast:T}),B&&!z&&i.jsx(nl,{mode:"start",taskId:Or,environmentId:B.id,personas:N,environments:S,onSendInput:(K,fe)=>{y(K,fe).catch(()=>{})},onSpawn:(K,fe,ee)=>{k(K,fe,ee).catch(()=>{})},onStartTask:V,onProvisionEnvironment:K=>{j(K).catch(()=>{})},onShowToast:T})]})}function GP(){const t=q7(),[s]=wm(),o=s.get("env")??"",{sessions:{sendInput:r,spawn:c},tasks:{startTask:d},personas:{personas:u},environments:{environments:p,provisionEnvironment:m}}=ot(),{showToast:g}=pn();return i.jsxs("div",{className:Y.panelContainer,children:[i.jsx(vs,{segments:t}),i.jsx("div",{className:Y.emptyState,children:"Enter a prompt below to start a new session"}),i.jsx(nl,{mode:"spawn",environmentId:o,showPersonaSelect:!0,personas:u,environments:p,onSendInput:(v,x)=>{r(v,x).catch(()=>{})},onSpawn:(v,x,y)=>{c(v,x,y).catch(()=>{})},onStartTask:(v,x,y)=>{d(v,x,y).catch(()=>{})},onProvisionEnvironment:v=>{m(v).catch(()=>{})},onShowToast:g})]})}function FP(){return i.jsxs("div",{className:Y.panelContainer,"aria-hidden":"true",children:[i.jsxs("div",{className:Y.header,children:[i.jsx("span",{children:i.jsx(Te,{width:"10rem",height:"0.875rem"})}),i.jsx("span",{className:Y.headerInfo,children:i.jsx(Te,{width:"16rem",height:"0.875rem"})})]}),i.jsx("div",{className:Y.eventScroll,children:i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--space-md)"},children:[i.jsx(Te,{width:"70%",height:"2.5rem",borderRadius:"var(--radius-sm)"}),i.jsx(Te,{width:"90%",height:"4rem",borderRadius:"var(--radius-sm)"}),i.jsx(Te,{width:"50%",height:"2rem",borderRadius:"var(--radius-sm)"}),i.jsx(Te,{width:"80%",height:"3.5rem",borderRadius:"var(--radius-sm)"}),i.jsx(Te,{width:"60%",height:"2.5rem",borderRadius:"var(--radius-sm)"})]})})]})}function ZP({sessionId:t,session:s,isActive:o,onStop:r,onKill:c}){return i.jsxs("div",{className:Y.header,children:[i.jsxs("span",{children:["Session: ",t.slice(0,8),s&&` | ${s.runtime} | ${s.endReason||s.status}`,s!=null&&s.inputTokens||s!=null&&s.outputTokens||s!=null&&s.costMillicents?` | ${Io((s.inputTokens??0)+(s.outputTokens??0))} tokens · ${Ns(s.costMillicents??0)}`:""]}),i.jsxs("span",{className:Y.headerInfo,children:[s&&i.jsx("span",{children:s.prompt.length>60?s.prompt.slice(0,60)+"...":s.prompt}),o&&i.jsx(Xx,{label:"Stop",onClick:r,variant:"danger",size:"sm","data-testid":"stop-split-button",options:[{label:"Stop",description:"Graceful shutdown",onClick:r},{label:"Kill",description:"Force kill",onClick:c}]})]})]})}function KP({session:t}){const s=t&&(t.status==="stopped"||t.status==="suspended"),o=s?`Session ${t.endReason||t.status} with no events recorded.`:"Waiting for events...";return i.jsx("div",{className:s?Y.errorMessage:Y.waitingMessage,children:o})}function YP(){const{sessionId:t}=as(),{sessions:{events:s,eventsDropped:o,sessions:r,sessionsLoading:c,kill:d,stopGraceful:u,loadSessionEvents:p,sendInput:m,spawn:g},tasks:{startTask:v},personas:{personas:x},environments:{environments:y,provisionEnvironment:k}}=ot(),{showToast:S}=pn(),j=b.useRef(void 0),N=G7(t),T=r.find(O=>O.id===t)??void 0,C=b.useMemo(()=>{const O=t?s.filter(E=>E.sessionId===t):[];return mh(ph(O))},[s,t]);if(b.useEffect(()=>{t&&t!==j.current&&(j.current=t,p(t).catch(()=>{}))},[t,p]),!T&&c)return i.jsx(FP,{});if(!t)return i.jsx("div",{className:Y.emptyState,children:"No session selected"});const A=(T==null?void 0:T.status)==="running"||(T==null?void 0:T.status)==="idle";return i.jsxs("div",{className:Y.panelContainer,children:[i.jsx(vs,{segments:N}),i.jsx(ZP,{sessionId:t,session:T,isActive:A,onStop:()=>{u(t).catch(()=>{})},onKill:()=>{d(t).catch(()=>{})}}),i.jsx(ch,{events:C,eventsDropped:o,emptyState:i.jsx(KP,{session:T}),onShowToast:S}),A&&i.jsx(nl,{mode:"send",sessionId:t,environmentId:T.environmentId,personas:x,environments:y,onSendInput:(O,E)=>{m(O,E).catch(()=>{})},onSpawn:(O,E,D)=>{g(O,E,D).catch(()=>{})},onStartTask:(O,E,D)=>{v(O,E,D).catch(()=>{})},onProvisionEnvironment:O=>{k(O).catch(()=>{})},onShowToast:S})]})}function JP(t){if(!t)return!1;const s=t.tagName;return!!(s==="INPUT"||s==="TEXTAREA"||s==="SELECT"||t.isContentEditable)}function sa(t,s){const o=b.useRef(s);o.current=s;const{key:r,ctrl:c=!1,shift:d=!1,suppressInInputs:u=!0,enabled:p=!0}=t;b.useEffect(()=>{if(!p)return;const m=g=>{if(u&&JP(document.activeElement??void 0))return;const v=g.ctrlKey||g.metaKey;c===v&&(d&&!g.shiftKey||g.key===r&&o.current())};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[r,c,d,u,p])}function WP(){return i.jsxs("div",{className:Y.panelContainer,"aria-hidden":"true",children:[i.jsx("div",{className:Y.workspaceHeader,children:i.jsx("span",{className:Y.workspaceName,children:i.jsx(Te,{width:"12rem",height:"1.25rem"})})}),i.jsx("div",{className:Y.metaToggle,style:{cursor:"default"},children:i.jsx(Te,{width:"4rem",height:"0.625rem"})}),i.jsxs("div",{className:Y.progressBarContainer,children:[i.jsx("div",{className:Y.progressBar,children:i.jsx("div",{className:Y.progressFill,style:{width:"0%"}})}),i.jsx(Te,{width:"2rem",height:"0.625rem"})]}),i.jsxs("div",{className:Y.tabBar,role:"tablist","aria-label":"Workspace view",children:[i.jsx("span",{className:`${Y.tab} ${Y.active}`,children:"Graph"}),i.jsx("span",{className:Y.tab,children:"Board"}),i.jsx("span",{className:Y.tab,children:"Tasks"})]}),i.jsx("div",{className:Y.overviewContent,children:Array.from({length:3},(t,s)=>i.jsx(yd,{lines:2},s))})]})}function ux(t){if(!t)return"";const s=new Date(t);if(isNaN(s.getTime()))return"";const r=Date.now()-s.getTime();if(r<0)return"just now";const c=Math.floor(r/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 u=Math.floor(d/24);return u<30?`${u}d ago`:s.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}const zp=100;function XP(t){try{const s=new URL(t);return s.protocol!=="http:"&&s.protocol!=="https:"?void 0:s.toString()}catch{return}}function QP(){const{workspaceId:t,environmentId:s}=as(),o=mt(),{tasks:{tasks:r},environments:{environments:c},workspaces:{workspaces:d,workspacesLoading:u,archiveWorkspace:p,updateWorkspace:m,linkEnvironment:g,unlinkEnvironment:v,linkOperationError:x,clearLinkOperationError:y},personas:{personas:k},sessions:{sessions:S},usageCache:j,loadUsage:N}=ot(),{resolvedThemeId:T}=Y1(),[C,A]=b.useState("tasks"),[O,E]=b.useState(!1),[D,P]=b.useState(null),[B,z]=b.useState(!1),J=b.useRef(void 0),V=d.find(W=>W.id===t),K=s??(V==null?void 0:V.linkedEnvironmentIds[0])??"",fe=F7(t,K,d,c);sa({key:"1"},()=>A("graph")),sa({key:"2"},()=>A("board")),sa({key:"3"},()=>A("tasks")),b.useEffect(()=>{const W=J.current;J.current=t,!(W===void 0||W===t)&&D!==null&&P(null)},[t,D]);const ee=S.reduce((W,X)=>W+(X.costMillicents??0),0);b.useEffect(()=>{t&&N("workspace",t).catch(()=>{})},[t,N,ee]);const oe=t?j[`workspace:${t}`]:void 0,M=r.filter(W=>W.workspaceId===t),H=M.filter(W=>W.status==="complete").length,ne=M.length,he=ne>0?Math.round(H/ne*100):0;return!V&&u?i.jsx(WP,{}):i.jsxs("div",{className:Y.panelContainer,children:[i.jsx(vs,{segments:fe}),i.jsxs("div",{className:Y.workspaceHeader,children:[i.jsx("span",{className:Y.workspaceName,"data-testid":"workspace-name",children:i.jsx(Ft,{value:(V==null?void 0:V.name)||"",onSave:W=>{V&&m(V.id,{name:W}).catch(()=>{})},validate:W=>{const X=W.trim();if(!X)return"Name is required";if(X.length>zp)return`Max ${zp} characters`},maxLength:zp,fieldId:"name",activeFieldId:D,onActivate:P,ariaLabel:"Workspace name",renderDisplay:W=>W||t||void 0,"data-testid":"edit-name"})}),i.jsx("button",{className:Y.archiveButton,onClick:()=>E(!0),title:"Archive workspace","data-testid":"archive-workspace-button",children:"Archive"})]}),i.jsxs("button",{className:Y.metaToggle,onClick:()=>z(!B),"aria-expanded":!B,"aria-controls":"workspace-meta-panel","data-testid":"meta-toggle",children:[i.jsx("span",{className:`${Y.metaToggleArrow} ${B?"":Y.metaToggleArrowOpen}`,children:"▶"}),"Details"]}),!B&&i.jsxs("div",{className:Y.workspaceMeta,"data-testid":"workspace-meta",id:"workspace-meta-panel",children:[i.jsxs("div",{className:Y.metaRow,children:[i.jsx("span",{className:Y.metaLabel,children:"Description"}),i.jsx("div",{className:Y.metaValue,children:i.jsx(cm,{value:(V==null?void 0:V.description)||"",onSave:W=>{V&&m(V.id,{description:W}).catch(()=>{})},fieldId:"description",activeFieldId:D,onActivate:P,renderDisplay:W=>W?i.jsx("span",{className:Y.overviewMarkdown,children:i.jsx(Sd,{remarkPlugins:[Td],children:W})}):void 0,placeholder:"No description",ariaLabel:"Workspace description","data-testid":"edit-description"})})]}),i.jsxs("div",{className:Y.metaRow,children:[i.jsx("span",{className:Y.metaLabel,children:"Repository"}),i.jsx("div",{className:Y.metaValue,children:i.jsx(Ft,{value:(V==null?void 0:V.repoUrl)||"",onSave:W=>{V&&m(V.id,{repoUrl:W}).catch(()=>{})},validate:W=>{const X=W.trim();if(X&&!/^https?:\/\/.+/.test(X))return"Must be a valid http(s) URL"},fieldId:"repoUrl",activeFieldId:D,onActivate:P,renderDisplay:W=>{const X=XP(W);return X?i.jsx("a",{className:Y.repoLink,href:X,target:"_blank",rel:"noopener noreferrer",onClick:de=>de.stopPropagation(),children:W}):W?i.jsx("span",{children:W}):void 0},placeholder:"No repository",ariaLabel:"Workspace repository URL","data-testid":"edit-repo"})})]}),i.jsxs("div",{className:Y.metaRow,children:[i.jsx("span",{className:Y.metaLabel,children:"Environments"}),i.jsx("div",{className:Y.metaValue,"data-testid":"linked-environments",children:V?i.jsxs("span",{className:Y.linkedEnvList,children:[(()=>{const W=[...new Set(V.linkedEnvironmentIds)];return W.length===0?i.jsx("span",{className:Y.metaPlaceholder,children:"None"}):W.map(X=>{const de=c.find(Ne=>Ne.id===X);return i.jsxs("span",{className:Y.linkedEnvChip,"data-testid":`linked-env-${X}`,children:[(de==null?void 0:de.displayName)||X,i.jsx("button",{className:Y.chipDismiss,onClick:()=>{v(V.id,X).catch(()=>{})},title:`Unlink ${(de==null?void 0:de.displayName)||X}`,"aria-label":`Unlink ${(de==null?void 0:de.displayName)||X}`,"data-testid":`unlink-env-${X}`,disabled:W.length<=1,children:"x"})]},X)})})(),(()=>{const W=new Set(V.linkedEnvironmentIds),X=c.filter(de=>!W.has(de.id));return X.length===0?null:i.jsxs("select",{className:Y.linkEnvSelect,value:"",onChange:de=>{de.target.value&&g(V.id,de.target.value).catch(()=>{})},"aria-label":"Link environment","data-testid":"link-env-select",children:[i.jsx("option",{value:"",children:"+ Link"}),X.map(de=>i.jsx("option",{value:de.id,children:de.displayName||de.id},de.id))]})})(),x&&i.jsxs("span",{className:Y.linkError,"data-testid":"link-operation-error",role:"alert",children:[x,i.jsx("button",{className:Y.chipDismiss,onClick:y,"aria-label":"Dismiss error","data-testid":"dismiss-link-error",children:"x"})]})]}):i.jsx("span",{className:Y.metaPlaceholder,children:"None"})})]}),i.jsxs("div",{className:Y.metaRow,children:[i.jsx("span",{className:Y.metaLabel,children:"Persona"}),i.jsx("div",{className:Y.metaValue,children:i.jsx(ul,{value:(V==null?void 0:V.defaultPersonaId)||"",onSave:W=>{V&&m(V.id,{defaultPersonaId:W}).catch(()=>{})},options:[{value:"",label:"(Inherit)"},...k.map(W=>({value:W.id,label:W.name}))],fieldId:"defaultPersonaId",activeFieldId:D,onActivate:P,renderDisplay:W=>{const X=k.find(de=>de.id===W);if(X)return i.jsx("span",{children:X.name})},placeholder:(V==null?void 0:V.defaultPersonaId)||"(Inherit)",ariaLabel:"Workspace default persona","data-testid":"edit-persona"})})]}),i.jsxs("div",{className:Y.metaRow,children:[i.jsx("span",{className:Y.metaLabel,children:"Worktrees"}),i.jsx("div",{className:Y.metaValue,children:i.jsx(G6,{checked:(V==null?void 0:V.useWorktrees)??!0,onChange:W=>{V&&m(V.id,{useWorktrees:W}).catch(()=>{})},label:"Enable worktree isolation","data-testid":"worktree-toggle"})})]}),i.jsxs("div",{className:Y.metaRow,children:[i.jsx("span",{className:Y.metaLabel,children:"Working Dir"}),i.jsx("div",{className:Y.metaValue,children:i.jsx(Ft,{value:(V==null?void 0:V.workingDirectory)||"",onSave:W=>{V&&m(V.id,{workingDirectory:W}).catch(()=>{})},fieldId:"workingDirectory",activeFieldId:D,onActivate:P,placeholder:"Default (server default)",ariaLabel:"Working directory","data-testid":"edit-working-directory"})})]}),V&&i.jsxs("div",{className:Y.metaTimestamps,children:[i.jsxs("span",{className:Y.metaTimestamp,children:["Created ",ux(V.createdAt)]}),V.updatedAt&&V.updatedAt!==V.createdAt&&i.jsxs("span",{className:Y.metaTimestamp,children:["· Updated ",ux(V.updatedAt)]})]})]}),ne>0&&i.jsxs("div",{className:Y.progressBarContainer,"data-testid":"progress-bar",children:[i.jsx("div",{className:Y.progressBar,children:i.jsx("div",{className:Y.progressFill,style:{width:`${he}%`}})}),i.jsxs("span",{className:Y.progressLabel,children:[H,"/",ne]})]}),oe&&oe.costMillicents>0&&i.jsx("div",{className:Y.progressBarContainer,children:i.jsxs("span",{className:Y.progressLabel,children:["Usage: ",Ns(oe.costMillicents)," (",oe.sessionCount," session",oe.sessionCount!==1?"s":"",")"]})}),V&&(V.tokenBudget>0||V.costBudgetMillicents>0)&&i.jsx("div",{className:Y.progressBarContainer,children:i.jsxs("span",{className:Y.progressLabel,children:["Budget:"," ",V.tokenBudget>0&&i.jsxs(i.Fragment,{children:["Tokens: ",Io(((oe==null?void 0:oe.inputTokens)??0)+((oe==null?void 0:oe.outputTokens)??0))," / ",Io(V.tokenBudget)]}),V.tokenBudget>0&&V.costBudgetMillicents>0&&" | ",V.costBudgetMillicents>0&&i.jsxs(i.Fragment,{children:["Cost: ",Ns((oe==null?void 0:oe.costMillicents)??0)," / ",Ns(V.costBudgetMillicents)]})]})}),i.jsxs("div",{className:Y.tabBar,role:"tablist","aria-label":"Workspace view",children:[i.jsx("button",{role:"tab","aria-selected":C==="graph",className:`${Y.tab} ${C==="graph"?Y.active:""}`,onClick:()=>A("graph"),children:"Graph"}),i.jsx("button",{role:"tab","aria-selected":C==="board",className:`${Y.tab} ${C==="board"?Y.active:""}`,onClick:()=>A("board"),"data-testid":"board-tab",children:"Board"}),i.jsx("button",{role:"tab","aria-selected":C==="tasks",className:`${Y.tab} ${C==="tasks"?Y.active:""}`,onClick:()=>A("tasks"),children:"Tasks"})]}),C==="tasks"&&ne>0&&i.jsxs("div",{className:Y.workspaceSummary,children:[i.jsx("span",{className:Y.workspaceSummaryTitle,children:`${H}/${ne} tasks complete`}),i.jsx("span",{className:Y.workspaceSummarySubtitle,children:"Select a task or click + to create one"})]}),C==="tasks"&&ne===0&&i.jsxs("div",{className:Y.emptyCta,children:[i.jsx("button",{className:Y.ctaButton,onClick:()=>o(Ii(t,void 0,K)),children:"Create Task"}),i.jsx("div",{className:Y.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}),C==="board"&&i.jsx(h7,{workspaceId:t,environmentId:K,tasks:r,sessions:S,personas:k,environments:c}),C==="graph"&&i.jsx(AN,{workspaceId:t,environmentId:K,tasks:r,resolvedThemeId:T}),i.jsx(oa,{isOpen:O,title:"Archive Workspace?",description:"This will hide the workspace from the sidebar. Tasks will not be deleted.",confirmLabel:"Archive",onConfirm:()=>{V&&(p(V.id).catch(()=>{}),o("/",{replace:!0})),E(!1)},onCancel:()=>E(!1)})]})}const eU="_container_3pgew_1",tU="_header_3pgew_8",nU="_headerTitle_3pgew_35",sU="_headerActions_3pgew_44",aU="_body_3pgew_51",iU="_btnPrimary_3pgew_63",oU="_btnGhost_3pgew_94",rU="_error_3pgew_116",$a={container:eU,header:tU,headerTitle:nU,headerActions:sU,body:aU,btnPrimary:iU,btnGhost:oU,error:rU};function lU(t){const s={};return t.name.trim()||(s.name="Name is required"),t.repoUrl.trim()&&!/^https?:\/\/.+/i.test(t.repoUrl.trim())&&(s.repoUrl="Must be a valid http(s) URL"),t.environmentId||(s.environmentId="Environment is required"),Object.keys(s).length>0?s:void 0}const cU=[{label:"Home",url:Di},{label:"New Workspace",url:void 0}];function dU(){const[t]=wm(),s=t.get("environment")??void 0,{environments:{environments:o},personas:{personas:r},workspaces:{createWorkspace:c,workspaceCreating:d}}=ot(),{showToast:u}=pn(),p=mt(),[m,g]=b.useState(()=>{var N;return w7(void 0,s||((N=o[0])==null?void 0:N.id))}),[v,x]=b.useState(),[y,k]=b.useState();b.useEffect(()=>{s||m.environmentId||o.length===0||g(N=>{var T;return N.environmentId?N:{...N,environmentId:((T=o[0])==null?void 0:T.id)??""}})},[o,s,m.environmentId]);const S=()=>{const N=lU(m);if(N){x(N),k(void 0);return}x(void 0),k(void 0),c(m.name.trim(),m.description,m.repoUrl.trim(),m.environmentId,m.defaultPersonaId,m.useWorktrees,m.workingDirectory,()=>{u("Workspace created","success"),p(Di,{replace:!0})},T=>{k(T)}).catch(()=>{})},j=()=>{p(s?Ai(s):Di,{replace:!0})};return i.jsxs("div",{className:$a.container,children:[i.jsxs("div",{className:$a.header,children:[i.jsx("div",{className:$a.headerTitle,children:i.jsx(vs,{segments:cU})}),i.jsxs("div",{className:$a.headerActions,children:[i.jsx("button",{className:$a.btnGhost,onClick:j,disabled:d,"data-testid":"workspace-create-cancel",children:"Cancel"}),i.jsx("button",{className:$a.btnPrimary,onClick:S,disabled:d||!m.name.trim()||!m.environmentId,"data-testid":"workspace-create-save",children:d?i.jsx(C1,{size:"sm",label:"Creating"}):"Create Workspace"})]})]}),i.jsxs("div",{className:$a.body,children:[i.jsx(C7,{values:m,onChange:N=>{g(N),x(void 0),k(void 0)},environments:o,personas:r,errors:v,disabled:d,autoFocusName:!0}),y&&i.jsx("div",{className:$a.error,"data-testid":"workspace-create-submit-error",children:y})]})]})}function fx(){const{workspaceId:t,environmentId:s}=as(),[o]=wm(),r=t??o.get("workspace")??"",c=o.get("parent")??void 0,{tasks:{tasks:d,createTask:u,updateTask:p},workspaces:{workspaces:m},personas:{personas:g}}=ot(),{showToast:v}=pn();return i.jsx(H1,{mode:"new",workspaceId:r,parentTaskId:c,environmentId:s,tasks:d,workspaces:m,personas:g,onCreateTask:(x,y,k,S,j,N,T,C,A)=>{u(x,y,k,S,j,N,T,C,A).catch(()=>{})},onUpdateTask:(x,y,k,S,j)=>{p(x,y,k,S,j).catch(()=>{})},onShowToast:v})}function uU(){return i.jsxs("div",{className:Y.panelContainer,"aria-hidden":"true",children:[i.jsx("div",{className:Y.header,children:i.jsxs("span",{className:Y.headerTitle,children:[i.jsx(Te,{width:"12rem",height:"1rem"}),i.jsx(Te,{width:"4rem",height:"1rem",borderRadius:"var(--radius-full)"})]})}),i.jsxs("div",{className:Y.tabBar,role:"tablist","aria-label":"Task view",children:[i.jsx("span",{className:`${Y.tab} ${Y.active}`,children:"Overview"}),i.jsx("span",{className:Y.tab,children:"Stream"}),i.jsx("span",{className:Y.tab,children:"Findings"})]}),i.jsx("div",{className:Y.overviewContent,children:i.jsxs("div",{className:Y.overviewDashboard,children:[i.jsx("div",{className:Y.overviewHero,children:i.jsx(Te,{width:"5rem",height:"1.5rem",borderRadius:"var(--radius-full)"})}),i.jsxs("div",{className:Y.overviewSection,children:[i.jsx("div",{className:Y.overviewLabel,children:"Description"}),i.jsx(lm,{lines:2})]}),i.jsxs("div",{className:Y.overviewSection,children:[i.jsx("div",{className:Y.overviewLabel,children:"Environment"}),i.jsxs("div",{className:Y.envRow,children:[i.jsx(Te,{width:"0.5rem",height:"0.5rem",variant:"circular"}),i.jsx(Te,{width:"8rem",height:"0.875rem"})]})]}),i.jsxs("div",{className:Y.overviewSection,children:[i.jsx("div",{className:Y.overviewLabel,children:"Dependencies"}),i.jsx(lm,{lines:2})]}),i.jsxs("div",{className:Y.overviewSection,children:[i.jsx("div",{className:Y.overviewLabel,children:"Timeline"}),i.jsx("div",{className:Y.timeline,children:Array.from({length:4},(t,s)=>i.jsxs("div",{className:Y.timelineRow,children:[i.jsx(Te,{width:"4rem",height:"0.75rem"}),i.jsx(Te,{width:"10rem",height:"0.75rem"})]},s))})]})]})})]})}function Pa(){const{taskId:t,workspaceId:s,environmentId:o}=as(),r=Yt(),c=mt(),{showToast:d}=pn(),{sessions:{events:u,eventsDropped:p,sessions:m,loadSessionEvents:g,taskSessions:v,loadTaskSessions:x,sendInput:y,spawn:k,kill:S},tasks:{tasks:j,tasksLoading:N,startTask:T,stopTask:C,resumeTask:A,deleteTask:O,createTask:E,updateTask:D},environments:{environments:P,provisionEnvironment:B},findings:{findings:z,loadFindings:J},workspaces:{workspaces:V},personas:{personas:K},usageCache:fe,loadUsage:ee}=ot(),oe=b.useRef(void 0),M=b.useRef(void 0),H=b.useRef(void 0),ne=b.useRef(void 0),he=b.useRef(void 0),W=r.pathname.endsWith("/stream")?"stream":r.pathname.endsWith("/findings")?"findings":"overview",X=r.pathname.endsWith("/edit"),[de,Ne]=b.useState(W),[Ue,ve]=b.useState(!1),[Se,xe]=b.useState(void 0),[Be,It]=b.useState(""),[zn,re]=b.useState(X),Je=b.useRef(W),Ut=b.useRef(X),se=j.find(Ae=>Ae.id===t),wt=(se==null?void 0:se.workspaceId)||void 0,Ot=V.find(Ae=>Ae.id===wt);b.useEffect(()=>{W!==Je.current&&(Je.current=W,W!==de&&Ne(W))},[W,de]),b.useEffect(()=>{X!==Ut.current&&(Ut.current=X,X!==zn&&re(X))},[X,zn]),b.useEffect(()=>{if(Be===""){if(Ot!=null&&Ot.linkedEnvironmentIds[0])It(Ot.linkedEnvironmentIds[0]);else if(P.length>0){const Ae=P.find(We=>We.status==="connected");It((Ae==null?void 0:Ae.id)??P[0].id)}}},[Be,Ot==null?void 0:Ot.linkedEnvironmentIds[0],P]);const Bt=se?v[se.id]??[]:[];let ze;Se&&Bt.some(Ae=>Ae.id===Se)?ze=Se:ze=(se==null?void 0:se.latestSessionId)||void 0;const sn=()=>{ve(!0)},ca=()=>{if(!se)return;O(se.id).catch(()=>{}),ve(!1);const Ae=o??(Ot==null?void 0:Ot.linkedEnvironmentIds[0]);c(se.workspaceId&&Ae?Ei(se.workspaceId,Ae):"/",{replace:!0})};b.useEffect(()=>{(se==null?void 0:se.id)!==M.current&&(M.current=se==null?void 0:se.id,xe(void 0),It(""),re(X))},[se==null?void 0:se.id,X]),b.useEffect(()=>{if(!(se!=null&&se.id))return;const Ae=se.id!==ne.current,We=se.latestSessionId!==he.current;(Ae||We)&&(ne.current=se.id,he.current=se.latestSessionId,x(se.id).catch(()=>{}))},[se==null?void 0:se.id,se==null?void 0:se.latestSessionId,x]),b.useEffect(()=>{if((se==null?void 0:se.status)!==H.current){const Ae=H.current===void 0;H.current=se==null?void 0:se.status;const We=(se==null?void 0:se.status)==="not_started"?"overview":(se==null?void 0:se.status)==="working"||(se==null?void 0:se.status)==="paused"?"stream":(se==null?void 0:se.status)==="complete"?"findings":void 0;We&&We!==de&&!(Ae&&W!=="overview")&&Ne(We)}},[se==null?void 0:se.status,de,W]);const is=b.useMemo(()=>new Map(j.map(Ae=>[Ae.id,Ae])),[j]),Ja=b.useMemo(()=>{const Ae=ze?u.filter(We=>We.sessionId===ze):[];return mh(ph(Ae))},[u,ze]),da=se?se.dependsOn.some(Ae=>{const We=is.get(Ae);return We!==void 0&&We.status!=="complete"}):!1,Jt=b.useMemo(()=>Z7(t,o,V,P,is),[t,o,V,P,is]);b.useEffect(()=>{ze&&ze!==oe.current&&(oe.current=ze,g(ze).catch(()=>{}))},[ze,g]),b.useEffect(()=>{de==="findings"&&wt&&J(wt).catch(()=>{})},[de,wt,J]);const Bi=Bt.reduce((Ae,We)=>Ae+(We.costMillicents??0),0);b.useEffect(()=>{se&&(ee("task",se.id).catch(()=>{}),se.childTaskIds.length>0&&ee("task_tree",se.id).catch(()=>{}))},[se==null?void 0:se.id,se==null?void 0:se.childTaskIds.length,ee,Bi]);const ua=se?`task:${se.id}`:"",Wa=ua in fe?fe[ua]:void 0,ys=se?`task_tree:${se.id}`:"",Li=se&&se.childTaskIds.length>0&&ys in fe?fe[ys]:void 0,$n=Ae=>{Ne(Ae),c(On(t,Ae==="overview"?void 0:Ae,s,o))};return sa({key:"1"},()=>$n("overview")),sa({key:"2"},()=>$n("stream")),sa({key:"3"},()=>$n("findings")),!se&&N?i.jsx(uU,{}):i.jsxs("div",{className:Y.panelContainer,children:[i.jsx(vs,{segments:Jt}),i.jsxs("div",{className:Y.header,children:[i.jsxs("span",{className:Y.headerTitle,children:[i.jsx("span",{"data-testid":"task-title",children:(se==null?void 0:se.title)||t}),se&&i.jsx("span",{className:Y.taskStatusBadge,"data-testid":"task-status",children:se.status}),(se==null?void 0:se.branch)&&i.jsx("span",{className:Y.taskBranch,children:se.branch}),da&&i.jsx("span",{className:Y.taskBlockedBadge,children:"blocked"})]}),se&&i.jsx(DB,{task:se,sessionId:ze,isBlocked:da,onStart:()=>{T(se.id,void 0,Be).catch(()=>{})},onResume:()=>{A(se.id).catch(()=>{})},onStop:()=>{C(se.id).catch(()=>{})},onPause:()=>{ze&&S(ze).catch(()=>{})},onDelete:sn,onEdit:()=>re(!0)})]}),i.jsxs("div",{className:Y.tabBar,role:"tablist","aria-label":"Task view",children:[i.jsx("button",{role:"tab","aria-selected":de==="overview",className:`${Y.tab} ${de==="overview"?Y.active:""}`,onClick:()=>$n("overview"),children:"Overview"}),i.jsx("button",{role:"tab","aria-selected":de==="stream",className:`${Y.tab} ${de==="stream"?Y.active:""}`,onClick:()=>$n("stream"),children:"Stream"}),i.jsx("button",{role:"tab","aria-selected":de==="findings",className:`${Y.tab} ${de==="findings"?Y.active:""}`,onClick:()=>$n("findings"),children:"Findings"})]}),i.jsxs(gs,{mode:"wait",children:[de==="overview"&&i.jsx(Rt.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:Y.overviewContent,"data-testid":"task-overview",children:zn&&se?i.jsx(H1,{mode:"edit",taskId:se.id,workspaceId:wt,environmentId:o,tasks:j,workspaces:V,personas:K,onCreateTask:(Ae,We,Wt,St,mn,Xt,zi,$i,Pi)=>{E(Ae,We,Wt,St,mn,Xt,zi,$i,Pi).catch(()=>{})},onUpdateTask:(Ae,We,Wt,St,mn)=>{D(Ae,We,Wt,St,mn).catch(()=>{})},onEditDone:()=>{X?c(On(se.id,void 0,s,o),{replace:!0}):re(!1)},onShowToast:d}):se?i.jsx(yL,{task:se,tasksById:is,environments:P,workspaces:V,taskSessions:Bt,selectedEnvId:Be,taskUsage:Wa,treeUsage:Li}):i.jsx("div",{className:Y.waitingMessage,children:"No additional details"})},"overview"),de==="stream"&&i.jsxs(Rt.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:[i.jsx(J3,{taskSessions:Bt,selectedSessionId:ze,onSelect:Ae=>xe(Ae)}),i.jsx(ch,{events:Ja,eventsDropped:p,emptyState:!ze&&se?da?i.jsx("div",{className:Y.emptyCta,"data-testid":"stream-blocked-message",children:i.jsx("div",{className:Y.ctaDescription,children:"This task is blocked by incomplete dependencies"})}):i.jsxs("div",{className:Y.emptyCta,children:[i.jsx("button",{"data-testid":"stream-start-cta",className:Y.ctaButton,onClick:()=>{T(se.id,void 0,Be).catch(()=>{})},children:"Start Task"}),i.jsx("div",{className:Y.ctaDescription,children:"Click to begin agent execution"})]}):ze&&Ja.length===0?i.jsx("div",{className:Y.waitingMessage,children:"Waiting for events..."}):void 0,onShowToast:d})]},"stream"),de==="findings"&&i.jsx(Rt.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:Y.tabContent,children:wt?i.jsx(P1,{findings:z.filter(Ae=>Ae.workspaceId===wt)}):i.jsx("div",{className:Y.noContext,children:"Navigate to a task within a workspace to view findings"})},"findings")]}),(()=>{if(!se||se.status!=="working"&&se.status!=="paused")return;const Ae=ze?m.find(We=>We.id===ze):void 0;if(!(!Ae||Ae.status==="stopped"))return i.jsx(nl,{mode:"send",sessionId:Ae.id,environmentId:Ae.environmentId,personas:K,environments:P,onSendInput:(We,Wt)=>{y(We,Wt).catch(()=>{})},onSpawn:(We,Wt,St)=>{k(We,Wt,St).catch(()=>{})},onStartTask:(We,Wt,St)=>{T(We,Wt,St).catch(()=>{})},onProvisionEnvironment:We=>{B(We).catch(()=>{})},onShowToast:d})})(),se&&i.jsx(oa,{isOpen:Ue,title:"Delete Task?",description:`"${se.title}" will be permanently removed.`,onConfirm:ca,onCancel:()=>ve(!1)})]})}function fU(){const{environments:{environments:t,addEnvironment:s,updateEnvironment:o},codespaces:{codespaces:r,codespaceError:c,codespaceListError:d,codespaceCreating:u,listCodespaces:p,createCodespace:m}}=ot(),{showToast:g}=pn();return i.jsx(V1,{mode:"new",environments:t,onAddEnvironment:(v,x,y)=>{s(v,x,y).catch(()=>{})},onUpdateEnvironment:(v,x)=>{o(v,x).catch(()=>{})},onListCodespaces:()=>{p().catch(()=>{})},codespaces:r,codespaceError:c,codespaceListError:d,codespaceCreating:u,onCreateCodespace:(v,x)=>{m(v,x).catch(()=>{})},onShowToast:g})}function pU(){const{environmentId:t}=as(),{environments:{environments:s,addEnvironment:o,updateEnvironment:r},codespaces:{codespaces:c,codespaceError:d,codespaceListError:u,codespaceCreating:p,listCodespaces:m,createCodespace:g}}=ot(),{showToast:v}=pn();return i.jsx(V1,{mode:"edit",environmentId:t,environments:s,onAddEnvironment:(x,y,k)=>{o(x,y,k).catch(()=>{})},onUpdateEnvironment:(x,y)=>{r(x,y).catch(()=>{})},onListCodespaces:()=>{m().catch(()=>{})},codespaces:c,codespaceError:d,codespaceListError:u,codespaceCreating:p,onCreateCodespace:(x,y)=>{g(x,y).catch(()=>{})},onShowToast:v})}const mU="_layout_11u79_1",hU="_content_11u79_8",gU="_tabPanel_11u79_14",tl={layout:mU,content:hU,tabPanel:gU};function vU(){const t=V7();return i.jsxs("div",{className:tl.layout,children:[i.jsx(vs,{segments:t}),i.jsx("div",{className:tl.content,children:i.jsx(Ka,{})})]})}const yU="_container_144a4_1",bU="_envHeader_144a4_6",xU="_envTitleRow_144a4_10",_U="_statusDot_144a4_16",kU="_envName_144a4_21",SU="_statusBadge_144a4_27",TU="_envMeta_144a4_33",jU="_metaTag_144a4_39",wU="_actions_144a4_51",NU="_provisionMessage_144a4_59",CU="_errorMessage_144a4_64",EU="_section_144a4_69",AU="_sectionHeader_144a4_73",DU="_cardList_144a4_121",MU="_card_144a4_121",RU="_cardHeader_144a4_138",IU="_cardName_144a4_144",OU="_cardActions_144a4_149",BU="_cardDescription_144a4_154",LU="_cardMeta_144a4_160",zU="_repoLink_144a4_166",$U="_empty_144a4_174",PU="_errorHint_144a4_180",UU="_btnPrimary_144a4_186",HU="_btnOutline_144a4_220",VU="_btnSmall_144a4_247",qU="_btnDanger_144a4_273",De={container:yU,envHeader:bU,envTitleRow:xU,statusDot:_U,envName:kU,statusBadge:SU,envMeta:TU,metaTag:jU,actions:wU,provisionMessage:NU,errorMessage:CU,section:EU,sectionHeader:AU,cardList:DU,card:MU,cardHeader:RU,cardName:IU,cardActions:OU,cardDescription:BU,cardMeta:LU,repoLink:zU,empty:$U,errorHint:PU,btnPrimary:UU,btnOutline:HU,btnSmall:VU,btnDanger:qU};function GU(){return i.jsxs("div",{className:De.container,"aria-hidden":"true",children:[i.jsxs("div",{className:De.envHeader,children:[i.jsxs("div",{className:De.envTitleRow,children:[i.jsx(Te,{width:"0.875rem",height:"0.875rem",variant:"circular"}),i.jsx(Te,{width:"12rem",height:"1.5rem"}),i.jsx(Te,{width:"4rem",height:"0.875rem"})]}),i.jsxs("div",{className:De.envMeta,children:[i.jsx(Te,{width:"6rem",height:"1.25rem",borderRadius:"var(--radius-sm)"}),i.jsx(Te,{width:"5rem",height:"1.25rem",borderRadius:"var(--radius-sm)"}),i.jsx(Te,{width:"4.5rem",height:"1.25rem",borderRadius:"var(--radius-sm)"})]})]}),i.jsxs("div",{className:De.actions,children:[i.jsx(Te,{width:"5rem",height:"2rem",borderRadius:"var(--radius-sm)"}),i.jsx(Te,{width:"4rem",height:"2rem",borderRadius:"var(--radius-sm)"})]}),i.jsxs("div",{className:De.section,children:[i.jsx("div",{className:De.sectionHeader,children:i.jsx("h3",{style:{margin:0},children:"Workspaces"})}),i.jsxs("div",{className:De.cardList,children:[i.jsx(yd,{lines:2}),i.jsx(yd,{lines:2})]})]})]})}const FU={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function ZU(){const{environmentId:t}=as(),s=mt(),{environments:{environments:o,environmentsLoading:r,provisionStatus:c,provisionEnvironment:d,stopEnvironment:u,removeEnvironment:p},workspaces:{workspaces:m,archiveWorkspace:g,linkEnvironment:v,unlinkEnvironment:x,linkOperationError:y,clearLinkOperationError:k},sessions:{sessions:S}}=ot(),[j,N]=b.useState(!1),[T,C]=b.useState(!1),[A,O]=b.useState(void 0),E=o.find(H=>H.id===t);if(!E&&r)return i.jsx(GU,{});if(!t||!E)return i.jsx(ts,{to:Ro,replace:!0});const D=m.filter(H=>H.linkedEnvironmentIds.includes(E.id)),P=S.filter(H=>H.environmentId===E.id),B=P.reduce((H,ne)=>H+(ne.costMillicents??0),0),z=FU[E.status]||"var(--text-tertiary)",J=E.status==="connected",V=E.status==="connecting",K=E.status==="disconnected"||E.status==="error"||E.status==="sleeping",fe=E.id in c?c[E.id]:void 0,ee=()=>{p(E.id).catch(()=>{}),N(!1),s(Ro,{replace:!0})},oe=()=>{C(!1),d(E.id,!0).catch(()=>{})},M=H=>{g(H).catch(()=>{}),O(void 0)};return i.jsxs("div",{className:De.container,children:[i.jsx(oa,{isOpen:j,title:"Delete Environment?",description:`"${E.displayName||E.id}" will be permanently removed along with all its data.`,onConfirm:ee,onCancel:()=>N(!1)}),i.jsx(oa,{isOpen:T,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:oe,onCancel:()=>C(!1)}),i.jsxs("div",{className:De.envHeader,children:[i.jsxs("div",{className:De.envTitleRow,children:[i.jsx("span",{className:De.statusDot,style:{color:z},children:"●"}),i.jsx("h2",{className:De.envName,children:E.displayName||E.id}),i.jsx("span",{className:De.statusBadge,style:{color:z},children:E.status})]}),i.jsxs("div",{className:De.envMeta,children:[i.jsxs("span",{className:De.metaTag,children:["Adapter: ",E.adapterType]}),P.length>0&&i.jsxs("span",{className:De.metaTag,children:[P.length," session",P.length!==1?"s":""]}),B>0&&i.jsxs("span",{className:De.metaTag,children:["Cost: ",Ns(B)]})]})]}),i.jsxs("div",{className:De.actions,children:[J&&i.jsxs(i.Fragment,{children:[i.jsx("button",{className:De.btnPrimary,onClick:()=>s(Zx(E.id)),children:"New Chat"}),i.jsx("button",{className:De.btnOutline,onClick:()=>{u(E.id).catch(()=>{})},children:"Stop"}),i.jsx("button",{className:De.btnOutline,onClick:()=>C(!0),disabled:fe!==void 0,"data-testid":"env-reprovision-btn",children:"Reprovision"})]}),K&&i.jsx("button",{className:De.btnPrimary,onClick:()=>{d(E.id).catch(()=>{})},children:E.status==="error"?"Retry":E.status==="sleeping"?"Wake":"Connect"}),V&&fe!==void 0&&i.jsx("span",{className:De.provisionMessage,children:fe.message}),E.status==="error"&&(fe==null?void 0:fe.stage)==="error"&&i.jsx("span",{className:De.errorMessage,children:fe.message}),i.jsx("button",{className:De.btnOutline,onClick:()=>s(bN(E.id)),"data-testid":"env-edit-btn",children:"Edit Config"}),i.jsx("button",{className:De.btnDanger,onClick:()=>N(!0),children:"Delete"})]}),i.jsxs("div",{className:De.section,children:[i.jsxs("div",{className:De.sectionHeader,children:[i.jsx("h3",{children:"Workspaces"}),i.jsx("button",{className:De.btnPrimary,onClick:()=>s(`${Jx}?environment=${encodeURIComponent(E.id)}`),"data-testid":"workspace-create-button",children:"+ New Workspace"}),(()=>{const H=m.filter(ne=>!ne.linkedEnvironmentIds.includes(E.id)&&ne.status==="active");return H.length===0?null:i.jsxs("select",{className:De.btnPrimary,value:"",onChange:ne=>{ne.target.value&&v(ne.target.value,E.id).catch(()=>{})},"aria-label":"Link a workspace","data-testid":"link-workspace-select",children:[i.jsx("option",{value:"",children:"+ Link Workspace"}),H.map(ne=>i.jsx("option",{value:ne.id,children:ne.name},ne.id))]})})()]}),y&&i.jsxs("p",{className:De.errorHint,"data-testid":"link-operation-error",role:"alert",children:[y,i.jsx("button",{className:De.btnSmall,onClick:k,"aria-label":"Dismiss error","data-testid":"dismiss-link-error",children:"Dismiss"})]}),D.length===0&&i.jsx("p",{className:De.empty,"data-testid":"linked-workspaces-empty",children:"No workspaces yet. Create one to get started."}),i.jsx("div",{className:De.cardList,"data-testid":"linked-workspaces-list",children:D.map(H=>i.jsx(KU,{workspace:H,confirmArchiveId:A,onOpen:()=>s(Ei(H.id,E.id)),onArchive:()=>O(H.id),onConfirmArchive:()=>M(H.id),onCancelArchive:()=>O(void 0),onUnlink:()=>{x(H.id,E.id).catch(()=>{})}},H.id))})]})]})}function KU({workspace:t,confirmArchiveId:s,onOpen:o,onArchive:r,onConfirmArchive:c,onCancelArchive:d,onUnlink:u}){const p=s===t.id,m=t.repoUrl&&/^https?:\/\//.test(t.repoUrl);return i.jsxs("div",{className:De.card,"data-testid":"workspace-card","data-workspace-id":t.id,children:[i.jsxs("div",{className:De.cardHeader,children:[i.jsx("strong",{className:De.cardName,children:t.name}),i.jsxs("div",{className:De.cardActions,children:[i.jsx("button",{className:De.btnSmall,onClick:o,children:"Open"}),i.jsx("button",{className:De.btnSmall,onClick:u,disabled:t.linkedEnvironmentIds.length<=1,"data-testid":`unlink-workspace-${t.id}`,children:"Unlink"}),p?i.jsxs(i.Fragment,{children:[i.jsx("button",{className:De.btnDanger,onClick:c,children:"Confirm"}),i.jsx("button",{className:De.btnSmall,onClick:d,children:"Cancel"})]}):i.jsx("button",{className:De.btnSmall,onClick:r,children:"Archive"})]})]}),t.description&&i.jsx("p",{className:De.cardDescription,children:t.description}),t.repoUrl&&i.jsx("div",{className:De.cardMeta,children:m?i.jsx("a",{href:t.repoUrl,target:"_blank",rel:"noopener noreferrer",className:De.repoLink,children:t.repoUrl}):i.jsx("span",{children:t.repoUrl})})]})}const YU={credentials:"Credentials",personas:"Personas",schedules:"Schedules",appearance:"Appearance",about:"About",shortcuts:"Shortcuts",plugins:"Plugins"};function JU(){const s=Yt().pathname.replace(/^\/settings\/?/,"").split("/")[0],o=YU[s],r=H7(o);return i.jsxs("div",{className:tl.layout,children:[i.jsx(vs,{segments:r}),i.jsx("div",{className:tl.content,children:i.jsx("div",{className:tl.tabPanel,children:i.jsx(Ka,{})},s)})]})}function WU(){const{tokens:{tokens:t,setToken:s,deleteToken:o},credentials:{credentialProviders:r,updateCredentialProviders:c}}=ot(),{showToast:d}=pn();return i.jsxs(i.Fragment,{children:[i.jsx(JL,{credentialProviders:r,onUpdateCredentialProviders:u=>{c(u).catch(()=>{})}}),i.jsx(sB,{tokens:t,onSetToken:(u,p,m,g,v)=>{s(u,p,m,g,v).catch(()=>{})},onDeleteToken:u=>{o(u).catch(()=>{})},onShowToast:d})]})}function XU(){const{personas:{personas:t,deletePersona:s},appDefaultPersonaId:o,setAppDefaultPersonaId:r}=ot(),{showToast:c}=pn(),d=mt();return i.jsx(c8,{personas:t,appDefaultPersonaId:o,onDeletePersona:async u=>{try{await s(u)}catch(p){throw console.error("Failed to delete persona",{personaId:u,error:p}),c("Failed to delete persona","error"),p}},onSetAppDefaultPersonaId:async u=>{try{await r(u)}catch(p){console.error("Failed to set app default persona ID",{personaId:u,error:p}),c("Failed to set app default persona","error")}},onNavigateToNew:()=>d(_N),onNavigateToPersona:u=>d(Kx(u))})}const QU="_container_1ooin_1",e9="_form_1ooin_7",t9="_formActions_1ooin_75",n9="_editableSection_1ooin_82",s9="_defaultBadge_1ooin_93",a9="_typeToggle_1ooin_107",i9="_scriptEditor_1ooin_121",o9="_optional_1ooin_128",ms={container:QU,form:e9,formActions:t9,editableSection:n9,defaultBadge:s9,typeToggle:a9,scriptEditor:i9,optional:o9},px=[{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)"}],mx=[{value:"genaiscript",label:"genaiscript"}],r9="0";function hx(){const{personaId:t}=as(),s=mt(),{showToast:o}=pn(),{personas:{personas:r,createPersona:c,updatePersona:d,deletePersona:u},appDefaultPersonaId:p,setAppDefaultPersonaId:m}=ot(),g=t===void 0,v=g?void 0:r.find(y=>y.id===t);if(!g&&r.length>0&&!v)return i.jsx(ts,{to:Qf,replace:!0});const x=[{label:"Settings",url:wi},{label:"Personas",url:Qf},{label:g?"New Persona":(v==null?void 0:v.name)??"Persona",url:void 0}];return i.jsxs("div",{className:ms.container,children:[i.jsx(vs,{segments:x}),i.jsx(l9,{existing:v,isNew:g,appDefaultPersonaId:p,onCreatePersona:c,onUpdatePersona:d,onDeletePersona:u,onSetAppDefaultPersonaId:m,onDone:()=>{s(Qf)},showToast:o})]})}function l9({existing:t,isNew:s,appDefaultPersonaId:o,onCreatePersona:r,onUpdatePersona:c,onDeletePersona:d,onSetAppDefaultPersonaId:u,onDone:p,showToast:m}){const g=mt(),[v,x]=b.useState((t==null?void 0:t.name)??""),[y,k]=b.useState((t==null?void 0:t.description)??""),[S,j]=b.useState((t==null?void 0:t.systemPrompt)??""),[N,T]=b.useState((t==null?void 0:t.runtime)??"claude-code"),[C,A]=b.useState((t==null?void 0:t.model)??"sonnet"),[O,E]=b.useState((t==null?void 0:t.maxTurns)??0),[D,P]=b.useState((t==null?void 0:t.type)==="script"?"script":"agent"),[B,z]=b.useState((t==null?void 0:t.script)??""),[J,V]=b.useState((t==null?void 0:t.allowedMcpTools)??[]),[K,fe]=b.useState(!1),[ee,oe]=b.useState(null),[M,H]=b.useState(!!s);b.useEffect(()=>{if(!s&&t&&!M){H(!0),x(t.name),k(t.description),j(t.systemPrompt);const re=t.type==="script"?"script":"agent";T(re==="script"?t.runtime||"genaiscript":t.runtime),A(t.model),E(t.maxTurns),P(re),z(t.script||""),V(t.allowedMcpTools)}},[s,t,M]);const ne=re=>{P(re),re==="script"?T("genaiscript"):N==="genaiscript"&&T("claude-code")},he=!s&&t===void 0,W=v.trim().length>0&&!he&&S.trim().length>0&&(D==="script"?B.trim().length>0:!!N&&!!C),X=s&&W,de=!s&&o===(t==null?void 0:t.id),Ne=!s&&t&&!de&&D==="agent"&&!!N&&!!C,Ue=(re,Je)=>{if(!re.trim())return`${Je} is required`},ve=re=>{if(re.preventDefault(),!(he||!W)){if(t){c(t.id,v,y,S,N,C,O,D,B).then(()=>{m("Persona updated","success"),p()},()=>{m("Failed to save persona","error")});return}r(v,y,S,N,C,O,D,B,J).then(Je=>{m("Persona created","success"),g(Kx(Je.id),{replace:!0})},()=>{m("Failed to save persona","error")})}},Se=()=>{t&&d(t.id).then(()=>{m("Persona deleted","success"),p()},()=>{m("Failed to delete persona","error")})},xe=async(re,Je,Ut,se)=>re().then(()=>{Je(),m(Ut,"success")},()=>{m(se,"error")}),Be=(re,Je)=>{if(!t)return;const Ut=re==="type"?String(Je):D,se=re==="runtime"?String(Je):re==="type"?String(Je)==="script"?"genaiscript":N==="genaiscript"?"claude-code":N:N,wt=re==="model"?String(Je):C,Ot=re==="maxTurns"?Number(Je):O,Bt=re==="systemPrompt"?String(Je):S,ze=re==="script"?String(Je):B;xe(()=>c(t.id,re==="name"?String(Je):v,re==="description"?String(Je):y,Bt,se,wt,Ot,Ut,ze),()=>{if(re==="type"){const sn=String(Je)==="script"?"script":"agent";P(sn),T(se)}re==="runtime"&&T(String(Je)),re==="name"&&x(String(Je)),re==="description"&&k(String(Je)),re==="systemPrompt"&&j(String(Je)),re==="model"&&A(String(Je)),re==="maxTurns"&&E(Number(Je)),re==="script"&&z(String(Je))},"Persona updated","Failed to update persona").catch(()=>{})},It=re=>{ve(re)},zn=()=>{t&&u(t.id).then(()=>{m("Set as app default","success")},()=>{m("Failed to set app default","error")})};return i.jsxs(i.Fragment,{children:[he?i.jsxs("div",{className:ms.form,children:[i.jsx("h3",{children:"Edit Persona"}),i.jsx("p",{children:"Loading persona..."})]}):s?i.jsxs("form",{onSubmit:It,className:ms.form,children:[i.jsx("h3",{children:"Create Persona"}),i.jsxs("div",{className:ms.typeToggle,"data-testid":"persona-type-toggle",children:[i.jsxs("label",{children:[i.jsx("input",{type:"radio",name:"personaType",value:"agent",checked:D==="agent",onChange:()=>ne("agent")}),"Agent"]}),i.jsxs("label",{children:[i.jsx("input",{type:"radio",name:"personaType",value:"script",checked:D==="script",onChange:()=>ne("script")}),"Script"]})]}),i.jsxs("label",{children:["Name",i.jsx("input",{type:"text",value:v,onChange:re=>x(re.target.value),placeholder:D==="script"?"e.g. Nightly Report":"e.g. Frontend Engineer",required:!0,"data-testid":"persona-detail-name"})]}),i.jsxs("label",{children:["Description",i.jsx("input",{type:"text",value:y,onChange:re=>k(re.target.value),placeholder:"Brief description...","data-testid":"persona-detail-description"})]}),i.jsxs("label",{children:["Runtime",i.jsx("select",{value:N,onChange:re=>T(re.target.value),"data-testid":"persona-runtime-select",children:(D==="script"?mx:px).map(re=>i.jsx("option",{value:re.value,children:re.label},re.value))})]}),D==="agent"&&i.jsxs(i.Fragment,{children:[i.jsxs("label",{children:["Model",i.jsx("input",{type:"text",value:C,onChange:re=>A(re.target.value),placeholder:"e.g. sonnet","data-testid":"persona-detail-model"})]}),i.jsxs("label",{children:["Max Turns",i.jsx("input",{type:"number",value:O,onChange:re=>E(parseInt(re.target.value,10)||0),min:0,"data-testid":"persona-detail-max-turns"})]}),i.jsxs("label",{children:["System Prompt",i.jsx("textarea",{value:S,onChange:re=>j(re.target.value),placeholder:"You are a senior frontend engineer...",rows:10,required:!0,"data-testid":"persona-detail-prompt"})]})]}),D==="script"&&i.jsxs(i.Fragment,{children:[i.jsxs("label",{children:["Model ",i.jsx("span",{className:ms.optional,children:"(optional)"}),i.jsx("input",{type:"text",value:C,onChange:re=>A(re.target.value),placeholder:"e.g. sonnet (leave empty for script-only)","data-testid":"persona-detail-model"})]}),i.jsxs("label",{children:["System Prompt",i.jsx("textarea",{value:S,onChange:re=>j(re.target.value),placeholder:"Context for the script...",rows:4,required:!0,"data-testid":"persona-detail-prompt"})]}),i.jsxs("label",{children:["Script",i.jsx("textarea",{value:B,onChange:re=>z(re.target.value),placeholder:`script({ model: "openai:gpt-4o" });
|
|
712
|
-
|
|
713
|
-
const grackle = await host.mcpServer({
|
|
714
|
-
id: "grackle",
|
|
715
|
-
url: env.vars.GRACKLE_MCP_URL,
|
|
716
|
-
});
|
|
717
|
-
|
|
718
|
-
$\`Summarize the current tasks.\`;`,rows:20,className:ms.scriptEditor,required:!0,"data-testid":"persona-script-editor"})]})]}),D==="agent"&&i.jsxs("div",{children:[i.jsx("label",{children:"Allowed MCP Tools"}),i.jsx(nx,{selectedTools:J,onChange:V})]}),i.jsxs("div",{className:ms.formActions,children:[i.jsx(tn,{type:"submit",variant:"primary",size:"md",disabled:!X,"data-testid":"persona-detail-save",children:"Create"}),i.jsx(tn,{type:"button",variant:"outline",size:"md",onClick:p,"data-testid":"persona-detail-cancel",children:"Cancel"})]})]}):t?i.jsxs("div",{className:ms.form,children:[i.jsx("h3",{children:"Edit Persona"}),i.jsxs("div",{className:ms.formActions,children:[i.jsx(tn,{type:"button",variant:"outline",size:"md",onClick:p,"data-testid":"persona-detail-cancel",children:"Back to Personas"}),Ne&&i.jsx(tn,{type:"button",variant:"ghost",size:"md",onClick:zn,"data-testid":"persona-detail-set-default",children:"Set as App Default"}),de&&i.jsx("span",{className:ms.defaultBadge,children:"App Default"}),i.jsx(tn,{type:"button",variant:"danger",size:"md",onClick:()=>fe(!0),"data-testid":"persona-detail-delete",children:"Delete"})]}),i.jsxs("div",{className:ms.editableSection,children:[i.jsxs("label",{children:["Name",i.jsx(Ft,{value:v,onSave:re=>{Be("name",re)},validate:re=>Ue(re,"Name"),fieldId:"persona-name",activeFieldId:ee,onActivate:oe,ariaLabel:"Persona name","data-testid":"persona-detail-name"})]}),i.jsxs("label",{children:["Description",i.jsx(Ft,{value:y,onSave:re=>{Be("description",re)},fieldId:"persona-description",activeFieldId:ee,onActivate:oe,placeholder:"Brief description...",ariaLabel:"Persona description","data-testid":"persona-detail-description"})]}),i.jsxs("label",{children:["Type",i.jsx(ul,{value:D,onSave:re=>{Be("type",re)},options:[{value:"agent",label:"Agent"},{value:"script",label:"Script"}],fieldId:"persona-type",activeFieldId:ee,onActivate:oe,ariaLabel:"Persona type","data-testid":"persona-type-toggle"})]}),i.jsxs("label",{children:["Runtime",i.jsx(ul,{value:N,onSave:re=>{Be("runtime",re)},options:D==="script"?mx:px,fieldId:"persona-runtime",activeFieldId:ee,onActivate:oe,ariaLabel:"Persona runtime","data-testid":"persona-runtime"})]}),i.jsxs("label",{children:["Model",D==="script"?" (optional)":"",i.jsx(Ft,{value:C,onSave:re=>{Be("model",re)},validate:D==="agent"?re=>Ue(re,"Model"):void 0,fieldId:"persona-model",activeFieldId:ee,onActivate:oe,placeholder:D==="script"?"e.g. sonnet (leave empty for script-only)":"e.g. sonnet",ariaLabel:"Persona model","data-testid":"persona-detail-model"})]}),i.jsxs("label",{children:["Max Turns",i.jsx(Ft,{value:String(O),onSave:re=>{Be("maxTurns",parseInt(re,10)||0)},validate:re=>/^\d+$/.test(re.trim())?void 0:"Max Turns must be a non-negative integer",fieldId:"persona-max-turns",activeFieldId:ee,onActivate:oe,placeholder:r9,ariaLabel:"Persona max turns","data-testid":"persona-detail-max-turns"})]}),i.jsxs("label",{children:["System Prompt",i.jsx(cm,{value:S,onSave:re=>{Be("systemPrompt",re)},validate:re=>Ue(re,"System Prompt"),fieldId:"persona-system-prompt",activeFieldId:ee,onActivate:oe,placeholder:D==="script"?"Context for the script...":"You are a senior frontend engineer...",ariaLabel:"Persona system prompt","data-testid":"persona-detail-prompt"})]}),D==="script"&&i.jsxs("label",{children:["Script",i.jsx(cm,{value:B,onSave:re=>{Be("script",re)},validate:re=>Ue(re,"Script"),fieldId:"persona-script",activeFieldId:ee,onActivate:oe,placeholder:`script({ model: "openai:gpt-4o" });
|
|
719
|
-
|
|
720
|
-
const grackle = await host.mcpServer({
|
|
721
|
-
id: "grackle",
|
|
722
|
-
url: env.vars.GRACKLE_MCP_URL,
|
|
723
|
-
});
|
|
724
|
-
|
|
725
|
-
$\`Summarize the current tasks.\`;`,ariaLabel:"Persona script","data-testid":"persona-script-editor"})]}),D==="agent"&&i.jsxs("div",{children:[i.jsx("label",{children:"Allowed MCP Tools"}),i.jsx(nx,{selectedTools:J,onChange:re=>{V(re),xe(()=>c(t.id,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,re),()=>{},"MCP tools updated","Failed to update MCP tools").catch(()=>{})}})]})]}),!Ne&&!de&&i.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,i.jsx(oa,{isOpen:K,title:"Delete Persona?",description:`"${t==null?void 0:t.name}" will be permanently removed.`,confirmLabel:"Delete",onConfirm:Se,onCancel:()=>fe(!1)})]})}function c9(){const{schedules:{schedules:t,deleteSchedule:s,updateSchedule:o},personas:{personas:r}}=ot(),{showToast:c}=pn(),d=mt();return i.jsx(z8,{schedules:t,personas:r,onDeleteSchedule:async u=>{try{await s(u)}catch(p){throw console.error("Failed to delete schedule",{scheduleId:u,error:p}),c("Failed to delete schedule","error"),p}},onToggleEnabled:async(u,p)=>{try{return await o(u,p)}catch(m){throw console.error("Failed to update schedule",{scheduleId:u,error:m}),c("Failed to update schedule","error"),m}},onNavigateToNew:()=>d(kN),onNavigateToSchedule:u=>d(Yx(u))})}const d9="_container_1g4qh_1",u9="_form_1g4qh_7",f9="_formActions_1g4qh_66",p9="_editableSection_1g4qh_73",m9="_helperText_1g4qh_84",h9="_metaSection_1g4qh_90",g9="_optional_1g4qh_108",v9="_readonlyValue_1g4qh_113",yn={container:d9,form:u9,formActions:f9,editableSection:p9,helperText:m9,metaSection:h9,optional:g9,readonlyValue:v9};function gx(){const{scheduleId:t}=as(),s=mt(),{showToast:o}=pn(),{schedules:{schedules:r,schedulesLoading:c,createSchedule:d,updateSchedule:u,deleteSchedule:p},personas:{personas:m},environments:{environments:g},workspaces:{workspaces:v}}=ot(),x=t===void 0,y=x?void 0:r.find(S=>S.id===t);if(!x&&!c&&r.length>0&&!y)return i.jsx(ts,{to:ep,replace:!0});const k=[{label:"Settings",url:wi},{label:"Schedules",url:ep},{label:x?"New Schedule":(y==null?void 0:y.title)??"Schedule",url:void 0}];return i.jsxs("div",{className:yn.container,children:[i.jsx(vs,{segments:k}),i.jsx(y9,{existing:y,isNew:x,personas:m,environments:g,workspaces:v,onCreateSchedule:d,onUpdateSchedule:u,onDeleteSchedule:p,onDone:()=>{s(ep)},showToast:o})]})}function y9({existing:t,isNew:s,personas:o,environments:r,workspaces:c,onCreateSchedule:d,onUpdateSchedule:u,onDeleteSchedule:p,onDone:m,showToast:g}){var W;const v=mt(),[x,y]=b.useState((t==null?void 0:t.title)??""),[k,S]=b.useState((t==null?void 0:t.description)??""),[j,N]=b.useState((t==null?void 0:t.scheduleExpression)??""),[T,C]=b.useState((t==null?void 0:t.personaId)??""),[A,O]=b.useState((t==null?void 0:t.environmentId)??""),[E,D]=b.useState((t==null?void 0:t.workspaceId)??""),[P,B]=b.useState(!1),[z,J]=b.useState(null);b.useEffect(()=>{s||t&&z===null&&(y(t.title),S(t.description),N(t.scheduleExpression),C(t.personaId),O(t.environmentId),D(t.workspaceId))},[s,t,z]);const V=!s&&t===void 0,K=s&&x.trim().length>0&&j.trim().length>0&&T.length>0,fe=o.map(X=>({value:X.id,label:X.name})),ee=[{value:"",label:"Auto-select (first connected)"},...r.map(X=>({value:X.id,label:X.displayName}))],oe=[{value:"",label:"System-level (no workspace)"},...c.map(X=>({value:X.id,label:X.name}))],M=X=>{X.preventDefault(),K&&d(x,k,j,T,A||void 0,E||void 0).then(de=>{g("Schedule created","success"),v(Yx(de.id),{replace:!0})},()=>{g("Failed to create schedule","error")})},H=(X,de)=>{t&&u(t.id,{[X]:de}).then(()=>{g("Schedule updated","success"),X==="title"&&y(String(de)),X==="description"&&S(String(de)),X==="scheduleExpression"&&N(String(de)),X==="personaId"&&C(String(de)),X==="environmentId"&&O(String(de))},()=>{g("Failed to update schedule","error")})},ne=()=>{if(!t)return;const X=!t.enabled;u(t.id,{enabled:X}).then(()=>{g(X?"Schedule enabled":"Schedule disabled","success")},()=>{g("Failed to update schedule","error")})},he=()=>{t&&p(t.id).then(()=>{g("Schedule deleted","success"),m()},()=>{g("Failed to delete schedule","error")})};return i.jsxs(i.Fragment,{children:[V?i.jsxs("div",{className:yn.form,children:[i.jsx("h3",{children:"Edit Schedule"}),i.jsx("p",{children:"Loading schedule..."})]}):s?i.jsxs("form",{onSubmit:M,className:yn.form,children:[i.jsx("h3",{children:"Create Schedule"}),i.jsxs("label",{children:["Title",i.jsx("input",{type:"text",value:x,onChange:X=>y(X.target.value),placeholder:"e.g. Nightly Review",required:!0,"data-testid":"schedule-detail-title"})]}),i.jsxs("label",{children:["Description ",i.jsx("span",{className:yn.optional,children:"(optional)"}),i.jsx("input",{type:"text",value:k,onChange:X=>S(X.target.value),placeholder:"Brief description...","data-testid":"schedule-detail-description"})]}),i.jsxs("label",{children:["Schedule Expression",i.jsx("input",{type:"text",value:j,onChange:X=>N(X.target.value),placeholder:"e.g. 30s, 5m, 1h, or 0 9 * * MON",required:!0,"data-testid":"schedule-detail-expression"}),i.jsxs("p",{className:yn.helperText,children:["Interval: ",i.jsx("code",{children:"30s"}),", ",i.jsx("code",{children:"5m"}),", ",i.jsx("code",{children:"1h"}),", ",i.jsx("code",{children:"1d"})," (min 10s) | Cron: ",i.jsx("code",{children:"0 9 * * MON"})," (standard 5-field cron syntax)"]})]}),i.jsxs("label",{children:["Persona",i.jsxs("select",{value:T,onChange:X=>C(X.target.value),required:!0,"data-testid":"schedule-detail-persona",children:[i.jsx("option",{value:"",children:"Select a persona..."}),fe.map(X=>i.jsx("option",{value:X.value,children:X.label},X.value))]})]}),i.jsxs("label",{children:["Environment ",i.jsx("span",{className:yn.optional,children:"(optional)"}),i.jsx("select",{value:A,onChange:X=>O(X.target.value),"data-testid":"schedule-detail-environment",children:ee.map(X=>i.jsx("option",{value:X.value,children:X.label},X.value))})]}),i.jsxs("label",{children:["Workspace ",i.jsx("span",{className:yn.optional,children:"(optional)"}),i.jsx("select",{value:E,onChange:X=>D(X.target.value),"data-testid":"schedule-detail-workspace",children:oe.map(X=>i.jsx("option",{value:X.value,children:X.label},X.value))})]}),i.jsxs("div",{className:yn.formActions,children:[i.jsx(tn,{type:"submit",variant:"primary",size:"md",disabled:!K,"data-testid":"schedule-detail-save",children:"Create"}),i.jsx(tn,{type:"button",variant:"outline",size:"md",onClick:m,"data-testid":"schedule-detail-cancel",children:"Cancel"})]})]}):t?i.jsxs("div",{className:yn.form,children:[i.jsx("h3",{children:"Edit Schedule"}),i.jsxs("div",{className:yn.formActions,children:[i.jsx(tn,{type:"button",variant:"outline",size:"md",onClick:m,"data-testid":"schedule-detail-cancel",children:"Back to Schedules"}),i.jsx(tn,{type:"button",variant:t.enabled?"ghost":"primary",size:"md",onClick:ne,"data-testid":"schedule-detail-toggle",children:t.enabled?"Disable":"Enable"}),i.jsx(tn,{type:"button",variant:"danger",size:"md",onClick:()=>B(!0),"data-testid":"schedule-detail-delete",children:"Delete"})]}),i.jsxs("div",{className:yn.editableSection,children:[i.jsxs("label",{children:["Title",i.jsx(Ft,{value:x,onSave:X=>{H("title",X)},validate:X=>X.trim()?void 0:"Title is required",fieldId:"schedule-title",activeFieldId:z,onActivate:J,ariaLabel:"Schedule title","data-testid":"schedule-detail-title"})]}),i.jsxs("label",{children:["Description",i.jsx(Ft,{value:k,onSave:X=>{H("description",X)},fieldId:"schedule-description",activeFieldId:z,onActivate:J,placeholder:"Brief description...",ariaLabel:"Schedule description","data-testid":"schedule-detail-description"})]}),i.jsxs("label",{children:["Schedule Expression",i.jsx(Ft,{value:j,onSave:X=>{H("scheduleExpression",X)},validate:X=>X.trim()?void 0:"Schedule expression is required",fieldId:"schedule-expression",activeFieldId:z,onActivate:J,placeholder:"e.g. 30s, 5m, 1h, or 0 9 * * MON",ariaLabel:"Schedule expression","data-testid":"schedule-detail-expression"})]}),i.jsxs("label",{children:["Persona",i.jsx(ul,{value:T,onSave:X=>{H("personaId",X)},options:fe,fieldId:"schedule-persona",activeFieldId:z,onActivate:J,ariaLabel:"Schedule persona","data-testid":"schedule-detail-persona"})]}),i.jsxs("label",{children:["Environment ",i.jsx("span",{className:yn.optional,children:"(optional — empty = auto-select)"}),i.jsx(ul,{value:A,onSave:X=>{H("environmentId",X)},options:ee,fieldId:"schedule-environment",activeFieldId:z,onActivate:J,ariaLabel:"Schedule environment","data-testid":"schedule-detail-environment"})]}),i.jsxs("label",{children:["Workspace ",i.jsx("span",{className:yn.optional,children:"(optional — set at creation)"}),i.jsx("span",{className:yn.readonlyValue,"data-testid":"schedule-detail-workspace",children:((W=c.find(X=>X.id===t.workspaceId))==null?void 0:W.name)??"System-level (no workspace)"})]})]}),i.jsxs("div",{className:yn.metaSection,children:[t.lastRunAt?i.jsxs("span",{children:["Last run: ",$o(t.lastRunAt)]}):i.jsx("span",{children:"Last run: Never"}),t.enabled&&t.nextRunAt?i.jsxs("span",{children:["Next run: ",O1(t.nextRunAt)]}):null,t.runCount>0&&i.jsxs("span",{children:["Total runs: ",t.runCount]}),i.jsxs("span",{children:["Created: ",$o(t.createdAt)]})]})]}):null,i.jsx(oa,{isOpen:P,title:"Delete Schedule?",description:`"${t==null?void 0:t.title}" will be permanently removed. Tasks already created by this schedule will not be affected.`,confirmLabel:"Delete",onConfirm:he,onCancel:()=>B(!1)})]})}function b9(){const{themeId:t,resolvedThemeId:s,setTheme:o,preferSystem:r,setPreferSystem:c}=Y1();return i.jsx(aB,{themeId:t,resolvedThemeId:s,onSetTheme:o,preferSystem:r,onSetPreferSystem:c})}function x9(){const[t,s]=b.useState(void 0);return b.useEffect(()=>{let o=!1;return(async()=>{try{const c=await Ye.getVersionStatus({});o||s({currentVersion:c.currentVersion,latestVersion:c.latestVersion,updateAvailable:c.updateAvailable,isDocker:c.isDocker})}catch{}})().catch(()=>{}),()=>{o=!0}},[]),t}function _9(){const{connected:t,environments:{environments:s},sessions:{sessions:o}}=ot(),r=x9();return i.jsxs(i.Fragment,{children:[r&&i.jsx(iO,{currentVersion:r.currentVersion,latestVersion:r.latestVersion,updateAvailable:r.updateAvailable,isDocker:r.isDocker}),i.jsx(iB,{connected:t,environments:s,sessions:o})]})}function k9(){return i.jsx(KL,{})}function S9(){const{plugins:{plugins:t,pluginsLoading:s,setPluginEnabled:o}}=ot();return i.jsx(bL,{plugins:t,loading:s,onSetPluginEnabled:(r,c)=>{o(r,c).catch(()=>{})}})}const vx=Ii();function T9(){const t=mt();return sa({key:"?"},()=>{t(SN)}),sa({key:"n"},()=>{t(vx)}),sa({key:"N"},()=>{t(vx)}),i.jsx(i.Fragment,{})}function bl(t){const s=L7();b.useLayoutEffect(()=>(s(t),()=>{s(void 0)}),[t,s])}function j9(){const{workspaces:{workspaces:t},tasks:{tasks:s}}=ot(),o=b.useMemo(()=>i.jsx(OI,{workspaces:t,tasks:s}),[t,s]);return bl(o),i.jsx(Ka,{})}function w9(){const{environments:{environments:t}}=ot(),s=b.useMemo(()=>i.jsx(G5,{environments:t}),[t]);return bl(s),i.jsx(Ka,{})}function N9(){const t=b.useMemo(()=>i.jsx(V8,{}),[]);return bl(t),i.jsx(Ka,{})}function C9(){const{findings:{findings:t,loadFindings:s,loadAllFindings:o}}=ot(),{workspaceId:r,environmentId:c}=as();b.useEffect(()=>{r?s(r).catch(()=>{}):o().catch(()=>{})},[r,s,o]);const d=b.useMemo(()=>i.jsx(nI,{findings:t,workspaceId:r,environmentId:c}),[t,r,c]);return bl(d),i.jsx(Ka,{})}function E9(){const{knowledge:t,workspaces:{workspaces:s}}=ot(),o=b.useCallback(p=>{t.search(p).catch(()=>{})},[t]),r=b.useCallback(()=>{t.clearSearch()},[t]),c=b.useCallback(p=>{t.selectNode(p).catch(()=>{})},[t]),d=b.useCallback(p=>{t.loadRecent(p||void 0).catch(()=>{})},[t]),u=b.useMemo(()=>i.jsx(a5,{nodes:t.graphData.nodes,workspaces:s,loading:t.loading,searchQuery:t.searchQuery,onSearch:o,onClearSearch:r,onSelectNode:c,onWorkspaceChange:d}),[t,s,o,r,c,d]);return bl(u),i.jsx(Ka,{})}const A9="_container_ce571_1",D9="_title_ce571_6",_d={container:A9,title:D9};function M9(){return i.jsxs("div",{className:_d.container,"aria-hidden":"true",children:[i.jsx("h1",{className:_d.title,children:"Findings"}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--space-sm)"},children:Array.from({length:4},(t,s)=>i.jsx(yd,{lines:3},s))})]})}function yx(){const{environmentId:t,workspaceId:s}=as(),{findings:{findings:o,findingsLoading:r,loadFindings:c},workspaces:{workspaces:d},environments:{environments:u}}=ot(),p=mt();b.useEffect(()=>{s&&c(s).catch(()=>{})},[s,c]);const m=b.useCallback(v=>{p(qp(v,s,t))},[p,s,t]);if(r)return i.jsx(M9,{});const g=s&&t?nk("Findings",s,t,d,u).slice(0,-1):Y7();return i.jsxs("div",{className:_d.container,"data-testid":"findings-list-page",children:[i.jsx(vs,{segments:g}),i.jsx("h1",{className:_d.title,children:"Findings"}),i.jsx(P1,{findings:o,onFindingClick:m})]})}const R9="_container_1wwpb_1",I9="_notFound_1wwpb_6",O9="_header_1wwpb_12",B9="_categoryBadge_1wwpb_19",L9="_title_1wwpb_28",z9="_content_1wwpb_35",$9="_tags_1wwpb_77",P9="_tag_1wwpb_77",U9="_meta_1wwpb_92",H9="_metaTimestamp_1wwpb_100",V9="_metaLink_1wwpb_105",vn={container:R9,notFound:I9,header:O9,categoryBadge:B9,title:L9,content:z9,tags:$9,tag:P9,meta:U9,metaTimestamp:H9,metaLink:V9};function bx(){const{findingId:t,environmentId:s,workspaceId:o}=as(),{findings:{selectedFinding:r,findingLoading:c,loadFinding:d},workspaces:{workspaces:u},environments:{environments:p}}=ot(),m=mt();if(b.useEffect(()=>{t&&d(t).catch(()=>{})},[t,d]),c)return i.jsx("div",{className:vn.container,"data-testid":"finding-detail-page",children:i.jsx("div",{className:vn.notFound,children:"Loading..."})});if(!r)return i.jsx("div",{className:vn.container,"data-testid":"finding-detail-page",children:i.jsx("div",{className:vn.notFound,children:"Finding not found."})});const g=nk(r.title,o,s,u,p),v=bd(r.category);return i.jsxs("div",{className:vn.container,"data-testid":"finding-detail-page",children:[i.jsx(vs,{segments:g}),i.jsxs("div",{className:vn.header,children:[i.jsx("span",{className:vn.categoryBadge,style:{background:v.bg,color:v.text},children:r.category}),i.jsx("h1",{className:vn.title,children:r.title})]}),r.content&&i.jsx("div",{className:vn.content,children:i.jsx(Sd,{remarkPlugins:[Td],children:r.content})}),r.tags.length>0&&i.jsx("div",{className:vn.tags,children:r.tags.map(x=>i.jsx("span",{className:vn.tag,children:x},x))}),i.jsxs("div",{className:vn.meta,children:[i.jsx("span",{className:vn.metaTimestamp,title:r.createdAt,children:$o(r.createdAt)}),r.taskId&&i.jsx("button",{type:"button",className:vn.metaLink,onClick:()=>{m(On(r.taskId))},children:"View Task"}),r.sessionId&&i.jsx("button",{type:"button",className:vn.metaLink,onClick:()=>{m(Nm(r.sessionId))},children:"View Session"})]})]})}const q9="_wizard_1260s_1",G9="_container_1260s_10",F9="_stepContent_1260s_19",Z9="_logoArea_1260s_28",K9="_logoImage_1260s_32",Y9="_heading_1260s_41",J9="_tagline_1260s_49",W9="_subtitle_1260s_56",X9="_featureList_1260s_64",Q9="_runtimeGrid_1260s_89",eH="_runtimeCard_1260s_101",tH="_runtimeName_1260s_133",nH="_runtimeDescription_1260s_139",sH="_buttonRow_1260s_144",aH="_primaryButton_1260s_151",iH="_ghostButton_1260s_185",oH="_dots_1260s_213",rH="_dot_1260s_213",Ke={wizard:q9,container:G9,stepContent:F9,logoArea:Z9,logoImage:K9,heading:Y9,tagline:J9,subtitle:W9,featureList:X9,runtimeGrid:Q9,runtimeCard:eH,runtimeName:tH,runtimeDescription:nH,buttonRow:sH,primaryButton:aH,ghostButton:iH,dots:oH,dot:rH};function lH({onNext:t}){return i.jsxs("div",{className:Ke.stepContent,"data-testid":"setup-welcome",children:[i.jsx("div",{className:Ke.logoArea,children:i.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:Ke.logoImage})}),i.jsx("h1",{className:Ke.heading,children:"Welcome to Grackle"}),i.jsx("p",{className:Ke.tagline,children:"Multi-agent orchestration for software teams"}),i.jsx("button",{type:"button",className:Ke.primaryButton,onClick:t,"data-testid":"setup-get-started",children:"Get Started"})]})}function cH({onNext:t,onBack:s}){return i.jsxs("div",{className:Ke.stepContent,"data-testid":"setup-about",children:[i.jsx("h2",{className:Ke.heading,children:"What is Grackle?"}),i.jsxs("ul",{className:Ke.featureList,children:[i.jsx("li",{children:"Run Claude, Copilot, and Codex agents side by side"}),i.jsx("li",{children:"Provision and control dev environments — SSH, Codespaces, or local"}),i.jsx("li",{children:"Organize work into workspaces with agent-executable tasks"}),i.jsx("li",{children:"Customize agent behavior with personas, tools, and MCP servers"}),i.jsx("li",{children:"Live-stream agent sessions with full terminal replay"})]}),i.jsxs("div",{className:Ke.buttonRow,children:[i.jsx("button",{type:"button",className:Ke.ghostButton,onClick:s,children:"Back"}),i.jsx("button",{type:"button",className:Ke.primaryButton,onClick:t,"data-testid":"setup-about-next",children:"Next"})]})]})}const dH=[{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 uH({currentRuntime:t,onFinish:s,onBack:o,finishDisabled:r}){const[c,d]=b.useState(t||"claude-code");return b.useEffect(()=>{t&&d(t)},[t]),i.jsxs("div",{className:Ke.stepContent,"data-testid":"setup-runtime",children:[i.jsx("h2",{className:Ke.heading,children:"Choose Your Runtime"}),i.jsx("p",{className:Ke.subtitle,children:"Select the primary agent runtime for your workspace. You can change this later."}),i.jsx("div",{className:Ke.runtimeGrid,children:dH.map(u=>i.jsxs("button",{type:"button",className:Ke.runtimeCard,"data-selected":c===u.id,"aria-pressed":c===u.id,"data-testid":`runtime-card-${u.id}`,onClick:()=>d(u.id),children:[i.jsx("span",{className:Ke.runtimeName,children:u.name}),i.jsx("span",{className:Ke.runtimeDescription,children:u.description})]},u.id))}),i.jsxs("div",{className:Ke.buttonRow,children:[i.jsx("button",{type:"button",className:Ke.ghostButton,onClick:o,children:"Back"}),i.jsx("button",{type:"button",className:Ke.primaryButton,onClick:()=>{s(c)},disabled:r,"data-testid":"setup-runtime-next",children:"Next"})]})]})}function fH(){return typeof Notification<"u"}function pH({onFinish:t,onBack:s,finishDisabled:o}){const r=fH(),c=r&&Notification.permission!=="default";function d(){r&&Notification.requestPermission().catch(()=>{}),t()}return i.jsxs("div",{className:Ke.stepContent,"data-testid":"setup-notifications",children:[i.jsx("h2",{className:Ke.heading,children:"Stay in the Loop"}),i.jsx("p",{className:Ke.subtitle,children:"Grackle can send you a browser notification when an agent needs your input, so you never miss an important moment."}),c?i.jsx("p",{className:Ke.subtitle,children:Notification.permission==="granted"?"Notifications are already enabled.":"Notifications have been blocked. You can change this in your browser settings."}):null,i.jsxs("div",{className:Ke.buttonRow,children:[i.jsx("button",{type:"button",className:Ke.ghostButton,onClick:s,disabled:o,children:"Back"}),!c&&r?i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:Ke.ghostButton,onClick:t,disabled:o,"data-testid":"setup-notifications-skip",children:"Skip"}),i.jsx("button",{type:"button",className:Ke.primaryButton,onClick:d,disabled:o,"data-testid":"setup-notifications-enable",children:"Enable Notifications"})]}):i.jsx("button",{type:"button",className:Ke.primaryButton,onClick:t,disabled:o,"data-testid":"setup-finish",children:"Finish"})]})]})}const mH=4,xx={"claude-code":"sonnet",copilot:"gpt-4o",codex:"o3",goose:""};function hH(){const{personas:{personas:t,updatePersona:s},completeOnboarding:o,onboardingCompleted:r}=ot(),{showToast:c}=pn(),d=mt(),[u,p]=b.useState(0),[m,g]=b.useState("claude-code"),[v,x]=b.useState(!1),y=t.find(j=>j.id==="claude-code"),k=b.useCallback(j=>{g(j),p(3)},[]),S=b.useCallback(()=>{const j=m;x(!0);const N=[];if(y&&j!==y.runtime){const C=xx[j]??"sonnet";N.push(s(y.id,void 0,void 0,void 0,j,C))}const T=t.find(C=>C.id===cy);if(T&&j!==T.runtime){const C=xx[j]??"sonnet";N.push(s(cy,void 0,void 0,void 0,j,C))}Promise.all(N).then(()=>o()).then(()=>{d("/",{replace:!0})},()=>{c("Failed to update runtime -- please try again","error"),x(!1)})},[m,y,t,s,o,d,c]);return r===!0?i.jsx(ts,{to:"/",replace:!0}):i.jsx("div",{className:Ke.wizard,"data-testid":"setup-wizard",children:i.jsxs("div",{className:Ke.container,children:[i.jsx(gs,{mode:"wait",children:i.jsxs(Rt.div,{initial:{opacity:0,x:40},animate:{opacity:1,x:0},exit:{opacity:0,x:-40},transition:{duration:.2,ease:"easeInOut"},children:[u===0&&i.jsx(lH,{onNext:()=>p(1)}),u===1&&i.jsx(cH,{onNext:()=>p(2),onBack:()=>p(0)}),u===2&&i.jsx(uH,{currentRuntime:m,onFinish:k,onBack:()=>p(1),finishDisabled:!y}),u===3&&i.jsx(pH,{onFinish:S,onBack:()=>p(2),finishDisabled:v})]},u)}),i.jsx("div",{className:Ke.dots,children:Array.from({length:mH},(j,N)=>i.jsx("span",{className:Ke.dot,"data-active":N===u},N))})]})})}const gH="_root_zndgp_1",vH="_body_zndgp_7",yH="_main_zndgp_19",bH="_sidebarWrapper_zndgp_26",xH="_overlay_zndgp_51",Yr={root:gH,body:vH,main:yH,sidebarWrapper:bH,overlay:xH},_H=b.lazy(()=>KT(()=>import("./KnowledgePage-39s6R_by.js"),__vite__mapDeps([0,1,2,3,4])).then(t=>({default:t.KnowledgePage}))),ok=typeof window<"u"&&new URLSearchParams(window.location.search).has("mock");function kH({tabs:t}){const{connected:s,environments:{environments:o},sessions:{sessions:r},tasks:{tasks:c}}=ot(),{toasts:d,dismissToast:u}=pn(),p=Yt(),m=B7(),g=m!==void 0,[v,x]=b.useState(!1),y=b.useCallback(()=>x(k=>!k),[]);return b.useEffect(()=>{x(!1)},[p.pathname]),b.useEffect(()=>{if(!v)return;const k=S=>{S.key==="Escape"&&x(!1)};return document.addEventListener("keydown",k),()=>{document.removeEventListener("keydown",k)}},[v]),i.jsxs(i.Fragment,{children:[i.jsx(m5,{connected:s,environments:o,sessions:r,onToggleSidebar:g?y:void 0,sidebarOpen:v}),i.jsx(_5,{tabs:t}),i.jsxs("div",{className:Yr.body,children:[g&&i.jsx("div",{className:Yr.sidebarWrapper,"data-sidebar-open":v,children:i.jsx(N5,{content:m})}),g&&v&&i.jsx("div",{className:Yr.overlay,"data-testid":"drawer-overlay",onClick:()=>x(!1)}),i.jsxs("div",{className:Yr.main,children:[i.jsx(Ka,{}),i.jsx(O5,{sessions:r,tasks:c,environments:o})]})]}),i.jsx(KI,{toasts:d,onDismiss:u}),i.jsx(T9,{})]})}function SH(){const{sessions:{lastSpawnedId:t},environments:{environments:s,operationError:o,clearOperationError:r},tasks:{tasks:c},connected:d,onboardingCompleted:u}=ot(),{pluginNames:p}=hh(),{showToast:m}=pn();Vz(s,m),Kz(c,m),qz(o,r,m);const g=mt(),v=Yt();if(b.useEffect(()=>{t&&!v.pathname.includes("/tasks/")&&g(Nm(t),{replace:!0})},[t,g,v.pathname]),d&&u===!1)return i.jsx(ts,{to:"/setup",replace:!0});const x=vz(p);return i.jsx(O7,{children:i.jsxs("div",{className:Yr.root,children:[ok&&i.jsx(QN,{}),i.jsx(kH,{tabs:x})]})})}function $p(){const{workspaceId:t}=as(),{workspaces:{workspaces:s}}=ot(),o=Yt(),r=s.find(g=>g.id===t),c=r!=null&&r.linkedEnvironmentIds?[...r.linkedEnvironmentIds].sort()[0]:void 0;if(!c)return s.length===0?void 0:i.jsx(ts,{to:"/environments",replace:!0});const d=encodeURIComponent(t),u=`/workspaces/${d}`,p=o.pathname.startsWith(u)?o.pathname.slice(u.length):"",m=`/environments/${encodeURIComponent(c)}/workspaces/${d}${p}${o.search}${o.hash}`;return i.jsx(ts,{to:m,replace:!0})}function TH(){const{pluginNames:t}=hh(),s=t.includes("orchestration"),o=t.includes("knowledge");return i.jsxs(Lw,{children:[i.jsx(we,{path:"setup",element:i.jsx(hH,{})}),i.jsxs(we,{element:i.jsx(SH,{}),children:[i.jsx(we,{index:!0,element:i.jsx(IP,{})}),i.jsx(we,{path:"chat",element:i.jsx(qP,{})}),i.jsx(we,{path:"sessions/new",element:i.jsx(GP,{})}),i.jsx(we,{path:"sessions/:sessionId",element:i.jsx(YP,{})}),o&&i.jsx(we,{element:i.jsx(E9,{}),children:i.jsx(we,{path:"knowledge",element:i.jsx(b.Suspense,{fallback:i.jsx(E1,{}),children:i.jsx(_H,{})})})}),s&&i.jsxs(we,{element:i.jsx(j9,{}),children:[i.jsx(we,{path:"tasks",element:i.jsx(MP,{})}),i.jsx(we,{path:"tasks/new",element:i.jsx(fx,{})}),i.jsx(we,{path:"tasks/:taskId",element:i.jsx(Pa,{})}),i.jsx(we,{path:"tasks/:taskId/edit",element:i.jsx(Pa,{})}),i.jsx(we,{path:"tasks/:taskId/stream",element:i.jsx(Pa,{})}),i.jsx(we,{path:"tasks/:taskId/findings",element:i.jsx(Pa,{})})]}),s&&i.jsxs(we,{element:i.jsx(C9,{}),children:[i.jsx(we,{path:"findings",element:i.jsx(yx,{})}),i.jsx(we,{path:"findings/:findingId",element:i.jsx(bx,{})}),i.jsx(we,{path:"environments/:environmentId/workspaces/:workspaceId/findings",element:i.jsx(yx,{})}),i.jsx(we,{path:"environments/:environmentId/workspaces/:workspaceId/findings/:findingId",element:i.jsx(bx,{})})]}),i.jsxs(we,{element:i.jsx(w9,{}),children:[i.jsx(we,{path:"workspaces",element:i.jsx(ts,{to:"/environments",replace:!0})}),i.jsx(we,{path:"workspaces/new",element:i.jsx(dU,{})}),i.jsx(we,{path:"workspaces/:workspaceId",element:i.jsx($p,{})}),i.jsx(we,{path:"workspaces/:workspaceId/tasks/:taskId",element:i.jsx($p,{})}),i.jsx(we,{path:"workspaces/:workspaceId/tasks/:taskId/*",element:i.jsx($p,{})}),i.jsx(we,{path:"environments/:environmentId/workspaces/:workspaceId",element:i.jsx(QP,{})}),i.jsx(we,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/new",element:i.jsx(fx,{})}),i.jsx(we,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId",element:i.jsx(Pa,{})}),i.jsx(we,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit",element:i.jsx(Pa,{})}),i.jsx(we,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream",element:i.jsx(Pa,{})}),i.jsx(we,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings",element:i.jsx(Pa,{})}),i.jsxs(we,{path:"environments",element:i.jsx(vU,{}),children:[i.jsx(we,{index:!0,element:i.jsx(RP,{})}),i.jsx(we,{path:"new",element:i.jsx(fU,{})}),i.jsx(we,{path:":environmentId",element:i.jsx(ZU,{})}),i.jsx(we,{path:":environmentId/edit",element:i.jsx(pU,{})})]})]}),i.jsx(we,{element:i.jsx(N9,{}),children:i.jsxs(we,{path:"settings",element:i.jsx(JU,{}),children:[i.jsx(we,{index:!0,element:i.jsx(ts,{to:"credentials",replace:!0})}),i.jsx(we,{path:"environments",element:i.jsx(ts,{to:"/environments",replace:!0})}),i.jsx(we,{path:"credentials",element:i.jsx(WU,{})}),i.jsx(we,{path:"tokens",element:i.jsx(ts,{to:"../credentials",replace:!0})}),i.jsx(we,{path:"personas",element:i.jsx(XU,{})}),i.jsx(we,{path:"personas/new",element:i.jsx(hx,{})}),i.jsx(we,{path:"personas/:personaId",element:i.jsx(hx,{})}),i.jsx(we,{path:"schedules",element:i.jsx(c9,{})}),i.jsx(we,{path:"schedules/new",element:i.jsx(gx,{})}),i.jsx(we,{path:"schedules/:scheduleId",element:i.jsx(gx,{})}),i.jsx(we,{path:"appearance",element:i.jsx(b9,{})}),i.jsx(we,{path:"shortcuts",element:i.jsx(k9,{})}),i.jsx(we,{path:"plugins",element:i.jsx(S9,{})}),i.jsx(we,{path:"about",element:i.jsx(_9,{})})]})}),i.jsx(we,{path:"*",element:i.jsx(ts,{to:"/",replace:!0})})]})]})}const jH=1e4;function wH(){const{onboardingCompleted:t}=ot(),[s,o]=b.useState(!1);b.useEffect(()=>{if(t!==void 0)return;const c=setTimeout(()=>o(!0),jH);return()=>clearTimeout(c)},[t]);const r=t===void 0&&!s;return i.jsx(gs,{mode:"wait",children:r?i.jsx(Rt.div,{initial:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:i.jsx(E1,{})},"splash"):i.jsx(Rt.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.25},style:{minHeight:"100vh"},children:i.jsx(lN,{basename:"/".replace(/\/$/,""),children:i.jsx(TH,{})})},"app")})}function NH(){const t=ok?dz:Hz;return i.jsx(pz,{children:i.jsx(I7,{children:i.jsx(A7,{children:i.jsx(t,{children:i.jsx(wH,{})})})})})}GT.createRoot(document.getElementById("root")).render(i.jsx(b.StrictMode,{children:i.jsx(NH,{})}));export{vs as B,Wx as K,ot as a,qp as f,Nm as s,On as t,mt as u};
|