@grackle-ai/web 0.113.0 → 0.114.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{KnowledgePage-DkdBifb0.js → KnowledgePage-CUjPQAzX.js} +1 -1
- package/dist/assets/grpc-NKDtlv-W.js +2 -0
- package/dist/assets/index-BMJJs-t4.js +769 -0
- package/dist/assets/{index-Bwj24CGE.css → index-DJDfd8Nl.css} +1 -1
- package/dist/index.html +3 -3
- package/package.json +3 -3
- package/dist/assets/grpc-D_uSC7Lb.js +0 -2
- package/dist/assets/index-CWV90-m6.js +0 -754
|
@@ -0,0 +1,769 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/McpAppWidget-DbYqtOnr.js","assets/dagview-tHPW3Rz3.js","assets/KnowledgePage-CUjPQAzX.js","assets/grpc-NKDtlv-W.js","assets/markdown-Yr3vTPLR.js","assets/KnowledgePage-BmY14aDt.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as R2,a as I2,b as y,j as a,d as my,H as hy,P as gy,i as O2,B as L2,c as B2,C as $2,M as z2,e as H2}from"./dagview-tHPW3Rz3.js";import{c as P2,a as Nd,G as U2,b as V2,d as q2,e as G2,f as F2,M as K2,D as R_,A as I_,W as Z2,O as Y2,g as J2,C as fa,h as O_,i as L_,w as W2,t as X2,p as Oc,j as Q2,R as Lc,S as vy}from"./grpc-NKDtlv-W.js";import{v as ej,r as tj,t as Bc,i as nj,f as sj,M as Cd,a as Ed}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 np={exports:{}},Pr={},sp={exports:{}},ap={};/**
|
|
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 yy;function aj(){return yy||(yy=1,(function(t){function s($,B){var se=$.length;$.push(B);e:for(;0<se;){var oe=se-1>>>1,X=$[oe];if(0<c(X,B))$[oe]=B,$[se]=X,se=oe;else break e}}function o($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var B=$[0],se=$.pop();if(se!==B){$[0]=se;e:for(var oe=0,X=$.length,ce=X>>>1;oe<ce;){var fe=2*(oe+1)-1,ge=$[fe],Ae=fe+1,vt=$[Ae];if(0>c(ge,se))Ae<X&&0>c(vt,ge)?($[oe]=vt,$[Ae]=se,oe=Ae):($[oe]=ge,$[fe]=se,oe=fe);else if(Ae<X&&0>c(vt,se))$[oe]=vt,$[Ae]=se,oe=Ae;else break e}}return B}function c($,B){var se=$.sortIndex-B.sortIndex;return se!==0?se:$.id-B.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,_=null,b=3,x=!1,k=!1,j=!1,w=!1,T=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function O($){for(var B=o(g);B!==null;){if(B.callback===null)r(g);else if(B.startTime<=$)r(g),B.sortIndex=B.expirationTime,s(m,B);else break;B=o(g)}}function E($){if(j=!1,O($),!k)if(o(m)!==null)k=!0,M||(M=!0,ee());else{var B=o(g);B!==null&&re(E,B.startTime-$)}}var M=!1,L=-1,A=5,P=-1;function Y(){return w?!0:!(t.unstable_now()-P<A)}function q(){if(w=!1,M){var $=t.unstable_now();P=$;var B=!0;try{e:{k=!1,j&&(j=!1,C(L),L=-1),x=!0;var se=b;try{t:{for(O($),_=o(m);_!==null&&!(_.expirationTime>$&&Y());){var oe=_.callback;if(typeof oe=="function"){_.callback=null,b=_.priorityLevel;var X=oe(_.expirationTime<=$);if($=t.unstable_now(),typeof X=="function"){_.callback=X,O($),B=!0;break t}_===o(m)&&r(m),O($)}else r(m);_=o(m)}if(_!==null)B=!0;else{var ce=o(g);ce!==null&&re(E,ce.startTime-$),B=!1}}break e}finally{_=null,b=se,x=!1}B=void 0}}finally{B?ee():M=!1}}}var ee;if(typeof D=="function")ee=function(){D(q)};else if(typeof MessageChannel<"u"){var le=new MessageChannel,W=le.port2;le.port1.onmessage=q,ee=function(){W.postMessage(null)}}else ee=function(){T(q,0)};function re($,B){L=T(function(){$(t.unstable_now())},B)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function($){$.callback=null},t.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<$?Math.floor(1e3/$):5},t.unstable_getCurrentPriorityLevel=function(){return b},t.unstable_next=function($){switch(b){case 1:case 2:case 3:var B=3;break;default:B=b}var se=b;b=B;try{return $()}finally{b=se}},t.unstable_requestPaint=function(){w=!0},t.unstable_runWithPriority=function($,B){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var se=b;b=$;try{return B()}finally{b=se}},t.unstable_scheduleCallback=function($,B,se){var oe=t.unstable_now();switch(typeof se=="object"&&se!==null?(se=se.delay,se=typeof se=="number"&&0<se?oe+se:oe):se=oe,$){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=se+X,$={id:v++,callback:B,priorityLevel:$,startTime:se,expirationTime:X,sortIndex:-1},se>oe?($.sortIndex=se,s(g,$),o(m)===null&&$===o(g)&&(j?(C(L),L=-1):j=!0,re(E,se-oe))):($.sortIndex=X,s(m,$),k||x||(k=!0,M||(M=!0,ee()))),$},t.unstable_shouldYield=Y,t.unstable_wrapCallback=function($){var B=b;return function(){var se=b;b=B;try{return $.apply(this,arguments)}finally{b=se}}}})(ap)),ap}var by;function ij(){return by||(by=1,sp.exports=aj()),sp.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 _y;function oj(){if(_y)return Pr;_y=1;var t=ij(),s=R2(),o=I2();function r(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)n+="&args[]="+encodeURIComponent(arguments[i])}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,i=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(i=n.return),e=n.return;while(e)}return n.tag===3?i: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 i=e,l=n;;){var f=i.return;if(f===null)break;var h=f.alternate;if(h===null){if(l=f.return,l!==null){i=l;continue}break}if(f.child===h.child){for(h=f.child;h;){if(h===i)return m(f),e;if(h===l)return m(f),n;h=h.sibling}throw Error(r(188))}if(i.return!==l.return)i=f,l=h;else{for(var S=!1,N=f.child;N;){if(N===i){S=!0,i=f,l=h;break}if(N===l){S=!0,l=f,i=h;break}N=N.sibling}if(!S){for(N=h.child;N;){if(N===i){S=!0,i=h,l=f;break}if(N===l){S=!0,l=h,i=f;break}N=N.sibling}if(!S)throw Error(r(189))}}if(i.alternate!==l)throw Error(r(190))}if(i.tag!==3)throw Error(r(188));return i.stateNode.current===i?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 _=Object.assign,b=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),D=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),Y=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function ee(e){return e===null||typeof e!="object"?null:(e=q&&e[q]||e["@@iterator"],typeof e=="function"?e:null)}var le=Symbol.for("react.client.reference");function W(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===le?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case j:return"Fragment";case T:return"Profiler";case w:return"StrictMode";case E:return"Suspense";case M:return"SuspenseList";case P:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case D: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 L:return n=e.displayName||null,n!==null?n:W(e.type)||"Memo";case A:n=e._payload,e=e._init;try{return W(e(n))}catch{}}return null}var re=Array.isArray,$=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se={pending:!1,data:null,method:null,action:null},oe=[],X=-1;function ce(e){return{current:e}}function fe(e){0>X||(e.current=oe[X],oe[X]=null,X--)}function ge(e,n){X++,oe[X]=e.current,e.current=n}var Ae=ce(null),vt=ce(null),wt=ce(null),_e=ce(null);function qe(e,n){switch(ge(wt,n),ge(vt,e),ge(Ae,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?B0(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=B0(n),e=$0(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}fe(Ae),ge(Ae,e)}function Bt(){fe(Ae),fe(vt),fe(wt)}function Wt(e){e.memoizedState!==null&&ge(_e,e);var n=Ae.current,i=$0(n,e.type);n!==i&&(ge(vt,e),ge(Ae,i))}function de(e){vt.current===e&&(fe(Ae),fe(vt)),_e.current===e&&(fe(_e),Br._currentValue=se)}var Ue,yt;function At(e){if(Ue===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);Ue=n&&n[1]||"",yt=-1<i.stack.indexOf(`
|
|
19
|
+
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
20
|
+
`+Ue+e+yt}var H=!1;function ve(e,n){if(!e||H)return"";H=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(n){var ae=function(){throw Error()};if(Object.defineProperty(ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ae,[])}catch(Z){var K=Z}Reflect.construct(e,[],ae)}else{try{ae.call()}catch(Z){K=Z}e.call(ae.prototype)}}else{try{throw Error()}catch(Z){K=Z}(ae=e())&&typeof ae.catch=="function"&&ae.catch(function(){})}}catch(Z){if(Z&&K&&typeof Z.stack=="string")return[Z.stack,K.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(),S=h[0],N=h[1];if(S&&N){var R=S.split(`
|
|
21
|
+
`),F=N.split(`
|
|
22
|
+
`);for(f=l=0;l<R.length&&!R[l].includes("DetermineComponentFrameRoot");)l++;for(;f<F.length&&!F[f].includes("DetermineComponentFrameRoot");)f++;if(l===R.length||f===F.length)for(l=R.length-1,f=F.length-1;1<=l&&0<=f&&R[l]!==F[f];)f--;for(;1<=l&&0<=f;l--,f--)if(R[l]!==F[f]){if(l!==1||f!==1)do if(l--,f--,0>f||R[l]!==F[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{H=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?At(i):""}function tt(e,n){switch(e.tag){case 26:case 27:case 5:return At(e.type);case 16:return At("Lazy");case 13:return e.child!==n&&n!==null?At("Suspense Fallback"):At("Suspense");case 19:return At("SuspenseList");case 0:case 15:return ve(e.type,!1);case 11:return ve(e.type.render,!1);case 1:return ve(e.type,!0);case 31:return At("Activity");default:return""}}function Dt(e){try{var n="",i=null;do n+=tt(e,i),i=e,e=e.return;while(e);return n}catch(l){return`
|
|
24
|
+
Error generating stack: `+l.message+`
|
|
25
|
+
`+l.stack}}var Ge=Object.prototype.hasOwnProperty,Xt=t.unstable_scheduleCallback,bn=t.unstable_cancelCallback,Bs=t.unstable_shouldYield,si=t.unstable_requestPaint,qt=t.unstable_now,Ui=t.unstable_getCurrentPriorityLevel,ai=t.unstable_ImmediatePriority,va=t.unstable_UserBlockingPriority,$s=t.unstable_NormalPriority,ii=t.unstable_LowPriority,oi=t.unstable_IdlePriority,ds=t.log,Ne=t.unstable_setDisableYieldValue,ze=null,ht=null;function Qt(e){if(typeof ds=="function"&&Ne(e),ht&&typeof ht.setStrictMode=="function")try{ht.setStrictMode(ze,e)}catch{}}var Gt=Math.clz32?Math.clz32:Gi,Vi=Math.log,qi=Math.LN2;function Gi(e){return e>>>=0,e===0?32:31-(Vi(e)/qi|0)|0}var zs=256,ri=262144,li=4194304;function Ss(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 ci(e,n,i){var l=e.pendingLanes;if(l===0)return 0;var f=0,h=e.suspendedLanes,S=e.pingedLanes;e=e.warmLanes;var N=l&134217727;return N!==0?(l=N&~h,l!==0?f=Ss(l):(S&=N,S!==0?f=Ss(S):i||(i=N&~e,i!==0&&(f=Ss(i))))):(N=l&~h,N!==0?f=Ss(N):S!==0?f=Ss(S):i||(i=l&~e,i!==0&&(f=Ss(i)))),f===0?0:n!==0&&n!==f&&(n&h)===0&&(h=f&-f,i=n&-n,h>=i||h===32&&(i&4194048)!==0)?n:f}function ya(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function kl(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 Xo(){var e=li;return li<<=1,(li&62914560)===0&&(li=4194304),e}function Fi(e){for(var n=[],i=0;31>i;i++)n.push(e);return n}function di(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function U(e,n,i,l,f,h){var S=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var N=e.entanglements,R=e.expirationTimes,F=e.hiddenUpdates;for(i=S&~i;0<i;){var Q=31-Gt(i),ae=1<<Q;N[Q]=0,R[Q]=-1;var K=F[Q];if(K!==null)for(F[Q]=null,Q=0;Q<K.length;Q++){var Z=K[Q];Z!==null&&(Z.lane&=-536870913)}i&=~ae}l!==0&&te(e,l,0),h!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=h&~(S&~n))}function te(e,n,i){e.pendingLanes|=n,e.suspendedLanes&=~n;var l=31-Gt(n);e.entangledLanes|=n,e.entanglements[l]=e.entanglements[l]|1073741824|i&261930}function ue(e,n){var i=e.entangledLanes|=n;for(e=e.entanglements;i;){var l=31-Gt(i),f=1<<l;f&n|e[l]&n&&(e[l]|=n),i&=~f}}function me(e,n){var i=n&-n;return i=(i&42)!==0?1:ye(i),(i&(e.suspendedLanes|n))!==0?0:i}function ye(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 Fe(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Se(){var e=B.p;return e!==0?e:(e=window.event,e===void 0?32:ry(e.type))}function Le(e,n){var i=B.p;try{return B.p=e,n()}finally{B.p=i}}var Ve=Math.random().toString(36).slice(2),Ie="__reactFiber$"+Ve,Me="__reactProps$"+Ve,Mt="__reactContainer$"+Ve,on="__reactEvents$"+Ve,Ft="__reactListeners$"+Ve,ba="__reactHandles$"+Ve,js="__reactResources$"+Ve,Hs="__reactMarker$"+Ve;function Kd(e){delete e[Ie],delete e[Me],delete e[on],delete e[Ft],delete e[ba]}function Ki(e){var n=e[Ie];if(n)return n;for(var i=e.parentNode;i;){if(n=i[Mt]||i[Ie]){if(i=n.alternate,n.child!==null||i!==null&&i.child!==null)for(e=G0(e);e!==null;){if(i=e[Ie])return i;e=G0(e)}return n}e=i,i=e.parentNode}return null}function Zi(e){if(e=e[Ie]||e[Mt]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function Qo(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(r(33))}function Yi(e){var n=e[js];return n||(n=e[js]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function rn(e){e[Hs]=!0}var wh=new Set,Th={};function ui(e,n){Ji(e,n),Ji(e+"Capture",n)}function Ji(e,n){for(Th[e]=n,e=0;e<n.length;e++)wh.add(n[e])}var jk=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]*$"),Nh={},Ch={};function wk(e){return Ge.call(Ch,e)?!0:Ge.call(Nh,e)?!1:jk.test(e)?Ch[e]=!0:(Nh[e]=!0,!1)}function Sl(e,n,i){if(wk(n))if(i===null)e.removeAttribute(n);else{switch(typeof i){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,""+i)}}function jl(e,n,i){if(i===null)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+i)}}function Ps(e,n,i,l){if(l===null)e.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(n,i,""+l)}}function qn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Eh(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Tk(e,n,i){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(S){i=""+S,h.call(this,S)}}),Object.defineProperty(e,n,{enumerable:l.enumerable}),{getValue:function(){return i},setValue:function(S){i=""+S},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Zd(e){if(!e._valueTracker){var n=Eh(e)?"checked":"value";e._valueTracker=Tk(e,n,""+e[n])}}function Ah(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var i=n.getValue(),l="";return e&&(l=Eh(e)?e.checked?"true":"false":e.value),e=l,e!==i?(n.setValue(e),!0):!1}function wl(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 Nk=/[\n"\\]/g;function Gn(e){return e.replace(Nk,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Yd(e,n,i,l,f,h,S,N){e.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.type=S:e.removeAttribute("type"),n!=null?S==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+qn(n)):e.value!==""+qn(n)&&(e.value=""+qn(n)):S!=="submit"&&S!=="reset"||e.removeAttribute("value"),n!=null?Jd(e,S,qn(n)):i!=null?Jd(e,S,qn(i)):l!=null&&e.removeAttribute("value"),f==null&&h!=null&&(e.defaultChecked=!!h),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?e.name=""+qn(N):e.removeAttribute("name")}function Dh(e,n,i,l,f,h,S,N){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),n!=null||i!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){Zd(e);return}i=i!=null?""+qn(i):"",n=n!=null?""+qn(n):i,N||n===e.value||(e.value=n),e.defaultValue=n}l=l??f,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=N?e.checked:!!l,e.defaultChecked=!!l,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(e.name=S),Zd(e)}function Jd(e,n,i){n==="number"&&wl(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function Wi(e,n,i,l){if(e=e.options,n){n={};for(var f=0;f<i.length;f++)n["$"+i[f]]=!0;for(i=0;i<e.length;i++)f=n.hasOwnProperty("$"+e[i].value),e[i].selected!==f&&(e[i].selected=f),f&&l&&(e[i].defaultSelected=!0)}else{for(i=""+qn(i),n=null,f=0;f<e.length;f++){if(e[f].value===i){e[f].selected=!0,l&&(e[f].defaultSelected=!0);return}n!==null||e[f].disabled||(n=e[f])}n!==null&&(n.selected=!0)}}function Mh(e,n,i){if(n!=null&&(n=""+qn(n),n!==e.value&&(e.value=n),i==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=i!=null?""+qn(i):""}function Rh(e,n,i,l){if(n==null){if(l!=null){if(i!=null)throw Error(r(92));if(re(l)){if(1<l.length)throw Error(r(93));l=l[0]}i=l}i==null&&(i=""),n=i}i=qn(n),e.defaultValue=i,l=e.textContent,l===i&&l!==""&&l!==null&&(e.value=l),Zd(e)}function Xi(e,n){if(n){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=n;return}}e.textContent=n}var Ck=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 Ih(e,n,i){var l=n.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?l?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":l?e.setProperty(n,i):typeof i!="number"||i===0||Ck.has(n)?n==="float"?e.cssFloat=i:e[n]=(""+i).trim():e[n]=i+"px"}function Oh(e,n,i){if(n!=null&&typeof n!="object")throw Error(r(62));if(e=e.style,i!=null){for(var l in i)!i.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)&&i[f]!==l&&Ih(e,f,l)}else for(var h in n)n.hasOwnProperty(h)&&Ih(e,h,n[h])}function Wd(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 Ek=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"]]),Ak=/^[\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 Tl(e){return Ak.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Us(){}var Xd=null;function Qd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qi=null,eo=null;function Lh(e){var n=Zi(e);if(n&&(e=n.stateNode)){var i=e[Me]||null;e:switch(e=n.stateNode,n.type){case"input":if(Yd(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),n=i.name,i.type==="radio"&&n!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Gn(""+n)+'"][type="radio"]'),n=0;n<i.length;n++){var l=i[n];if(l!==e&&l.form===e.form){var f=l[Me]||null;if(!f)throw Error(r(90));Yd(l,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<i.length;n++)l=i[n],l.form===e.form&&Ah(l)}break e;case"textarea":Mh(e,i.value,i.defaultValue);break e;case"select":n=i.value,n!=null&&Wi(e,!!i.multiple,n,!1)}}}var eu=!1;function Bh(e,n,i){if(eu)return e(n,i);eu=!0;try{var l=e(n);return l}finally{if(eu=!1,(Qi!==null||eo!==null)&&(pc(),Qi&&(n=Qi,e=eo,eo=Qi=null,Lh(n),e)))for(n=0;n<e.length;n++)Lh(e[n])}}function er(e,n){var i=e.stateNode;if(i===null)return null;var l=i[Me]||null;if(l===null)return null;i=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(i&&typeof i!="function")throw Error(r(231,n,typeof i));return i}var Vs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),tu=!1;if(Vs)try{var tr={};Object.defineProperty(tr,"passive",{get:function(){tu=!0}}),window.addEventListener("test",tr,tr),window.removeEventListener("test",tr,tr)}catch{tu=!1}var _a=null,nu=null,Nl=null;function $h(){if(Nl)return Nl;var e,n=nu,i=n.length,l,f="value"in _a?_a.value:_a.textContent,h=f.length;for(e=0;e<i&&n[e]===f[e];e++);var S=i-e;for(l=1;l<=S&&n[i-l]===f[h-l];l++);return Nl=f.slice(e,1<l?1-l:void 0)}function Cl(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 El(){return!0}function zh(){return!1}function jn(e){function n(i,l,f,h,S){this._reactName=i,this._targetInst=f,this.type=l,this.nativeEvent=h,this.target=S,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(i=e[N],this[N]=i?i(h):h[N]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?El:zh,this.isPropagationStopped=zh,this}return _(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=El)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=El)},persist:function(){},isPersistent:El}),n}var fi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Al=jn(fi),nr=_({},fi,{view:0,detail:0}),Dk=jn(nr),su,au,sr,Dl=_({},nr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ou,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!==sr&&(sr&&e.type==="mousemove"?(su=e.screenX-sr.screenX,au=e.screenY-sr.screenY):au=su=0,sr=e),su)},movementY:function(e){return"movementY"in e?e.movementY:au}}),Hh=jn(Dl),Mk=_({},Dl,{dataTransfer:0}),Rk=jn(Mk),Ik=_({},nr,{relatedTarget:0}),iu=jn(Ik),Ok=_({},fi,{animationName:0,elapsedTime:0,pseudoElement:0}),Lk=jn(Ok),Bk=_({},fi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),$k=jn(Bk),zk=_({},fi,{data:0}),Ph=jn(zk),Hk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Pk={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"},Uk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Vk(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Uk[e])?!!n[e]:!1}function ou(){return Vk}var qk=_({},nr,{key:function(e){if(e.key){var n=Hk[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Cl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Pk[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ou,charCode:function(e){return e.type==="keypress"?Cl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Cl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Gk=jn(qk),Fk=_({},Dl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Uh=jn(Fk),Kk=_({},nr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ou}),Zk=jn(Kk),Yk=_({},fi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Jk=jn(Yk),Wk=_({},Dl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Xk=jn(Wk),Qk=_({},fi,{newState:0,oldState:0}),eS=jn(Qk),tS=[9,13,27,32],ru=Vs&&"CompositionEvent"in window,ar=null;Vs&&"documentMode"in document&&(ar=document.documentMode);var nS=Vs&&"TextEvent"in window&&!ar,Vh=Vs&&(!ru||ar&&8<ar&&11>=ar),qh=" ",Gh=!1;function Fh(e,n){switch(e){case"keyup":return tS.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var to=!1;function sS(e,n){switch(e){case"compositionend":return Kh(n);case"keypress":return n.which!==32?null:(Gh=!0,qh);case"textInput":return e=n.data,e===qh&&Gh?null:e;default:return null}}function aS(e,n){if(to)return e==="compositionend"||!ru&&Fh(e,n)?(e=$h(),Nl=nu=_a=null,to=!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 Vh&&n.locale!=="ko"?null:n.data;default:return null}}var iS={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 Zh(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!iS[e.type]:n==="textarea"}function Yh(e,n,i,l){Qi?eo?eo.push(l):eo=[l]:Qi=l,n=_c(n,"onChange"),0<n.length&&(i=new Al("onChange","change",null,i,l),e.push({event:i,listeners:n}))}var ir=null,or=null;function oS(e){D0(e,0)}function Ml(e){var n=Qo(e);if(Ah(n))return e}function Jh(e,n){if(e==="change")return n}var Wh=!1;if(Vs){var lu;if(Vs){var cu="oninput"in document;if(!cu){var Xh=document.createElement("div");Xh.setAttribute("oninput","return;"),cu=typeof Xh.oninput=="function"}lu=cu}else lu=!1;Wh=lu&&(!document.documentMode||9<document.documentMode)}function Qh(){ir&&(ir.detachEvent("onpropertychange",eg),or=ir=null)}function eg(e){if(e.propertyName==="value"&&Ml(or)){var n=[];Yh(n,or,e,Qd(e)),Bh(oS,n)}}function rS(e,n,i){e==="focusin"?(Qh(),ir=n,or=i,ir.attachEvent("onpropertychange",eg)):e==="focusout"&&Qh()}function lS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ml(or)}function cS(e,n){if(e==="click")return Ml(n)}function dS(e,n){if(e==="input"||e==="change")return Ml(n)}function uS(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var An=typeof Object.is=="function"?Object.is:uS;function rr(e,n){if(An(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var i=Object.keys(e),l=Object.keys(n);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var f=i[l];if(!Ge.call(n,f)||!An(e[f],n[f]))return!1}return!0}function tg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ng(e,n){var i=tg(e);e=0;for(var l;i;){if(i.nodeType===3){if(l=e+i.textContent.length,e<=n&&l>=n)return{node:i,offset:n-e};e=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=tg(i)}}function sg(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?sg(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function ag(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=wl(e.document);n instanceof e.HTMLIFrameElement;){try{var i=typeof n.contentWindow.location.href=="string"}catch{i=!1}if(i)e=n.contentWindow;else break;n=wl(e.document)}return n}function du(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 fS=Vs&&"documentMode"in document&&11>=document.documentMode,no=null,uu=null,lr=null,fu=!1;function ig(e,n,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;fu||no==null||no!==wl(l)||(l=no,"selectionStart"in l&&du(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}),lr&&rr(lr,l)||(lr=l,l=_c(uu,"onSelect"),0<l.length&&(n=new Al("onSelect","select",null,n,i),e.push({event:n,listeners:l}),n.target=no)))}function pi(e,n){var i={};return i[e.toLowerCase()]=n.toLowerCase(),i["Webkit"+e]="webkit"+n,i["Moz"+e]="moz"+n,i}var so={animationend:pi("Animation","AnimationEnd"),animationiteration:pi("Animation","AnimationIteration"),animationstart:pi("Animation","AnimationStart"),transitionrun:pi("Transition","TransitionRun"),transitionstart:pi("Transition","TransitionStart"),transitioncancel:pi("Transition","TransitionCancel"),transitionend:pi("Transition","TransitionEnd")},pu={},og={};Vs&&(og=document.createElement("div").style,"AnimationEvent"in window||(delete so.animationend.animation,delete so.animationiteration.animation,delete so.animationstart.animation),"TransitionEvent"in window||delete so.transitionend.transition);function mi(e){if(pu[e])return pu[e];if(!so[e])return e;var n=so[e],i;for(i in n)if(n.hasOwnProperty(i)&&i in og)return pu[e]=n[i];return e}var rg=mi("animationend"),lg=mi("animationiteration"),cg=mi("animationstart"),pS=mi("transitionrun"),mS=mi("transitionstart"),hS=mi("transitioncancel"),dg=mi("transitionend"),ug=new Map,mu="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(" ");mu.push("scrollEnd");function us(e,n){ug.set(e,n),ui(n,[e])}var Rl=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)},Fn=[],ao=0,hu=0;function Il(){for(var e=ao,n=hu=ao=0;n<e;){var i=Fn[n];Fn[n++]=null;var l=Fn[n];Fn[n++]=null;var f=Fn[n];Fn[n++]=null;var h=Fn[n];if(Fn[n++]=null,l!==null&&f!==null){var S=l.pending;S===null?f.next=f:(f.next=S.next,S.next=f),l.pending=f}h!==0&&fg(i,f,h)}}function Ol(e,n,i,l){Fn[ao++]=e,Fn[ao++]=n,Fn[ao++]=i,Fn[ao++]=l,hu|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function gu(e,n,i,l){return Ol(e,n,i,l),Ll(e)}function hi(e,n){return Ol(e,null,null,n),Ll(e)}function fg(e,n,i){e.lanes|=i;var l=e.alternate;l!==null&&(l.lanes|=i);for(var f=!1,h=e.return;h!==null;)h.childLanes|=i,l=h.alternate,l!==null&&(l.childLanes|=i),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-Gt(i),e=h.hiddenUpdates,l=e[f],l===null?e[f]=[n]:l.push(n),n.lane=i|536870912),h):null}function Ll(e){if(50<Ar)throw Ar=0,Tf=null,Error(r(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var io={};function gS(e,n,i,l){this.tag=e,this.key=i,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 Dn(e,n,i,l){return new gS(e,n,i,l)}function vu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function qs(e,n){var i=e.alternate;return i===null?(i=Dn(e.tag,n,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=n,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,n=e.dependencies,i.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function pg(e,n){e.flags&=65011714;var i=e.alternate;return i===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=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,n=i.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function Bl(e,n,i,l,f,h){var S=0;if(l=e,typeof e=="function")vu(e)&&(S=1);else if(typeof e=="string")S=x2(e,i,Ae.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case P:return e=Dn(31,i,n,f),e.elementType=P,e.lanes=h,e;case j:return gi(i.children,f,h,n);case w:S=8,f|=24;break;case T:return e=Dn(12,i,n,f|2),e.elementType=T,e.lanes=h,e;case E:return e=Dn(13,i,n,f),e.elementType=E,e.lanes=h,e;case M:return e=Dn(19,i,n,f),e.elementType=M,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case D:S=10;break e;case C:S=9;break e;case O:S=11;break e;case L:S=14;break e;case A:S=16,l=null;break e}S=29,i=Error(r(130,e===null?"null":typeof e,"")),l=null}return n=Dn(S,i,n,f),n.elementType=e,n.type=l,n.lanes=h,n}function gi(e,n,i,l){return e=Dn(7,e,l,n),e.lanes=i,e}function yu(e,n,i){return e=Dn(6,e,null,n),e.lanes=i,e}function mg(e){var n=Dn(18,null,null,0);return n.stateNode=e,n}function bu(e,n,i){return n=Dn(4,e.children!==null?e.children:[],e.key,n),n.lanes=i,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var hg=new WeakMap;function Kn(e,n){if(typeof e=="object"&&e!==null){var i=hg.get(e);return i!==void 0?i:(n={value:e,source:n,stack:Dt(n)},hg.set(e,n),n)}return{value:e,source:n,stack:Dt(n)}}var oo=[],ro=0,$l=null,cr=0,Zn=[],Yn=0,xa=null,ws=1,Ts="";function Gs(e,n){oo[ro++]=cr,oo[ro++]=$l,$l=e,cr=n}function gg(e,n,i){Zn[Yn++]=ws,Zn[Yn++]=Ts,Zn[Yn++]=xa,xa=e;var l=ws;e=Ts;var f=32-Gt(l)-1;l&=~(1<<f),i+=1;var h=32-Gt(n)+f;if(30<h){var S=f-f%5;h=(l&(1<<S)-1).toString(32),l>>=S,f-=S,ws=1<<32-Gt(n)+f|i<<f|l,Ts=h+e}else ws=1<<h|i<<f|l,Ts=e}function _u(e){e.return!==null&&(Gs(e,1),gg(e,1,0))}function xu(e){for(;e===$l;)$l=oo[--ro],oo[ro]=null,cr=oo[--ro],oo[ro]=null;for(;e===xa;)xa=Zn[--Yn],Zn[Yn]=null,Ts=Zn[--Yn],Zn[Yn]=null,ws=Zn[--Yn],Zn[Yn]=null}function vg(e,n){Zn[Yn++]=ws,Zn[Yn++]=Ts,Zn[Yn++]=xa,ws=n.id,Ts=n.overflow,xa=e}var dn=null,bt=null,Xe=!1,ka=null,Jn=!1,ku=Error(r(519));function Sa(e){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw dr(Kn(n,e)),ku}function yg(e){var n=e.stateNode,i=e.type,l=e.memoizedProps;switch(n[Ie]=e,n[Me]=l,i){case"dialog":Ze("cancel",n),Ze("close",n);break;case"iframe":case"object":case"embed":Ze("load",n);break;case"video":case"audio":for(i=0;i<Mr.length;i++)Ze(Mr[i],n);break;case"source":Ze("error",n);break;case"img":case"image":case"link":Ze("error",n),Ze("load",n);break;case"details":Ze("toggle",n);break;case"input":Ze("invalid",n),Dh(n,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Ze("invalid",n);break;case"textarea":Ze("invalid",n),Rh(n,l.value,l.defaultValue,l.children)}i=l.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||n.textContent===""+i||l.suppressHydrationWarning===!0||O0(n.textContent,i)?(l.popover!=null&&(Ze("beforetoggle",n),Ze("toggle",n)),l.onScroll!=null&&Ze("scroll",n),l.onScrollEnd!=null&&Ze("scrollend",n),l.onClick!=null&&(n.onclick=Us),n=!0):n=!1,n||Sa(e,!0)}function bg(e){for(dn=e.return;dn;)switch(dn.tag){case 5:case 31:case 13:Jn=!1;return;case 27:case 3:Jn=!0;return;default:dn=dn.return}}function lo(e){if(e!==dn)return!1;if(!Xe)return bg(e),Xe=!0,!1;var n=e.tag,i;if((i=n!==3&&n!==27)&&((i=n===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Pf(e.type,e.memoizedProps)),i=!i),i&&bt&&Sa(e),bg(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));bt=q0(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));bt=q0(e)}else n===27?(n=bt,Ba(e.type)?(e=Ff,Ff=null,bt=e):bt=n):bt=dn?Xn(e.stateNode.nextSibling):null;return!0}function vi(){bt=dn=null,Xe=!1}function Su(){var e=ka;return e!==null&&(Cn===null?Cn=e:Cn.push.apply(Cn,e),ka=null),e}function dr(e){ka===null?ka=[e]:ka.push(e)}var ju=ce(null),yi=null,Fs=null;function ja(e,n,i){ge(ju,n._currentValue),n._currentValue=i}function Ks(e){e._currentValue=ju.current,fe(ju)}function wu(e,n,i){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===i)break;e=e.return}}function Tu(e,n,i,l){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var h=f.dependencies;if(h!==null){var S=f.child;h=h.firstContext;e:for(;h!==null;){var N=h;h=f;for(var R=0;R<n.length;R++)if(N.context===n[R]){h.lanes|=i,N=h.alternate,N!==null&&(N.lanes|=i),wu(h.return,i,e),l||(S=null);break e}h=N.next}}else if(f.tag===18){if(S=f.return,S===null)throw Error(r(341));S.lanes|=i,h=S.alternate,h!==null&&(h.lanes|=i),wu(S,i,e),S=null}else S=f.child;if(S!==null)S.return=f;else for(S=f;S!==null;){if(S===e){S=null;break}if(f=S.sibling,f!==null){f.return=S.return,S=f;break}S=S.return}f=S}}function co(e,n,i,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 S=f.alternate;if(S===null)throw Error(r(387));if(S=S.memoizedProps,S!==null){var N=f.type;An(f.pendingProps.value,S.value)||(e!==null?e.push(N):e=[N])}}else if(f===_e.current){if(S=f.alternate,S===null)throw Error(r(387));S.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(Br):e=[Br])}f=f.return}e!==null&&Tu(n,e,i,l),n.flags|=262144}function zl(e){for(e=e.firstContext;e!==null;){if(!An(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function bi(e){yi=e,Fs=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function un(e){return _g(yi,e)}function Hl(e,n){return yi===null&&bi(e),_g(e,n)}function _g(e,n){var i=n._currentValue;if(n={context:n,memoizedValue:i,next:null},Fs===null){if(e===null)throw Error(r(308));Fs=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Fs=Fs.next=n;return i}var vS=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(i,l){e.push(l)}};this.abort=function(){n.aborted=!0,e.forEach(function(i){return i()})}},yS=t.unstable_scheduleCallback,bS=t.unstable_NormalPriority,Kt={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Nu(){return{controller:new vS,data:new Map,refCount:0}}function ur(e){e.refCount--,e.refCount===0&&yS(bS,function(){e.controller.abort()})}var fr=null,Cu=0,uo=0,fo=null;function _S(e,n){if(fr===null){var i=fr=[];Cu=0,uo=Mf(),fo={status:"pending",value:void 0,then:function(l){i.push(l)}}}return Cu++,n.then(xg,xg),n}function xg(){if(--Cu===0&&fr!==null){fo!==null&&(fo.status="fulfilled");var e=fr;fr=null,uo=0,fo=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function xS(e,n){var i=[],l={status:"pending",value:null,reason:null,then:function(f){i.push(f)}};return e.then(function(){l.status="fulfilled",l.value=n;for(var f=0;f<i.length;f++)(0,i[f])(n)},function(f){for(l.status="rejected",l.reason=f,f=0;f<i.length;f++)(0,i[f])(void 0)}),l}var kg=$.S;$.S=function(e,n){i0=qt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&_S(e,n),kg!==null&&kg(e,n)};var _i=ce(null);function Eu(){var e=_i.current;return e!==null?e:gt.pooledCache}function Pl(e,n){n===null?ge(_i,_i.current):ge(_i,n.pool)}function Sg(){var e=Eu();return e===null?null:{parent:Kt._currentValue,pool:e}}var po=Error(r(460)),Au=Error(r(474)),Ul=Error(r(542)),Vl={then:function(){}};function jg(e){return e=e.status,e==="fulfilled"||e==="rejected"}function wg(e,n,i){switch(i=e[i],i===void 0?e.push(n):i!==n&&(n.then(Us,Us),n=i),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Ng(e),e;default:if(typeof n.status=="string")n.then(Us,Us);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,Ng(e),e}throw ki=n,po}}function xi(e){try{var n=e._init;return n(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(ki=i,po):i}}var ki=null;function Tg(){if(ki===null)throw Error(r(459));var e=ki;return ki=null,e}function Ng(e){if(e===po||e===Ul)throw Error(r(483))}var mo=null,pr=0;function ql(e){var n=pr;return pr+=1,mo===null&&(mo=[]),wg(mo,e,n)}function mr(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Gl(e,n){throw n.$$typeof===b?Error(r(525)):(e=Object.prototype.toString.call(n),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function Cg(e){function n(V,z){if(e){var G=V.deletions;G===null?(V.deletions=[z],V.flags|=16):G.push(z)}}function i(V,z){if(!e)return null;for(;z!==null;)n(V,z),z=z.sibling;return null}function l(V){for(var z=new Map;V!==null;)V.key!==null?z.set(V.key,V):z.set(V.index,V),V=V.sibling;return z}function f(V,z){return V=qs(V,z),V.index=0,V.sibling=null,V}function h(V,z,G){return V.index=G,e?(G=V.alternate,G!==null?(G=G.index,G<z?(V.flags|=67108866,z):G):(V.flags|=67108866,z)):(V.flags|=1048576,z)}function S(V){return e&&V.alternate===null&&(V.flags|=67108866),V}function N(V,z,G,ne){return z===null||z.tag!==6?(z=yu(G,V.mode,ne),z.return=V,z):(z=f(z,G),z.return=V,z)}function R(V,z,G,ne){var Te=G.type;return Te===j?Q(V,z,G.props.children,ne,G.key):z!==null&&(z.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===A&&xi(Te)===z.type)?(z=f(z,G.props),mr(z,G),z.return=V,z):(z=Bl(G.type,G.key,G.props,null,V.mode,ne),mr(z,G),z.return=V,z)}function F(V,z,G,ne){return z===null||z.tag!==4||z.stateNode.containerInfo!==G.containerInfo||z.stateNode.implementation!==G.implementation?(z=bu(G,V.mode,ne),z.return=V,z):(z=f(z,G.children||[]),z.return=V,z)}function Q(V,z,G,ne,Te){return z===null||z.tag!==7?(z=gi(G,V.mode,ne,Te),z.return=V,z):(z=f(z,G),z.return=V,z)}function ae(V,z,G){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=yu(""+z,V.mode,G),z.return=V,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case x:return G=Bl(z.type,z.key,z.props,null,V.mode,G),mr(G,z),G.return=V,G;case k:return z=bu(z,V.mode,G),z.return=V,z;case A:return z=xi(z),ae(V,z,G)}if(re(z)||ee(z))return z=gi(z,V.mode,G,null),z.return=V,z;if(typeof z.then=="function")return ae(V,ql(z),G);if(z.$$typeof===D)return ae(V,Hl(V,z),G);Gl(V,z)}return null}function K(V,z,G,ne){var Te=z!==null?z.key:null;if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return Te!==null?null:N(V,z,""+G,ne);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case x:return G.key===Te?R(V,z,G,ne):null;case k:return G.key===Te?F(V,z,G,ne):null;case A:return G=xi(G),K(V,z,G,ne)}if(re(G)||ee(G))return Te!==null?null:Q(V,z,G,ne,null);if(typeof G.then=="function")return K(V,z,ql(G),ne);if(G.$$typeof===D)return K(V,z,Hl(V,G),ne);Gl(V,G)}return null}function Z(V,z,G,ne,Te){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return V=V.get(G)||null,N(z,V,""+ne,Te);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case x:return V=V.get(ne.key===null?G:ne.key)||null,R(z,V,ne,Te);case k:return V=V.get(ne.key===null?G:ne.key)||null,F(z,V,ne,Te);case A:return ne=xi(ne),Z(V,z,G,ne,Te)}if(re(ne)||ee(ne))return V=V.get(G)||null,Q(z,V,ne,Te,null);if(typeof ne.then=="function")return Z(V,z,G,ql(ne),Te);if(ne.$$typeof===D)return Z(V,z,G,Hl(z,ne),Te);Gl(z,ne)}return null}function xe(V,z,G,ne){for(var Te=null,nt=null,ke=z,He=z=0,Je=null;ke!==null&&He<G.length;He++){ke.index>He?(Je=ke,ke=null):Je=ke.sibling;var st=K(V,ke,G[He],ne);if(st===null){ke===null&&(ke=Je);break}e&&ke&&st.alternate===null&&n(V,ke),z=h(st,z,He),nt===null?Te=st:nt.sibling=st,nt=st,ke=Je}if(He===G.length)return i(V,ke),Xe&&Gs(V,He),Te;if(ke===null){for(;He<G.length;He++)ke=ae(V,G[He],ne),ke!==null&&(z=h(ke,z,He),nt===null?Te=ke:nt.sibling=ke,nt=ke);return Xe&&Gs(V,He),Te}for(ke=l(ke);He<G.length;He++)Je=Z(ke,V,He,G[He],ne),Je!==null&&(e&&Je.alternate!==null&&ke.delete(Je.key===null?He:Je.key),z=h(Je,z,He),nt===null?Te=Je:nt.sibling=Je,nt=Je);return e&&ke.forEach(function(Ua){return n(V,Ua)}),Xe&&Gs(V,He),Te}function Ce(V,z,G,ne){if(G==null)throw Error(r(151));for(var Te=null,nt=null,ke=z,He=z=0,Je=null,st=G.next();ke!==null&&!st.done;He++,st=G.next()){ke.index>He?(Je=ke,ke=null):Je=ke.sibling;var Ua=K(V,ke,st.value,ne);if(Ua===null){ke===null&&(ke=Je);break}e&&ke&&Ua.alternate===null&&n(V,ke),z=h(Ua,z,He),nt===null?Te=Ua:nt.sibling=Ua,nt=Ua,ke=Je}if(st.done)return i(V,ke),Xe&&Gs(V,He),Te;if(ke===null){for(;!st.done;He++,st=G.next())st=ae(V,st.value,ne),st!==null&&(z=h(st,z,He),nt===null?Te=st:nt.sibling=st,nt=st);return Xe&&Gs(V,He),Te}for(ke=l(ke);!st.done;He++,st=G.next())st=Z(ke,V,He,st.value,ne),st!==null&&(e&&st.alternate!==null&&ke.delete(st.key===null?He:st.key),z=h(st,z,He),nt===null?Te=st:nt.sibling=st,nt=st);return e&&ke.forEach(function(M2){return n(V,M2)}),Xe&&Gs(V,He),Te}function mt(V,z,G,ne){if(typeof G=="object"&&G!==null&&G.type===j&&G.key===null&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case x:e:{for(var Te=G.key;z!==null;){if(z.key===Te){if(Te=G.type,Te===j){if(z.tag===7){i(V,z.sibling),ne=f(z,G.props.children),ne.return=V,V=ne;break e}}else if(z.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===A&&xi(Te)===z.type){i(V,z.sibling),ne=f(z,G.props),mr(ne,G),ne.return=V,V=ne;break e}i(V,z);break}else n(V,z);z=z.sibling}G.type===j?(ne=gi(G.props.children,V.mode,ne,G.key),ne.return=V,V=ne):(ne=Bl(G.type,G.key,G.props,null,V.mode,ne),mr(ne,G),ne.return=V,V=ne)}return S(V);case k:e:{for(Te=G.key;z!==null;){if(z.key===Te)if(z.tag===4&&z.stateNode.containerInfo===G.containerInfo&&z.stateNode.implementation===G.implementation){i(V,z.sibling),ne=f(z,G.children||[]),ne.return=V,V=ne;break e}else{i(V,z);break}else n(V,z);z=z.sibling}ne=bu(G,V.mode,ne),ne.return=V,V=ne}return S(V);case A:return G=xi(G),mt(V,z,G,ne)}if(re(G))return xe(V,z,G,ne);if(ee(G)){if(Te=ee(G),typeof Te!="function")throw Error(r(150));return G=Te.call(G),Ce(V,z,G,ne)}if(typeof G.then=="function")return mt(V,z,ql(G),ne);if(G.$$typeof===D)return mt(V,z,Hl(V,G),ne);Gl(V,G)}return typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint"?(G=""+G,z!==null&&z.tag===6?(i(V,z.sibling),ne=f(z,G),ne.return=V,V=ne):(i(V,z),ne=yu(G,V.mode,ne),ne.return=V,V=ne),S(V)):i(V,z)}return function(V,z,G,ne){try{pr=0;var Te=mt(V,z,G,ne);return mo=null,Te}catch(ke){if(ke===po||ke===Ul)throw ke;var nt=Dn(29,ke,null,V.mode);return nt.lanes=ne,nt.return=V,nt}finally{}}}var Si=Cg(!0),Eg=Cg(!1),wa=!1;function Du(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Mu(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 Ta(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Na(e,n,i){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(rt&2)!==0){var f=l.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),l.pending=n,n=Ll(e),fg(e,null,i),n}return Ol(e,l,n,i),Ll(e)}function hr(e,n,i){if(n=n.updateQueue,n!==null&&(n=n.shared,(i&4194048)!==0)){var l=n.lanes;l&=e.pendingLanes,i|=l,n.lanes=i,ue(e,i)}}function Ru(e,n){var i=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var f=null,h=null;if(i=i.firstBaseUpdate,i!==null){do{var S={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};h===null?f=h=S:h=h.next=S,i=i.next}while(i!==null);h===null?f=h=n:h=h.next=n}else f=h=n;i={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:l.shared,callbacks:l.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=n:e.next=n,i.lastBaseUpdate=n}var Iu=!1;function gr(){if(Iu){var e=fo;if(e!==null)throw e}}function vr(e,n,i,l){Iu=!1;var f=e.updateQueue;wa=!1;var h=f.firstBaseUpdate,S=f.lastBaseUpdate,N=f.shared.pending;if(N!==null){f.shared.pending=null;var R=N,F=R.next;R.next=null,S===null?h=F:S.next=F,S=R;var Q=e.alternate;Q!==null&&(Q=Q.updateQueue,N=Q.lastBaseUpdate,N!==S&&(N===null?Q.firstBaseUpdate=F:N.next=F,Q.lastBaseUpdate=R))}if(h!==null){var ae=f.baseState;S=0,Q=F=R=null,N=h;do{var K=N.lane&-536870913,Z=K!==N.lane;if(Z?(Ye&K)===K:(l&K)===K){K!==0&&K===uo&&(Iu=!0),Q!==null&&(Q=Q.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var xe=e,Ce=N;K=n;var mt=i;switch(Ce.tag){case 1:if(xe=Ce.payload,typeof xe=="function"){ae=xe.call(mt,ae,K);break e}ae=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=Ce.payload,K=typeof xe=="function"?xe.call(mt,ae,K):xe,K==null)break e;ae=_({},ae,K);break e;case 2:wa=!0}}K=N.callback,K!==null&&(e.flags|=64,Z&&(e.flags|=8192),Z=f.callbacks,Z===null?f.callbacks=[K]:Z.push(K))}else Z={lane:K,tag:N.tag,payload:N.payload,callback:N.callback,next:null},Q===null?(F=Q=Z,R=ae):Q=Q.next=Z,S|=K;if(N=N.next,N===null){if(N=f.shared.pending,N===null)break;Z=N,N=Z.next,Z.next=null,f.lastBaseUpdate=Z,f.shared.pending=null}}while(!0);Q===null&&(R=ae),f.baseState=R,f.firstBaseUpdate=F,f.lastBaseUpdate=Q,h===null&&(f.shared.lanes=0),Ma|=S,e.lanes=S,e.memoizedState=ae}}function Ag(e,n){if(typeof e!="function")throw Error(r(191,e));e.call(n)}function Dg(e,n){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Ag(i[e],n)}var ho=ce(null),Fl=ce(0);function Mg(e,n){e=na,ge(Fl,e),ge(ho,n),na=e|n.baseLanes}function Ou(){ge(Fl,na),ge(ho,ho.current)}function Lu(){na=Fl.current,fe(ho),fe(Fl)}var Mn=ce(null),Wn=null;function Ca(e){var n=e.alternate;ge($t,$t.current&1),ge(Mn,e),Wn===null&&(n===null||ho.current!==null||n.memoizedState!==null)&&(Wn=e)}function Bu(e){ge($t,$t.current),ge(Mn,e),Wn===null&&(Wn=e)}function Rg(e){e.tag===22?(ge($t,$t.current),ge(Mn,e),Wn===null&&(Wn=e)):Ea()}function Ea(){ge($t,$t.current),ge(Mn,Mn.current)}function Rn(e){fe(Mn),Wn===e&&(Wn=null),fe($t)}var $t=ce(0);function Kl(e){for(var n=e;n!==null;){if(n.tag===13){var i=n.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||qf(i)||Gf(i)))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 Zs=0,Be=null,ft=null,Zt=null,Zl=!1,go=!1,ji=!1,Yl=0,yr=0,vo=null,kS=0;function Rt(){throw Error(r(321))}function $u(e,n){if(n===null)return!1;for(var i=0;i<n.length&&i<e.length;i++)if(!An(e[i],n[i]))return!1;return!0}function zu(e,n,i,l,f,h){return Zs=h,Be=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,$.H=e===null||e.memoizedState===null?gv:ef,ji=!1,h=i(l,f),ji=!1,go&&(h=Og(n,i,l,f)),Ig(e),h}function Ig(e){$.H=xr;var n=ft!==null&&ft.next!==null;if(Zs=0,Zt=ft=Be=null,Zl=!1,yr=0,vo=null,n)throw Error(r(300));e===null||Yt||(e=e.dependencies,e!==null&&zl(e)&&(Yt=!0))}function Og(e,n,i,l){Be=e;var f=0;do{if(go&&(vo=null),yr=0,go=!1,25<=f)throw Error(r(301));if(f+=1,Zt=ft=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}$.H=vv,h=n(i,l)}while(go);return h}function SS(){var e=$.H,n=e.useState()[0];return n=typeof n.then=="function"?br(n):n,e=e.useState()[0],(ft!==null?ft.memoizedState:null)!==e&&(Be.flags|=1024),n}function Hu(){var e=Yl!==0;return Yl=0,e}function Pu(e,n,i){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~i}function Uu(e){if(Zl){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}Zl=!1}Zs=0,Zt=ft=Be=null,go=!1,yr=Yl=0,vo=null}function _n(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Zt===null?Be.memoizedState=Zt=e:Zt=Zt.next=e,Zt}function zt(){if(ft===null){var e=Be.alternate;e=e!==null?e.memoizedState:null}else e=ft.next;var n=Zt===null?Be.memoizedState:Zt.next;if(n!==null)Zt=n,ft=e;else{if(e===null)throw Be.alternate===null?Error(r(467)):Error(r(310));ft=e,e={memoizedState:ft.memoizedState,baseState:ft.baseState,baseQueue:ft.baseQueue,queue:ft.queue,next:null},Zt===null?Be.memoizedState=Zt=e:Zt=Zt.next=e}return Zt}function Jl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function br(e){var n=yr;return yr+=1,vo===null&&(vo=[]),e=wg(vo,e,n),n=Be,(Zt===null?n.memoizedState:Zt.next)===null&&(n=n.alternate,$.H=n===null||n.memoizedState===null?gv:ef),e}function Wl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return br(e);if(e.$$typeof===D)return un(e)}throw Error(r(438,String(e)))}function Vu(e){var n=null,i=Be.updateQueue;if(i!==null&&(n=i.memoCache),n==null){var l=Be.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}),i===null&&(i=Jl(),Be.updateQueue=i),i.memoCache=n,i=n.data[n.index],i===void 0)for(i=n.data[n.index]=Array(e),l=0;l<e;l++)i[l]=Y;return n.index++,i}function Ys(e,n){return typeof n=="function"?n(e):n}function Xl(e){var n=zt();return qu(n,ft,e)}function qu(e,n,i){var l=e.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=i;var f=e.baseQueue,h=l.pending;if(h!==null){if(f!==null){var S=f.next;f.next=h.next,h.next=S}n.baseQueue=f=h,l.pending=null}if(h=e.baseState,f===null)e.memoizedState=h;else{n=f.next;var N=S=null,R=null,F=n,Q=!1;do{var ae=F.lane&-536870913;if(ae!==F.lane?(Ye&ae)===ae:(Zs&ae)===ae){var K=F.revertLane;if(K===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),ae===uo&&(Q=!0);else if((Zs&K)===K){F=F.next,K===uo&&(Q=!0);continue}else ae={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},R===null?(N=R=ae,S=h):R=R.next=ae,Be.lanes|=K,Ma|=K;ae=F.action,ji&&i(h,ae),h=F.hasEagerState?F.eagerState:i(h,ae)}else K={lane:ae,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},R===null?(N=R=K,S=h):R=R.next=K,Be.lanes|=ae,Ma|=ae;F=F.next}while(F!==null&&F!==n);if(R===null?S=h:R.next=N,!An(h,e.memoizedState)&&(Yt=!0,Q&&(i=fo,i!==null)))throw i;e.memoizedState=h,e.baseState=S,e.baseQueue=R,l.lastRenderedState=h}return f===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Gu(e){var n=zt(),i=n.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=e;var l=i.dispatch,f=i.pending,h=n.memoizedState;if(f!==null){i.pending=null;var S=f=f.next;do h=e(h,S.action),S=S.next;while(S!==f);An(h,n.memoizedState)||(Yt=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),i.lastRenderedState=h}return[h,l]}function Lg(e,n,i){var l=Be,f=zt(),h=Xe;if(h){if(i===void 0)throw Error(r(407));i=i()}else i=n();var S=!An((ft||f).memoizedState,i);if(S&&(f.memoizedState=i,Yt=!0),f=f.queue,Zu(zg.bind(null,l,f,e),[e]),f.getSnapshot!==n||S||Zt!==null&&Zt.memoizedState.tag&1){if(l.flags|=2048,yo(9,{destroy:void 0},$g.bind(null,l,f,i,n),null),gt===null)throw Error(r(349));h||(Zs&127)!==0||Bg(l,n,i)}return i}function Bg(e,n,i){e.flags|=16384,e={getSnapshot:n,value:i},n=Be.updateQueue,n===null?(n=Jl(),Be.updateQueue=n,n.stores=[e]):(i=n.stores,i===null?n.stores=[e]:i.push(e))}function $g(e,n,i,l){n.value=i,n.getSnapshot=l,Hg(n)&&Pg(e)}function zg(e,n,i){return i(function(){Hg(n)&&Pg(e)})}function Hg(e){var n=e.getSnapshot;e=e.value;try{var i=n();return!An(e,i)}catch{return!0}}function Pg(e){var n=hi(e,2);n!==null&&En(n,e,2)}function Fu(e){var n=_n();if(typeof e=="function"){var i=e;if(e=i(),ji){Qt(!0);try{i()}finally{Qt(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ys,lastRenderedState:e},n}function Ug(e,n,i,l){return e.baseState=i,qu(e,ft,typeof l=="function"?l:Ys)}function jS(e,n,i,l,f){if(tc(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(S){h.listeners.push(S)}};$.T!==null?i(!0):h.isTransition=!1,l(h),i=n.pending,i===null?(h.next=n.pending=h,Vg(n,h)):(h.next=i.next,n.pending=i.next=h)}}function Vg(e,n){var i=n.action,l=n.payload,f=e.state;if(n.isTransition){var h=$.T,S={};$.T=S;try{var N=i(f,l),R=$.S;R!==null&&R(S,N),qg(e,n,N)}catch(F){Ku(e,n,F)}finally{h!==null&&S.types!==null&&(h.types=S.types),$.T=h}}else try{h=i(f,l),qg(e,n,h)}catch(F){Ku(e,n,F)}}function qg(e,n,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(l){Gg(e,n,l)},function(l){return Ku(e,n,l)}):Gg(e,n,i)}function Gg(e,n,i){n.status="fulfilled",n.value=i,Fg(n),e.state=i,n=e.pending,n!==null&&(i=n.next,i===n?e.pending=null:(i=i.next,n.next=i,Vg(e,i)))}function Ku(e,n,i){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do n.status="rejected",n.reason=i,Fg(n),n=n.next;while(n!==l)}e.action=null}function Fg(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function Kg(e,n){return n}function Zg(e,n){if(Xe){var i=gt.formState;if(i!==null){e:{var l=Be;if(Xe){if(bt){t:{for(var f=bt,h=Jn;f.nodeType!==8;){if(!h){f=null;break t}if(f=Xn(f.nextSibling),f===null){f=null;break t}}h=f.data,f=h==="F!"||h==="F"?f:null}if(f){bt=Xn(f.nextSibling),l=f.data==="F!";break e}}Sa(l)}l=!1}l&&(n=i[0])}}return i=_n(),i.memoizedState=i.baseState=n,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kg,lastRenderedState:n},i.queue=l,i=pv.bind(null,Be,l),l.dispatch=i,l=Fu(!1),h=Qu.bind(null,Be,!1,l.queue),l=_n(),f={state:n,dispatch:null,action:e,pending:null},l.queue=f,i=jS.bind(null,Be,f,h,i),f.dispatch=i,l.memoizedState=e,[n,i,!1]}function Yg(e){var n=zt();return Jg(n,ft,e)}function Jg(e,n,i){if(n=qu(e,n,Kg)[0],e=Xl(Ys)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var l=br(n)}catch(S){throw S===po?Ul:S}else l=n;n=zt();var f=n.queue,h=f.dispatch;return i!==n.memoizedState&&(Be.flags|=2048,yo(9,{destroy:void 0},wS.bind(null,f,i),null)),[l,h,e]}function wS(e,n){e.action=n}function Wg(e){var n=zt(),i=ft;if(i!==null)return Jg(n,i,e);zt(),n=n.memoizedState,i=zt();var l=i.queue.dispatch;return i.memoizedState=e,[n,l,!1]}function yo(e,n,i,l){return e={tag:e,create:i,deps:l,inst:n,next:null},n=Be.updateQueue,n===null&&(n=Jl(),Be.updateQueue=n),i=n.lastEffect,i===null?n.lastEffect=e.next=e:(l=i.next,i.next=e,e.next=l,n.lastEffect=e),e}function Xg(){return zt().memoizedState}function Ql(e,n,i,l){var f=_n();Be.flags|=e,f.memoizedState=yo(1|n,{destroy:void 0},i,l===void 0?null:l)}function ec(e,n,i,l){var f=zt();l=l===void 0?null:l;var h=f.memoizedState.inst;ft!==null&&l!==null&&$u(l,ft.memoizedState.deps)?f.memoizedState=yo(n,h,i,l):(Be.flags|=e,f.memoizedState=yo(1|n,h,i,l))}function Qg(e,n){Ql(8390656,8,e,n)}function Zu(e,n){ec(2048,8,e,n)}function TS(e){Be.flags|=4;var n=Be.updateQueue;if(n===null)n=Jl(),Be.updateQueue=n,n.events=[e];else{var i=n.events;i===null?n.events=[e]:i.push(e)}}function ev(e){var n=zt().memoizedState;return TS({ref:n,nextImpl:e}),function(){if((rt&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function tv(e,n){return ec(4,2,e,n)}function nv(e,n){return ec(4,4,e,n)}function sv(e,n){if(typeof n=="function"){e=e();var i=n(e);return function(){typeof i=="function"?i():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function av(e,n,i){i=i!=null?i.concat([e]):null,ec(4,4,sv.bind(null,n,e),i)}function Yu(){}function iv(e,n){var i=zt();n=n===void 0?null:n;var l=i.memoizedState;return n!==null&&$u(n,l[1])?l[0]:(i.memoizedState=[e,n],e)}function ov(e,n){var i=zt();n=n===void 0?null:n;var l=i.memoizedState;if(n!==null&&$u(n,l[1]))return l[0];if(l=e(),ji){Qt(!0);try{e()}finally{Qt(!1)}}return i.memoizedState=[l,n],l}function Ju(e,n,i){return i===void 0||(Zs&1073741824)!==0&&(Ye&261930)===0?e.memoizedState=n:(e.memoizedState=i,e=r0(),Be.lanes|=e,Ma|=e,i)}function rv(e,n,i,l){return An(i,n)?i:ho.current!==null?(e=Ju(e,i,l),An(e,n)||(Yt=!0),e):(Zs&42)===0||(Zs&1073741824)!==0&&(Ye&261930)===0?(Yt=!0,e.memoizedState=i):(e=r0(),Be.lanes|=e,Ma|=e,n)}function lv(e,n,i,l,f){var h=B.p;B.p=h!==0&&8>h?h:8;var S=$.T,N={};$.T=N,Qu(e,!1,n,i);try{var R=f(),F=$.S;if(F!==null&&F(N,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var Q=xS(R,l);_r(e,n,Q,Ln(e))}else _r(e,n,l,Ln(e))}catch(ae){_r(e,n,{then:function(){},status:"rejected",reason:ae},Ln())}finally{B.p=h,S!==null&&N.types!==null&&(S.types=N.types),$.T=S}}function NS(){}function Wu(e,n,i,l){if(e.tag!==5)throw Error(r(476));var f=cv(e).queue;lv(e,f,n,se,i===null?NS:function(){return dv(e),i(l)})}function cv(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:se,baseState:se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ys,lastRenderedState:se},next:null};var i={};return n.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ys,lastRenderedState:i},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function dv(e){var n=cv(e);n.next===null&&(n=e.alternate.memoizedState),_r(e,n.next.queue,{},Ln())}function Xu(){return un(Br)}function uv(){return zt().memoizedState}function fv(){return zt().memoizedState}function CS(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var i=Ln();e=Ta(i);var l=Na(n,e,i);l!==null&&(En(l,n,i),hr(l,n,i)),n={cache:Nu()},e.payload=n;return}n=n.return}}function ES(e,n,i){var l=Ln();i={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},tc(e)?mv(n,i):(i=gu(e,n,i,l),i!==null&&(En(i,e,l),hv(i,n,l)))}function pv(e,n,i){var l=Ln();_r(e,n,i,l)}function _r(e,n,i,l){var f={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(tc(e))mv(n,f);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var S=n.lastRenderedState,N=h(S,i);if(f.hasEagerState=!0,f.eagerState=N,An(N,S))return Ol(e,n,f,0),gt===null&&Il(),!1}catch{}finally{}if(i=gu(e,n,f,l),i!==null)return En(i,e,l),hv(i,n,l),!0}return!1}function Qu(e,n,i,l){if(l={lane:2,revertLane:Mf(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},tc(e)){if(n)throw Error(r(479))}else n=gu(e,i,l,2),n!==null&&En(n,e,2)}function tc(e){var n=e.alternate;return e===Be||n!==null&&n===Be}function mv(e,n){go=Zl=!0;var i=e.pending;i===null?n.next=n:(n.next=i.next,i.next=n),e.pending=n}function hv(e,n,i){if((i&4194048)!==0){var l=n.lanes;l&=e.pendingLanes,i|=l,n.lanes=i,ue(e,i)}}var xr={readContext:un,use:Wl,useCallback:Rt,useContext:Rt,useEffect:Rt,useImperativeHandle:Rt,useLayoutEffect:Rt,useInsertionEffect:Rt,useMemo:Rt,useReducer:Rt,useRef:Rt,useState:Rt,useDebugValue:Rt,useDeferredValue:Rt,useTransition:Rt,useSyncExternalStore:Rt,useId:Rt,useHostTransitionStatus:Rt,useFormState:Rt,useActionState:Rt,useOptimistic:Rt,useMemoCache:Rt,useCacheRefresh:Rt};xr.useEffectEvent=Rt;var gv={readContext:un,use:Wl,useCallback:function(e,n){return _n().memoizedState=[e,n===void 0?null:n],e},useContext:un,useEffect:Qg,useImperativeHandle:function(e,n,i){i=i!=null?i.concat([e]):null,Ql(4194308,4,sv.bind(null,n,e),i)},useLayoutEffect:function(e,n){return Ql(4194308,4,e,n)},useInsertionEffect:function(e,n){Ql(4,2,e,n)},useMemo:function(e,n){var i=_n();n=n===void 0?null:n;var l=e();if(ji){Qt(!0);try{e()}finally{Qt(!1)}}return i.memoizedState=[l,n],l},useReducer:function(e,n,i){var l=_n();if(i!==void 0){var f=i(n);if(ji){Qt(!0);try{i(n)}finally{Qt(!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=ES.bind(null,Be,e),[l.memoizedState,e]},useRef:function(e){var n=_n();return e={current:e},n.memoizedState=e},useState:function(e){e=Fu(e);var n=e.queue,i=pv.bind(null,Be,n);return n.dispatch=i,[e.memoizedState,i]},useDebugValue:Yu,useDeferredValue:function(e,n){var i=_n();return Ju(i,e,n)},useTransition:function(){var e=Fu(!1);return e=lv.bind(null,Be,e.queue,!0,!1),_n().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,i){var l=Be,f=_n();if(Xe){if(i===void 0)throw Error(r(407));i=i()}else{if(i=n(),gt===null)throw Error(r(349));(Ye&127)!==0||Bg(l,n,i)}f.memoizedState=i;var h={value:i,getSnapshot:n};return f.queue=h,Qg(zg.bind(null,l,h,e),[e]),l.flags|=2048,yo(9,{destroy:void 0},$g.bind(null,l,h,i,n),null),i},useId:function(){var e=_n(),n=gt.identifierPrefix;if(Xe){var i=Ts,l=ws;i=(l&~(1<<32-Gt(l)-1)).toString(32)+i,n="_"+n+"R_"+i,i=Yl++,0<i&&(n+="H"+i.toString(32)),n+="_"}else i=kS++,n="_"+n+"r_"+i.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Xu,useFormState:Zg,useActionState:Zg,useOptimistic:function(e){var n=_n();n.memoizedState=n.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=i,n=Qu.bind(null,Be,!0,i),i.dispatch=n,[e,n]},useMemoCache:Vu,useCacheRefresh:function(){return _n().memoizedState=CS.bind(null,Be)},useEffectEvent:function(e){var n=_n(),i={impl:e};return n.memoizedState=i,function(){if((rt&2)!==0)throw Error(r(440));return i.impl.apply(void 0,arguments)}}},ef={readContext:un,use:Wl,useCallback:iv,useContext:un,useEffect:Zu,useImperativeHandle:av,useInsertionEffect:tv,useLayoutEffect:nv,useMemo:ov,useReducer:Xl,useRef:Xg,useState:function(){return Xl(Ys)},useDebugValue:Yu,useDeferredValue:function(e,n){var i=zt();return rv(i,ft.memoizedState,e,n)},useTransition:function(){var e=Xl(Ys)[0],n=zt().memoizedState;return[typeof e=="boolean"?e:br(e),n]},useSyncExternalStore:Lg,useId:uv,useHostTransitionStatus:Xu,useFormState:Yg,useActionState:Yg,useOptimistic:function(e,n){var i=zt();return Ug(i,ft,e,n)},useMemoCache:Vu,useCacheRefresh:fv};ef.useEffectEvent=ev;var vv={readContext:un,use:Wl,useCallback:iv,useContext:un,useEffect:Zu,useImperativeHandle:av,useInsertionEffect:tv,useLayoutEffect:nv,useMemo:ov,useReducer:Gu,useRef:Xg,useState:function(){return Gu(Ys)},useDebugValue:Yu,useDeferredValue:function(e,n){var i=zt();return ft===null?Ju(i,e,n):rv(i,ft.memoizedState,e,n)},useTransition:function(){var e=Gu(Ys)[0],n=zt().memoizedState;return[typeof e=="boolean"?e:br(e),n]},useSyncExternalStore:Lg,useId:uv,useHostTransitionStatus:Xu,useFormState:Wg,useActionState:Wg,useOptimistic:function(e,n){var i=zt();return ft!==null?Ug(i,ft,e,n):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:Vu,useCacheRefresh:fv};vv.useEffectEvent=ev;function tf(e,n,i,l){n=e.memoizedState,i=i(l,n),i=i==null?n:_({},n,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var nf={enqueueSetState:function(e,n,i){e=e._reactInternals;var l=Ln(),f=Ta(l);f.payload=n,i!=null&&(f.callback=i),n=Na(e,f,l),n!==null&&(En(n,e,l),hr(n,e,l))},enqueueReplaceState:function(e,n,i){e=e._reactInternals;var l=Ln(),f=Ta(l);f.tag=1,f.payload=n,i!=null&&(f.callback=i),n=Na(e,f,l),n!==null&&(En(n,e,l),hr(n,e,l))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var i=Ln(),l=Ta(i);l.tag=2,n!=null&&(l.callback=n),n=Na(e,l,i),n!==null&&(En(n,e,i),hr(n,e,i))}};function yv(e,n,i,l,f,h,S){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,h,S):n.prototype&&n.prototype.isPureReactComponent?!rr(i,l)||!rr(f,h):!0}function bv(e,n,i,l){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(i,l),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(i,l),n.state!==e&&nf.enqueueReplaceState(n,n.state,null)}function wi(e,n){var i=n;if("ref"in n){i={};for(var l in n)l!=="ref"&&(i[l]=n[l])}if(e=e.defaultProps){i===n&&(i=_({},i));for(var f in e)i[f]===void 0&&(i[f]=e[f])}return i}function _v(e){Rl(e)}function xv(e){console.error(e)}function kv(e){Rl(e)}function nc(e,n){try{var i=e.onUncaughtError;i(n.value,{componentStack:n.stack})}catch(l){setTimeout(function(){throw l})}}function Sv(e,n,i){try{var l=e.onCaughtError;l(i.value,{componentStack:i.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function sf(e,n,i){return i=Ta(i),i.tag=3,i.payload={element:null},i.callback=function(){nc(e,n)},i}function jv(e){return e=Ta(e),e.tag=3,e}function wv(e,n,i,l){var f=i.type.getDerivedStateFromError;if(typeof f=="function"){var h=l.value;e.payload=function(){return f(h)},e.callback=function(){Sv(n,i,l)}}var S=i.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(e.callback=function(){Sv(n,i,l),typeof f!="function"&&(Ra===null?Ra=new Set([this]):Ra.add(this));var N=l.stack;this.componentDidCatch(l.value,{componentStack:N!==null?N:""})})}function AS(e,n,i,l,f){if(i.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(n=i.alternate,n!==null&&co(n,i,f,!0),i=Mn.current,i!==null){switch(i.tag){case 31:case 13:return Wn===null?mc():i.alternate===null&&It===0&&(It=3),i.flags&=-257,i.flags|=65536,i.lanes=f,l===Vl?i.flags|=16384:(n=i.updateQueue,n===null?i.updateQueue=new Set([l]):n.add(l),Ef(e,l,f)),!1;case 22:return i.flags|=65536,l===Vl?i.flags|=16384:(n=i.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([l])},i.updateQueue=n):(i=n.retryQueue,i===null?n.retryQueue=new Set([l]):i.add(l)),Ef(e,l,f)),!1}throw Error(r(435,i.tag))}return Ef(e,l,f),mc(),!1}if(Xe)return n=Mn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,l!==ku&&(e=Error(r(422),{cause:l}),dr(Kn(e,i)))):(l!==ku&&(n=Error(r(423),{cause:l}),dr(Kn(n,i))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,l=Kn(l,i),f=sf(e.stateNode,l,f),Ru(e,f),It!==4&&(It=2)),!1;var h=Error(r(520),{cause:l});if(h=Kn(h,i),Er===null?Er=[h]:Er.push(h),It!==4&&(It=2),n===null)return!0;l=Kn(l,i),i=n;do{switch(i.tag){case 3:return i.flags|=65536,e=f&-f,i.lanes|=e,e=sf(i.stateNode,l,e),Ru(i,e),!1;case 1:if(n=i.type,h=i.stateNode,(i.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Ra===null||!Ra.has(h))))return i.flags|=65536,f&=-f,i.lanes|=f,f=jv(f),wv(f,e,i,l),Ru(i,f),!1}i=i.return}while(i!==null);return!1}var af=Error(r(461)),Yt=!1;function fn(e,n,i,l){n.child=e===null?Eg(n,null,i,l):Si(n,e.child,i,l)}function Tv(e,n,i,l,f){i=i.render;var h=n.ref;if("ref"in l){var S={};for(var N in l)N!=="ref"&&(S[N]=l[N])}else S=l;return bi(n),l=zu(e,n,i,S,h,f),N=Hu(),e!==null&&!Yt?(Pu(e,n,f),Js(e,n,f)):(Xe&&N&&_u(n),n.flags|=1,fn(e,n,l,f),n.child)}function Nv(e,n,i,l,f){if(e===null){var h=i.type;return typeof h=="function"&&!vu(h)&&h.defaultProps===void 0&&i.compare===null?(n.tag=15,n.type=h,Cv(e,n,h,l,f)):(e=Bl(i.type,null,l,n,n.mode,f),e.ref=n.ref,e.return=n,n.child=e)}if(h=e.child,!pf(e,f)){var S=h.memoizedProps;if(i=i.compare,i=i!==null?i:rr,i(S,l)&&e.ref===n.ref)return Js(e,n,f)}return n.flags|=1,e=qs(h,l),e.ref=n.ref,e.return=n,n.child=e}function Cv(e,n,i,l,f){if(e!==null){var h=e.memoizedProps;if(rr(h,l)&&e.ref===n.ref)if(Yt=!1,n.pendingProps=l=h,pf(e,f))(e.flags&131072)!==0&&(Yt=!0);else return n.lanes=e.lanes,Js(e,n,f)}return of(e,n,i,l,f)}function Ev(e,n,i,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|i:i,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 Av(e,n,h,i,l)}if((i&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Pl(n,h!==null?h.cachePool:null),h!==null?Mg(n,h):Ou(),Rg(n);else return l=n.lanes=536870912,Av(e,n,h!==null?h.baseLanes|i:i,i,l)}else h!==null?(Pl(n,h.cachePool),Mg(n,h),Ea(),n.memoizedState=null):(e!==null&&Pl(n,null),Ou(),Ea());return fn(e,n,f,i),n.child}function kr(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Av(e,n,i,l,f){var h=Eu();return h=h===null?null:{parent:Kt._currentValue,pool:h},n.memoizedState={baseLanes:i,cachePool:h},e!==null&&Pl(n,null),Ou(),Rg(n),e!==null&&co(e,n,l,!0),n.childLanes=f,null}function sc(e,n){return n=ic({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function Dv(e,n,i){return Si(n,e.child,null,i),e=sc(n,n.pendingProps),e.flags|=2,Rn(n),n.memoizedState=null,e}function DS(e,n,i){var l=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Xe){if(l.mode==="hidden")return e=sc(n,l),n.lanes=536870912,kr(null,e);if(Bu(n),(e=bt)?(e=V0(e,Jn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:xa!==null?{id:ws,overflow:Ts}:null,retryLane:536870912,hydrationErrors:null},i=mg(e),i.return=n,n.child=i,dn=n,bt=null)):e=null,e===null)throw Sa(n);return n.lanes=536870912,null}return sc(n,l)}var h=e.memoizedState;if(h!==null){var S=h.dehydrated;if(Bu(n),f)if(n.flags&256)n.flags&=-257,n=Dv(e,n,i);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(r(558));else if(Yt||co(e,n,i,!1),f=(i&e.childLanes)!==0,Yt||f){if(l=gt,l!==null&&(S=me(l,i),S!==0&&S!==h.retryLane))throw h.retryLane=S,hi(e,S),En(l,e,S),af;mc(),n=Dv(e,n,i)}else e=h.treeContext,bt=Xn(S.nextSibling),dn=n,Xe=!0,ka=null,Jn=!1,e!==null&&vg(n,e),n=sc(n,l),n.flags|=4096;return n}return e=qs(e.child,{mode:l.mode,children:l.children}),e.ref=n.ref,n.child=e,e.return=n,e}function ac(e,n){var i=n.ref;if(i===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(r(284));(e===null||e.ref!==i)&&(n.flags|=4194816)}}function of(e,n,i,l,f){return bi(n),i=zu(e,n,i,l,void 0,f),l=Hu(),e!==null&&!Yt?(Pu(e,n,f),Js(e,n,f)):(Xe&&l&&_u(n),n.flags|=1,fn(e,n,i,f),n.child)}function Mv(e,n,i,l,f,h){return bi(n),n.updateQueue=null,i=Og(n,l,i,f),Ig(e),l=Hu(),e!==null&&!Yt?(Pu(e,n,h),Js(e,n,h)):(Xe&&l&&_u(n),n.flags|=1,fn(e,n,i,h),n.child)}function Rv(e,n,i,l,f){if(bi(n),n.stateNode===null){var h=io,S=i.contextType;typeof S=="object"&&S!==null&&(h=un(S)),h=new i(l,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=nf,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=l,h.state=n.memoizedState,h.refs={},Du(n),S=i.contextType,h.context=typeof S=="object"&&S!==null?un(S):io,h.state=n.memoizedState,S=i.getDerivedStateFromProps,typeof S=="function"&&(tf(n,i,S,l),h.state=n.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(S=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),S!==h.state&&nf.enqueueReplaceState(h,h.state,null),vr(n,l,h,f),gr(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),l=!0}else if(e===null){h=n.stateNode;var N=n.memoizedProps,R=wi(i,N);h.props=R;var F=h.context,Q=i.contextType;S=io,typeof Q=="object"&&Q!==null&&(S=un(Q));var ae=i.getDerivedStateFromProps;Q=typeof ae=="function"||typeof h.getSnapshotBeforeUpdate=="function",N=n.pendingProps!==N,Q||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(N||F!==S)&&bv(n,h,l,S),wa=!1;var K=n.memoizedState;h.state=K,vr(n,l,h,f),gr(),F=n.memoizedState,N||K!==F||wa?(typeof ae=="function"&&(tf(n,i,ae,l),F=n.memoizedState),(R=wa||yv(n,i,R,l,K,F,S))?(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=F),h.props=l,h.state=F,h.context=S,l=R):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),l=!1)}else{h=n.stateNode,Mu(e,n),S=n.memoizedProps,Q=wi(i,S),h.props=Q,ae=n.pendingProps,K=h.context,F=i.contextType,R=io,typeof F=="object"&&F!==null&&(R=un(F)),N=i.getDerivedStateFromProps,(F=typeof N=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(S!==ae||K!==R)&&bv(n,h,l,R),wa=!1,K=n.memoizedState,h.state=K,vr(n,l,h,f),gr();var Z=n.memoizedState;S!==ae||K!==Z||wa||e!==null&&e.dependencies!==null&&zl(e.dependencies)?(typeof N=="function"&&(tf(n,i,N,l),Z=n.memoizedState),(Q=wa||yv(n,i,Q,l,K,Z,R)||e!==null&&e.dependencies!==null&&zl(e.dependencies))?(F||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"||S===e.memoizedProps&&K===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&K===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"||S===e.memoizedProps&&K===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&K===e.memoizedState||(n.flags|=1024),l=!1)}return h=l,ac(e,n),l=(n.flags&128)!==0,h||l?(h=n.stateNode,i=l&&typeof i.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,e!==null&&l?(n.child=Si(n,e.child,null,f),n.child=Si(n,null,i,f)):fn(e,n,i,f),n.memoizedState=h.state,e=n.child):e=Js(e,n,f),e}function Iv(e,n,i,l){return vi(),n.flags|=256,fn(e,n,i,l),n.child}var rf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function lf(e){return{baseLanes:e,cachePool:Sg()}}function cf(e,n,i){return e=e!==null?e.childLanes&~i:0,n&&(e|=On),e}function Ov(e,n,i){var l=n.pendingProps,f=!1,h=(n.flags&128)!==0,S;if((S=h)||(S=e!==null&&e.memoizedState===null?!1:($t.current&2)!==0),S&&(f=!0,n.flags&=-129),S=(n.flags&32)!==0,n.flags&=-33,e===null){if(Xe){if(f?Ca(n):Ea(),(e=bt)?(e=V0(e,Jn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:xa!==null?{id:ws,overflow:Ts}:null,retryLane:536870912,hydrationErrors:null},i=mg(e),i.return=n,n.child=i,dn=n,bt=null)):e=null,e===null)throw Sa(n);return Gf(e)?n.lanes=32:n.lanes=536870912,null}var N=l.children;return l=l.fallback,f?(Ea(),f=n.mode,N=ic({mode:"hidden",children:N},f),l=gi(l,f,i,null),N.return=n,l.return=n,N.sibling=l,n.child=N,l=n.child,l.memoizedState=lf(i),l.childLanes=cf(e,S,i),n.memoizedState=rf,kr(null,l)):(Ca(n),df(n,N))}var R=e.memoizedState;if(R!==null&&(N=R.dehydrated,N!==null)){if(h)n.flags&256?(Ca(n),n.flags&=-257,n=uf(e,n,i)):n.memoizedState!==null?(Ea(),n.child=e.child,n.flags|=128,n=null):(Ea(),N=l.fallback,f=n.mode,l=ic({mode:"visible",children:l.children},f),N=gi(N,f,i,null),N.flags|=2,l.return=n,N.return=n,l.sibling=N,n.child=l,Si(n,e.child,null,i),l=n.child,l.memoizedState=lf(i),l.childLanes=cf(e,S,i),n.memoizedState=rf,n=kr(null,l));else if(Ca(n),Gf(N)){if(S=N.nextSibling&&N.nextSibling.dataset,S)var F=S.dgst;S=F,l=Error(r(419)),l.stack="",l.digest=S,dr({value:l,source:null,stack:null}),n=uf(e,n,i)}else if(Yt||co(e,n,i,!1),S=(i&e.childLanes)!==0,Yt||S){if(S=gt,S!==null&&(l=me(S,i),l!==0&&l!==R.retryLane))throw R.retryLane=l,hi(e,l),En(S,e,l),af;qf(N)||mc(),n=uf(e,n,i)}else qf(N)?(n.flags|=192,n.child=e.child,n=null):(e=R.treeContext,bt=Xn(N.nextSibling),dn=n,Xe=!0,ka=null,Jn=!1,e!==null&&vg(n,e),n=df(n,l.children),n.flags|=4096);return n}return f?(Ea(),N=l.fallback,f=n.mode,R=e.child,F=R.sibling,l=qs(R,{mode:"hidden",children:l.children}),l.subtreeFlags=R.subtreeFlags&65011712,F!==null?N=qs(F,N):(N=gi(N,f,i,null),N.flags|=2),N.return=n,l.return=n,l.sibling=N,n.child=l,kr(null,l),l=n.child,N=e.child.memoizedState,N===null?N=lf(i):(f=N.cachePool,f!==null?(R=Kt._currentValue,f=f.parent!==R?{parent:R,pool:R}:f):f=Sg(),N={baseLanes:N.baseLanes|i,cachePool:f}),l.memoizedState=N,l.childLanes=cf(e,S,i),n.memoizedState=rf,kr(e.child,l)):(Ca(n),i=e.child,e=i.sibling,i=qs(i,{mode:"visible",children:l.children}),i.return=n,i.sibling=null,e!==null&&(S=n.deletions,S===null?(n.deletions=[e],n.flags|=16):S.push(e)),n.child=i,n.memoizedState=null,i)}function df(e,n){return n=ic({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function ic(e,n){return e=Dn(22,e,null,n),e.lanes=0,e}function uf(e,n,i){return Si(n,e.child,null,i),e=df(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Lv(e,n,i){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n),wu(e.return,n,i)}function ff(e,n,i,l,f,h){var S=e.memoizedState;S===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:f,treeForkCount:h}:(S.isBackwards=n,S.rendering=null,S.renderingStartTime=0,S.last=l,S.tail=i,S.tailMode=f,S.treeForkCount=h)}function Bv(e,n,i){var l=n.pendingProps,f=l.revealOrder,h=l.tail;l=l.children;var S=$t.current,N=(S&2)!==0;if(N?(S=S&1|2,n.flags|=128):S&=1,ge($t,S),fn(e,n,l,i),l=Xe?cr:0,!N&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Lv(e,i,n);else if(e.tag===19)Lv(e,i,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(i=n.child,f=null;i!==null;)e=i.alternate,e!==null&&Kl(e)===null&&(f=i),i=i.sibling;i=f,i===null?(f=n.child,n.child=null):(f=i.sibling,i.sibling=null),ff(n,!1,f,i,h,l);break;case"backwards":case"unstable_legacy-backwards":for(i=null,f=n.child,n.child=null;f!==null;){if(e=f.alternate,e!==null&&Kl(e)===null){n.child=f;break}e=f.sibling,f.sibling=i,i=f,f=e}ff(n,!0,i,null,h,l);break;case"together":ff(n,!1,null,null,void 0,l);break;default:n.memoizedState=null}return n.child}function Js(e,n,i){if(e!==null&&(n.dependencies=e.dependencies),Ma|=n.lanes,(i&n.childLanes)===0)if(e!==null){if(co(e,n,i,!1),(i&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,i=qs(e,e.pendingProps),n.child=i,i.return=n;e.sibling!==null;)e=e.sibling,i=i.sibling=qs(e,e.pendingProps),i.return=n;i.sibling=null}return n.child}function pf(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&zl(e)))}function MS(e,n,i){switch(n.tag){case 3:qe(n,n.stateNode.containerInfo),ja(n,Kt,e.memoizedState.cache),vi();break;case 27:case 5:Wt(n);break;case 4:qe(n,n.stateNode.containerInfo);break;case 10:ja(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Bu(n),null;break;case 13:var l=n.memoizedState;if(l!==null)return l.dehydrated!==null?(Ca(n),n.flags|=128,null):(i&n.child.childLanes)!==0?Ov(e,n,i):(Ca(n),e=Js(e,n,i),e!==null?e.sibling:null);Ca(n);break;case 19:var f=(e.flags&128)!==0;if(l=(i&n.childLanes)!==0,l||(co(e,n,i,!1),l=(i&n.childLanes)!==0),f){if(l)return Bv(e,n,i);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),ge($t,$t.current),l)break;return null;case 22:return n.lanes=0,Ev(e,n,i,n.pendingProps);case 24:ja(n,Kt,e.memoizedState.cache)}return Js(e,n,i)}function $v(e,n,i){if(e!==null)if(e.memoizedProps!==n.pendingProps)Yt=!0;else{if(!pf(e,i)&&(n.flags&128)===0)return Yt=!1,MS(e,n,i);Yt=(e.flags&131072)!==0}else Yt=!1,Xe&&(n.flags&1048576)!==0&&gg(n,cr,n.index);switch(n.lanes=0,n.tag){case 16:e:{var l=n.pendingProps;if(e=xi(n.elementType),n.type=e,typeof e=="function")vu(e)?(l=wi(e,l),n.tag=1,n=Rv(null,n,e,l,i)):(n.tag=0,n=of(null,n,e,l,i));else{if(e!=null){var f=e.$$typeof;if(f===O){n.tag=11,n=Tv(null,n,e,l,i);break e}else if(f===L){n.tag=14,n=Nv(null,n,e,l,i);break e}}throw n=W(e)||e,Error(r(306,n,""))}}return n;case 0:return of(e,n,n.type,n.pendingProps,i);case 1:return l=n.type,f=wi(l,n.pendingProps),Rv(e,n,l,f,i);case 3:e:{if(qe(n,n.stateNode.containerInfo),e===null)throw Error(r(387));l=n.pendingProps;var h=n.memoizedState;f=h.element,Mu(e,n),vr(n,l,null,i);var S=n.memoizedState;if(l=S.cache,ja(n,Kt,l),l!==h.cache&&Tu(n,[Kt],i,!0),gr(),l=S.element,h.isDehydrated)if(h={element:l,isDehydrated:!1,cache:S.cache},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){n=Iv(e,n,l,i);break e}else if(l!==f){f=Kn(Error(r(424)),n),dr(f),n=Iv(e,n,l,i);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(bt=Xn(e.firstChild),dn=n,Xe=!0,ka=null,Jn=!0,i=Eg(n,null,l,i),n.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(vi(),l===f){n=Js(e,n,i);break e}fn(e,n,l,i)}n=n.child}return n;case 26:return ac(e,n),e===null?(i=Y0(n.type,null,n.pendingProps,null))?n.memoizedState=i:Xe||(i=n.type,e=n.pendingProps,l=xc(wt.current).createElement(i),l[Ie]=n,l[Me]=e,pn(l,i,e),rn(l),n.stateNode=l):n.memoizedState=Y0(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return Wt(n),e===null&&Xe&&(l=n.stateNode=F0(n.type,n.pendingProps,wt.current),dn=n,Jn=!0,f=bt,Ba(n.type)?(Ff=f,bt=Xn(l.firstChild)):bt=f),fn(e,n,n.pendingProps.children,i),ac(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Xe&&((f=l=bt)&&(l=l2(l,n.type,n.pendingProps,Jn),l!==null?(n.stateNode=l,dn=n,bt=Xn(l.firstChild),Jn=!1,f=!0):f=!1),f||Sa(n)),Wt(n),f=n.type,h=n.pendingProps,S=e!==null?e.memoizedProps:null,l=h.children,Pf(f,h)?l=null:S!==null&&Pf(f,S)&&(n.flags|=32),n.memoizedState!==null&&(f=zu(e,n,SS,null,null,i),Br._currentValue=f),ac(e,n),fn(e,n,l,i),n.child;case 6:return e===null&&Xe&&((e=i=bt)&&(i=c2(i,n.pendingProps,Jn),i!==null?(n.stateNode=i,dn=n,bt=null,e=!0):e=!1),e||Sa(n)),null;case 13:return Ov(e,n,i);case 4:return qe(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=Si(n,null,l,i):fn(e,n,l,i),n.child;case 11:return Tv(e,n,n.type,n.pendingProps,i);case 7:return fn(e,n,n.pendingProps,i),n.child;case 8:return fn(e,n,n.pendingProps.children,i),n.child;case 12:return fn(e,n,n.pendingProps.children,i),n.child;case 10:return l=n.pendingProps,ja(n,n.type,l.value),fn(e,n,l.children,i),n.child;case 9:return f=n.type._context,l=n.pendingProps.children,bi(n),f=un(f),l=l(f),n.flags|=1,fn(e,n,l,i),n.child;case 14:return Nv(e,n,n.type,n.pendingProps,i);case 15:return Cv(e,n,n.type,n.pendingProps,i);case 19:return Bv(e,n,i);case 31:return DS(e,n,i);case 22:return Ev(e,n,i,n.pendingProps);case 24:return bi(n),l=un(Kt),e===null?(f=Eu(),f===null&&(f=gt,h=Nu(),f.pooledCache=h,h.refCount++,h!==null&&(f.pooledCacheLanes|=i),f=h),n.memoizedState={parent:l,cache:f},Du(n),ja(n,Kt,f)):((e.lanes&i)!==0&&(Mu(e,n),vr(n,null,null,i),gr()),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),ja(n,Kt,l)):(l=h.cache,ja(n,Kt,l),l!==f.cache&&Tu(n,[Kt],i,!0))),fn(e,n,n.pendingProps.children,i),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function Ws(e){e.flags|=4}function mf(e,n,i,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(u0())e.flags|=8192;else throw ki=Vl,Au}else e.flags&=-16777217}function zv(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ey(n))if(u0())e.flags|=8192;else throw ki=Vl,Au}function oc(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Xo():536870912,e.lanes|=n,ko|=n)}function Sr(e,n){if(!Xe)switch(e.tailMode){case"hidden":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function _t(e){var n=e.alternate!==null&&e.alternate.child===e.child,i=0,l=0;if(n)for(var f=e.child;f!==null;)i|=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;)i|=f.lanes|f.childLanes,l|=f.subtreeFlags,l|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=l,e.childLanes=i,n}function RS(e,n,i){var l=n.pendingProps;switch(xu(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _t(n),null;case 1:return _t(n),null;case 3:return i=n.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),Ks(Kt),Bt(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(lo(n)?Ws(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Su())),_t(n),null;case 26:var f=n.type,h=n.memoizedState;return e===null?(Ws(n),h!==null?(_t(n),zv(n,h)):(_t(n),mf(n,f,null,l,i))):h?h!==e.memoizedState?(Ws(n),_t(n),zv(n,h)):(_t(n),n.flags&=-16777217):(e=e.memoizedProps,e!==l&&Ws(n),_t(n),mf(n,f,e,l,i)),null;case 27:if(de(n),i=wt.current,f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==l&&Ws(n);else{if(!l){if(n.stateNode===null)throw Error(r(166));return _t(n),null}e=Ae.current,lo(n)?yg(n):(e=F0(f,l,i),n.stateNode=e,Ws(n))}return _t(n),null;case 5:if(de(n),f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==l&&Ws(n);else{if(!l){if(n.stateNode===null)throw Error(r(166));return _t(n),null}if(h=Ae.current,lo(n))yg(n);else{var S=xc(wt.current);switch(h){case 1:h=S.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:h=S.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":h=S.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":h=S.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":h=S.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof l.is=="string"?S.createElement("select",{is:l.is}):S.createElement("select"),l.multiple?h.multiple=!0:l.size&&(h.size=l.size);break;default:h=typeof l.is=="string"?S.createElement(f,{is:l.is}):S.createElement(f)}}h[Ie]=n,h[Me]=l;e:for(S=n.child;S!==null;){if(S.tag===5||S.tag===6)h.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===n)break e;for(;S.sibling===null;){if(S.return===null||S.return===n)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}n.stateNode=h;e:switch(pn(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&&Ws(n)}}return _t(n),mf(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,i),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==l&&Ws(n);else{if(typeof l!="string"&&n.stateNode===null)throw Error(r(166));if(e=wt.current,lo(n)){if(e=n.stateNode,i=n.memoizedProps,l=null,f=dn,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}e[Ie]=n,e=!!(e.nodeValue===i||l!==null&&l.suppressHydrationWarning===!0||O0(e.nodeValue,i)),e||Sa(n,!0)}else e=xc(e).createTextNode(l),e[Ie]=n,n.stateNode=e}return _t(n),null;case 31:if(i=n.memoizedState,e===null||e.memoizedState!==null){if(l=lo(n),i!==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[Ie]=n}else vi(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;_t(n),e=!1}else i=Su(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return n.flags&256?(Rn(n),n):(Rn(n),null);if((n.flags&128)!==0)throw Error(r(558))}return _t(n),null;case 13:if(l=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=lo(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[Ie]=n}else vi(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;_t(n),f=!1}else f=Su(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(Rn(n),n):(Rn(n),null)}return Rn(n),(n.flags&128)!==0?(n.lanes=i,n):(i=l!==null,e=e!==null&&e.memoizedState!==null,i&&(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)),i!==e&&i&&(n.child.flags|=8192),oc(n,n.updateQueue),_t(n),null);case 4:return Bt(),e===null&&Lf(n.stateNode.containerInfo),_t(n),null;case 10:return Ks(n.type),_t(n),null;case 19:if(fe($t),l=n.memoizedState,l===null)return _t(n),null;if(f=(n.flags&128)!==0,h=l.rendering,h===null)if(f)Sr(l,!1);else{if(It!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(h=Kl(e),h!==null){for(n.flags|=128,Sr(l,!1),e=h.updateQueue,n.updateQueue=e,oc(n,e),n.subtreeFlags=0,e=i,i=n.child;i!==null;)pg(i,e),i=i.sibling;return ge($t,$t.current&1|2),Xe&&Gs(n,l.treeForkCount),n.child}e=e.sibling}l.tail!==null&&qt()>uc&&(n.flags|=128,f=!0,Sr(l,!1),n.lanes=4194304)}else{if(!f)if(e=Kl(h),e!==null){if(n.flags|=128,f=!0,e=e.updateQueue,n.updateQueue=e,oc(n,e),Sr(l,!0),l.tail===null&&l.tailMode==="hidden"&&!h.alternate&&!Xe)return _t(n),null}else 2*qt()-l.renderingStartTime>uc&&i!==536870912&&(n.flags|=128,f=!0,Sr(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=qt(),e.sibling=null,i=$t.current,ge($t,f?i&1|2:i&1),Xe&&Gs(n,l.treeForkCount),e):(_t(n),null);case 22:case 23:return Rn(n),Lu(),l=n.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(n.flags|=8192):l&&(n.flags|=8192),l?(i&536870912)!==0&&(n.flags&128)===0&&(_t(n),n.subtreeFlags&6&&(n.flags|=8192)):_t(n),i=n.updateQueue,i!==null&&oc(n,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),l=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),l!==i&&(n.flags|=2048),e!==null&&fe(_i),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),n.memoizedState.cache!==i&&(n.flags|=2048),Ks(Kt),_t(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function IS(e,n){switch(xu(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Ks(Kt),Bt(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return de(n),null;case 31:if(n.memoizedState!==null){if(Rn(n),n.alternate===null)throw Error(r(340));vi()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(Rn(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(r(340));vi()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return fe($t),null;case 4:return Bt(),null;case 10:return Ks(n.type),null;case 22:case 23:return Rn(n),Lu(),e!==null&&fe(_i),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Ks(Kt),null;case 25:return null;default:return null}}function Hv(e,n){switch(xu(n),n.tag){case 3:Ks(Kt),Bt();break;case 26:case 27:case 5:de(n);break;case 4:Bt();break;case 31:n.memoizedState!==null&&Rn(n);break;case 13:Rn(n);break;case 19:fe($t);break;case 10:Ks(n.type);break;case 22:case 23:Rn(n),Lu(),e!==null&&fe(_i);break;case 24:Ks(Kt)}}function jr(e,n){try{var i=n.updateQueue,l=i!==null?i.lastEffect:null;if(l!==null){var f=l.next;i=f;do{if((i.tag&e)===e){l=void 0;var h=i.create,S=i.inst;l=h(),S.destroy=l}i=i.next}while(i!==f)}}catch(N){dt(n,n.return,N)}}function Aa(e,n,i){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 S=l.inst,N=S.destroy;if(N!==void 0){S.destroy=void 0,f=n;var R=i,F=N;try{F()}catch(Q){dt(f,R,Q)}}}l=l.next}while(l!==h)}}catch(Q){dt(n,n.return,Q)}}function Pv(e){var n=e.updateQueue;if(n!==null){var i=e.stateNode;try{Dg(n,i)}catch(l){dt(e,e.return,l)}}}function Uv(e,n,i){i.props=wi(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(l){dt(e,n,l)}}function wr(e,n){try{var i=e.ref;if(i!==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 i=="function"?e.refCleanup=i(l):i.current=l}}catch(f){dt(e,n,f)}}function Ns(e,n){var i=e.ref,l=e.refCleanup;if(i!==null)if(typeof l=="function")try{l()}catch(f){dt(e,n,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(f){dt(e,n,f)}else i.current=null}function Vv(e){var n=e.type,i=e.memoizedProps,l=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":i.autoFocus&&l.focus();break e;case"img":i.src?l.src=i.src:i.srcSet&&(l.srcset=i.srcSet)}}catch(f){dt(e,e.return,f)}}function hf(e,n,i){try{var l=e.stateNode;n2(l,e.type,i,n),l[Me]=n}catch(f){dt(e,e.return,f)}}function qv(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ba(e.type)||e.tag===4}function gf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||qv(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&&Ba(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 vf(e,n,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,n):(n=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,n.appendChild(e),i=i._reactRootContainer,i!=null||n.onclick!==null||(n.onclick=Us));else if(l!==4&&(l===27&&Ba(e.type)&&(i=e.stateNode,n=null),e=e.child,e!==null))for(vf(e,n,i),e=e.sibling;e!==null;)vf(e,n,i),e=e.sibling}function rc(e,n,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?i.insertBefore(e,n):i.appendChild(e);else if(l!==4&&(l===27&&Ba(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(rc(e,n,i),e=e.sibling;e!==null;)rc(e,n,i),e=e.sibling}function Gv(e){var n=e.stateNode,i=e.memoizedProps;try{for(var l=e.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);pn(n,l,i),n[Ie]=e,n[Me]=i}catch(h){dt(e,e.return,h)}}var Xs=!1,Jt=!1,yf=!1,Fv=typeof WeakSet=="function"?WeakSet:Set,ln=null;function OS(e,n){if(e=e.containerInfo,zf=Cc,e=ag(e),du(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var f=l.anchorOffset,h=l.focusNode;l=l.focusOffset;try{i.nodeType,h.nodeType}catch{i=null;break e}var S=0,N=-1,R=-1,F=0,Q=0,ae=e,K=null;t:for(;;){for(var Z;ae!==i||f!==0&&ae.nodeType!==3||(N=S+f),ae!==h||l!==0&&ae.nodeType!==3||(R=S+l),ae.nodeType===3&&(S+=ae.nodeValue.length),(Z=ae.firstChild)!==null;)K=ae,ae=Z;for(;;){if(ae===e)break t;if(K===i&&++F===f&&(N=S),K===h&&++Q===l&&(R=S),(Z=ae.nextSibling)!==null)break;ae=K,K=ae.parentNode}ae=Z}i=N===-1||R===-1?null:{start:N,end:R}}else i=null}i=i||{start:0,end:0}}else i=null;for(Hf={focusedElem:e,selectionRange:i},Cc=!1,ln=n;ln!==null;)if(n=ln,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,ln=e;else for(;ln!==null;){switch(n=ln,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(i=0;i<e.length;i++)f=e[i],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,i=n,f=h.memoizedProps,h=h.memoizedState,l=i.stateNode;try{var xe=wi(i.type,f);e=l.getSnapshotBeforeUpdate(xe,h),l.__reactInternalSnapshotBeforeUpdate=e}catch(Ce){dt(i,i.return,Ce)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,i=e.nodeType,i===9)Vf(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Vf(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,ln=e;break}ln=n.return}}function Kv(e,n,i){var l=i.flags;switch(i.tag){case 0:case 11:case 15:ea(e,i),l&4&&jr(5,i);break;case 1:if(ea(e,i),l&4)if(e=i.stateNode,n===null)try{e.componentDidMount()}catch(S){dt(i,i.return,S)}else{var f=wi(i.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(f,n,e.__reactInternalSnapshotBeforeUpdate)}catch(S){dt(i,i.return,S)}}l&64&&Pv(i),l&512&&wr(i,i.return);break;case 3:if(ea(e,i),l&64&&(e=i.updateQueue,e!==null)){if(n=null,i.child!==null)switch(i.child.tag){case 27:case 5:n=i.child.stateNode;break;case 1:n=i.child.stateNode}try{Dg(e,n)}catch(S){dt(i,i.return,S)}}break;case 27:n===null&&l&4&&Gv(i);case 26:case 5:ea(e,i),n===null&&l&4&&Vv(i),l&512&&wr(i,i.return);break;case 12:ea(e,i);break;case 31:ea(e,i),l&4&&Jv(e,i);break;case 13:ea(e,i),l&4&&Wv(e,i),l&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=qS.bind(null,i),d2(e,i))));break;case 22:if(l=i.memoizedState!==null||Xs,!l){n=n!==null&&n.memoizedState!==null||Jt,f=Xs;var h=Jt;Xs=l,(Jt=n)&&!h?ta(e,i,(i.subtreeFlags&8772)!==0):ea(e,i),Xs=f,Jt=h}break;case 30:break;default:ea(e,i)}}function Zv(e){var n=e.alternate;n!==null&&(e.alternate=null,Zv(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&Kd(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,wn=!1;function Qs(e,n,i){for(i=i.child;i!==null;)Yv(e,n,i),i=i.sibling}function Yv(e,n,i){if(ht&&typeof ht.onCommitFiberUnmount=="function")try{ht.onCommitFiberUnmount(ze,i)}catch{}switch(i.tag){case 26:Jt||Ns(i,n),Qs(e,n,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Jt||Ns(i,n);var l=Tt,f=wn;Ba(i.type)&&(Tt=i.stateNode,wn=!1),Qs(e,n,i),Ir(i.stateNode),Tt=l,wn=f;break;case 5:Jt||Ns(i,n);case 6:if(l=Tt,f=wn,Tt=null,Qs(e,n,i),Tt=l,wn=f,Tt!==null)if(wn)try{(Tt.nodeType===9?Tt.body:Tt.nodeName==="HTML"?Tt.ownerDocument.body:Tt).removeChild(i.stateNode)}catch(h){dt(i,n,h)}else try{Tt.removeChild(i.stateNode)}catch(h){dt(i,n,h)}break;case 18:Tt!==null&&(wn?(e=Tt,P0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Ao(e)):P0(Tt,i.stateNode));break;case 4:l=Tt,f=wn,Tt=i.stateNode.containerInfo,wn=!0,Qs(e,n,i),Tt=l,wn=f;break;case 0:case 11:case 14:case 15:Aa(2,i,n),Jt||Aa(4,i,n),Qs(e,n,i);break;case 1:Jt||(Ns(i,n),l=i.stateNode,typeof l.componentWillUnmount=="function"&&Uv(i,n,l)),Qs(e,n,i);break;case 21:Qs(e,n,i);break;case 22:Jt=(l=Jt)||i.memoizedState!==null,Qs(e,n,i),Jt=l;break;default:Qs(e,n,i)}}function Jv(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ao(e)}catch(i){dt(n,n.return,i)}}}function Wv(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ao(e)}catch(i){dt(n,n.return,i)}}function LS(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new Fv),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new Fv),n;default:throw Error(r(435,e.tag))}}function lc(e,n){var i=LS(e);n.forEach(function(l){if(!i.has(l)){i.add(l);var f=GS.bind(null,e,l);l.then(f,f)}})}function Tn(e,n){var i=n.deletions;if(i!==null)for(var l=0;l<i.length;l++){var f=i[l],h=e,S=n,N=S;e:for(;N!==null;){switch(N.tag){case 27:if(Ba(N.type)){Tt=N.stateNode,wn=!1;break e}break;case 5:Tt=N.stateNode,wn=!1;break e;case 3:case 4:Tt=N.stateNode.containerInfo,wn=!0;break e}N=N.return}if(Tt===null)throw Error(r(160));Yv(h,S,f),Tt=null,wn=!1,h=f.alternate,h!==null&&(h.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Xv(n,e),n=n.sibling}var fs=null;function Xv(e,n){var i=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Tn(n,e),Nn(e),l&4&&(Aa(3,e,e.return),jr(3,e),Aa(5,e,e.return));break;case 1:Tn(n,e),Nn(e),l&512&&(Jt||i===null||Ns(i,i.return)),l&64&&Xs&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?l:i.concat(l))));break;case 26:var f=fs;if(Tn(n,e),Nn(e),l&512&&(Jt||i===null||Ns(i,i.return)),l&4){var h=i!==null?i.memoizedState:null;if(l=e.memoizedState,i===null)if(l===null)if(e.stateNode===null){e:{l=e.type,i=e.memoizedProps,f=f.ownerDocument||f;t:switch(l){case"title":h=f.getElementsByTagName("title")[0],(!h||h[Hs]||h[Ie]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=f.createElement(l),f.head.insertBefore(h,f.querySelector("head > title"))),pn(h,l,i),h[Ie]=e,rn(h),l=h;break e;case"link":var S=X0("link","href",f).get(l+(i.href||""));if(S){for(var N=0;N<S.length;N++)if(h=S[N],h.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&h.getAttribute("rel")===(i.rel==null?null:i.rel)&&h.getAttribute("title")===(i.title==null?null:i.title)&&h.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){S.splice(N,1);break t}}h=f.createElement(l),pn(h,l,i),f.head.appendChild(h);break;case"meta":if(S=X0("meta","content",f).get(l+(i.content||""))){for(N=0;N<S.length;N++)if(h=S[N],h.getAttribute("content")===(i.content==null?null:""+i.content)&&h.getAttribute("name")===(i.name==null?null:i.name)&&h.getAttribute("property")===(i.property==null?null:i.property)&&h.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&h.getAttribute("charset")===(i.charSet==null?null:i.charSet)){S.splice(N,1);break t}}h=f.createElement(l),pn(h,l,i),f.head.appendChild(h);break;default:throw Error(r(468,l))}h[Ie]=e,rn(h),l=h}e.stateNode=l}else Q0(f,e.type,e.stateNode);else e.stateNode=W0(f,l,e.memoizedProps);else h!==l?(h===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):h.count--,l===null?Q0(f,e.type,e.stateNode):W0(f,l,e.memoizedProps)):l===null&&e.stateNode!==null&&hf(e,e.memoizedProps,i.memoizedProps)}break;case 27:Tn(n,e),Nn(e),l&512&&(Jt||i===null||Ns(i,i.return)),i!==null&&l&4&&hf(e,e.memoizedProps,i.memoizedProps);break;case 5:if(Tn(n,e),Nn(e),l&512&&(Jt||i===null||Ns(i,i.return)),e.flags&32){f=e.stateNode;try{Xi(f,"")}catch(xe){dt(e,e.return,xe)}}l&4&&e.stateNode!=null&&(f=e.memoizedProps,hf(e,f,i!==null?i.memoizedProps:f)),l&1024&&(yf=!0);break;case 6:if(Tn(n,e),Nn(e),l&4){if(e.stateNode===null)throw Error(r(162));l=e.memoizedProps,i=e.stateNode;try{i.nodeValue=l}catch(xe){dt(e,e.return,xe)}}break;case 3:if(jc=null,f=fs,fs=kc(n.containerInfo),Tn(n,e),fs=f,Nn(e),l&4&&i!==null&&i.memoizedState.isDehydrated)try{Ao(n.containerInfo)}catch(xe){dt(e,e.return,xe)}yf&&(yf=!1,Qv(e));break;case 4:l=fs,fs=kc(e.stateNode.containerInfo),Tn(n,e),Nn(e),fs=l;break;case 12:Tn(n,e),Nn(e);break;case 31:Tn(n,e),Nn(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,lc(e,l)));break;case 13:Tn(n,e),Nn(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(dc=qt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,lc(e,l)));break;case 22:f=e.memoizedState!==null;var R=i!==null&&i.memoizedState!==null,F=Xs,Q=Jt;if(Xs=F||f,Jt=Q||R,Tn(n,e),Jt=Q,Xs=F,Nn(e),l&8192)e:for(n=e.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(i===null||R||Xs||Jt||Ti(e)),i=null,n=e;;){if(n.tag===5||n.tag===26){if(i===null){R=i=n;try{if(h=R.stateNode,f)S=h.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{N=R.stateNode;var ae=R.memoizedProps.style,K=ae!=null&&ae.hasOwnProperty("display")?ae.display:null;N.style.display=K==null||typeof K=="boolean"?"":(""+K).trim()}}catch(xe){dt(R,R.return,xe)}}}else if(n.tag===6){if(i===null){R=n;try{R.stateNode.nodeValue=f?"":R.memoizedProps}catch(xe){dt(R,R.return,xe)}}}else if(n.tag===18){if(i===null){R=n;try{var Z=R.stateNode;f?U0(Z,!0):U0(R.stateNode,!1)}catch(xe){dt(R,R.return,xe)}}}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;i===n&&(i=null),n=n.return}i===n&&(i=null),n.sibling.return=n.return,n=n.sibling}l&4&&(l=e.updateQueue,l!==null&&(i=l.retryQueue,i!==null&&(l.retryQueue=null,lc(e,i))));break;case 19:Tn(n,e),Nn(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,lc(e,l)));break;case 30:break;case 21:break;default:Tn(n,e),Nn(e)}}function Nn(e){var n=e.flags;if(n&2){try{for(var i,l=e.return;l!==null;){if(qv(l)){i=l;break}l=l.return}if(i==null)throw Error(r(160));switch(i.tag){case 27:var f=i.stateNode,h=gf(e);rc(e,h,f);break;case 5:var S=i.stateNode;i.flags&32&&(Xi(S,""),i.flags&=-33);var N=gf(e);rc(e,N,S);break;case 3:case 4:var R=i.stateNode.containerInfo,F=gf(e);vf(e,F,R);break;default:throw Error(r(161))}}catch(Q){dt(e,e.return,Q)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Qv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Qv(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function ea(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Kv(e,n.alternate,n),n=n.sibling}function Ti(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:Aa(4,n,n.return),Ti(n);break;case 1:Ns(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount=="function"&&Uv(n,n.return,i),Ti(n);break;case 27:Ir(n.stateNode);case 26:case 5:Ns(n,n.return),Ti(n);break;case 22:n.memoizedState===null&&Ti(n);break;case 30:Ti(n);break;default:Ti(n)}e=e.sibling}}function ta(e,n,i){for(i=i&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var l=n.alternate,f=e,h=n,S=h.flags;switch(h.tag){case 0:case 11:case 15:ta(f,h,i),jr(4,h);break;case 1:if(ta(f,h,i),l=h,f=l.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(F){dt(l,l.return,F)}if(l=h,f=l.updateQueue,f!==null){var N=l.stateNode;try{var R=f.shared.hiddenCallbacks;if(R!==null)for(f.shared.hiddenCallbacks=null,f=0;f<R.length;f++)Ag(R[f],N)}catch(F){dt(l,l.return,F)}}i&&S&64&&Pv(h),wr(h,h.return);break;case 27:Gv(h);case 26:case 5:ta(f,h,i),i&&l===null&&S&4&&Vv(h),wr(h,h.return);break;case 12:ta(f,h,i);break;case 31:ta(f,h,i),i&&S&4&&Jv(f,h);break;case 13:ta(f,h,i),i&&S&4&&Wv(f,h);break;case 22:h.memoizedState===null&&ta(f,h,i),wr(h,h.return);break;case 30:break;default:ta(f,h,i)}n=n.sibling}}function bf(e,n){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&ur(i))}function _f(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&ur(e))}function ps(e,n,i,l){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)e0(e,n,i,l),n=n.sibling}function e0(e,n,i,l){var f=n.flags;switch(n.tag){case 0:case 11:case 15:ps(e,n,i,l),f&2048&&jr(9,n);break;case 1:ps(e,n,i,l);break;case 3:ps(e,n,i,l),f&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&ur(e)));break;case 12:if(f&2048){ps(e,n,i,l),e=n.stateNode;try{var h=n.memoizedProps,S=h.id,N=h.onPostCommit;typeof N=="function"&&N(S,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(R){dt(n,n.return,R)}}else ps(e,n,i,l);break;case 31:ps(e,n,i,l);break;case 13:ps(e,n,i,l);break;case 23:break;case 22:h=n.stateNode,S=n.alternate,n.memoizedState!==null?h._visibility&2?ps(e,n,i,l):Tr(e,n):h._visibility&2?ps(e,n,i,l):(h._visibility|=2,bo(e,n,i,l,(n.subtreeFlags&10256)!==0||!1)),f&2048&&bf(S,n);break;case 24:ps(e,n,i,l),f&2048&&_f(n.alternate,n);break;default:ps(e,n,i,l)}}function bo(e,n,i,l,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=e,S=n,N=i,R=l,F=S.flags;switch(S.tag){case 0:case 11:case 15:bo(h,S,N,R,f),jr(8,S);break;case 23:break;case 22:var Q=S.stateNode;S.memoizedState!==null?Q._visibility&2?bo(h,S,N,R,f):Tr(h,S):(Q._visibility|=2,bo(h,S,N,R,f)),f&&F&2048&&bf(S.alternate,S);break;case 24:bo(h,S,N,R,f),f&&F&2048&&_f(S.alternate,S);break;default:bo(h,S,N,R,f)}n=n.sibling}}function Tr(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var i=e,l=n,f=l.flags;switch(l.tag){case 22:Tr(i,l),f&2048&&bf(l.alternate,l);break;case 24:Tr(i,l),f&2048&&_f(l.alternate,l);break;default:Tr(i,l)}n=n.sibling}}var Nr=8192;function _o(e,n,i){if(e.subtreeFlags&Nr)for(e=e.child;e!==null;)t0(e,n,i),e=e.sibling}function t0(e,n,i){switch(e.tag){case 26:_o(e,n,i),e.flags&Nr&&e.memoizedState!==null&&k2(i,fs,e.memoizedState,e.memoizedProps);break;case 5:_o(e,n,i);break;case 3:case 4:var l=fs;fs=kc(e.stateNode.containerInfo),_o(e,n,i),fs=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Nr,Nr=16777216,_o(e,n,i),Nr=l):_o(e,n,i));break;default:_o(e,n,i)}}function n0(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 Cr(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var i=0;i<n.length;i++){var l=n[i];ln=l,a0(l,e)}n0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)s0(e),e=e.sibling}function s0(e){switch(e.tag){case 0:case 11:case 15:Cr(e),e.flags&2048&&Aa(9,e,e.return);break;case 3:Cr(e);break;case 12:Cr(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,cc(e)):Cr(e);break;default:Cr(e)}}function cc(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var i=0;i<n.length;i++){var l=n[i];ln=l,a0(l,e)}n0(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:Aa(8,n,n.return),cc(n);break;case 22:i=n.stateNode,i._visibility&2&&(i._visibility&=-3,cc(n));break;default:cc(n)}e=e.sibling}}function a0(e,n){for(;ln!==null;){var i=ln;switch(i.tag){case 0:case 11:case 15:Aa(8,i,n);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var l=i.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:ur(i.memoizedState.cache)}if(l=i.child,l!==null)l.return=i,ln=l;else e:for(i=e;ln!==null;){l=ln;var f=l.sibling,h=l.return;if(Zv(l),l===i){ln=null;break e}if(f!==null){f.return=h,ln=f;break e}ln=h}}}var BS={getCacheForType:function(e){var n=un(Kt),i=n.data.get(e);return i===void 0&&(i=e(),n.data.set(e,i)),i},cacheSignal:function(){return un(Kt).controller.signal}},$S=typeof WeakMap=="function"?WeakMap:Map,rt=0,gt=null,Ke=null,Ye=0,ct=0,In=null,Da=!1,xo=!1,xf=!1,na=0,It=0,Ma=0,Ni=0,kf=0,On=0,ko=0,Er=null,Cn=null,Sf=!1,dc=0,i0=0,uc=1/0,fc=null,Ra=null,en=0,Ia=null,So=null,sa=0,jf=0,wf=null,o0=null,Ar=0,Tf=null;function Ln(){return(rt&2)!==0&&Ye!==0?Ye&-Ye:$.T!==null?Mf():Se()}function r0(){if(On===0)if((Ye&536870912)===0||Xe){var e=ri;ri<<=1,(ri&3932160)===0&&(ri=262144),On=e}else On=536870912;return e=Mn.current,e!==null&&(e.flags|=32),On}function En(e,n,i){(e===gt&&(ct===2||ct===9)||e.cancelPendingCommit!==null)&&(jo(e,0),Oa(e,Ye,On,!1)),di(e,i),((rt&2)===0||e!==gt)&&(e===gt&&((rt&2)===0&&(Ni|=i),It===4&&Oa(e,Ye,On,!1)),Cs(e))}function l0(e,n,i){if((rt&6)!==0)throw Error(r(327));var l=!i&&(n&127)===0&&(n&e.expiredLanes)===0||ya(e,n),f=l?PS(e,n):Cf(e,n,!0),h=l;do{if(f===0){xo&&!l&&Oa(e,n,0,!1);break}else{if(i=e.current.alternate,h&&!zS(i)){f=Cf(e,n,!1),h=!1;continue}if(f===2){if(h=n,e.errorRecoveryDisabledLanes&h)var S=0;else S=e.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){n=S;e:{var N=e;f=Er;var R=N.current.memoizedState.isDehydrated;if(R&&(jo(N,S).flags|=256),S=Cf(N,S,!1),S!==2){if(xf&&!R){N.errorRecoveryDisabledLanes|=h,Ni|=h,f=4;break e}h=Cn,Cn=f,h!==null&&(Cn===null?Cn=h:Cn.push.apply(Cn,h))}f=S}if(h=!1,f!==2)continue}}if(f===1){jo(e,0),Oa(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:Oa(l,n,On,!Da);break e;case 2:Cn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(f=dc+300-qt(),10<f)){if(Oa(l,n,On,!Da),ci(l,0,!0)!==0)break e;sa=n,l.timeoutHandle=z0(c0.bind(null,l,i,Cn,fc,Sf,n,On,Ni,ko,Da,h,"Throttled",-0,0),f);break e}c0(l,i,Cn,fc,Sf,n,On,Ni,ko,Da,h,null,-0,0)}}break}while(!0);Cs(e)}function c0(e,n,i,l,f,h,S,N,R,F,Q,ae,K,Z){if(e.timeoutHandle=-1,ae=n.subtreeFlags,ae&8192||(ae&16785408)===16785408){ae={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Us},t0(n,h,ae);var xe=(h&62914560)===h?dc-qt():(h&4194048)===h?i0-qt():0;if(xe=S2(ae,xe),xe!==null){sa=h,e.cancelPendingCommit=xe(v0.bind(null,e,n,h,i,l,f,S,N,R,Q,ae,null,K,Z)),Oa(e,h,S,!F);return}}v0(e,n,h,i,l,f,S,N,R)}function zS(e){for(var n=e;;){var i=n.tag;if((i===0||i===11||i===15)&&n.flags&16384&&(i=n.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var l=0;l<i.length;l++){var f=i[l],h=f.getSnapshot;f=f.value;try{if(!An(h(),f))return!1}catch{return!1}}if(i=n.child,n.subtreeFlags&16384&&i!==null)i.return=n,n=i;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 Oa(e,n,i,l){n&=~kf,n&=~Ni,e.suspendedLanes|=n,e.pingedLanes&=~n,l&&(e.warmLanes|=n),l=e.expirationTimes;for(var f=n;0<f;){var h=31-Gt(f),S=1<<h;l[h]=-1,f&=~S}i!==0&&te(e,i,n)}function pc(){return(rt&6)===0?(Dr(0),!1):!0}function Nf(){if(Ke!==null){if(ct===0)var e=Ke.return;else e=Ke,Fs=yi=null,Uu(e),mo=null,pr=0,e=Ke;for(;e!==null;)Hv(e.alternate,e),e=e.return;Ke=null}}function jo(e,n){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,i2(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),sa=0,Nf(),gt=e,Ke=i=qs(e.current,null),Ye=n,ct=0,In=null,Da=!1,xo=ya(e,n),xf=!1,ko=On=kf=Ni=Ma=It=0,Cn=Er=null,Sf=!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-Gt(l),h=1<<f;n|=e[f],l&=~h}return na=n,Il(),i}function d0(e,n){Be=null,$.H=xr,n===po||n===Ul?(n=Tg(),ct=3):n===Au?(n=Tg(),ct=4):ct=n===af?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,In=n,Ke===null&&(It=1,nc(e,Kn(n,e.current)))}function u0(){var e=Mn.current;return e===null?!0:(Ye&4194048)===Ye?Wn===null:(Ye&62914560)===Ye||(Ye&536870912)!==0?e===Wn:!1}function f0(){var e=$.H;return $.H=xr,e===null?xr:e}function p0(){var e=$.A;return $.A=BS,e}function mc(){It=4,Da||(Ye&4194048)!==Ye&&Mn.current!==null||(xo=!0),(Ma&134217727)===0&&(Ni&134217727)===0||gt===null||Oa(gt,Ye,On,!1)}function Cf(e,n,i){var l=rt;rt|=2;var f=f0(),h=p0();(gt!==e||Ye!==n)&&(fc=null,jo(e,n)),n=!1;var S=It;e:do try{if(ct!==0&&Ke!==null){var N=Ke,R=In;switch(ct){case 8:Nf(),S=6;break e;case 3:case 2:case 9:case 6:Mn.current===null&&(n=!0);var F=ct;if(ct=0,In=null,wo(e,N,R,F),i&&xo){S=0;break e}break;default:F=ct,ct=0,In=null,wo(e,N,R,F)}}HS(),S=It;break}catch(Q){d0(e,Q)}while(!0);return n&&e.shellSuspendCounter++,Fs=yi=null,rt=l,$.H=f,$.A=h,Ke===null&&(gt=null,Ye=0,Il()),S}function HS(){for(;Ke!==null;)m0(Ke)}function PS(e,n){var i=rt;rt|=2;var l=f0(),f=p0();gt!==e||Ye!==n?(fc=null,uc=qt()+500,jo(e,n)):xo=ya(e,n);e:do try{if(ct!==0&&Ke!==null){n=Ke;var h=In;t:switch(ct){case 1:ct=0,In=null,wo(e,n,h,1);break;case 2:case 9:if(jg(h)){ct=0,In=null,h0(n);break}n=function(){ct!==2&&ct!==9||gt!==e||(ct=7),Cs(e)},h.then(n,n);break e;case 3:ct=7;break e;case 4:ct=5;break e;case 7:jg(h)?(ct=0,In=null,h0(n)):(ct=0,In=null,wo(e,n,h,7));break;case 5:var S=null;switch(Ke.tag){case 26:S=Ke.memoizedState;case 5:case 27:var N=Ke;if(S?ey(S):N.stateNode.complete){ct=0,In=null;var R=N.sibling;if(R!==null)Ke=R;else{var F=N.return;F!==null?(Ke=F,hc(F)):Ke=null}break t}}ct=0,In=null,wo(e,n,h,5);break;case 6:ct=0,In=null,wo(e,n,h,6);break;case 8:Nf(),It=6;break e;default:throw Error(r(462))}}US();break}catch(Q){d0(e,Q)}while(!0);return Fs=yi=null,$.H=l,$.A=f,rt=i,Ke!==null?0:(gt=null,Ye=0,Il(),It)}function US(){for(;Ke!==null&&!Bs();)m0(Ke)}function m0(e){var n=$v(e.alternate,e,na);e.memoizedProps=e.pendingProps,n===null?hc(e):Ke=n}function h0(e){var n=e,i=n.alternate;switch(n.tag){case 15:case 0:n=Mv(i,n,n.pendingProps,n.type,void 0,Ye);break;case 11:n=Mv(i,n,n.pendingProps,n.type.render,n.ref,Ye);break;case 5:Uu(n);default:Hv(i,n),n=Ke=pg(n,na),n=$v(i,n,na)}e.memoizedProps=e.pendingProps,n===null?hc(e):Ke=n}function wo(e,n,i,l){Fs=yi=null,Uu(n),mo=null,pr=0;var f=n.return;try{if(AS(e,f,n,i,Ye)){It=1,nc(e,Kn(i,e.current)),Ke=null;return}}catch(h){if(f!==null)throw Ke=f,h;It=1,nc(e,Kn(i,e.current)),Ke=null;return}n.flags&32768?(Xe||l===1?e=!0:xo||(Ye&536870912)!==0?e=!1:(Da=e=!0,(l===2||l===9||l===3||l===6)&&(l=Mn.current,l!==null&&l.tag===13&&(l.flags|=16384))),g0(n,e)):hc(n)}function hc(e){var n=e;do{if((n.flags&32768)!==0){g0(n,Da);return}e=n.return;var i=RS(n.alternate,n,na);if(i!==null){Ke=i;return}if(n=n.sibling,n!==null){Ke=n;return}Ke=n=e}while(n!==null);It===0&&(It=5)}function g0(e,n){do{var i=IS(e.alternate,e);if(i!==null){i.flags&=32767,Ke=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!n&&(e=e.sibling,e!==null)){Ke=e;return}Ke=e=i}while(e!==null);It=6,Ke=null}function v0(e,n,i,l,f,h,S,N,R){e.cancelPendingCommit=null;do gc();while(en!==0);if((rt&6)!==0)throw Error(r(327));if(n!==null){if(n===e.current)throw Error(r(177));if(h=n.lanes|n.childLanes,h|=hu,U(e,i,h,S,N,R),e===gt&&(Ke=gt=null,Ye=0),So=n,Ia=e,sa=i,jf=h,wf=f,o0=l,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,FS($s,function(){return k0(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||l){l=$.T,$.T=null,f=B.p,B.p=2,S=rt,rt|=4;try{OS(e,n,i)}finally{rt=S,B.p=f,$.T=l}}en=1,y0(),b0(),_0()}}function y0(){if(en===1){en=0;var e=Ia,n=So,i=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||i){i=$.T,$.T=null;var l=B.p;B.p=2;var f=rt;rt|=4;try{Xv(n,e);var h=Hf,S=ag(e.containerInfo),N=h.focusedElem,R=h.selectionRange;if(S!==N&&N&&N.ownerDocument&&sg(N.ownerDocument.documentElement,N)){if(R!==null&&du(N)){var F=R.start,Q=R.end;if(Q===void 0&&(Q=F),"selectionStart"in N)N.selectionStart=F,N.selectionEnd=Math.min(Q,N.value.length);else{var ae=N.ownerDocument||document,K=ae&&ae.defaultView||window;if(K.getSelection){var Z=K.getSelection(),xe=N.textContent.length,Ce=Math.min(R.start,xe),mt=R.end===void 0?Ce:Math.min(R.end,xe);!Z.extend&&Ce>mt&&(S=mt,mt=Ce,Ce=S);var V=ng(N,Ce),z=ng(N,mt);if(V&&z&&(Z.rangeCount!==1||Z.anchorNode!==V.node||Z.anchorOffset!==V.offset||Z.focusNode!==z.node||Z.focusOffset!==z.offset)){var G=ae.createRange();G.setStart(V.node,V.offset),Z.removeAllRanges(),Ce>mt?(Z.addRange(G),Z.extend(z.node,z.offset)):(G.setEnd(z.node,z.offset),Z.addRange(G))}}}}for(ae=[],Z=N;Z=Z.parentNode;)Z.nodeType===1&&ae.push({element:Z,left:Z.scrollLeft,top:Z.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<ae.length;N++){var ne=ae[N];ne.element.scrollLeft=ne.left,ne.element.scrollTop=ne.top}}Cc=!!zf,Hf=zf=null}finally{rt=f,B.p=l,$.T=i}}e.current=n,en=2}}function b0(){if(en===2){en=0;var e=Ia,n=So,i=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||i){i=$.T,$.T=null;var l=B.p;B.p=2;var f=rt;rt|=4;try{Kv(e,n.alternate,n)}finally{rt=f,B.p=l,$.T=i}}en=3}}function _0(){if(en===4||en===3){en=0,si();var e=Ia,n=So,i=sa,l=o0;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?en=5:(en=0,So=Ia=null,x0(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(Ra=null),Fe(i),n=n.stateNode,ht&&typeof ht.onCommitFiberRoot=="function")try{ht.onCommitFiberRoot(ze,n,void 0,(n.current.flags&128)===128)}catch{}if(l!==null){n=$.T,f=B.p,B.p=2,$.T=null;try{for(var h=e.onRecoverableError,S=0;S<l.length;S++){var N=l[S];h(N.value,{componentStack:N.stack})}}finally{$.T=n,B.p=f}}(sa&3)!==0&&gc(),Cs(e),f=e.pendingLanes,(i&261930)!==0&&(f&42)!==0?e===Tf?Ar++:(Ar=0,Tf=e):Ar=0,Dr(0)}}function x0(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,ur(n)))}function gc(){return y0(),b0(),_0(),k0()}function k0(){if(en!==5)return!1;var e=Ia,n=jf;jf=0;var i=Fe(sa),l=$.T,f=B.p;try{B.p=32>i?32:i,$.T=null,i=wf,wf=null;var h=Ia,S=sa;if(en=0,So=Ia=null,sa=0,(rt&6)!==0)throw Error(r(331));var N=rt;if(rt|=4,s0(h.current),e0(h,h.current,S,i),rt=N,Dr(0,!1),ht&&typeof ht.onPostCommitFiberRoot=="function")try{ht.onPostCommitFiberRoot(ze,h)}catch{}return!0}finally{B.p=f,$.T=l,x0(e,n)}}function S0(e,n,i){n=Kn(i,n),n=sf(e.stateNode,n,2),e=Na(e,n,2),e!==null&&(di(e,2),Cs(e))}function dt(e,n,i){if(e.tag===3)S0(e,e,i);else for(;n!==null;){if(n.tag===3){S0(n,e,i);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ra===null||!Ra.has(l))){e=Kn(i,e),i=jv(2),l=Na(n,i,2),l!==null&&(wv(i,l,n,e),di(l,2),Cs(l));break}}n=n.return}}function Ef(e,n,i){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(i)||(xf=!0,f.add(i),e=VS.bind(null,e,n,i),n.then(e,e))}function VS(e,n,i){var l=e.pingCache;l!==null&&l.delete(n),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,gt===e&&(Ye&i)===i&&(It===4||It===3&&(Ye&62914560)===Ye&&300>qt()-dc?(rt&2)===0&&jo(e,0):kf|=i,ko===Ye&&(ko=0)),Cs(e)}function j0(e,n){n===0&&(n=Xo()),e=hi(e,n),e!==null&&(di(e,n),Cs(e))}function qS(e){var n=e.memoizedState,i=0;n!==null&&(i=n.retryLane),j0(e,i)}function GS(e,n){var i=0;switch(e.tag){case 31:case 13:var l=e.stateNode,f=e.memoizedState;f!==null&&(i=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),j0(e,i)}function FS(e,n){return Xt(e,n)}var vc=null,To=null,Af=!1,yc=!1,Df=!1,La=0;function Cs(e){e!==To&&e.next===null&&(To===null?vc=To=e:To=To.next=e),yc=!0,Af||(Af=!0,ZS())}function Dr(e,n){if(!Df&&yc){Df=!0;do for(var i=!1,l=vc;l!==null;){if(e!==0){var f=l.pendingLanes;if(f===0)var h=0;else{var S=l.suspendedLanes,N=l.pingedLanes;h=(1<<31-Gt(42|e)+1)-1,h&=f&~(S&~N),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(i=!0,C0(l,h))}else h=Ye,h=ci(l,l===gt?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(h&3)===0||ya(l,h)||(i=!0,C0(l,h));l=l.next}while(i);Df=!1}}function KS(){w0()}function w0(){yc=Af=!1;var e=0;La!==0&&a2()&&(e=La);for(var n=qt(),i=null,l=vc;l!==null;){var f=l.next,h=T0(l,n);h===0?(l.next=null,i===null?vc=f:i.next=f,f===null&&(To=i)):(i=l,(e!==0||(h&3)!==0)&&(yc=!0)),l=f}en!==0&&en!==5||Dr(e),La!==0&&(La=0)}function T0(e,n){for(var i=e.suspendedLanes,l=e.pingedLanes,f=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var S=31-Gt(h),N=1<<S,R=f[S];R===-1?((N&i)===0||(N&l)!==0)&&(f[S]=kl(N,n)):R<=n&&(e.expiredLanes|=N),h&=~N}if(n=gt,i=Ye,i=ci(e,e===n?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,i===0||e===n&&(ct===2||ct===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&bn(l),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||ya(e,i)){if(n=i&-i,n===e.callbackPriority)return n;switch(l!==null&&bn(l),Fe(i)){case 2:case 8:i=va;break;case 32:i=$s;break;case 268435456:i=oi;break;default:i=$s}return l=N0.bind(null,e),i=Xt(i,l),e.callbackPriority=n,e.callbackNode=i,n}return l!==null&&l!==null&&bn(l),e.callbackPriority=2,e.callbackNode=null,2}function N0(e,n){if(en!==0&&en!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(gc()&&e.callbackNode!==i)return null;var l=Ye;return l=ci(e,e===gt?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(l0(e,l,n),T0(e,qt()),e.callbackNode!=null&&e.callbackNode===i?N0.bind(null,e):null)}function C0(e,n){if(gc())return null;l0(e,n,!0)}function ZS(){o2(function(){(rt&6)!==0?Xt(ai,KS):w0()})}function Mf(){if(La===0){var e=uo;e===0&&(e=zs,zs<<=1,(zs&261888)===0&&(zs=256)),La=e}return La}function E0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Tl(""+e)}function A0(e,n){var i=n.ownerDocument.createElement("input");return i.name=n.name,i.value=n.value,e.id&&i.setAttribute("form",e.id),n.parentNode.insertBefore(i,n),e=new FormData(e),i.parentNode.removeChild(i),e}function YS(e,n,i,l,f){if(n==="submit"&&i&&i.stateNode===f){var h=E0((f[Me]||null).action),S=l.submitter;S&&(n=(n=S[Me]||null)?E0(n.formAction):S.getAttribute("formAction"),n!==null&&(h=n,S=null));var N=new Al("action","action",null,l,f);e.push({event:N,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(La!==0){var R=S?A0(f,S):new FormData(f);Wu(i,{pending:!0,data:R,method:f.method,action:h},null,R)}}else typeof h=="function"&&(N.preventDefault(),R=S?A0(f,S):new FormData(f),Wu(i,{pending:!0,data:R,method:f.method,action:h},h,R))},currentTarget:f}]})}}for(var Rf=0;Rf<mu.length;Rf++){var If=mu[Rf],JS=If.toLowerCase(),WS=If[0].toUpperCase()+If.slice(1);us(JS,"on"+WS)}us(rg,"onAnimationEnd"),us(lg,"onAnimationIteration"),us(cg,"onAnimationStart"),us("dblclick","onDoubleClick"),us("focusin","onFocus"),us("focusout","onBlur"),us(pS,"onTransitionRun"),us(mS,"onTransitionStart"),us(hS,"onTransitionCancel"),us(dg,"onTransitionEnd"),Ji("onMouseEnter",["mouseout","mouseover"]),Ji("onMouseLeave",["mouseout","mouseover"]),Ji("onPointerEnter",["pointerout","pointerover"]),Ji("onPointerLeave",["pointerout","pointerover"]),ui("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ui("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ui("onBeforeInput",["compositionend","keypress","textInput","paste"]),ui("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ui("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ui("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Mr="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(" "),XS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Mr));function D0(e,n){n=(n&4)!==0;for(var i=0;i<e.length;i++){var l=e[i],f=l.event;l=l.listeners;e:{var h=void 0;if(n)for(var S=l.length-1;0<=S;S--){var N=l[S],R=N.instance,F=N.currentTarget;if(N=N.listener,R!==h&&f.isPropagationStopped())break e;h=N,f.currentTarget=F;try{h(f)}catch(Q){Rl(Q)}f.currentTarget=null,h=R}else for(S=0;S<l.length;S++){if(N=l[S],R=N.instance,F=N.currentTarget,N=N.listener,R!==h&&f.isPropagationStopped())break e;h=N,f.currentTarget=F;try{h(f)}catch(Q){Rl(Q)}f.currentTarget=null,h=R}}}}function Ze(e,n){var i=n[on];i===void 0&&(i=n[on]=new Set);var l=e+"__bubble";i.has(l)||(M0(n,e,2,!1),i.add(l))}function Of(e,n,i){var l=0;n&&(l|=4),M0(i,e,l,n)}var bc="_reactListening"+Math.random().toString(36).slice(2);function Lf(e){if(!e[bc]){e[bc]=!0,wh.forEach(function(i){i!=="selectionchange"&&(XS.has(i)||Of(i,!1,e),Of(i,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[bc]||(n[bc]=!0,Of("selectionchange",!1,n))}}function M0(e,n,i,l){switch(ry(n)){case 2:var f=T2;break;case 8:f=N2;break;default:f=Wf}i=f.bind(null,n,i,e),f=void 0,!tu||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),l?f!==void 0?e.addEventListener(n,i,{capture:!0,passive:f}):e.addEventListener(n,i,!0):f!==void 0?e.addEventListener(n,i,{passive:f}):e.addEventListener(n,i,!1)}function Bf(e,n,i,l,f){var h=l;if((n&1)===0&&(n&2)===0&&l!==null)e:for(;;){if(l===null)return;var S=l.tag;if(S===3||S===4){var N=l.stateNode.containerInfo;if(N===f)break;if(S===4)for(S=l.return;S!==null;){var R=S.tag;if((R===3||R===4)&&S.stateNode.containerInfo===f)return;S=S.return}for(;N!==null;){if(S=Ki(N),S===null)return;if(R=S.tag,R===5||R===6||R===26||R===27){l=h=S;continue e}N=N.parentNode}}l=l.return}Bh(function(){var F=h,Q=Qd(i),ae=[];e:{var K=ug.get(e);if(K!==void 0){var Z=Al,xe=e;switch(e){case"keypress":if(Cl(i)===0)break e;case"keydown":case"keyup":Z=Gk;break;case"focusin":xe="focus",Z=iu;break;case"focusout":xe="blur",Z=iu;break;case"beforeblur":case"afterblur":Z=iu;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Z=Hh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Z=Rk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Z=Zk;break;case rg:case lg:case cg:Z=Lk;break;case dg:Z=Jk;break;case"scroll":case"scrollend":Z=Dk;break;case"wheel":Z=Xk;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=Uh;break;case"toggle":case"beforetoggle":Z=eS}var Ce=(n&4)!==0,mt=!Ce&&(e==="scroll"||e==="scrollend"),V=Ce?K!==null?K+"Capture":null:K;Ce=[];for(var z=F,G;z!==null;){var ne=z;if(G=ne.stateNode,ne=ne.tag,ne!==5&&ne!==26&&ne!==27||G===null||V===null||(ne=er(z,V),ne!=null&&Ce.push(Rr(z,ne,G))),mt)break;z=z.return}0<Ce.length&&(K=new Z(K,xe,null,i,Q),ae.push({event:K,listeners:Ce}))}}if((n&7)===0){e:{if(K=e==="mouseover"||e==="pointerover",Z=e==="mouseout"||e==="pointerout",K&&i!==Xd&&(xe=i.relatedTarget||i.fromElement)&&(Ki(xe)||xe[Mt]))break e;if((Z||K)&&(K=Q.window===Q?Q:(K=Q.ownerDocument)?K.defaultView||K.parentWindow:window,Z?(xe=i.relatedTarget||i.toElement,Z=F,xe=xe?Ki(xe):null,xe!==null&&(mt=d(xe),Ce=xe.tag,xe!==mt||Ce!==5&&Ce!==27&&Ce!==6)&&(xe=null)):(Z=null,xe=F),Z!==xe)){if(Ce=Hh,ne="onMouseLeave",V="onMouseEnter",z="mouse",(e==="pointerout"||e==="pointerover")&&(Ce=Uh,ne="onPointerLeave",V="onPointerEnter",z="pointer"),mt=Z==null?K:Qo(Z),G=xe==null?K:Qo(xe),K=new Ce(ne,z+"leave",Z,i,Q),K.target=mt,K.relatedTarget=G,ne=null,Ki(Q)===F&&(Ce=new Ce(V,z+"enter",xe,i,Q),Ce.target=G,Ce.relatedTarget=mt,ne=Ce),mt=ne,Z&&xe)t:{for(Ce=QS,V=Z,z=xe,G=0,ne=V;ne;ne=Ce(ne))G++;ne=0;for(var Te=z;Te;Te=Ce(Te))ne++;for(;0<G-ne;)V=Ce(V),G--;for(;0<ne-G;)z=Ce(z),ne--;for(;G--;){if(V===z||z!==null&&V===z.alternate){Ce=V;break t}V=Ce(V),z=Ce(z)}Ce=null}else Ce=null;Z!==null&&R0(ae,K,Z,Ce,!1),xe!==null&&mt!==null&&R0(ae,mt,xe,Ce,!0)}}e:{if(K=F?Qo(F):window,Z=K.nodeName&&K.nodeName.toLowerCase(),Z==="select"||Z==="input"&&K.type==="file")var nt=Jh;else if(Zh(K))if(Wh)nt=dS;else{nt=lS;var ke=rS}else Z=K.nodeName,!Z||Z.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?F&&Wd(F.elementType)&&(nt=Jh):nt=cS;if(nt&&(nt=nt(e,F))){Yh(ae,nt,i,Q);break e}ke&&ke(e,K,F),e==="focusout"&&F&&K.type==="number"&&F.memoizedProps.value!=null&&Jd(K,"number",K.value)}switch(ke=F?Qo(F):window,e){case"focusin":(Zh(ke)||ke.contentEditable==="true")&&(no=ke,uu=F,lr=null);break;case"focusout":lr=uu=no=null;break;case"mousedown":fu=!0;break;case"contextmenu":case"mouseup":case"dragend":fu=!1,ig(ae,i,Q);break;case"selectionchange":if(fS)break;case"keydown":case"keyup":ig(ae,i,Q)}var He;if(ru)e:{switch(e){case"compositionstart":var Je="onCompositionStart";break e;case"compositionend":Je="onCompositionEnd";break e;case"compositionupdate":Je="onCompositionUpdate";break e}Je=void 0}else to?Fh(e,i)&&(Je="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Je="onCompositionStart");Je&&(Vh&&i.locale!=="ko"&&(to||Je!=="onCompositionStart"?Je==="onCompositionEnd"&&to&&(He=$h()):(_a=Q,nu="value"in _a?_a.value:_a.textContent,to=!0)),ke=_c(F,Je),0<ke.length&&(Je=new Ph(Je,e,null,i,Q),ae.push({event:Je,listeners:ke}),He?Je.data=He:(He=Kh(i),He!==null&&(Je.data=He)))),(He=nS?sS(e,i):aS(e,i))&&(Je=_c(F,"onBeforeInput"),0<Je.length&&(ke=new Ph("onBeforeInput","beforeinput",null,i,Q),ae.push({event:ke,listeners:Je}),ke.data=He)),YS(ae,e,F,i,Q)}D0(ae,n)})}function Rr(e,n,i){return{instance:e,listener:n,currentTarget:i}}function _c(e,n){for(var i=n+"Capture",l=[];e!==null;){var f=e,h=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||h===null||(f=er(e,i),f!=null&&l.unshift(Rr(e,f,h)),f=er(e,n),f!=null&&l.push(Rr(e,f,h))),e.tag===3)return l;e=e.return}return[]}function QS(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function R0(e,n,i,l,f){for(var h=n._reactName,S=[];i!==null&&i!==l;){var N=i,R=N.alternate,F=N.stateNode;if(N=N.tag,R!==null&&R===l)break;N!==5&&N!==26&&N!==27||F===null||(R=F,f?(F=er(i,h),F!=null&&S.unshift(Rr(i,F,R))):f||(F=er(i,h),F!=null&&S.push(Rr(i,F,R)))),i=i.return}S.length!==0&&e.push({event:n,listeners:S})}var e2=/\r\n?/g,t2=/\u0000|\uFFFD/g;function I0(e){return(typeof e=="string"?e:""+e).replace(e2,`
|
|
26
|
+
`).replace(t2,"")}function O0(e,n){return n=I0(n),I0(e)===n}function pt(e,n,i,l,f,h){switch(i){case"children":typeof l=="string"?n==="body"||n==="textarea"&&l===""||Xi(e,l):(typeof l=="number"||typeof l=="bigint")&&n!=="body"&&Xi(e,""+l);break;case"className":jl(e,"class",l);break;case"tabIndex":jl(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":jl(e,i,l);break;case"style":Oh(e,l,h);break;case"data":if(n!=="object"){jl(e,"data",l);break}case"src":case"href":if(l===""&&(n!=="a"||i!=="href")){e.removeAttribute(i);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(i);break}l=Tl(""+l),e.setAttribute(i,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(i,"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"&&(i==="formAction"?(n!=="input"&&pt(e,n,"name",f.name,f,null),pt(e,n,"formEncType",f.formEncType,f,null),pt(e,n,"formMethod",f.formMethod,f,null),pt(e,n,"formTarget",f.formTarget,f,null)):(pt(e,n,"encType",f.encType,f,null),pt(e,n,"method",f.method,f,null),pt(e,n,"target",f.target,f,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(i);break}l=Tl(""+l),e.setAttribute(i,l);break;case"onClick":l!=null&&(e.onclick=Us);break;case"onScroll":l!=null&&Ze("scroll",e);break;case"onScrollEnd":l!=null&&Ze("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(i=l.__html,i!=null){if(f.children!=null)throw Error(r(60));e.innerHTML=i}}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}i=Tl(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);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(i,""+l):e.removeAttribute(i);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(i,""):e.removeAttribute(i);break;case"capture":case"download":l===!0?e.setAttribute(i,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,l):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(i,l):e.removeAttribute(i);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(i):e.setAttribute(i,l);break;case"popover":Ze("beforetoggle",e),Ze("toggle",e),Sl(e,"popover",l);break;case"xlinkActuate":Ps(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Ps(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Ps(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Ps(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Ps(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Ps(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Ps(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Ps(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Ps(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Sl(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=Ek.get(i)||i,Sl(e,i,l))}}function $f(e,n,i,l,f,h){switch(i){case"style":Oh(e,l,h);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(i=l.__html,i!=null){if(f.children!=null)throw Error(r(60));e.innerHTML=i}}break;case"children":typeof l=="string"?Xi(e,l):(typeof l=="number"||typeof l=="bigint")&&Xi(e,""+l);break;case"onScroll":l!=null&&Ze("scroll",e);break;case"onScrollEnd":l!=null&&Ze("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Us);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Th.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(f=i.endsWith("Capture"),n=i.slice(2,f?i.length-7:void 0),h=e[Me]||null,h=h!=null?h[i]:null,typeof h=="function"&&e.removeEventListener(n,h,f),typeof l=="function")){typeof h!="function"&&h!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(n,l,f);break e}i in e?e[i]=l:l===!0?e.setAttribute(i,""):Sl(e,i,l)}}}function pn(e,n,i){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ze("error",e),Ze("load",e);var l=!1,f=!1,h;for(h in i)if(i.hasOwnProperty(h)){var S=i[h];if(S!=null)switch(h){case"src":l=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:pt(e,n,h,S,i,null)}}f&&pt(e,n,"srcSet",i.srcSet,i,null),l&&pt(e,n,"src",i.src,i,null);return;case"input":Ze("invalid",e);var N=h=S=f=null,R=null,F=null;for(l in i)if(i.hasOwnProperty(l)){var Q=i[l];if(Q!=null)switch(l){case"name":f=Q;break;case"type":S=Q;break;case"checked":R=Q;break;case"defaultChecked":F=Q;break;case"value":h=Q;break;case"defaultValue":N=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(r(137,n));break;default:pt(e,n,l,Q,i,null)}}Dh(e,h,N,R,F,S,f,!1);return;case"select":Ze("invalid",e),l=S=h=null;for(f in i)if(i.hasOwnProperty(f)&&(N=i[f],N!=null))switch(f){case"value":h=N;break;case"defaultValue":S=N;break;case"multiple":l=N;default:pt(e,n,f,N,i,null)}n=h,i=S,e.multiple=!!l,n!=null?Wi(e,!!l,n,!1):i!=null&&Wi(e,!!l,i,!0);return;case"textarea":Ze("invalid",e),h=f=l=null;for(S in i)if(i.hasOwnProperty(S)&&(N=i[S],N!=null))switch(S){case"value":l=N;break;case"defaultValue":f=N;break;case"children":h=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(r(91));break;default:pt(e,n,S,N,i,null)}Rh(e,l,f,h);return;case"option":for(R in i)if(i.hasOwnProperty(R)&&(l=i[R],l!=null))switch(R){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:pt(e,n,R,l,i,null)}return;case"dialog":Ze("beforetoggle",e),Ze("toggle",e),Ze("cancel",e),Ze("close",e);break;case"iframe":case"object":Ze("load",e);break;case"video":case"audio":for(l=0;l<Mr.length;l++)Ze(Mr[l],e);break;case"image":Ze("error",e),Ze("load",e);break;case"details":Ze("toggle",e);break;case"embed":case"source":case"link":Ze("error",e),Ze("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(F in i)if(i.hasOwnProperty(F)&&(l=i[F],l!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:pt(e,n,F,l,i,null)}return;default:if(Wd(n)){for(Q in i)i.hasOwnProperty(Q)&&(l=i[Q],l!==void 0&&$f(e,n,Q,l,i,void 0));return}}for(N in i)i.hasOwnProperty(N)&&(l=i[N],l!=null&&pt(e,n,N,l,i,null))}function n2(e,n,i,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,S=null,N=null,R=null,F=null,Q=null;for(Z in i){var ae=i[Z];if(i.hasOwnProperty(Z)&&ae!=null)switch(Z){case"checked":break;case"value":break;case"defaultValue":R=ae;default:l.hasOwnProperty(Z)||pt(e,n,Z,null,l,ae)}}for(var K in l){var Z=l[K];if(ae=i[K],l.hasOwnProperty(K)&&(Z!=null||ae!=null))switch(K){case"type":h=Z;break;case"name":f=Z;break;case"checked":F=Z;break;case"defaultChecked":Q=Z;break;case"value":S=Z;break;case"defaultValue":N=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(r(137,n));break;default:Z!==ae&&pt(e,n,K,Z,l,ae)}}Yd(e,S,N,R,F,Q,h,f);return;case"select":Z=S=N=K=null;for(h in i)if(R=i[h],i.hasOwnProperty(h)&&R!=null)switch(h){case"value":break;case"multiple":Z=R;default:l.hasOwnProperty(h)||pt(e,n,h,null,l,R)}for(f in l)if(h=l[f],R=i[f],l.hasOwnProperty(f)&&(h!=null||R!=null))switch(f){case"value":K=h;break;case"defaultValue":N=h;break;case"multiple":S=h;default:h!==R&&pt(e,n,f,h,l,R)}n=N,i=S,l=Z,K!=null?Wi(e,!!i,K,!1):!!l!=!!i&&(n!=null?Wi(e,!!i,n,!0):Wi(e,!!i,i?[]:"",!1));return;case"textarea":Z=K=null;for(N in i)if(f=i[N],i.hasOwnProperty(N)&&f!=null&&!l.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:pt(e,n,N,null,l,f)}for(S in l)if(f=l[S],h=i[S],l.hasOwnProperty(S)&&(f!=null||h!=null))switch(S){case"value":K=f;break;case"defaultValue":Z=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(r(91));break;default:f!==h&&pt(e,n,S,f,l,h)}Mh(e,K,Z);return;case"option":for(var xe in i)if(K=i[xe],i.hasOwnProperty(xe)&&K!=null&&!l.hasOwnProperty(xe))switch(xe){case"selected":e.selected=!1;break;default:pt(e,n,xe,null,l,K)}for(R in l)if(K=l[R],Z=i[R],l.hasOwnProperty(R)&&K!==Z&&(K!=null||Z!=null))switch(R){case"selected":e.selected=K&&typeof K!="function"&&typeof K!="symbol";break;default:pt(e,n,R,K,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 i)K=i[Ce],i.hasOwnProperty(Ce)&&K!=null&&!l.hasOwnProperty(Ce)&&pt(e,n,Ce,null,l,K);for(F in l)if(K=l[F],Z=i[F],l.hasOwnProperty(F)&&K!==Z&&(K!=null||Z!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(r(137,n));break;default:pt(e,n,F,K,l,Z)}return;default:if(Wd(n)){for(var mt in i)K=i[mt],i.hasOwnProperty(mt)&&K!==void 0&&!l.hasOwnProperty(mt)&&$f(e,n,mt,void 0,l,K);for(Q in l)K=l[Q],Z=i[Q],!l.hasOwnProperty(Q)||K===Z||K===void 0&&Z===void 0||$f(e,n,Q,K,l,Z);return}}for(var V in i)K=i[V],i.hasOwnProperty(V)&&K!=null&&!l.hasOwnProperty(V)&&pt(e,n,V,null,l,K);for(ae in l)K=l[ae],Z=i[ae],!l.hasOwnProperty(ae)||K===Z||K==null&&Z==null||pt(e,n,ae,K,l,Z)}function L0(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function s2(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,i=performance.getEntriesByType("resource"),l=0;l<i.length;l++){var f=i[l],h=f.transferSize,S=f.initiatorType,N=f.duration;if(h&&N&&L0(S)){for(S=0,N=f.responseEnd,l+=1;l<i.length;l++){var R=i[l],F=R.startTime;if(F>N)break;var Q=R.transferSize,ae=R.initiatorType;Q&&L0(ae)&&(R=R.responseEnd,S+=Q*(R<N?1:(N-F)/(R-F)))}if(--l,n+=8*(h+S)/(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 zf=null,Hf=null;function xc(e){return e.nodeType===9?e:e.ownerDocument}function B0(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 $0(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 Pf(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 Uf=null;function a2(){var e=window.event;return e&&e.type==="popstate"?e===Uf?!1:(Uf=e,!0):(Uf=null,!1)}var z0=typeof setTimeout=="function"?setTimeout:void 0,i2=typeof clearTimeout=="function"?clearTimeout:void 0,H0=typeof Promise=="function"?Promise:void 0,o2=typeof queueMicrotask=="function"?queueMicrotask:typeof H0<"u"?function(e){return H0.resolve(null).then(e).catch(r2)}:z0;function r2(e){setTimeout(function(){throw e})}function Ba(e){return e==="head"}function P0(e,n){var i=n,l=0;do{var f=i.nextSibling;if(e.removeChild(i),f&&f.nodeType===8)if(i=f.data,i==="/$"||i==="/&"){if(l===0){e.removeChild(f),Ao(n);return}l--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")l++;else if(i==="html")Ir(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,Ir(i);for(var h=i.firstChild;h;){var S=h.nextSibling,N=h.nodeName;h[Hs]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&h.rel.toLowerCase()==="stylesheet"||i.removeChild(h),h=S}}else i==="body"&&Ir(e.ownerDocument.body);i=f}while(i);Ao(n)}function U0(e,n){var i=e;e=0;do{var l=i.nextSibling;if(i.nodeType===1?n?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(n?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),l&&l.nodeType===8)if(i=l.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=l}while(i)}function Vf(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var i=n;switch(n=n.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Vf(i),Kd(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function l2(e,n,i,l){for(;e.nodeType===1;){var f=i;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Hs])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=Xn(e.nextSibling),e===null)break}return null}function c2(e,n,i){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Xn(e.nextSibling),e===null))return null;return e}function V0(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Xn(e.nextSibling),e===null))return null;return e}function qf(e){return e.data==="$?"||e.data==="$~"}function Gf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function d2(e,n){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||i.readyState!=="loading")n();else{var l=function(){n(),i.removeEventListener("DOMContentLoaded",l)};i.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Xn(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 Ff=null;function q0(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(n===0)return Xn(e.nextSibling);n--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||n++}e=e.nextSibling}return null}function G0(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(n===0)return e;n--}else i!=="/$"&&i!=="/&"||n++}e=e.previousSibling}return null}function F0(e,n,i){switch(n=xc(i),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 Ir(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Kd(e)}var Qn=new Map,K0=new Set;function kc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var aa=B.d;B.d={f:u2,r:f2,D:p2,C:m2,L:h2,m:g2,X:y2,S:v2,M:b2};function u2(){var e=aa.f(),n=pc();return e||n}function f2(e){var n=Zi(e);n!==null&&n.tag===5&&n.type==="form"?dv(n):aa.r(e)}var No=typeof document>"u"?null:document;function Z0(e,n,i){var l=No;if(l&&typeof n=="string"&&n){var f=Gn(n);f='link[rel="'+e+'"][href="'+f+'"]',typeof i=="string"&&(f+='[crossorigin="'+i+'"]'),K0.has(f)||(K0.add(f),e={rel:e,crossOrigin:i,href:n},l.querySelector(f)===null&&(n=l.createElement("link"),pn(n,"link",e),rn(n),l.head.appendChild(n)))}}function p2(e){aa.D(e),Z0("dns-prefetch",e,null)}function m2(e,n){aa.C(e,n),Z0("preconnect",e,n)}function h2(e,n,i){aa.L(e,n,i);var l=No;if(l&&e&&n){var f='link[rel="preload"][as="'+Gn(n)+'"]';n==="image"&&i&&i.imageSrcSet?(f+='[imagesrcset="'+Gn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(f+='[imagesizes="'+Gn(i.imageSizes)+'"]')):f+='[href="'+Gn(e)+'"]';var h=f;switch(n){case"style":h=Co(e);break;case"script":h=Eo(e)}Qn.has(h)||(e=_({rel:"preload",href:n==="image"&&i&&i.imageSrcSet?void 0:e,as:n},i),Qn.set(h,e),l.querySelector(f)!==null||n==="style"&&l.querySelector(Or(h))||n==="script"&&l.querySelector(Lr(h))||(n=l.createElement("link"),pn(n,"link",e),rn(n),l.head.appendChild(n)))}}function g2(e,n){aa.m(e,n);var i=No;if(i&&e){var l=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+Gn(l)+'"][href="'+Gn(e)+'"]',h=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Eo(e)}if(!Qn.has(h)&&(e=_({rel:"modulepreload",href:e},n),Qn.set(h,e),i.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Lr(h)))return}l=i.createElement("link"),pn(l,"link",e),rn(l),i.head.appendChild(l)}}}function v2(e,n,i){aa.S(e,n,i);var l=No;if(l&&e){var f=Yi(l).hoistableStyles,h=Co(e);n=n||"default";var S=f.get(h);if(!S){var N={loading:0,preload:null};if(S=l.querySelector(Or(h)))N.loading=5;else{e=_({rel:"stylesheet",href:e,"data-precedence":n},i),(i=Qn.get(h))&&Kf(e,i);var R=S=l.createElement("link");rn(R),pn(R,"link",e),R._p=new Promise(function(F,Q){R.onload=F,R.onerror=Q}),R.addEventListener("load",function(){N.loading|=1}),R.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Sc(S,n,l)}S={type:"stylesheet",instance:S,count:1,state:N},f.set(h,S)}}}function y2(e,n){aa.X(e,n);var i=No;if(i&&e){var l=Yi(i).hoistableScripts,f=Eo(e),h=l.get(f);h||(h=i.querySelector(Lr(f)),h||(e=_({src:e,async:!0},n),(n=Qn.get(f))&&Zf(e,n),h=i.createElement("script"),rn(h),pn(h,"link",e),i.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(f,h))}}function b2(e,n){aa.M(e,n);var i=No;if(i&&e){var l=Yi(i).hoistableScripts,f=Eo(e),h=l.get(f);h||(h=i.querySelector(Lr(f)),h||(e=_({src:e,async:!0,type:"module"},n),(n=Qn.get(f))&&Zf(e,n),h=i.createElement("script"),rn(h),pn(h,"link",e),i.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(f,h))}}function Y0(e,n,i,l){var f=(f=wt.current)?kc(f):null;if(!f)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(n=Co(i.href),i=Yi(f).hoistableStyles,l=i.get(n),l||(l={type:"style",instance:null,count:0,state:null},i.set(n,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=Co(i.href);var h=Yi(f).hoistableStyles,S=h.get(e);if(S||(f=f.ownerDocument||f,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,S),(h=f.querySelector(Or(e)))&&!h._p&&(S.instance=h,S.state.loading=5),Qn.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Qn.set(e,i),h||_2(f,e,i,S.state))),n&&l===null)throw Error(r(528,""));return S}if(n&&l!==null)throw Error(r(529,""));return null;case"script":return n=i.async,i=i.src,typeof i=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Eo(i),i=Yi(f).hoistableScripts,l=i.get(n),l||(l={type:"script",instance:null,count:0,state:null},i.set(n,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function Co(e){return'href="'+Gn(e)+'"'}function Or(e){return'link[rel="stylesheet"]['+e+"]"}function J0(e){return _({},e,{"data-precedence":e.precedence,precedence:null})}function _2(e,n,i,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}),pn(n,"link",i),rn(n),e.head.appendChild(n))}function Eo(e){return'[src="'+Gn(e)+'"]'}function Lr(e){return"script[async]"+e}function W0(e,n,i){if(n.count++,n.instance===null)switch(n.type){case"style":var l=e.querySelector('style[data-href~="'+Gn(i.href)+'"]');if(l)return n.instance=l,rn(l),l;var f=_({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),rn(l),pn(l,"style",f),Sc(l,i.precedence,e),n.instance=l;case"stylesheet":f=Co(i.href);var h=e.querySelector(Or(f));if(h)return n.state.loading|=4,n.instance=h,rn(h),h;l=J0(i),(f=Qn.get(f))&&Kf(l,f),h=(e.ownerDocument||e).createElement("link"),rn(h);var S=h;return S._p=new Promise(function(N,R){S.onload=N,S.onerror=R}),pn(h,"link",l),n.state.loading|=4,Sc(h,i.precedence,e),n.instance=h;case"script":return h=Eo(i.src),(f=e.querySelector(Lr(h)))?(n.instance=f,rn(f),f):(l=i,(f=Qn.get(h))&&(l=_({},i),Zf(l,f)),e=e.ownerDocument||e,f=e.createElement("script"),rn(f),pn(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,Sc(l,i.precedence,e));return n.instance}function Sc(e,n,i){for(var l=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=l.length?l[l.length-1]:null,h=f,S=0;S<l.length;S++){var N=l[S];if(N.dataset.precedence===n)h=N;else if(h!==f)break}h?h.parentNode.insertBefore(e,h.nextSibling):(n=i.nodeType===9?i.head:i,n.insertBefore(e,n.firstChild))}function Kf(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Zf(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var jc=null;function X0(e,n,i){if(jc===null){var l=new Map,f=jc=new Map;f.set(i,l)}else f=jc,l=f.get(i),l||(l=new Map,f.set(i,l));if(l.has(e))return l;for(l.set(e,null),i=i.getElementsByTagName(e),f=0;f<i.length;f++){var h=i[f];if(!(h[Hs]||h[Ie]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var S=h.getAttribute(n)||"";S=e+S;var N=l.get(S);N?N.push(h):l.set(S,[h])}}return l}function Q0(e,n,i){e=e.ownerDocument||e,e.head.insertBefore(i,n==="title"?e.querySelector("head > title"):null)}function x2(e,n,i){if(i===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 ey(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function k2(e,n,i,l){if(i.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var f=Co(l.href),h=n.querySelector(Or(f));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=wc.bind(e),n.then(e,e)),i.state.loading|=4,i.instance=h,rn(h);return}h=n.ownerDocument||n,l=J0(l),(f=Qn.get(f))&&Kf(l,f),h=h.createElement("link"),rn(h);var S=h;S._p=new Promise(function(N,R){S.onload=N,S.onerror=R}),pn(h,"link",l),i.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,n),(n=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=wc.bind(e),n.addEventListener("load",i),n.addEventListener("error",i))}}var Yf=0;function S2(e,n){return e.stylesheets&&e.count===0&&Nc(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var l=setTimeout(function(){if(e.stylesheets&&Nc(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+n);0<e.imgBytes&&Yf===0&&(Yf=62500*s2());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Nc(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Yf?50:800)+n);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(f)}}:null}function wc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Nc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Tc=null;function Nc(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Tc=new Map,n.forEach(j2,e),Tc=null,wc.call(e))}function j2(e,n){if(!(n.state.loading&4)){var i=Tc.get(e);if(i)var l=i.get(null);else{i=new Map,Tc.set(e,i);for(var f=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<f.length;h++){var S=f[h];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(i.set(S.dataset.precedence,S),l=S)}l&&i.set(null,l)}f=n.instance,S=f.getAttribute("data-precedence"),h=i.get(S)||l,h===l&&i.set(null,f),i.set(S,f),this.count++,l=wc.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 Br={$$typeof:D,Provider:null,Consumer:null,_currentValue:se,_currentValue2:se,_threadCount:0};function w2(e,n,i,l,f,h,S,N,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=Fi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fi(0),this.hiddenUpdates=Fi(null),this.identifierPrefix=l,this.onUncaughtError=f,this.onCaughtError=h,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function ty(e,n,i,l,f,h,S,N,R,F,Q,ae){return e=new w2(e,n,i,S,R,F,Q,ae,N),n=1,h===!0&&(n|=24),h=Dn(3,null,null,n),e.current=h,h.stateNode=e,n=Nu(),n.refCount++,e.pooledCache=n,n.refCount++,h.memoizedState={element:l,isDehydrated:i,cache:n},Du(h),e}function ny(e){return e?(e=io,e):io}function sy(e,n,i,l,f,h){f=ny(f),l.context===null?l.context=f:l.pendingContext=f,l=Ta(n),l.payload={element:i},h=h===void 0?null:h,h!==null&&(l.callback=h),i=Na(e,l,n),i!==null&&(En(i,e,n),hr(i,e,n))}function ay(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<n?i:n}}function Jf(e,n){ay(e,n),(e=e.alternate)&&ay(e,n)}function iy(e){if(e.tag===13||e.tag===31){var n=hi(e,67108864);n!==null&&En(n,e,67108864),Jf(e,67108864)}}function oy(e){if(e.tag===13||e.tag===31){var n=Ln();n=ye(n);var i=hi(e,n);i!==null&&En(i,e,n),Jf(e,n)}}var Cc=!0;function T2(e,n,i,l){var f=$.T;$.T=null;var h=B.p;try{B.p=2,Wf(e,n,i,l)}finally{B.p=h,$.T=f}}function N2(e,n,i,l){var f=$.T;$.T=null;var h=B.p;try{B.p=8,Wf(e,n,i,l)}finally{B.p=h,$.T=f}}function Wf(e,n,i,l){if(Cc){var f=Xf(l);if(f===null)Bf(e,n,l,Ec,i),ly(e,l);else if(E2(f,e,n,i,l))l.stopPropagation();else if(ly(e,l),n&4&&-1<C2.indexOf(e)){for(;f!==null;){var h=Zi(f);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var S=Ss(h.pendingLanes);if(S!==0){var N=h;for(N.pendingLanes|=2,N.entangledLanes|=2;S;){var R=1<<31-Gt(S);N.entanglements[1]|=R,S&=~R}Cs(h),(rt&6)===0&&(uc=qt()+500,Dr(0))}}break;case 31:case 13:N=hi(h,2),N!==null&&En(N,h,2),pc(),Jf(h,2)}if(h=Xf(l),h===null&&Bf(e,n,l,Ec,i),h===f)break;f=h}f!==null&&l.stopPropagation()}else Bf(e,n,l,null,i)}}function Xf(e){return e=Qd(e),Qf(e)}var Ec=null;function Qf(e){if(Ec=null,e=Ki(e),e!==null){var n=d(e);if(n===null)e=null;else{var i=n.tag;if(i===13){if(e=u(n),e!==null)return e;e=null}else if(i===31){if(e=p(n),e!==null)return e;e=null}else if(i===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Ec=e,null}function ry(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(Ui()){case ai:return 2;case va:return 8;case $s:case ii:return 32;case oi:return 268435456;default:return 32}default:return 32}}var ep=!1,$a=null,za=null,Ha=null,$r=new Map,zr=new Map,Pa=[],C2="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 ly(e,n){switch(e){case"focusin":case"focusout":$a=null;break;case"dragenter":case"dragleave":za=null;break;case"mouseover":case"mouseout":Ha=null;break;case"pointerover":case"pointerout":$r.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":zr.delete(n.pointerId)}}function Hr(e,n,i,l,f,h){return e===null||e.nativeEvent!==h?(e={blockedOn:n,domEventName:i,eventSystemFlags:l,nativeEvent:h,targetContainers:[f]},n!==null&&(n=Zi(n),n!==null&&iy(n)),e):(e.eventSystemFlags|=l,n=e.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),e)}function E2(e,n,i,l,f){switch(n){case"focusin":return $a=Hr($a,e,n,i,l,f),!0;case"dragenter":return za=Hr(za,e,n,i,l,f),!0;case"mouseover":return Ha=Hr(Ha,e,n,i,l,f),!0;case"pointerover":var h=f.pointerId;return $r.set(h,Hr($r.get(h)||null,e,n,i,l,f)),!0;case"gotpointercapture":return h=f.pointerId,zr.set(h,Hr(zr.get(h)||null,e,n,i,l,f)),!0}return!1}function cy(e){var n=Ki(e.target);if(n!==null){var i=d(n);if(i!==null){if(n=i.tag,n===13){if(n=u(i),n!==null){e.blockedOn=n,Le(e.priority,function(){oy(i)});return}}else if(n===31){if(n=p(i),n!==null){e.blockedOn=n,Le(e.priority,function(){oy(i)});return}}else if(n===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ac(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var i=Xf(e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);Xd=l,i.target.dispatchEvent(l),Xd=null}else return n=Zi(i),n!==null&&iy(n),e.blockedOn=i,!1;n.shift()}return!0}function dy(e,n,i){Ac(e)&&i.delete(n)}function A2(){ep=!1,$a!==null&&Ac($a)&&($a=null),za!==null&&Ac(za)&&(za=null),Ha!==null&&Ac(Ha)&&(Ha=null),$r.forEach(dy),zr.forEach(dy)}function Dc(e,n){e.blockedOn===n&&(e.blockedOn=null,ep||(ep=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,A2)))}var Mc=null;function uy(e){Mc!==e&&(Mc=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Mc===e&&(Mc=null);for(var n=0;n<e.length;n+=3){var i=e[n],l=e[n+1],f=e[n+2];if(typeof l!="function"){if(Qf(l||i)===null)continue;break}var h=Zi(i);h!==null&&(e.splice(n,3),n-=3,Wu(h,{pending:!0,data:f,method:i.method,action:l},l,f))}}))}function Ao(e){function n(R){return Dc(R,e)}$a!==null&&Dc($a,e),za!==null&&Dc(za,e),Ha!==null&&Dc(Ha,e),$r.forEach(n),zr.forEach(n);for(var i=0;i<Pa.length;i++){var l=Pa[i];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Pa.length&&(i=Pa[0],i.blockedOn===null);)cy(i),i.blockedOn===null&&Pa.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(l=0;l<i.length;l+=3){var f=i[l],h=i[l+1],S=f[Me]||null;if(typeof h=="function")S||uy(i);else if(S){var N=null;if(h&&h.hasAttribute("formAction")){if(f=h,S=h[Me]||null)N=S.formAction;else if(Qf(f)!==null)continue}else N=S.action;typeof N=="function"?i[l+1]=N:(i.splice(l,3),l-=3),uy(i)}}}function fy(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(S){return f=S})},focusReset:"manual",scroll:"manual"})}function n(){f!==null&&(f(),f=null),l||setTimeout(i,20)}function i(){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(i,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function tp(e){this._internalRoot=e}Rc.prototype.render=tp.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(r(409));var i=n.current,l=Ln();sy(i,l,e,n,null,null)},Rc.prototype.unmount=tp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;sy(e.current,2,null,e,null,null),pc(),n[Mt]=null}};function Rc(e){this._internalRoot=e}Rc.prototype.unstable_scheduleHydration=function(e){if(e){var n=Se();e={blockedOn:null,target:e,priority:n};for(var i=0;i<Pa.length&&n!==0&&n<Pa[i].priority;i++);Pa.splice(i,0,e),i===0&&cy(e)}};var py=s.version;if(py!=="19.2.4")throw Error(r(527,py,"19.2.4"));B.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 D2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ic=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ic.isDisabled&&Ic.supportsFiber)try{ze=Ic.inject(D2),ht=Ic}catch{}}return Pr.createRoot=function(e,n){if(!c(e))throw Error(r(299));var i=!1,l="",f=_v,h=xv,S=kv;return n!=null&&(n.unstable_strictMode===!0&&(i=!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&&(S=n.onRecoverableError)),n=ty(e,1,!1,null,null,i,l,null,f,h,S,fy),e[Mt]=n.current,Lf(e),new tp(n)},Pr.hydrateRoot=function(e,n,i){if(!c(e))throw Error(r(299));var l=!1,f="",h=_v,S=xv,N=kv,R=null;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onUncaughtError!==void 0&&(h=i.onUncaughtError),i.onCaughtError!==void 0&&(S=i.onCaughtError),i.onRecoverableError!==void 0&&(N=i.onRecoverableError),i.formState!==void 0&&(R=i.formState)),n=ty(e,1,!0,n,i??null,l,f,R,h,S,N,fy),n.context=ny(null),i=n.current,l=Ln(),l=ye(l),f=Ta(l),f.callback=null,Na(i,f,l),i=l,n.current.lanes=i,di(n,i),Cs(n),e[Mt]=n.current,Lf(e),new Rc(n)},Pr.version="19.2.4",Pr}var xy;function rj(){if(xy)return np.exports;xy=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(),np.exports=oj(),np.exports}var lj=rj();const cj="modulepreload",dj=function(t){return"/"+t},ky={},B_=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(_=>({status:"fulfilled",value:_}),_=>({status:"rejected",reason:_}))))};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=dj(g),g in ky)return;ky[g]=!0;const v=g.endsWith(".css"),_=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${_}`))return;const b=document.createElement("link");if(b.rel=v?"stylesheet":cj,v||(b.as="script"),b.crossOrigin="",b.href=g,m&&b.setAttribute("nonce",m),document.head.appendChild(b),v)return new Promise((x,k)=>{b.addEventListener("load",x),b.addEventListener("error",()=>k(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)})},uj=new Proxy(globalThis.fetch,{apply(t,s,o){return Reflect.apply(globalThis.fetch,s,o)}}),Ad=P2({baseUrl:"/",fetch:uj}),$e=Nd(U2,Ad),hn=Nd(V2,Ad),$c=Nd(q2,Ad),zc=Nd(G2,Ad),fj="_bar_1xlm9_1",pj="_textarea_1xlm9_32",mj="_select_1xlm9_73",hj="_btnPrimary_1xlm9_109",gj="_btnGhost_1xlm9_179",vj="_badge_1xlm9_201",yj="_disconnectHint_1xlm9_211",_s={bar:fj,textarea:pj,select:mj,btnPrimary:hj,btnGhost:gj,badge:vj,disconnectHint:yj},bj=200;function _j(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 xj({environmentId:t,onReconnect:s}){return a.jsxs(a.Fragment,{children:[a.jsx("span",{className:_s.disconnectHint,"data-testid":"env-disconnect-hint",children:"Environment unavailable"}),a.jsx("button",{type:"button",onClick:()=>s(t),className:_s.btnGhost,"data-testid":"reconnect-btn",title:"Reconnect the environment to resume messaging",children:"Reconnect"})]})}function ip({value:t,onChange:s,onSubmit:o,placeholder:r,disabled:c,autoFocus:d,ariaLabel:u}){const p=y.useRef(null);y.useLayoutEffect(()=>{const g=p.current;g&&(g.style.height="auto",g.style.height=`${Math.min(g.scrollHeight,bj)}px`)},[t]);const m=g=>{g.key==="Enter"&&(g.metaKey||g.ctrlKey)&&!g.nativeEvent.isComposing&&(g.preventDefault(),o())};return a.jsx("textarea",{ref:p,rows:1,value:t,onChange:g=>s(g.target.value),onKeyDown:m,placeholder:r,disabled:c,autoFocus:d,className:_s.textarea,"aria-label":u})}function Dd({mode:t,sessionId:s,environmentId:o,taskId:r,showPersonaSelect:c,personas:d,environments:u,onSendInput:p,onSpawn:m,onStartTask:g,onProvisionEnvironment:v,onShowToast:_}){const[b,x]=y.useState(""),[k,j]=y.useState(""),w=_j(o,u),T=()=>{if(b.trim())if(t==="send"){if(!s||w)return;p(s,b),x("")}else if(t==="spawn"){if(!o)return;m(o,b,k),_==null||_("Session started","success"),x(""),j("")}else{if(!r)return;g(r,void 0,o,b),x("")}},C=D=>{D.preventDefault(),T()};return t==="spawn"?a.jsxs("form",{onSubmit:C,className:_s.bar,children:[a.jsx("span",{className:_s.badge,children:"new chat"}),a.jsx(ip,{value:b,onChange:x,onSubmit:T,placeholder:"Enter prompt...",autoFocus:!0,ariaLabel:"Enter prompt"}),c&&a.jsxs("select",{value:k,onChange:D=>j(D.target.value),className:_s.select,"aria-label":"Select persona",children:[a.jsx("option",{value:"",children:"(Default)"}),d.map(D=>a.jsx("option",{value:D.id,children:D.name},D.id))]}),a.jsx("button",{type:"submit",disabled:!b.trim()||!o,className:_s.btnPrimary,children:"Go"})]}):t==="start"?a.jsxs("form",{onSubmit:C,className:_s.bar,children:[a.jsx(ip,{value:b,onChange:x,onSubmit:T,placeholder:"Type a message...",autoFocus:!0,ariaLabel:"Type a message"}),a.jsx("button",{type:"submit",disabled:!b.trim(),className:_s.btnPrimary,children:"Send"})]}):a.jsxs("form",{onSubmit:C,className:_s.bar,children:[w&&o&&a.jsx(xj,{environmentId:o,onReconnect:v}),a.jsx(ip,{value:b,onChange:x,onSubmit:T,placeholder:"Type a message...",autoFocus:!w,disabled:w,ariaLabel:"Type a message"}),a.jsx("span",{title:w?"Environment is unavailable — reconnect first":void 0,children:a.jsx("button",{type:"submit",disabled:!b.trim()||w,className:_s.btnPrimary,children:"Send"})})]})}const Sy=220,jy=70,kj=40,Sj=60,jj="hierarchy",wj="dependency";function Tj(t){return y.useMemo(()=>{if(t.length===0)return{nodes:[],edges:[]};const s=new my.graphlib.Graph({multigraph:!0});s.setDefaultEdgeLabel(()=>({})),s.setGraph({rankdir:"TB",nodesep:kj,ranksep:Sj});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:Sy,height:jy});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:jj},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:wj},style:{stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeDasharray:"6 3"},animated:!1})}}return my.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-Sy/2,y:p.y-jy/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 Nj=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$_=(...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 Cj={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 Ej=y.forwardRef(({color:t="currentColor",size:s=24,strokeWidth:o=2,absoluteStrokeWidth:r,className:c="",children:d,iconNode:u,...p},m)=>y.createElement("svg",{ref:m,...Cj,width:s,height:s,stroke:t,strokeWidth:r?Number(o)*24/Number(s):o,className:$_("lucide",c),...p},[...u.map(([g,v])=>y.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 Re=(t,s)=>{const o=y.forwardRef(({className:r,...c},d)=>y.createElement(Ej,{ref:d,iconNode:s,className:$_(`lucide-${Nj(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 Aj=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],wy=Re("ArrowDown",Aj);/**
|
|
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 Dj=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Ty=Re("ArrowUp",Dj);/**
|
|
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 Mj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],Rj=Re("Ban",Mj);/**
|
|
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 Ij=[["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"}]],Oj=Re("Brain",Ij);/**
|
|
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 Lj=[["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"}]],Bj=Re("CalendarClock",Lj);/**
|
|
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 $j=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],$i=Re("Check",$j);/**
|
|
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 zj=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],z_=Re("ChevronDown",zj);/**
|
|
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 Hj=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ga=Re("ChevronRight",Hj);/**
|
|
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 Pj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ja=Re("Circle",Pj);/**
|
|
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 Uj=[["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"}]],Vj=Re("ClipboardList",Uj);/**
|
|
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 qj=[["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"}]],H_=Re("Clipboard",qj);/**
|
|
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 Gj=[["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"}]],Fj=Re("Cog",Gj);/**
|
|
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 Kj=[["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"}]],Zj=Re("Copy",Kj);/**
|
|
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 Yj=[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]],Jj=Re("CornerDownRight",Yj);/**
|
|
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 Wj=[["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"}]],Xj=Re("FilePen",Wj);/**
|
|
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 Qj=[["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"}]],ew=Re("FileText",Qj);/**
|
|
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 tw=[["polyline",{points:"15 17 20 12 15 7",key:"1w3sku"}],["path",{d:"M4 18v-2a4 4 0 0 1 4-4h12",key:"jmiej9"}]],nw=Re("Forward",tw);/**
|
|
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 sw=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],aw=Re("GitBranch",sw);/**
|
|
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 iw=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],ow=Re("Github",iw);/**
|
|
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 rw=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],lw=Re("Hash",rw);/**
|
|
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 cw=[["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"}]],dw=Re("House",cw);/**
|
|
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 uw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Tm=Re("Info",uw);/**
|
|
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 fw=[["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"}]],pw=Re("Key",fw);/**
|
|
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 mw=[["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"}]],hw=Re("Keyboard",mw);/**
|
|
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 gw=[["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"}]],vw=Re("ListChecks",gw);/**
|
|
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 yw=[["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"}]],bw=Re("List",yw);/**
|
|
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 _w=[["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"}]],xw=Re("Loader",_w);/**
|
|
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 kw=[["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"}]],Sw=Re("Menu",kw);/**
|
|
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 jw=[["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"}]],ww=Re("MessageSquare",jw);/**
|
|
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 Tw=[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]],Nw=Re("MessagesSquare",Tw);/**
|
|
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 Cw=[["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"}]],Ew=Re("Monitor",Cw);/**
|
|
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 Aw=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],Dw=Re("Network",Aw);/**
|
|
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 Mw=[["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"}]],Rw=Re("Palette",Mw);/**
|
|
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 Iw=[["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"}]],Ow=Re("Pause",Iw);/**
|
|
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 Lw=[["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"}]],Bw=Re("Pencil",Lw);/**
|
|
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 $w=[["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"}]],zw=Re("Puzzle",$w);/**
|
|
227
|
+
* @license lucide-react v0.474.0 - ISC
|
|
228
|
+
*
|
|
229
|
+
* This source code is licensed under the ISC license.
|
|
230
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
+
*/const Hw=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Pw=Re("RefreshCw",Hw);/**
|
|
232
|
+
* @license lucide-react v0.474.0 - ISC
|
|
233
|
+
*
|
|
234
|
+
* This source code is licensed under the ISC license.
|
|
235
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
+
*/const Uw=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],ud=Re("Search",Uw);/**
|
|
237
|
+
* @license lucide-react v0.474.0 - ISC
|
|
238
|
+
*
|
|
239
|
+
* This source code is licensed under the ISC license.
|
|
240
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
+
*/const Vw=[["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"}]],qw=Re("Settings",Vw);/**
|
|
242
|
+
* @license lucide-react v0.474.0 - ISC
|
|
243
|
+
*
|
|
244
|
+
* This source code is licensed under the ISC license.
|
|
245
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
+
*/const Gw=[["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"}]],Fw=Re("SquareCheckBig",Gw);/**
|
|
247
|
+
* @license lucide-react v0.474.0 - ISC
|
|
248
|
+
*
|
|
249
|
+
* This source code is licensed under the ISC license.
|
|
250
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
+
*/const Kw=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Zw=Re("Star",Kw);/**
|
|
252
|
+
* @license lucide-react v0.474.0 - ISC
|
|
253
|
+
*
|
|
254
|
+
* This source code is licensed under the ISC license.
|
|
255
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
+
*/const Yw=[["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"}]],Nm=Re("TriangleAlert",Yw);/**
|
|
257
|
+
* @license lucide-react v0.474.0 - ISC
|
|
258
|
+
*
|
|
259
|
+
* This source code is licensed under the ISC license.
|
|
260
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
+
*/const Jw=[["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"}]],Ww=Re("User",Jw);/**
|
|
262
|
+
* @license lucide-react v0.474.0 - ISC
|
|
263
|
+
*
|
|
264
|
+
* This source code is licensed under the ISC license.
|
|
265
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
+
*/const Xw=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ls=Re("X",Xw),Cm=8,We=12,Vt=14,kt=16,Jp={not_started:{color:"var(--text-tertiary)",icon:a.jsx(Ja,{size:We}),label:"Not Started"},working:{color:"var(--accent-green)",icon:a.jsx(Ja,{size:We,fill:"currentColor"}),label:"Working"},paused:{color:"var(--accent-yellow)",icon:a.jsx(Ow,{size:We}),label:"Paused"},complete:{color:"var(--accent-green)",icon:a.jsx($i,{size:We}),label:"Complete"},failed:{color:"var(--accent-red)",icon:a.jsx(Ls,{size:We}),label:"Failed"},blocked:{color:"var(--accent-yellow)",icon:a.jsx(Rj,{size:We}),label:"Blocked"}};function Wa(t){return t==="blocked"?Jp.blocked:Jp[ml(t)]}const Qw={not_started:"statusPending",working:"statusInProgress",paused:"statusWaitingInput",complete:"statusDone",failed:"statusFailed"};function eT(t){return Qw[ml(t)]??"statusPending"}const tT=["working","paused","failed","not_started","blocked","complete"],Ny=["not_started","working","paused","complete","failed"],nT={pending:"not_started",assigned:"not_started",in_progress:"working",waiting_input:"paused",review:"paused",done:"complete"};function ml(t){return t in Jp&&t!=="blocked"?t:nT[t]??"not_started"}const sT={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"},aT="_dagContainer_js4w6_1",iT="_taskNode_js4w6_26",oT="_taskNodeBorder_js4w6_54",rT="_taskNodeContent_js4w6_60",lT="_taskNodeHeader_js4w6_70",cT="_taskNodeIcon_js4w6_77",dT="_taskNodeTitle_js4w6_82",uT="_taskNodeBadges_js4w6_90",fT="_childBadge_js4w6_95",pT="_depBadge_js4w6_107",mT="_handle_js4w6_119",hT="_emptyCta_js4w6_126",gT="_ctaDescription_js4w6_137",vT="_ctaButton_js4w6_144",Sn={dagContainer:aT,taskNode:iT,taskNodeBorder:oT,taskNodeContent:rT,taskNodeHeader:lT,taskNodeIcon:cT,taskNodeTitle:dT,taskNodeBadges:uT,childBadge:fT,depBadge:pT,handle:mT,emptyCta:hT,ctaDescription:gT,ctaButton:vT};function yT({data:t}){const{task:s,childCount:o,doneChildCount:r,hasDependencies:c}=t,d=Wa(s.status);return a.jsxs("div",{className:Sn.taskNode,"data-task-id":s.id,"data-task-title":s.title,children:[a.jsx(hy,{type:"target",position:gy.Top,className:Sn.handle}),a.jsx("div",{className:Sn.taskNodeBorder,style:{backgroundColor:d.color}}),a.jsxs("div",{className:Sn.taskNodeContent,children:[a.jsxs("div",{className:Sn.taskNodeHeader,children:[a.jsx("span",{className:Sn.taskNodeIcon,style:{color:d.color},children:d.icon}),a.jsx("span",{className:Sn.taskNodeTitle,children:s.title})]}),a.jsxs("div",{className:Sn.taskNodeBadges,children:[o>0&&a.jsxs("span",{className:Sn.childBadge,children:[r,"/",o]}),c&&a.jsx("span",{className:Sn.depBadge,children:"dep"})]})]}),a.jsx(hy,{type:"source",position:gy.Bottom,className:Sn.handle})]})}/**
|
|
267
|
+
* react-router v7.13.2
|
|
268
|
+
*
|
|
269
|
+
* Copyright (c) Remix Software Inc.
|
|
270
|
+
*
|
|
271
|
+
* This source code is licensed under the MIT license found in the
|
|
272
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
273
|
+
*
|
|
274
|
+
* @license MIT
|
|
275
|
+
*/var Cy="popstate";function Ey(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function bT(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 Wp("",{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:ol(c)}return xT(s,o,null,t)}function St(t,s){if(t===!1||t===null||typeof t>"u")throw new Error(s)}function os(t,s){if(!t){typeof console<"u"&&console.warn(s);try{throw new Error(s)}catch{}}}function _T(){return Math.random().toString(36).substring(2,10)}function Ay(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 Wp(t,s,o=null,r,c){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof s=="string"?Fo(s):s,state:o,key:s&&s.key||r||_T(),unstable_mask:c}}function ol({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 Fo(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 xT(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 _(){p="POP";let w=v(),T=w==null?null:w-g;g=w,m&&m({action:p,location:j.location,delta:T})}function b(w,T){p="PUSH";let C=Ey(w)?w:Wp(j.location,w,T);g=v()+1;let D=Ay(C,g),O=j.createHref(C.unstable_mask||C);try{u.pushState(D,"",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 x(w,T){p="REPLACE";let C=Ey(w)?w:Wp(j.location,w,T);g=v();let D=Ay(C,g),O=j.createHref(C.unstable_mask||C);u.replaceState(D,"",O),d&&m&&m({action:p,location:j.location,delta:0})}function k(w){return kT(w)}let j={get action(){return p},get location(){return t(c,u)},listen(w){if(m)throw new Error("A history only accepts one active listener");return c.addEventListener(Cy,_),m=w,()=>{c.removeEventListener(Cy,_),m=null}},createHref(w){return s(c,w)},createURL:k,encodeLocation(w){let T=k(w);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:b,replace:x,go(w){return u.go(w)}};return j}function kT(t,s=!1){let o="http://localhost";typeof window<"u"&&(o=window.location.origin!=="null"?window.location.origin:window.location.href),St(o,"No window.location.(origin|href) available to create URL");let r=typeof t=="string"?t:ol(t);return r=r.replace(/ $/,"%20"),!s&&r.startsWith("//")&&(r=o+r),new URL(r,o)}function P_(t,s,o="/"){return ST(t,s,o,!1)}function ST(t,s,o,r){let c=typeof s=="string"?Fo(s):s,d=pa(c.pathname||"/",o);if(d==null)return null;let u=U_(t);jT(u);let p=null;for(let m=0;p==null&&m<u.length;++m){let g=q_(d);p=RT(u[m],g,r)}return p}function U_(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;St(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 _=Rs([r,v.relativePath]),b=o.concat(v);u.children&&u.children.length>0&&(St(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${_}".`),U_(u.children,s,b,_,m)),!(u.path==null&&!u.index)&&s.push({path:_,score:DT(_,u.index),routesMeta:b})};return t.forEach((u,p)=>{var m;if(u.path===""||!((m=u.path)!=null&&m.includes("?")))d(u,p);else for(let g of V_(u.path))d(u,p,!0,g)}),s}function V_(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=V_(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 jT(t){t.sort((s,o)=>s.score!==o.score?o.score-s.score:MT(s.routesMeta.map(r=>r.childrenIndex),o.routesMeta.map(r=>r.childrenIndex)))}var wT=/^:[\w-]+$/,TT=3,NT=2,CT=1,ET=10,AT=-2,Dy=t=>t==="*";function DT(t,s){let o=t.split("/"),r=o.length;return o.some(Dy)&&(r+=AT),s&&(r+=NT),o.filter(c=>!Dy(c)).reduce((c,d)=>c+(wT.test(d)?TT:d===""?CT:ET),r)}function MT(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 RT(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)||"/",_=rl({path:m.relativePath,caseSensitive:m.caseSensitive,end:g},v),b=m.route;if(!_&&g&&o&&!r[r.length-1].route.index&&(_=rl({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},v)),!_)return null;Object.assign(c,_.params),u.push({params:c,pathname:Rs([d,_.pathname]),pathnameBase:$T(Rs([d,_.pathnameBase])),route:b}),_.pathnameBase!=="/"&&(d=Rs([d,_.pathnameBase]))}return u}function rl(t,s){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[o,r]=IT(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:_},b)=>{if(v==="*"){let k=p[b]||"";u=d.slice(0,d.length-k.length).replace(/(.)\/+$/,"$1")}const x=p[b];return _&&!x?g[v]=void 0:g[v]=(x||"").replace(/%2F/g,"/"),g},{}),pathname:d,pathnameBase:u,pattern:t}}function IT(t,s=!1,o=!0){os(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 _=v.charAt(g+u.length);return _&&_!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}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 q_(t){try{return t.split("/").map(s=>decodeURIComponent(s).replace(/\//g,"%2F")).join("/")}catch(s){return os(!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 pa(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 OT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function LT(t,s="/"){let{pathname:o,search:r="",hash:c=""}=typeof t=="string"?Fo(t):t,d;return o?(o=o.replace(/\/\/+/g,"/"),o.startsWith("/")?d=My(o.substring(1),"/"):d=My(o,s)):d=s,{pathname:d,search:zT(r),hash:HT(c)}}function My(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 op(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 BT(t){return t.filter((s,o)=>o===0||s.route.path&&s.route.path.length>0)}function Em(t){let s=BT(t);return s.map((o,r)=>r===s.length-1?o.pathname:o.pathnameBase)}function Md(t,s,o,r=!1){let c;typeof t=="string"?c=Fo(t):(c={...t},St(!c.pathname||!c.pathname.includes("?"),op("?","pathname","search",c)),St(!c.pathname||!c.pathname.includes("#"),op("#","pathname","hash",c)),St(!c.search||!c.search.includes("#"),op("#","search","hash",c)));let d=t===""||c.pathname==="",u=d?"/":c.pathname,p;if(u==null)p=o;else{let _=s.length-1;if(!r&&u.startsWith("..")){let b=u.split("/");for(;b[0]==="..";)b.shift(),_-=1;c.pathname=b.join("/")}p=_>=0?s[_]:"/"}let m=LT(c,p),g=u&&u!=="/"&&u.endsWith("/"),v=(d||u===".")&&o.endsWith("/");return!m.pathname.endsWith("/")&&(g||v)&&(m.pathname+="/"),m}var Rs=t=>t.join("/").replace(/\/\/+/g,"/"),$T=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),zT=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,HT=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,PT=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 UT(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function VT(t){return t.map(s=>s.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var G_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function F_(t,s){let o=t;if(typeof o!="string"||!OT.test(o))return{absoluteURL:void 0,isExternal:!1,to:o};let r=o,c=!1;if(G_)try{let d=new URL(window.location.href),u=o.startsWith("//")?new URL(d.protocol+o):new URL(o),p=pa(u.pathname,s);u.origin===d.origin&&p!=null?o=p+u.search+u.hash:c=!0}catch{os(!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 K_=["POST","PUT","PATCH","DELETE"];new Set(K_);var qT=["GET",...K_];new Set(qT);var Ko=y.createContext(null);Ko.displayName="DataRouter";var Rd=y.createContext(null);Rd.displayName="DataRouterState";var GT=y.createContext(!1),Z_=y.createContext({isTransitioning:!1});Z_.displayName="ViewTransition";var FT=y.createContext(new Map);FT.displayName="Fetchers";var KT=y.createContext(null);KT.displayName="Await";var Vn=y.createContext(null);Vn.displayName="Navigation";var hl=y.createContext(null);hl.displayName="Location";var rs=y.createContext({outlet:null,matches:[],isDataRoute:!1});rs.displayName="Route";var Am=y.createContext(null);Am.displayName="RouteError";var Y_="REACT_ROUTER_ERROR",ZT="REDIRECT",YT="ROUTE_ERROR_RESPONSE";function JT(t){if(t.startsWith(`${Y_}:${ZT}:{`))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 WT(t){if(t.startsWith(`${Y_}:${YT}:{`))try{let s=JSON.parse(t.slice(40));if(typeof s=="object"&&s&&typeof s.status=="number"&&typeof s.statusText=="string")return new PT(s.status,s.statusText,s.data)}catch{}}function XT(t,{relative:s}={}){St(zi(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:r}=y.useContext(Vn),{hash:c,pathname:d,search:u}=gl(t,{relative:s}),p=d;return o!=="/"&&(p=d==="/"?o:Rs([o,d])),r.createHref({pathname:p,search:u,hash:c})}function zi(){return y.useContext(hl)!=null}function an(){return St(zi(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(hl).location}function Ot(t){St(zi(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:s}=an();return y.useMemo(()=>rl(t,q_(s)),[s,t])}var J_="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function W_(t){y.useContext(Vn).static||y.useLayoutEffect(t)}function Id(){let{isDataRoute:t}=y.useContext(rs);return t?pN():QT()}function QT(){St(zi(),"useNavigate() may be used only in the context of a <Router> component.");let t=y.useContext(Ko),{basename:s,navigator:o}=y.useContext(Vn),{matches:r}=y.useContext(rs),{pathname:c}=an(),d=JSON.stringify(Em(r)),u=y.useRef(!1);return W_(()=>{u.current=!0}),y.useCallback((m,g={})=>{if(os(u.current,J_),!u.current)return;if(typeof m=="number"){o.go(m);return}let v=Md(m,JSON.parse(d),c,g.relative==="path");t==null&&s!=="/"&&(v.pathname=v.pathname==="/"?s:Rs([s,v.pathname])),(g.replace?o.replace:o.push)(v,g.state,g)},[s,o,d,c,t])}var eN=y.createContext(null);function tN(t){let s=y.useContext(rs).outlet;return y.useMemo(()=>s&&y.createElement(eN.Provider,{value:t},s),[s,t])}function ls(){let{matches:t}=y.useContext(rs),s=t[t.length-1];return s?s.params:{}}function gl(t,{relative:s}={}){let{matches:o}=y.useContext(rs),{pathname:r}=an(),c=JSON.stringify(Em(o));return y.useMemo(()=>Md(t,JSON.parse(c),r,s==="path"),[t,c,r,s])}function nN(t,s){return X_(t,s)}function X_(t,s,o){var w;St(zi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=y.useContext(Vn),{matches:c}=y.useContext(rs),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||"";ex(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.
|
|
276
|
+
|
|
277
|
+
Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let v=an(),_;if(s){let T=typeof s=="string"?Fo(s):s;St(m==="/"||((w=T.pathname)==null?void 0:w.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.`),_=T}else _=v;let b=_.pathname||"/",x=b;if(m!=="/"){let T=m.replace(/^\//,"").split("/");x="/"+b.replace(/^\//,"").split("/").slice(T.length).join("/")}let k=P_(t,{pathname:x});os(g||k!=null,`No routes matched location "${_.pathname}${_.search}${_.hash}" `),os(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${_.pathname}${_.search}${_.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=rN(k&&k.map(T=>Object.assign({},T,{params:Object.assign({},u,T.params),pathname:Rs([m,r.encodeLocation?r.encodeLocation(T.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?m:Rs([m,r.encodeLocation?r.encodeLocation(T.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),c,o);return s&&j?y.createElement(hl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,..._},navigationType:"POP"}},j):j}function sN(){let t=fN(),s=UT(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=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:d},"ErrorBoundary")," or"," ",y.createElement("code",{style:d},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},s),o?y.createElement("pre",{style:c},o):null,u)}var aN=y.createElement(sN,null),Q_=class extends y.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=WT(t.digest);o&&(t=o)}let s=t!==void 0?y.createElement(rs.Provider,{value:this.props.routeContext},y.createElement(Am.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?y.createElement(iN,{error:t},s):s}};Q_.contextType=GT;var rp=new WeakMap;function iN({children:t,error:s}){let{basename:o}=y.useContext(Vn);if(typeof s=="object"&&s&&"digest"in s&&typeof s.digest=="string"){let r=JT(s.digest);if(r){let c=rp.get(s);if(c)throw c;let d=F_(r.location,o);if(G_&&!rp.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 rp.set(s,u),u}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d.absoluteURL||d.to}`})}}return t}function oN({routeContext:t,match:s,children:o}){let r=y.useContext(Ko);return r&&r.static&&r.staticContext&&(s.route.errorElement||s.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=s.route.id),y.createElement(rs.Provider,{value:t},o)}function rN(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(_=>_.route.id&&(d==null?void 0:d[_.route.id])!==void 0);St(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 _=c[v];if((_.route.HydrateFallback||_.route.hydrateFallbackElement)&&(p=v),_.route.id){let{loaderData:b,errors:x}=r,k=_.route.loader&&!b.hasOwnProperty(_.route.id)&&(!x||x[_.route.id]===void 0);if(_.route.lazy||k){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,_)=>{var b,x;m(v,{location:r.location,params:((x=(b=r.matches)==null?void 0:b[0])==null?void 0:x.params)??{},unstable_pattern:VT(r.matches),errorInfo:_})}:void 0;return c.reduceRight((v,_,b)=>{let x,k=!1,j=null,w=null;r&&(x=d&&_.route.id?d[_.route.id]:void 0,j=_.route.errorElement||aN,u&&(p<0&&b===0?(ex("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,w=null):p===b&&(k=!0,w=_.route.hydrateFallbackElement||null)));let T=s.concat(c.slice(0,b+1)),C=()=>{let D;return x?D=j:k?D=w:_.route.Component?D=y.createElement(_.route.Component,null):_.route.element?D=_.route.element:D=v,y.createElement(oN,{match:_,routeContext:{outlet:v,matches:T,isDataRoute:r!=null},children:D})};return r&&(_.route.ErrorBoundary||_.route.errorElement||b===0)?y.createElement(Q_,{location:r.location,revalidation:r.revalidation,component:j,error:x,children:C(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:g}):C()},null)}function Dm(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function lN(t){let s=y.useContext(Ko);return St(s,Dm(t)),s}function cN(t){let s=y.useContext(Rd);return St(s,Dm(t)),s}function dN(t){let s=y.useContext(rs);return St(s,Dm(t)),s}function Mm(t){let s=dN(t),o=s.matches[s.matches.length-1];return St(o.route.id,`${t} can only be used on routes that contain a unique "id"`),o.route.id}function uN(){return Mm("useRouteId")}function fN(){var r;let t=y.useContext(Am),s=cN("useRouteError"),o=Mm("useRouteError");return t!==void 0?t:(r=s.errors)==null?void 0:r[o]}function pN(){let{router:t}=lN("useNavigate"),s=Mm("useNavigate"),o=y.useRef(!1);return W_(()=>{o.current=!0}),y.useCallback(async(c,d={})=>{os(o.current,J_),o.current&&(typeof c=="number"?await t.navigate(c):await t.navigate(c,{fromRouteId:s,...d}))},[t,s])}var Ry={};function ex(t,s,o){!s&&!Ry[t]&&(Ry[t]=!0,os(!1,o))}y.memo(mN);function mN({routes:t,future:s,state:o,isStatic:r,onError:c}){return X_(t,void 0,{state:o,isStatic:r,onError:c})}function zn({to:t,replace:s,state:o,relative:r}){St(zi(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=y.useContext(Vn);os(!c,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:d}=y.useContext(rs),{pathname:u}=an(),p=Id(),m=Md(t,Em(d),u,r==="path"),g=JSON.stringify(m);return y.useEffect(()=>{p(JSON.parse(g),{replace:s,state:o,relative:r})},[p,g,r,s,o]),null}function ti(t){return tN(t.context)}function je(t){St(!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 hN({basename:t="/",children:s=null,location:o,navigationType:r="POP",navigator:c,static:d=!1,unstable_useTransitions:u}){St(!zi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=t.replace(/^\/*/,"/"),m=y.useMemo(()=>({basename:p,navigator:c,static:d,unstable_useTransitions:u,future:{}}),[p,c,d,u]);typeof o=="string"&&(o=Fo(o));let{pathname:g="/",search:v="",hash:_="",state:b=null,key:x="default",unstable_mask:k}=o,j=y.useMemo(()=>{let w=pa(g,p);return w==null?null:{location:{pathname:w,search:v,hash:_,state:b,key:x,unstable_mask:k},navigationType:r}},[p,g,v,_,b,x,r,k]);return os(j!=null,`<Router basename="${p}"> is not able to match the URL "${g}${v}${_}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:y.createElement(Vn.Provider,{value:m},y.createElement(hl.Provider,{children:s,value:j}))}function gN({children:t,location:s}){return nN(Xp(t),s)}function Xp(t,s=[]){let o=[];return y.Children.forEach(t,(r,c)=>{if(!y.isValidElement(r))return;let d=[...s,c];if(r.type===y.Fragment){o.push.apply(o,Xp(r.props.children,d));return}St(r.type===je,`[${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>`),St(!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=Xp(r.props.children,d)),o.push(u)}),o}var nd="get",sd="application/x-www-form-urlencoded";function Od(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function vN(t){return Od(t)&&t.tagName.toLowerCase()==="button"}function yN(t){return Od(t)&&t.tagName.toLowerCase()==="form"}function bN(t){return Od(t)&&t.tagName.toLowerCase()==="input"}function _N(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function xN(t,s){return t.button===0&&(!s||s==="_self")&&!_N(t)}function Qp(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 kN(t,s){let o=Qp(t);return s&&s.forEach((r,c)=>{o.has(c)||s.getAll(c).forEach(d=>{o.append(c,d)})}),o}var Hc=null;function SN(){if(Hc===null)try{new FormData(document.createElement("form"),0),Hc=!1}catch{Hc=!0}return Hc}var jN=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function lp(t){return t!=null&&!jN.has(t)?(os(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${sd}"`),null):t}function wN(t,s){let o,r,c,d,u;if(yN(t)){let p=t.getAttribute("action");r=p?pa(p,s):null,o=t.getAttribute("method")||nd,c=lp(t.getAttribute("enctype"))||sd,d=new FormData(t)}else if(vN(t)||bN(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?pa(m,s):null,o=t.getAttribute("formmethod")||p.getAttribute("method")||nd,c=lp(t.getAttribute("formenctype"))||lp(p.getAttribute("enctype"))||sd,d=new FormData(p,t),!SN()){let{name:g,type:v,value:_}=t;if(v==="image"){let b=g?`${g}.`:"";d.append(`${b}x`,"0"),d.append(`${b}y`,"0")}else g&&d.append(g,_)}}else{if(Od(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=nd,r=null,c=sd,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 Rm(t,s){if(t===!1||t===null||typeof t>"u")throw new Error(s)}function TN(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&&pa(c.pathname,s)==="/"?c.pathname=`${s.replace(/\/$/,"")}/_root.${r}`:c.pathname=`${c.pathname.replace(/\/$/,"")}.${r}`,c}async function NN(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 CN(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 EN(t,s,o){let r=await Promise.all(t.map(async c=>{let d=s.routes[c.route.id];if(d){let u=await NN(d,o);return u.links?u.links():[]}return[]}));return RN(r.flat(1).filter(CN).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function Iy(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 _;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 b=m.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:((_=o[0])==null?void 0:_.params)||{},nextUrl:new URL(t,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function AN(t,s,{includeHydrateFallback:o}={}){return DN(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 DN(t){return[...new Set(t)]}function MN(t){let s={},o=Object.keys(t).sort();for(let r of o)s[r]=t[r];return s}function RN(t,s){let o=new Set;return new Set(s),t.reduce((r,c)=>{let d=JSON.stringify(MN(c));return o.has(d)||(o.add(d),r.push({key:d,link:c})),r},[])}function tx(){let t=y.useContext(Ko);return Rm(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function IN(){let t=y.useContext(Rd);return Rm(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var Im=y.createContext(void 0);Im.displayName="FrameworkContext";function nx(){let t=y.useContext(Im);return Rm(t,"You must render this element inside a <HydratedRouter> element"),t}function ON(t,s){let o=y.useContext(Im),[r,c]=y.useState(!1),[d,u]=y.useState(!1),{onFocus:p,onBlur:m,onMouseEnter:g,onMouseLeave:v,onTouchStart:_}=s,b=y.useRef(null);y.useEffect(()=>{if(t==="render"&&u(!0),t==="viewport"){let j=T=>{T.forEach(C=>{u(C.isIntersecting)})},w=new IntersectionObserver(j,{threshold:.5});return b.current&&w.observe(b.current),()=>{w.disconnect()}}},[t]),y.useEffect(()=>{if(r){let j=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(j)}}},[r]);let x=()=>{c(!0)},k=()=>{c(!1),u(!1)};return o?t!=="intent"?[d,b,{}]:[d,b,{onFocus:Ur(p,x),onBlur:Ur(m,k),onMouseEnter:Ur(g,x),onMouseLeave:Ur(v,k),onTouchStart:Ur(_,x)}]:[!1,b,{}]}function Ur(t,s){return o=>{t&&t(o),o.defaultPrevented||s(o)}}function LN({page:t,...s}){let{router:o}=tx(),r=y.useMemo(()=>P_(o.routes,t,o.basename),[o.routes,t,o.basename]);return r?y.createElement($N,{page:t,matches:r,...s}):null}function BN(t){let{manifest:s,routeModules:o}=nx(),[r,c]=y.useState([]);return y.useEffect(()=>{let d=!1;return EN(t,s,o).then(u=>{d||c(u)}),()=>{d=!0}},[t,s,o]),r}function $N({page:t,matches:s,...o}){let r=an(),{future:c,manifest:d,routeModules:u}=nx(),{basename:p}=tx(),{loaderData:m,matches:g}=IN(),v=y.useMemo(()=>Iy(t,s,g,d,r,"data"),[t,s,g,d,r]),_=y.useMemo(()=>Iy(t,s,g,d,r,"assets"),[t,s,g,d,r]),b=y.useMemo(()=>{if(t===r.pathname+r.search+r.hash)return[];let j=new Set,w=!1;if(s.forEach(C=>{var O;let D=d.routes[C.route.id];!D||!D.hasLoader||(!v.some(E=>E.route.id===C.route.id)&&C.route.id in m&&((O=u[C.route.id])!=null&&O.shouldRevalidate)||D.hasClientLoader?w=!0:j.add(C.route.id))}),j.size===0)return[];let T=TN(t,p,c.unstable_trailingSlashAwareDataRequests,"data");return w&&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]),x=y.useMemo(()=>AN(_,d),[_,d]),k=BN(_);return y.createElement(y.Fragment,null,b.map(j=>y.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...o})),x.map(j=>y.createElement("link",{key:j,rel:"modulepreload",href:j,...o})),k.map(({key:j,link:w})=>y.createElement("link",{key:j,nonce:o.nonce,...w,crossOrigin:w.crossOrigin??o.crossOrigin})))}function zN(...t){return s=>{t.forEach(o=>{typeof o=="function"?o(s):o!=null&&(o.current=s)})}}var HN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{HN&&(window.__reactRouterVersion="7.13.2")}catch{}function PN({basename:t,children:s,unstable_useTransitions:o,window:r}){let c=y.useRef();c.current==null&&(c.current=bT({window:r,v5Compat:!0}));let d=c.current,[u,p]=y.useState({action:d.action,location:d.location}),m=y.useCallback(g=>{o===!1?p(g):y.startTransition(()=>p(g))},[o]);return y.useLayoutEffect(()=>d.listen(m),[d,m]),y.createElement(hN,{basename:t,children:s,location:u.location,navigationType:u.action,navigator:d,unstable_useTransitions:o})}var sx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Om=y.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:_,viewTransition:b,unstable_defaultShouldRevalidate:x,...k},j){let{basename:w,navigator:T,unstable_useTransitions:C}=y.useContext(Vn),D=typeof v=="string"&&sx.test(v),O=F_(v,w);v=O.to;let E=XT(v,{relative:c}),M=an(),L=null;if(p){let re=Md(p,[],M.unstable_mask?M.unstable_mask.pathname:"/",!0);w!=="/"&&(re.pathname=re.pathname==="/"?w:Rs([w,re.pathname])),L=T.createHref(re)}let[A,P,Y]=ON(r,k),q=GN(v,{replace:u,unstable_mask:p,state:m,target:g,preventScrollReset:_,relative:c,viewTransition:b,unstable_defaultShouldRevalidate:x,unstable_useTransitions:C});function ee(re){s&&s(re),re.defaultPrevented||q(re)}let le=!(O.isExternal||d),W=y.createElement("a",{...k,...Y,href:(le?L:void 0)||O.absoluteURL||E,onClick:le?ee:s,ref:zN(j,P),target:g,"data-discover":!D&&o==="render"?"true":void 0});return A&&!D?y.createElement(y.Fragment,null,W,y.createElement(LN,{page:E})):W});Om.displayName="Link";var UN=y.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 _=gl(u,{relative:g.relative}),b=an(),x=y.useContext(Rd),{navigator:k,basename:j}=y.useContext(Vn),w=x!=null&&JN(_)&&p===!0,T=k.encodeLocation?k.encodeLocation(_).pathname:_.pathname,C=b.pathname,D=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;o||(C=C.toLowerCase(),D=D?D.toLowerCase():null,T=T.toLowerCase()),D&&j&&(D=pa(D,j)||D);const O=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let E=C===T||!c&&C.startsWith(T)&&C.charAt(O)==="/",M=D!=null&&(D===T||!c&&D.startsWith(T)&&D.charAt(T.length)==="/"),L={isActive:E,isPending:M,isTransitioning:w},A=E?s:void 0,P;typeof r=="function"?P=r(L):P=[r,E?"active":null,M?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let Y=typeof d=="function"?d(L):d;return y.createElement(Om,{...g,"aria-current":A,className:P,ref:v,style:Y,to:u,viewTransition:p},typeof m=="function"?m(L):m)});UN.displayName="NavLink";var VN=y.forwardRef(({discover:t="render",fetcherKey:s,navigate:o,reloadDocument:r,replace:c,state:d,method:u=nd,action:p,onSubmit:m,relative:g,preventScrollReset:v,viewTransition:_,unstable_defaultShouldRevalidate:b,...x},k)=>{let{unstable_useTransitions:j}=y.useContext(Vn),w=ZN(),T=YN(p,{relative:g}),C=u.toLowerCase()==="get"?"get":"post",D=typeof p=="string"&&sx.test(p),O=E=>{if(m&&m(E),E.defaultPrevented)return;E.preventDefault();let M=E.nativeEvent.submitter,L=(M==null?void 0:M.getAttribute("formmethod"))||u,A=()=>w(M||E.currentTarget,{fetcherKey:s,method:L,navigate:o,replace:c,state:d,relative:g,preventScrollReset:v,viewTransition:_,unstable_defaultShouldRevalidate:b});j&&o!==!1?y.startTransition(()=>A()):A()};return y.createElement("form",{ref:k,method:C,action:T,onSubmit:r?m:O,...x,"data-discover":!D&&t==="render"?"true":void 0})});VN.displayName="Form";function qN(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ax(t){let s=y.useContext(Ko);return St(s,qN(t)),s}function GN(t,{target:s,replace:o,unstable_mask:r,state:c,preventScrollReset:d,relative:u,viewTransition:p,unstable_defaultShouldRevalidate:m,unstable_useTransitions:g}={}){let v=Id(),_=an(),b=gl(t,{relative:u});return y.useCallback(x=>{if(xN(x,s)){x.preventDefault();let k=o!==void 0?o:ol(_)===ol(b),j=()=>v(t,{replace:k,unstable_mask:r,state:c,preventScrollReset:d,relative:u,viewTransition:p,unstable_defaultShouldRevalidate:m});g?y.startTransition(()=>j()):j()}},[_,v,b,o,r,c,s,t,d,u,p,m,g])}function Lm(t){os(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=y.useRef(Qp(t)),o=y.useRef(!1),r=an(),c=y.useMemo(()=>kN(r.search,o.current?null:s.current),[r.search]),d=Id(),u=y.useCallback((p,m)=>{const g=Qp(typeof p=="function"?p(new URLSearchParams(c)):p);o.current=!0,d("?"+g,m)},[d,c]);return[c,u]}var FN=0,KN=()=>`__${String(++FN)}__`;function ZN(){let{router:t}=ax("useSubmit"),{basename:s}=y.useContext(Vn),o=uN(),r=t.fetch,c=t.navigate;return y.useCallback(async(d,u={})=>{let{action:p,method:m,encType:g,formData:v,body:_}=wN(d,s);if(u.navigate===!1){let b=u.fetcherKey||KN();await r(b,o,u.action||p,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:v,body:_,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:_,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 YN(t,{relative:s}={}){let{basename:o}=y.useContext(Vn),r=y.useContext(rs);St(r,"useFormAction must be used inside a RouteContext");let[c]=r.matches.slice(-1),d={...gl(t||".",{relative:s})},u=an();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(_=>_).forEach(_=>p.append("index",_));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:Rs([o,d.pathname])),ol(d)}function JN(t,{relative:s}={}){let o=y.useContext(Z_);St(o!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=ax("useViewTransitionState"),c=gl(t,{relative:s});if(!o.isTransitioning)return!1;let d=pa(o.currentLocation.pathname,r)||o.currentLocation.pathname,u=pa(o.nextLocation.pathname,r)||o.nextLocation.pathname;return rl(c.pathname,u)!=null||rl(c.pathname,d)!=null}function ut(){const t=Id();return y.useCallback((s,o)=>{typeof s=="number"?t(s):t(s,o)},[t])}function Ld(t){return`/sessions/${encodeURIComponent(t)}`}function Xa(t,s){return s?`/environments/${encodeURIComponent(s)}/workspaces/${encodeURIComponent(t)}`:`/workspaces/${encodeURIComponent(t)}`}function Pn(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 Hi(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 ix(t){return`/sessions/new?${new URLSearchParams({env:t}).toString()}`}const Ho="/environments",WN="/environments/new";function Li(t){return`/environments/${encodeURIComponent(t)}`}function XN(t){return`/environments/${encodeURIComponent(t)}/edit`}const Ii="/settings",QN="/settings/credentials",cp="/settings/personas",eC="/settings/personas/new";function ox(t){return`/settings/personas/${encodeURIComponent(t)}`}const dp="/settings/schedules",tC="/settings/schedules/new";function rx(t){return`/settings/schedules/${encodeURIComponent(t)}`}const nC="/settings/shortcuts",sC="/pair",aC="/chat",lx="/coordination",Zo="/",iC="/tasks",cx="/workspaces/new",dx="/knowledge",Bd="/findings";function oC(t,s){return t&&s?`/environments/${encodeURIComponent(s)}/workspaces/${encodeURIComponent(t)}/findings`:Bd}function em(t,s,o){const r=encodeURIComponent(t);return s&&o?`/environments/${encodeURIComponent(o)}/workspaces/${encodeURIComponent(s)}/findings/${r}`:`/findings/${r}`}const rC=sT,lC={task:yT};function cC({workspaceId:t,environmentId:s,tasks:o,resolvedThemeId:r}){const c=ut(),d=y.useMemo(()=>o.filter(_=>_.workspaceId===t),[o,t]),{nodes:u,edges:p}=Tj(d),m=y.useMemo(()=>{const _=getComputedStyle(document.documentElement),b={};for(const[x,k]of Object.entries(rC))b[x]=_.getPropertyValue(k).trim()||"#6b7a8d";return b},[r]),g=y.useCallback((_,b)=>{c(Pn(b.id,void 0,t,s))},[c,t,s]),v=y.useCallback(_=>{const b=_.data;return m[b.task.status]||m.pending},[m]);return d.length===0?a.jsxs("div",{className:Sn.emptyCta,children:[a.jsx("button",{className:Sn.ctaButton,onClick:()=>c(Hi(t,void 0,s)),children:"Create Task"}),a.jsx("div",{className:Sn.ctaDescription,children:"Create tasks to see the dependency graph"})]}):a.jsx("div",{className:Sn.dagContainer,children:a.jsxs(O2,{nodes:u,edges:p,nodeTypes:lC,onNodeClick:g,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,children:[a.jsx(L2,{variant:B2.Dots,gap:24,size:1,color:"var(--text-disabled)"}),a.jsx($2,{showInteractive:!1}),a.jsx(z2,{nodeColor:v,maskColor:"var(--bg-overlay)",style:{background:"var(--bg-inset)"}})]})})}const dC="_breadcrumbs_17or2_1",uC="_list_17or2_11",fC="_item_17or2_21",pC="_separator_17or2_28",mC="_link_17or2_34",hC="_current_17or2_57",Do={breadcrumbs:dC,list:uC,item:fC,separator:pC,link:mC,current:hC};function ks({segments:t}){return a.jsx("nav",{className:Do.breadcrumbs,"aria-label":"Breadcrumb","data-testid":"breadcrumbs",children:a.jsx("ol",{className:Do.list,children:t.map((s,o)=>{const r=o===t.length-1;return a.jsxs("li",{className:Do.item,children:[o>0&&a.jsx("span",{className:Do.separator,"aria-hidden":"true",children:a.jsx(ga,{size:We})}),s.url&&!r?a.jsx(Om,{className:Do.link,to:s.url,title:s.label,children:s.label}):a.jsx("span",{className:Do.current,"aria-current":"page",title:s.label,children:s.label})]},o)})})})}const gC="_btn_dwk2o_1",vC="_sm_dwk2o_22",yC="_md_dwk2o_28",bC="_lg_dwk2o_34",_C="_primary_dwk2o_40",xC="_danger_dwk2o_55",kC="_outline_dwk2o_70",SC="_ghost_dwk2o_80",up={btn:gC,sm:vC,md:yC,lg:bC,primary:_C,danger:xC,outline:kC,ghost:SC},cn=y.forwardRef(function({variant:s="primary",size:o="md",className:r,children:c,...d},u){const p=[up.btn,up[s],up[o],r].filter(Boolean).join(" ");return a.jsx("button",{ref:u,className:p,...d,children:c})}),jC="_copyButton_1bqk0_1",wC={copyButton:jC},TC=2e3;function NC({text:t,className:s,"data-testid":o}){const[r,c]=y.useState(!1),d=y.useRef(void 0);y.useEffect(()=>()=>{d.current!==void 0&&clearTimeout(d.current)},[]);const u=y.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},TC)}catch{}},[t]);return a.jsx("button",{type:"button",className:`${wC.copyButton} ${s??""}`,onClick:()=>{u().catch(()=>{})},"aria-label":r?"Copied":"Copy to clipboard","data-testid":o??"copy-button",children:r?a.jsx($i,{size:Vt,"aria-hidden":"true"}):a.jsx(H_,{size:Vt,"aria-hidden":"true"})})}const CC="_banner_bxqlh_1",EC="_label_bxqlh_15",AC="_text_bxqlh_25",DC="_link_bxqlh_29",Pc={banner:CC,label:EC,text:AC,link:DC};function MC(){return a.jsxs("div",{className:Pc.banner,"data-testid":"demo-banner",children:[a.jsx("span",{className:Pc.label,children:"DEMO"}),a.jsxs("span",{className:Pc.text,children:["This is an interactive demo with mock data."," ",a.jsx("a",{href:"https://github.com/nick-pape/grackle",target:"_blank",rel:"noopener noreferrer",className:Pc.link,children:"Install Grackle"})," ","to use it for real."]})]})}const RC="_container_og0yp_1",IC="_chevronButton_og0yp_6",OC="_mainButton_og0yp_6",LC="_sm_og0yp_34",BC="_md_og0yp_34",$C="_lg_og0yp_34",zC="_primary_og0yp_57",HC="_danger_og0yp_70",PC="_outline_og0yp_83",UC="_ghost_og0yp_92",VC="_dropdown_og0yp_100",qC="_option_og0yp_113",GC="_optionLabel_og0yp_130",FC="_optionDesc_og0yp_135",ia={container:RC,chevronButton:IC,mainButton:OC,sm:LC,md:BC,lg:$C,primary:zC,danger:HC,outline:PC,ghost:UC,dropdown:VC,option:qC,optionLabel:GC,optionDesc:FC};function ux({label:t,onClick:s,options:o,variant:r="primary",size:c="md","data-testid":d}){const[u,p]=y.useState(!1),m=y.useRef(null);y.useEffect(()=>{if(!u)return;function b(x){m.current&&x.target instanceof Node&&!m.current.contains(x.target)&&p(!1)}return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[u]),y.useEffect(()=>{if(!u)return;function b(x){x.key==="Escape"&&p(!1)}return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[u]);const g=ia[r]||"",v=ia[c]||"",_=()=>{u&&p(!1),s()};return a.jsxs("div",{ref:m,className:ia.container,"data-testid":d,children:[a.jsx("button",{type:"button",className:`${ia.mainButton} ${g} ${v}`,onClick:_,"data-testid":d?`${d}-main`:void 0,children:t}),a.jsx("button",{type:"button",className:`${ia.chevronButton} ${g} ${v}`,onClick:()=>p(b=>!b),"aria-label":`More options for ${t}`,"aria-haspopup":"menu","aria-expanded":u,"data-testid":d?`${d}-chevron`:void 0,children:a.jsx(z_,{size:Vt,"aria-hidden":"true"})}),u&&a.jsx("div",{className:ia.dropdown,"data-testid":d?`${d}-menu`:void 0,children:o.map((b,x)=>a.jsxs("button",{type:"button",className:ia.option,onClick:()=>{b.onClick(),p(!1)},children:[a.jsx("span",{className:ia.optionLabel,children:b.label}),b.description&&a.jsx("span",{className:ia.optionDesc,children:b.description})]},x))})]})}function tm(){tm=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)),fd(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&&fd(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)},tm.apply(this,arguments)}function fd(t,s){return fd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},fd(t,s)}function Oy(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 fp(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 Oy(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)?Oy(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.
|
|
278
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var KC=(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){ej(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,_=(function(E){for(var M,L=fp(E.properties.className);!(M=L()).done;){var A=M.value;if(A.slice(0,9)==="language-")return A.slice(9).toLowerCase()}return null})(r);if(!_&&s.defaultLanguage&&r.properties.className.push("language-"+(_=s.defaultLanguage)),r.properties.className.push("code-highlight"),_)try{var b,x;x=(b=_)!=null&&b.includes("diff-")?_.split("-")[1]:_,g=t.highlight(Bc(r),x),d.properties.className=(d.properties.className||[]).concat("language-"+x)}catch(E){if(!s.ignoreMissing||!/Unknown language/.test(E.message))throw E;g=r}else g=r;g.children=(v=1,function E(M){return M.reduce(function(L,A){if(A.type==="text"){var P=A.value,Y=(P.match(/\n/g)||"").length;if(Y===0)A.position={start:{line:v,column:1},end:{line:v,column:1}},L.push(A);else for(var q,ee=P.split(`
|
|
279
|
+
`),le=fp(ee.entries());!(q=le()).done;){var W=q.value,re=W[0],$=W[1];L.push({type:"text",value:re===ee.length-1?$:$+`
|
|
280
|
+
`,position:{start:{line:v+re,column:1},end:{line:v+re,column:1}}})}return v+=Y,L}if(Object.prototype.hasOwnProperty.call(A,"children")){var B=v;return A.children=E(A.children),L.push(A),A.position={start:{line:B,column:1},end:{line:v,column:1}},L}return L.push(A),L},[])})(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 k,j=(function(E){var M=/{([\d,-]+)}/,L=E.split(",").map(function(Y){return Y.trim()}).join();if(M.test(L)){var A=M.exec(L)[1],P=nj(A);return function(Y){return P.includes(Y+1)}}return function(){return!1}})(m),w=(function(E){var M=tm(/showLineNumbers=(\d+)/i,{lines:1});if(M.test(E)){var L=M.exec(E);return Number(L.groups.lines)}return 1})(m),T=(function(E){for(var M=new Array(E),L=0;L<E;L++)M[L]={type:"element",tagName:"span",properties:{className:[]},children:[]};return M})(g.position.end.line),C=["showlinenumbers=false",'showlinenumbers="false"',"showlinenumbers={false}"],D=function(){var E,M,L=k.value,A=L[0],P=L[1];P.properties.className=["code-line"];var Y=sj(g,function(q){return q.position.start.line<=A+1&&q.position.end.line>=A+1});P.children=Y.children,(m.toLowerCase().includes("showLineNumbers".toLowerCase())||s.showLineNumbers===!0||typeof s.showLineNumbers=="object"&&s.showLineNumbers.includes(_))&&!C.some(function(q){return m.toLowerCase().includes(q)})&&(P.properties.line=[(A+w).toString()],P.properties.className.push("line-number")),j(A)&&P.properties.className.push("highlight-line"),(_==="diff"||(E=_)!=null&&E.includes("diff-"))&&Bc(P).substring(0,1)==="-"?P.properties.className.push("deleted"):(_==="diff"||(M=_)!=null&&M.includes("diff-"))&&Bc(P).substring(0,1)==="+"&&P.properties.className.push("inserted")},O=fp(T.entries());!(k=O()).done;)D();T.length>0&&Bc(T[T.length-1]).trim()===""&&T.pop(),r.children=T}}}})(tj);function Po(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 Ms(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 Ly=new Set(["grackle"]);function Yo(t){if(t.startsWith("mcp__")){const o=t.indexOf("__",5);if(o>5){const r=t.slice(5,o);if(Ly.has(r))return t.slice(o+2)}}const s=t.indexOf("-");if(s>0){const o=t.slice(0,s);if(Ly.has(o))return t.slice(s+1)}return t}const ZC={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 YC(t){const s=Yo(t);return ZC[s.toLowerCase()]??"generic"}const JC="_card_qkm9i_2",WC="_cardBlue_qkm9i_20",XC="_cardOrange_qkm9i_24",QC="_cardGreen_qkm9i_28",eE="_cardPurple_qkm9i_32",tE="_cardNeutral_qkm9i_36",nE="_cardRed_qkm9i_40",sE="_cardTeal_qkm9i_44",aE="_header_qkm9i_48",iE="_icon_qkm9i_55",oE="_toolName_qkm9i_64",rE="_fileName_qkm9i_71",lE="_badge_qkm9i_80",cE="_spacer_qkm9i_87",dE="_bodyToggle_qkm9i_91",uE="_chevron_qkm9i_109",fE="_chevronExpanded_qkm9i_115",pE="_pre_qkm9i_119",mE="_diffAdd_qkm9i_143",hE="_diffRemove_qkm9i_155",gE="_diffContext_qkm9i_167",vE="_diffHeader_qkm9i_176",yE="_diffLine_qkm9i_182",bE="_exitOk_qkm9i_188",_E="_exitError_qkm9i_194",xE="_exitPending_qkm9i_200",kE="_inProgress_qkm9i_228",SE="_metadata_qkm9i_232",jE="_metadataPrefix_qkm9i_239",I={card:JC,cardBlue:WC,cardOrange:XC,cardGreen:QC,cardPurple:eE,cardNeutral:tE,cardRed:nE,cardTeal:sE,header:aE,icon:iE,toolName:oE,fileName:rE,badge:lE,spacer:cE,bodyToggle:dE,chevron:uE,chevronExpanded:fE,pre:pE,diffAdd:mE,diffRemove:hE,diffContext:gE,diffHeader:vE,diffLine:yE,exitOk:bE,exitError:_E,exitPending:xE,inProgress:kE,metadata:SE,metadataPrefix:jE};function wE(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 TE(t){const s=t.split(/[/\\]/);return s[s.length-1]||t}const pp=5;function By({tool:t,args:s,result:o,isError:r,writeVariant:c}){const[d,u]=y.useState(!1),p=wE(s),m=TE(p),g=o===void 0,v=r?I.cardRed:c?I.cardGreen:I.cardBlue,_=c?"var(--accent-green)":"var(--accent-blue)",b=c?a.jsx(Xj,{size:Vt}):a.jsx(ew,{size:Vt}),x=c?"tool-card-file-write":"tool-card-file-read",k=(o==null?void 0:o.split(`
|
|
281
|
+
`))??[],j=k.length>pp,w=d?k:k.slice(0,pp);return a.jsxs("div",{className:`${I.card} ${v} ${g?I.inProgress:""}`,"data-testid":x,children:[a.jsxs("div",{className:I.header,children:[a.jsx("span",{className:I.icon,children:b}),a.jsx("span",{className:I.toolName,style:{color:_},children:t}),m&&a.jsx("span",{className:I.fileName,title:p,children:m}),!g&&k.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:I.spacer}),a.jsxs("span",{className:I.badge,children:[k.length," lines"]})]})]}),r&&o&&a.jsx("pre",{className:I.pre,"data-testid":"tool-card-error",children:o}),!r&&!g&&k.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("pre",{className:I.pre,"data-testid":"tool-card-content",children:w.map((T,C)=>a.jsxs("span",{className:I.diffLine,children:[a.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&&a.jsxs("button",{type:"button",className:I.bodyToggle,onClick:()=>{u(T=>!T)},"aria-expanded":d,"data-testid":"tool-card-toggle",children:[a.jsx("span",{className:`${I.chevron} ${d?I.chevronExpanded:""}`,"aria-hidden":"true",children:a.jsx(ga,{size:We})}),d?"collapse":`${k.length-pp} more lines`]})]})]})}function NE(t){const s=t.split(`
|
|
282
|
+
`),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 CE(t,s){const o=t.split(`
|
|
283
|
+
`),r=s.split(`
|
|
284
|
+
`),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 EE(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 AE(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 DE(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 ME(t){const s=t.split(/[/\\]/);return s[s.length-1]||t}function RE(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=NE(r);if(c.length>0)return c}}const o=DE(t);if(o)return CE(o.oldStr,o.newStr)}const mp=5;function IE({tool:t,args:s,result:o,isError:r,detailedResult:c}){const[d,u]=y.useState(!1),p=AE(s),m=ME(p),g=o===void 0,v=RE(s,c),_=v?EE(v):null,b=((v==null?void 0:v.length)??0)>mp,x=d?v:v==null?void 0:v.slice(0,mp);return a.jsxs("div",{className:`${I.card} ${r?I.cardRed:I.cardOrange} ${g?I.inProgress:""}`,"data-testid":"tool-card-file-edit",children:[a.jsxs("div",{className:I.header,children:[a.jsx("span",{className:I.icon,children:a.jsx(Bw,{size:Vt})}),a.jsx("span",{className:I.toolName,style:{color:"var(--accent-yellow)"},children:t}),m&&a.jsx("span",{className:I.fileName,title:p,children:m}),_&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:I.spacer}),a.jsxs("span",{className:I.badge,"data-testid":"tool-card-diff-stats",children:[a.jsxs("span",{style:{color:"var(--accent-green)"},children:["+",_.added]})," ",a.jsxs("span",{style:{color:"var(--accent-red)"},children:["−",_.removed]})]})]})]}),r&&o&&a.jsx("pre",{className:I.pre,"data-testid":"tool-card-error",children:o}),!r&&x&&x.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("pre",{className:I.pre,"data-testid":"tool-card-diff",children:x.map((k,j)=>{let w=I.diffContext;return k.type==="add"&&(w=I.diffAdd),k.type==="remove"&&(w=I.diffRemove),k.type==="header"&&(w=I.diffHeader),a.jsx("span",{className:`${I.diffLine} ${w}`,children:k.content},j)})}),b&&a.jsxs("button",{type:"button",className:I.bodyToggle,onClick:()=>{u(k=>!k)},"aria-expanded":d,"data-testid":"tool-card-toggle",children:[a.jsx("span",{className:`${I.chevron} ${d?I.chevronExpanded:""}`,"aria-hidden":"true",children:a.jsx(ga,{size:We})}),d?"collapse":`${((v==null?void 0:v.length)??0)-mp} more lines`]})]}),!r&&!v&&!g&&o&&a.jsx("pre",{className:I.pre,"data-testid":"tool-card-content",children:o})]})}const OE=/^\[exit (\d+)\]\s*/;function LE(t){const s=OE.exec(t);return s?{exitCode:Number(s[1]),output:t.slice(s[0].length)}:{exitCode:void 0,output:t}}function BE(t){if(t==null||typeof t!="object")return"";const s=t;return typeof s.command=="string"?s.command:""}function $E(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 hp=3;function zE({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),u=BE(s),p=$E(u),m=o===void 0,g=o?LE(o):null,v=(g==null?void 0:g.output.split(`
|
|
285
|
+
`))??[],_=v.length>hp,b=c?v:v.slice(0,hp),x=g==null?void 0:g.exitCode,k=r||x!==void 0&&x!==0;return a.jsxs("div",{className:`${I.card} ${k?I.cardRed:I.cardNeutral}`,"data-testid":"tool-card-shell",children:[a.jsxs("div",{className:I.header,children:[a.jsx("span",{className:I.icon,style:{color:"var(--text-secondary)",fontFamily:"var(--font-mono)",fontWeight:"bold"},children:"$"}),a.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}),x!==void 0&&a.jsxs("span",{className:x===0?I.exitOk:I.exitError,"data-testid":"tool-card-exit-code",children:[x===0?a.jsx($i,{size:We,"aria-hidden":"true"}):a.jsx(Ls,{size:We,"aria-hidden":"true"})," ","exit ",x]}),m&&a.jsx("span",{className:I.exitPending,"data-testid":"tool-card-pending",children:a.jsx(xw,{size:We,"aria-hidden":"true"})})]}),!m&&g&&g.output.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("pre",{className:I.pre,"data-testid":"tool-card-output",children:b.join(`
|
|
286
|
+
`)}),_&&a.jsxs("button",{type:"button",className:I.bodyToggle,onClick:()=>{d(j=>!j)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[a.jsx("span",{className:`${I.chevron} ${c?I.chevronExpanded:""}`,"aria-hidden":"true",children:a.jsx(ga,{size:We})}),c?"collapse":`${v.length-hp} more lines`]})]})]})}function HE(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 gp=5;function PE({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),{pattern:u,path:p}=HE(s),m=o===void 0,g=(o==null?void 0:o.split(`
|
|
287
|
+
`).filter(b=>b.length>0))??[],v=g.length>gp,_=c?g:g.slice(0,gp);return a.jsxs("div",{className:`${I.card} ${r?I.cardRed:I.cardPurple} ${m?I.inProgress:""}`,"data-testid":"tool-card-search",children:[a.jsxs("div",{className:I.header,children:[a.jsx("span",{className:I.icon,children:a.jsx(ud,{size:Vt})}),a.jsx("span",{className:I.toolName,style:{color:"var(--accent-purple, #a78bfa)"},children:t}),u&&a.jsxs("span",{className:I.fileName,"data-testid":"tool-card-pattern",children:['"',u,'"']}),p&&a.jsxs("span",{className:I.fileName,style:{flexShrink:1},"data-testid":"tool-card-search-path",children:["in ",p]}),!m&&!r&&g.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:I.spacer}),a.jsxs("span",{className:I.badge,"data-testid":"tool-card-match-count",children:[g.length," ",g.length===1?"match":"matches"]})]})]}),r&&o&&a.jsx("pre",{className:I.pre,"data-testid":"tool-card-error",children:o}),!r&&!m&&_.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("pre",{className:I.pre,"data-testid":"tool-card-results",children:_.join(`
|
|
288
|
+
`)}),v&&a.jsxs("button",{type:"button",className:I.bodyToggle,onClick:()=>{d(b=>!b)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[a.jsx("span",{className:`${I.chevron} ${c?I.chevronExpanded:""}`,"aria-hidden":"true",children:a.jsx(ga,{size:We})}),c?"collapse":`${g.length-gp} more matches`]})]})]})}const UE="_progressBar_14f5c_1",VE="_progressFill_14f5c_9",qE="_activeTask_14f5c_16",GE="_activeIcon_14f5c_27",FE="_todoPulse_14f5c_1",KE="_activeText_14f5c_34",ZE="_checklist_14f5c_48",YE="_item_14f5c_55",JE="_itemIcon_14f5c_65",WE="_itemText_14f5c_73",XE="_pending_14f5c_78",QE="_in_progress_14f5c_85",eA="_completed_14f5c_97",tA="_emptyMessage_14f5c_108",ms={progressBar:UE,progressFill:VE,activeTask:qE,activeIcon:GE,todoPulse:FE,activeText:KE,checklist:ZE,item:YE,itemIcon:JE,itemText:WE,pending:XE,in_progress:QE,completed:eA,emptyMessage:tA},nA=/^[-*]\s*\[([ xX~!/])\]\s*(.+)$/;function sA(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:$y(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:$y(o.status)})):typeof s.content=="string"?aA(s.content):[]}function $y(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 aA(t){const s=t.split(`
|
|
289
|
+
`),o=[];for(const r of s){const c=nA.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 iA(t){switch(t){case"completed":return a.jsx($i,{size:We});case"in_progress":return a.jsx(Ja,{size:We,fill:"currentColor"});default:return a.jsx(Ja,{size:We})}}function oA({args:t}){const s=sA(t),o=s.filter(d=>d.status==="completed").length,r=s.find(d=>d.status==="in_progress"),c=s.length===0;return a.jsxs("div",{className:`${I.card} ${I.cardBlue}`,"data-testid":"tool-card-todo",children:[a.jsxs("div",{className:I.header,children:[a.jsx("span",{className:I.icon,children:a.jsx(vw,{size:Vt})}),a.jsx("span",{className:I.toolName,style:{color:"var(--accent-blue)"},children:c?"Todos cleared":"Todos"}),!c&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:I.spacer}),a.jsxs("span",{className:I.badge,"data-testid":"tool-card-todo-progress",children:[o,"/",s.length]})]})]}),!c&&a.jsx("div",{className:ms.progressBar,"data-testid":"tool-card-todo-bar",children:a.jsx("div",{className:ms.progressFill,style:{width:`${o/s.length*100}%`}})}),r&&a.jsxs("div",{className:ms.activeTask,"data-testid":"tool-card-todo-active",children:[a.jsx("span",{className:ms.activeIcon,children:a.jsx(Ja,{size:We,fill:"currentColor"})}),a.jsx("span",{className:ms.activeText,children:r.activeForm||r.content})]}),!c&&a.jsx("div",{className:ms.checklist,"data-testid":"tool-card-todo-list",children:s.map((d,u)=>a.jsxs("div",{className:`${ms.item} ${ms[d.status]}`,"data-testid":"tool-card-todo-item",children:[a.jsx("span",{className:ms.itemIcon,children:iA(d.status)}),a.jsx("span",{className:ms.itemText,children:d.content})]},u))}),c&&a.jsx("div",{className:ms.emptyMessage,children:"All items completed and cleared."})]})}function rA(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 lA({tool:t,args:s}){const o=rA(t,s);return a.jsxs("div",{className:I.metadata,"data-testid":"tool-card-metadata",children:[a.jsx("span",{className:I.metadataPrefix,children:a.jsx(Jj,{size:We})}),o]})}function cA(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 dA(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 vp=5,yp=5;function uA({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),u=Yo(t),p=cA(s),m=o===void 0,{single:g,list:v}=dA(o),_=(g==null?void 0:g.title)??p.title,b=v?void 0:(g==null?void 0:g.category)??p.category,x=v?void 0:(g==null?void 0:g.tags)??p.tags;return a.jsxs("div",{className:`${I.card} ${r?I.cardRed:I.cardPurple} ${m?I.inProgress:""}`,"data-testid":"tool-card-finding",children:[a.jsxs("div",{className:I.header,children:[a.jsx("span",{className:I.icon,"aria-hidden":"true",children:"💡"}),a.jsx("span",{className:I.toolName,style:{color:"var(--accent-purple, #a78bfa)"},children:u}),_&&a.jsxs("span",{className:I.fileName,"data-testid":"tool-card-finding-title",children:['"',_,'"']}),b&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:I.spacer}),a.jsx("span",{className:I.badge,"data-testid":"tool-card-finding-category",children:b})]}),v&&!b&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:I.spacer}),a.jsxs("span",{className:I.badge,"data-testid":"tool-card-finding-count",children:[v.length," ",v.length===1?"finding":"findings"]})]})]}),x&&x.length>0&&a.jsx("div",{className:I.pre,style:{padding:"4px 8px",whiteSpace:"normal"},"data-testid":"tool-card-finding-tags",children:x.map((k,j)=>a.jsxs("span",{style:{display:"inline-block",marginRight:"6px",opacity:.7,fontSize:"0.85em"},children:["#",k]},j))}),m&&!_&&s!==null&&s!==void 0&&a.jsx("pre",{className:I.pre,"data-testid":"tool-card-args",children:JSON.stringify(s,null,2)}),r&&o&&a.jsx("pre",{className:I.pre,"data-testid":"tool-card-error",children:o}),!r&&(g==null?void 0:g.content)&&a.jsx(a.Fragment,{children:(()=>{const k=g.content.split(`
|
|
290
|
+
`),j=k.length>yp,w=c?g.content:k.slice(0,yp).join(`
|
|
291
|
+
`);return a.jsxs(a.Fragment,{children:[a.jsx("pre",{className:I.pre,"data-testid":"tool-card-finding-content",children:w}),j&&a.jsxs("button",{type:"button",className:I.bodyToggle,onClick:()=>{d(T=>!T)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[a.jsx("span",{className:`${I.chevron} ${c?I.chevronExpanded:""}`,children:"▸"}),c?"collapse":`${k.length-yp} more lines`]})]})})()}),!r&&v&&v.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("pre",{className:I.pre,"data-testid":"tool-card-finding-list",children:(c?v:v.slice(0,vp)).map((k,j)=>`${k.category?`[${k.category}] `:""}${k.title??k.id??`Finding ${j+1}`}`).join(`
|
|
292
|
+
`)}),v.length>vp&&a.jsxs("button",{type:"button",className:I.bodyToggle,onClick:()=>{d(k=>!k)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[a.jsx("span",{className:`${I.chevron} ${c?I.chevronExpanded:""}`,children:"▸"}),c?"collapse":`${v.length-vp} more findings`]})]})]})}function fA(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 pA(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 zy(t){switch(t){case"complete":case"completed":return"✓";case"working":case"in_progress":return"●";case"paused":return"⏸";case"failed":return"✗";default:return"○"}}function mA(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 bp=5;function hA({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),u=Yo(t),p=fA(s),m=o===void 0,{single:g,list:v,sessionId:_}=pA(o),b=(g==null?void 0:g.title)??p.title,x=(g==null?void 0:g.status)??p.status;return a.jsxs("div",{className:`${I.card} ${r?I.cardRed:I.cardBlue} ${m?I.inProgress:""}`,"data-testid":"tool-card-task",children:[a.jsxs("div",{className:I.header,children:[a.jsx("span",{className:I.icon,"aria-hidden":"true",children:"📋"}),a.jsx("span",{className:I.toolName,style:{color:"var(--accent-blue)"},children:u}),b&&a.jsxs("span",{className:I.fileName,"data-testid":"tool-card-task-title",children:['"',b,'"']}),!b&&p.taskId&&a.jsx("span",{className:I.fileName,"data-testid":"tool-card-task-id",children:p.taskId}),x&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:I.spacer}),a.jsxs("span",{className:I.badge,style:{color:mA(x)},"data-testid":"tool-card-task-status",children:[zy(x)," ",x]})]}),v&&!x&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:I.spacer}),a.jsxs("span",{className:I.badge,"data-testid":"tool-card-task-count",children:[v.length," ",v.length===1?"task":"tasks"]})]})]}),m&&!b&&!p.taskId&&s!==null&&s!==void 0&&a.jsx("pre",{className:I.pre,"data-testid":"tool-card-args",children:JSON.stringify(s,null,2)}),r&&o&&a.jsx("pre",{className:I.pre,"data-testid":"tool-card-error",children:o}),!r&&_&&a.jsxs("div",{className:I.pre,style:{padding:"4px 8px",fontSize:"0.85em"},"data-testid":"tool-card-task-session",children:["session: ",_]}),!r&&g&&!v&&!_&&a.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(`
|
|
293
|
+
`)}),!r&&v&&v.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("pre",{className:I.pre,"data-testid":"tool-card-task-list",children:(c?v:v.slice(0,bp)).map(k=>{const j=zy(k.status),w=k.title??k.id??"untitled";return`${j} ${w}`}).join(`
|
|
294
|
+
`)}),v.length>bp&&a.jsxs("button",{type:"button",className:I.bodyToggle,onClick:()=>{d(k=>!k)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[a.jsx("span",{className:`${I.chevron} ${c?I.chevronExpanded:""}`,children:"▸"}),c?"collapse":`${v.length-bp} more tasks`]})]})]})}function gA(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 vA(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 yA({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),u=Yo(t),p=gA(s),m=o===void 0,g=vA(o),v=g.status??p.status,_=g.summary??p.summary;return a.jsxs("div",{className:`${I.card} ${r?I.cardRed:I.cardGreen} ${m?I.inProgress:""}`,"data-testid":"tool-card-workpad",children:[a.jsxs("div",{className:I.header,children:[a.jsx("span",{className:I.icon,"aria-hidden":"true",children:"📓"}),a.jsx("span",{className:I.toolName,style:{color:"var(--accent-green, #4ade80)"},children:u}),v&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:I.spacer}),a.jsx("span",{className:I.badge,"data-testid":"tool-card-workpad-status",children:v})]})]}),_&&a.jsx("pre",{className:I.pre,style:{whiteSpace:"pre-wrap"},"data-testid":"tool-card-workpad-summary",children:_}),m&&!_&&s!==null&&s!==void 0&&a.jsx("pre",{className:I.pre,"data-testid":"tool-card-args",children:JSON.stringify(s,null,2)}),r&&o&&a.jsx("pre",{className:I.pre,"data-testid":"tool-card-error",children:o}),!r&&!m&&o&&!_&&!v&&!g.extra&&a.jsx("pre",{className:I.pre,"data-testid":"tool-card-result",children:o}),!r&&g.extra&&a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:I.bodyToggle,onClick:()=>{d(b=>!b)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[a.jsx("span",{className:`${I.chevron} ${c?I.chevronExpanded:""}`,children:"▸"}),c?"collapse":"extra data"]}),c&&a.jsx("pre",{className:I.pre,"data-testid":"tool-card-workpad-extra",children:JSON.stringify(g.extra,null,2)})]})]})}function bA(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 _A(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 _p=5;function xA({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),u=Yo(t),p=bA(s),m=o===void 0,g=_A(o);return a.jsxs("div",{className:`${I.card} ${r?I.cardRed:I.cardPurple} ${m?I.inProgress:""}`,"data-testid":"tool-card-knowledge",children:[a.jsxs("div",{className:I.header,children:[a.jsx("span",{className:I.icon,"aria-hidden":"true",children:"🧠"}),a.jsx("span",{className:I.toolName,style:{color:"var(--accent-purple, #a78bfa)"},children:u}),p.query&&a.jsxs("span",{className:I.fileName,"data-testid":"tool-card-knowledge-query",children:['"',p.query,'"']}),p.id&&!p.query&&a.jsx("span",{className:I.fileName,"data-testid":"tool-card-knowledge-id",children:p.id}),g.results&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:I.spacer}),a.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&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:I.spacer}),a.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&&a.jsx("pre",{className:I.pre,"data-testid":"tool-card-args",children:JSON.stringify(s,null,2)}),r&&o&&a.jsx("pre",{className:I.pre,"data-testid":"tool-card-error",children:o}),!r&&g.results&&g.results.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("pre",{className:I.pre,"data-testid":"tool-card-knowledge-results",children:(c?g.results:g.results.slice(0,_p)).map(v=>{var x,k,j;const _=((x=v.node)==null?void 0:x.title)??((k=v.node)==null?void 0:k.label)??((j=v.node)==null?void 0:j.id)??"node",b=v.score!==void 0?` (${(v.score*100).toFixed(0)}%)`:"";return`${_}${b}`}).join(`
|
|
295
|
+
`)}),g.results.length>_p&&a.jsxs("button",{type:"button",className:I.bodyToggle,onClick:()=>{d(v=>!v)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[a.jsx("span",{className:`${I.chevron} ${c?I.chevronExpanded:""}`,children:"▸"}),c?"collapse":`${g.results.length-_p} more results`]})]}),!r&&g.node&&!g.results&&a.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(`
|
|
296
|
+
`)})]})}function kA(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 SA(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 jA({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),u=Yo(t),p=kA(s),m=o===void 0,g=SA(o);let v="";p.pipe?v=`[${p.pipe}]`:p.fd!==void 0?v=`fd:${p.fd}`:p.name&&(v=`"${p.name}"`);const _=p.prompt?p.prompt.length>60?`${p.prompt.slice(0,60)}...`:p.prompt:void 0;return a.jsxs("div",{className:`${I.card} ${r?I.cardRed:I.cardOrange} ${m?I.inProgress:""}`,"data-testid":"tool-card-ipc",children:[a.jsxs("div",{className:I.header,children:[a.jsx("span",{className:I.icon,"aria-hidden":"true",children:"🔀"}),a.jsx("span",{className:I.toolName,style:{color:"var(--accent-yellow, #fbbf24)"},children:u}),v&&a.jsx("span",{className:I.fileName,"data-testid":"tool-card-ipc-info",children:v}),_&&a.jsx("span",{className:I.fileName,title:p.prompt,"data-testid":"tool-card-ipc-prompt",children:_}),g.fds&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:I.spacer}),a.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&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:I.spacer}),a.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&&!_&&!v&&s!==null&&s!==void 0&&a.jsx("pre",{className:I.pre,"data-testid":"tool-card-args",children:JSON.stringify(s,null,2)}),r&&o&&a.jsx("pre",{className:I.pre,"data-testid":"tool-card-error",children:o}),!r&&g.sessionId&&a.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&&a.jsx("pre",{className:I.pre,"data-testid":"tool-card-ipc-output",children:g.output}),!r&&g.fds&&g.fds.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("pre",{className:I.pre,"data-testid":"tool-card-ipc-fds",children:(c?g.fds:g.fds.slice(0,5)).map(b=>{const x=[`fd:${b.fd??"?"}`,b.permission??"",b.deliveryMode??""];return b.streamName&&x.push(b.streamName),b.owned&&x.push("(owned)"),x.filter(Boolean).join(" ")}).join(`
|
|
297
|
+
`)}),g.fds.length>5&&a.jsxs("button",{type:"button",className:I.bodyToggle,onClick:()=>{d(b=>!b)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[a.jsx("span",{className:`${I.chevron} ${c?I.chevronExpanded:""}`,children:"▸"}),c?"collapse":`${g.fds.length-5} more fds`]})]})]})}function wA(t){if(t==null||typeof t!="object")return"";const s=t;return typeof s.query=="string"?s.query:""}const xp=8;function TA({args:t,result:s,isError:o}){const[r,c]=y.useState(!1),d=wA(t),u=s===void 0,p=(s==null?void 0:s.split(`
|
|
298
|
+
`))??[],m=p.length>xp,g=r?s:p.slice(0,xp).join(`
|
|
299
|
+
`);return a.jsxs("div",{className:`${I.card} ${o?I.cardRed:I.cardNeutral} ${u?I.inProgress:""}`,"data-testid":"tool-card-tool-search",children:[a.jsxs("div",{className:I.header,children:[a.jsx("span",{className:I.icon,"aria-hidden":"true",children:"🔧"}),a.jsx("span",{className:I.toolName,children:"ToolSearch"}),d&&a.jsxs("span",{className:I.fileName,"data-testid":"tool-card-tool-search-query",children:['"',d,'"']}),!u&&!o&&s&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:I.spacer}),a.jsxs("span",{className:I.badge,"data-testid":"tool-card-tool-search-count",children:[p.length," lines"]})]})]}),u&&!d&&t!==null&&t!==void 0&&a.jsx("pre",{className:I.pre,"data-testid":"tool-card-args",children:JSON.stringify(t,null,2)}),o&&s&&a.jsx("pre",{className:I.pre,"data-testid":"tool-card-error",children:s}),!o&&!u&&s&&a.jsxs(a.Fragment,{children:[a.jsx("pre",{className:I.pre,"data-testid":"tool-card-tool-search-result",children:g}),m&&a.jsxs("button",{type:"button",className:I.bodyToggle,onClick:()=>{c(v=>!v)},"aria-expanded":r,"data-testid":"tool-card-toggle",children:[a.jsx("span",{className:`${I.chevron} ${r?I.chevronExpanded:""}`,children:"▸"}),r?"collapse":`${p.length-xp} more lines`]})]})]})}function NA(t){const s=/^mcp__([^_]+(?:_[^_]+)*)__(.+)$/.exec(t);return s?{display:`${s[1]} / ${s[2]}`,isMcp:!0}:{display:t,isMcp:!1}}function CA(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 kp=5;function EA({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),{display:u}=NA(t),p=CA(s),m=o===void 0,g=(o==null?void 0:o.split(`
|
|
300
|
+
`))??[],v=g.length>kp,_=c?o:g.slice(0,kp).join(`
|
|
301
|
+
`);let b="";if(s!=null)try{b=JSON.stringify(s,null,2)}catch{b=String(s)}return a.jsxs("div",{className:`${I.card} ${r?I.cardRed:I.cardBlue} ${m?I.inProgress:""}`,"data-testid":"tool-card-generic",children:[a.jsxs("div",{className:I.header,children:[a.jsx("span",{className:I.icon,children:a.jsx(Fj,{size:Vt,"aria-hidden":"true"})}),a.jsx("span",{className:I.toolName,style:{color:"var(--accent-blue)"},children:u}),p&&a.jsx("span",{className:I.fileName,children:p})]}),m&&b&&a.jsx("pre",{className:I.pre,"data-testid":"tool-card-args",children:b}),r&&o&&a.jsx("pre",{className:I.pre,"data-testid":"tool-card-error",children:o}),!r&&!m&&o&&a.jsxs(a.Fragment,{children:[a.jsx("pre",{className:I.pre,"data-testid":"tool-card-result",children:_}),v&&a.jsxs("button",{type:"button",className:I.bodyToggle,onClick:()=>{d(x=>!x)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[a.jsx("span",{className:`${I.chevron} ${c?I.chevronExpanded:""}`,"aria-hidden":"true",children:a.jsx(ga,{size:We})}),c?"collapse":`${g.length-kp} more lines`]})]})]})}const AA="_badgePill_o7eqc_1",DA="_modelBadge_o7eqc_14",MA="_backgroundBadge_o7eqc_26",RA="_backgroundDot_o7eqc_36",IA="_backgroundDotPulsing_o7eqc_41",OA="_description_o7eqc_55",LA="_statusLine_o7eqc_62",BA="_statusCompleted_o7eqc_72",$A="_statusRunning_o7eqc_77",zA="_statusError_o7eqc_83",HA="_promptToggle_o7eqc_88",hs={badgePill:AA,modelBadge:DA,backgroundBadge:MA,backgroundDot:RA,backgroundDotPulsing:IA,description:OA,statusLine:LA,statusCompleted:BA,statusRunning:$A,statusError:zA,promptToggle:HA};function PA(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 UA=/^Agent\s+(completed|running|failed|error)\.\s*agent_id:\s*(\S+),?\s*([^\n]*)(?:\n\n([\s\S]*))?$/i;function VA(t){const s=UA.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 Sp=5;function qA({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),[u,p]=y.useState(!1),m=PA(t,s),g=o===void 0,v=m.isPoll&&o?VA(o):void 0,_=(v==null?void 0:v.content)??o,b=(_==null?void 0:_.split(`
|
|
302
|
+
`))??[],x=b.length>Sp,k=c?_:b.slice(0,Sp).join(`
|
|
303
|
+
`),j=m.isPoll?"Subagent":"Agent";return a.jsxs("div",{className:`${I.card} ${r?I.cardRed:I.cardTeal} ${g?I.inProgress:""}`,"data-testid":"tool-card-agent",children:[a.jsxs("div",{className:I.header,children:[a.jsx("span",{className:I.icon,style:{color:"var(--accent-teal, #2dd4bf)"},children:"▶"}),a.jsx("span",{className:I.toolName,style:{color:"var(--accent-teal, #2dd4bf)"},children:j}),m.agentType&&a.jsx("span",{className:hs.badgePill,"data-testid":"tool-card-agent-type",children:m.agentType}),m.model&&a.jsx("span",{className:hs.modelBadge,"data-testid":"tool-card-agent-model",children:m.model}),m.isBackground&&a.jsxs("span",{className:hs.backgroundBadge,"data-testid":"tool-card-agent-background",children:[a.jsx("span",{className:g?hs.backgroundDotPulsing:hs.backgroundDot,children:"●"}),"BG"]}),m.agentName&&a.jsx("span",{className:I.fileName,"data-testid":"tool-card-agent-name",children:m.agentName}),m.agentId&&a.jsx("span",{className:I.fileName,"data-testid":"tool-card-agent-id",children:m.agentId}),a.jsx("span",{className:I.spacer}),g&&!m.isBackground&&a.jsx("span",{className:I.exitPending,"data-testid":"tool-card-pending",children:"●"})]}),m.description&&a.jsx("div",{className:hs.description,"data-testid":"tool-card-agent-description",children:m.isResume?`Resuming: ${m.description}`:m.description}),v&&a.jsxs("div",{className:hs.statusLine,"data-testid":"tool-card-agent-status",children:[a.jsx("span",{className:v.status==="completed"?hs.statusCompleted:v.status==="running"?hs.statusRunning:hs.statusError,children:v.status}),v.metadata&&a.jsx("span",{children:v.metadata})]}),m.prompt&&a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:hs.promptToggle,onClick:()=>{p(w=>!w)},"aria-expanded":u,"data-testid":"tool-card-prompt-toggle",children:[a.jsx("span",{className:`${I.chevron} ${u?I.chevronExpanded:""}`,children:"▸"}),"prompt"]}),u&&a.jsx("pre",{className:I.pre,"data-testid":"tool-card-prompt",children:m.prompt})]}),r&&o&&a.jsx("pre",{className:I.pre,"data-testid":"tool-card-error",children:o}),!r&&!g&&_&&a.jsxs(a.Fragment,{children:[a.jsx("pre",{className:I.pre,"data-testid":"tool-card-result",children:k}),x&&a.jsxs("button",{type:"button",className:I.bodyToggle,onClick:()=>{d(w=>!w)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[a.jsx("span",{className:`${I.chevron} ${c?I.chevronExpanded:""}`,children:"▸"}),c?"collapse":`${b.length-Sp} more lines`]})]})]})}function jp(t){switch(YC(t.tool)){case"file-read":return a.jsx(By,{...t});case"file-edit":return a.jsx(IE,{...t});case"file-write":return a.jsx(By,{...t,writeVariant:!0});case"shell":return a.jsx(zE,{...t});case"search":return a.jsx(PE,{...t});case"todo":return a.jsx(oA,{...t});case"metadata":return a.jsx(lA,{...t});case"finding":return a.jsx(uA,{...t});case"task":return a.jsx(hA,{...t});case"workpad":return a.jsx(yA,{...t});case"knowledge":return a.jsx(xA,{...t});case"ipc":return a.jsx(jA,{...t});case"tool-search":return a.jsx(TA,{...t});case"agent":return a.jsx(qA,{...t});default:return a.jsx(EA,{...t})}}const GA="_systemContextEvent_1kdcc_1",FA="_systemContextHeader_1kdcc_7",KA="_systemContextBadge_1kdcc_28",ZA="_systemContextToggle_1kdcc_37",YA="_systemContextPre_1kdcc_43",JA="_systemContextEllipsis_1kdcc_54",WA="_systemEvent_1kdcc_58",XA="_systemTimestamp_1kdcc_65",QA="_textEvent_1kdcc_69",eD="_codeBlockWrapper_1kdcc_156",tD="_codeBlockCopyButton_1kdcc_159",nD="_errorEvent_1kdcc_163",sD="_statusEvent_1kdcc_171",aD="_userInputEvent_1kdcc_180",iD="_userInputContent_1kdcc_186",oD="_signalEvent_1kdcc_293",rD="_signalBadge_1kdcc_304",lD="_signalContent_1kdcc_313",cD="_usageEvent_1kdcc_318",dD="_usageBadge_1kdcc_325",uD="_defaultEvent_1kdcc_334",Ut={systemContextEvent:GA,systemContextHeader:FA,systemContextBadge:KA,systemContextToggle:ZA,systemContextPre:YA,systemContextEllipsis:JA,systemEvent:WA,systemTimestamp:XA,textEvent:QA,codeBlockWrapper:eD,codeBlockCopyButton:tD,errorEvent:nD,statusEvent:sD,userInputEvent:aD,userInputContent:iD,signalEvent:oD,signalBadge:rD,signalContent:lD,usageEvent:cD,usageBadge:dD,defaultEvent:uD},fD=y.lazy(()=>B_(()=>import("./McpAppWidget-DbYqtOnr.js"),__vite__mapDeps([0,1])).then(t=>({default:t.McpAppWidget}))),Hy=3;function pD({content:t}){const[s,o]=y.useState(!1),r=t.split(`
|
|
304
|
+
`),c=r.length>Hy,d=s?t:r.slice(0,Hy).join(`
|
|
305
|
+
`);return a.jsxs("div",{className:Ut.systemContextEvent,"data-testid":"system-context-event",children:[a.jsxs("button",{type:"button",className:Ut.systemContextHeader,onClick:()=>{o(u=>!u)},"aria-expanded":s,children:[a.jsx("span",{className:Ut.systemContextBadge,children:"SYSTEM PROMPT"}),c&&a.jsx("span",{className:Ut.systemContextToggle,"aria-hidden":"true",children:s?a.jsx(z_,{size:We}):a.jsx(ga,{size:We})})]}),a.jsxs("pre",{className:Ut.systemContextPre,children:[d,!s&&c&&a.jsx("span",{className:Ut.systemContextEllipsis,children:"…"})]})]})}function mD({time:t,content:s}){return a.jsxs("div",{className:Ut.systemEvent,children:[a.jsxs("span",{className:Ut.systemTimestamp,children:["[",t,"]"]})," ",s]})}function nm(t){return typeof t=="string"?t:typeof t=="number"?String(t):Array.isArray(t)?t.map(nm).join(""):t!=null&&typeof t=="object"&&"props"in t?nm(t.props.children):""}function hD({children:t,node:s,...o}){const r=nm(t);return a.jsxs("div",{className:Ut.codeBlockWrapper,children:[a.jsx("pre",{...o,children:t}),a.jsx(NC,{text:r,"data-testid":"copy-code-block",className:Ut.codeBlockCopyButton})]})}const gD={pre:hD};function fx({content:t}){return a.jsx(Cd,{remarkPlugins:[Ed],rehypePlugins:[KC],components:gD,children:t})}function vD({content:t}){return a.jsx("div",{className:Ut.textEvent,children:a.jsx(fx,{content:t})})}function yD({content:t}){return a.jsxs("div",{className:Ut.errorEvent,children:["Error: ",t]})}function bD({content:t}){return a.jsxs("div",{className:Ut.statusEvent,children:["--- ",t," ---"]})}function _D({content:t}){return a.jsx("div",{className:Ut.userInputEvent,children:a.jsx("div",{className:Ut.userInputContent,"data-testid":"user-input-content",children:a.jsx(fx,{content:t})})})}function xD({content:t}){return a.jsxs("div",{className:Ut.signalEvent,"data-testid":"signal-event",children:[a.jsx("span",{className:Ut.signalBadge,children:"SIGNAL"}),a.jsx("span",{className:Ut.signalContent,children:t})]})}function kD({content:t}){let s=t;try{const o=JSON.parse(t),r=Number(o.input_tokens)||0,c=Number(o.output_tokens)||0,d=Po(r+c),u=Ms(Number(o.cost_millicents)||0);s=`${d} tokens · ${u}`}catch{}return a.jsx("div",{className:Ut.usageEvent,"data-testid":"usage-event",children:a.jsx("span",{className:Ut.usageBadge,children:s})})}function Uc({content:t}){return a.jsx("div",{className:Ut.defaultEvent,children:t})}function SD({event:t,toolUseCtx:s,settled:o,sandboxProxyUrl:r}){const c=new Date(t.timestamp).toLocaleTimeString();switch(t.eventType){case"widget":{if(!r)return a.jsx(Uc,{content:t.content});let d={};try{d=JSON.parse(t.content)}catch{}return d.html?a.jsx(y.Suspense,{fallback:a.jsx(Uc,{content:"Loading widget..."}),children:a.jsx(fD,{widgetHtml:d.html,sandboxProxyUrl:r,csp:d.csp,toolInput:d.toolInput,toolResult:d.toolResult})}):a.jsx(Uc,{content:t.content})}case"system":{if(t.raw)try{if(JSON.parse(t.raw).systemContext===!0)return a.jsx(pD,{content:t.content})}catch{}return a.jsx(mD,{time:c,content:t.content})}case"text":case"output":return a.jsx(vD,{content:t.content});case"tool_use":{let d="",u={};try{const p=JSON.parse(t.content);d=p.tool||"",u=p.args}catch{}return a.jsx(jp,{tool:d,args:u,result:o?"":void 0})}case"tool_result":{let d=!1;if(t.raw)try{d=JSON.parse(t.raw).is_error===!0}catch{}let u=t.content;if(t.content.trimStart().startsWith("{"))try{const p=JSON.parse(t.content);typeof p.content=="string"&&(u=p.content)}catch{}return s?a.jsx(jp,{tool:s.tool,args:s.args,result:u,isError:d,detailedResult:s.detailedResult}):a.jsx(jp,{tool:"Tool output",args:void 0,result:u,isError:d})}case"error":return a.jsx(yD,{content:t.content});case"status":return a.jsx(bD,{content:t.content});case"user_input":return a.jsx(_D,{content:t.content});case"signal":return a.jsx(xD,{content:t.content});case"usage":return a.jsx(kD,{content:t.content});default:return a.jsx(Uc,{content:t.content})}}const Bm=y.createContext({});function $m(t){const s=y.useRef(null);return s.current===null&&(s.current=t()),s.current}const $d=y.createContext(null),zm=y.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class jD extends y.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 wD({children:t,isPresent:s}){const o=y.useId(),r=y.useRef(null),c=y.useRef({width:0,height:0,top:0,left:0}),{nonce:d}=y.useContext(zm);return y.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(`
|
|
306
|
+
[data-motion-pop-id="${o}"] {
|
|
307
|
+
position: absolute !important;
|
|
308
|
+
width: ${u}px !important;
|
|
309
|
+
height: ${p}px !important;
|
|
310
|
+
top: ${m}px !important;
|
|
311
|
+
left: ${g}px !important;
|
|
312
|
+
}
|
|
313
|
+
`),()=>{document.head.removeChild(v)}},[s]),a.jsx(jD,{isPresent:s,childRef:r,sizeRef:c,children:y.cloneElement(t,{ref:r})})}const TD=({children:t,initial:s,isPresent:o,onExitComplete:r,custom:c,presenceAffectsLayout:d,mode:u})=>{const p=$m(ND),m=y.useId(),g=y.useCallback(_=>{p.set(_,!0);for(const b of p.values())if(!b)return;r&&r()},[p,r]),v=y.useMemo(()=>({id:m,initial:s,isPresent:o,custom:c,onExitComplete:g,register:_=>(p.set(_,!1),()=>p.delete(_))}),d?[Math.random(),g]:[o,g]);return y.useMemo(()=>{p.forEach((_,b)=>p.set(b,!1))},[o]),y.useEffect(()=>{!o&&!p.size&&r&&r()},[o]),u==="popLayout"&&(t=a.jsx(wD,{isPresent:o,children:t})),a.jsx($d.Provider,{value:v,children:t})};function ND(){return new Map}function px(t=!0){const s=y.useContext($d);if(s===null)return[!0,null];const{isPresent:o,onExitComplete:r,register:c}=s,d=y.useId();y.useEffect(()=>{t&&c(d)},[t]);const u=y.useCallback(()=>t&&r&&r(d),[d,r,t]);return!o&&r?[!1,u]:[!0]}const Vc=t=>t.key||"";function Py(t){const s=[];return y.Children.forEach(t,o=>{y.isValidElement(o)&&s.push(o)}),s}const Hm=typeof window<"u",mx=Hm?y.useLayoutEffect:y.useEffect,is=({children:t,custom:s,initial:o=!0,onExitComplete:r,presenceAffectsLayout:c=!0,mode:d="sync",propagate:u=!1})=>{const[p,m]=px(u),g=y.useMemo(()=>Py(t),[t]),v=u&&!p?[]:g.map(Vc),_=y.useRef(!0),b=y.useRef(g),x=$m(()=>new Map),[k,j]=y.useState(g),[w,T]=y.useState(g);mx(()=>{_.current=!1,b.current=g;for(let O=0;O<w.length;O++){const E=Vc(w[O]);v.includes(E)?x.delete(E):x.get(E)!==!0&&x.set(E,!1)}},[w,v.length,v.join("-")]);const C=[];if(g!==k){let O=[...g];for(let E=0;E<w.length;E++){const M=w[E],L=Vc(M);v.includes(L)||(O.splice(E,0,M),C.push(M))}d==="wait"&&C.length&&(O=C),T(Py(O)),j(g);return}const{forceRender:D}=y.useContext(Bm);return a.jsx(a.Fragment,{children:w.map(O=>{const E=Vc(O),M=u&&!p?!1:g===w||v.includes(E),L=()=>{if(x.has(E))x.set(E,!0);else return;let A=!0;x.forEach(P=>{P||(A=!1)}),A&&(D==null||D(),T(b.current),u&&(m==null||m()),r&&r())};return a.jsx(TD,{isPresent:M,initial:!_.current||o?void 0:!1,custom:M?void 0:s,presenceAffectsLayout:c,mode:d,onExitComplete:M?void 0:L,children:O},E)})})},Hn=t=>t;let hx=Hn;const CD={useManualTiming:!1};function ED(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,_=!1)=>{const x=_&&r?s:o;return v&&d.add(g),x.has(g)||x.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 qc=["read","resolveKeyframes","update","preRender","render","postRender"],AD=40;function gx(t,s){let o=!1,r=!0;const c={delta:0,timestamp:0,isProcessing:!1},d=()=>o=!0,u=qc.reduce((T,C)=>(T[C]=ED(d),T),{}),{read:p,resolveKeyframes:m,update:g,preRender:v,render:_,postRender:b}=u,x=()=>{const T=performance.now();o=!1,c.delta=r?1e3/60:Math.max(Math.min(T-c.timestamp,AD),1),c.timestamp=T,c.isProcessing=!0,p.process(c),m.process(c),g.process(c),v.process(c),_.process(c),b.process(c),c.isProcessing=!1,o&&s&&(r=!1,t(x))},k=()=>{o=!0,r=!0,c.isProcessing||t(x)};return{schedule:qc.reduce((T,C)=>{const D=u[C];return T[C]=(O,E=!1,M=!1)=>(o||k(),D.schedule(O,E,M)),T},{}),cancel:T=>{for(let C=0;C<qc.length;C++)u[qc[C]].cancel(T)},state:c,steps:u}}const{schedule:jt,cancel:Qa,state:mn,steps:wp}=gx(typeof requestAnimationFrame<"u"?requestAnimationFrame:Hn,!0),vx=y.createContext({strict:!1}),Uy={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"]},Uo={};for(const t in Uy)Uo[t]={isEnabled:s=>Uy[t].some(o=>!!s[o])};function DD(t){for(const s in t)Uo[s]={...Uo[s],...t[s]}}const MD=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 pd(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||MD.has(t)}let yx=t=>!pd(t);function RD(t){t&&(yx=s=>s.startsWith("on")?!pd(s):t(s))}try{RD(require("@emotion/is-prop-valid").default)}catch{}function ID(t,s,o){const r={};for(const c in t)c==="values"&&typeof t.values=="object"||(yx(c)||o===!0&&pd(c)||!s&&!pd(c)||t.draggable&&c.startsWith("onDrag"))&&(r[c]=t[c]);return r}function OD(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 zd=y.createContext({});function ll(t){return typeof t=="string"||Array.isArray(t)}function Hd(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const Pm=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Um=["initial",...Pm];function Pd(t){return Hd(t.animate)||Um.some(s=>ll(t[s]))}function bx(t){return!!(Pd(t)||t.variants)}function LD(t,s){if(Pd(t)){const{initial:o,animate:r}=t;return{initial:o===!1||ll(o)?o:void 0,animate:ll(r)?r:void 0}}return t.inherit!==!1?s:{}}function BD(t){const{initial:s,animate:o}=LD(t,y.useContext(zd));return y.useMemo(()=>({initial:s,animate:o}),[Vy(s),Vy(o)])}function Vy(t){return Array.isArray(t)?t.join(" "):t}const $D=Symbol.for("motionComponentSymbol");function Oo(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function zD(t,s,o){return y.useCallback(r=>{r&&t.onMount&&t.onMount(r),s&&(r?s.mount(r):s.unmount()),o&&(typeof o=="function"?o(r):Oo(o)&&(o.current=r))},[s])}const Vm=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),HD="framerAppearId",_x="data-"+Vm(HD),{schedule:qm}=gx(queueMicrotask,!1),xx=y.createContext({});function PD(t,s,o,r,c){var d,u;const{visualElement:p}=y.useContext(zd),m=y.useContext(vx),g=y.useContext($d),v=y.useContext(zm).reducedMotion,_=y.useRef(null);r=r||m.renderer,!_.current&&r&&(_.current=r(t,{visualState:s,parent:p,props:o,presenceContext:g,blockInitialAnimation:g?g.initial===!1:!1,reducedMotionConfig:v}));const b=_.current,x=y.useContext(xx);b&&!b.projection&&c&&(b.type==="html"||b.type==="svg")&&UD(_.current,o,c,x);const k=y.useRef(!1);y.useInsertionEffect(()=>{b&&k.current&&b.update(o,g)});const j=o[_x],w=y.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 mx(()=>{b&&(k.current=!0,window.MotionIsMounted=!0,b.updateFeatures(),qm.render(b.render),w.current&&b.animationState&&b.animationState.animateChanges())}),y.useEffect(()=>{b&&(!w.current&&b.animationState&&b.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)===null||T===void 0||T.call(window,j)}),w.current=!1))}),b}function UD(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:kx(t.parent)),t.projection.setOptions({layoutId:c,layout:d,alwaysMeasureLayout:!!u||p&&Oo(p),visualElement:t,animationType:typeof d=="string"?d:"both",initialPromotionConfig:r,layoutScroll:m,layoutRoot:g})}function kx(t){if(t)return t.options.allowProjection!==!1?t.projection:kx(t.parent)}function VD({preloadedFeatures:t,createVisualElement:s,useRender:o,useVisualState:r,Component:c}){var d,u;t&&DD(t);function p(g,v){let _;const b={...y.useContext(zm),...g,layoutId:qD(g)},{isStatic:x}=b,k=BD(g),j=r(g,x);if(!x&&Hm){GD();const w=FD(b);_=w.MeasureLayout,k.visualElement=PD(c,j,b,s,w.ProjectionNode)}return a.jsxs(zd.Provider,{value:k,children:[_&&k.visualElement?a.jsx(_,{visualElement:k.visualElement,...b}):null,o(c,g,zD(j,k.visualElement,v),j,x,k.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=y.forwardRef(p);return m[$D]=c,m}function qD({layoutId:t}){const s=y.useContext(Bm).id;return s&&t!==void 0?s+"-"+t:t}function GD(t,s){y.useContext(vx).strict}function FD(t){const{drag:s,layout:o}=Uo;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 KD=["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 Gm(t){return typeof t!="string"||t.includes("-")?!1:!!(KD.indexOf(t)>-1||/[A-Z]/u.test(t))}function qy(t){const s=[{},{}];return t==null||t.values.forEach((o,r)=>{s[0][r]=o.get(),s[1][r]=o.getVelocity()}),s}function Fm(t,s,o,r){if(typeof s=="function"){const[c,d]=qy(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]=qy(r);s=s(o!==void 0?o:t.custom,c,d)}return s}const sm=t=>Array.isArray(t),ZD=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),YD=t=>sm(t)?t[t.length-1]||0:t,yn=t=>!!(t&&t.getVelocity);function ad(t){const s=yn(t)?t.get():t;return ZD(s)?s.toValue():s}function JD({scrapeMotionValuesFromProps:t,createRenderState:s,onUpdate:o},r,c,d){const u={latestValues:WD(r,c,d,t),renderState:s()};return o&&(u.onMount=p=>o({props:r,current:p,...u}),u.onUpdate=p=>o(p)),u}const Sx=t=>(s,o)=>{const r=y.useContext(zd),c=y.useContext($d),d=()=>JD(t,s,r,c);return o?d():$m(d)};function WD(t,s,o,r){const c={},d=r(t,{});for(const b in d)c[b]=ad(d[b]);let{initial:u,animate:p}=t;const m=Pd(t),g=bx(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 _=v?p:u;if(_&&typeof _!="boolean"&&!Hd(_)){const b=Array.isArray(_)?_:[_];for(let x=0;x<b.length;x++){const k=Fm(t,b[x]);if(k){const{transitionEnd:j,transition:w,...T}=k;for(const C in T){let D=T[C];if(Array.isArray(D)){const O=v?D.length-1:0;D=D[O]}D!==null&&(c[C]=D)}for(const C in j)c[C]=j[C]}}}return c}const Jo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Pi=new Set(Jo),jx=t=>s=>typeof s=="string"&&s.startsWith(t),wx=jx("--"),XD=jx("var(--"),Km=t=>XD(t)?QD.test(t.split("/*")[0].trim()):!1,QD=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Tx=(t,s)=>s&&typeof t=="number"?s.transform(t):t,ma=(t,s,o)=>o>s?s:o<t?t:o,Wo={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},cl={...Wo,transform:t=>ma(0,1,t)},Gc={...Wo,default:1},vl=t=>({test:s=>typeof s=="string"&&s.endsWith(t)&&s.split(" ").length===1,parse:parseFloat,transform:s=>`${s}${t}`}),Ya=vl("deg"),Is=vl("%"),Ee=vl("px"),eM=vl("vh"),tM=vl("vw"),Gy={...Is,parse:t=>Is.parse(t)/100,transform:t=>Is.transform(t*100)},nM={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},sM={rotate:Ya,rotateX:Ya,rotateY:Ya,rotateZ:Ya,scale:Gc,scaleX:Gc,scaleY:Gc,scaleZ:Gc,skew:Ya,skewX:Ya,skewY:Ya,distance:Ee,translateX:Ee,translateY:Ee,translateZ:Ee,x:Ee,y:Ee,z:Ee,perspective:Ee,transformPerspective:Ee,opacity:cl,originX:Gy,originY:Gy,originZ:Ee},Fy={...Wo,transform:Math.round},Zm={...nM,...sM,zIndex:Fy,size:Ee,fillOpacity:cl,strokeOpacity:cl,numOctaves:Fy},aM={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},iM=Jo.length;function oM(t,s,o){let r="",c=!0;for(let d=0;d<iM;d++){const u=Jo[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=Tx(p,Zm[u]);if(!m){c=!1;const v=aM[u]||u;r+=`${v}(${g}) `}o&&(s[u]=g)}}return r=r.trim(),o?r=o(s,c?"":r):c&&(r="none"),r}function Ym(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(Pi.has(m)){u=!0;continue}else if(wx(m)){c[m]=g;continue}else{const v=Tx(g,Zm[m]);m.startsWith("origin")?(p=!0,d[m]=v):r[m]=v}}if(s.transform||(u||o?r.transform=oM(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 rM={offset:"stroke-dashoffset",array:"stroke-dasharray"},lM={offset:"strokeDashoffset",array:"strokeDasharray"};function cM(t,s,o=1,r=0,c=!0){t.pathLength=1;const d=c?rM:lM;t[d.offset]=Ee.transform(-r);const u=Ee.transform(s),p=Ee.transform(o);t[d.array]=`${u} ${p}`}function Ky(t,s,o){return typeof t=="string"?t:Ee.transform(s+o*t)}function dM(t,s,o){const r=Ky(s,t.x,t.width),c=Ky(o,t.y,t.height);return`${r} ${c}`}function Jm(t,{attrX:s,attrY:o,attrScale:r,originX:c,originY:d,pathLength:u,pathSpacing:p=1,pathOffset:m=0,...g},v,_){if(Ym(t,g,_),v){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:b,style:x,dimensions:k}=t;b.transform&&(k&&(x.transform=b.transform),delete b.transform),k&&(c!==void 0||d!==void 0||x.transform)&&(x.transformOrigin=dM(k,c!==void 0?c:.5,d!==void 0?d:.5)),s!==void 0&&(b.x=s),o!==void 0&&(b.y=o),r!==void 0&&(b.scale=r),u!==void 0&&cM(b,u,p,m,!1)}const Wm=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Nx=()=>({...Wm(),attrs:{}}),Xm=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Cx(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 Ex=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 Ax(t,s,o,r){Cx(t,s,void 0,r);for(const c in s.attrs)t.setAttribute(Ex.has(c)?c:Vm(c),s.attrs[c])}const md={};function uM(t){Object.assign(md,t)}function Dx(t,{layout:s,layoutId:o}){return Pi.has(t)||t.startsWith("origin")||(s||o!==void 0)&&(!!md[t]||t==="opacity")}function Qm(t,s,o){var r;const{style:c}=t,d={};for(const u in c)(yn(c[u])||s.style&&yn(s.style[u])||Dx(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 Mx(t,s,o){const r=Qm(t,s,o);for(const c in t)if(yn(t[c])||yn(s[c])){const d=Jo.indexOf(c)!==-1?"attr"+c.charAt(0).toUpperCase()+c.substring(1):c;r[d]=t[c]}return r}function fM(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 Zy=["x","y","width","height","cx","cy","r"],pM={useVisualState:Sx({scrapeMotionValuesFromProps:Mx,createRenderState:Nx,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(Pi.has(p)){d=!0;break}}if(!d)return;let u=!s;if(s)for(let p=0;p<Zy.length;p++){const m=Zy[p];t[m]!==s[m]&&(u=!0)}u&&jt.read(()=>{fM(o,r),jt.render(()=>{Jm(r,c,Xm(o.tagName),t.transformTemplate),Ax(o,r)})})}})},mM={useVisualState:Sx({scrapeMotionValuesFromProps:Qm,createRenderState:Wm})};function Rx(t,s,o){for(const r in s)!yn(s[r])&&!Dx(r,o)&&(t[r]=s[r])}function hM({transformTemplate:t},s){return y.useMemo(()=>{const o=Wm();return Ym(o,s,t),Object.assign({},o.vars,o.style)},[s])}function gM(t,s){const o=t.style||{},r={};return Rx(r,o,t),Object.assign(r,hM(t,s)),r}function vM(t,s){const o={},r=gM(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 yM(t,s,o,r){const c=y.useMemo(()=>{const d=Nx();return Jm(d,s,Xm(r),t.transformTemplate),{...d.attrs,style:{...d.style}}},[s]);if(t.style){const d={};Rx(d,t.style,t),c.style={...d,...c.style}}return c}function bM(t=!1){return(o,r,c,{latestValues:d},u)=>{const m=(Gm(o)?yM:vM)(r,d,u,o),g=ID(r,typeof o=="string",t),v=o!==y.Fragment?{...g,...m,ref:c}:{},{children:_}=r,b=y.useMemo(()=>yn(_)?_.get():_,[_]);return y.createElement(o,{...v,children:b})}}function _M(t,s){return function(r,{forwardMotionProps:c}={forwardMotionProps:!1}){const u={...Gm(r)?pM:mM,preloadedFeatures:t,useRender:bM(c),createVisualElement:s,Component:r};return VD(u)}}function Ix(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 Ud(t,s,o){const r=t.getProps();return Fm(r,s,o!==void 0?o:r.custom,t)}function eh(t,s){return t?t[s]||t.default||t:void 0}const Ox=new Set(["width","height","top","left","right","bottom",...Jo]);let id;function xM(){id=void 0}const Os={now:()=>(id===void 0&&Os.set(mn.isProcessing||CD.useManualTiming?mn.timestamp:performance.now()),id),set:t=>{id=t,queueMicrotask(xM)}};function th(t,s){t.indexOf(s)===-1&&t.push(s)}function nh(t,s){const o=t.indexOf(s);o>-1&&t.splice(o,1)}class sh{constructor(){this.subscriptions=[]}add(s){return th(this.subscriptions,s),()=>nh(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 Lx(t,s){return s?t*(1e3/s):0}const Yy=30,kM=t=>!isNaN(parseFloat(t));class SM{constructor(s,o={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,c=!0)=>{const d=Os.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=Os.now(),this.canTrackVelocity===null&&s!==void 0&&(this.canTrackVelocity=kM(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 sh);const r=this.events[s].add(o);return s==="change"?()=>{r(),jt.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=Os.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||s-this.updatedAt>Yy)return 0;const o=Math.min(this.updatedAt-this.prevUpdatedAt,Yy);return Lx(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 dl(t,s){return new SM(t,s)}function jM(t,s,o){t.hasValue(s)?t.getValue(s).set(o):t.addValue(s,dl(o))}function wM(t,s){const o=Ud(t,s);let{transitionEnd:r={},transition:c={},...d}=o||{};d={...d,...r};for(const u in d){const p=YD(d[u]);jM(t,u,p)}}function TM(t){return!!(yn(t)&&t.add)}function am(t,s){const o=t.getValue("willChange");if(TM(o))return o.add(s)}function Bx(t){return t.props[_x]}function ah(t){let s;return()=>(s===void 0&&(s=t()),s)}const NM=ah(()=>window.ScrollTimeline!==void 0);class CM{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(NM()&&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 EM extends CM{then(s,o){return Promise.all(this.animations).then(s).catch(o)}}const ca=t=>t*1e3,da=t=>t/1e3;function ih(t){return typeof t=="function"}function Jy(t,s){t.timeline=s,t.onfinish=null}const oh=t=>Array.isArray(t)&&typeof t[0]=="number",AM={linearEasing:void 0};function DM(t,s){const o=ah(t);return()=>{var r;return(r=AM[s])!==null&&r!==void 0?r:o()}}const hd=DM(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Vo=(t,s,o)=>{const r=s-t;return r===0?1:(o-t)/r},$x=(t,s,o=10)=>{let r="";const c=Math.max(Math.round(s/o),2);for(let d=0;d<c;d++)r+=t(Vo(0,c-1,d))+", ";return`linear(${r.substring(0,r.length-2)})`};function zx(t){return!!(typeof t=="function"&&hd()||!t||typeof t=="string"&&(t in im||hd())||oh(t)||Array.isArray(t)&&t.every(zx))}const Yr=([t,s,o,r])=>`cubic-bezier(${t}, ${s}, ${o}, ${r})`,im={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Yr([0,.65,.55,1]),circOut:Yr([.55,0,1,.45]),backIn:Yr([.31,.01,.66,-.59]),backOut:Yr([.33,1.53,.69,.99])};function Hx(t,s){if(t)return typeof t=="function"&&hd()?$x(t,s):oh(t)?Yr(t):Array.isArray(t)?t.map(o=>Hx(o,s)||im.easeOut):im[t]}const Px=(t,s,o)=>(((1-3*o+3*s)*t+(3*o-6*s))*t+3*s)*t,MM=1e-7,RM=12;function IM(t,s,o,r,c){let d,u,p=0;do u=s+(o-s)/2,d=Px(u,r,c)-t,d>0?o=u:s=u;while(Math.abs(d)>MM&&++p<RM);return u}function yl(t,s,o,r){if(t===s&&o===r)return Hn;const c=d=>IM(d,0,1,t,o);return d=>d===0||d===1?d:Px(c(d),s,r)}const Ux=t=>s=>s<=.5?t(2*s)/2:(2-t(2*(1-s)))/2,Vx=t=>s=>1-t(1-s),qx=yl(.33,1.53,.69,.99),rh=Vx(qx),Gx=Ux(rh),Fx=t=>(t*=2)<1?.5*rh(t):.5*(2-Math.pow(2,-10*(t-1))),lh=t=>1-Math.sin(Math.acos(t)),Kx=Vx(lh),Zx=Ux(lh),Yx=t=>/^0[^.\s]+$/u.test(t);function OM(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Yx(t):!0}const el=t=>Math.round(t*1e5)/1e5,ch=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function LM(t){return t==null}const BM=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,dh=(t,s)=>o=>!!(typeof o=="string"&&BM.test(o)&&o.startsWith(t)||s&&!LM(o)&&Object.prototype.hasOwnProperty.call(o,s)),Jx=(t,s,o)=>r=>{if(typeof r!="string")return r;const[c,d,u,p]=r.match(ch);return{[t]:parseFloat(c),[s]:parseFloat(d),[o]:parseFloat(u),alpha:p!==void 0?parseFloat(p):1}},$M=t=>ma(0,255,t),Tp={...Wo,transform:t=>Math.round($M(t))},Ri={test:dh("rgb","red"),parse:Jx("red","green","blue"),transform:({red:t,green:s,blue:o,alpha:r=1})=>"rgba("+Tp.transform(t)+", "+Tp.transform(s)+", "+Tp.transform(o)+", "+el(cl.transform(r))+")"};function zM(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 om={test:dh("#"),parse:zM,transform:Ri.transform},Lo={test:dh("hsl","hue"),parse:Jx("hue","saturation","lightness"),transform:({hue:t,saturation:s,lightness:o,alpha:r=1})=>"hsla("+Math.round(t)+", "+Is.transform(el(s))+", "+Is.transform(el(o))+", "+el(cl.transform(r))+")"},vn={test:t=>Ri.test(t)||om.test(t)||Lo.test(t),parse:t=>Ri.test(t)?Ri.parse(t):Lo.test(t)?Lo.parse(t):om.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Ri.transform(t):Lo.transform(t)},HM=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function PM(t){var s,o;return isNaN(t)&&typeof t=="string"&&(((s=t.match(ch))===null||s===void 0?void 0:s.length)||0)+(((o=t.match(HM))===null||o===void 0?void 0:o.length)||0)>0}const Wx="number",Xx="color",UM="var",VM="var(",Wy="${}",qM=/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 ul(t){const s=t.toString(),o=[],r={color:[],number:[],var:[]},c=[];let d=0;const p=s.replace(qM,m=>(vn.test(m)?(r.color.push(d),c.push(Xx),o.push(vn.parse(m))):m.startsWith(VM)?(r.var.push(d),c.push(UM),o.push(m)):(r.number.push(d),c.push(Wx),o.push(parseFloat(m))),++d,Wy)).split(Wy);return{values:o,split:p,indexes:r,types:c}}function Qx(t){return ul(t).values}function e1(t){const{split:s,types:o}=ul(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===Wx?d+=el(c[u]):p===Xx?d+=vn.transform(c[u]):d+=c[u]}return d}}const GM=t=>typeof t=="number"?0:t;function FM(t){const s=Qx(t);return e1(t)(s.map(GM))}const ei={test:PM,parse:Qx,createTransformer:e1,getAnimatableNone:FM},KM=new Set(["brightness","contrast","saturate","opacity"]);function ZM(t){const[s,o]=t.slice(0,-1).split("(");if(s==="drop-shadow")return t;const[r]=o.match(ch)||[];if(!r)return t;const c=o.replace(r,"");let d=KM.has(s)?1:0;return r!==o&&(d*=100),s+"("+d+c+")"}const YM=/\b([a-z-]*)\(.*?\)/gu,rm={...ei,getAnimatableNone:t=>{const s=t.match(YM);return s?s.map(ZM).join(" "):t}},JM={...Zm,color:vn,backgroundColor:vn,outlineColor:vn,fill:vn,stroke:vn,borderColor:vn,borderTopColor:vn,borderRightColor:vn,borderBottomColor:vn,borderLeftColor:vn,filter:rm,WebkitFilter:rm},uh=t=>JM[t];function t1(t,s){let o=uh(t);return o!==rm&&(o=ei),o.getAnimatableNone?o.getAnimatableNone(s):void 0}const WM=new Set(["auto","none","0"]);function XM(t,s,o){let r=0,c;for(;r<t.length&&!c;){const d=t[r];typeof d=="string"&&!WM.has(d)&&ul(d).values.length&&(c=t[r]),r++}if(c&&o)for(const d of s)t[d]=t1(o,c)}const Xy=t=>t===Wo||t===Ee,Qy=(t,s)=>parseFloat(t.split(", ")[s]),eb=(t,s)=>(o,{transform:r})=>{if(r==="none"||!r)return 0;const c=r.match(/^matrix3d\((.+)\)$/u);if(c)return Qy(c[1],s);{const d=r.match(/^matrix\((.+)\)$/u);return d?Qy(d[1],t):0}},QM=new Set(["x","y","z"]),e4=Jo.filter(t=>!QM.has(t));function t4(t){const s=[];return e4.forEach(o=>{const r=t.getValue(o);r!==void 0&&(s.push([o,r.get()]),r.set(o.startsWith("scale")?1:0))}),s}const qo={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:eb(4,13),y:eb(5,14)};qo.translateX=qo.x;qo.translateY=qo.y;const Oi=new Set;let lm=!1,cm=!1;function n1(){if(cm){const t=Array.from(Oi).filter(r=>r.needsMeasurement),s=new Set(t.map(r=>r.element)),o=new Map;s.forEach(r=>{const c=t4(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)})}cm=!1,lm=!1,Oi.forEach(t=>t.complete()),Oi.clear()}function s1(){Oi.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(cm=!0)})}function n4(){s1(),n1()}class fh{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?(Oi.add(this),lm||(lm=!0,jt.read(s1),jt.resolveKeyframes(n1))):(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),Oi.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Oi.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const a1=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),s4=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function a4(t){const s=s4.exec(t);if(!s)return[,];const[,o,r,c]=s;return[`--${o??r}`,c]}function i1(t,s,o=1){const[r,c]=a4(t);if(!r)return;const d=window.getComputedStyle(s).getPropertyValue(r);if(d){const u=d.trim();return a1(u)?parseFloat(u):u}return Km(c)?i1(c,s,o+1):c}const o1=t=>s=>s.test(t),i4={test:t=>t==="auto",parse:t=>t},r1=[Wo,Ee,Is,Ya,tM,eM,i4],tb=t=>r1.find(o1(t));class l1 extends fh{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(),Km(g))){const v=i1(g,o.current);v!==void 0&&(s[m]=v),m===s.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!Ox.has(r)||s.length!==2)return;const[c,d]=s,u=tb(c),p=tb(d);if(u!==p)if(Xy(u)&&Xy(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++)OM(s[c])&&r.push(c);r.length&&XM(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=qo[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]=qo[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 nb=(t,s)=>s==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(ei.test(t)||t==="0")&&!t.startsWith("url("));function o4(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 r4(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=nb(c,s),p=nb(d,s);return!u||!p?!1:o4(t)||(o==="spring"||ih(o))&&r}const l4=t=>t!==null;function Vd(t,{repeat:s,repeatType:o="loop"},r){const c=t.filter(l4),d=s&&o!=="loop"&&s%2===1?0:c.length-1;return!d||r===void 0?c[d]:r}const c4=40;class c1{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=Os.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>c4?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&n4(),this._resolved}onKeyframesResolved(s,o){this.resolvedAt=Os.now(),this.hasAttemptedResolve=!0;const{name:r,type:c,velocity:d,delay:u,onComplete:p,onUpdate:m,isGenerator:g}=this.options;if(!g&&!r4(s,r,c,d))if(u)this.options.duration=0;else{m&&m(Vd(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 dm=2e4;function d1(t){let s=0;const o=50;let r=t.next(s);for(;!r.done&&s<dm;)s+=o,r=t.next(s);return s>=dm?1/0:s}const Et=(t,s,o)=>t+(s-t)*o;function Np(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=Np(m,p,t+1/3),d=Np(m,p,t),u=Np(m,p,t-1/3)}return{red:Math.round(c*255),green:Math.round(d*255),blue:Math.round(u*255),alpha:r}}function gd(t,s){return o=>o>0?s:t}const Cp=(t,s,o)=>{const r=t*t,c=o*(s*s-r)+r;return c<0?0:Math.sqrt(c)},u4=[om,Ri,Lo],f4=t=>u4.find(s=>s.test(t));function sb(t){const s=f4(t);if(!s)return!1;let o=s.parse(t);return s===Lo&&(o=d4(o)),o}const ab=(t,s)=>{const o=sb(t),r=sb(s);if(!o||!r)return gd(t,s);const c={...o};return d=>(c.red=Cp(o.red,r.red,d),c.green=Cp(o.green,r.green,d),c.blue=Cp(o.blue,r.blue,d),c.alpha=Et(o.alpha,r.alpha,d),Ri.transform(c))},p4=(t,s)=>o=>s(t(o)),bl=(...t)=>t.reduce(p4),um=new Set(["none","hidden"]);function m4(t,s){return um.has(t)?o=>o<=0?t:s:o=>o>=1?s:t}function h4(t,s){return o=>Et(t,s,o)}function ph(t){return typeof t=="number"?h4:typeof t=="string"?Km(t)?gd:vn.test(t)?ab:y4:Array.isArray(t)?u1:typeof t=="object"?vn.test(t)?ab:g4:gd}function u1(t,s){const o=[...t],r=o.length,c=t.map((d,u)=>ph(d)(d,s[u]));return d=>{for(let u=0;u<r;u++)o[u]=c[u](d);return o}}function g4(t,s){const o={...t,...s},r={};for(const c in o)t[c]!==void 0&&s[c]!==void 0&&(r[c]=ph(t[c])(t[c],s[c]));return c=>{for(const d in r)o[d]=r[d](c);return o}}function v4(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 y4=(t,s)=>{const o=ei.createTransformer(s),r=ul(t),c=ul(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?um.has(t)&&!c.values.length||um.has(s)&&!r.values.length?m4(t,s):bl(u1(v4(r,c),c.values),o):gd(t,s)};function f1(t,s,o){return typeof t=="number"&&typeof s=="number"&&typeof o=="number"?Et(t,s,o):ph(t)(t,s)}const b4=5;function p1(t,s,o){const r=Math.max(s-b4,0);return Lx(o-t(r),s-r)}const Lt={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},Ep=.001;function _4({duration:t=Lt.duration,bounce:s=Lt.bounce,velocity:o=Lt.velocity,mass:r=Lt.mass}){let c,d,u=1-s;u=ma(Lt.minDamping,Lt.maxDamping,u),t=ma(Lt.minDuration,Lt.maxDuration,da(t)),u<1?(c=g=>{const v=g*u,_=v*t,b=v-o,x=fm(g,u),k=Math.exp(-_);return Ep-b/x*k},d=g=>{const _=g*u*t,b=_*o+o,x=Math.pow(u,2)*Math.pow(g,2)*t,k=Math.exp(-_),j=fm(Math.pow(g,2),u);return(-c(g)+Ep>0?-1:1)*((b-x)*k)/j}):(c=g=>{const v=Math.exp(-g*t),_=(g-o)*t+1;return-Ep+v*_},d=g=>{const v=Math.exp(-g*t),_=(o-g)*(t*t);return v*_});const p=5/t,m=k4(c,d,p);if(t=ca(t),isNaN(m))return{stiffness:Lt.stiffness,damping:Lt.damping,duration:t};{const g=Math.pow(m,2)*r;return{stiffness:g,damping:u*2*Math.sqrt(r*g),duration:t}}}const x4=12;function k4(t,s,o){let r=o;for(let c=1;c<x4;c++)r=r-t(r)/s(r);return r}function fm(t,s){return t*Math.sqrt(1-s*s)}const S4=["duration","bounce"],j4=["stiffness","damping","mass"];function ib(t,s){return s.some(o=>t[o]!==void 0)}function w4(t){let s={velocity:Lt.velocity,stiffness:Lt.stiffness,damping:Lt.damping,mass:Lt.mass,isResolvedFromDuration:!1,...t};if(!ib(t,j4)&&ib(t,S4))if(t.visualDuration){const o=t.visualDuration,r=2*Math.PI/(o*1.2),c=r*r,d=2*ma(.05,1,1-(t.bounce||0))*Math.sqrt(c);s={...s,mass:Lt.mass,stiffness:c,damping:d}}else{const o=_4(t);s={...s,...o,mass:Lt.mass},s.isResolvedFromDuration=!0}return s}function m1(t=Lt.visualDuration,s=Lt.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:_,velocity:b,isResolvedFromDuration:x}=w4({...o,velocity:-da(o.velocity||0)}),k=b||0,j=g/(2*Math.sqrt(m*v)),w=u-d,T=da(Math.sqrt(m/v)),C=Math.abs(w)<5;r||(r=C?Lt.restSpeed.granular:Lt.restSpeed.default),c||(c=C?Lt.restDelta.granular:Lt.restDelta.default);let D;if(j<1){const E=fm(T,j);D=M=>{const L=Math.exp(-j*T*M);return u-L*((k+j*T*w)/E*Math.sin(E*M)+w*Math.cos(E*M))}}else if(j===1)D=E=>u-Math.exp(-T*E)*(w+(k+T*w)*E);else{const E=T*Math.sqrt(j*j-1);D=M=>{const L=Math.exp(-j*T*M),A=Math.min(E*M,300);return u-L*((k+j*T*w)*Math.sinh(A)+E*w*Math.cosh(A))/E}}const O={calculatedDuration:x&&_||null,next:E=>{const M=D(E);if(x)p.done=E>=_;else{let L=0;j<1&&(L=E===0?ca(k):p1(D,E,M));const A=Math.abs(L)<=r,P=Math.abs(u-M)<=c;p.done=A&&P}return p.value=p.done?u:M,p},toString:()=>{const E=Math.min(d1(O),dm),M=$x(L=>O.next(E*L).value,E,30);return E+"ms "+M}};return O}function ob({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 _=t[0],b={done:!1,value:_},x=A=>p!==void 0&&A<p||m!==void 0&&A>m,k=A=>p===void 0?m:m===void 0||Math.abs(p-A)<Math.abs(m-A)?p:m;let j=o*s;const w=_+j,T=u===void 0?w:u(w);T!==w&&(j=T-_);const C=A=>-j*Math.exp(-A/r),D=A=>T+C(A),O=A=>{const P=C(A),Y=D(A);b.done=Math.abs(P)<=g,b.value=b.done?T:Y};let E,M;const L=A=>{x(b.value)&&(E=A,M=m1({keyframes:[b.value,k(b.value)],velocity:p1(D,A,b.value),damping:c,stiffness:d,restDelta:g,restSpeed:v}))};return L(0),{calculatedDuration:null,next:A=>{let P=!1;return!M&&E===void 0&&(P=!0,O(A),L(A)),E!==void 0&&A>=E?M.next(A-E):(!P&&O(A),b)}}}const T4=yl(.42,0,1,1),N4=yl(0,0,.58,1),h1=yl(.42,0,.58,1),C4=t=>Array.isArray(t)&&typeof t[0]!="number",E4={linear:Hn,easeIn:T4,easeInOut:h1,easeOut:N4,circIn:lh,circInOut:Zx,circOut:Kx,backIn:rh,backInOut:Gx,backOut:qx,anticipate:Fx},rb=t=>{if(oh(t)){hx(t.length===4);const[s,o,r,c]=t;return yl(s,o,r,c)}else if(typeof t=="string")return E4[t];return t};function A4(t,s,o){const r=[],c=o||f1,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]||Hn:s;p=bl(m,p)}r.push(p)}return r}function D4(t,s,{clamp:o=!0,ease:r,mixer:c}={}){const d=t.length;if(hx(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=A4(s,r,c),m=p.length,g=v=>{if(u&&v<t[0])return s[0];let _=0;if(m>1)for(;_<t.length-2&&!(v<t[_+1]);_++);const b=Vo(t[_],t[_+1],v);return p[_](b)};return o?v=>g(ma(t[0],t[d-1],v)):g}function M4(t,s){const o=t[t.length-1];for(let r=1;r<=s;r++){const c=Vo(0,s,r);t.push(Et(o,1,c))}}function R4(t){const s=[0];return M4(s,t.length-1),s}function I4(t,s){return t.map(o=>o*s)}function O4(t,s){return t.map(()=>s||h1).splice(0,t.length-1)}function vd({duration:t=300,keyframes:s,times:o,ease:r="easeInOut"}){const c=C4(r)?r.map(rb):rb(r),d={done:!1,value:s[0]},u=I4(o&&o.length===s.length?o:R4(s),t),p=D4(u,s,{ease:Array.isArray(c)?c:O4(s,c)});return{calculatedDuration:t,next:m=>(d.value=p(m),d.done=m>=t,d)}}const L4=t=>{const s=({timestamp:o})=>t(o);return{start:()=>jt.update(s,!0),stop:()=>Qa(s),now:()=>mn.isProcessing?mn.timestamp:Os.now()}},B4={decay:ob,inertia:ob,tween:vd,keyframes:vd,spring:m1},$4=t=>t/100;class mh extends c1{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)||fh,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=ih(o)?o:B4[o]||vd;let m,g;p!==vd&&typeof s[0]!="number"&&(m=bl($4,f1(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=d1(v));const{calculatedDuration:_}=v,b=_+c,x=b*(r+1)-c;return{generator:v,mirroredGenerator:g,mapPercentToKeyframes:m,calculatedDuration:_,resolvedDuration:b,totalDuration:x}}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:A}=this.options;return{done:!0,value:A[A.length-1]}}const{finalKeyframe:c,generator:d,mirroredGenerator:u,mapPercentToKeyframes:p,keyframes:m,calculatedDuration:g,totalDuration:v,resolvedDuration:_}=r;if(this.startTime===null)return d.next(0);const{delay:b,repeat:x,repeatType:k,repeatDelay:j,onUpdate:w}=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-b*(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 D=this.currentTime,O=d;if(x){const A=Math.min(this.currentTime,v)/_;let P=Math.floor(A),Y=A%1;!Y&&A>=1&&(Y=1),Y===1&&P--,P=Math.min(P,x+1),!!(P%2)&&(k==="reverse"?(Y=1-Y,j&&(Y-=j/_)):k==="mirror"&&(O=u)),D=ma(0,1,Y)*_}const E=C?{done:!1,value:m[0]}:O.next(D);p&&(E.value=p(E.value));let{done:M}=E;!C&&g!==null&&(M=this.speed>=0?this.currentTime>=v:this.currentTime<=0);const L=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return L&&c!==void 0&&(E.value=Vd(m,this.options,c)),w&&w(E.value),L&&this.finish(),E}get duration(){const{resolved:s}=this;return s?da(s.calculatedDuration):0}get time(){return da(this.currentTime)}set time(s){s=ca(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=da(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:s=L4,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 z4=new Set(["opacity","clipPath","filter","transform"]);function H4(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=Hx(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 P4=ah(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),yd=10,U4=2e4;function V4(t){return ih(t.type)||t.type==="spring"||!zx(t.ease)}function q4(t,s){const o=new mh({...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<U4;)r=o.sample(d),c.push(r.value),d+=yd;return{times:void 0,keyframes:c,duration:d-yd,ease:"linear"}}const g1={anticipate:Fx,backInOut:Gx,circInOut:Zx};function G4(t){return t in g1}class lb extends c1{constructor(s){super(s);const{name:o,motionValue:r,element:c,keyframes:d}=this.options;this.resolver=new l1(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"&&hd()&&G4(d)&&(d=g1[d]),V4(this.options)){const{onComplete:_,onUpdate:b,motionValue:x,element:k,...j}=this.options,w=q4(s,j);s=w.keyframes,s.length===1&&(s[1]=s[0]),r=w.duration,c=w.times,d=w.ease,u="keyframes"}const v=H4(p.owner.current,m,s,{...this.options,duration:r,times:c,ease:d});return v.startTime=g??this.calcStartTime(),this.pendingTimeline?(Jy(v,this.pendingTimeline),this.pendingTimeline=void 0):v.onfinish=()=>{const{onComplete:_}=this.options;p.set(Vd(s,this.options,o)),_&&_(),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 da(o)}get time(){const{resolved:s}=this;if(!s)return 0;const{animation:o}=s;return da(o.currentTime||0)}set time(s){const{resolved:o}=this;if(!o)return;const{animation:r}=o;r.currentTime=ca(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 Hn;const{animation:r}=o;Jy(r,s)}return Hn}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:_,element:b,...x}=this.options,k=new mh({...x,keyframes:r,duration:c,type:d,ease:u,times:p,isGenerator:!0}),j=ca(this.time);g.setWithVelocity(k.sample(j-yd).value,k.sample(j).value,yd)}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 P4()&&r&&z4.has(r)&&!m&&!g&&!c&&d!=="mirror"&&u!==0&&p!=="inertia"}}const F4={type:"spring",stiffness:500,damping:25,restSpeed:10},K4=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Z4={type:"keyframes",duration:.8},Y4={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},J4=(t,{keyframes:s})=>s.length>2?Z4:Pi.has(t)?t.startsWith("scale")?K4(s[1]):F4:Y4;function W4({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 hh=(t,s,o,r={},c,d)=>u=>{const p=eh(r,t)||{},m=p.delay||r.delay||0;let{elapsed:g=0}=r;g=g-ca(m);let v={keyframes:Array.isArray(o)?o:[null,o],ease:"easeOut",velocity:s.getVelocity(),...p,delay:-g,onUpdate:b=>{s.set(b),p.onUpdate&&p.onUpdate(b)},onComplete:()=>{u(),p.onComplete&&p.onComplete()},name:t,motionValue:s,element:d?void 0:c};W4(p)||(v={...v,...J4(t,v)}),v.duration&&(v.duration=ca(v.duration)),v.repeatDelay&&(v.repeatDelay=ca(v.repeatDelay)),v.from!==void 0&&(v.keyframes[0]=v.from);let _=!1;if((v.type===!1||v.duration===0&&!v.repeatDelay)&&(v.duration=0,v.delay===0&&(_=!0)),_&&!d&&s.get()!==void 0){const b=Vd(v.keyframes,p);if(b!==void 0)return jt.update(()=>{v.onUpdate(b),v.onComplete()}),new EM([])}return!d&&lb.supports(v)?new lb(v):new mh(v)};function X4({protectedKeys:t,needsAnimating:s},o){const r=t.hasOwnProperty(o)&&s[o]!==!0;return s[o]=!1,r}function v1(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 _ in m){const b=t.getValue(_,(d=t.latestValues[_])!==null&&d!==void 0?d:null),x=m[_];if(x===void 0||v&&X4(v,_))continue;const k={delay:o,...eh(u||{},_)};let j=!1;if(window.MotionHandoffAnimation){const T=Bx(t);if(T){const C=window.MotionHandoffAnimation(T,_,jt);C!==null&&(k.startTime=C,j=!0)}}am(t,_),b.start(hh(_,b,x,t.shouldReduceMotion&&Ox.has(_)?{type:!1}:k,t,j));const w=b.animation;w&&g.push(w)}return p&&Promise.all(g).then(()=>{jt.update(()=>{p&&wM(t,p)})}),g}function pm(t,s,o={}){var r;const c=Ud(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(v1(t,c,o)):()=>Promise.resolve(),p=t.variantChildren&&t.variantChildren.size?(g=0)=>{const{delayChildren:v=0,staggerChildren:_,staggerDirection:b}=d;return Q4(t,s,v+g,_,b,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 Q4(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(eR).forEach((g,v)=>{g.notify("AnimationStart",s),u.push(pm(g,s,{...d,delay:o+m(v)}).then(()=>g.notify("AnimationComplete",s)))}),Promise.all(u)}function eR(t,s){return t.sortNodePosition(s)}function tR(t,s,o={}){t.notify("AnimationStart",s);let r;if(Array.isArray(s)){const c=s.map(d=>pm(t,d,o));r=Promise.all(c)}else if(typeof s=="string")r=pm(t,s,o);else{const c=typeof s=="function"?Ud(t,s,o.custom):s;r=Promise.all(v1(t,c,o))}return r.then(()=>{t.notify("AnimationComplete",s)})}const nR=Um.length;function y1(t){if(!t)return;if(!t.isControllingVariants){const o=t.parent?y1(t.parent)||{}:{};return t.props.initial!==void 0&&(o.initial=t.props.initial),o}const s={};for(let o=0;o<nR;o++){const r=Um[o],c=t.props[r];(ll(c)||c===!1)&&(s[r]=c)}return s}const sR=[...Pm].reverse(),aR=Pm.length;function iR(t){return s=>Promise.all(s.map(({animation:o,options:r})=>tR(t,o,r)))}function oR(t){let s=iR(t),o=cb(),r=!0;const c=m=>(g,v)=>{var _;const b=Ud(t,v,m==="exit"?(_=t.presenceContext)===null||_===void 0?void 0:_.custom:void 0);if(b){const{transition:x,transitionEnd:k,...j}=b;g={...g,...j,...k}}return g};function d(m){s=m(t)}function u(m){const{props:g}=t,v=y1(t.parent)||{},_=[],b=new Set;let x={},k=1/0;for(let w=0;w<aR;w++){const T=sR[w],C=o[T],D=g[T]!==void 0?g[T]:v[T],O=ll(D),E=T===m?C.isActive:null;E===!1&&(k=w);let M=D===v[T]&&D!==g[T]&&O;if(M&&r&&t.manuallyAnimateOnMount&&(M=!1),C.protectedKeys={...x},!C.isActive&&E===null||!D&&!C.prevProp||Hd(D)||typeof D=="boolean")continue;const L=rR(C.prevProp,D);let A=L||T===m&&C.isActive&&!M&&O||w>k&&O,P=!1;const Y=Array.isArray(D)?D:[D];let q=Y.reduce(c(T),{});E===!1&&(q={});const{prevResolvedValues:ee={}}=C,le={...ee,...q},W=B=>{A=!0,b.has(B)&&(P=!0,b.delete(B)),C.needsAnimating[B]=!0;const se=t.getValue(B);se&&(se.liveStyle=!1)};for(const B in le){const se=q[B],oe=ee[B];if(x.hasOwnProperty(B))continue;let X=!1;sm(se)&&sm(oe)?X=!Ix(se,oe):X=se!==oe,X?se!=null?W(B):b.add(B):se!==void 0&&b.has(B)?W(B):C.protectedKeys[B]=!0}C.prevProp=D,C.prevResolvedValues=q,C.isActive&&(x={...x,...q}),r&&t.blockInitialAnimation&&(A=!1),A&&(!(M&&L)||P)&&_.push(...Y.map(B=>({animation:B,options:{type:T}})))}if(b.size){const w={};b.forEach(T=>{const C=t.getBaseTarget(T),D=t.getValue(T);D&&(D.liveStyle=!0),w[T]=C??null}),_.push({animation:w})}let j=!!_.length;return r&&(g.initial===!1||g.initial===g.animate)&&!t.manuallyAnimateOnMount&&(j=!1),r=!1,j?s(_):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(b=>{var x;return(x=b.animationState)===null||x===void 0?void 0:x.setActive(m,g)}),o[m].isActive=g;const _=u(m);for(const b in o)o[b].protectedKeys={};return _}return{animateChanges:u,setActive:p,setAnimateFunction:d,getState:()=>o,reset:()=>{o=cb(),r=!0}}}function rR(t,s){return typeof s=="string"?s!==t:Array.isArray(s)?!Ix(s,t):!1}function Ci(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function cb(){return{animate:Ci(!0),whileInView:Ci(),whileHover:Ci(),whileTap:Ci(),whileDrag:Ci(),whileFocus:Ci(),exit:Ci()}}class ni{constructor(s){this.isMounted=!1,this.node=s}update(){}}class lR extends ni{constructor(s){super(s),s.animationState||(s.animationState=oR(s))}updateAnimationControlsSubscription(){const{animate:s}=this.node.getProps();Hd(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 cR=0;class dR extends ni{constructor(){super(...arguments),this.id=cR++}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 uR={animation:{Feature:lR},exit:{Feature:dR}},bs={x:!1,y:!1};function b1(){return bs.x||bs.y}function fR(t){return t==="x"||t==="y"?bs[t]?null:(bs[t]=!0,()=>{bs[t]=!1}):bs.x||bs.y?null:(bs.x=bs.y=!0,()=>{bs.x=bs.y=!1})}const gh=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function fl(t,s,o,r={passive:!0}){return t.addEventListener(s,o,r),()=>t.removeEventListener(s,o)}function _l(t){return{point:{x:t.pageX,y:t.pageY}}}const pR=t=>s=>gh(s)&&t(s,_l(s));function tl(t,s,o,r){return fl(t,s,pR(o),r)}const db=(t,s)=>Math.abs(t-s);function mR(t,s){const o=db(t.x,s.x),r=db(t.y,s.y);return Math.sqrt(o**2+r**2)}class _1{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 _=Dp(this.lastMoveEventInfo,this.history),b=this.startEvent!==null,x=mR(_.offset,{x:0,y:0})>=3;if(!b&&!x)return;const{point:k}=_,{timestamp:j}=mn;this.history.push({...k,timestamp:j});const{onStart:w,onMove:T}=this.handlers;b||(w&&w(this.lastMoveEvent,_),this.startEvent=this.lastMoveEvent),T&&T(this.lastMoveEvent,_)},this.handlePointerMove=(_,b)=>{this.lastMoveEvent=_,this.lastMoveEventInfo=Ap(b,this.transformPagePoint),jt.update(this.updatePoint,!0)},this.handlePointerUp=(_,b)=>{this.end();const{onEnd:x,onSessionEnd:k,resumeAnimation:j}=this.handlers;if(this.dragSnapToOrigin&&j&&j(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=Dp(_.type==="pointercancel"?this.lastMoveEventInfo:Ap(b,this.transformPagePoint),this.history);this.startEvent&&x&&x(_,w),k&&k(_,w)},!gh(s))return;this.dragSnapToOrigin=d,this.handlers=o,this.transformPagePoint=r,this.contextWindow=c||window;const u=_l(s),p=Ap(u,this.transformPagePoint),{point:m}=p,{timestamp:g}=mn;this.history=[{...m,timestamp:g}];const{onSessionStart:v}=o;v&&v(s,Dp(p,this.history)),this.removeListeners=bl(tl(this.contextWindow,"pointermove",this.handlePointerMove),tl(this.contextWindow,"pointerup",this.handlePointerUp),tl(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(s){this.handlers=s}end(){this.removeListeners&&this.removeListeners(),Qa(this.updatePoint)}}function Ap(t,s){return s?{point:s(t.point)}:t}function ub(t,s){return{x:t.x-s.x,y:t.y-s.y}}function Dp({point:t},s){return{point:t,delta:ub(t,x1(s)),offset:ub(t,hR(s)),velocity:gR(s,.1)}}function hR(t){return t[0]}function x1(t){return t[t.length-1]}function gR(t,s){if(t.length<2)return{x:0,y:0};let o=t.length-1,r=null;const c=x1(t);for(;o>=0&&(r=t[o],!(c.timestamp-r.timestamp>ca(s)));)o--;if(!r)return{x:0,y:0};const d=da(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 k1=1e-4,vR=1-k1,yR=1+k1,S1=.01,bR=0-S1,_R=0+S1;function Un(t){return t.max-t.min}function xR(t,s,o){return Math.abs(t-s)<=o}function fb(t,s,o,r=.5){t.origin=r,t.originPoint=Et(s.min,s.max,t.origin),t.scale=Un(o)/Un(s),t.translate=Et(o.min,o.max,t.origin)-t.originPoint,(t.scale>=vR&&t.scale<=yR||isNaN(t.scale))&&(t.scale=1),(t.translate>=bR&&t.translate<=_R||isNaN(t.translate))&&(t.translate=0)}function nl(t,s,o,r){fb(t.x,s.x,o.x,r?r.originX:void 0),fb(t.y,s.y,o.y,r?r.originY:void 0)}function pb(t,s,o){t.min=o.min+s.min,t.max=t.min+Un(s)}function kR(t,s,o){pb(t.x,s.x,o.x),pb(t.y,s.y,o.y)}function mb(t,s,o){t.min=s.min-o.min,t.max=t.min+Un(s)}function sl(t,s,o){mb(t.x,s.x,o.x),mb(t.y,s.y,o.y)}function SR(t,{min:s,max:o},r){return s!==void 0&&t<s?t=r?Et(s,t,r.min):Math.max(t,s):o!==void 0&&t>o&&(t=r?Et(o,t,r.max):Math.min(t,o)),t}function hb(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 jR(t,{top:s,left:o,bottom:r,right:c}){return{x:hb(t.x,o,c),y:hb(t.y,s,r)}}function gb(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 wR(t,s){return{x:gb(t.x,s.x),y:gb(t.y,s.y)}}function TR(t,s){let o=.5;const r=Un(t),c=Un(s);return c>r?o=Vo(s.min,s.max-r,t.min):r>c&&(o=Vo(t.min,t.max-c,s.min)),ma(0,1,o)}function NR(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 mm=.35;function CR(t=mm){return t===!1?t=0:t===!0&&(t=mm),{x:vb(t,"left","right"),y:vb(t,"top","bottom")}}function vb(t,s,o){return{min:yb(t,s),max:yb(t,o)}}function yb(t,s){return typeof t=="number"?t:t[s]||0}const bb=()=>({translate:0,scale:1,origin:0,originPoint:0}),Bo=()=>({x:bb(),y:bb()}),_b=()=>({min:0,max:0}),Ht=()=>({x:_b(),y:_b()});function as(t){return[t("x"),t("y")]}function j1({top:t,left:s,right:o,bottom:r}){return{x:{min:s,max:o},y:{min:t,max:r}}}function ER({x:t,y:s}){return{top:s.min,right:t.max,bottom:s.max,left:t.min}}function AR(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 Mp(t){return t===void 0||t===1}function hm({scale:t,scaleX:s,scaleY:o}){return!Mp(t)||!Mp(s)||!Mp(o)}function Di(t){return hm(t)||w1(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function w1(t){return xb(t.x)||xb(t.y)}function xb(t){return t&&t!=="0%"}function bd(t,s,o){const r=t-o,c=s*r;return o+c}function kb(t,s,o,r,c){return c!==void 0&&(t=bd(t,c,r)),bd(t,o,r)+s}function gm(t,s=0,o=1,r,c){t.min=kb(t.min,s,o,r,c),t.max=kb(t.max,s,o,r,c)}function T1(t,{x:s,y:o}){gm(t.x,s.translate,s.scale,s.originPoint),gm(t.y,o.translate,o.scale,o.originPoint)}const Sb=.999999999999,jb=1.0000000000001;function DR(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&&zo(t,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),u&&(s.x*=u.x.scale,s.y*=u.y.scale,T1(t,u)),r&&Di(d.latestValues)&&zo(t,d.latestValues))}s.x<jb&&s.x>Sb&&(s.x=1),s.y<jb&&s.y>Sb&&(s.y=1)}function $o(t,s){t.min=t.min+s,t.max=t.max+s}function wb(t,s,o,r,c=.5){const d=Et(t.min,t.max,c);gm(t,s,o,d,r)}function zo(t,s){wb(t.x,s.x,s.scaleX,s.scale,s.originX),wb(t.y,s.y,s.scaleY,s.scale,s.originY)}function N1(t,s){return j1(AR(t.getBoundingClientRect(),s))}function MR(t,s,o){const r=N1(t,o),{scroll:c}=s;return c&&($o(r.x,c.offset.x),$o(r.y,c.offset.y)),r}const C1=({current:t})=>t?t.ownerDocument.defaultView:null,RR=new WeakMap;class IR{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=Ht(),this.visualElement=s}start(s,{snapToCursor:o=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const c=v=>{const{dragSnapToOrigin:_}=this.getProps();_?this.pauseAnimation():this.stopAnimation(),o&&this.snapToCursor(_l(v).point)},d=(v,_)=>{const{drag:b,dragPropagation:x,onDragStart:k}=this.getProps();if(b&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=fR(b),!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),as(w=>{let T=this.getAxisMotionValue(w).get()||0;if(Is.test(T)){const{projection:C}=this.visualElement;if(C&&C.layout){const D=C.layout.layoutBox[w];D&&(T=Un(D)*(parseFloat(T)/100))}}this.originPoint[w]=T}),k&&jt.postRender(()=>k(v,_)),am(this.visualElement,"transform");const{animationState:j}=this.visualElement;j&&j.setActive("whileDrag",!0)},u=(v,_)=>{const{dragPropagation:b,dragDirectionLock:x,onDirectionLock:k,onDrag:j}=this.getProps();if(!b&&!this.openDragLock)return;const{offset:w}=_;if(x&&this.currentDirection===null){this.currentDirection=OR(w),this.currentDirection!==null&&k&&k(this.currentDirection);return}this.updateAxis("x",_.point,w),this.updateAxis("y",_.point,w),this.visualElement.render(),j&&j(v,_)},p=(v,_)=>this.stop(v,_),m=()=>as(v=>{var _;return this.getAnimationState(v)==="paused"&&((_=this.getAxisMotionValue(v).animation)===null||_===void 0?void 0:_.play())}),{dragSnapToOrigin:g}=this.getProps();this.panSession=new _1(s,{onSessionStart:c,onStart:d,onMove:u,onSessionEnd:p,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,contextWindow:C1(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&&jt.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||!Fc(s,c,this.currentDirection))return;const d=this.getAxisMotionValue(s);let u=this.originPoint[s]+r[s];this.constraints&&this.constraints[s]&&(u=SR(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&&Oo(o)?this.constraints||(this.constraints=this.resolveRefConstraints()):o&&c?this.constraints=jR(c.layoutBox,o):this.constraints=!1,this.elastic=CR(r),d!==this.constraints&&c&&this.constraints&&!this.hasMutatedConstraints&&as(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=NR(c.layoutBox[u],this.constraints[u]))})}resolveRefConstraints(){const{dragConstraints:s,onMeasureDragConstraints:o}=this.getProps();if(!s||!Oo(s))return!1;const r=s.current,{projection:c}=this.visualElement;if(!c||!c.layout)return!1;const d=MR(r,c.root,this.visualElement.getTransformPagePoint());let u=wR(c.layout.layoutBox,d);if(o){const p=o(ER(u));this.hasMutatedConstraints=!!p,p&&(u=j1(p))}return u}startAnimation(s){const{drag:o,dragMomentum:r,dragElastic:c,dragTransition:d,dragSnapToOrigin:u,onDragTransitionEnd:p}=this.getProps(),m=this.constraints||{},g=as(v=>{if(!Fc(v,o,this.currentDirection))return;let _=m&&m[v]||{};u&&(_={min:0,max:0});const b=c?200:1e6,x=c?40:1e7,k={type:"inertia",velocity:r?s[v]:0,bounceStiffness:b,bounceDamping:x,timeConstant:750,restDelta:1,restSpeed:10,...d,..._};return this.startAxisValueAnimation(v,k)});return Promise.all(g).then(p)}startAxisValueAnimation(s,o){const r=this.getAxisMotionValue(s);return am(this.visualElement,s),r.start(hh(s,r,0,o,this.visualElement,!1))}stopAnimation(){as(s=>this.getAxisMotionValue(s).stop())}pauseAnimation(){as(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){as(o=>{const{drag:r}=this.getProps();if(!Fc(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]-Et(u,p,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:s,dragConstraints:o}=this.getProps(),{projection:r}=this.visualElement;if(!Oo(o)||!r||!this.constraints)return;this.stopAnimation();const c={x:0,y:0};as(u=>{const p=this.getAxisMotionValue(u);if(p&&this.constraints!==!1){const m=p.get();c[u]=TR({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(),as(u=>{if(!Fc(u,s,null))return;const p=this.getAxisMotionValue(u),{min:m,max:g}=this.constraints[u];p.set(Et(m,g,c[u]))})}addListeners(){if(!this.visualElement.current)return;RR.set(this.visualElement,this);const s=this.visualElement.current,o=tl(s,"pointerdown",m=>{const{drag:g,dragListener:v=!0}=this.getProps();g&&v&&this.start(m)}),r=()=>{const{dragConstraints:m}=this.getProps();Oo(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()),jt.read(r);const u=fl(window,"resize",()=>this.scalePositionWithinConstraints()),p=c.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:g})=>{this.isDragging&&g&&(as(v=>{const _=this.getAxisMotionValue(v);_&&(this.originPoint[v]+=m[v].translate,_.set(_.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=mm,dragMomentum:p=!0}=s;return{...s,drag:o,dragDirectionLock:r,dragPropagation:c,dragConstraints:d,dragElastic:u,dragMomentum:p}}}function Fc(t,s,o){return(s===!0||s===t)&&(o===null||o===t)}function OR(t,s=10){let o=null;return Math.abs(t.y)>s?o="y":Math.abs(t.x)>s&&(o="x"),o}class LR extends ni{constructor(s){super(s),this.removeGroupControls=Hn,this.removeListeners=Hn,this.controls=new IR(s)}mount(){const{dragControls:s}=this.node.getProps();s&&(this.removeGroupControls=s.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Hn}unmount(){this.removeGroupControls(),this.removeListeners()}}const Tb=t=>(s,o)=>{t&&jt.postRender(()=>t(s,o))};class BR extends ni{constructor(){super(...arguments),this.removePointerDownListener=Hn}onPointerDown(s){this.session=new _1(s,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:C1(this.node)})}createPanHandlers(){const{onPanSessionStart:s,onPanStart:o,onPan:r,onPanEnd:c}=this.node.getProps();return{onSessionStart:Tb(s),onStart:Tb(o),onMove:r,onEnd:(d,u)=>{delete this.session,c&&jt.postRender(()=>c(d,u))}}}mount(){this.removePointerDownListener=tl(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 od={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Nb(t,s){return s.max===s.min?0:t/(s.max-s.min)*100}const Vr={correct:(t,s)=>{if(!s.target)return t;if(typeof t=="string")if(Ee.test(t))t=parseFloat(t);else return t;const o=Nb(t,s.target.x),r=Nb(t,s.target.y);return`${o}% ${r}%`}},$R={correct:(t,{treeScale:s,projectionDelta:o})=>{const r=t,c=ei.parse(t);if(c.length>5)return r;const d=ei.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=Et(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 zR extends y.Component{componentDidMount(){const{visualElement:s,layoutGroup:o,switchLayoutGroup:r,layoutId:c}=this.props,{projection:d}=s;uM(HR),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()})),od.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()||jt.postRender(()=>{const p=u.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:s}=this.props.visualElement;s&&(s.root.didUpdate(),qm.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 E1(t){const[s,o]=px(),r=y.useContext(Bm);return a.jsx(zR,{...t,layoutGroup:r,switchLayoutGroup:y.useContext(xx),isPresent:s,safeToRemove:o})}const HR={borderRadius:{...Vr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Vr,borderTopRightRadius:Vr,borderBottomLeftRadius:Vr,borderBottomRightRadius:Vr,boxShadow:$R};function PR(t,s,o){const r=yn(t)?t:dl(t);return r.start(hh("",r,s,o)),r.animation}function UR(t){return t instanceof SVGElement&&t.tagName!=="svg"}const VR=(t,s)=>t.depth-s.depth;class qR{constructor(){this.children=[],this.isDirty=!1}add(s){th(this.children,s),this.isDirty=!0}remove(s){nh(this.children,s),this.isDirty=!0}forEach(s){this.isDirty&&this.children.sort(VR),this.isDirty=!1,this.children.forEach(s)}}function GR(t,s){const o=Os.now(),r=({timestamp:c})=>{const d=c-o;d>=s&&(Qa(r),t(d-s))};return jt.read(r,!0),()=>Qa(r)}const A1=["TopLeft","TopRight","BottomLeft","BottomRight"],FR=A1.length,Cb=t=>typeof t=="string"?parseFloat(t):t,Eb=t=>typeof t=="number"||Ee.test(t);function KR(t,s,o,r,c,d){c?(t.opacity=Et(0,o.opacity!==void 0?o.opacity:1,ZR(r)),t.opacityExit=Et(s.opacity!==void 0?s.opacity:1,0,YR(r))):d&&(t.opacity=Et(s.opacity!==void 0?s.opacity:1,o.opacity!==void 0?o.opacity:1,r));for(let u=0;u<FR;u++){const p=`border${A1[u]}Radius`;let m=Ab(s,p),g=Ab(o,p);if(m===void 0&&g===void 0)continue;m||(m=0),g||(g=0),m===0||g===0||Eb(m)===Eb(g)?(t[p]=Math.max(Et(Cb(m),Cb(g),r),0),(Is.test(g)||Is.test(m))&&(t[p]+="%")):t[p]=g}(s.rotate||o.rotate)&&(t.rotate=Et(s.rotate||0,o.rotate||0,r))}function Ab(t,s){return t[s]!==void 0?t[s]:t.borderRadius}const ZR=D1(0,.5,Kx),YR=D1(.5,.95,Hn);function D1(t,s,o){return r=>r<t?0:r>s?1:o(Vo(t,s,r))}function Db(t,s){t.min=s.min,t.max=s.max}function es(t,s){Db(t.x,s.x),Db(t.y,s.y)}function Mb(t,s){t.translate=s.translate,t.scale=s.scale,t.originPoint=s.originPoint,t.origin=s.origin}function Rb(t,s,o,r,c){return t-=s,t=bd(t,1/o,r),c!==void 0&&(t=bd(t,1/c,r)),t}function JR(t,s=0,o=1,r=.5,c,d=t,u=t){if(Is.test(s)&&(s=parseFloat(s),s=Et(u.min,u.max,s/100)-u.min),typeof s!="number")return;let p=Et(d.min,d.max,r);t===d&&(p-=s),t.min=Rb(t.min,s,o,p,c),t.max=Rb(t.max,s,o,p,c)}function Ib(t,s,[o,r,c],d,u){JR(t,s[o],s[r],s[c],s.scale,d,u)}const WR=["x","scaleX","originX"],XR=["y","scaleY","originY"];function Ob(t,s,o,r){Ib(t.x,s,WR,o?o.x:void 0,r?r.x:void 0),Ib(t.y,s,XR,o?o.y:void 0,r?r.y:void 0)}function Lb(t){return t.translate===0&&t.scale===1}function M1(t){return Lb(t.x)&&Lb(t.y)}function Bb(t,s){return t.min===s.min&&t.max===s.max}function QR(t,s){return Bb(t.x,s.x)&&Bb(t.y,s.y)}function $b(t,s){return Math.round(t.min)===Math.round(s.min)&&Math.round(t.max)===Math.round(s.max)}function R1(t,s){return $b(t.x,s.x)&&$b(t.y,s.y)}function zb(t){return Un(t.x)/Un(t.y)}function Hb(t,s){return t.translate===s.translate&&t.scale===s.scale&&t.originPoint===s.originPoint}class e3{constructor(){this.members=[]}add(s){th(this.members,s),s.scheduleRender()}remove(s){if(nh(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 t3(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:_,rotateY:b,skewX:x,skewY:k}=o;g&&(r=`perspective(${g}px) ${r}`),v&&(r+=`rotate(${v}deg) `),_&&(r+=`rotateX(${_}deg) `),b&&(r+=`rotateY(${b}deg) `),x&&(r+=`skewX(${x}deg) `),k&&(r+=`skewY(${k}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 Mi={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Jr=typeof window<"u"&&window.MotionDebug!==void 0,Rp=["","X","Y","Z"],n3={visibility:"hidden"},Pb=1e3;let s3=0;function Ip(t,s,o,r){const{latestValues:c}=s;c[t]&&(o[t]=c[t],s.setStaticValue(t,0),r&&(r[t]=0))}function I1(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:s}=t.options;if(!s)return;const o=Bx(s);if(window.MotionHasOptimisedAnimation(o,"transform")){const{layout:c,layoutId:d}=t.options;window.MotionCancelOptimisedAnimation(o,"transform",jt,!(c||d))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&I1(r)}function O1({attachResizeListener:t,defaultParent:s,measureScroll:o,checkIsScrollRoot:r,resetTransform:c}){return class{constructor(u={},p=s==null?void 0:s()){this.id=s3++,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,Jr&&(Mi.totalNodes=Mi.resolvedTargetDeltas=Mi.recalculatedProjection=0),this.nodes.forEach(o3),this.nodes.forEach(u3),this.nodes.forEach(f3),this.nodes.forEach(r3),Jr&&window.MotionDebug.record(Mi)},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 qR)}addEventListener(u,p){return this.eventHandlers.has(u)||this.eventHandlers.set(u,new sh),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=UR(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 _;const b=()=>this.root.updateBlockedByResize=!1;t(u,()=>{this.root.updateBlockedByResize=!0,_&&_(),_=GR(b,250),od.hasAnimatedSinceResize&&(od.hasAnimatedSinceResize=!1,this.nodes.forEach(Vb))})}m&&this.root.registerSharedNode(m,this),this.options.animate!==!1&&v&&(m||g)&&this.addEventListener("didUpdate",({delta:_,hasLayoutChanged:b,hasRelativeTargetChanged:x,layout:k})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const j=this.options.transition||v.getDefaultTransition()||v3,{onLayoutAnimationStart:w,onLayoutAnimationComplete:T}=v.getProps(),C=!this.targetLayout||!R1(this.targetLayout,k)||x,D=!b&&x;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||D||b&&(C||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(_,D);const O={...eh(j,"layout"),onPlay:w,onComplete:T};(v.shouldReduceMotion||this.options.layoutRoot)&&(O.delay=0,O.type=!1),this.startAnimation(O)}else b||Vb(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=k})}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,Qa(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(p3),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&&I1(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let v=0;v<this.path.length;v++){const _=this.path[v];_.shouldResetTransform=!0,_.updateScroll("snapshot"),_.options.layoutRoot&&_.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(Ub);return}this.isUpdating||this.nodes.forEach(c3),this.isUpdating=!1,this.nodes.forEach(d3),this.nodes.forEach(a3),this.nodes.forEach(i3),this.clearAllSnapshots();const p=Os.now();mn.delta=ma(0,1e3/60,p-mn.timestamp),mn.timestamp=p,mn.isProcessing=!0,wp.update.process(mn),wp.preRender.process(mn),wp.render.process(mn),mn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,qm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(l3),this.sharedNodes.forEach(m3)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,jt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){jt.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=Ht(),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&&!M1(this.projectionDelta),m=this.getTransformTemplate(),g=m?m(this.latestValues,""):void 0,v=g!==this.prevTransformTemplateValue;u&&(p||Di(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)),y3(m),{animationId:this.root.animationId,measuredBox:p,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:p}=this.options;if(!p)return Ht();const m=p.measureViewportBox();if(!(((u=this.scroll)===null||u===void 0?void 0:u.wasRoot)||this.path.some(b3))){const{scroll:v}=this.root;v&&($o(m.x,v.offset.x),$o(m.y,v.offset.y))}return m}removeElementScroll(u){var p;const m=Ht();if(es(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:_,options:b}=v;v!==this.root&&_&&b.layoutScroll&&(_.wasRoot&&es(m,u),$o(m.x,_.offset.x),$o(m.y,_.offset.y))}return m}applyTransform(u,p=!1){const m=Ht();es(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&&zo(m,{x:-v.scroll.offset.x,y:-v.scroll.offset.y}),Di(v.latestValues)&&zo(m,v.latestValues)}return Di(this.latestValues)&&zo(m,this.latestValues),m}removeTransform(u){const p=Ht();es(p,u);for(let m=0;m<this.path.length;m++){const g=this.path[m];if(!g.instance||!Di(g.latestValues))continue;hm(g.latestValues)&&g.updateSnapshot();const v=Ht(),_=g.measurePageBox();es(v,_),Ob(p,g.latestValues,g.snapshot?g.snapshot.layoutBox:void 0,v)}return Di(this.latestValues)&&Ob(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!==mn.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:_,layoutId:b}=this.options;if(!(!this.layout||!(_||b))){if(this.resolvedRelativeTargetAt=mn.timestamp,!this.targetDelta&&!this.relativeTarget){const x=this.getClosestProjectingParent();x&&x.layout&&this.animationProgress!==1?(this.relativeParent=x,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ht(),this.relativeTargetOrigin=Ht(),sl(this.relativeTargetOrigin,this.layout.layoutBox,x.layout.layoutBox),es(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Ht(),this.targetWithTransforms=Ht()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),kR(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):es(this.target,this.layout.layoutBox),T1(this.target,this.targetDelta)):es(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const x=this.getClosestProjectingParent();x&&!!x.resumingFrom==!!this.resumingFrom&&!x.options.layoutScroll&&x.target&&this.animationProgress!==1?(this.relativeParent=x,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ht(),this.relativeTargetOrigin=Ht(),sl(this.relativeTargetOrigin,this.target,x.target),es(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Jr&&Mi.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||hm(this.parent.latestValues)||w1(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===mn.timestamp&&(g=!1),g)return;const{layout:v,layoutId:_}=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||_))return;es(this.layoutCorrected,this.layout.layoutBox);const b=this.treeScale.x,x=this.treeScale.y;DR(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=Ht());const{target:k}=p;if(!k){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Mb(this.prevProjectionDelta.x,this.projectionDelta.x),Mb(this.prevProjectionDelta.y,this.projectionDelta.y)),nl(this.projectionDelta,this.layoutCorrected,k,this.latestValues),(this.treeScale.x!==b||this.treeScale.y!==x||!Hb(this.projectionDelta.x,this.prevProjectionDelta.x)||!Hb(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",k)),Jr&&Mi.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=Bo(),this.projectionDelta=Bo(),this.projectionDeltaWithTransform=Bo()}setAnimationOrigin(u,p=!1){const m=this.snapshot,g=m?m.latestValues:{},v={...this.latestValues},_=Bo();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const b=Ht(),x=m?m.source:void 0,k=this.layout?this.layout.source:void 0,j=x!==k,w=this.getStack(),T=!w||w.members.length<=1,C=!!(j&&!T&&this.options.crossfade===!0&&!this.path.some(g3));this.animationProgress=0;let D;this.mixTargetDelta=O=>{const E=O/1e3;qb(_.x,u.x,E),qb(_.y,u.y,E),this.setTargetDelta(_),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(sl(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox),h3(this.relativeTarget,this.relativeTargetOrigin,b,E),D&&QR(this.relativeTarget,D)&&(this.isProjectionDirty=!1),D||(D=Ht()),es(D,this.relativeTarget)),j&&(this.animationValues=v,KR(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&&(Qa(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=jt.update(()=>{od.hasAnimatedSinceResize=!0,this.currentAnimation=PR(0,Pb,{...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(Pb),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&&L1(this.options.animationType,this.layout.layoutBox,g.layoutBox)){m=this.target||Ht();const _=Un(this.layout.layoutBox.x);m.x.min=u.target.x.min,m.x.max=m.x.min+_;const b=Un(this.layout.layoutBox.y);m.y.min=u.target.y.min,m.y.max=m.y.min+b}es(p,m),zo(p,v),nl(this.projectionDeltaWithTransform,this.layoutCorrected,p,v)}}registerSharedNode(u,p){this.sharedNodes.has(u)||this.sharedNodes.set(u,new e3),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&&Ip("z",u,g,this.animationValues);for(let v=0;v<Rp.length;v++)Ip(`rotate${Rp[v]}`,u,g,this.animationValues),Ip(`skew${Rp[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 n3;const g={visibility:""},v=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,g.opacity="",g.pointerEvents=ad(u==null?void 0:u.pointerEvents)||"",g.transform=v?v(this.latestValues,""):"none",g;const _=this.getLead();if(!this.projectionDelta||!this.layout||!_.target){const j={};return this.options.layoutId&&(j.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,j.pointerEvents=ad(u==null?void 0:u.pointerEvents)||""),this.hasProjected&&!Di(this.latestValues)&&(j.transform=v?v({},""):"none",this.hasProjected=!1),j}const b=_.animationValues||_.latestValues;this.applyTransformsToTarget(),g.transform=t3(this.projectionDeltaWithTransform,this.treeScale,b),v&&(g.transform=v(b,g.transform));const{x,y:k}=this.projectionDelta;g.transformOrigin=`${x.origin*100}% ${k.origin*100}% 0`,_.animationValues?g.opacity=_===this?(m=(p=b.opacity)!==null&&p!==void 0?p:this.latestValues.opacity)!==null&&m!==void 0?m:1:this.preserveOpacity?this.latestValues.opacity:b.opacityExit:g.opacity=_===this?b.opacity!==void 0?b.opacity:"":b.opacityExit!==void 0?b.opacityExit:0;for(const j in md){if(b[j]===void 0)continue;const{correct:w,applyTo:T}=md[j],C=g.transform==="none"?b[j]:w(b[j],_);if(T){const D=T.length;for(let O=0;O<D;O++)g[T[O]]=C}else g[j]=C}return this.options.layoutId&&(g.pointerEvents=_===this?ad(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(Ub),this.root.sharedNodes.clear()}}}function a3(t){t.updateLayout()}function i3(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"?as(_=>{const b=u?o.measuredBox[_]:o.layoutBox[_],x=Un(b);b.min=r[_].min,b.max=b.min+x}):L1(d,o.layoutBox,r)&&as(_=>{const b=u?o.measuredBox[_]:o.layoutBox[_],x=Un(r[_]);b.max=b.min+x,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[_].max=t.relativeTarget[_].min+x)});const p=Bo();nl(p,r,o.layoutBox);const m=Bo();u?nl(m,t.applyTransform(c,!0),o.measuredBox):nl(m,r,o.layoutBox);const g=!M1(p);let v=!1;if(!t.resumeFrom){const _=t.getClosestProjectingParent();if(_&&!_.resumeFrom){const{snapshot:b,layout:x}=_;if(b&&x){const k=Ht();sl(k,o.layoutBox,b.layoutBox);const j=Ht();sl(j,r,x.layoutBox),R1(k,j)||(v=!0),_.options.layoutRoot&&(t.relativeTarget=j,t.relativeTargetOrigin=k,t.relativeParent=_)}}}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 o3(t){Jr&&Mi.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 r3(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function l3(t){t.clearSnapshot()}function Ub(t){t.clearMeasurements()}function c3(t){t.isLayoutDirty=!1}function d3(t){const{visualElement:s}=t.options;s&&s.getProps().onBeforeLayoutMeasure&&s.notify("BeforeLayoutMeasure"),t.resetTransform()}function Vb(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function u3(t){t.resolveTargetDelta()}function f3(t){t.calcProjection()}function p3(t){t.resetSkewAndRotation()}function m3(t){t.removeLeadSnapshot()}function qb(t,s,o){t.translate=Et(s.translate,0,o),t.scale=Et(s.scale,1,o),t.origin=s.origin,t.originPoint=s.originPoint}function Gb(t,s,o,r){t.min=Et(s.min,o.min,r),t.max=Et(s.max,o.max,r)}function h3(t,s,o,r){Gb(t.x,s.x,o.x,r),Gb(t.y,s.y,o.y,r)}function g3(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const v3={duration:.45,ease:[.4,0,.1,1]},Fb=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Kb=Fb("applewebkit/")&&!Fb("chrome/")?Math.round:Hn;function Zb(t){t.min=Kb(t.min),t.max=Kb(t.max)}function y3(t){Zb(t.x),Zb(t.y)}function L1(t,s,o){return t==="position"||t==="preserve-aspect"&&!xR(zb(s),zb(o),.2)}function b3(t){var s;return t!==t.root&&((s=t.scroll)===null||s===void 0?void 0:s.wasRoot)}const _3=O1({attachResizeListener:(t,s)=>fl(t,"resize",s),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Op={current:void 0},B1=O1({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Op.current){const t=new _3({});t.mount(window),t.setOptions({layoutScroll:!0}),Op.current=t}return Op.current},resetTransform:(t,s)=>{t.style.transform=s!==void 0?s:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),x3={pan:{Feature:BR},drag:{Feature:LR,ProjectionNode:B1,MeasureLayout:E1}};function k3(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 $1(t,s){const o=k3(t),r=new AbortController,c={passive:!0,...s,signal:r.signal};return[o,c,()=>r.abort()]}function Yb(t){return s=>{s.pointerType==="touch"||b1()||t(s)}}function S3(t,s,o={}){const[r,c,d]=$1(t,o),u=Yb(p=>{const{target:m}=p,g=s(p);if(typeof g!="function"||!m)return;const v=Yb(_=>{g(_),m.removeEventListener("pointerleave",v)});m.addEventListener("pointerleave",v,c)});return r.forEach(p=>{p.addEventListener("pointerenter",u,c)}),d}function Jb(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&&jt.postRender(()=>d(s,_l(s)))}class j3 extends ni{mount(){const{current:s}=this.node;s&&(this.unmount=S3(s,o=>(Jb(this.node,o,"Start"),r=>Jb(this.node,r,"End"))))}unmount(){}}class w3 extends ni{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=bl(fl(this.node.current,"focus",()=>this.onFocus()),fl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const z1=(t,s)=>s?t===s?!0:z1(t,s.parentElement):!1,T3=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function N3(t){return T3.has(t.tagName)||t.tabIndex!==-1}const Wr=new WeakSet;function Wb(t){return s=>{s.key==="Enter"&&t(s)}}function Lp(t,s){t.dispatchEvent(new PointerEvent("pointer"+s,{isPrimary:!0,bubbles:!0}))}const C3=(t,s)=>{const o=t.currentTarget;if(!o)return;const r=Wb(()=>{if(Wr.has(o))return;Lp(o,"down");const c=Wb(()=>{Lp(o,"up")}),d=()=>Lp(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 Xb(t){return gh(t)&&!b1()}function E3(t,s,o={}){const[r,c,d]=$1(t,o),u=p=>{const m=p.currentTarget;if(!Xb(p)||Wr.has(m))return;Wr.add(m);const g=s(p),v=(x,k)=>{window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",b),!(!Xb(x)||!Wr.has(m))&&(Wr.delete(m),typeof g=="function"&&g(x,{success:k}))},_=x=>{v(x,o.useGlobalTarget||z1(m,x.target))},b=x=>{v(x,!1)};window.addEventListener("pointerup",_,c),window.addEventListener("pointercancel",b,c)};return r.forEach(p=>{!N3(p)&&p.getAttribute("tabindex")===null&&(p.tabIndex=0),(o.useGlobalTarget?window:p).addEventListener("pointerdown",u,c),p.addEventListener("focus",g=>C3(g,c),c)}),d}function Qb(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&&jt.postRender(()=>d(s,_l(s)))}class A3 extends ni{mount(){const{current:s}=this.node;s&&(this.unmount=E3(s,o=>(Qb(this.node,o,"Start"),(r,{success:c})=>Qb(this.node,r,c?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const vm=new WeakMap,Bp=new WeakMap,D3=t=>{const s=vm.get(t.target);s&&s(t)},M3=t=>{t.forEach(D3)};function R3({root:t,...s}){const o=t||document;Bp.has(o)||Bp.set(o,{});const r=Bp.get(o),c=JSON.stringify(s);return r[c]||(r[c]=new IntersectionObserver(M3,{root:t,...s})),r[c]}function I3(t,s,o){const r=R3(s);return vm.set(t,o),r.observe(t),()=>{vm.delete(t),r.unobserve(t)}}const O3={some:0,all:1};class L3 extends ni{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:O3[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:_}=this.node.getProps(),b=g?v:_;b&&b(m)};return I3(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(B3(s,o))&&this.startObserver()}unmount(){}}function B3({viewport:t={}},{viewport:s={}}={}){return o=>t[o]!==s[o]}const $3={inView:{Feature:L3},tap:{Feature:A3},focus:{Feature:w3},hover:{Feature:j3}},z3={layout:{ProjectionNode:B1,MeasureLayout:E1}},_d={current:null},vh={current:!1};function H1(){if(vh.current=!0,!!Hm)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),s=()=>_d.current=t.matches;t.addListener(s),s()}else _d.current=!1}const H3=[...r1,vn,ei],P3=t=>H3.find(o1(t)),e_=new WeakMap;function U3(t,s,o){for(const r in s){const c=s[r],d=o[r];if(yn(c))t.addValue(r,c);else if(yn(d))t.addValue(r,dl(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,dl(u!==void 0?u:c,{owner:t}))}}for(const r in o)s[r]===void 0&&t.removeValue(r);return s}const t_=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class V3{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=fh,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 x=Os.now();this.renderScheduledAt<x&&(this.renderScheduledAt=x,jt.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=Pd(o),this.isVariantNode=bx(o),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(s&&s.current);const{willChange:_,...b}=this.scrapeMotionValuesFromProps(o,{},this);for(const x in b){const k=b[x];m[x]!==void 0&&yn(k)&&k.set(m[x],!1)}}mount(s){this.current=s,e_.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)),vh.current||H1(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:_d.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){e_.delete(this.current),this.projection&&this.projection.unmount(),Qa(this.notifyUpdate),Qa(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=Pi.has(s),c=o.on("change",p=>{this.latestValues[s]=p,this.props.onUpdate&&jt.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 Uo){const o=Uo[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):Ht()}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<t_.length;r++){const c=t_[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=U3(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=dl(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"&&(a1(c)||Yx(c))?c=parseFloat(c):!P3(c)&&ei.test(o)&&(c=t1(s,o)),this.setBaseTarget(s,yn(c)?c.get():c)),yn(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=Fm(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&&!yn(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 sh),this.events[s].add(o)}notify(s,...o){this.events[s]&&this.events[s].notify(...o)}}class P1 extends V3{constructor(){super(...arguments),this.KeyframeResolver=l1}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;yn(s)&&(this.childSubscription=s.on("change",o=>{this.current&&(this.current.textContent=`${o}`)}))}}function q3(t){return window.getComputedStyle(t)}class G3 extends P1{constructor(){super(...arguments),this.type="html",this.renderInstance=Cx}readValueFromInstance(s,o){if(Pi.has(o)){const r=uh(o);return r&&r.default||0}else{const r=q3(s),c=(wx(o)?r.getPropertyValue(o):r[o])||0;return typeof c=="string"?c.trim():c}}measureInstanceViewportBox(s,{transformPagePoint:o}){return N1(s,o)}build(s,o,r){Ym(s,o,r.transformTemplate)}scrapeMotionValuesFromProps(s,o,r){return Qm(s,o,r)}}class F3 extends P1{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ht}getBaseTargetFromProps(s,o){return s[o]}readValueFromInstance(s,o){if(Pi.has(o)){const r=uh(o);return r&&r.default||0}return o=Ex.has(o)?o:Vm(o),s.getAttribute(o)}scrapeMotionValuesFromProps(s,o,r){return Mx(s,o,r)}build(s,o,r){Jm(s,o,this.isSVGTag,r.transformTemplate)}renderInstance(s,o,r,c){Ax(s,o,r,c)}mount(s){this.isSVGTag=Xm(s.tagName),super.mount(s)}}const K3=(t,s)=>Gm(t)?new F3(s):new G3(s,{allowProjection:t!==y.Fragment}),Z3=_M({...uR,...$3,...x3,...z3},K3),Ct=OD(Z3);function Y3(){!vh.current&&H1();const[t]=y.useState(_d.current);return t}const J3="_overlay_cmicx_1",W3="_dialog_cmicx_11",X3="_title_cmicx_30",Q3="_description_cmicx_38",e6="_actions_cmicx_45",t6="_cancelButton_cmicx_52",n6="_confirmButton_cmicx_79",Ei={overlay:J3,dialog:W3,title:X3,description:Q3,actions:e6,cancelButton:t6,confirmButton:n6};function xs({isOpen:t,title:s,description:o,confirmLabel:r="Delete",onConfirm:c,onCancel:d}){const u=y.useId(),p=y.useId();return a.jsx(is,{children:t&&a.jsx(Ct.div,{className:Ei.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:a.jsxs(Ct.div,{className:Ei.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:[a.jsx("h3",{id:u,className:Ei.title,children:s}),o&&a.jsx("p",{id:p,className:Ei.description,children:o}),a.jsxs("div",{className:Ei.actions,children:[a.jsx("button",{type:"button",className:Ei.cancelButton,onClick:d,autoFocus:!0,children:"Cancel"}),a.jsx("button",{type:"button",className:Ei.confirmButton,onClick:c,children:r})]})]})})})}const s6="_skeleton_1gqp4_9",a6="_circular_1gqp4_17",i6="_textContainer_1gqp4_26",o6="_card_1gqp4_31",xd={skeleton:s6,circular:a6,textContainer:i6,card:o6};function we({width:t="100%",height:s="1rem",borderRadius:o,variant:r="rectangular",className:c}){const d=[xd.skeleton,r==="circular"?xd.circular:"",c??""].filter(Boolean).join(" ");return a.jsx("div",{className:d,style:{width:t,height:s,...o&&r!=="circular"?{borderRadius:o}:{}},"aria-hidden":"true","data-testid":"skeleton"})}function ym({lines:t=3,lastLineWidth:s="60%",lineHeight:o="0.75rem",gap:r="var(--space-sm)",className:c}){return a.jsx("div",{className:`${xd.textContainer} ${c??""}`,style:{gap:r},"aria-hidden":"true","data-testid":"skeleton-text",children:Array.from({length:t},(d,u)=>a.jsx(we,{width:u===t-1&&t>1?s:"100%",height:o},u))})}function kd({lines:t=2,className:s}){return a.jsxs("div",{className:`${xd.card} ${s??""}`,"aria-hidden":"true","data-testid":"skeleton-card",children:[a.jsx(we,{width:"40%",height:"1.25rem"}),a.jsx(ym,{lines:t})]})}const r6="_spinner_1uyt1_1",l6="_spin_1uyt1_1",c6="_sm_1uyt1_14",d6="_md_1uyt1_20",u6="_lg_1uyt1_26",f6="_xl_1uyt1_32",n_={spinner:r6,spin:l6,sm:c6,md:d6,lg:u6,xl:f6};function U1({size:t="md",className:s,label:o="Loading",liveRegion:r=!1}){return a.jsx("span",{className:`${n_.spinner} ${n_[t]} ${s??""}`,role:r?"status":void 0,"aria-label":o,"aria-hidden":r?void 0:!0})}function qd(t){return`/${t.replace(/^\//,"")}`}const p6="_splash_1bn1g_1",m6="_logo_1bn1g_11",s_={splash:p6,logo:m6};function V1(){return a.jsxs("div",{className:s_.splash,"data-testid":"splash-screen",children:[a.jsx("img",{src:qd("grackle-logo.png"),alt:"Grackle",className:s_.logo}),a.jsx(U1,{size:"xl",label:"Loading Grackle",liveRegion:!0})]})}const h6="_wrapper_4e5yt_1",g6="_wrapperBlock_4e5yt_6",v6="_tooltip_4e5yt_11",y6="_visible_4e5yt_31",b6="_top_4e5yt_41",_6="_bottom_4e5yt_48",x6="_left_4e5yt_55",k6="_right_4e5yt_62",qr={wrapper:h6,wrapperBlock:g6,tooltip:v6,visible:y6,top:b6,bottom:_6,left:x6,right:k6},S6=300,Kc=6;function Bi({text:t,placement:s="top",delayMs:o=S6,inline:r=!0,children:c,className:d,"data-testid":u}){const[p,m]=y.useState(!1),[g,v]=y.useState({top:0,left:0}),_=y.useRef(null),b=y.useRef(null),x=y.useRef(void 0),k=y.useId(),j=typeof document<"u",w=y.useCallback(()=>{if(!_.current||!b.current)return;const P=_.current.getBoundingClientRect(),Y=b.current.getBoundingClientRect();let q=0,ee=0;switch(s){case"top":q=P.top-Y.height-Kc,ee=P.left+P.width/2-Y.width/2;break;case"bottom":q=P.bottom+Kc,ee=P.left+P.width/2-Y.width/2;break;case"left":q=P.top+P.height/2-Y.height/2,ee=P.left-Y.width-Kc;break;case"right":q=P.top+P.height/2-Y.height/2,ee=P.right+Kc;break}v({top:q,left:ee})},[s]),T=y.useCallback(P=>{x.current!==void 0&&clearTimeout(x.current),x.current=setTimeout(()=>{w(),m(!0),x.current=void 0},P)},[w]),C=y.useCallback(()=>{T(o)},[o,T]),D=y.useCallback(()=>{T(0)},[T]),O=y.useCallback(()=>{x.current!==void 0&&(clearTimeout(x.current),x.current=void 0),m(!1)},[]);y.useEffect(()=>{if(!p)return;const P=Y=>{Y.key==="Escape"&&O()};return document.addEventListener("keydown",P),window.addEventListener("scroll",w,!0),window.addEventListener("resize",w),()=>{document.removeEventListener("keydown",P),window.removeEventListener("scroll",w,!0),window.removeEventListener("resize",w)}},[p,O,w]),y.useEffect(()=>()=>{x.current!==void 0&&clearTimeout(x.current)},[]);const E=r?"span":"div",M=[r?qr.wrapper:qr.wrapperBlock,d].filter(Boolean).join(" ");let L=c;if(y.isValidElement(c)){const P=c,Y=P.props["aria-describedby"],q=p?Y?`${Y} ${k}`:k:Y;L=y.cloneElement(P,{"aria-describedby":q})}const A=a.jsx("div",{ref:b,id:k,role:"tooltip",className:`${qr.tooltip} ${qr[s]} ${p?qr.visible:""}`,style:{top:g.top,left:g.left},"data-testid":u??"tooltip",children:t});return a.jsxs(E,{ref:_,className:M,onMouseEnter:C,onMouseLeave:O,onFocus:D,onBlur:O,children:[L,j?H2.createPortal(A,document.body):null]})}const j6="_attemptSelector_ggigl_1",w6="_attemptLabel_ggigl_17",T6="_attemptButton_ggigl_21",N6="_attemptActive_ggigl_38",C6="_attemptStatus_ggigl_44",Gr={attemptSelector:j6,attemptLabel:w6,attemptButton:T6,attemptActive:N6,attemptStatus:C6};function E6({taskSessions:t,selectedSessionId:s,onSelect:o}){if(!(t.length<2))return a.jsxs("div",{className:Gr.attemptSelector,"data-testid":"attempt-selector",children:[a.jsx("span",{className:Gr.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 a.jsxs("button",{className:`${Gr.attemptButton} ${d?Gr.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&&a.jsx("span",{className:Gr.attemptStatus,children:u})]},r.id)})]})}const A6="_row_ldkru_1",D6="_hoverActions_ldkru_5",M6="_hoverButton_ldkru_31",R6="_selectingRow_ldkru_72",I6="_selected_ldkru_83",O6="_checkboxArea_ldkru_90",L6="_checkbox_ldkru_90",B6="_contentArea_ldkru_106",gs={row:A6,hoverActions:D6,hoverButton:M6,selectingRow:R6,selected:I6,checkboxArea:O6,checkbox:L6,contentArea:B6};function $6({copyText:t,isContentBearing:s,isSelecting:o,isSelected:r,checkboxLabel:c,onSelect:d,onToggle:u,onCopied:p,children:m}){const[g,v]=y.useState(!1),_=y.useRef(void 0);y.useEffect(()=>()=>{_.current!==void 0&&clearTimeout(_.current)},[]);const b=y.useCallback(async()=>{try{await navigator.clipboard.writeText(t),v(!0),p==null||p(),_.current!==void 0&&clearTimeout(_.current),_.current=setTimeout(()=>{v(!1)},2e3)}catch{}},[t,p]),x=y.useCallback(k=>{!o||k.target.closest("a, button, input, textarea, select, [role=button]")||(k.preventDefault(),u(k.shiftKey))},[o,u]);return s?o?a.jsxs("div",{className:`${gs.row} ${gs.selectingRow} ${r?gs.selected:""}`,onClick:x,"data-testid":"event-selectable-row",children:[a.jsx("div",{className:gs.checkboxArea,children:a.jsx("input",{type:"checkbox",checked:r,onChange:k=>{u(k.nativeEvent.shiftKey)},onClick:k=>{k.stopPropagation()},className:gs.checkbox,"aria-label":c??"Select this event","data-testid":"event-select-checkbox"})}),a.jsx("div",{className:gs.contentArea,children:m})]}):a.jsxs("div",{className:gs.row,"data-testid":"event-hover-row",children:[a.jsxs("div",{className:gs.hoverActions,"data-testid":"event-hover-actions",children:[a.jsx("button",{type:"button",className:gs.hoverButton,onClick:()=>{b().catch(()=>{})},"aria-label":"Copy event content","data-testid":"event-hover-copy",children:g?a.jsx($i,{size:We,"aria-hidden":"true"}):a.jsx(H_,{size:We,"aria-hidden":"true"})}),a.jsx("button",{type:"button",className:gs.hoverButton,onClick:d,"aria-label":"Select this event","data-testid":"event-hover-select",children:a.jsx(Fw,{size:We,"aria-hidden":"true"})})]}),m]}):a.jsx("div",{className:gs.row,children:m})}const z6="_bar_lagql_1",H6="_left_lagql_21",P6="_right_lagql_27",U6="_count_lagql_33",V6="_toggleButton_lagql_40",q6="_copyButton_lagql_68",G6="_forwardButton_lagql_108",F6="_cancelButton_lagql_148",Va={bar:z6,left:H6,right:P6,count:U6,toggleButton:V6,copyButton:q6,forwardButton:G6,cancelButton:F6};function K6({selectedCount:t,totalSelectable:s,onSelectAll:o,onDeselectAll:r,onCopy:c,onForward:d,forwardDisabled:u=!1,onCancel:p}){const m=t>0&&t>=s;return a.jsxs(Ct.div,{className:Va.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:[a.jsxs("div",{className:Va.left,children:[a.jsxs("span",{className:Va.count,"data-testid":"floating-bar-count",children:[t," selected"]}),a.jsx("button",{type:"button",className:Va.toggleButton,onClick:m?r:o,"data-testid":"floating-bar-select-all",children:m?"Deselect all":"Select all"})]}),a.jsxs("div",{className:Va.right,children:[a.jsxs("button",{type:"button",className:Va.copyButton,onClick:c,disabled:t===0,"data-testid":"floating-bar-copy",children:[a.jsx(Zj,{size:We,"aria-hidden":"true"}),"Copy"]}),d!==void 0&&a.jsx(Bi,{text:u?"No active sessions to forward to":"Forward to another session",children:a.jsxs("button",{type:"button",className:Va.forwardButton,"aria-disabled":u||t===0,onClick:()=>{!u&&t>0&&d()},"data-testid":"floating-bar-forward",children:[a.jsx(nw,{size:We,"aria-hidden":"true"}),"Forward"]})}),a.jsx("button",{type:"button",className:Va.cancelButton,onClick:p,"aria-label":"Cancel selection","data-testid":"floating-bar-cancel",children:a.jsx(Ls,{size:We,"aria-hidden":"true"})})]})]})}const Z6="_overlay_1hra6_1",Y6="_dialog_1hra6_11",J6="_header_1hra6_27",W6="_title_1hra6_35",X6="_closeButton_1hra6_42",Q6="_filterRow_1hra6_78",eI="_searchIcon_1hra6_86",tI="_filterInput_1hra6_91",nI="_list_1hra6_108",sI="_emptyItem_1hra6_116",aI="_sessionRow_1hra6_123",iI="_sessionMain_1hra6_158",oI="_envName_1hra6_165",rI="_personaName_1hra6_175",lI="_statusBadge_1hra6_189",cI="_status_running_1hra6_198",dI="_status_idle_1hra6_202",uI="_status_other_1hra6_206",fI="_sessionPrompt_1hra6_211",pI="_noSessions_1hra6_220",tn={overlay:Z6,dialog:Y6,header:J6,title:W6,closeButton:X6,filterRow:Q6,searchIcon:eI,filterInput:tI,list:nI,emptyItem:sI,sessionRow:aI,sessionMain:iI,envName:oI,personaName:rI,statusBadge:lI,status_running:cI,status_idle:dI,status_other:uI,sessionPrompt:fI,noSessions:pI};function mI(t){return t==="running"?"running":t==="idle"?"idle":t}function hI({isOpen:t,sessions:s,environments:o,personas:r,onSelect:c,onCancel:d}){const[u,p]=y.useState(""),m=y.useRef(null),g=y.useRef(null);y.useEffect(()=>{var j;t&&s.length<=4&&((j=g.current)==null||j.focus())},[t,s.length]);const v=new Map(o.map(j=>[j.id,j.displayName])),_=new Map((r??[]).map(j=>[j.id,j.name])),b=s.map(j=>({session:j,environmentName:v.get(j.environmentId)??j.environmentId})),x=s.length>4,k=u.trim()?b.filter(({session:j,environmentName:w})=>w.toLowerCase().includes(u.toLowerCase())||j.prompt.toLowerCase().includes(u.toLowerCase())):b;return a.jsx(is,{children:t&&a.jsx(Ct.div,{className:tn.overlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},onClick:d,onKeyDown:j=>{j.key==="Escape"&&d()},role:"dialog","aria-modal":"true","aria-label":"Forward to session","data-testid":"session-picker-overlay",children:a.jsxs(Ct.div,{ref:m,className:tn.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:j=>{j.stopPropagation()},"data-testid":"session-picker-dialog",children:[a.jsxs("div",{className:tn.header,children:[a.jsx("h3",{className:tn.title,children:"Forward to session"}),a.jsx("button",{ref:g,type:"button",className:tn.closeButton,onClick:d,"aria-label":"Close session picker","data-testid":"session-picker-close",children:a.jsx(Ls,{size:We,"aria-hidden":"true"})})]}),x&&a.jsxs("div",{className:tn.filterRow,children:[a.jsx(ud,{size:We,className:tn.searchIcon,"aria-hidden":"true"}),a.jsx("input",{type:"text",className:tn.filterInput,placeholder:"Filter sessions...",value:u,onChange:j=>{p(j.target.value)},"data-testid":"session-picker-filter",autoFocus:!0})]}),s.length===0?a.jsxs("div",{className:tn.noSessions,"data-testid":"session-picker-no-sessions",children:[a.jsx(ud,{size:Vt,"aria-hidden":"true"}),a.jsx("p",{children:"No active sessions to forward to."})]}):a.jsx("ul",{className:tn.list,"data-testid":"session-picker-list",children:k.length===0?a.jsx("li",{className:tn.emptyItem,"data-testid":"session-picker-empty",children:"No matching sessions"}):k.map(({session:j,environmentName:w})=>{const T=j.personaId?_.get(j.personaId)??void 0:void 0;return a.jsx("li",{children:a.jsxs("button",{type:"button",className:tn.sessionRow,onClick:()=>{c(j.id)},"data-testid":`session-picker-item-${j.id}`,children:[a.jsxs("div",{className:tn.sessionMain,children:[a.jsx("span",{className:tn.envName,children:w}),T!==void 0&&a.jsx("span",{className:tn.personaName,"data-testid":`session-picker-persona-${j.id}`,children:T}),a.jsx("span",{className:`${tn.statusBadge} ${tn[`status_${j.status}`]??tn.status_other}`,"data-testid":`session-picker-status-${j.id}`,children:mI(j.status)})]}),a.jsx("div",{className:tn.sessionPrompt,children:j.prompt.length>80?`${j.prompt.slice(0,80)}...`:j.prompt})]})},j.id)})})]})})})}const q1=50;function gI(t,s,o,r,c=q1){return r?t<c:s-t-o<c}function vI(t,s){const o=s-t;return o>0?o:0}function yI({scrollRef:t,contentLength:s,isReversed:o,paused:r}){const[c,d]=y.useState(!0),u=y.useRef(0),p=y.useRef(!1),m=y.useRef(0);y.useEffect(()=>{const v=t.current;if(!v)return;let _=!0;const b=()=>{m.current||(m.current=requestAnimationFrame(()=>{m.current=0;const x=gI(v.scrollTop,v.scrollHeight,v.clientHeight,o,q1);x!==_&&(_=x,d(x))}))};return v.addEventListener("scroll",b,{passive:!0}),()=>{v.removeEventListener("scroll",b),m.current&&(cancelAnimationFrame(m.current),m.current=0)}},[t,o]),y.useLayoutEffect(()=>{const v=t.current;!v||p.current||(p.current=!0,o?v.scrollTop=0:v.scrollTop=v.scrollHeight,d(!0))},[t,o]),y.useLayoutEffect(()=>{const v=t.current;if(v){if(r){u.current=v.scrollHeight;return}if(o&&!c){const _=vI(u.current,v.scrollHeight);_>0&&(v.scrollTop+=_)}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=y.useCallback(()=>{const v=t.current;if(!v)return;const _=o?0:v.scrollHeight;v.scrollTo({top:_,behavior:"smooth"}),d(!0)},[t,o]);return{isAtAnchor:c,scrollToAnchor:g}}const bI=new Set(["text","output","user_input","tool_use","tool_result","error"]);function pl(t){return bI.has(t.eventType)}function _I(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}
|
|
314
|
+
${c}`}catch{return t.content}default:return t.content}}function a_(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 G1(t){var o;const s=[];for(const r of t){if(!pl(r))continue;const c=new Date(r.timestamp).toLocaleTimeString();switch(r.eventType){case"text":case"output":{s.push(`**Assistant** (${c}):
|
|
315
|
+
${r.content}`);break}case"user_input":{s.push(`**User** (${c}):
|
|
316
|
+
${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=a_(r.toolUseCtx.args),p=u?`**Tool: ${r.toolUseCtx.tool}** ${u}`:`**Tool: ${r.toolUseCtx.tool}**`;s.push(`${p} (${c}):
|
|
317
|
+
${d}`)}else s.push(`**Tool output** (${c}):
|
|
318
|
+
${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=a_(u),m=p?`**Tool: ${d}** ${p}`:`**Tool: ${d}**`;u!==void 0?s.push(`${m} (${c}):
|
|
319
|
+
\`\`\`json
|
|
320
|
+
${JSON.stringify(u,void 0,2)}
|
|
321
|
+
\`\`\``):s.push(`${m} (${c}):`);break}case"error":{s.push(`**Error** (${c}):
|
|
322
|
+
${r.content}`);break}}}return s.join(`
|
|
323
|
+
|
|
324
|
+
`)}function xI(t,s){const o=kI(t),r=G1(s);return`--- Forwarded from ${o} ---
|
|
325
|
+
|
|
326
|
+
${r}
|
|
327
|
+
|
|
328
|
+
--- End forwarded ---`}function kI(t){return t.replace(/[\r\n]+/g," ").trim().replace(/---/g,"—")}function SI({events:t,formatForClipboard:s}){const[o,r]=y.useState(!1),[c,d]=y.useState(new Set),u=y.useRef(void 0),p=y.useMemo(()=>c.size,[c]),m=y.useCallback(k=>{r(!0),k!==void 0?(d(new Set([k])),u.current=k):(d(new Set),u.current=void 0)},[]),g=y.useCallback(()=>{r(!1),d(new Set),u.current=void 0},[]),v=y.useCallback((k,j)=>{if(j&&u.current!==void 0){const w=Math.min(u.current,k),T=Math.max(u.current,k);d(C=>{const D=new Set(C);for(let O=w;O<=T;O++)O<t.length&&pl(t[O])&&D.add(O);return D})}else d(w=>{const T=new Set(w);return T.has(k)?T.delete(k):T.add(k),T.size===0?(r(!1),u.current=void 0):u.current=k,T})},[t]),_=y.useCallback(()=>{const k=new Set;for(let j=0;j<t.length;j++)pl(t[j])&&k.add(j);d(k)},[t]),b=y.useCallback(()=>{d(new Set)},[]),x=y.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 w=s(j);try{return await navigator.clipboard.writeText(w),!0}catch{return!1}},[c,t,s]);return{isSelecting:o,selectedIndices:c,selectedCount:p,enterSelectionMode:m,cancelSelection:g,toggleEvent:v,selectAll:_,deselectAll:b,copySelected:x}}const jI="_wrapper_1cdza_1",wI="_scrollContainer_1cdza_9",TI="_selectingPadding_1cdza_16",NI="_toolbar_1cdza_20",CI="_directionToggle_1cdza_27",EI="_scrollToAnchor_1cdza_65",AI="_scrollToAnchorBottom_1cdza_89",DI="_scrollToAnchorTop_1cdza_93",MI="_eventOverflowWarning_1cdza_97",ra={wrapper:jI,scrollContainer:wI,selectingPadding:TI,toolbar:NI,directionToggle:CI,scrollToAnchor:EI,scrollToAnchorBottom:AI,scrollToAnchorTop:DI,eventOverflowWarning:MI},RI=10*1024,II=new Set(["running","idle"]);function OI(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 F1="grackle-stream-direction";function LI(){try{return localStorage.getItem(F1)==="reversed"}catch{return!1}}function BI({eventsDropped:t}){return t<=0?a.jsx(a.Fragment,{}):a.jsxs("div",{className:ra.eventOverflowWarning,role:"alert",children:[a.jsx(Nm,{size:Vt,"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 yh({events:t,eventsDropped:s,emptyState:o,onShowToast:r,sessions:c,currentSessionId:d,environments:u,personas:p,onForward:m,sandboxProxyUrl:g}){const v=y.useRef(null),[_,b]=y.useState(LI),x=Y3(),[k,j]=y.useState(!1),[w,T]=y.useState(!1),[C,D]=y.useState(void 0),O=SI({events:t,formatForClipboard:G1}),E=y.useMemo(()=>t.filter(pl).length,[t]),M=y.useMemo(()=>c?c.filter(ce=>II.has(ce.status)&&ce.id!==d):[],[c,d]),L=y.useMemo(()=>_?[...t].reverse():t,[t,_]),{isAtAnchor:A,scrollToAnchor:P}=yI({scrollRef:v,contentLength:t.length,isReversed:_,paused:O.isSelecting}),Y=()=>{const ce=!_;b(ce);try{localStorage.setItem(F1,ce?"reversed":"default")}catch{}};y.useEffect(()=>{if(!O.isSelecting)return;const ce=fe=>{fe.key==="Escape"&&!k&&!w&&O.cancelSelection()};return window.addEventListener("keydown",ce),()=>{window.removeEventListener("keydown",ce)}},[O.isSelecting,O.cancelSelection,k,w]);const q=y.useCallback(async()=>{await O.copySelected()&&(r==null||r(`Copied ${O.selectedCount} message${O.selectedCount===1?"":"s"} to clipboard`,"success"))},[O,r]),ee=y.useCallback(()=>[...O.selectedIndices].sort((fe,ge)=>fe-ge).filter(fe=>fe<t.length).map(fe=>t[fe]),[O.selectedIndices,t]),le=y.useCallback(ce=>{if(!ce)return"this session";const fe=c==null?void 0:c.find(Ae=>Ae.id===ce);if(!fe)return ce.slice(0,8);const ge=u==null?void 0:u.find(Ae=>Ae.id===fe.environmentId);return(ge==null?void 0:ge.displayName)??fe.environmentId.slice(0,8)},[c,u]),W=y.useCallback(async(ce,fe)=>{if(!m)return;const ge=le(ce);try{await m(ce,fe);const Ae=O.selectedCount;r==null||r(`Forwarded ${Ae} message${Ae===1?"":"s"} to ${ge}`,"success"),O.cancelSelection()}catch{r==null||r("Failed to forward messages","error")}},[m,le,r,O]),re=y.useCallback(ce=>{j(!1);const fe=ee(),ge=le(d),Ae=xI(ge,fe);if(new TextEncoder().encode(Ae).length>RI){D({sessionId:ce,text:Ae}),T(!0);return}W(ce,Ae).catch(()=>{})},[ee,le,d,W]),$=y.useCallback(()=>{T(!1),C&&(W(C.sessionId,C.text).catch(()=>{}),D(void 0))},[C,W]),B=y.useCallback(()=>{T(!1),D(void 0)},[]),se=x?0:.2,oe=_?-8:8,X=C?Math.round(new TextEncoder().encode(C.text).length/1024):0;return a.jsxs("div",{className:ra.wrapper,children:[a.jsx("div",{className:ra.toolbar,children:a.jsx(Bi,{text:_?"Showing newest first":"Showing oldest first",children:a.jsx("button",{className:ra.directionToggle,onClick:Y,"aria-label":_?"Switch to newest at bottom":"Switch to newest at top","data-testid":"direction-toggle",children:_?a.jsx(wy,{size:Vt,"aria-hidden":"true"}):a.jsx(Ty,{size:Vt,"aria-hidden":"true"})})})}),a.jsxs("div",{ref:v,className:`${ra.scrollContainer} ${O.isSelecting?ra.selectingPadding:""}`,"data-testid":"event-stream-scroll",children:[t.length===0&&o,a.jsx(BI,{eventsDropped:s}),a.jsx(is,{initial:!1,children:L.map((ce,fe)=>{const ge=_?t.length-1-fe:fe;return a.jsx(Ct.div,{initial:{opacity:0,y:oe},animate:{opacity:1,y:0},transition:{duration:se,ease:"easeOut"},children:a.jsx($6,{copyText:_I(ce),isContentBearing:pl(ce),isSelecting:O.isSelecting,isSelected:O.selectedIndices.has(ge),checkboxLabel:OI(ce),onSelect:()=>{O.enterSelectionMode(ge)},onToggle:Ae=>{O.toggleEvent(ge,Ae)},onCopied:()=>{r==null||r("Copied to clipboard","success")},children:a.jsx(SD,{event:ce,toolUseCtx:ce.toolUseCtx,settled:ce.settled,sandboxProxyUrl:g})})},`${ce.sessionId}-${ce.timestamp}-${ge}`)})})]}),a.jsx(is,{children:O.isSelecting&&a.jsx(K6,{selectedCount:O.selectedCount,totalSelectable:E,onSelectAll:O.selectAll,onDeselectAll:O.deselectAll,onCopy:()=>{q().catch(()=>{})},onForward:m!==void 0?()=>{j(!0)}:void 0,forwardDisabled:M.length===0,onCancel:O.cancelSelection})}),a.jsx(hI,{isOpen:k,sessions:M,environments:u??[],personas:p,onSelect:re,onCancel:()=>{j(!1)}}),a.jsx(xs,{isOpen:w,title:"Send large message?",description:`This will forward a large message (${X} KB). Continue?`,confirmLabel:"Send",onConfirm:$,onCancel:B}),a.jsx(is,{children:!A&&a.jsxs(Ct.button,{className:`${ra.scrollToAnchor} ${_?ra.scrollToAnchorTop:ra.scrollToAnchorBottom}`,onClick:P,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:[_?a.jsx(Ty,{size:Vt,"aria-hidden":"true"}):a.jsx(wy,{size:Vt,"aria-hidden":"true"})," New events"]})})]})}function bh(t){const{value:s,onSave:o,validate:r,fieldId:c,activeFieldId:d,onActivate:u,enterToSave:p=!0,trimOnSave:m=!0}=t,[g,v]=y.useState(""),[_,b]=y.useState(""),x=y.useRef(!1),k=d===c,j=y.useCallback(L=>{v(L),b("")},[]),w=y.useCallback(()=>{b("")},[]),T=y.useCallback(()=>{x.current=!1,u==null||u(null),v(""),b("")},[u]),C=y.useCallback(()=>{const L=m?g.trim():g;if(r){const P=r(g);if(P){b(P);return}}const A=m?s.trim():s;if(L===A){T();return}o(L),T()},[g,s,m,r,o,T]),D=y.useCallback(()=>{x.current=!0,u==null||u(c),v(s),b("")},[c,s,u]),O=y.useCallback(L=>{if(x.current){x.current=!1;return}L.relatedTarget instanceof HTMLElement&&L.relatedTarget.dataset.editAction===c||C()},[c,C]),E=y.useCallback(L=>{L.key==="Escape"?T():L.key==="Enter"&&p&&C()},[T,p,C]),M=(()=>{if(!k)return!1;const L=m?s.trim():s;return(m?g.trim():g)!==L})();return y.useEffect(()=>{!k&&(g!==""||_!=="")&&(v(""),b(""))},[k,g,_]),{isEditing:k,draft:g,error:_,isDirty:M,startEdit:D,cancelEdit:T,save:C,setDraft:j,clearError:w,handleBlur:O,handleKeyDown:E,ignoreInitialBlurRef:x}}const $I="_editFieldWrapper_yuzty_1",zI="_editInput_yuzty_10",HI="_editTextarea_yuzty_42",PI="_editSelect_yuzty_78",UI="_editError_yuzty_111",VI="_editInputInvalid_yuzty_118",qI="_editHint_yuzty_123",GI="_unsavedDot_yuzty_132",FI="_metaValueClickable_yuzty_140",KI="_editButton_yuzty_159",ZI="_metaPlaceholder_yuzty_175",YI="_worktreeToggle_yuzty_180",it={editFieldWrapper:$I,editInput:zI,editTextarea:HI,editSelect:PI,editError:UI,editInputInvalid:VI,editHint:qI,unsavedDot:GI,metaValueClickable:FI,editButton:KI,metaPlaceholder:ZI,worktreeToggle:YI};function Pt(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:_,ariaLabel:b,"data-testid":x}=t,k=y.useRef(null),j=bh({value:s,onSave:o,validate:r,fieldId:d,activeFieldId:u,onActivate:p,enterToSave:!0,trimOnSave:!0});if(y.useEffect(()=>{if(j.isEditing){const T=window.setTimeout(()=>{var C;(C=k.current)==null||C.focus()},0);return()=>window.clearTimeout(T)}},[j.isEditing]),c==="create"){const T=D=>{m==null||m(D.target.value)},C=r==null?void 0:r(s);return a.jsxs("div",{className:it.editFieldWrapper,children:[a.jsx("input",{className:`${it.editInput} ${C?it.editInputInvalid:""}`,value:s,onChange:T,maxLength:_,placeholder:v,"aria-label":b,"data-testid":x?`${x}-input`:void 0}),C&&a.jsx("span",{className:it.editError,"data-testid":"edit-error",children:C})]})}if(j.isEditing)return a.jsxs("div",{className:it.editFieldWrapper,children:[a.jsx("input",{ref:k,className:`${it.editInput} ${j.error?it.editInputInvalid:""}`,value:j.draft,onChange:T=>j.setDraft(T.target.value),onBlur:j.handleBlur,onKeyDown:j.handleKeyDown,maxLength:_,placeholder:v,"aria-label":b,"data-testid":x?`${x}-input`:void 0}),j.isDirty&&a.jsx("span",{className:it.unsavedDot,title:"Unsaved changes"}),j.error&&a.jsx("span",{className:it.editError,"data-testid":"edit-error",children:j.error}),a.jsx("span",{className:it.editHint,children:"Enter to save · Esc to cancel"})]});const w=g==null?void 0:g(s);return a.jsxs("span",{role:"button",tabIndex:0,className:it.metaValueClickable,onClick:()=>j.startEdit(),onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),j.startEdit())},title:"Click to edit","aria-label":b,"data-testid":x?`${x}-button`:void 0,children:[w!==void 0?w:s?a.jsx("span",{children:s}):a.jsx("span",{className:it.metaPlaceholder,children:v||"None"}),a.jsx("span",{className:it.editButton,"aria-hidden":"true",children:"✏️"})]})}function bm(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:_,"data-testid":b}=t,x=y.useRef(null),k=bh({value:s,onSave:o,validate:r,fieldId:d,activeFieldId:u,onActivate:p,enterToSave:!1,trimOnSave:!1});if(y.useEffect(()=>{if(k.isEditing){const w=window.setTimeout(()=>{var T;(T=x.current)==null||T.focus()},0);return()=>window.clearTimeout(w)}},[k.isEditing]),c==="create"){const w=C=>{m==null||m(C.target.value)},T=r==null?void 0:r(s);return a.jsxs("div",{className:it.editFieldWrapper,children:[a.jsx("textarea",{className:`${it.editTextarea} ${T?it.editInputInvalid:""}`,value:s,onChange:w,placeholder:v,"aria-label":_,"data-testid":b?`${b}-input`:void 0}),T&&a.jsx("span",{className:it.editError,"data-testid":"edit-error",children:T})]})}if(k.isEditing)return a.jsxs("div",{className:it.editFieldWrapper,children:[a.jsx("textarea",{ref:x,className:`${it.editTextarea} ${k.error?it.editInputInvalid:""}`,value:k.draft,onChange:w=>k.setDraft(w.target.value),onBlur:k.handleBlur,onKeyDown:k.handleKeyDown,title:_,"aria-label":_,"data-testid":b?`${b}-input`:void 0}),k.isDirty&&a.jsx("span",{className:it.unsavedDot,title:"Unsaved changes"}),k.error&&a.jsx("span",{className:it.editError,"data-testid":"edit-error",children:k.error}),a.jsx("span",{className:it.editHint,children:"Tab to save · Esc to cancel"})]});const j=g==null?void 0:g(s);return a.jsxs("span",{role:"button",tabIndex:0,className:it.metaValueClickable,onClick:()=>k.startEdit(),onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),k.startEdit())},title:"Click to edit","aria-label":_,"data-testid":b?`${b}-button`:void 0,children:[j!==void 0?j:s?a.jsx("span",{children:s}):a.jsx("span",{className:it.metaPlaceholder,children:v||"None"}),a.jsx("span",{className:it.editButton,"aria-hidden":"true",children:"✏️"})]})}function Sd(t){var D;const{value:s,onSave:o,mode:r="edit",options:c,fieldId:d="select",activeFieldId:u,onActivate:p,onChange:m,renderDisplay:g,placeholder:v,ariaLabel:_,"data-testid":b}=t,x=y.useRef(null),k=bh({value:s,onSave:o,fieldId:d,activeFieldId:u,onActivate:p,enterToSave:!1,trimOnSave:!1});y.useEffect(()=>{if(k.isEditing){const O=window.setTimeout(()=>{var E;(E=x.current)==null||E.focus()},0);return()=>window.clearTimeout(O)}},[k.isEditing]);const j=y.useCallback(O=>{const E=O.target.value;k.ignoreInitialBlurRef.current=!1,E!==s&&o(E),k.cancelEdit()},[s,o,k]),w=y.useCallback(O=>{if(k.ignoreInitialBlurRef.current){k.ignoreInitialBlurRef.current=!1;return}O.relatedTarget instanceof HTMLElement&&O.relatedTarget.dataset.editAction===d||k.cancelEdit()},[d,k]);if(r==="create")return a.jsx("select",{className:it.editSelect,value:s,onChange:O=>m==null?void 0:m(O.target.value),"aria-label":_,"data-testid":b?`${b}-select`:void 0,children:c.map(O=>a.jsx("option",{value:O.value,children:O.label},O.value))});if(k.isEditing)return a.jsx("select",{ref:x,className:it.editSelect,value:k.draft,onChange:j,onBlur:w,title:_,"aria-label":_,"data-testid":b?`${b}-select`:void 0,children:c.map(O=>a.jsx("option",{value:O.value,children:O.label},O.value))});const T=g==null?void 0:g(s),C=(D=c.find(O=>O.value===s))==null?void 0:D.label;return a.jsxs("button",{type:"button",className:it.metaValueClickable,onClick:()=>k.startEdit(),title:"Click to change","aria-label":_,"data-testid":b?`${b}-button`:void 0,children:[T!==void 0?T:C?a.jsx("span",{children:C}):a.jsx("span",{className:it.metaPlaceholder,children:v||"None"}),a.jsx("span",{className:it.editButton,"aria-hidden":"true",children:"✏️"})]})}function JI(t){const{checked:s,onChange:o,label:r,ariaLabel:c,"data-testid":d}=t;return a.jsxs("label",{className:it.worktreeToggle,"data-testid":d,children:[a.jsx("input",{type:"checkbox",checked:s,onChange:u=>o(u.target.checked),"aria-label":c}),a.jsx("span",{children:r})]})}const WI="_nav_1snmp_1",XI="_searchForm_1snmp_8",QI="_searchInput_1snmp_15",e5="_searchButton_1snmp_33",t5="_clearButton_1snmp_68",n5="_workspaceSelect_1snmp_85",s5="_listHeader_1snmp_99",a5="_nodeList_1snmp_108",i5="_nodeItem_1snmp_116",o5="_indicator_1snmp_129",r5="_label_1snmp_136",l5="_badge_1snmp_145",ts={nav:WI,searchForm:XI,searchInput:QI,searchButton:e5,clearButton:t5,workspaceSelect:n5,listHeader:s5,nodeList:a5,nodeItem:i5,indicator:o5,label:r5,badge:l5};function c5({nodes:t,workspaces:s,loading:o,searchQuery:r,onSearch:c,onClearSearch:d,onSelectNode:u,onWorkspaceChange:p}){const[m,g]=y.useState(""),v=y.useCallback(k=>{k.preventDefault(),m.trim()&&c(m.trim())},[m,c]),_=y.useCallback(()=>{g(""),d()},[d]),b=y.useCallback(k=>{u(k)},[u]),x=y.useCallback(k=>{g(""),p(k)},[p]);return a.jsxs("div",{className:ts.nav,"data-testid":"knowledge-nav",children:[a.jsxs("form",{className:ts.searchForm,onSubmit:v,children:[a.jsx("input",{className:ts.searchInput,type:"text",placeholder:"Search...",value:m,onChange:k=>{g(k.target.value)},"data-testid":"knowledge-search-input","aria-label":"Search knowledge nodes"}),a.jsx("button",{type:"submit",className:ts.searchButton,disabled:o,children:"Go"})]}),r&&a.jsx("button",{type:"button",className:ts.clearButton,onClick:_,children:"Clear search"}),a.jsxs("select",{className:ts.workspaceSelect,onChange:k=>{x(k.target.value)},"data-testid":"knowledge-workspace-filter","aria-label":"Filter by workspace",children:[a.jsx("option",{value:"",children:"All workspaces"}),s.map(k=>a.jsx("option",{value:k.id,children:k.name},k.id))]}),a.jsxs("div",{className:ts.listHeader,children:["Nodes (",t.length,")"]}),a.jsx("ul",{className:ts.nodeList,children:t.map(k=>a.jsxs("li",{className:ts.nodeItem,onClick:()=>{b(k.id)},onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),b(k.id))},role:"button",tabIndex:0,children:[a.jsx("span",{className:ts.indicator,style:{backgroundColor:k.kind==="reference"?"#4A9EFF":k.category==="decision"?"#22C55E":k.category==="concept"?"#A855F7":k.category==="snippet"?"#6B7280":"#EAB308"}}),a.jsx("span",{className:ts.label,children:k.label}),a.jsx("span",{className:ts.badge,children:k.kind==="reference"?k.sourceType:k.category})]},k.id))})]})}const d5="_container_bwu10_1",u5="_hamburger_bwu10_33",f5="_brand_bwu10_49",p5="_brandLogo_bwu10_68",m5="_info_bwu10_75",h5="_connectionLabel_bwu10_90",g5="_connectionDot_bwu10_103",v5="_connected_bwu10_106",y5="_disconnected_bwu10_110",b5="_connecting_bwu10_113",Ds={container:d5,hamburger:u5,brand:f5,brandLogo:p5,info:m5,connectionLabel:h5,connectionDot:g5,connected:v5,disconnected:y5,connecting:b5},_5={connected:"Connected",connecting:"Connecting...",disconnected:"Disconnected"},x5={connected:Ds.connected,connecting:Ds.connecting,disconnected:Ds.disconnected};function k5({connectionStatus:t,environments:s,sessions:o,onToggleSidebar:r,sidebarOpen:c}){const d=ut(),u=s.length,p=s.filter(v=>v.status==="connected").length,m=o.filter(v=>["running","idle"].includes(v.status)).length,g=_5[t];return a.jsxs("div",{className:Ds.container,children:[r&&a.jsx("button",{type:"button",className:Ds.hamburger,onClick:r,"aria-label":"Toggle sidebar","aria-expanded":c,children:a.jsx(Sw,{size:kt,"aria-hidden":"true"})}),a.jsx(Bi,{text:"Home",placement:"bottom",children:a.jsxs("button",{type:"button",className:Ds.brand,onClick:()=>d(Zo),"data-testid":"statusbar-brand",children:[a.jsx("img",{src:qd("icon-192x192.png"),alt:"",className:Ds.brandLogo,"aria-hidden":"true","data-testid":"statusbar-logo"}),"Grackle"]})}),a.jsxs("div",{className:Ds.info,children:[a.jsxs("span",{"aria-label":g,children:[a.jsx("span",{className:`${Ds.connectionDot} ${x5[t]}`,"aria-hidden":"true",children:a.jsx(Ja,{size:Cm,fill:"currentColor"})})," ",a.jsx("span",{className:Ds.connectionLabel,"aria-hidden":"true",children:g})]}),a.jsxs("span",{children:[p,"/",u," env",u!==1?"s":""]}),a.jsxs("span",{children:[m," active"]})]})]})}const S5="_nav_gx5h3_1",j5="_tab_gx5h3_35",w5="_tabIcon_gx5h3_68",T5="_tabLabel_gx5h3_79",N5="_tabActive_gx5h3_84",C5="_tabEnd_gx5h3_90",Mo={nav:S5,tab:j5,tabIcon:w5,tabLabel:T5,tabActive:N5,tabEnd:C5},rd=[{view:"dashboard",label:"Dashboard",icon:a.jsx(dw,{size:kt}),route:Zo,testId:"sidebar-tab-dashboard",order:0},{view:"tasks",label:"Tasks",icon:a.jsx(Vj,{size:kt}),route:iC,testId:"sidebar-tab-tasks",order:1},{view:"environments",label:"Environments",icon:a.jsx(Ew,{size:kt}),route:Ho,testId:"sidebar-tab-environments",order:2},{view:"chat",label:"Root",icon:a.jsx(ww,{size:kt}),route:aC,testId:"sidebar-tab-chat",order:3},{view:"findings",label:"Findings",icon:a.jsx(ud,{size:kt}),route:Bd,testId:"sidebar-tab-findings",order:4},{view:"knowledge",label:"Knowledge",icon:a.jsx(Oj,{size:kt}),route:dx,testId:"sidebar-tab-knowledge",order:5},{view:"coordination",label:"Coordination",icon:a.jsx(Dw,{size:kt}),route:lx,testId:"sidebar-tab-coordination",order:6},{view:"settings",label:"Settings",icon:a.jsx(qw,{size:kt}),route:QN,testId:"sidebar-tab-settings",align:"end"}];function E5(t){return t===Zo||t==="/"?"dashboard":t.startsWith(lx)?"coordination":t.startsWith("/chat")||t.startsWith("/sessions")?"chat":t.startsWith("/workspaces")||t.startsWith("/environments")?"environments":t.startsWith(dx)?"knowledge":t.startsWith(Bd)?"findings":t.startsWith(Ii)?"settings":"tasks"}function A5({tabs:t=rd}){var g;const s=an(),o=ut(),r=y.useRef(null),c=E5(s.pathname),d=y.useMemo(()=>{const v=(_,b)=>(_.order??Number.MAX_SAFE_INTEGER)-(b.order??Number.MAX_SAFE_INTEGER);return[...t.filter(_=>_.align!=="end").sort(v),...t.filter(_=>_.align==="end")]},[t]),u=(g=d.find(v=>v.align==="end"))==null?void 0:g.view,p=y.useCallback(v=>{o(v.route)},[o]),m=y.useCallback(v=>{var j,w;const _=(j=r.current)==null?void 0:j.querySelectorAll('[role="tab"]');if(!_)return;const b=Array.from(_).findIndex(T=>T===document.activeElement),x=b>=0?b:d.findIndex(T=>T.view===c);let k=x;if(v.key==="ArrowRight"||v.key==="j"||v.key==="J")v.preventDefault(),k=(x+1)%d.length;else if(v.key==="ArrowLeft"||v.key==="k"||v.key==="K")v.preventDefault(),k=(x-1+d.length)%d.length;else if(v.key==="Home")v.preventDefault(),k=0;else if(v.key==="End")v.preventDefault(),k=d.length-1;else return;o(d[k].route),(w=_[k])==null||w.focus()},[c,o,d]);return a.jsx("nav",{className:Mo.nav,ref:r,role:"tablist","aria-orientation":"horizontal","aria-label":"App navigation",onKeyDown:m,"data-testid":"sidebar-nav",children:d.map(v=>{const _=v.view===c,b=v.view===u;return a.jsx(Bi,{text:v.label,placement:"bottom",className:b?Mo.tabEnd:void 0,children:a.jsxs("button",{role:"tab",type:"button","aria-selected":_,tabIndex:_?0:-1,className:`${Mo.tab} ${_?Mo.tabActive:""}`,onClick:()=>p(v),"data-testid":v.testId,"aria-label":v.label,children:[a.jsx("span",{className:Mo.tabIcon,"aria-hidden":"true",children:v.icon}),a.jsx("span",{className:Mo.tabLabel,children:v.label})]})},v.view)})})}const D5="_container_pi6ii_1",M5="_content_pi6ii_66",i_={container:D5,content:M5},R5=320,K1=220,Z1=600,Y1="grackle-sidebar-width";function I5(){try{const t=localStorage.getItem(Y1);if(t!==null){const s=Number(t);if(Number.isFinite(s)&&s>=K1&&s<=Z1)return s}}catch{}return R5}function O5(t){try{localStorage.setItem(Y1,String(t))}catch{}}function L5({content:t}){const[s]=y.useState(I5),o=y.useRef(null);if(y.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>=K1&&m<=Z1&&O5(m)}}});return c.observe(r),()=>{c.disconnect()}},[]),t!==void 0)return a.jsx("div",{className:i_.container,ref:o,"data-testid":"sidebar",style:{width:s},children:a.jsx("div",{className:i_.content,children:t})})}const B5="_bar_tnfsh_1",$5="_btnPrimary_tnfsh_32",z5="_statusText_tnfsh_85",H5="_statusCompleted_tnfsh_90",P5="_statusFailed_tnfsh_94",U5="_statusBlocked_tnfsh_98",V5="_hintText_tnfsh_103",Nt={bar:B5,btnPrimary:$5,statusText:z5,statusCompleted:H5,statusFailed:P5,statusBlocked:U5,hintText:V5};function q5({sessions:t,tasks:s,environments:o}){const r=ut(),c=an(),d=Ot("/sessions/:sessionId"),u=Ot("/tasks/:taskId"),p=Ot("/tasks/:taskId/stream"),m=Ot("/tasks/:taskId/findings"),g=Ot("/tasks/:taskId/edit"),v=Ot("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId"),_=Ot("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream"),b=Ot("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings"),x=Ot("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit"),k=Ot("/sessions/new"),j=Ot("/environments/:environmentId/workspaces/:workspaceId"),w=Ot("/tasks/new"),T=Ot("/chat"),C=Ot("/"),D=Ot("/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)??(_==null?void 0:_.params.taskId)??(b==null?void 0:b.params.taskId)??(x==null?void 0:x.params.taskId),M=v??_??b??x,L=(M==null?void 0:M.params.environmentId)??(j==null?void 0:j.params.environmentId),A=c.pathname.startsWith("/environments")&&!j&&!M,P=!!T,Y=!!k,q=!!j&&!v&&!_&&!b&&!x,ee=!!w;if(!!C&&!Y&&!q&&!ee||!!D||(!!g||!!x)||ee||A||Y)return a.jsx(a.Fragment,{});if(P)return o.find(B=>B.adapterType==="local"&&B.status==="connected")?a.jsx(a.Fragment,{}):a.jsx("div",{className:Nt.bar,children:a.jsx("span",{className:Nt.hintText,children:"Add a local environment to start chatting"})});if(q)return a.jsx("div",{className:Nt.bar,children:a.jsx("span",{className:Nt.hintText,children:"Select a task or click + to create one"})});if(E){const $=s.find(oe=>oe.id===E);if(!$)return a.jsx("div",{className:Nt.bar,children:a.jsx("span",{className:Nt.hintText,children:"Loading..."})});const B=new Map(s.map(oe=>[oe.id,oe])),se=$.dependsOn.some(oe=>{const X=B.get(oe);return X!==void 0&&X.status!=="complete"});if($.status==="not_started"){const oe=se?$.dependsOn.map(X=>B.get(X)).filter(X=>X&&X.status!=="complete").map(X=>X.title):[];return a.jsx("div",{className:Nt.bar,children:se?a.jsxs("span",{className:Nt.statusBlocked,children:["Blocked by: ",oe.join(", ")]}):a.jsx("span",{className:Nt.hintText,children:"Use the buttons above to start or manage this task"})})}if($.status==="working"||$.status==="paused"){const oe=$.latestSessionId||void 0,X=oe?t.find(fe=>fe.id===oe):void 0;return X&&X.status!=="stopped"?a.jsx(a.Fragment,{}):a.jsx("div",{className:Nt.bar,children:a.jsx("span",{className:Nt.hintText,children:"Waiting for agent..."})})}if($.status==="complete")return a.jsxs("div",{className:Nt.bar,children:[a.jsx("span",{className:`${Nt.statusText} ${Nt.statusCompleted}`,children:"Task completed"}),a.jsx("button",{onClick:()=>r(Hi($.workspaceId,void 0,L)),className:Nt.btnPrimary,children:"+ New Task"})]});if($.status==="failed")return a.jsx("div",{className:Nt.bar,children:a.jsx("span",{className:`${Nt.statusText} ${Nt.statusFailed}`,children:"Task failed"})})}if(O){const $=t.find(oe=>oe.id===O),B=($==null?void 0:$.status)==="stopped";if($!==void 0&&!B)return a.jsx(a.Fragment,{});if(B)return a.jsxs("div",{className:Nt.bar,children:[a.jsxs("span",{className:`${Nt.statusText} ${Nt.hintText}`,children:["Session ",$.endReason||$.status]}),a.jsx("button",{onClick:()=>r(ix($.environmentId)),className:Nt.btnPrimary,children:"+ New Chat"})]})}return a.jsx("div",{className:Nt.bar,children:a.jsx("span",{className:Nt.hintText,children:"Loading..."})})}const G5="_nav_14i94_1",F5="_tab_14i94_24",K5="_tabActive_14i94_62",Z5="_tabLabel_14i94_75",Y5="_statusDot_14i94_81",J5="_pulse_14i94_87",W5="_addButton_14i94_99",X5="_empty_14i94_132",qa={nav:G5,tab:F5,tabActive:K5,tabLabel:Z5,statusDot:Y5,pulse:J5,addButton:W5,empty:X5},Q5={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function eO({environments:t}){const s=ut(),o=y.useRef(null),r=Ot("/environments/:environmentId"),c=Ot("/environments/:environmentId/edit"),d=Ot("/environments/:environmentId/workspaces/:workspaceId"),u=Ot("/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=y.useCallback(b=>{s(Li(b))},[s]),v=y.useCallback(b=>{var T;const x=(T=o.current)==null?void 0:T.querySelectorAll('[role="tab"]');if(!x||x.length===0)return;const k=Array.from(x).findIndex(C=>C===document.activeElement),j=k>=0?k:t.findIndex(C=>C.id===m);let w=j;if(b.key==="ArrowDown"||b.key==="j"||b.key==="J")b.preventDefault(),w=(j+1)%x.length;else if(b.key==="ArrowUp"||b.key==="k"||b.key==="K")b.preventDefault(),w=(j-1+x.length)%x.length;else if(b.key==="Home")b.preventDefault(),w=0;else if(b.key==="End")b.preventDefault(),w=x.length-1;else return;w<t.length&&s(Li(t[w].id)),x[w].focus()},[m,t,s]),_=m??(t.length>0?t[0].id:void 0);return a.jsxs("div",{className:qa.nav,"data-testid":"environment-nav",children:[a.jsx("nav",{ref:o,role:"tablist","aria-orientation":"vertical","aria-label":"Environments",onKeyDown:v,children:t.map(b=>{const x=b.id===m,k=b.id===_,j=Q5[b.status]||"var(--text-tertiary)",w=b.status==="connected";return a.jsxs("button",{role:"tab",type:"button","aria-selected":x,tabIndex:k?0:-1,className:`${qa.tab} ${x?qa.tabActive:""}`,onClick:()=>g(b.id),"data-testid":"env-nav-item",children:[a.jsx("span",{className:`${qa.statusDot} ${w?qa.pulse:""}`,style:{color:j},"aria-hidden":"true",children:a.jsx(Ja,{size:Cm,fill:"currentColor"})}),a.jsx("span",{className:qa.tabLabel,title:b.displayName||b.id,children:b.displayName||b.id})]},b.id)})}),a.jsx("button",{type:"button",className:qa.addButton,onClick:()=>s(WN),title:"Add environment","data-testid":"env-nav-add",children:"+ Add Environment"}),t.length===0&&a.jsx("div",{className:qa.empty,children:"No environments yet."})]})}function Go(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 J1(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 o_={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 jd(t){return o_[t]||o_.general}const tO="_nav_dlm8m_1",nO="_categoryPills_dlm8m_24",sO="_categoryPill_dlm8m_24",aO="_tab_dlm8m_42",iO="_tabActive_dlm8m_80",oO="_tabContent_dlm8m_93",rO="_tabLabel_dlm8m_100",lO="_tabMeta_dlm8m_106",cO="_categoryDot_dlm8m_111",dO="_empty_dlm8m_118",Es={nav:tO,categoryPills:nO,categoryPill:sO,tab:aO,tabActive:iO,tabContent:oO,tabLabel:rO,tabMeta:lO,categoryDot:cO,empty:dO};function uO({findings:t,workspaceId:s,environmentId:o}){const r=ut(),c=y.useRef(null),d=Ot("/findings/:findingId"),u=Ot("/environments/:environmentId/workspaces/:workspaceId/findings/:findingId"),p=(d==null?void 0:d.params.findingId)??(u==null?void 0:u.params.findingId),m=y.useMemo(()=>{const b=new Set(t.map(x=>x.category).filter(Boolean));return Array.from(b).sort()},[t]),g=y.useCallback(b=>{r(em(b,s,o))},[r,s,o]),v=y.useCallback(b=>{var T;const x=(T=c.current)==null?void 0:T.querySelectorAll('[role="tab"]');if(!x||x.length===0)return;const k=Array.from(x).findIndex(C=>C===document.activeElement),j=k>=0?k:t.findIndex(C=>C.id===p);let w=j;if(b.key==="ArrowDown"||b.key==="j"||b.key==="J")b.preventDefault(),w=(j+1)%x.length;else if(b.key==="ArrowUp"||b.key==="k"||b.key==="K")b.preventDefault(),w=(j-1+x.length)%x.length;else if(b.key==="Home")b.preventDefault(),w=0;else if(b.key==="End")b.preventDefault(),w=x.length-1;else return;w<t.length&&r(em(t[w].id,s,o)),x[w].focus()},[p,t,r,s,o]),_=p??(t.length>0?t[0].id:void 0);return a.jsxs("div",{className:Es.nav,"data-testid":"findings-nav",children:[m.length>1&&a.jsx("div",{className:Es.categoryPills,"data-testid":"findings-nav-categories",children:m.map(b=>a.jsx("span",{className:Es.categoryPill,style:{color:jd(b).text},children:b},b))}),a.jsx("nav",{ref:c,role:"tablist","aria-orientation":"vertical","aria-label":"Findings",onKeyDown:v,children:t.map(b=>{const x=b.id===p,k=b.id===_;return a.jsxs("button",{role:"tab",type:"button","aria-selected":x,tabIndex:k?0:-1,className:`${Es.tab} ${x?Es.tabActive:""}`,onClick:()=>g(b.id),"data-testid":"finding-nav-item",children:[a.jsx("span",{className:Es.categoryDot,style:{color:jd(b.category).text},"aria-hidden":"true",children:a.jsx(Ja,{size:Cm,fill:"currentColor"})}),a.jsxs("span",{className:Es.tabContent,children:[a.jsx("span",{className:Es.tabLabel,title:b.title,children:b.title}),a.jsx("span",{className:Es.tabMeta,title:b.createdAt,children:Go(b.createdAt)})]})]},b.id)})}),t.length===0&&a.jsx("div",{className:Es.empty,children:"No findings yet. Agents will post discoveries here."})]})}function fO(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 W1({text:t,indices:s,highlightClass:o}){if(!s||s.length===0)return a.jsx(a.Fragment,{children:t});const r=fO(s),c=[];let d=0;for(const[u,p]of r)u>d&&c.push(a.jsx("span",{children:t.slice(d,u)},`p${d}`)),c.push(a.jsx("mark",{className:o,children:t.slice(u,p+1)},`m${u}`)),d=p+1;return d<t.length&&c.push(a.jsx("span",{children:t.slice(d)},`p${d}`)),a.jsx(a.Fragment,{children:c})}function pO(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 mO(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 tT){c.add(d);const u=o.get(d);if(u&&u.length>0){u.sort((m,g)=>m.sortOrder-g.sortOrder);const p=Wa(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=Wa(d);r.push({status:d,label:p.label,style:p,tasks:u})}return r}const hO="_container_z4i38_1",gO="_header_z4i38_5",vO="_headerActions_z4i38_17",yO="_searchInput_z4i38_23",bO="_searchHighlight_z4i38_56",_O="_groupToggle_z4i38_62",xO="_groupToggleActive_z4i38_89",kO="_addButton_z4i38_93",SO="_taskRow_z4i38_120",jO="_selected_z4i38_140",wO="_expandArrow_z4i38_150",TO="_expanded_z4i38_157",NO="_leafSpacer_z4i38_161",CO="_taskStatusIcon_z4i38_166",EO="_taskTitle_z4i38_170",AO="_workspaceBadge_z4i38_177",DO="_childCountBadge_z4i38_195",MO="_dependencyBadge_z4i38_208",RO="_blockedBadge_z4i38_220",IO="_addChildButton_z4i38_225",OO="_emptyState_z4i38_268",LO="_statusGroupHeader_z4i38_275",BO="_statusGroupIcon_z4i38_294",$O="_statusGroupLabel_z4i38_298",zO="_statusGroupCount_z4i38_303",Qe={container:hO,header:gO,headerActions:vO,searchInput:yO,searchHighlight:bO,groupToggle:_O,groupToggleActive:xO,addButton:kO,taskRow:SO,selected:jO,expandArrow:wO,expanded:TO,leafSpacer:NO,taskStatusIcon:CO,taskTitle:EO,workspaceBadge:AO,childCountBadge:DO,dependencyBadge:MO,blockedBadge:RO,addChildButton:IO,emptyState:OO,statusGroupHeader:LO,statusGroupIcon:BO,statusGroupLabel:$O,statusGroupCount:zO},HO=[{name:"title",weight:2},{name:"description",weight:1}],X1=16,PO=16,Q1="grackle-task-group-by-status";function r_(){try{return localStorage.getItem(Q1)==="true"}catch{return!1}}function UO(t){try{localStorage.setItem(Q1,String(t))}catch{}}function VO({group:t,isExpanded:s,onToggle:o,selectedTaskId:r,navigate:c,titleHighlights:d,workspaceNames:u}){return a.jsxs("div",{"data-testid":`status-group-${t.status}`,children:[a.jsxs("div",{className:Qe.statusGroupHeader,role:"button",tabIndex:0,"aria-expanded":s,onClick:o,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),o())},children:[a.jsx("span",{className:`${Qe.expandArrow} ${s?Qe.expanded:""}`,"aria-hidden":"true",children:a.jsx(ga,{size:We})}),a.jsx("span",{className:Qe.statusGroupIcon,style:{color:t.style.color},"aria-hidden":"true",children:t.style.icon}),a.jsx("span",{className:Qe.statusGroupLabel,children:t.label}),a.jsx("span",{className:Qe.statusGroupCount,children:t.tasks.length})]}),a.jsx(is,{children:s&&a.jsx(Ct.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=Wa(p.status),g=r===p.id,v=p.parentTaskId||!p.workspaceId?void 0:u.get(p.workspaceId);return a.jsxs("div",{onClick:()=>c(Pn(p.id)),role:"button",tabIndex:0,"aria-label":p.title,onKeyDown:_=>{_.currentTarget===_.target&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),c(Pn(p.id)))},className:`${Qe.taskRow} ${g?Qe.selected:""}`,style:{"--task-indent":`${X1}px`},"data-task-id":p.id,children:[a.jsx("span",{className:Qe.leafSpacer}),a.jsx("span",{className:Qe.taskStatusIcon,style:{color:m.color},"aria-hidden":"true","data-testid":`task-status-${ml(p.status)}`,children:m.icon}),a.jsx("span",{className:Qe.taskTitle,title:p.title,children:a.jsx(W1,{text:p.title,indices:d.get(p.id),highlightClass:Qe.searchHighlight})}),v&&a.jsx("span",{className:Qe.workspaceBadge,title:v,children:v})]},p.id)})})})]})}function ek({node:t,depth:s,expandedTasks:o,toggleTask:r,selectedTaskId:c,navigate:d,taskStatusById:u,titleHighlights:p,workspaceNames:m}){const g=Wa(t.status),v=t.dependsOn.length>0&&t.dependsOn.some(T=>u.get(T)!=="complete"),_=o.has(t.id),b=t.children.length>0,x=c===t.id,k=X1+s*PO,w=s===0&&!t.parentTaskId&&t.workspaceId?m.get(t.workspaceId):void 0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{onClick:()=>d(Pn(t.id)),role:"button",tabIndex:0,"aria-label":t.title,onKeyDown:T=>{T.currentTarget===T.target&&(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),d(Pn(t.id)))},className:`${Qe.taskRow} ${x?Qe.selected:""}`,style:{"--task-indent":`${k}px`},"data-task-id":t.id,children:[b&&a.jsx("span",{className:`${Qe.expandArrow} ${_?Qe.expanded:""}`,role:"button",tabIndex:0,"aria-label":_?"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:a.jsx(ga,{size:We,"aria-hidden":"true"})}),!b&&a.jsx("span",{className:Qe.leafSpacer}),a.jsx("span",{className:Qe.taskStatusIcon,style:{color:g.color},"aria-hidden":"true","data-testid":`task-status-${ml(t.status)}`,children:g.icon}),a.jsx("span",{className:Qe.taskTitle,title:t.title,children:a.jsx(W1,{text:t.title,indices:p.get(t.id),highlightClass:Qe.searchHighlight})}),w&&a.jsx("span",{className:Qe.workspaceBadge,title:w,children:w}),b&&a.jsxs("span",{className:Qe.childCountBadge,children:[t.children.filter(T=>T.status==="complete").length,"/",t.children.length]}),t.dependsOn.length>0&&a.jsx("span",{className:`${Qe.dependencyBadge} ${v?Qe.blockedBadge:""}`,title:`Depends on: ${t.dependsOn.join(", ")}`,children:v?"blocked":"dep"}),s<K2&&a.jsx(Bi,{text:"Add child task",children:a.jsx("button",{onClick:T=>{T.stopPropagation(),d(Hi(t.workspaceId,t.id))},"aria-label":"Add child task",className:Qe.addChildButton,children:"+"})})]}),a.jsx(is,{children:b&&_&&a.jsx(Ct.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=>a.jsx(ek,{node:T,depth:s+1,expandedTasks:o,toggleTask:r,selectedTaskId:c,navigate:d,taskStatusById:u,titleHighlights:p,workspaceNames:m},T.id))})})]})}function qO({workspaces:t,tasks:s}){const o=ut(),[r,c]=y.useState(new Set),[d,u]=y.useState(new Set),[p,m]=y.useState(r_),[g,v]=y.useState(r_),[_,b]=y.useState(new Map),x=Ot("/tasks/:taskId/*"),k=(x==null?void 0:x.params.taskId)!=="new"?x==null?void 0:x.params.taskId:void 0,j=y.useMemo(()=>new Map(s.map(W=>[W.id,W.status])),[s]),w=y.useMemo(()=>new Map(t.map(W=>[W.id,W.name])),[t]),T=()=>{const W=!p;UO(W),m(W),W&&(v(!0),b(new Map))},C=W=>{b(re=>{const $=new Map(re),B=$.has(W)?$.get(W):g;return $.set(W,!B),$})},D=W=>_.has(W)?_.get(W):g,O=W=>{c(re=>{const $=new Set(re);return $.has(W)?($.delete(W),u(B=>new Set(B).add(W))):($.add(W),u(B=>{const se=new Set(B);return se.delete(W),se})),$})};y.useEffect(()=>{const W=new Set(s.filter(re=>re.parentTaskId).map(re=>re.parentTaskId));W.size>0&&c(re=>{const $=new Set(re);for(const B of W)d.has(B)||$.add(B);return $})},[s,d]);const[E,M]=y.useState(""),{directMatchTaskIds:L,treeMatchTaskIds:A,titleHighlights:P}=y.useMemo(()=>{if(!E.trim())return{directMatchTaskIds:null,treeMatchTaskIds:null,titleHighlights:new Map};const W=F2(s,E,HO),re=new Set(W.map(oe=>oe.item.id)),$=new Map;for(const oe of W){const X=oe.matches.find(ce=>ce.key==="title");X&&$.set(oe.item.id,X.indices)}const B=new Set(re),se=new Map(s.map(oe=>[oe.id,oe]));for(const oe of[...re]){let X=se.get(oe);for(;X!=null&&X.parentTaskId;)B.add(X.parentTaskId),X=se.get(X.parentTaskId)}return{directMatchTaskIds:re,treeMatchTaskIds:B,titleHighlights:$}},[E,s]),Y=L!==null,q=Y?p?L:A:null,ee=q?s.filter(W=>q.has(W.id)):s,le=p?[]:pO(ee);return a.jsxs("div",{className:Qe.container,children:[a.jsxs("div",{className:Qe.header,children:[a.jsx("span",{children:"Tasks"}),a.jsxs("div",{className:Qe.headerActions,children:[a.jsx(Bi,{text:p?"Switch to tree view":"Group tasks by status",children:a.jsx("button",{className:`${Qe.groupToggle} ${p?Qe.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:a.jsx(bw,{size:Vt})})}),a.jsx(Bi,{text:"New task",children:a.jsx("button",{className:Qe.addButton,onClick:()=>o(Hi()),"aria-label":"New task","data-testid":"new-task-button",children:"+"})})]})]}),s.length>0&&a.jsx("input",{type:"text",value:E,onChange:W=>M(W.target.value),placeholder:"Filter...","aria-label":"Filter tasks",className:Qe.searchInput,"data-testid":"sidebar-search"}),p?mO(ee,j).map(W=>a.jsx(VO,{group:W,isExpanded:D(W.status),onToggle:()=>C(W.status),selectedTaskId:k,navigate:o,titleHighlights:P,workspaceNames:w},W.status)):le.map(W=>a.jsx(ek,{node:W,depth:0,expandedTasks:r,toggleTask:O,selectedTaskId:k,navigate:o,taskStatusById:j,titleHighlights:P,workspaceNames:w},W.id)),ee.length===0&&!Y&&a.jsx("div",{className:Qe.emptyState,children:"No tasks yet. Click + to create one."}),ee.length===0&&Y&&a.jsx("div",{className:Qe.emptyState,children:"No matching tasks"})]})}const GO="_toast_ed2dk_1",FO="_success_ed2dk_18",KO="_icon_ed2dk_22",ZO="_error_ed2dk_25",YO="_warning_ed2dk_32",JO="_info_ed2dk_38",WO="_message_ed2dk_53",XO="_close_ed2dk_60",Fr={toast:GO,success:FO,icon:KO,error:ZO,warning:YO,info:JO,message:WO,close:XO},QO={success:a.jsx($i,{size:kt}),error:a.jsx(Ls,{size:kt}),warning:a.jsx(Nm,{size:kt}),info:a.jsx(Tm,{size:kt})};function eL({toast:t,onDismiss:s}){return y.useEffect(()=>{const o=setTimeout(()=>s(t.id),t.duration);return()=>clearTimeout(o)},[t.id,t.duration,s]),a.jsxs(Ct.div,{className:`${Fr.toast} ${Fr[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:[a.jsx("span",{className:Fr.icon,"aria-hidden":"true",children:QO[t.variant]}),a.jsx("span",{className:Fr.message,children:t.message}),a.jsx("button",{type:"button",className:Fr.close,onClick:()=>s(t.id),"aria-label":"Dismiss notification",children:a.jsx(Ls,{size:Vt,"aria-hidden":"true"})})]})}const tL="_container_qqse2_1",nL={container:tL};function sL({toasts:t,onDismiss:s}){return a.jsx("div",{className:nL.container,"data-testid":"toast-container",children:a.jsx(is,{children:t.map(o=>a.jsx(eL,{toast:o,onDismiss:s},o.id))})})}const aL="_callout_e5awm_1",iL="_success_e5awm_11",oL="_icon_e5awm_15",rL="_error_e5awm_18",lL="_warning_e5awm_25",cL="_info_e5awm_32",dL="_content_e5awm_48",uL="_close_e5awm_53",Kr={callout:aL,success:iL,icon:oL,error:rL,warning:lL,info:cL,content:dL,close:uL},fL={success:a.jsx($i,{size:kt}),error:a.jsx(Ls,{size:kt}),warning:a.jsx(Nm,{size:kt}),info:a.jsx(Tm,{size:kt})};function pL({variant:t="info",children:s,dismissible:o=!1,className:r}){const[c,d]=y.useState(!1);return a.jsx(a.Fragment,{children:!c&&a.jsxs("div",{className:[Kr.callout,Kr[t],r].filter(Boolean).join(" "),role:t==="error"||t==="warning"?"alert":"status",children:[a.jsx("span",{className:Kr.icon,"aria-hidden":"true",children:fL[t]}),a.jsx("span",{className:Kr.content,children:s}),o&&a.jsx("button",{type:"button",className:Kr.close,onClick:()=>d(!0),"aria-label":"Dismiss",children:a.jsx(Ls,{size:Vt,"aria-hidden":"true"})})]})})}function mL({currentVersion:t,latestVersion:s,updateAvailable:o,isDocker:r}){if(!o)return a.jsx(a.Fragment,{});const c=r?"docker pull ghcr.io/nick-pape/grackle:latest && docker restart grackle":`npm install -g @grackle-ai/cli@${s}`;return a.jsx("div",{"data-testid":"update-banner",children:a.jsxs(pL,{variant:"info",dismissible:!0,children:[a.jsxs("strong",{children:["Grackle v",s]})," is available (you have v",t,")."," ","Run: ",a.jsx("code",{children:c})]})})}const hL="_container_de44x_1",gL="_emptyState_de44x_8",vL="_card_de44x_14",yL="_cardClickable_de44x_34",bL="_cardHeader_de44x_42",_L="_categoryBadge_de44x_54",xL="_findingTitle_de44x_62",kL="_findingDate_de44x_68",SL="_findingContent_de44x_80",jL="_tags_de44x_86",wL="_tag_de44x_86",vs={container:hL,emptyState:gL,card:vL,cardClickable:yL,cardHeader:bL,categoryBadge:_L,findingTitle:xL,findingDate:kL,findingContent:SL,tags:jL,tag:wL};function tk({findings:t,onFindingClick:s}){return t.length===0?a.jsx("div",{className:vs.emptyState,children:"No findings yet. Agents will post discoveries here."}):a.jsx("div",{className:vs.container,children:t.map((o,r)=>{const c=jd(o.category),d=s?Ct.button:Ct.div;return a.jsxs(d,{type:s?"button":void 0,className:`${vs.card} ${s?vs.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:[a.jsxs("div",{className:vs.cardHeader,children:[a.jsx("span",{className:vs.categoryBadge,style:{background:c.bg,color:c.text},children:o.category}),a.jsx("span",{className:vs.findingTitle,children:o.title}),a.jsx("span",{className:vs.findingDate,title:o.createdAt,children:Go(o.createdAt)})]}),a.jsx("div",{className:vs.findingContent,children:o.content.length>300?o.content.slice(0,300)+"...":o.content}),o.tags.length>0&&a.jsx("div",{className:vs.tags,children:o.tags.map(u=>a.jsx("span",{className:vs.tag,style:{color:c.text,textShadow:`0 0 8px ${c.text}`},children:u},u))})]},o.id)})})}const TL="_container_m1fsr_1",NL="_heading_m1fsr_7",CL="_section_m1fsr_14",EL="_sectionTitle_m1fsr_26",AL="_sectionDescription_m1fsr_35",DL="_emptyState_m1fsr_41",ML="_tokenList_m1fsr_48",RL="_tokenRow_m1fsr_55",IL="_tokenBadge_m1fsr_68",OL="_tokenName_m1fsr_83",LL="_tokenTarget_m1fsr_90",BL="_deleteButton_m1fsr_99",$L="_addForm_m1fsr_113",zL="_formRow_m1fsr_119",HL="_input_m1fsr_125",PL="_select_m1fsr_155",UL="_addButton_m1fsr_187",VL="_emptyStateInfo_m1fsr_221",qL="_themeOptions_m1fsr_229",GL="_themeOption_m1fsr_229",FL="_themeOptionSelected_m1fsr_254",KL="_themeOptionHeader_m1fsr_259",ZL="_themeOptionLabel_m1fsr_266",YL="_themeOptionDesc_m1fsr_273",JL="_variantToggle_m1fsr_279",WL="_variantButton_m1fsr_286",XL="_variantActive_m1fsr_305",QL="_themeSwatches_m1fsr_311",eB="_themeSwatch_m1fsr_311",tB="_systemToggle_m1fsr_325",nB="_systemToggleHint_m1fsr_341",sB="_themeActive_m1fsr_348",aB="_aboutGrid_m1fsr_354",iB="_aboutItem_m1fsr_360",oB="_aboutLabel_m1fsr_373",rB="_aboutValue_m1fsr_379",lB="_aboutDot_m1fsr_387",cB="_aboutDotConnected_m1fsr_394",dB="_aboutDotDisconnected_m1fsr_398",uB="_aboutDotConnecting_m1fsr_402",pe={container:TL,heading:NL,section:CL,sectionTitle:EL,sectionDescription:AL,emptyState:DL,tokenList:ML,tokenRow:RL,tokenBadge:IL,tokenName:OL,tokenTarget:LL,deleteButton:BL,addForm:$L,formRow:zL,input:HL,select:PL,addButton:UL,emptyStateInfo:VL,themeOptions:qL,themeOption:GL,themeOptionSelected:FL,themeOptionHeader:KL,themeOptionLabel:ZL,themeOptionDesc:YL,variantToggle:JL,variantButton:WL,variantActive:XL,themeSwatches:QL,themeSwatch:eB,systemToggle:tB,systemToggleHint:nB,themeActive:sB,aboutGrid:aB,aboutItem:iB,aboutLabel:oB,aboutValue:rB,aboutDot:lB,aboutDotConnected:cB,aboutDotDisconnected:dB,aboutDotConnecting:uB},fB=[{value:"env_var",label:"Environment Variable"},{value:"file",label:"File"}];function pB({tokens:t,onSetToken:s,onDeleteToken:o,onShowToast:r}){const[c,d]=y.useState(""),[u,p]=y.useState(""),[m,g]=y.useState("env_var"),[v,_]=y.useState(""),[b,x]=y.useState(null),k=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(""),_("")},j=T=>{x(T)},w=()=>{b&&(o(b),r==null||r("Token deleted","info")),x(null)};return a.jsxs(a.Fragment,{children:[a.jsx(xs,{isOpen:b!==null,title:"Delete Token?",description:b?`"${b}" will be permanently removed.`:void 0,onConfirm:w,onCancel:()=>x(null)}),a.jsxs("section",{className:pe.section,children:[a.jsx("h3",{className:pe.sectionTitle,children:"Tokens"}),a.jsx("p",{className:pe.sectionDescription,children:"API tokens are auto-pushed to environments when set or updated. Values are write-only."}),t.length===0?a.jsx("div",{className:pe.emptyStateInfo,children:"Add your first API token to enable service integrations."}):a.jsx("div",{className:pe.tokenList,children:t.map(T=>a.jsxs("div",{className:pe.tokenRow,children:[a.jsx("span",{className:pe.tokenBadge,children:T.tokenType}),a.jsx("span",{className:pe.tokenName,children:T.name}),a.jsx("span",{className:pe.tokenTarget,children:T.tokenType==="env_var"?T.envVar:T.filePath}),a.jsx("button",{className:pe.deleteButton,onClick:()=>j(T.name),title:`Delete ${T.name}`,"aria-label":`Delete ${T.name}`,children:a.jsx(Ls,{size:Vt,"aria-hidden":"true"})})]},T.name))}),a.jsxs("form",{className:pe.addForm,onSubmit:k,children:[a.jsxs("div",{className:pe.formRow,children:[a.jsx("input",{className:pe.input,type:"text",placeholder:"Token name",value:c,onChange:T=>d(T.target.value)}),a.jsx("input",{className:pe.input,type:"password",placeholder:"Value",value:u,onChange:T=>p(T.target.value)})]}),a.jsxs("div",{className:pe.formRow,children:[a.jsx("select",{className:pe.select,value:m,onChange:T=>g(T.target.value),children:fB.map(T=>a.jsx("option",{value:T.value,children:T.label},T.value))}),a.jsx("input",{className:pe.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=>_(T.target.value)}),a.jsx("button",{className:pe.addButton,type:"submit",children:"Add Token"})]})]})]})]})}const Gd=[{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"]}],nk=new Set(Gd.map(t=>t.id)),l_="grackle";function _m(t){return Gd.find(s=>s.id===t)}function mB({themeId:t,resolvedThemeId:s,onSetTheme:o,preferSystem:r,onSetPreferSystem:c}){return a.jsxs("section",{className:pe.section,children:[a.jsx("h3",{className:pe.sectionTitle,children:"Appearance"}),a.jsx("p",{className:pe.sectionDescription,children:"Choose how Grackle looks across the app."}),a.jsx("div",{className:pe.themeOptions,children:Gd.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 a.jsxs("button",{type:"button",className:`${pe.themeOption} ${p?pe.themeOptionSelected:""}`,"aria-pressed":p,onClick:()=>o(d.id),children:[a.jsxs("span",{className:pe.themeOptionHeader,children:[a.jsxs("span",{children:[a.jsx("span",{className:pe.themeOptionLabel,children:d.label}),a.jsx("span",{className:pe.themeOptionDesc,children:d.description})]}),u&&a.jsxs("span",{className:pe.variantToggle,children:[a.jsx("span",{role:"button",tabIndex:0,className:`${pe.variantButton} ${p&&m?pe.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:"☼"}),a.jsx("span",{role:"button",tabIndex:0,className:`${pe.variantButton} ${p&&!m?pe.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&&a.jsx("span",{className:pe.themeSwatches,children:d.swatches.map((g,v)=>a.jsx("span",{className:pe.themeSwatch,style:{background:g}},v))})]},d.id)})}),a.jsxs("label",{className:pe.systemToggle,children:[a.jsx("input",{type:"checkbox",checked:r,onChange:d=>c(d.target.checked)}),a.jsx("span",{children:"Match system light/dark preference"})]}),a.jsx("p",{className:pe.systemToggleHint,children:"Automatically switches between light and dark variants when available."}),a.jsxs("p",{className:pe.themeActive,children:["Active theme: ",a.jsx("strong",{children:s})]})]})}const hB={connected:"Connected",connecting:"Connecting...",disconnected:"Disconnected"},gB={connected:pe.aboutDotConnected,connecting:pe.aboutDotConnecting,disconnected:pe.aboutDotDisconnected};function vB({connectionStatus: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 a.jsxs("section",{className:pe.section,"data-testid":"about-panel",children:[a.jsx("h3",{className:pe.sectionTitle,children:"About"}),a.jsx("p",{className:pe.sectionDescription,children:"Connection status and application information."}),a.jsxs("div",{className:pe.aboutGrid,children:[a.jsxs("div",{className:pe.aboutItem,children:[a.jsx("span",{className:pe.aboutLabel,children:"Connection"}),a.jsxs("span",{className:pe.aboutValue,children:[a.jsx("span",{className:`${pe.aboutDot} ${gB[t]}`}),hB[t]]})]}),a.jsxs("div",{className:pe.aboutItem,children:[a.jsx("span",{className:pe.aboutLabel,children:"Environments"}),a.jsxs("span",{className:pe.aboutValue,children:[r,"/",c," connected"]})]}),a.jsxs("div",{className:pe.aboutItem,children:[a.jsx("span",{className:pe.aboutLabel,children:"Active Sessions"}),a.jsx("span",{className:pe.aboutValue,children:d})]}),a.jsxs("div",{className:pe.aboutItem,children:[a.jsx("span",{className:pe.aboutLabel,children:"Version"}),a.jsx("span",{className:pe.aboutValue,children:"0.113.0"})]})]})]})}const yB="_container_cddyd_1",bB="_header_cddyd_8",_B="_headerTitle_cddyd_35",xB="_badge_cddyd_44",kB="_headerActions_cddyd_54",SB="_body_cddyd_61",jB="_formContent_cddyd_73",wB="_section_cddyd_85",TB="_label_cddyd_91",NB="_titleInput_cddyd_98",CB="_descriptionTextarea_cddyd_131",EB="_parentContext_cddyd_167",AB="_parentLabel_cddyd_175",DB="_parentName_cddyd_182",MB="_personaSelect_cddyd_186",RB="_depList_cddyd_220",IB="_depItem_cddyd_226",OB="_depItemSelected_cddyd_248",LB="_noDeps_cddyd_252",BB="_btnPrimary_cddyd_258",$B="_btnGhost_cddyd_289",at={container:yB,header:bB,headerTitle:_B,badge:xB,headerActions:kB,body:SB,formContent:jB,section:wB,label:TB,titleInput:NB,descriptionTextarea:CB,parentContext:EB,parentLabel:AB,parentName:DB,personaSelect:MB,depList:RB,depItem:IB,depItemSelected:OB,noDeps:LB,btnPrimary:BB,btnGhost:$B};function sk({mode:t,taskId:s,workspaceId:o,parentTaskId:r,environmentId:c,tasks:d,workspaces:u,personas:p,onCreateTask:m,onUpdateTask:g,onEditDone:v,onShowToast:_}){const b=ut(),x=t==="edit",k=x&&s?d.find(_e=>_e.id===s):void 0,j=x?(k==null?void 0:k.workspaceId)??"":o??"",[w,T]=y.useState(j),C=j||w,D=u.find(_e=>_e.id===C),O=c??(D==null?void 0:D.linkedEnvironmentIds[0]),E=!x&&!o,M=x?(k==null?void 0:k.parentTaskId)??"":r??"",L=M?d.find(_e=>_e.id===M):void 0,[A,P]=y.useState((k==null?void 0:k.title)??""),[Y,q]=y.useState((k==null?void 0:k.description)??""),[ee,le]=y.useState((k==null?void 0:k.dependsOn)??[]),[W,re]=y.useState((k==null?void 0:k.defaultPersonaId)??""),[$,B]=y.useState((k==null?void 0:k.canDecompose)??!1),[se,oe]=y.useState(!1),X=y.useRef(!1);y.useEffect(()=>{x&&k&&!X.current&&(X.current=!0,P(k.title),q(k.description),le(k.dependsOn),re(k.defaultPersonaId),B(k.canDecompose))},[x,k]);const ce=d.filter(_e=>_e.workspaceId===C&&(!x||_e.id!==s)&&_e.id!==M),fe=A.trim().length>0&&(!x||k!==void 0)&&C.length>0,ge=_e=>{le(qe=>qe.includes(_e)?qe.filter(Bt=>Bt!==_e):[...qe,_e])},Ae=()=>{!fe||se||x&&k===void 0||(x&&s?(g(s,A.trim(),Y,ee,W),_==null||_("Task updated","success"),v?v():b(Pn(s,void 0,C,O),{replace:!0})):(oe(!0),m(C,A.trim(),Y,ee.length>0?ee:void 0,M||void 0,W,$,()=>{_==null||_("Task created","success"),b(o?Xa(o,O):"/tasks",{replace:!0})},_e=>{_==null||_(_e,"error"),oe(!1)})))},vt=()=>{if(v){v();return}b(x&&s?Pn(s,void 0,C,O):o?Xa(o,O):"/tasks")},wt=x?"edit task":M?"child task":"new task";return a.jsxs("div",{className:at.container,children:[a.jsxs("div",{className:at.header,children:[a.jsxs("div",{className:at.headerTitle,children:[a.jsx("span",{className:at.badge,children:wt}),L&&a.jsxs("span",{className:at.parentContext,children:[a.jsx("span",{className:at.parentLabel,children:"Child of"}),a.jsx("span",{className:at.parentName,children:L.title})]})]}),a.jsxs("div",{className:at.headerActions,children:[a.jsx("button",{onClick:Ae,disabled:!fe||se,className:at.btnPrimary,"data-testid":"task-edit-save",children:se?"Creating…":x?"Save Changes":"Create"}),a.jsx("button",{onClick:vt,className:at.btnGhost,children:"Cancel"})]})]}),a.jsx("div",{className:at.body,children:a.jsxs("div",{className:at.formContent,children:[E&&a.jsxs("div",{className:at.section,children:[a.jsx("label",{className:at.label,htmlFor:"task-edit-workspace",children:"Workspace"}),a.jsxs("select",{id:"task-edit-workspace",value:w,onChange:_e=>T(_e.target.value),className:at.personaSelect,"data-testid":"task-edit-workspace",children:[a.jsx("option",{value:"",children:"Select a workspace..."}),u.map(_e=>a.jsx("option",{value:_e.id,children:_e.name},_e.id))]})]}),a.jsxs("div",{className:at.section,children:[a.jsx("label",{className:at.label,htmlFor:"task-edit-title",children:"Title"}),a.jsx("input",{id:"task-edit-title",type:"text",value:A,onChange:_e=>P(_e.target.value),placeholder:"Task title...",autoFocus:!0,className:at.titleInput,"data-testid":"task-edit-title",onKeyDown:_e=>{_e.key==="Enter"&&fe&&Ae()}})]}),a.jsxs("div",{className:at.section,children:[a.jsx("label",{className:at.label,htmlFor:"task-edit-description",children:"Description"}),a.jsx("textarea",{id:"task-edit-description",value:Y,onChange:_e=>q(_e.target.value),placeholder:"Describe the task... (markdown supported)",className:at.descriptionTextarea,"data-testid":"task-edit-description",rows:8})]}),a.jsxs("div",{className:at.section,children:[a.jsx("label",{className:at.label,htmlFor:"task-edit-persona",children:"Default Persona"}),a.jsxs("select",{id:"task-edit-persona",value:W,onChange:_e=>re(_e.target.value),className:at.personaSelect,"data-testid":"task-edit-persona",children:[a.jsx("option",{value:"",children:"(Inherit)"}),p.map(_e=>a.jsx("option",{value:_e.id,children:_e.name},_e.id))]})]}),!x&&a.jsx("div",{className:at.section,children:a.jsxs("label",{className:at.depItem,"data-testid":"task-edit-can-decompose",children:[a.jsx("input",{type:"checkbox",checked:$,onChange:_e=>B(_e.target.checked)}),"Can spawn subtasks"]})}),a.jsxs("div",{className:at.section,children:[a.jsx("div",{className:at.label,children:"Dependencies"}),ce.length===0?a.jsx("div",{className:at.noDeps,children:"No other tasks in this workspace"}):a.jsx("div",{className:at.depList,children:ce.map(_e=>{const qe=ee.includes(_e.id);return a.jsxs("label",{className:`${at.depItem} ${qe?at.depItemSelected:""}`,"data-testid":`dep-option-${_e.id}`,children:[a.jsx("input",{type:"checkbox",checked:qe,onChange:()=>ge(_e.id)}),_e.title,a.jsxs("span",{style:{opacity:.5,fontSize:"11px",marginLeft:"4px"},children:["(",_e.status,")"]})]},_e.id)})})]})]})})]})}const zB="_actionButtons_1rjka_1",HB="_btnPrimary_1rjka_8",PB="_btnDanger_1rjka_39",UB="_btnGhost_1rjka_78",nn={actionButtons:zB,btnPrimary:HB,btnDanger:PB,btnGhost:UB};function VB({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?a.jsxs("div",{className:nn.actionButtons,"data-testid":"task-action-buttons",children:[a.jsx("button",{onClick:m,className:nn.btnGhost,"data-testid":"task-action-edit",children:"Edit"}),a.jsx("button",{onClick:p,className:nn.btnDanger,"data-testid":"task-action-delete",children:"Delete"})]}):a.jsxs("div",{className:nn.actionButtons,"data-testid":"task-action-buttons",children:[a.jsx("button",{"data-testid":"task-header-start",onClick:r,className:nn.btnPrimary,children:"Start"}),a.jsx("button",{onClick:m,className:nn.btnGhost,"data-testid":"task-action-edit",children:"Edit"}),a.jsx("button",{onClick:p,className:nn.btnDanger,"data-testid":"task-action-delete",children:"Delete"})]});if(t.status==="working")return a.jsxs("div",{className:nn.actionButtons,"data-testid":"task-action-buttons",children:[a.jsx("button",{onClick:d,className:nn.btnDanger,"data-testid":"task-action-stop",children:"Stop"}),a.jsx("button",{onClick:u,disabled:!s,className:nn.btnGhost,"data-testid":"task-action-pause",children:"Pause"})]});if(t.status==="paused")return a.jsxs("div",{className:nn.actionButtons,"data-testid":"task-action-buttons",children:[a.jsx("button",{onClick:d,className:nn.btnPrimary,"data-testid":"task-action-stop",children:"Stop"}),a.jsx("button",{onClick:c,className:nn.btnGhost,"data-testid":"task-action-resume",children:"Resume"}),a.jsx("button",{onClick:p,className:nn.btnDanger,"data-testid":"task-action-delete",children:"Delete"})]});if(t.status==="complete")return a.jsx("div",{className:nn.actionButtons,"data-testid":"task-action-buttons",children:a.jsx("button",{onClick:p,className:nn.btnDanger,"data-testid":"task-action-delete",children:"Delete"})});if(t.status==="failed")return a.jsxs("div",{className:nn.actionButtons,"data-testid":"task-action-buttons",children:[a.jsx("button",{onClick:r,className:nn.btnPrimary,"data-testid":"task-header-start",children:"Retry"}),a.jsx("button",{onClick:p,className:nn.btnDanger,"data-testid":"task-action-delete",children:"Delete"})]})}const qB="_workpadSection_y8nj9_1",GB="_workpadLabel_y8nj9_9",FB="_workpadStatus_y8nj9_17",KB="_workpadSummary_y8nj9_23",ZB="_workpadExtra_y8nj9_29",Ga={workpadSection:qB,workpadLabel:GB,workpadStatus:FB,workpadSummary:KB,workpadExtra:ZB};function YB({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 a.jsxs("div",{className:Ga.workpadSection,"data-testid":"workpad-panel",children:[a.jsx("div",{className:Ga.workpadLabel,children:"Workpad"}),a.jsx("div",{className:Ga.workpadExtra,children:t})]})}if(!(!s.status&&!s.summary&&!s.extra))return a.jsxs("div",{className:Ga.workpadSection,"data-testid":"workpad-panel",children:[a.jsx("div",{className:Ga.workpadLabel,children:"Workpad"}),s.status&&a.jsx("div",{className:Ga.workpadStatus,"data-testid":"workpad-status",children:s.status}),s.summary&&a.jsx("div",{className:Ga.workpadSummary,"data-testid":"workpad-summary",children:s.summary}),s.extra&&Object.keys(s.extra).length>0&&a.jsx("div",{className:Ga.workpadExtra,"data-testid":"workpad-extra",children:JSON.stringify(s.extra,null,2)})]})}const JB="_overviewDashboard_r05qm_1",WB="_overviewHero_r05qm_7",XB="_statusBadge_r05qm_14",QB="_statusPending_r05qm_26",e8="_statusAssigned_r05qm_31",t8="_statusInProgress_r05qm_36",n8="_statusReview_r05qm_41",s8="_statusDone_r05qm_46",a8="_statusFailed_r05qm_51",i8="_statusWaitingInput_r05qm_56",o8="_overviewBranchPill_r05qm_61",r8="_branchLink_r05qm_76",l8="_overviewSection_r05qm_87",c8="_overviewLabel_r05qm_93",d8="_overviewValue_r05qm_100",u8="_overviewMuted_r05qm_105",f8="_overviewMarkdown_r05qm_111",p8="_envRow_r05qm_180",m8="_envDot_r05qm_186",h8="_envDotGreen_r05qm_193",g8="_envDotYellow_r05qm_197",v8="_envDotRed_r05qm_201",y8="_envDotGray_r05qm_205",b8="_depList_r05qm_209",_8="_depItem_r05qm_215",x8="_depBlocked_r05qm_222",k8="_depDone_r05qm_226",S8="_timeline_r05qm_230",j8="_timelineRow_r05qm_236",w8="_timelineKey_r05qm_243",T8="_timelineValue_r05qm_249",N8="_timelineDelta_r05qm_253",C8="_reviewNotes_r05qm_264",be={overviewDashboard:JB,overviewHero:WB,statusBadge:XB,statusPending:QB,statusAssigned:e8,statusInProgress:t8,statusReview:n8,statusDone:s8,statusFailed:a8,statusWaitingInput:i8,overviewBranchPill:o8,branchLink:r8,overviewSection:l8,overviewLabel:c8,overviewValue:d8,overviewMuted:u8,overviewMarkdown:f8,envRow:p8,envDot:m8,envDotGreen:h8,envDotYellow:g8,envDotRed:v8,envDotGray:y8,depList:b8,depItem:_8,depBlocked:x8,depDone:k8,timeline:S8,timelineRow:j8,timelineKey:w8,timelineValue:T8,timelineDelta:N8,reviewNotes:C8};function Zc(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 $p(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 c_(t){const s=t.toLowerCase();return s==="ready"||s==="running"||s==="available"||s==="connected"?be.envDotGreen:s==="provisioning"||s==="starting"||s==="pending"||s==="connecting"?be.envDotYellow:s==="error"||s==="failed"||s==="disconnected"?be.envDotRed:be.envDotGray}function E8({status:t}){const s=Wa(t),o=eT(t);return a.jsx("span",{className:`${be.statusBadge} ${be[o]??be.statusPending}`,"data-testid":"task-overview-status-badge",children:s.label})}function A8({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(k=>k.id===g):void 0,_=r.find(k=>k.id===t.workspaceId),b=o.find(k=>k.id===d),x=t.branch&&(_!=null&&_.repoUrl)?`${_.repoUrl.replace(/\/$/,"")}/tree/${encodeURIComponent(t.branch)}`:void 0;return a.jsxs("div",{className:be.overviewDashboard,"data-testid":"task-overview-panel",children:[a.jsxs("div",{className:be.overviewHero,children:[a.jsx(E8,{status:t.status}),t.branch&&a.jsx("span",{className:be.overviewBranchPill,"data-testid":"task-overview-branch",children:x?a.jsxs("a",{href:x,target:"_blank",rel:"noreferrer noopener",className:be.branchLink,children:["🔗"," ",t.branch]}):a.jsxs("span",{children:["🔗"," ",t.branch]})})]}),typeof t.description=="string"&&t.description&&a.jsxs("div",{className:be.overviewSection,"data-testid":"task-overview-description",children:[a.jsx("div",{className:be.overviewLabel,children:"Description"}),a.jsx("div",{className:be.overviewMarkdown,children:a.jsx(Cd,{remarkPlugins:[Ed],children:t.description})})]}),t.workpad&&a.jsx(YB,{workpad:t.workpad}),a.jsxs("div",{className:be.overviewSection,children:[a.jsx("div",{className:be.overviewLabel,children:"Environment"}),g&&v?a.jsxs("div",{className:be.envRow,"data-testid":"task-overview-environment",children:[a.jsx("span",{className:`${be.envDot} ${c_(v.status)}`,title:v.status,"aria-label":`Status: ${v.status}`,role:"img"}),a.jsx("span",{className:be.overviewValue,children:v.displayName})]}):b?a.jsxs("div",{className:be.envRow,"data-testid":"task-overview-environment",children:[a.jsx("span",{className:`${be.envDot} ${c_(b.status)}`,title:b.status,"aria-label":`Status: ${b.status}`,role:"img"}),a.jsx("span",{className:be.overviewValue,children:b.displayName}),a.jsx("span",{className:be.overviewMuted,children:"(workspace default)"})]}):a.jsx("div",{className:be.overviewMuted,children:"Set in workspace settings"})]}),a.jsxs("div",{className:be.overviewSection,"data-testid":"task-overview-dependencies",children:[a.jsx("div",{className:be.overviewLabel,children:"Dependencies"}),t.dependsOn.length===0?a.jsx("div",{className:be.overviewMuted,children:"None"}):a.jsx("div",{className:be.depList,children:t.dependsOn.map(k=>{const j=s.get(k),w=(j==null?void 0:j.status)==="complete";return a.jsxs("div",{className:`${be.depItem} ${w?be.depDone:be.depBlocked}`,children:[a.jsx("span",{children:w?"✓":"○"}),a.jsx("span",{children:(j==null?void 0:j.title)??k})]},k)})})]}),a.jsxs("div",{className:be.overviewSection,"data-testid":"task-overview-timeline",children:[a.jsx("div",{className:be.overviewLabel,children:"Timeline"}),a.jsxs("div",{className:be.timeline,children:[t.createdAt&&a.jsxs("div",{className:be.timelineRow,children:[a.jsx("span",{className:be.timelineKey,children:"Created"}),a.jsx("span",{className:be.timelineValue,children:Zc(t.createdAt)})]}),t.assignedAt&&(()=>{const k=$p(t.createdAt,t.assignedAt);return a.jsxs("div",{className:be.timelineRow,children:[a.jsx("span",{className:be.timelineKey,children:"Assigned"}),a.jsx("span",{className:be.timelineValue,children:Zc(t.assignedAt)}),k!==void 0&&a.jsx("span",{className:be.timelineDelta,children:k})]})})(),t.startedAt&&(()=>{const k=$p(t.assignedAt??t.createdAt,t.startedAt);return a.jsxs("div",{className:be.timelineRow,children:[a.jsx("span",{className:be.timelineKey,children:"Started"}),a.jsx("span",{className:be.timelineValue,children:Zc(t.startedAt)}),k!==void 0&&a.jsx("span",{className:be.timelineDelta,children:k})]})})(),t.completedAt&&(()=>{const k=$p(t.startedAt,t.completedAt);return a.jsxs("div",{className:be.timelineRow,children:[a.jsx("span",{className:be.timelineKey,children:"Completed"}),a.jsx("span",{className:be.timelineValue,children:Zc(t.completedAt)}),k!==void 0&&a.jsx("span",{className:be.timelineDelta,children:k})]})})(),!t.createdAt&&!t.assignedAt&&!t.startedAt&&!t.completedAt&&a.jsx("div",{className:be.overviewMuted,children:"No timing data"})]})]}),u&&u.costMillicents>0&&a.jsxs("div",{className:be.overviewSection,"data-testid":"task-overview-usage",children:[a.jsx("div",{className:be.overviewLabel,children:"Usage"}),a.jsxs("div",{className:be.timeline,children:[a.jsxs("div",{className:be.timelineRow,children:[a.jsx("span",{className:be.timelineKey,children:"Cost"}),a.jsx("span",{className:be.timelineValue,children:Ms(u.costMillicents)}),a.jsxs("span",{className:be.timelineDelta,children:[u.sessionCount," session",u.sessionCount!==1?"s":""]})]}),p&&p.costMillicents>u.costMillicents&&a.jsxs("div",{className:be.timelineRow,children:[a.jsx("span",{className:be.timelineKey,children:"Total (incl. subtasks)"}),a.jsx("span",{className:be.timelineValue,children:Ms(p.costMillicents)}),a.jsxs("span",{className:be.timelineDelta,children:[p.sessionCount," session",p.sessionCount!==1?"s":""]})]})]})]}),(t.tokenBudget>0||t.costBudgetMillicents>0)&&a.jsxs("div",{className:be.overviewSection,"data-testid":"task-overview-budget",children:[a.jsx("div",{className:be.overviewLabel,children:"Budget"}),a.jsxs("div",{className:be.timeline,children:[t.tokenBudget>0&&a.jsxs("div",{className:be.timelineRow,children:[a.jsx("span",{className:be.timelineKey,children:"Tokens"}),a.jsxs("span",{className:be.timelineValue,children:[Po(((u==null?void 0:u.inputTokens)??0)+((u==null?void 0:u.outputTokens)??0))," / ",Po(t.tokenBudget)]})]}),t.costBudgetMillicents>0&&a.jsxs("div",{className:be.timelineRow,children:[a.jsx("span",{className:be.timelineKey,children:"Cost"}),a.jsxs("span",{className:be.timelineValue,children:[Ms((u==null?void 0:u.costMillicents)??0)," / ",Ms(t.costBudgetMillicents)]})]})]})]}),t.reviewNotes&&a.jsxs("div",{className:be.overviewSection,"data-testid":"task-overview-review-notes",children:[a.jsx("div",{className:be.overviewLabel,children:"Review Notes"}),a.jsx("div",{className:be.reviewNotes,children:t.reviewNotes})]})]})}function D8({plugins:t,loading:s,onSetPluginEnabled:o}){return a.jsxs("div",{className:pe.container,"data-testid":"plugins-panel",children:[a.jsx("h2",{className:pe.heading,children:"Plugins"}),a.jsxs("div",{className:pe.section,children:[a.jsx("p",{className:pe.sectionDescription,children:"Enable or disable optional Grackle plugins. A server restart is required for changes to take effect."}),s&&a.jsx("p",{className:pe.emptyState,children:"Loading plugins..."}),!s&&t.length===0&&a.jsx("p",{className:pe.emptyState,children:"No plugins found."}),!s&&t.map(r=>{const c=r.enabled!==r.loaded;return a.jsxs("div",{className:pe.tokenRow,"data-testid":`plugin-row-${r.name}`,children:[a.jsxs("div",{style:{flex:1},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[a.jsx("span",{className:pe.tokenName,children:r.name}),r.required&&a.jsx("span",{className:pe.tokenBadge,title:"Required — cannot be disabled",children:"required"})]}),a.jsx("div",{className:pe.tokenTarget,children:r.description}),c&&a.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"})]}),a.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:a.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)})]})]})}function M8({githubAccounts:t,githubAccountsLoading:s,onAddGitHubAccount:o,onUpdateGitHubAccount:r,onRemoveGitHubAccount:c,onImportGitHubAccounts:d,onShowToast:u}){const[p,m]=y.useState(""),[g,v]=y.useState(""),[_,b]=y.useState(!1),[x,k]=y.useState(!1),[j,w]=y.useState(!1),[T,C]=y.useState(null),D=t.find(A=>A.id===T),O=async A=>{if(A.preventDefault(),!(!p.trim()||!g.trim())){k(!0);try{await o(p.trim(),g.trim(),"",_),u==null||u("GitHub account added","success"),m(""),v(""),b(!1)}catch(P){const Y=P instanceof Error?P.message:"Failed to add account";u==null||u(Y,"error")}finally{k(!1)}}},E=async A=>{try{await r(A,{isDefault:!0}),u==null||u("Default account updated","success")}catch(P){const Y=P instanceof Error?P.message:"Failed to update account";u==null||u(Y,"error")}},M=async()=>{if(T)try{await c(T),u==null||u("GitHub account removed","info")}catch(A){const P=A instanceof Error?A.message:"Failed to remove account";u==null||u(P,"error")}finally{C(null)}},L=async()=>{w(!0);try{const A=await d();A.imported>0?u==null||u(`Imported ${A.imported} account(s): ${A.usernames.join(", ")}`,"success"):u==null||u("No new accounts to import","info")}catch(A){const P=A instanceof Error?A.message:"Import failed";u==null||u(P,"error")}finally{w(!1)}};return a.jsxs(a.Fragment,{children:[a.jsx(xs,{isOpen:T!==null,title:"Remove GitHub Account?",description:D?`"${D.label}"${D.username?` (@${D.username})`:""} will be permanently removed.`:void 0,onConfirm:()=>{M().catch(()=>{})},onCancel:()=>C(null)}),a.jsxs("section",{className:pe.section,"data-testid":"github-accounts-panel",children:[a.jsx("h3",{className:pe.sectionTitle,children:"GitHub Accounts"}),a.jsx("p",{className:pe.sectionDescription,children:"Register multiple GitHub accounts to use different identities per environment. The default account is used when no specific account is assigned."}),s&&t.length===0?a.jsx("div",{className:pe.emptyState,children:"Loading..."}):t.length===0?a.jsx("div",{className:pe.emptyStateInfo,children:"No GitHub accounts registered. Add one below or import from the gh CLI."}):a.jsx("div",{className:pe.tokenList,children:t.map(A=>a.jsxs("div",{className:pe.tokenRow,"data-testid":`github-account-row-${A.id}`,children:[A.isDefault&&a.jsx("span",{className:pe.tokenBadge,title:"Default account",children:"default"}),a.jsx("span",{className:pe.tokenName,children:A.label}),A.username&&a.jsxs("span",{className:pe.tokenTarget,children:["@",A.username]}),!A.isDefault&&a.jsx("button",{className:pe.deleteButton,onClick:()=>{E(A.id).catch(()=>{})},title:"Set as default","aria-label":`Set ${A.label} as default`,"data-testid":`github-account-set-default-${A.id}`,children:a.jsx(Zw,{size:Vt,"aria-hidden":"true"})}),a.jsx("button",{className:pe.deleteButton,onClick:()=>C(A.id),title:`Remove ${A.label}`,"aria-label":`Remove ${A.label}`,"data-testid":`github-account-remove-${A.id}`,children:a.jsx(Ls,{size:Vt,"aria-hidden":"true"})})]},A.id))}),a.jsxs("form",{className:pe.addForm,onSubmit:A=>{O(A).catch(()=>{})},children:[a.jsxs("div",{className:pe.formRow,children:[a.jsx("input",{className:pe.input,type:"text",placeholder:"Label (e.g. personal, work)",value:p,onChange:A=>m(A.target.value),"data-testid":"github-account-label-input"}),a.jsx("input",{className:pe.input,type:"password",placeholder:"Personal access token",value:g,onChange:A=>v(A.target.value),"data-testid":"github-account-token-input"})]}),a.jsxs("div",{className:pe.formRow,children:[a.jsxs("label",{className:pe.tokenTarget,style:{display:"flex",alignItems:"center",gap:"6px",cursor:"pointer"},children:[a.jsx("input",{type:"checkbox",checked:_,onChange:A=>b(A.target.checked),"data-testid":"github-account-default-checkbox"}),"Set as default"]}),a.jsx("button",{className:pe.addButton,type:"submit",disabled:!p.trim()||!g.trim()||x,"data-testid":"github-account-add-button",children:x?"Adding...":"Add Account"}),a.jsx("button",{className:pe.addButton,type:"button",onClick:()=>{L().catch(()=>{})},disabled:j,"data-testid":"github-account-import-button",children:j?"Importing...":"Import from gh CLI"})]})]})]})]})}const R8="_container_legrg_1",I8="_header_legrg_8",O8="_headerTitle_legrg_35",L8="_badge_legrg_44",B8="_headerActions_legrg_54",$8="_body_legrg_61",z8="_formContent_legrg_73",H8="_section_legrg_85",P8="_label_legrg_91",U8="_nameInput_legrg_98",V8="_fieldInput_legrg_131",q8="_adapterSelect_legrg_164",G8="_readOnlyValue_legrg_198",F8="_codespaceSection_legrg_204",K8="_codespaceActions_legrg_210",Z8="_creatingHint_legrg_216",Y8="_errorHint_legrg_222",J8="_btnPrimary_legrg_235",W8="_btnGhost_legrg_266",ie={container:R8,header:I8,headerTitle:O8,badge:L8,headerActions:B8,body:$8,formContent:z8,section:H8,label:P8,nameInput:U8,fieldInput:V8,adapterSelect:q8,readOnlyValue:G8,codespaceSection:F8,codespaceActions:K8,creatingHint:Z8,errorHint:Y8,btnPrimary:J8,btnGhost:W8},ld=1,cd=65535;function zp(t){if(!t.trim())return!0;const s=Number(t);return Number.isInteger(s)&&s>=ld&&s<=cd}function Hp(t){try{const s=JSON.parse(t);if(typeof s=="object"&&s!==null&&!Array.isArray(s))return s}catch{}return{}}function X8({codespaceName:t,onCodespaceNameChange:s,envName:o,onEnvNameChange:r,codespaces:c,codespaceError:d,codespaceListError:u,codespaceCreating:p,onCreateCodespace:m}){const[g,v]=y.useState("pick"),[_,b]=y.useState(""),[x,k]=y.useState("");return g==="create"?a.jsxs("div",{className:ie.codespaceSection,children:[a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,children:"Repository"}),a.jsx("input",{type:"text",value:_,onChange:j=>b(j.target.value),placeholder:"owner/repo",className:ie.fieldInput,"data-testid":"env-codespace-repo"})]}),a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,children:"Machine Type"}),a.jsx("input",{type:"text",value:x,onChange:j=>k(j.target.value),placeholder:"Machine type (optional)...",className:ie.fieldInput,"data-testid":"env-codespace-machine"})]}),a.jsxs("div",{className:ie.codespaceActions,children:[a.jsx("button",{onClick:()=>{_.trim()&&(m(_.trim(),x.trim()||void 0),v("pick"),b(""),k(""))},disabled:!_.trim(),className:ie.btnPrimary,children:"Create"}),a.jsx("button",{onClick:()=>{v("pick"),b(""),k("")},className:ie.btnGhost,children:"Cancel"})]})]}):a.jsx("div",{className:ie.codespaceSection,children:a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,children:"Codespace"}),!u&&a.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:ie.adapterSelect,"data-testid":"env-codespace-select",children:[a.jsx("option",{value:"",children:"Select a codespace..."}),c.map(j=>a.jsxs("option",{value:j.name,children:[j.name," (",j.repository,") — ",j.state]},j.name)),a.jsx("option",{value:"__create__",children:"Create new from repo..."})]}),p&&a.jsx("span",{className:ie.creatingHint,children:"Creating codespace..."}),u&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:ie.errorHint,children:u}),a.jsx("input",{type:"text",value:t,onChange:j=>s(j.target.value),placeholder:"Or enter codespace name manually...",className:ie.fieldInput,"data-testid":"env-codespace-manual"})]}),d&&!u&&a.jsx("span",{className:ie.errorHint,children:d})]})})}function ak({mode:t,environmentId:s,environments:o,githubAccounts:r,onAddEnvironment:c,onUpdateEnvironment:d,onListCodespaces:u,codespaces:p,codespaceError:m,codespaceListError:g,codespaceCreating:v,onCreateCodespace:_,onListDockerContainers:b,dockerContainers:x,dockerContainersError:k,onShowToast:j}){const w=ut(),T=t==="edit",C=T&&s?o.find(H=>H.id===s):void 0,[D,O]=y.useState(""),[E,M]=y.useState("local"),[L,A]=y.useState(""),[P,Y]=y.useState(""),[q,ee]=y.useState(""),[le,W]=y.useState(""),[re,$]=y.useState(""),[B,se]=y.useState(""),[oe,X]=y.useState(""),[ce,fe]=y.useState(""),[ge,Ae]=y.useState("create"),[vt,wt]=y.useState(""),[_e,qe]=y.useState(null),Bt=y.useCallback(()=>{const H={};if(E==="local"){if(L.trim()&&(H.host=L.trim()),P.trim()){const ve=Number(P);Number.isInteger(ve)&&(H.port=ve)}}else if(E==="ssh"){if(H.host=L.trim(),q.trim()&&(H.user=q.trim()),P.trim()){const ve=Number(P);Number.isInteger(ve)&&(H.sshPort=ve)}le.trim()&&(H.identityFile=le.trim())}else E==="docker"?ge==="attach"?vt.trim()&&(H.attach=vt.trim()):(re.trim()&&(H.image=re.trim()),B.trim()&&(H.repo=B.trim())):E==="codespace"&&(H.codespaceName=oe.trim());return H},[E,L,P,q,le,re,B,oe,ge,vt]),Wt=()=>!(!D.trim()||E==="ssh"&&!L.trim()||E==="codespace"&&!oe.trim()||E==="docker"&&ge==="attach"&&!vt.trim()||(E==="local"||E==="ssh")&&!zp(P)),de=()=>{Wt()&&(c(D.trim(),E,Bt(),ce||void 0),j==null||j("Environment added successfully","success"),w(Ho,{replace:!0}))},Ue=()=>{w(s?Li(s):Ho)},yt=y.useCallback((H,ve)=>{if(!C||!s)return;const tt=Hp(C.adapterConfig),Dt=ve.trim();Dt?tt[H]=Dt:delete tt[H],d(s,{adapterConfig:tt})},[C,s,d]),At=y.useCallback((H,ve)=>{if(!C||!s)return;const tt=Hp(C.adapterConfig);if(ve.trim()){const Dt=Number(ve);Number.isInteger(Dt)&&Dt>=ld&&Dt<=cd&&(tt[H]=Dt)}else delete tt[H];d(s,{adapterConfig:tt})},[C,s,d]);if(T){if(!C)return a.jsxs("div",{className:ie.container,children:[a.jsxs("div",{className:ie.header,children:[a.jsx("div",{className:ie.headerTitle,children:a.jsx("span",{className:ie.badge,children:"edit environment"})}),a.jsx("div",{className:ie.headerActions,children:a.jsx("button",{onClick:Ue,className:ie.btnGhost,children:"Back"})})]}),a.jsx("div",{className:ie.body,children:a.jsx("div",{className:ie.formContent,children:a.jsx("span",{className:ie.readOnlyValue,children:"Environment not found"})})})]});const H=Hp(C.adapterConfig);return a.jsxs("div",{className:ie.container,"data-testid":"env-edit-panel",children:[a.jsxs("div",{className:ie.header,children:[a.jsx("div",{className:ie.headerTitle,children:a.jsx("span",{className:ie.badge,children:"edit environment"})}),a.jsx("div",{className:ie.headerActions,children:a.jsx("button",{onClick:Ue,className:ie.btnGhost,"data-testid":"env-edit-back",children:"Back"})})]}),a.jsx("div",{className:ie.body,children:a.jsxs("div",{className:ie.formContent,children:[a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,children:"Name"}),a.jsx(Pt,{value:C.displayName,onSave:ve=>{s&&d(s,{displayName:ve})},validate:ve=>ve.trim()===""?"Name cannot be empty":void 0,mode:"edit",fieldId:"name",activeFieldId:_e,onActivate:qe,placeholder:"Environment name",ariaLabel:"Environment name","data-testid":"env-edit-name"})]}),a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,children:"Adapter Type"}),a.jsx("span",{className:ie.readOnlyValue,"data-testid":"env-edit-adapter-type",children:C.adapterType})]}),(C.adapterType==="codespace"||C.adapterType==="docker")&&(r.length>0||!!C.githubAccountId)&&a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,children:"GitHub Account"}),a.jsxs("select",{value:C.githubAccountId||"",onChange:ve=>{s&&d(s,{githubAccountId:ve.target.value})},className:ie.adapterSelect,"data-testid":"env-edit-github-account",children:[a.jsx("option",{value:"",children:"(Default)"}),r.map(ve=>a.jsxs("option",{value:ve.id,children:[ve.label,ve.username?` (@${ve.username})`:"",ve.isDefault?" — default":""]},ve.id))]})]}),C.adapterType==="local"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,children:"Host"}),a.jsx(Pt,{value:String(H.host??""),onSave:ve=>yt("host",ve),mode:"edit",fieldId:"host",activeFieldId:_e,onActivate:qe,placeholder:"(default)",ariaLabel:"Host","data-testid":"env-edit-host"})]}),a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,children:"Port"}),a.jsx(Pt,{value:String(H.port??""),onSave:ve=>At("port",ve),validate:ve=>zp(ve)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"port",activeFieldId:_e,onActivate:qe,placeholder:"(default)",ariaLabel:"Port","data-testid":"env-edit-port"})]})]}),C.adapterType==="ssh"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,children:"Host"}),a.jsx(Pt,{value:String(H.host??""),onSave:ve=>yt("host",ve),validate:ve=>ve.trim()===""?"Host is required":void 0,mode:"edit",fieldId:"host",activeFieldId:_e,onActivate:qe,placeholder:"hostname or IP",ariaLabel:"Host","data-testid":"env-edit-host"})]}),a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,children:"User"}),a.jsx(Pt,{value:String(H.user??""),onSave:ve=>yt("user",ve),mode:"edit",fieldId:"user",activeFieldId:_e,onActivate:qe,placeholder:"(default)",ariaLabel:"User","data-testid":"env-edit-user"})]}),a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,children:"SSH Port"}),a.jsx(Pt,{value:String(H.sshPort??""),onSave:ve=>At("sshPort",ve),validate:ve=>zp(ve)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"sshPort",activeFieldId:_e,onActivate:qe,placeholder:"22",ariaLabel:"SSH Port","data-testid":"env-edit-ssh-port"})]}),a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,children:"Identity File"}),a.jsx(Pt,{value:String(H.identityFile??""),onSave:ve=>yt("identityFile",ve),mode:"edit",fieldId:"identityFile",activeFieldId:_e,onActivate:qe,placeholder:"~/.ssh/id_rsa",ariaLabel:"Identity File","data-testid":"env-edit-identity-file"})]})]}),C.adapterType==="docker"&&H.attach!==void 0&&a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,children:"Attach (container)"}),a.jsx(Pt,{value:String(H.attach??""),onSave:ve=>yt("attach",ve),validate:ve=>ve.trim()===""?"Container name is required":void 0,mode:"edit",fieldId:"attach",activeFieldId:_e,onActivate:qe,placeholder:"container name or ID",ariaLabel:"Attach container","data-testid":"env-edit-attach"})]}),C.adapterType==="docker"&&H.attach===void 0&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,children:"Image"}),a.jsx(Pt,{value:String(H.image??""),onSave:ve=>yt("image",ve),mode:"edit",fieldId:"image",activeFieldId:_e,onActivate:qe,placeholder:"(default)",ariaLabel:"Image","data-testid":"env-edit-image"})]}),a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,children:"Repo"}),a.jsx(Pt,{value:String(H.repo??""),onSave:ve=>yt("repo",ve),mode:"edit",fieldId:"repo",activeFieldId:_e,onActivate:qe,placeholder:"(none)",ariaLabel:"Repo","data-testid":"env-edit-repo"})]})]}),C.adapterType==="codespace"&&a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,children:"Codespace Name"}),a.jsx(Pt,{value:String(H.codespaceName??""),onSave:ve=>yt("codespaceName",ve),validate:ve=>ve.trim()===""?"Codespace name is required":void 0,mode:"edit",fieldId:"codespaceName",activeFieldId:_e,onActivate:qe,placeholder:"codespace-name",ariaLabel:"Codespace Name","data-testid":"env-edit-codespace-name"})]})]})})]})}return a.jsxs("div",{className:ie.container,"data-testid":"env-create-panel",children:[a.jsxs("div",{className:ie.header,children:[a.jsx("div",{className:ie.headerTitle,children:a.jsx("span",{className:ie.badge,children:"new environment"})}),a.jsxs("div",{className:ie.headerActions,children:[a.jsx("button",{onClick:de,disabled:!Wt(),className:ie.btnPrimary,"data-testid":"env-create-submit",children:"Create"}),a.jsx("button",{onClick:Ue,className:ie.btnGhost,children:"Cancel"})]})]}),a.jsx("div",{className:ie.body,children:a.jsxs("div",{className:ie.formContent,children:[a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,htmlFor:"env-create-name",children:"Name"}),a.jsx("input",{id:"env-create-name",type:"text",value:D,onChange:H=>O(H.target.value),placeholder:"Environment name...",autoFocus:!0,className:ie.nameInput,"data-testid":"env-create-name",onKeyDown:H=>{H.key==="Enter"&&Wt()&&de()}})]}),a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,htmlFor:"env-create-adapter",children:"Adapter Type"}),a.jsxs("select",{id:"env-create-adapter",value:E,onChange:H=>{M(H.target.value),H.target.value==="codespace"&&u(ce||void 0)},className:ie.adapterSelect,"data-testid":"env-create-adapter",children:[a.jsx("option",{value:"local",children:"local"}),a.jsx("option",{value:"ssh",children:"ssh"}),a.jsx("option",{value:"docker",children:"docker"}),a.jsx("option",{value:"codespace",children:"codespace"})]})]}),(E==="codespace"||E==="docker")&&r.length>0&&a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,htmlFor:"env-create-github-account",children:"GitHub Account"}),a.jsxs("select",{id:"env-create-github-account",value:ce,onChange:H=>{fe(H.target.value),E==="codespace"&&u(H.target.value||void 0)},className:ie.adapterSelect,"data-testid":"env-create-github-account",children:[a.jsx("option",{value:"",children:"(Default)"}),r.map(H=>a.jsxs("option",{value:H.id,children:[H.label," (@",H.username,")",H.isDefault?" — default":""]},H.id))]})]}),E==="local"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,htmlFor:"env-create-host",children:"Host"}),a.jsx("input",{id:"env-create-host",type:"text",value:L,onChange:H=>A(H.target.value),placeholder:"Host (optional)...",className:ie.fieldInput,"data-testid":"env-create-host"})]}),a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,htmlFor:"env-create-port",children:"Port"}),a.jsx("input",{id:"env-create-port",type:"number",min:ld,max:cd,value:P,onChange:H=>Y(H.target.value),placeholder:"Port (optional)...",className:ie.fieldInput,"data-testid":"env-create-port"})]})]}),E==="ssh"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,htmlFor:"env-create-host",children:"Host"}),a.jsx("input",{id:"env-create-host",type:"text",value:L,onChange:H=>A(H.target.value),placeholder:"Host (required)...",className:ie.fieldInput,"data-testid":"env-create-host"})]}),a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,htmlFor:"env-create-user",children:"User"}),a.jsx("input",{id:"env-create-user",type:"text",value:q,onChange:H=>ee(H.target.value),placeholder:"User (optional)...",className:ie.fieldInput,"data-testid":"env-create-user"})]}),a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,htmlFor:"env-create-port",children:"SSH Port"}),a.jsx("input",{id:"env-create-port",type:"number",min:ld,max:cd,value:P,onChange:H=>Y(H.target.value),placeholder:"SSH port (optional)...",className:ie.fieldInput,"data-testid":"env-create-port"})]}),a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,htmlFor:"env-create-identity",children:"Identity File"}),a.jsx("input",{id:"env-create-identity",type:"text",value:le,onChange:H=>W(H.target.value),placeholder:"Identity file (optional)...",className:ie.fieldInput,"data-testid":"env-create-identity"})]})]}),E==="docker"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,htmlFor:"env-docker-mode",children:"Source"}),a.jsxs("select",{id:"env-docker-mode",value:ge,onChange:H=>{const ve=H.target.value;Ae(ve),ve==="attach"&&b()},className:ie.adapterSelect,"data-testid":"env-docker-mode",children:[a.jsx("option",{value:"create",children:"Create new container"}),a.jsx("option",{value:"attach",children:"Attach to existing container"})]})]}),ge==="create"?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,htmlFor:"env-create-image",children:"Image"}),a.jsx("input",{id:"env-create-image",type:"text",value:re,onChange:H=>$(H.target.value),placeholder:"Image (optional)...",className:ie.fieldInput,"data-testid":"env-create-image"})]}),a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,htmlFor:"env-create-repo",children:"Repo"}),a.jsx("input",{id:"env-create-repo",type:"text",value:B,onChange:H=>se(H.target.value),placeholder:"Repo (optional)...",className:ie.fieldInput,"data-testid":"env-create-repo"})]})]}):a.jsxs("div",{className:ie.section,children:[a.jsx("label",{className:ie.label,children:"Container"}),!k&&x.length>0&&a.jsxs("select",{value:vt,onChange:H=>{wt(H.target.value),H.target.value&&!D.trim()&&O(H.target.value)},className:ie.adapterSelect,"data-testid":"env-docker-container-select",children:[a.jsx("option",{value:"",children:"Select a container..."}),x.map(H=>a.jsxs("option",{value:H.name,children:[H.name," (",H.image,") ",H.status]},H.id))]}),(k||x.length===0)&&a.jsxs(a.Fragment,{children:[k?a.jsx("span",{className:ie.errorHint,children:k}):a.jsx("span",{className:ie.creatingHint,children:"No running containers found."}),a.jsx("input",{type:"text",value:vt,onChange:H=>{wt(H.target.value),H.target.value&&!D.trim()&&O(H.target.value)},placeholder:"Enter container name/ID...",className:ie.fieldInput,"data-testid":"env-docker-container-manual"})]})]})]}),E==="codespace"&&a.jsx(X8,{codespaceName:oe,onCodespaceNameChange:X,envName:D,onEnvNameChange:O,codespaces:p,codespaceError:m,codespaceListError:g,codespaceCreating:v,onCreateCodespace:_})]})})]})}const Q8="_group_1iprv_1",e7="_groupTitle_1iprv_8",t7="_shortcutList_1iprv_17",n7="_shortcutRow_1iprv_23",s7="_keys_1iprv_36",a7="_kbd_1iprv_43",i7="_description_1iprv_60",Ai={group:Q8,groupTitle:e7,shortcutList:t7,shortcutRow:n7,keys:s7,kbd:a7,description:i7},o7=[{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:"Root",shortcuts:[{keys:["Ctrl/Cmd","Enter"],description:"Send message (when the composer is focused)"},{keys:["Enter"],description:"Insert a new line in the message composer"}]}];function r7(){return a.jsxs("section",{className:pe.section,"data-testid":"keyboard-shortcuts-panel",children:[a.jsx("h3",{className:pe.sectionTitle,children:"Keyboard Shortcuts"}),a.jsx("p",{className:pe.sectionDescription,children:"Keyboard shortcuts for navigating and interacting with Grackle. Global shortcuts are suppressed while typing in text fields."}),o7.map(t=>a.jsxs("div",{className:Ai.group,children:[a.jsx("h4",{className:Ai.groupTitle,children:t.title}),a.jsx("div",{className:Ai.shortcutList,children:t.shortcuts.map(s=>a.jsxs("div",{className:Ai.shortcutRow,children:[a.jsx("span",{className:Ai.keys,children:s.keys.map(o=>a.jsx("kbd",{className:Ai.kbd,children:o},o))}),a.jsx("span",{className:Ai.description,children:s.description})]},s.description))})]},t.title))]})}const l7=[{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 c7({credentialProviders:t,onUpdateCredentialProviders:s}){const o=(r,c)=>{const d={...t};r==="claude"?d.claude=c:d[r]=c,s(d)};return a.jsxs("section",{className:pe.section,children:[a.jsx("h3",{className:pe.sectionTitle,children:"Credential Providers"}),a.jsx("p",{className:pe.sectionDescription,children:"Enable providers to automatically forward credentials to environments at task start. Credentials are read fresh from the host each time."}),a.jsx("div",{className:pe.tokenList,children:l7.map(r=>a.jsxs("div",{className:pe.tokenRow,children:[a.jsx("span",{className:pe.tokenName,children:r.label}),a.jsx("span",{className:pe.tokenTarget,children:r.description}),a.jsx("select",{className:pe.select,value:t[r.key],onChange:c=>o(r.key,c.target.value),children:r.options.map(c=>a.jsx("option",{value:c.value,children:c.label},c.value))})]},r.key))})]})}const d7="_container_10efq_1",u7="_header_10efq_7",f7="_list_10efq_105",p7="_card_10efq_111",m7="_cardHeader_10efq_125",h7="_cardTitle_10efq_135",g7="_defaultBadge_10efq_141",v7="_cardActions_10efq_155",y7="_description_10efq_160",b7="_meta_10efq_166",_7="_empty_10efq_212",x7="_typeBadge_10efq_362",ns={container:d7,header:u7,list:f7,card:p7,cardHeader:m7,cardTitle:h7,defaultBadge:g7,cardActions:v7,description:y7,meta:b7,empty:_7,typeBadge:x7};function k7({personas:t,appDefaultPersonaId:s,onDeletePersona:o,onSetAppDefaultPersonaId:r,onNavigateToNew:c,onNavigateToPersona:d}){const[u,p]=y.useState(null),m=u?t.find(v=>v.id===u):void 0,g=async v=>{await o(v),p(null)};return a.jsxs("div",{className:ns.container,children:[a.jsxs("div",{className:ns.header,children:[a.jsx("h2",{children:"Personas"}),a.jsx(cn,{variant:"primary",size:"md",onClick:c,"data-testid":"persona-new-button",children:"+ New Persona"})]}),t.length===0?a.jsx("p",{className:ns.empty,children:"No personas yet. Create one to get started."}):a.jsx("div",{className:ns.list,children:t.map(v=>{const _=s===v.id,b=v.type==="script";return a.jsxs("div",{className:ns.card,"data-testid":`persona-card-${v.id}`,onClick:()=>d(v.id),role:"button",tabIndex:0,onKeyDown:x=>{x.currentTarget===x.target&&(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),d(v.id))},children:[a.jsxs("div",{className:ns.cardHeader,children:[a.jsxs("span",{className:ns.cardTitle,children:[a.jsx("strong",{children:v.name}),a.jsx("span",{className:ns.typeBadge,"data-testid":`persona-type-badge-${v.id}`,children:b?"Script":"Agent"}),_&&a.jsx("span",{className:ns.defaultBadge,"data-testid":`persona-default-badge-${v.id}`,children:"App Default"})]}),a.jsxs("div",{className:ns.cardActions,onClick:x=>x.stopPropagation(),children:[!_&&a.jsx(cn,{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"}),a.jsx(cn,{variant:"ghost",size:"sm",onClick:()=>d(v.id),children:"Edit"}),a.jsx(cn,{variant:"ghost",size:"sm",onClick:()=>p(v.id),"data-testid":`persona-delete-${v.id}`,children:"Delete"})]})]}),v.description&&a.jsx("p",{className:ns.description,children:v.description}),a.jsxs("div",{className:ns.meta,children:[v.runtime&&a.jsxs("span",{children:["Runtime: ",v.runtime]}),v.model&&a.jsxs("span",{children:["Model: ",v.model]}),v.maxTurns>0&&a.jsxs("span",{children:["Max turns: ",v.maxTurns]})]})]},v.id)})}),a.jsx(xs,{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 S7="_container_uy08i_1",j7="_header_uy08i_7",w7="_count_uy08i_13",T7="_presets_uy08i_18",N7="_presetButton_uy08i_24",C7="_filterInput_uy08i_41",E7="_groups_uy08i_53",A7="_group_uy08i_53",D7="_groupHeader_uy08i_68",M7="_groupName_uy08i_77",R7="_groupCount_uy08i_81",I7="_toolList_uy08i_87",O7="_toolItem_uy08i_95",L7="_toolName_uy08i_103",xn={container:S7,header:j7,count:w7,presets:T7,presetButton:N7,filterInput:C7,groups:E7,group:A7,groupHeader:D7,groupName:M7,groupCount:R7,toolList:I7,toolItem:O7,toolName:L7},B7=(()=>{const t=new Map;for(const s of I_){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()}))})(),$7=[{name:"default",label:"Default",tools:R_},{name:"worker",label:"Worker",tools:Z2},{name:"orchestrator",label:"Orchestrator",tools:Y2},{name:"admin",label:"Admin",tools:J2}];function d_({selectedTools:t,onChange:s,disabled:o}){const[r,c]=y.useState(""),d=y.useMemo(()=>new Set(t),[t]),u=y.useCallback(v=>{if(o)return;const _=new Set(d);_.has(v)?_.delete(v):_.add(v),s([..._].sort())},[d,s,o]),p=y.useCallback((v,_)=>{if(o)return;const b=new Set(d);for(const x of v)_?b.delete(x):b.add(x);s([...b].sort())},[d,s,o]),m=y.useCallback(v=>{o||s([...v].sort())},[s,o]),g=r.toLowerCase();return a.jsxs("div",{className:xn.container,"data-testid":"mcp-tool-selector",children:[a.jsx("div",{className:xn.header,children:a.jsx("span",{className:xn.count,children:t.length===0?`Using default (${R_.length} tools)`:`${t.length} of ${I_.size} tools selected`})}),a.jsxs("div",{className:xn.presets,"data-testid":"mcp-tool-presets",children:[$7.map(v=>a.jsx("button",{type:"button",className:xn.presetButton,disabled:o,onClick:()=>m(v.tools),"data-testid":`preset-${v.name}`,children:v.label},v.name)),a.jsx("button",{type:"button",className:xn.presetButton,disabled:o,onClick:()=>s([]),"data-testid":"preset-clear",children:"Clear"})]}),a.jsx("input",{type:"text",className:xn.filterInput,placeholder:"Filter tools...",value:r,onChange:v=>c(v.target.value),disabled:o,"data-testid":"mcp-tool-filter"}),a.jsx("div",{className:xn.groups,children:B7.map(({group:v,tools:_})=>{const b=g?_.filter(k=>k.toLowerCase().includes(g)):_;if(b.length===0)return null;const x=b.every(k=>d.has(k));return a.jsxs("div",{className:xn.group,"data-testid":`tool-group-${v}`,children:[a.jsxs("label",{className:xn.groupHeader,children:[a.jsx("input",{type:"checkbox",checked:x,onChange:()=>p(b,x),disabled:o,"data-testid":`group-toggle-${v}`}),a.jsx("span",{className:xn.groupName,children:v}),a.jsxs("span",{className:xn.groupCount,children:["(",b.filter(k=>d.has(k)).length,"/",b.length,")"]})]}),a.jsx("div",{className:xn.toolList,children:b.map(k=>a.jsxs("label",{className:xn.toolItem,children:[a.jsx("input",{type:"checkbox",checked:d.has(k),onChange:()=>u(k),disabled:o,"data-testid":`tool-${k}`}),a.jsx("span",{className:xn.toolName,children:k})]},k))})]},v)})})]})}const z7="_container_1gfuq_1",H7="_header_1gfuq_7",P7="_list_1gfuq_19",U7="_card_1gfuq_25",V7="_cardHeader_1gfuq_40",q7="_cardTitle_1gfuq_46",G7="_statusBadge_1gfuq_56",F7="_enabled_1gfuq_68",K7="_disabled_1gfuq_71",Z7="_cardActions_1gfuq_75",Y7="_cardMeta_1gfuq_80",J7="_empty_1gfuq_98",ss={container:z7,header:H7,list:P7,card:U7,cardHeader:V7,cardTitle:q7,statusBadge:G7,enabled:F7,disabled:K7,cardActions:Z7,cardMeta:Y7,empty:J7};function W7({schedules:t,personas:s,onDeleteSchedule:o,onToggleEnabled:r,onNavigateToNew:c,onNavigateToSchedule:d}){const[u,p]=y.useState(null),m=u?t.find(b=>b.id===u):void 0,g=async b=>{await o(b),p(null)},v=y.useMemo(()=>{const b=new Map;for(const x of s)b.set(x.id,x.name);return b},[s]),_=b=>v.get(b)??b;return a.jsxs("div",{className:ss.container,children:[a.jsxs("div",{className:ss.header,children:[a.jsx("h2",{children:"Schedules"}),a.jsx(cn,{variant:"primary",size:"md",onClick:c,"data-testid":"schedule-new-button",children:"+ New Schedule"})]}),t.length===0?a.jsx("p",{className:ss.empty,"data-testid":"schedule-empty-state",children:"No schedules yet. Create one to run tasks on a recurring cadence."}):a.jsx("div",{className:ss.list,children:t.map(b=>a.jsxs("div",{className:ss.card,"data-testid":`schedule-card-${b.id}`,onClick:()=>d(b.id),role:"button",tabIndex:0,onKeyDown:x=>{x.currentTarget===x.target&&(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),d(b.id))},children:[a.jsxs("div",{className:ss.cardHeader,children:[a.jsxs("span",{className:ss.cardTitle,children:[a.jsx("strong",{children:b.title}),a.jsx("span",{className:`${ss.statusBadge} ${b.enabled?ss.enabled:ss.disabled}`,"data-testid":`schedule-status-badge-${b.id}`,children:b.enabled?"Enabled":"Disabled"})]}),a.jsxs("div",{className:ss.cardActions,onClick:x=>x.stopPropagation(),children:[a.jsx(cn,{variant:"ghost",size:"sm",onClick:()=>{(async()=>{await r(b.id,{enabled:!b.enabled})})().catch(()=>{})},"data-testid":`schedule-toggle-${b.id}`,title:b.enabled?"Disable schedule":"Enable schedule",children:b.enabled?"Disable":"Enable"}),a.jsx(cn,{variant:"ghost",size:"sm",onClick:()=>d(b.id),"data-testid":`schedule-edit-${b.id}`,children:"Edit"}),a.jsx(cn,{variant:"ghost",size:"sm",onClick:()=>p(b.id),"data-testid":`schedule-delete-${b.id}`,children:"Delete"})]})]}),a.jsxs("div",{className:ss.cardMeta,children:[a.jsx("span",{"data-testid":`schedule-expression-${b.id}`,children:b.scheduleExpression}),b.personaId&&a.jsxs("span",{"data-testid":`schedule-persona-${b.id}`,children:["Persona: ",_(b.personaId)]}),a.jsxs("span",{"data-testid":`schedule-last-run-${b.id}`,children:["Last run: ",b.lastRunAt?Go(b.lastRunAt):"Never"]}),b.enabled&&b.nextRunAt?a.jsxs("span",{"data-testid":`schedule-next-run-${b.id}`,children:["Next run: ",J1(b.nextRunAt)]}):null,b.runCount>0&&a.jsxs("span",{"data-testid":`schedule-run-count-${b.id}`,children:["Runs: ",b.runCount]})]})]},b.id))}),a.jsx(xs,{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 X7="_nav_1bhou_1",Q7="_tab_1bhou_24",e$="_tabIcon_1bhou_62",t$="_tabActive_1bhou_68",Yc={nav:X7,tab:Q7,tabIcon:e$,tabActive:t$},oa=[{path:"credentials",label:"Credentials",icon:a.jsx(pw,{size:kt})},{path:"github-accounts",label:"GitHub Accounts",icon:a.jsx(ow,{size:kt})},{path:"personas",label:"Personas",icon:a.jsx(Ww,{size:kt})},{path:"schedules",label:"Schedules",icon:a.jsx(Bj,{size:kt})},{path:"appearance",label:"Appearance",icon:a.jsx(Rw,{size:kt})},{path:"shortcuts",label:"Shortcuts",icon:a.jsx(hw,{size:kt})},{path:"plugins",label:"Plugins",icon:a.jsx(zw,{size:kt})},{path:"about",label:"About",icon:a.jsx(Tm,{size:kt})}];function n$(){var u;const t=an(),s=ut(),o=y.useRef(null),r=((u=oa.find(p=>{const m=`${Ii}/${p.path}`;return t.pathname===m||t.pathname.startsWith(`${m}/`)}))==null?void 0:u.path)??oa[0].path,c=y.useCallback(p=>{s(`${Ii}/${p}`)},[s]),d=y.useCallback(p=>{var x,k;const m=(x=o.current)==null?void 0:x.querySelectorAll('[role="tab"]');if(!m)return;const g=Array.from(m).findIndex(j=>j===document.activeElement),v=g>=0?g:oa.findIndex(j=>j.path===r);let _=v;if(p.key==="ArrowDown"||p.key==="j"||p.key==="J")p.preventDefault(),_=(v+1)%oa.length;else if(p.key==="ArrowUp"||p.key==="k"||p.key==="K")p.preventDefault(),_=(v-1+oa.length)%oa.length;else if(p.key==="Home")p.preventDefault(),_=0;else if(p.key==="End")p.preventDefault(),_=oa.length-1;else return;const b=oa[_].path;s(`${Ii}/${b}`),(k=m[_])==null||k.focus()},[r,s]);return a.jsx("nav",{className:Yc.nav,ref:o,role:"tablist","aria-orientation":"vertical","aria-label":"Settings",onKeyDown:d,children:oa.map(p=>{const m=p.path===r;return a.jsxs("button",{role:"tab",type:"button","aria-selected":m,tabIndex:m?0:-1,className:`${Yc.tab} ${m?Yc.tabActive:""}`,onClick:()=>c(p.path),children:[a.jsx("span",{className:Yc.tabIcon,"aria-hidden":"true",children:p.icon}),p.label]},p.path)})})}const s$=["lifecycle:","pipe:","stdin:"];function ik(t){return t.selfEcho?"chatroom":t.name.startsWith("pipe:")?"pipe":"channel"}function a$(t,s){let o=!1;for(const r of t.subscribers){const c=s.get(r.sessionId);if(c&&(o=!0,c.taskId))return{kind:"task",taskId:c.taskId}}return o?{kind:"unattached"}:{kind:"external"}}function i$(t,s){const o=new Map(s.map(u=>[u.id,u])),r=new Map,c=[];for(const u of t){const p=a$(u,o);if(p.kind==="task"){const m=r.get(p.taskId);m?m.push(u):r.set(p.taskId,[u])}else c.push(u)}const d=Array.from(r,([u,p])=>({taskId:u,streams:p}));return c.length>0&&d.push({taskId:void 0,streams:c}),d}const o$="_container_16qkd_1",r$="_header_16qkd_7",l$="_title_16qkd_15",c$="_headerActions_16qkd_21",d$="_internalsToggle_16qkd_27",u$="_refreshButton_16qkd_37",f$="_state_16qkd_52",p$="_group_16qkd_59",m$="_groupHeader_16qkd_63",h$="_row_16qkd_72",g$="_selected_16qkd_92",v$="_kindBadge_16qkd_96",y$="_kindChatroom_16qkd_108",b$="_kindPipe_16qkd_114",_$="_kindChannel_16qkd_120",x$="_streamName_16qkd_126",k$="_meta_16qkd_135",sn={container:o$,header:r$,title:l$,headerActions:c$,internalsToggle:d$,refreshButton:u$,state:f$,group:p$,groupHeader:m$,row:h$,selected:g$,kindBadge:v$,kindChatroom:y$,kindPipe:b$,kindChannel:_$,streamName:x$,meta:k$},S$={chatroom:"Chatroom",pipe:"Pipe",channel:"Channel"};function j$({kind:t}){return t==="chatroom"?a.jsx(Nw,{size:We,"aria-hidden":"true"}):t==="pipe"?a.jsx(aw,{size:We,"aria-hidden":"true"}):a.jsx(lw,{size:We,"aria-hidden":"true"})}function w$({streams:t,sessions:s,tasks:o,loading:r,loadError:c=!1,loadedOnce:d=!0,showInternals:u,onToggleInternals:p,selectedStreamId:m,onSelectStream:g,onRefresh:v}){const _=i$(t,s),b={chatroom:sn.kindChatroom,pipe:sn.kindPipe,channel:sn.kindChannel},x=k=>{var j;return((j=o.find(w=>w.id===k))==null?void 0:j.title)??k};return a.jsxs("div",{className:sn.container,"data-testid":"coordination-list",children:[a.jsxs("div",{className:sn.header,children:[a.jsx("span",{className:sn.title,children:"Coordination"}),a.jsxs("div",{className:sn.headerActions,children:[a.jsxs("label",{className:sn.internalsToggle,children:[a.jsx("input",{type:"checkbox",checked:u,onChange:k=>p(k.target.checked),"data-testid":"coordination-show-internals"}),"Show internals"]}),v&&a.jsx("button",{type:"button",className:sn.refreshButton,onClick:v,"aria-label":"Refresh streams","data-testid":"coordination-refresh",children:a.jsx(Pw,{size:We,"aria-hidden":"true"})})]})]}),r&&t.length===0&&a.jsxs("div",{className:sn.state,children:["Loading","…"]}),!r&&c&&a.jsx("div",{className:sn.state,"data-testid":"coordination-error",children:"Unable to load streams"}),!r&&!c&&d&&t.length===0&&a.jsx("div",{className:sn.state,"data-testid":"coordination-empty",children:"No active streams"}),_.map(k=>a.jsxs("div",{className:sn.group,children:[a.jsx("div",{className:sn.groupHeader,children:k.taskId?x(k.taskId):"Unattached / external (CLI · MCP)"}),k.streams.map(j=>{const w=ik(j),T=j.id===m;return a.jsxs("button",{type:"button",className:`${sn.row}${T?` ${sn.selected}`:""}`,onClick:()=>g(j.id),"data-testid":`coordination-row-${j.id}`,"aria-current":T?"page":void 0,children:[a.jsxs("span",{className:`${sn.kindBadge} ${b[w]}`,children:[a.jsx(j$,{kind:w})," ",S$[w]]}),a.jsx("span",{className:sn.streamName,children:j.name}),a.jsxs("span",{className:sn.meta,children:[j.subscriberCount," ",j.subscriberCount===1?"sub":"subs"," ","·"," ",j.messageBufferDepth," buffered"]})]},j.id)})]},k.taskId??"__orphans__"))]})}const T$="_panel_iibrt_1",N$="_header_iibrt_24",C$="_title_iibrt_33",E$="_closeButton_iibrt_43",A$="_body_iibrt_57",D$="_section_iibrt_63",M$="_sectionLabel_iibrt_67",R$="_metaRow_iibrt_76",I$="_metaKey_iibrt_84",O$="_metaValue_iibrt_90",L$="_subscriberCard_iibrt_99",B$="_subscriberHeader_iibrt_107",$$="_sessionLink_iibrt_114",z$="_badges_iibrt_132",H$="_badgeRw_iibrt_150 _badge_iibrt_132",P$="_badgeR_iibrt_150 _badge_iibrt_132",U$="_badgeW_iibrt_162 _badge_iibrt_132",V$="_badgeAsync_iibrt_168 _badge_iibrt_132",q$="_badgeSync_iibrt_174 _badge_iibrt_132",G$="_badgeDetach_iibrt_178 _badge_iibrt_132",F$="_spawnTag_iibrt_184 _badge_iibrt_132",K$="_fdNumber_iibrt_189",Z$="_emptySubscribers_iibrt_195",Y$="_metaValueMono_iibrt_201 _metaValue_iibrt_90",J$="_placeholder_iibrt_207",W$="_advanced_iibrt_216",X$="_advancedSummary_iibrt_220",Pe={panel:T$,header:N$,title:C$,closeButton:E$,body:A$,section:D$,sectionLabel:M$,metaRow:R$,metaKey:I$,metaValue:O$,subscriberCard:L$,subscriberHeader:B$,sessionLink:$$,badges:z$,badgeRw:H$,badgeR:P$,badgeW:U$,badgeAsync:V$,badgeSync:q$,badgeDetach:G$,spawnTag:F$,fdNumber:K$,emptySubscribers:Z$,metaValueMono:Y$,placeholder:J$,advanced:W$,advancedSummary:X$},Q$={chatroom:"Chatroom",pipe:"Pipe",channel:"Channel"};function ez({permission:t}){const s=t==="rw"?Pe.badgeRw:t==="r"?Pe.badgeR:Pe.badgeW;return a.jsx("span",{className:s,children:t})}function tz({mode:t}){const s=t==="async"?Pe.badgeAsync:t==="detach"?Pe.badgeDetach:Pe.badgeSync;return a.jsx("span",{className:s,children:t})}function nz({stream:t,onClose:s}){const o=ut();return y.useEffect(()=>{const r=c=>{c.key==="Escape"&&s()};return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}},[s]),a.jsxs("div",{className:Pe.panel,"data-testid":"stream-detail-panel",children:[a.jsxs("div",{className:Pe.header,children:[a.jsx("h3",{className:Pe.title,children:t.name}),a.jsx("button",{type:"button",className:Pe.closeButton,onClick:s,"aria-label":"Close stream details",children:"×"})]}),a.jsxs("div",{className:Pe.body,children:[a.jsxs("div",{className:Pe.section,children:[a.jsx("div",{className:Pe.sectionLabel,children:"Overview"}),a.jsxs("div",{className:Pe.metaRow,children:[a.jsx("span",{className:Pe.metaKey,children:"Kind"}),a.jsx("span",{className:Pe.metaValue,children:Q$[ik(t)]})]}),a.jsxs("div",{className:Pe.metaRow,children:[a.jsx("span",{className:Pe.metaKey,children:"Participants"}),a.jsx("span",{className:Pe.metaValue,children:t.subscriberCount})]}),a.jsxs("div",{className:Pe.metaRow,children:[a.jsx("span",{className:Pe.metaKey,children:"Buffered"}),a.jsxs("span",{className:Pe.metaValue,children:[t.messageBufferDepth," msgs"]})]})]}),a.jsxs("div",{className:Pe.section,children:[a.jsx("div",{className:Pe.sectionLabel,children:"Participants"}),t.subscribers.length===0?a.jsx("div",{className:Pe.emptySubscribers,children:"No active subscribers"}):t.subscribers.map(r=>a.jsxs("div",{className:Pe.subscriberCard,"data-testid":`subscriber-card-${r.subscriptionId}`,children:[a.jsxs("button",{type:"button",className:Pe.sessionLink,onClick:()=>{o(Ld(r.sessionId))},title:r.sessionId,children:[r.sessionId.slice(0,12),"…"]}),r.createdBySpawn&&a.jsx("span",{className:Pe.spawnTag,children:"spawn"})]},r.subscriptionId))]}),a.jsxs("div",{className:Pe.section,children:[a.jsx("div",{className:Pe.sectionLabel,children:"Conversation"}),a.jsx("div",{className:Pe.placeholder,"data-testid":"stream-conversation-placeholder",children:"Live conversation view — coming in V2."})]}),a.jsxs("details",{className:Pe.advanced,"data-testid":"stream-advanced",children:[a.jsx("summary",{className:Pe.advancedSummary,children:"Advanced"}),a.jsxs("div",{className:Pe.metaRow,children:[a.jsx("span",{className:Pe.metaKey,children:"Stream ID"}),a.jsx("span",{className:Pe.metaValueMono,children:t.id})]}),t.subscribers.map(r=>a.jsxs("div",{className:Pe.subscriberCard,children:[a.jsxs("div",{className:Pe.subscriberHeader,children:[a.jsxs("span",{className:Pe.fdNumber,children:["fd ",r.fd]}),a.jsxs("span",{className:Pe.metaValueMono,title:r.subscriptionId,children:[r.subscriptionId.slice(0,12),"…"]})]}),a.jsxs("div",{className:Pe.badges,children:[a.jsx(ez,{permission:r.permission}),a.jsx(tz,{mode:r.deliveryMode})]})]},r.subscriptionId))]})]})]})}function sz({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(Ny.map(d=>[d,[]]));for(const d of t){const u=ml(d.status),p=d.dependsOn.length>0&&d.dependsOn.some(k=>s.get(k)!=="complete"),m=r.get(d.id)??[],g=m.length,v=m.filter(k=>k.status==="complete").length;let _;if(u==="paused"&&o){const k=o.get(d.id);k==="idle"?_="Needs input":k==="completed"&&(_="Ready to complete")}const b={task:d,isBlocked:p,childCount:g,doneChildCount:v,pausedSubBadge:_},x=c.get(u);x?x.push(b):c.get("not_started").push(b)}for(const d of c.values())d.sort((u,p)=>u.task.sortOrder-p.task.sortOrder);return Ny.map(d=>{const u=Wa(d);return{status:d,label:u.label,style:u,tasks:c.get(d)??[]}})}const az="_boardContainer_1c4y1_1",iz="_column_1c4y1_17",oz="_columnHeader_1c4y1_34",rz="_columnIcon_1c4y1_47",lz="_columnLabel_1c4y1_52",cz="_columnCount_1c4y1_57",dz="_cardList_1c4y1_67",uz="_emptyPlaceholder_1c4y1_76",fz="_card_1c4y1_67",pz="_cardHeader_1c4y1_107",mz="_cardStatusIcon_1c4y1_113",hz="_cardTitle_1c4y1_119",gz="_cardBadges_1c4y1_127",vz="_badge_1c4y1_134",yz="_blockedBadge_1c4y1_146",bz="_childBadge_1c4y1_151",_z="_depBadge_1c4y1_155",xz="_parentBadge_1c4y1_159",kz="_pausedSubBadge_1c4y1_166",Sz="_personaBadge_1c4y1_170",jz="_envBadge_1c4y1_174",wz="_emptyCta_1c4y1_178",Tz="_ctaButton_1c4y1_188",Nz="_ctaDescription_1c4y1_204",lt={boardContainer:az,column:iz,columnHeader:oz,columnIcon:rz,columnLabel:lz,columnCount:cz,cardList:dz,emptyPlaceholder:uz,card:fz,cardHeader:pz,cardStatusIcon:mz,cardTitle:hz,cardBadges:gz,badge:vz,blockedBadge:yz,childBadge:bz,depBadge:_z,parentBadge:xz,pausedSubBadge:kz,personaBadge:Sz,envBadge:jz,emptyCta:wz,ctaButton:Tz,ctaDescription:Nz};function Cz({workspaceId:t,environmentId:s,tasks:o,sessions:r,personas:c,environments:d}){const u=ut(),p=y.useMemo(()=>o.filter(b=>b.workspaceId===t),[o,t]),m=y.useMemo(()=>new Map(o.map(b=>[b.id,b.status])),[o]),g=y.useMemo(()=>new Map(p.map(b=>[b.id,b])),[p]),v=y.useMemo(()=>{const b=new Map(r.map(C=>[C.id,C])),x=new Map(c.map(C=>[C.id,C])),k=new Map(d.map(C=>[C.id,C])),j=new Map,w=new Map,T=new Map;for(const C of p)if(C.latestSessionId){const D=b.get(C.latestSessionId);if(D){if(j.set(C.id,D.endReason||D.status),D.personaId){const O=x.get(D.personaId);O&&w.set(C.id,O.name)}if(D.environmentId){const O=k.get(D.environmentId);O&&T.set(C.id,O.displayName)}}}return{sessionStatusByTaskId:j,personaNameByTaskId:w,environmentNameByTaskId:T}},[p,r,c,d]),_=y.useMemo(()=>sz({tasks:p,taskStatusById:m,sessionStatusByTaskId:v.sessionStatusByTaskId}),[p,m,v]);return p.length===0?a.jsxs("div",{className:lt.emptyCta,"data-testid":"board-empty-cta",children:[a.jsx("button",{className:lt.ctaButton,onClick:()=>u(Hi(t,void 0,s)),children:"Create Task"}),a.jsx("div",{className:lt.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}):a.jsx("div",{className:lt.boardContainer,"data-testid":"board-container",children:_.map(b=>a.jsxs("section",{className:lt.column,"data-testid":`board-column-${b.status}`,"aria-label":`${b.label}, ${b.tasks.length} ${b.tasks.length===1?"task":"tasks"}`,children:[a.jsxs("div",{className:lt.columnHeader,children:[a.jsx("span",{className:lt.columnIcon,style:{color:b.style.color},children:b.style.icon}),a.jsx("span",{className:lt.columnLabel,children:b.label}),a.jsx("span",{className:lt.columnCount,"data-testid":`board-count-${b.status}`,children:b.tasks.length})]}),a.jsx("div",{className:lt.cardList,children:b.tasks.length===0?a.jsx("div",{className:lt.emptyPlaceholder,children:"No tasks"}):a.jsx(is,{mode:"popLayout",children:b.tasks.map(x=>a.jsx(Ct.div,{layout:!0,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},children:a.jsx(Ez,{boardTask:x,tasksById:g,personaName:v.personaNameByTaskId.get(x.task.id),envName:v.environmentNameByTaskId.get(x.task.id),onClick:()=>u(Pn(x.task.id,void 0,t,s))})},x.task.id))})})]},b.status))})}function Ez({boardTask:t,tasksById:s,personaName:o,envName:r,onClick:c}){const{task:d,isBlocked:u,childCount:p,doneChildCount:m,pausedSubBadge:g}=t,v=Wa(d.status),_=d.parentTaskId?s.get(d.parentTaskId):void 0;return a.jsxs("div",{className:lt.card,tabIndex:0,role:"button","data-testid":`board-card-${d.id}`,onClick:c,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),c())},children:[a.jsxs("div",{className:lt.cardHeader,children:[a.jsx("span",{className:lt.cardStatusIcon,style:{color:v.color},children:v.icon}),a.jsx("span",{className:lt.cardTitle,children:d.title})]}),a.jsxs("div",{className:lt.cardBadges,children:[_&&a.jsx("span",{className:`${lt.badge} ${lt.parentBadge}`,title:_.title,children:_.title}),p>0&&a.jsxs("span",{className:`${lt.badge} ${lt.childBadge}`,children:[m,"/",p]}),u&&a.jsx("span",{className:`${lt.badge} ${lt.blockedBadge}`,children:"blocked"}),d.dependsOn.length>0&&!u&&a.jsx("span",{className:`${lt.badge} ${lt.depBadge}`,children:"dep"}),g&&a.jsx("span",{className:`${lt.badge} ${lt.pausedSubBadge}`,children:g}),o&&a.jsx("span",{className:`${lt.badge} ${lt.personaBadge}`,children:o}),r&&a.jsx("span",{className:`${lt.badge} ${lt.envBadge}`,children:r})]})]})}const Az="_formContent_ymnez_1",Dz="_section_ymnez_13",Mz="_label_ymnez_19",Rz="_titleInput_ymnez_26",Iz="_descriptionTextarea_ymnez_58",Oz="_selectField_ymnez_94",Lz="_checkboxRow_ymnez_128",Bz="_checkboxLabel_ymnez_141",$z="_fieldError_ymnez_146",xt={formContent:Az,section:Dz,label:Mz,titleInput:Rz,descriptionTextarea:Iz,selectField:Oz,checkboxRow:Lz,checkboxLabel:Bz,fieldError:$z};function zz(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 Hz=100;function Pz({values:t,onChange:s,environments:o,personas:r,errors:c,disabled:d,autoFocusName:u}){const p=(m,g)=>{s({...t,[m]:g})};return a.jsxs("div",{className:xt.formContent,children:[a.jsxs("div",{className:xt.section,children:[a.jsx("label",{className:xt.label,htmlFor:"ws-name",children:"Name"}),a.jsx("input",{id:"ws-name",className:xt.titleInput,type:"text",value:t.name,onChange:m=>p("name",m.target.value),placeholder:"Workspace name",maxLength:Hz,autoFocus:u,disabled:d,"data-testid":"workspace-form-name"}),(c==null?void 0:c.name)&&a.jsx("span",{className:xt.fieldError,"data-testid":"workspace-form-error-name",children:c.name})]}),a.jsxs("div",{className:xt.section,children:[a.jsx("label",{className:xt.label,htmlFor:"ws-description",children:"Description"}),a.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"})]}),a.jsxs("div",{className:xt.section,children:[a.jsx("label",{className:xt.label,htmlFor:"ws-repo",children:"Repository URL"}),a.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)&&a.jsx("span",{className:xt.fieldError,"data-testid":"workspace-form-error-repoUrl",children:c.repoUrl})]}),a.jsxs("div",{className:xt.section,children:[a.jsx("label",{className:xt.label,htmlFor:"ws-environment",children:"Environment"}),a.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:[a.jsx("option",{value:"",children:"Select environment…"}),o.map(m=>a.jsx("option",{value:m.id,children:m.displayName||m.id},m.id))]}),(c==null?void 0:c.environmentId)&&a.jsx("span",{className:xt.fieldError,"data-testid":"workspace-form-error-environmentId",children:c.environmentId})]}),a.jsxs("div",{className:xt.section,children:[a.jsx("label",{className:xt.label,htmlFor:"ws-persona",children:"Default Persona"}),a.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:[a.jsx("option",{value:"",children:"(Inherit)"}),r.map(m=>a.jsx("option",{value:m.id,children:m.name},m.id))]})]}),a.jsx("div",{className:xt.section,children:a.jsxs("label",{className:xt.checkboxRow,children:[a.jsx("input",{type:"checkbox",checked:t.useWorktrees,onChange:m=>p("useWorktrees",m.target.checked),disabled:d,"data-testid":"workspace-form-worktrees"}),a.jsx("span",{className:xt.checkboxLabel,children:"Enable worktree isolation"})]})}),a.jsxs("div",{className:xt.section,children:[a.jsx("label",{className:xt.label,htmlFor:"ws-workdir",children:"Working Directory"}),a.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 ok=y.createContext(void 0),Uz=4e3;function Vz({children:t}){const[s,o]=y.useState([]),r=y.useRef(0),c=y.useCallback(u=>{o(p=>p.filter(m=>m.id!==u))},[]),d=y.useCallback((u,p="info",m=Uz)=>{const g=`toast-${++r.current}`;o(v=>[...v,{id:g,message:u,variant:p,duration:m}])},[]);return a.jsx(ok.Provider,{value:{toasts:s,showToast:d,dismissToast:c},children:t})}function gn(){const t=y.useContext(ok);if(!t)throw new Error("useToast must be used within ToastProvider");return t}const xm="grackle-theme",rk="grackle-prefer-system",lk="(prefers-color-scheme: dark)";let Xr=[],dd;function Pp(){dd=void 0;for(const t of Xr)t()}function km(){return typeof window>"u"?!1:window.matchMedia(lk).matches}function al(){if(typeof localStorage>"u")return l_;try{const t=localStorage.getItem(xm);if(t!==null&&nk.has(t))return t}catch{}return l_}function wd(){if(typeof localStorage>"u")return!1;try{return localStorage.getItem(rk)==="true"}catch{return!1}}function Sm(t){return Gd.find(s=>s.variantLightId===t||s.variantDarkId===t)}function ck(t,s){const o=_m(t);if(o!=null&&o.variantDarkId)return s&&o.variantLightId?km()?o.variantDarkId:o.variantLightId:o.variantDarkId;if(o!=null&&o.hidden&&s){const r=Sm(t);if(r!=null&&r.variantLightId&&r.variantDarkId)return km()?r.variantDarkId:r.variantLightId}return t}function Io(t,s,o=!1){o&&document.documentElement.classList.add("no-transitions"),document.documentElement.dataset.theme=ck(t,s),o&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove("no-transitions")}))}typeof document<"u"&&Io(al(),wd());function qz(){return dd===void 0&&(dd={themeId:al(),systemDark:km(),preferSystem:wd()}),dd}function Gz(t){return Xr=[...Xr,t],()=>{Xr=Xr.filter(s=>s!==t)}}function Fz(){const t=y.useSyncExternalStore(Gz,qz),{themeId:s,preferSystem:o}=t,r=ck(s,o),c=y.useCallback(u=>{if(nk.has(u)){try{localStorage.setItem(xm,u)}catch{}Io(u,wd(),!0),Pp()}},[]),d=y.useCallback(u=>{try{localStorage.setItem(rk,u?"true":"false")}catch{}if(u){const p=al(),m=_m(p);if(m!=null&&m.hidden){const g=Sm(p);if(g)try{localStorage.setItem(xm,g.id)}catch{}}}Io(al(),u,!0),Pp()},[]);return y.useEffect(()=>{Io(s,o)},[s,o]),y.useEffect(()=>{if(typeof window>"u")return;const u=window.matchMedia(lk),p=()=>{const m=al(),g=wd();if(g){const v=_m(m);if(v!=null&&v.variantDarkId&&v.variantLightId&&Io(m,g),v!=null&&v.hidden){const _=Sm(m);_!=null&&_.variantDarkId&&_.variantLightId&&Io(m,g)}}Pp()};return u.addEventListener("change",p),()=>{u.removeEventListener("change",p)}},[]),{themeId:s,setTheme:c,resolvedThemeId:r,preferSystem:o,setPreferSystem:d}}const dk=y.createContext(void 0);function Kz({children:t}){const s=Fz();return a.jsx(dk.Provider,{value:s,children:t})}function uk(){const t=y.useContext(dk);if(!t)throw new Error("useThemeContext must be used within ThemeProvider");return t}const fk=y.createContext(void 0),pk=y.createContext(void 0);function Zz({children:t}){const[s,o]=y.useState(void 0),r=y.useCallback(c=>{o(c)},[]);return a.jsx(pk.Provider,{value:r,children:a.jsx(fk.Provider,{value:s,children:t})})}function Yz(){return y.useContext(fk)}function Jz(){const t=y.useContext(pk);if(t===void 0)throw new Error("useSidebarSetter must be used within a SidebarProvider");return t}const _h=y.createContext(void 0);function ot(){const t=y.useContext(_h);if(!t)throw new Error("useGrackle must be used within GrackleProvider");return t}function mk(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function hk(t,s){return console.warn(`[ws] Malformed "${t}" message: ${s}`),!1}function Wz(t){return mk(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 Xz=new Set(["off","subscription","api_key"]),Jc=new Set(["off","on"]);function Qz(t){return mk(t)&&Xz.has(t.claude)&&Jc.has(t.github)&&Jc.has(t.copilot)&&Jc.has(t.codex)&&Jc.has(t.goose)}function gk(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 vk(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 Ro=5e3;function eH(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 ha={label:"Home",url:Zo};function tH(t){return t?[ha,{label:"Settings",url:Ii},{label:t,url:void 0}]:[ha,{label:"Settings",url:void 0}]}const xh={label:"Environments",url:Ho};function nH(){return[ha,{label:"Environments",url:void 0}]}function sH(){return[ha,{label:"New Chat",url:void 0}]}function aH(t){return[ha,{label:`Session ${t.slice(0,8)}`,url:void 0}]}function iH(t,s,o,r){const c=o.find(u=>u.id===t),d=r.find(u=>u.id===s);return[ha,xh,{label:(d==null?void 0:d.displayName)??"Environment",url:Li(s)},{label:(c==null?void 0:c.name)??"Workspace",url:void 0}]}function oH(t,s,o,r,c){const d=eH(t,c),u=c.get(t),p=u==null?void 0:u.workspaceId,m=p?o.find(x=>x.id===p):void 0,g=s??(m==null?void 0:m.linkedEnvironmentIds[0]),v=g?r.find(x=>x.id===g):void 0,_=[ha];v&&g&&(_.push(xh),_.push({label:v.displayName,url:Li(g)})),m&&g&&_.push({label:m.name,url:Xa(m.id,g)});for(let x=0;x<d.length-1;x++)_.push({label:d[x].title,url:Pn(d[x].id,void 0,p,g)});const b=d[d.length-1];return _.push({label:(b==null?void 0:b.title)??t,url:void 0}),_}const rH={label:"Findings",url:Bd};function lH(){return[ha,{label:"Findings",url:void 0}]}function yk(t,s,o,r,c){const d=[ha];if(s&&o){const u=r.find(m=>m.id===s),p=c.find(m=>m.id===o);d.push(xh),p&&d.push({label:p.displayName,url:Li(o)}),u&&d.push({label:u.name,url:Xa(s,o)}),d.push({label:"Findings",url:oC(s,o)})}else d.push(rH);return d.push({label:t,url:void 0}),d}function kh(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 Wc(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 cH(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 Sh(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 _=s.get(v),b=_?Wc(_):void 0;if(b)try{const x=JSON.parse(v.content);o.set(b,{tool:x.tool,args:x.args})}catch{}}const r=new Set,c=new Set,d=t.map((v,_)=>{if(v.eventType!=="tool_result")return v;const b=s.get(v),x=b?cH(b):void 0;if(!x)return v;const k=o.get(x);if(!k)return v;r.add(x),c.add(_);let j;const w=v.content.trim();if(w.startsWith("{"))try{const T=JSON.parse(w);typeof T.detailedContent=="string"&&(j=T.detailedContent)}catch{}return{...v,toolUseCtx:{...k,detailedResult:j}}}),u=[];for(let v=0;v<d.length;v++){if(d[v].eventType!=="tool_use")continue;const _=s.get(d[v]),b=_?Wc(_):void 0;b&&r.has(b)||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 _=p[m];if(_!==v+1)continue;const b=d[v],x=d[_];let k;try{const j=JSON.parse(b.content);k={tool:j.tool,args:j.args}}catch{}if(k){let j;const w=x.content.trim();if(w.startsWith("{"))try{const D=JSON.parse(w);typeof D.detailedContent=="string"&&(j=D.detailedContent)}catch{}d[_]={...x,toolUseCtx:{...k,detailedResult:j}},c.add(_);const T=s.get(b),C=T?Wc(T):void 0;C?r.add(C):(r.add(`__seq_${v}`),s.set(b,{...T??{},__seqId:`__seq_${v}`})),m++}}const g=d.filter(v=>{if(v.eventType!=="tool_use")return!0;const _=s.get(v);if(!_)return!0;const b=Wc(_);if(b&&r.has(b))return!1;const x=_.__seqId;return!(x&&r.has(x))});for(let v=0;v<g.length;v++){if(g[v].eventType!=="tool_use")continue;let _=!1;for(let b=v+1;b<g.length;b++)if(g[b].eventType!=="tool_use"){_=!0;break}_&&(g[v]={...g[v],settled:!0})}return g}function dH(t,s,o){const r=t.filter(m=>m.status==="running"||m.status==="idle"||m.status==="waiting").length,c=bk(s),d=s.filter(m=>jm(m,c)).length,u=s.filter(m=>m.status==="paused"||m.status==="failed"||jm(m,c)).length,p=o.filter(m=>m.status==="disconnected"||m.status==="error").length;return{activeSessions:r,blockedTasks:d,attentionTasks:u,unhealthyEnvironments:p}}function bk(t){const s=new Map;for(const o of t)s.set(o.id,o.status);return s}function jm(t,s){return t.dependsOn.some(o=>s.get(o)!=="complete")}function uH(t,s){var u;const o=new Map;for(const p of s)o.set(p.id,p);const r=bk(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}):jm(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 fH(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 pH(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 As=[{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
|
|
329
|
+
export function verifyToken(req: Request, res: Response, next: NextFunction): void {
|
|
330
|
+
const header = req.headers.authorization;
|
|
331
|
+
if (!header?.startsWith("Bearer ")) {
|
|
332
|
+
res.status(401).json({ error: "Missing token" });
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
const decoded = jwt.verify(header.slice(7), JWT_SECRET) as JwtPayload;
|
|
336
|
+
req.user = decoded;
|
|
337
|
+
next();
|
|
338
|
+
}
|
|
339
|
+
\`\`\``,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
|
|
340
|
+
CREATE TABLE audit_log (
|
|
341
|
+
id BIGSERIAL PRIMARY KEY,
|
|
342
|
+
user_id UUID REFERENCES users(id),
|
|
343
|
+
action TEXT NOT NULL,
|
|
344
|
+
entity_type TEXT NOT NULL,
|
|
345
|
+
entity_id TEXT NOT NULL,
|
|
346
|
+
old_value JSONB,
|
|
347
|
+
new_value JSONB,
|
|
348
|
+
ip_address INET,
|
|
349
|
+
created_at TIMESTAMPTZ DEFAULT now()
|
|
350
|
+
);
|
|
351
|
+
\`\`\``,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}],Fa=[{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"}],mH=new Map(As.map(t=>[t.id,t]));function Up(t){const s=mH.get(t);if(!s)throw new Error(`MOCK_KNOWLEDGE_NODES is missing node "${t}"`);return s}const u_={"kn-auth-flow":{node:Up("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:Up("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:Up("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"}]}},f_=[{id:"stream-planning",name:"jwt-planning-room",selfEcho:!0,subscriberCount:2,messageBufferDepth:3,subscribers:[{subscriptionId:"sub-p1",sessionId:"sess-001",fd:3,permission:"rw",deliveryMode:"async",createdBySpawn:!1},{subscriptionId:"sub-p2",sessionId:"sess-002",fd:4,permission:"r",deliveryMode:"async",createdBySpawn:!0}]},{id:"stream-metrics",name:"rate-limit-metrics",selfEcho:!1,subscriberCount:1,messageBufferDepth:0,subscribers:[{subscriptionId:"sub-m1",sessionId:"sess-004",fd:3,permission:"r",deliveryMode:"sync",createdBySpawn:!1}]},{id:"stream-cli",name:"cli-inspector",selfEcho:!1,subscriberCount:1,messageBufferDepth:1,subscribers:[{subscriptionId:"sub-c1",sessionId:"external-cli-session",fd:5,permission:"rw",deliveryMode:"async",createdBySpawn:!1}]},{id:"stream-lifecycle",name:"lifecycle:sess-001-7f3a",selfEcho:!1,subscriberCount:1,messageBufferDepth:0,subscribers:[{subscriptionId:"sub-l1",sessionId:"sess-001",fd:6,permission:"rw",deliveryMode:"detach",createdBySpawn:!0}]},{id:"stream-pipe",name:"pipe:sess-001-sess-004",selfEcho:!1,subscriberCount:2,messageBufferDepth:0,subscribers:[{subscriptionId:"sub-pp1",sessionId:"sess-001",fd:7,permission:"rw",deliveryMode:"async",createdBySpawn:!1},{subscriptionId:"sub-pp2",sessionId:"sess-004",fd:8,permission:"rw",deliveryMode:"async",createdBySpawn:!0}]},{id:"stream-stdin",name:"stdin:sess-002-9c2e",selfEcho:!1,subscriberCount:1,messageBufferDepth:0,subscribers:[{subscriptionId:"sub-s1",sessionId:"sess-002",fd:9,permission:"w",deliveryMode:"detach",createdBySpawn:!0}]}],hH=[{id:"env-local-01",displayName:"Local Dev",adapterType:"local",adapterConfig:"{}",status:"connected",bootstrapped:!0,githubAccountId:""},{id:"env-docker-01",displayName:"Docker Sandbox",adapterType:"docker",adapterConfig:'{"image":"node:20"}',status:"connected",bootstrapped:!0,githubAccountId:""},{id:"env-cs-01",displayName:"GitHub Codespace",adapterType:"codespace",adapterConfig:'{"codespaceName":"my-codespace"}',status:"connected",bootstrapped:!0,githubAccountId:""},{id:"env-remote-01",displayName:"Staging (SSH)",adapterType:"ssh",adapterConfig:'{"host":"192.168.1.10","user":"deploy","sshPort":22}',status:"disconnected",bootstrapped:!1,githubAccountId:""},{id:"error-env",displayName:"Error Test",adapterType:"local",adapterConfig:"{}",status:"connected",bootstrapped:!0,githubAccountId:""}],gH=[{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",taskId:"task-001",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",taskId:"task-003",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",taskId:"task-006c",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}],vH=[{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.
|
|
352
|
+
Project: acme/alpha — Node.js + Express REST API
|
|
353
|
+
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";
|
|
354
|
+
import type { Request, Response, NextFunction } from "express";
|
|
355
|
+
|
|
356
|
+
export function requireAuth(req: Request, res: Response, next: NextFunction): void {
|
|
357
|
+
if (!req.session?.userId) {
|
|
358
|
+
res.status(401).json({ error: "Not authenticated" });
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
next();
|
|
362
|
+
}`,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) {
|
|
363
|
+
src/routes/login.ts:18: req.session.userId = user.id;
|
|
364
|
+
src/routes/login.ts:19: req.session.role = user.role;
|
|
365
|
+
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";
|
|
366
|
+
import bcrypt from "bcrypt";
|
|
367
|
+
import { db } from "../db.js";
|
|
368
|
+
|
|
369
|
+
const router = Router();
|
|
370
|
+
|
|
371
|
+
router.post("/login", async (req, res) => {
|
|
372
|
+
const { email, password } = req.body;
|
|
373
|
+
const user = await db.users.findByEmail(email);
|
|
374
|
+
if (!user || !await bcrypt.compare(password, user.passwordHash)) {
|
|
375
|
+
return res.status(401).json({ error: "Invalid credentials" });
|
|
376
|
+
}
|
|
377
|
+
req.session.userId = user.id;
|
|
378
|
+
req.session.role = user.role;
|
|
379
|
+
res.json({ ok: true });
|
|
380
|
+
});
|
|
381
|
+
|
|
382
|
+
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.
|
|
383
|
+
Project: acme/alpha — Node.js + Express REST API
|
|
384
|
+
Task: Implement auth middleware using JWT tokens
|
|
385
|
+
|
|
386
|
+
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:"user_input",timestamp:"2026-02-27T08:15:03Z",content:"Pick up the **JWT auth migration** from the previous session. A few requirements:\n\n- use `jsonwebtoken`, not `jose`\n- access tokens expire in `24h`\n- store refresh tokens in the DB\n\nMake sure the existing tests still pass."},{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
|
|
387
|
+
src/routes/login.ts
|
|
388
|
+
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
|
|
389
|
+
|
|
390
|
+
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";
|
|
391
|
+
import type { Request, Response, NextFunction } from "express";
|
|
392
|
+
|
|
393
|
+
const JWT_SECRET = process.env.JWT_SECRET || "change-me";
|
|
394
|
+
|
|
395
|
+
export interface JwtPayload {
|
|
396
|
+
userId: string;
|
|
397
|
+
role: string;
|
|
398
|
+
iat: number;
|
|
399
|
+
exp: number;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
export function verifyToken(req: Request, res: Response, next: NextFunction): void {
|
|
403
|
+
const header = req.headers.authorization;
|
|
404
|
+
if (!header?.startsWith("Bearer ")) {
|
|
405
|
+
res.status(401).json({ error: "Missing or malformed token" });
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
try {
|
|
409
|
+
const decoded = jwt.verify(header.slice(7), JWT_SECRET) as JwtPayload;
|
|
410
|
+
req.user = decoded;
|
|
411
|
+
next();
|
|
412
|
+
} catch (err) {
|
|
413
|
+
if (err instanceof jwt.TokenExpiredError) {
|
|
414
|
+
res.status(401).json({ error: "Token expired" });
|
|
415
|
+
} else {
|
|
416
|
+
res.status(403).json({ error: "Invalid token" });
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
`}}),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.
|
|
421
|
+
|
|
422
|
+
The new login flow will:
|
|
423
|
+
1. Validate credentials (unchanged)
|
|
424
|
+
2. Generate a JWT with \`userId\` and \`role\` claims
|
|
425
|
+
3. Return the token in the response body
|
|
426
|
+
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";
|
|
427
|
+
import bcrypt from "bcrypt";
|
|
428
|
+
import jwt from "jsonwebtoken";
|
|
429
|
+
import crypto from "node:crypto";
|
|
430
|
+
import { db } from "../db.js";
|
|
431
|
+
|
|
432
|
+
const JWT_SECRET = process.env.JWT_SECRET || "change-me";
|
|
433
|
+
const ACCESS_TOKEN_EXPIRY = "24h";
|
|
434
|
+
const REFRESH_TOKEN_BYTES = 48;
|
|
435
|
+
|
|
436
|
+
const router = Router();
|
|
437
|
+
|
|
438
|
+
router.post("/login", async (req, res) => {
|
|
439
|
+
const { email, password } = req.body;
|
|
440
|
+
const user = await db.users.findByEmail(email);
|
|
441
|
+
if (!user || !(await bcrypt.compare(password, user.passwordHash))) {
|
|
442
|
+
return res.status(401).json({ error: "Invalid credentials" });
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
const accessToken = jwt.sign(
|
|
446
|
+
{ userId: user.id, role: user.role },
|
|
447
|
+
JWT_SECRET,
|
|
448
|
+
{ expiresIn: ACCESS_TOKEN_EXPIRY },
|
|
449
|
+
);
|
|
450
|
+
|
|
451
|
+
const refreshToken = crypto.randomBytes(REFRESH_TOKEN_BYTES).toString("hex");
|
|
452
|
+
await db.refreshTokens.create({ userId: user.id, token: refreshToken });
|
|
453
|
+
|
|
454
|
+
res.json({ accessToken, refreshToken, expiresIn: ACCESS_TOKEN_EXPIRY });
|
|
455
|
+
});
|
|
456
|
+
|
|
457
|
+
export default router;
|
|
458
|
+
`}}),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
|
|
459
|
+
PASS src/routes/__tests__/protected.test.ts
|
|
460
|
+
FAIL src/middleware/__tests__/auth.test.ts
|
|
461
|
+
x should reject missing session (12ms)
|
|
462
|
+
x should allow valid session (8ms)
|
|
463
|
+
|
|
464
|
+
2 failed, 12 passed, 14 total
|
|
465
|
+
|
|
466
|
+
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.
|
|
467
|
+
|
|
468
|
+
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";
|
|
469
|
+
import jwt from "jsonwebtoken";
|
|
470
|
+
import { verifyToken } from "../auth.js";
|
|
471
|
+
import { createMockReqRes } from "../../test-utils/mock-express.js";
|
|
472
|
+
|
|
473
|
+
const SECRET = "test-secret";
|
|
474
|
+
process.env.JWT_SECRET = SECRET;
|
|
475
|
+
|
|
476
|
+
describe("verifyToken", () => {
|
|
477
|
+
it("should reject requests without Authorization header", () => {
|
|
478
|
+
const { req, res, next } = createMockReqRes();
|
|
479
|
+
verifyToken(req, res, next);
|
|
480
|
+
expect(res.status).toHaveBeenCalledWith(401);
|
|
481
|
+
});
|
|
482
|
+
|
|
483
|
+
it("should reject expired tokens", () => {
|
|
484
|
+
const token = jwt.sign({ userId: "u1", role: "user" }, SECRET, { expiresIn: "-1h" });
|
|
485
|
+
const { req, res, next } = createMockReqRes({ authorization: \`Bearer \${token}\` });
|
|
486
|
+
verifyToken(req, res, next);
|
|
487
|
+
expect(res.status).toHaveBeenCalledWith(401);
|
|
488
|
+
});
|
|
489
|
+
|
|
490
|
+
it("should accept valid tokens and attach user to request", () => {
|
|
491
|
+
const token = jwt.sign({ userId: "u1", role: "admin" }, SECRET, { expiresIn: "1h" });
|
|
492
|
+
const { req, res, next } = createMockReqRes({ authorization: \`Bearer \${token}\` });
|
|
493
|
+
verifyToken(req, res, next);
|
|
494
|
+
expect(next).toHaveBeenCalled();
|
|
495
|
+
expect(req.user).toMatchObject({ userId: "u1", role: "admin" });
|
|
496
|
+
});
|
|
497
|
+
});
|
|
498
|
+
`}}),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
|
|
499
|
+
PASS src/routes/__tests__/protected.test.ts
|
|
500
|
+
PASS src/middleware/__tests__/auth.test.ts
|
|
501
|
+
|
|
502
|
+
Test Suites: 3 passed, 3 total
|
|
503
|
+
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:
|
|
504
|
+
|
|
505
|
+
### Changes made
|
|
506
|
+
|
|
507
|
+
| File | Action |
|
|
508
|
+
|------|--------|
|
|
509
|
+
| \`src/middleware/auth.ts\` | Rewrote to verify JWT Bearer tokens |
|
|
510
|
+
| \`src/routes/login.ts\` | Now issues JWT access + refresh tokens |
|
|
511
|
+
| \`src/routes/protected.ts\` | Updated to read \`req.user\` from JWT payload |
|
|
512
|
+
| \`src/middleware/__tests__/auth.test.ts\` | Updated tests for JWT verification |
|
|
513
|
+
|
|
514
|
+
### Key decisions
|
|
515
|
+
- **Access token expiry**: 24 hours (configurable via \`JWT_SECRET\` env var)
|
|
516
|
+
- **Refresh tokens**: 48-byte random hex, stored in DB
|
|
517
|
+
- **Error handling**: Distinguishes expired tokens (401) from invalid tokens (403)`},{sessionId:"sess-001",eventType:"user_input",timestamp:"2026-02-27T08:15:50Z",content:"Looks great! Two follow-ups:\n\n1. add a `/refresh` endpoint that swaps a refresh token for a new access token\n2. note the token flow in `README.md`"},{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.
|
|
518
|
+
Project: acme/alpha — Node.js + Express REST API
|
|
519
|
+
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";
|
|
520
|
+
import bcrypt from "bcrypt";
|
|
521
|
+
import { db } from "../db.js";
|
|
522
|
+
import { validateEmail, validatePassword } from "../utils/validators.js";
|
|
523
|
+
|
|
524
|
+
const SALT_ROUNDS = 12;
|
|
525
|
+
const router = Router();
|
|
526
|
+
|
|
527
|
+
router.post("/register", async (req, res) => {
|
|
528
|
+
const { name, email, password } = req.body;
|
|
529
|
+
|
|
530
|
+
if (!name || !email || !password) {
|
|
531
|
+
return res.status(400).json({ error: "Missing required fields" });
|
|
532
|
+
}
|
|
533
|
+
if (!validateEmail(email)) {
|
|
534
|
+
return res.status(400).json({ error: "Invalid email format" });
|
|
535
|
+
}
|
|
536
|
+
if (!validatePassword(password)) {
|
|
537
|
+
return res.status(400).json({ error: "Password too weak" });
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
const existing = await db.users.findByEmail(email);
|
|
541
|
+
if (existing) {
|
|
542
|
+
return res.status(409).json({ error: "Email already registered" });
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
const passwordHash = await bcrypt.hash(password, SALT_ROUNDS);
|
|
546
|
+
const user = await db.users.create({ name, email, passwordHash });
|
|
547
|
+
res.status(201).json({ id: user.id, name: user.name, email: user.email });
|
|
548
|
+
});
|
|
549
|
+
|
|
550
|
+
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:
|
|
551
|
+
|
|
552
|
+
1. **Happy path** - valid registration
|
|
553
|
+
2. **Missing fields** - each required field missing
|
|
554
|
+
3. **Invalid email** - malformed email format
|
|
555
|
+
4. **Weak password** - password validation failure
|
|
556
|
+
5. **Duplicate email** - conflict with existing user
|
|
557
|
+
6. **SQL injection** - malicious email input
|
|
558
|
+
7. **XSS payload** - HTML in the name field
|
|
559
|
+
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
|
|
560
|
+
POST /api/register
|
|
561
|
+
✓ should register a valid user (28ms)
|
|
562
|
+
✓ should reject missing name (4ms)
|
|
563
|
+
✓ should reject missing email (3ms)
|
|
564
|
+
✓ should reject missing password (3ms)
|
|
565
|
+
✓ should reject invalid email format (5ms)
|
|
566
|
+
✓ should reject weak password (4ms)
|
|
567
|
+
✓ should reject duplicate email (12ms)
|
|
568
|
+
✓ should sanitize HTML in name field (6ms)
|
|
569
|
+
|
|
570
|
+
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.
|
|
571
|
+
Project: acme/alpha — Node.js + Express + PostgreSQL
|
|
572
|
+
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 (
|
|
573
|
+
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
574
|
+
name TEXT NOT NULL,
|
|
575
|
+
email TEXT UNIQUE NOT NULL,
|
|
576
|
+
password_hash TEXT NOT NULL,
|
|
577
|
+
role TEXT DEFAULT 'user',
|
|
578
|
+
created_at TIMESTAMPTZ DEFAULT now(),
|
|
579
|
+
updated_at TIMESTAMPTZ DEFAULT now()
|
|
580
|
+
);
|
|
581
|
+
|
|
582
|
+
CREATE TABLE sessions (
|
|
583
|
+
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
584
|
+
user_id UUID REFERENCES users(id),
|
|
585
|
+
expires_at TIMESTAMPTZ NOT NULL,
|
|
586
|
+
created_at TIMESTAMPTZ DEFAULT now()
|
|
587
|
+
);`,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
|
|
588
|
+
-- Add audit logging and user activity tracking
|
|
589
|
+
|
|
590
|
+
BEGIN;
|
|
591
|
+
|
|
592
|
+
-- 1. Add last_login_at to users
|
|
593
|
+
ALTER TABLE users ADD COLUMN last_login_at TIMESTAMPTZ;
|
|
594
|
+
|
|
595
|
+
-- 2. Index for session cleanup queries
|
|
596
|
+
CREATE INDEX CONCURRENTLY idx_sessions_expires_at ON sessions (expires_at);
|
|
597
|
+
|
|
598
|
+
-- 3. Audit log table
|
|
599
|
+
CREATE TABLE audit_log (
|
|
600
|
+
id BIGSERIAL PRIMARY KEY,
|
|
601
|
+
user_id UUID REFERENCES users(id),
|
|
602
|
+
action TEXT NOT NULL,
|
|
603
|
+
entity_type TEXT NOT NULL,
|
|
604
|
+
entity_id TEXT NOT NULL,
|
|
605
|
+
old_value JSONB,
|
|
606
|
+
new_value JSONB,
|
|
607
|
+
ip_address INET,
|
|
608
|
+
created_at TIMESTAMPTZ DEFAULT now()
|
|
609
|
+
);
|
|
610
|
+
|
|
611
|
+
CREATE INDEX idx_audit_log_user ON audit_log (user_id);
|
|
612
|
+
CREATE INDEX idx_audit_log_entity ON audit_log (entity_type, entity_id);
|
|
613
|
+
CREATE INDEX idx_audit_log_created ON audit_log (created_at);
|
|
614
|
+
|
|
615
|
+
COMMIT;
|
|
616
|
+
`}}),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
|
|
617
|
+
- ALTER TABLE users ADD COLUMN last_login_at
|
|
618
|
+
- CREATE INDEX CONCURRENTLY idx_sessions_expires_at
|
|
619
|
+
- CREATE TABLE audit_log
|
|
620
|
+
- 3 indexes on audit_log
|
|
621
|
+
|
|
622
|
+
WARNING: CREATE INDEX CONCURRENTLY cannot run inside a transaction block.
|
|
623
|
+
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.
|
|
624
|
+
Project: acme/data-pipeline — ETL pipelines for analytics
|
|
625
|
+
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
|
|
626
|
+
src/middleware/error-handler.ts
|
|
627
|
+
src/middleware/logger.ts
|
|
628
|
+
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:
|
|
629
|
+
|
|
630
|
+
- Uses an **in-memory token bucket** per client IP
|
|
631
|
+
- Supports configurable rate (requests/second) and burst size
|
|
632
|
+
- Returns \`429 Too Many Requests\` with \`Retry-After\` header
|
|
633
|
+
- Has a Redis adapter option for multi-instance deployments
|
|
634
|
+
|
|
635
|
+
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.
|
|
636
|
+
Project: acme/alpha — Node.js + Express + PostgreSQL
|
|
637
|
+
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";
|
|
638
|
+
|
|
639
|
+
const pool = new pg.Pool({
|
|
640
|
+
connectionString: process.env.DATABASE_URL,
|
|
641
|
+
max: 20,
|
|
642
|
+
idleTimeoutMillis: 30000,
|
|
643
|
+
});
|
|
644
|
+
|
|
645
|
+
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:
|
|
646
|
+
|
|
647
|
+
1. **A \`PoolManager\` class** that creates and caches per-tenant pools
|
|
648
|
+
2. **Configurable limits** per tenant (max connections, idle timeout)
|
|
649
|
+
3. **Health checks** with automatic pool eviction for unhealthy connections
|
|
650
|
+
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";
|
|
651
|
+
src/routes/users.ts:2:import { pool } from "../db/pool.js";
|
|
652
|
+
src/routes/register.ts:3:import { pool } from "../db/pool.js";
|
|
653
|
+
src/routes/admin.ts:4:import { pool } from "../db/pool.js";
|
|
654
|
+
src/services/billing.ts:2:import { pool } from "../db/pool.js";
|
|
655
|
+
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:
|
|
656
|
+
1. Create a new \`PoolManager\` abstraction
|
|
657
|
+
2. Update all consumers to use \`getPool(tenantId)\` instead of the global pool
|
|
658
|
+
3. Add middleware to extract tenant ID from the request
|
|
659
|
+
|
|
660
|
+
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"}],yH=[{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"}],bH=[{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}],Xc=[{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"}],_H=[{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:""}],xH=[{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));
|
|
661
|
+
for (const f of files) {
|
|
662
|
+
const eslintResult = await host.exec("npx", ["eslint", "--fix", f.filename]);
|
|
663
|
+
if (eslintResult.exitCode !== 0) {
|
|
664
|
+
env.findings.push({ category: "lint", title: \`Lint issues in \${f.filename}\`, content: eslintResult.stderr });
|
|
665
|
+
}
|
|
666
|
+
const prettierResult = await host.exec("npx", ["prettier", "--write", f.filename]);
|
|
667
|
+
if (prettierResult.exitCode !== 0) {
|
|
668
|
+
env.findings.push({ category: "format", title: \`Prettier issues in \${f.filename}\`, content: prettierResult.stderr });
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
env.findings.push({ category: "summary", title: "Lint & format pass complete", content: \`Ran ESLint and Prettier on \${files.length} files\` });`,allowedMcpTools:[]}],kH={"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 Oe(t){return new Date(Date.now()+t).toISOString()}const p_=[{label:"API Refactor",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Oe(0),content:"running"}},{delayMs:600,event:{eventType:"text",timestamp:Oe(600),content:"I'll start by finding all API route files that need refactoring."}},{delayMs:1200,event:{eventType:"tool_use",timestamp:Oe(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:Oe(1600),content:`src/routes/users.ts
|
|
672
|
+
src/routes/auth.ts
|
|
673
|
+
src/routes/billing.ts
|
|
674
|
+
src/routes/admin.ts
|
|
675
|
+
src/routes/health.ts`,raw:JSON.stringify({tool_use_id:"stream-a-01"})}},{delayMs:2200,event:{eventType:"text",timestamp:Oe(2200),content:`Found 5 route files. Let me refactor users.ts to use Express Router with a middleware chain.
|
|
676
|
+
|
|
677
|
+
\`\`\`typescript
|
|
678
|
+
const router = Router();
|
|
679
|
+
router.use(authenticate);
|
|
680
|
+
router.use(validateBody);
|
|
681
|
+
|
|
682
|
+
router.get("/", listUsers);
|
|
683
|
+
router.post("/", createUser);
|
|
684
|
+
router.get("/:id", getUser);
|
|
685
|
+
router.put("/:id", updateUser);
|
|
686
|
+
router.delete("/:id", deleteUser);
|
|
687
|
+
\`\`\``}},{delayMs:3200,event:{eventType:"tool_use",timestamp:Oe(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:Oe(4e3),content:` PASS src/routes/__tests__/users.test.ts
|
|
688
|
+
PASS src/routes/__tests__/auth.test.ts
|
|
689
|
+
PASS src/routes/__tests__/billing.test.ts
|
|
690
|
+
|
|
691
|
+
Test Suites: 3 passed, 3 total
|
|
692
|
+
Tests: 22 passed, 22 total`,raw:JSON.stringify({tool_use_id:"stream-a-02"})}},{delayMs:4500,event:{eventType:"usage",timestamp:Oe(4500),content:JSON.stringify({input_tokens:28400,output_tokens:7200,cost_millicents:15e3})}},{delayMs:5e3,event:{eventType:"text",timestamp:Oe(5e3),content:"All 22 tests pass. The route refactoring is complete."}},{delayMs:5500,event:{eventType:"status",timestamp:Oe(5500),content:"completed"}}]},{label:"Database Migration",pauseForInput:!0,pauseAfterStep:4,steps:[{delayMs:0,event:{eventType:"status",timestamp:Oe(0),content:"running"}},{delayMs:600,event:{eventType:"text",timestamp:Oe(600),content:"Scanning the current database schema to plan the migration."}},{delayMs:1200,event:{eventType:"tool_use",timestamp:Oe(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:Oe(1800),content:`CREATE TABLE users (
|
|
693
|
+
id UUID PRIMARY KEY,
|
|
694
|
+
name TEXT NOT NULL,
|
|
695
|
+
email TEXT UNIQUE NOT NULL,
|
|
696
|
+
created_at TIMESTAMPTZ DEFAULT now()
|
|
697
|
+
);
|
|
698
|
+
|
|
699
|
+
CREATE TABLE sessions (
|
|
700
|
+
id UUID PRIMARY KEY,
|
|
701
|
+
user_id UUID REFERENCES users(id),
|
|
702
|
+
expires_at TIMESTAMPTZ NOT NULL
|
|
703
|
+
);`,raw:JSON.stringify({tool_use_id:"stream-b-01"})}},{delayMs:2600,event:{eventType:"text",timestamp:Oe(2600),content:`I found the tables to modify:
|
|
704
|
+
- **users**: add column \`last_login_at\`
|
|
705
|
+
- **sessions**: add index on \`expires_at\`
|
|
706
|
+
- **audit_log**: new table
|
|
707
|
+
|
|
708
|
+
This migration will add a NOT NULL column to the \`users\` table. The table has **50,000+ rows** which may lock the table briefly.
|
|
709
|
+
|
|
710
|
+
Please confirm to proceed.`}}],resumeSteps:[{delayMs:500,event:{eventType:"text",timestamp:Oe(0),content:"Proceeding with migration."}},{delayMs:1200,event:{eventType:"tool_use",timestamp:Oe(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:Oe(1700),content:`Applying 002_add_last_login.sql... done
|
|
711
|
+
Applying 003_sessions_index.sql... done
|
|
712
|
+
Applying 004_audit_log.sql... done
|
|
713
|
+
|
|
714
|
+
3 migrations applied successfully.`,raw:JSON.stringify({tool_use_id:"stream-b-02"})}},{delayMs:2800,event:{eventType:"text",timestamp:Oe(2300),content:"All 3 migrations applied successfully. The `audit_log` table is ready."}},{delayMs:3200,event:{eventType:"status",timestamp:Oe(2700),content:"completed"}}]},{label:"Test Writer",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Oe(0),content:"running"}},{delayMs:600,event:{eventType:"text",timestamp:Oe(600),content:"I'll generate tests for `src/services/billing.ts`. Let me read the implementation first."}},{delayMs:1200,event:{eventType:"tool_use",timestamp:Oe(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:Oe(1800),content:`import { StripeClient } from "./stripe-client.js";
|
|
715
|
+
import type { Invoice, LineItem } from "../types/billing.js";
|
|
716
|
+
|
|
717
|
+
export class BillingService {
|
|
718
|
+
constructor(private stripe: StripeClient) {}
|
|
719
|
+
|
|
720
|
+
async calculateMonthlyTotal(userId: string): Promise<number> {
|
|
721
|
+
const invoices = await this.stripe.listInvoices(userId);
|
|
722
|
+
return invoices.reduce((sum, inv) => sum + inv.total, 0);
|
|
723
|
+
}
|
|
724
|
+
}`,raw:JSON.stringify({tool_use_id:"stream-c-01"})}},{delayMs:2400,event:{eventType:"text",timestamp:Oe(2400),content:"The billing service imports from `./stripe-client.js`. Let me check if that module exists."}},{delayMs:2800,event:{eventType:"tool_use",timestamp:Oe(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:Oe(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:Oe(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:Oe(4e3),content:"failed"}}]},{label:"Fix Auth Bug",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Oe(0),content:"running"}},{delayMs:600,event:{eventType:"text",timestamp:Oe(600),content:"Let me investigate the authentication bug..."}},{delayMs:1200,event:{eventType:"tool_use",timestamp:Oe(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:Oe(1800),content:`import jwt from "jsonwebtoken";
|
|
725
|
+
import type { Request, Response, NextFunction } from "express";
|
|
726
|
+
|
|
727
|
+
const JWT_SECRET = process.env.JWT_SECRET || "change-me";
|
|
728
|
+
|
|
729
|
+
export function verifyToken(req: Request, res: Response, next: NextFunction): void {
|
|
730
|
+
const header = req.headers.authorization;
|
|
731
|
+
if (!header?.startsWith("Bearer ")) {
|
|
732
|
+
res.status(401).json({ error: "Missing token" });
|
|
733
|
+
return;
|
|
734
|
+
}
|
|
735
|
+
try {
|
|
736
|
+
const decoded = jwt.verify(header.slice(7), JWT_SECRET);
|
|
737
|
+
if (decoded.exp > Date.now() / 1000) {
|
|
738
|
+
res.status(403).json({ error: "Token expired" });
|
|
739
|
+
return;
|
|
740
|
+
}
|
|
741
|
+
req.user = decoded;
|
|
742
|
+
next();
|
|
743
|
+
} catch {
|
|
744
|
+
res.status(403).json({ error: "Invalid token" });
|
|
745
|
+
}
|
|
746
|
+
}`,raw:JSON.stringify({tool_use_id:"tool-mock-001",is_error:!1})}},{delayMs:2600,event:{eventType:"text",timestamp:Oe(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:Oe(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:Oe(4e3),content:"File updated successfully",raw:JSON.stringify({tool_use_id:"tool-mock-002",is_error:!1})}},{delayMs:4600,event:{eventType:"tool_use",timestamp:Oe(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:Oe(5800),content:`[exit 0] > jest --grep auth
|
|
747
|
+
|
|
748
|
+
PASS src/auth.test.ts
|
|
749
|
+
✓ validates JWT token (12ms)
|
|
750
|
+
✓ rejects expired token (3ms)
|
|
751
|
+
✓ handles missing header (1ms)
|
|
752
|
+
|
|
753
|
+
Tests: 3 passed, 3 total
|
|
754
|
+
Time: 1.234s`,raw:JSON.stringify({tool_use_id:"tool-mock-003",is_error:!1})}},{delayMs:6400,event:{eventType:"tool_use",timestamp:Oe(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:Oe(7e3),content:`src/middleware/auth.ts:14: if (decoded.exp < Date.now() / 1000) {
|
|
755
|
+
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:Oe(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:Oe(8400),content:JSON.stringify({input_tokens:42600,output_tokens:1850,cost_millicents:12e3})}},{delayMs:8800,event:{eventType:"status",timestamp:Oe(8800),content:"completed"}}]}],Bn={onConnect:async()=>{},onDisconnect:()=>{},handleEvent:()=>!1};function m_(t){return t?f_:f_.filter(s=>!s$.some(o=>s.name.startsWith(o)))}const h_=400;function SH({children:t}){const[s,o]=y.useState(hH),[r,c]=y.useState(gH),[d,u]=y.useState(()=>m_(!1)),[p,m]=y.useState(vH),[g,v]=y.useState(void 0),[_,b]=y.useState(yH),[x,k]=y.useState(""),[j,w]=y.useState(bH),[T,C]=y.useState(Xc),[D,O]=y.useState(void 0),E=!1,[M,L]=y.useState(_H),[A,P]=y.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),[Y,q]=y.useState(xH),[ee,le]=y.useState([]),[W]=y.useState(kH),[re,$]=y.useState(""),[B,se]=y.useState(As),[oe,X]=y.useState(Fa),[ce,fe]=y.useState(void 0),[ge,Ae]=y.useState(void 0),[vt,wt]=y.useState(""),_e=y.useRef(void 0),qe=y.useRef(0),Bt=y.useRef(0),Wt=y.useRef(new Set),de=y.useRef(new Map),Ue=y.useRef(j);Ue.current=j;const yt=y.useRef(new Map),At=y.useRef(new Map),H=y.useCallback(U=>(qe.current+=1,`mock-${U}-${String(qe.current).padStart(3,"0")}`),[]),ve=y.useCallback(()=>{const U=p_[Bt.current%p_.length];return Bt.current+=1,U},[]),tt=y.useCallback((U,te,ue)=>{const me=setTimeout(()=>{var ye;Wt.current.delete(me),ue&&((ye=de.current.get(ue))==null||ye.delete(me)),U()},te);Wt.current.add(me),ue&&(de.current.has(ue)||de.current.set(ue,new Set),de.current.get(ue).add(me))},[]),Dt=y.useCallback(U=>{const te=de.current.get(U);te&&(te.forEach(ue=>{clearTimeout(ue),Wt.current.delete(ue)}),de.current.delete(U))},[]),Ge=y.useCallback((U,te,ue)=>{c(me=>me.map(ye=>ye.id===U?{...ye,status:te,...ue!==void 0?{endReason:ue}:{}}:ye))},[]),Xt=y.useCallback(U=>{m(te=>[...te,U])},[]),bn=y.useCallback((U,te,ue)=>{te.forEach((me,ye)=>{tt(()=>{const Fe={sessionId:U,...me.event,timestamp:new Date().toISOString()};if(Xt(Fe),me.event.eventType==="status"){const Se=gk(me.event.content),Le=vk(me.event.content);Ge(U,Se,Le)}ye===te.length-1&&ue&&ue()},me.delayMs,U)})},[tt,Xt,Ge]),Bs=y.useCallback(async(U,te,ue,me)=>{console.log("[MockGrackle] spawn",{environmentId:U,prompt:te,runtime:me});const ye=H("sess"),Fe={id:ye,environmentId:U,runtime:me||"claude-code",status:"running",prompt:te,startedAt:new Date().toISOString()};c(Le=>[...Le,Fe]),v(ye);const Se=ve();if(console.log(`[MockGrackle] Playing scenario: ${Se.label}`),Se.pauseForInput){const Le=Se.pauseAfterStep??Se.steps.length-1,Ve=Se.steps.slice(0,Le+1),Ie=Ve.length>0?Ve[Ve.length-1].delayMs:0;bn(ye,Ve),tt(()=>{Ge(ye,"idle"),Xt({sessionId:ye,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},Ie+h_,ye),Se.resumeSteps&&yt.current.set(ye,Se.resumeSteps)}else bn(ye,Se.steps)},[H,ve,bn,tt,Ge,Xt]),si=y.useCallback(async U=>{console.log("[MockGrackle] kill",U),Dt(U),yt.current.delete(U),Ge(U,"stopped","killed"),Xt({sessionId:U,eventType:"status",timestamp:new Date().toISOString(),content:"killed"}),w(te=>te.map(ue=>ue.latestSessionId===U&&ue.status==="working"?{...ue,status:"not_started"}:ue))},[Dt,Ge,Xt]),qt=y.useCallback(async U=>{console.log("[MockGrackle] stopGraceful",U),Dt(U),yt.current.delete(U),Ge(U,"stopped","terminated"),Xt({sessionId:U,eventType:"status",timestamp:new Date().toISOString(),content:"terminated"}),w(te=>te.map(ue=>ue.latestSessionId===U&&ue.status==="working"?{...ue,status:"not_started"}:ue))},[Dt,Ge,Xt]),Ui=y.useCallback(()=>{console.log("[MockGrackle] refresh")},[]),ai=y.useCallback(async U=>{console.log("[MockGrackle] loadSessionEvents",U)},[]),va=y.useCallback(()=>{console.log("[MockGrackle] clearEvents"),m([])},[]),$s=y.useCallback(async(U,te,ue,me,ye,Fe,Se,Le,Ve)=>{console.log("[MockGrackle] createWorkspace",{name:U,description:te});const Ie={id:H("proj"),name:U,description:te||"",repoUrl:ue||"",linkedEnvironmentIds:me?[me]:[],status:"active",workingDirectory:Se||"",useWorktrees:Fe??!0,defaultPersonaId:ye||"",tokenBudget:0,costBudgetMillicents:0,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};b(Me=>[...Me,Ie]),Le&&Le(Ie)},[H]),ii=y.useCallback(async U=>{console.log("[MockGrackle] archiveWorkspace",U),b(te=>te.map(ue=>ue.id===U?{...ue,status:"archived"}:ue))},[]),oi=y.useCallback(async U=>{console.log("[MockGrackle] loadTasks",U)},[]),ds=y.useCallback(async(U,te,ue,me,ye,Fe,Se,Le,Ve)=>{console.log("[MockGrackle] createTask",{workspaceId:U,title:te,parentTaskId:ye}),w(Ie=>{const Mt=Ie.filter(js=>js.workspaceId===U).reduce((js,Hs)=>Math.max(js,Hs.sortOrder),0),on=ye?Ie.find(js=>js.id===ye):void 0;if(ye&&!on)return console.warn("[MockGrackle] Parent task not found:",ye),Ie;if(on&&!on.canDecompose)return console.warn("[MockGrackle] Parent task does not have decomposition rights:",ye),Ie;const Ft=on?on.depth+1:0,ba={id:H("task"),workspaceId:U,title:te,description:ue||"",status:"not_started",branch:"",latestSessionId:"",dependsOn:me||[],reviewNotes:void 0,sortOrder:Mt+1,createdAt:new Date().toISOString(),parentTaskId:ye||"",depth:Ft,childTaskIds:[],canDecompose:Se??!ye,defaultPersonaId:Fe||"",workpad:"",tokenBudget:0,costBudgetMillicents:0};return[...Ie,ba]}),Le&&Le()},[H]),Ne=y.useCallback(async(U,te,ue,me)=>{var Ie;console.log("[MockGrackle] startTask",{taskId:U});const ye=Ue.current.find(Me=>Me.id===U),Fe=(ye==null?void 0:ye.title)??"",Se=H("sess"),Le={id:Se,environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:Fe||U,startedAt:new Date().toISOString()};c(Me=>[...Me,Le]),w(Me=>Me.map(Mt=>Mt.id===U?{...Mt,status:"working",latestSessionId:Se,branch:`mock/${U.slice(0,8)}`}:Mt));const Ve=ve();if(console.log(`[MockGrackle] Playing task scenario: ${Ve.label}`),Ve.pauseForInput){const Me=Ve.pauseAfterStep??Ve.steps.length-1,Mt=Ve.steps.slice(0,Me+1),on=Mt.length>0?Mt[Mt.length-1].delayMs:0;if(bn(Se,Mt),tt(()=>{Ge(Se,"idle"),Xt({sessionId:Se,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},on+h_,Se),Ve.resumeSteps){const Ft=[...Ve.resumeSteps];yt.current.set(Se,Ft);const ba=Ft.reduce((js,Hs)=>Math.max(js,Hs.delayMs),0);At.current.set(Se,{taskId:U,delayAfterResume:ba+200})}}else{const Me=Ve.steps.length>0?Ve.steps[Ve.steps.length-1].delayMs:0;bn(Se,Ve.steps);const Mt=(Ie=Ve.steps[Ve.steps.length-1])==null?void 0:Ie.event.content;tt(()=>{Mt==="completed"?w(on=>on.map(Ft=>Ft.id===U&&Ft.status==="working"?{...Ft,status:"paused"}:Ft)):Mt==="failed"&&w(on=>on.map(Ft=>Ft.id===U&&Ft.status==="working"?{...Ft,status:"failed"}:Ft))},Me+100,Se)}},[H,ve,bn,tt,Ge,Xt]),ze=y.useCallback(async(U,te)=>{console.log("[MockGrackle] sendInput",{sessionId:U,text:te}),Xt({sessionId:U,eventType:"output",timestamp:new Date().toISOString(),content:`User input: ${te}`}),Ge(U,"running"),Xt({sessionId:U,eventType:"status",timestamp:new Date().toISOString(),content:"running"});const ue=yt.current.get(U);if(ue)yt.current.delete(U),bn(U,ue);else{const ye=[{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"}}];bn(U,ye)}const me=At.current.get(U);me&&(At.current.delete(U),tt(()=>{w(ye=>ye.map(Fe=>Fe.id===me.taskId&&Fe.status==="working"?{...Fe,status:"paused"}:Fe))},me.delayAfterResume,U))},[Xt,Ge,bn,tt]),ht=y.useCallback(async U=>{console.log("[MockGrackle] completeTask",U),w(te=>te.map(ue=>ue.id===U?{...ue,status:"complete"}:ue))},[]),Qt=y.useCallback(async U=>{console.log("[MockGrackle] resumeTask",U)},[]),Gt=y.useCallback(async(U,te,ue,me,ye)=>{console.log("[MockGrackle] updateTask",{taskId:U,title:te}),w(Fe=>Fe.map(Se=>Se.id===U?{...Se,title:te.trim()||Se.title,description:ue,dependsOn:me,...ye!==void 0?{defaultPersonaId:ye}:{}}:Se))},[]),Vi=y.useCallback(async U=>{console.log("[MockGrackle] deleteTask",U),w(te=>te.filter(ue=>ue.id!==U))},[]),qi=y.useCallback(async U=>{console.log("[MockGrackle] loadFindings",U),C(Xc.filter(te=>te.workspaceId===U))},[]),Gi=y.useCallback(async()=>{console.log("[MockGrackle] loadAllFindings"),C([...Xc])},[]),zs=y.useCallback(async U=>{console.log("[MockGrackle] loadFinding",U);const te=Xc.find(ue=>ue.id===U);O(te)},[]),ri=y.useCallback(async(U,te,ue,me,ye)=>{console.log("[MockGrackle] postFinding",{workspaceId:U,title:te});const Fe={id:H("find"),workspaceId:U,taskId:"",sessionId:"",category:me||"general",title:te,content:ue,tags:ye||[],createdAt:new Date().toISOString()};C(Se=>[...Se,Fe])},[H]),li=y.useCallback(async()=>{console.log("[MockGrackle] loadEnvironments")},[]),Ss=y.useCallback(async(U,te,ue)=>{console.log("[MockGrackle] addEnvironment",{displayName:U,adapterType:te,adapterConfig:ue})},[]),ci=y.useCallback(async(U,te)=>{console.log("[MockGrackle] updateEnvironment",{environmentId:U,...te}),o(ue=>ue.map(me=>me.id!==U?me:{...me,...te.displayName!==void 0?{displayName:te.displayName}:{},...te.adapterConfig!==void 0?{adapterConfig:JSON.stringify(te.adapterConfig)}:{}}))},[]),ya=y.useCallback(async()=>{console.log("[MockGrackle] loadTokens")},[]),kl=y.useCallback(async(U,te,ue,me,ye)=>{console.log("[MockGrackle] setToken",{name:U,tokenType:ue}),L(Fe=>[...Fe.filter(Le=>Le.name!==U),{name:U,tokenType:ue,envVar:me,filePath:ye,expiresAt:""}])},[]),Xo=y.useCallback(async U=>{console.log("[MockGrackle] deleteToken",U),L(te=>te.filter(ue=>ue.name!==U))},[]),Fi=y.useCallback(async U=>{console.log("[MockGrackle] updateCredentialProviders",U),P(U)},[]);y.useEffect(()=>()=>{Wt.current.forEach(clearTimeout),Wt.current.clear()},[]);const di=y.useMemo(()=>({connectionStatus:"connected",environments:{environments:s,environmentsLoading:!1,provisionStatus:{},operationError:"",clearOperationError:()=>{},loadEnvironments:li,addEnvironment:Ss,updateEnvironment:ci,provisionEnvironment:async(U,te)=>{},stopEnvironment:async()=>{},removeEnvironment:async()=>{},domainHook:Bn},sessions:{sessions:r,sessionsLoading:!1,events:p,eventsDropped:0,lastSpawnedId:g,taskSessions:W,spawn:Bs,sendInput:ze,kill:si,stopGraceful:qt,loadSessionEvents:ai,clearEvents:va,loadTaskSessions:async U=>{console.log("[MockGrackle] loadTaskSessions",U)},domainHook:Bn},workspaces:{workspaces:_,workspacesLoading:!1,workspaceCreating:!1,loadWorkspaces:async()=>{console.log("[MockGrackle] loadWorkspaces")},createWorkspace:$s,archiveWorkspace:ii,updateWorkspace:async(U,te)=>{console.log("[MockGrackle] updateWorkspace",{workspaceId:U,...te}),b(ue=>ue.map(me=>me.id!==U?me:{...me,...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"){k("Failed to link environment");return}k(""),b(ue=>ue.map(me=>me.id!==U||me.linkedEnvironmentIds.includes(te)?me:{...me,linkedEnvironmentIds:[...me.linkedEnvironmentIds,te]}))},unlinkEnvironment:async(U,te)=>{if(console.log("[MockGrackle] unlinkEnvironment",{workspaceId:U,environmentId:te}),te==="error-env"){k("Failed to unlink environment");return}k(""),b(ue=>ue.map(me=>me.id!==U?me:{...me,linkedEnvironmentIds:me.linkedEnvironmentIds.filter(ye=>ye!==te)}))},linkOperationError:x,clearLinkOperationError:()=>{k("")},domainHook:Bn},tasks:{tasks:j,tasksLoading:!1,taskStartingId:void 0,loadTasks:oi,loadAllTasks:async()=>{console.log("[MockGrackle] loadAllTasks")},createTask:ds,startTask:Ne,stopTask:async U=>{console.log("[MockGrackle] stopTask",{taskId:U}),await ht(U)},completeTask:ht,resumeTask:Qt,updateTask:Gt,deleteTask:Vi,domainHook:Bn},findings:{findings:T,selectedFinding:D,findingLoading:E,findingsLoading:!1,loadFindings:qi,loadAllFindings:Gi,loadFinding:zs,postFinding:ri,domainHook:Bn},tokens:{tokens:M,tokensLoading:!1,loadTokens:ya,setToken:kl,deleteToken:Xo,domainHook:Bn},credentials:{credentialProviders:A,credentialsLoading:!1,updateCredentialProviders:Fi,domainHook:Bn},codespaces:{codespaces:[],codespaceError:"",codespaceListError:"",codespaceCreating:!1,listCodespaces:async()=>{},createCodespace:async()=>{},domainHook:Bn},dockerContainers:{dockerContainers:[],dockerContainersError:"",listDockerContainers:async()=>{},domainHook:Bn},personas:{personas:Y,personasLoading:!1,createPersona:async(U,te,ue,me,ye,Fe,Se,Le,Ve)=>{console.log("[MockGrackle] createPersona",{name:U});const Ie={id:`mock-persona-${Date.now()}`,name:U,description:te,systemPrompt:ue,toolConfig:"{}",runtime:me??"claude-code",model:ye||"",maxTurns:Fe||0,mcpServers:"[]",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),type:Se||"agent",script:Le||"",allowedMcpTools:Ve||[]};return q(Me=>[...Me,Ie]),Ie},updatePersona:async(U,te,ue,me,ye,Fe,Se,Le,Ve,Ie)=>{console.log("[MockGrackle] updatePersona",{personaId:U,name:te});const Me=Y.find(Ft=>Ft.id===U);if(!Me)throw new Error(`Persona not found: ${U}`);const Mt=new Date().toISOString(),on={...Me,...te!==void 0?{name:te}:{},...ue!==void 0?{description:ue}:{},...me!==void 0?{systemPrompt:me}:{},...ye!==void 0?{runtime:ye}:{},...Fe!==void 0?{model:Fe}:{},...Se!==void 0?{maxTurns:Se}:{},...Le!==void 0?{type:Le}:{},...Ve!==void 0?{script:Ve}:{},...Ie!==void 0?{allowedMcpTools:Ie}:{},updatedAt:Mt};return q(Ft=>Ft.map(ba=>ba.id===U?on:ba)),on},deletePersona:async U=>{console.log("[MockGrackle] deletePersona",U),q(te=>te.filter(ue=>ue.id!==U))},domainHook:Bn},schedules:{schedules:ee,schedulesLoading:!1,createSchedule:async(U,te,ue,me,ye)=>{console.log("[MockGrackle] createSchedule",{title:U});const Fe={id:`mock-schedule-${Date.now()}`,title:U,description:te,scheduleExpression:ue,personaId:me,workspaceId:ye??"",parentTaskId:"",enabled:!0,lastRunAt:"",nextRunAt:new Date(Date.now()+6e4).toISOString(),runCount:0,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};return le(Se=>[...Se,Fe]),Fe},updateSchedule:async(U,te)=>{console.log("[MockGrackle] updateSchedule",{scheduleId:U,fields:te});let ue;if(le(me=>me.map(ye=>ye.id!==U?ye:(ue={...ye,...te,updatedAt:new Date().toISOString()},ue))),!ue)throw new Error(`Schedule not found: ${U}`);return ue},deleteSchedule:async U=>{console.log("[MockGrackle] deleteSchedule",U),le(te=>te.filter(ue=>ue.id!==U))},domainHook:Bn},streams:{streams:d,streamsLoading:!1,streamsLoadedOnce:!0,streamsLoadError:!1,loadStreams:async(U=!1)=>{u(m_(U))},domainHook:Bn},knowledge:{graphData:{nodes:B,links:oe},selectedNode:ce,loading:!1,selectedId:ge,searchQuery:vt,search:async U=>{if(console.log("[MockGrackle] knowledge.search",U),!U.trim()){wt(U);return}wt(U);const te=_e.current,ue=te?As.filter(Se=>!Se.workspaceId||Se.workspaceId===te):As,me=U.toLowerCase(),ye=ue.filter(Se=>{var Le,Ve,Ie;return Se.label.toLowerCase().includes(me)||((Le=Se.content)==null?void 0:Le.toLowerCase().includes(me))||((Ve=Se.tags)==null?void 0:Ve.some(Me=>Me.toLowerCase().includes(me)))||((Ie=Se.category)==null?void 0:Ie.toLowerCase().includes(me))});se(ye);const Fe=new Set(ye.map(Se=>Se.id));X(Fa.filter(Se=>Fe.has(Se.source)&&Fe.has(Se.target))),Ae(void 0),fe(void 0)},clearSearch:()=>{console.log("[MockGrackle] knowledge.clearSearch"),wt("");const U=_e.current,te=U?As.filter(me=>!me.workspaceId||me.workspaceId===U):As;se(te);const ue=new Set(te.map(me=>me.id));X(Fa.filter(me=>ue.has(me.source)&&ue.has(me.target)))},selectNode:async U=>{console.log("[MockGrackle] knowledge.selectNode",U),Ae(U);const te=U in u_?u_[U]:void 0;if(te)fe(te);else{const ue=As.find(me=>me.id===U);if(ue){const me=Fa.filter(ye=>ye.source===U||ye.target===U).map(ye=>({fromId:ye.source,toId:ye.target,type:ye.type}));fe({node:ue,edges:me})}}},clearSelection:()=>{console.log("[MockGrackle] knowledge.clearSelection"),Ae(void 0),fe(void 0)},expandNode:async U=>{console.log("[MockGrackle] knowledge.expandNode",U),se(te=>{const ue=new Set(te.map(Le=>Le.id)),me=Fa.filter(Le=>Le.source===U||Le.target===U),ye=new Set;for(const Le of me)ue.has(Le.source)||ye.add(Le.source),ue.has(Le.target)||ye.add(Le.target);if(ye.size===0)return te;const Fe=As.filter(Le=>ye.has(Le.id)),Se=new Set([...ue,...ye]);return X(Le=>{const Ve=new Set(Le.map(Me=>`${Me.source}|${Me.target}|${Me.type}`)),Ie=Fa.filter(Me=>Se.has(Me.source)&&Se.has(Me.target)&&!Ve.has(`${Me.source}|${Me.target}|${Me.type}`));return Ie.length>0?[...Le,...Ie]:Le}),[...te,...Fe]})},loadRecent:async U=>{if(console.log("[MockGrackle] knowledge.loadRecent",U),_e.current=U,U){const te=As.filter(me=>!me.workspaceId||me.workspaceId===U);se(te);const ue=new Set(te.map(me=>me.id));X(Fa.filter(me=>ue.has(me.source)&&ue.has(me.target)))}else se(As),X(Fa);wt("")},handleEvent:()=>!1,domainHook:Bn},githubAccounts:{githubAccounts:[],githubAccountsLoading:!1,loadGitHubAccounts:async()=>{console.log("[MockGrackle] loadGitHubAccounts")},addGitHubAccount:async(U,te,ue,me)=>{console.log("[MockGrackle] addGitHubAccount",U)},updateGitHubAccount:async(U,te)=>{console.log("[MockGrackle] updateGitHubAccount",U,te)},removeGitHubAccount:async U=>{console.log("[MockGrackle] removeGitHubAccount",U)},importGitHubAccounts:async()=>(console.log("[MockGrackle] importGitHubAccounts"),{imported:0,usernames:[]})},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:re,setAppDefaultPersonaId:async U=>{console.log("[MockGrackle] setAppDefaultPersonaId",U),$(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:Ui}),[s,r,d,p,g,W,_,x,j,T,D,M,A,Y,ee,re,B,oe,ce,ge,vt,Bs,ze,si,qt,ai,va,$s,ii,oi,ds,Ne,ht,Qt,Gt,Vi,qi,Gi,zs,ri,li,Ss,ci,ya,kl,Xo,Fi,Ui]);return a.jsx(_h.Provider,{value:di,children:t})}const _k=3e3,jH=_k;function wH(t){const[s,o]=y.useState("connecting"),r=y.useRef(t.onSessionEvent);r.current=t.onSessionEvent;const c=y.useRef(t.onDomainEvent);c.current=t.onDomainEvent;const d=y.useRef(t.onConnect);d.current=t.onConnect;const u=y.useRef(t.onDisconnect);return u.current=t.onDisconnect,y.useEffect(()=>{let p=!1,m,g;async function v(){var x,k;if(p)return;Promise.resolve((x=d.current)==null?void 0:x.call(d)).catch(()=>{});let _=!1;const b=()=>{!_&&!p&&(_=!0,o("connected"))};g=setTimeout(b,jH);try{const j=$e.streamEvents({});for await(const w of j){if(b(),p)break;const T=w.event;if(T.case==="sessionEvent"){const C=T.value;r.current({sessionId:C.sessionId,type:C.type,timestamp:C.timestamp,content:C.content,raw:C.raw})}else if(T.case==="domainEvent"){const C=T.value;c.current({id:C.id,type:C.type,timestamp:C.timestamp,payloadJson:C.payloadJson})}}}catch(j){if(clearTimeout(g),j instanceof fa&&j.code===O_.Unauthenticated){window.location.href=sC;return}}clearTimeout(g),p||(o("connecting"),(k=u.current)==null||k.call(u),m=setTimeout(()=>{v().catch(()=>{})},_k))}return v().catch(()=>{}),()=>{p=!0,clearTimeout(m),clearTimeout(g)}},[]),{connectionStatus:s}}const wm=["core","orchestration","scheduling"],xk=y.createContext({pluginNames:[...wm],sandboxPort:void 0,sandboxOrigin:void 0,loading:!1,error:void 0});function TH({children:t}){const[s,o]=y.useState([...wm]),[r,c]=y.useState(void 0),[d,u]=y.useState(void 0),[p,m]=y.useState(!0),[g,v]=y.useState(void 0);return y.useEffect(()=>{let _=!1;return fetch("/api/manifest").then(async b=>{if(!b.ok)throw new Error(`Manifest fetch returned ${b.status}`);return b.json()}).then(b=>{_||(o(b.plugins.map(x=>x.name)),c(b.sandboxPort),u(b.sandboxOrigin),m(!1))}).catch(b=>{_||(o([...wm]),v(b instanceof Error?b:new Error(String(b))),m(!1))}),()=>{_=!0}},[]),a.jsx(xk.Provider,{value:{pluginNames:s,sandboxPort:r,sandboxOrigin:d,loading:p,error:g},children:t})}function Fd(){return y.useContext(xk)}function jh(){const{sandboxPort:t,sandboxOrigin:s}=Fd();if(typeof window>"u")return;if(s!==void 0&&s!=="")try{return new URL("/sandbox.html",s).toString()}catch{}if(t===void 0)return;const o=new URL(window.location.origin);return o.port=String(t),o.pathname="/sandbox.html",o.toString()}const NH=new Set(["dashboard","chat","environments","coordination","settings"]),CH=new Set(["tasks","findings"]),EH=new Set(["knowledge"]),kk={core:{navItems:rd.filter(t=>NH.has(t.view)),domainHookKeys:["environments","sessions","workspaces","tokens","credentials","codespaces","dockerContainers","streams","plugins"]},orchestration:{navItems:rd.filter(t=>CH.has(t.view)),domainHookKeys:["tasks","findings","personas","notifications"]},scheduling:{navItems:[],domainHookKeys:["schedules"]},knowledge:{navItems:rd.filter(t=>EH.has(t.view)),domainHookKeys:["knowledge"]}};function AH(t){return t.flatMap(s=>{var o;return((o=kk[s])==null?void 0:o.navItems)??[]})}function DH(t){return new Set(t.flatMap(s=>{var o;return((o=kk[s])==null?void 0:o.domainHookKeys)??[]}))}function MH(t){return{id:t.id,displayName:t.displayName,adapterType:t.adapterType,adapterConfig:t.adapterConfig||"{}",status:t.status,bootstrapped:t.bootstrapped,githubAccountId:t.githubAccountId||""}}function g_(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,taskId:t.taskId||void 0,inputTokens:t.inputTokens,outputTokens:t.outputTokens,costMillicents:t.costMillicents}}function RH(t){return{sessionId:t.sessionId,eventType:L_(t.type),timestamp:t.timestamp,content:t.content,raw:t.raw||void 0}}function v_(t){return{id:t.id,name:t.name,description:t.description,repoUrl:t.repoUrl,linkedEnvironmentIds:[...t.linkedEnvironmentIds],status:W2(t.status),workingDirectory:t.workingDirectory,useWorktrees:t.useWorktrees,defaultPersonaId:t.defaultPersonaId,tokenBudget:t.tokenBudget,costBudgetMillicents:t.costBudgetMillicents,createdAt:t.createdAt,updatedAt:t.updatedAt}}function y_(t){return{id:t.id,workspaceId:t.workspaceId??void 0,title:t.title,description:t.description,status:X2(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 Vp(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 IH(t){return{name:t.name,tokenType:t.type,envVar:t.envVar,filePath:t.filePath,expiresAt:t.expiresAt}}function OH(t){return{claude:Q2(t.claude),github:Oc(t.github),copilot:Oc(t.copilot),codex:Oc(t.codex),goose:Oc(t.goose)}}function LH(t){return{name:t.name,repository:t.repository,state:t.state,gitStatus:t.gitStatus}}function BH(t){return{id:t.id,name:t.name,image:t.image,state:t.state,status:t.status}}function qp(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 $H(t){return{inputTokens:t.inputTokens,outputTokens:t.outputTokens,costMillicents:t.costMillicents,sessionCount:t.sessionCount}}function Gp(t){return{id:t.id,title:t.title,description:t.description,scheduleExpression:t.scheduleExpression,personaId:t.personaId,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 Qc(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 Fp(t){return{source:t.fromId,target:t.toId,type:t.type}}function zH(t){return{subscriptionId:t.subscriptionId,sessionId:t.sessionId,fd:t.fd,permission:t.permission,deliveryMode:t.deliveryMode,createdBySpawn:t.createdBySpawn}}function HH(t){return{id:t.id,name:t.name,subscriberCount:t.subscriberCount,messageBufferDepth:t.messageBufferDepth,subscribers:t.subscribers.map(zH),selfEcho:t.selfEcho}}function cs(){const[t,s]=y.useState(!1),o=y.useRef(0),r=y.useCallback(c=>(o.current++,o.current===1&&s(!0),c.finally(()=>{o.current--,o.current===0&&s(!1)})),[]);return{loading:t,track:r}}const b_=5e3;function Zr(t){return t instanceof fa?t.message:"Operation failed"}function PH(){const[t,s]=y.useState([]),{loading:o,track:r}=cs(),[c,d]=y.useState({}),[u,p]=y.useState(""),m=y.useCallback(()=>{p("")},[]),g=y.useCallback(async()=>{try{const C=await r($e.listEnvironments({}));s(C.environments.map(MH))}catch{}},[r]),v=y.useCallback(C=>{switch(C.type){case"environment.added":return!0;case"environment.removed":{const D=C.payload.environmentId;return D&&(s(O=>O.filter(E=>E.id!==D)),d(O=>{const E={...O};return delete E[D],E})),!0}case"environment.changed":return g().catch(()=>{}),!0;case"environment.provision_progress":{const D=C.payload;if(typeof D.environmentId!="string"||typeof D.stage!="string"||typeof D.message!="string"||typeof D.progress!="number")return hk("environment.provision_progress","invalid payload"),!0;if(d(O=>({...O,[D.environmentId]:{stage:D.stage,message:D.message,progress:D.progress}})),D.stage==="ready"){const O=D.environmentId;setTimeout(()=>{d(E=>{const M={...E};return delete M[O],M})},b_)}return!0}default:return!1}},[g]),_=y.useCallback(C=>{var D;if(C.type==="environments"){const O=Array.isArray((D=C.payload)==null?void 0:D.environments)?C.payload.environments:[];return s(O),!0}return!1},[]),b=y.useCallback(async(C,D,O,E)=>{p("");try{await $e.addEnvironment({displayName:C,adapterType:D,adapterConfig:JSON.stringify(O??{}),githubAccountId:E??""})}catch(M){p(Zr(M))}},[]),x=y.useCallback(async(C,D)=>{p("");try{await $e.updateEnvironment({id:C,displayName:D.displayName,adapterConfig:D.adapterConfig?JSON.stringify(D.adapterConfig):void 0,githubAccountId:D.githubAccountId})}catch(O){p(Zr(O))}},[]),k=y.useCallback(async(C,D)=>{p("");try{const O=$e.provisionEnvironment({id:C,force:D??!1});for await(const E of O)d(M=>({...M,[C]:{stage:E.stage,message:E.message,progress:E.progress}})),E.stage==="ready"&&setTimeout(()=>{d(M=>{const L={...M};return delete L[C],L})},b_)}catch(O){d(E=>{const M={...E};return delete M[C],M}),p(Zr(O))}},[]),j=y.useCallback(async C=>{p("");try{await $e.stopEnvironment({id:C})}catch(D){p(Zr(D))}},[]),w=y.useCallback(async C=>{p("");try{await $e.removeEnvironment({id:C})}catch(D){p(Zr(D))}},[]);return{environments:t,environmentsLoading:o,provisionStatus:c,operationError:u,clearOperationError:m,loadEnvironments:g,addEnvironment:b,updateEnvironment:x,provisionEnvironment:k,stopEnvironment:j,removeEnvironment:w,handleEvent:v,handleLegacyMessage:_,domainHook:{onConnect:()=>g(),onDisconnect:()=>{},handleEvent:v}}}const Kp=new Set(["pending","running","idle"]),UH=new Set(["completed","failed","interrupted","hibernating","suspended"]),__=["pending","running","idle"];function VH(){const[t,s]=y.useState([]),{loading:o,track:r}=cs(),[c,d]=y.useState([]),[u,p]=y.useState(0),[m,g]=y.useState(void 0),[v,_]=y.useState({}),b=y.useCallback(async()=>{try{const P=(await r($e.listSessions({}))).sessions.map(g_);s(Y=>{const q=new Map(Y.map(ee=>[ee.id,ee]));return P.map(ee=>{const le=q.get(ee.id),W=le==null?void 0:le.status;return!W||W===ee.status?ee:UH.has(W)&&Kp.has(ee.status)?{...ee,status:W,...le.endReason!==void 0?{endReason:le.endReason}:{}}:Kp.has(W)&&Kp.has(ee.status)&&__.indexOf(W)>__.indexOf(ee.status)?{...ee,status:W}:ee})})}catch{}},[r]),x=y.useCallback(A=>{if(A.type!=="session_event")return!1;if(!Wz(A.payload))return hk("session_event","payload is not a valid SessionEvent"),!0;const P=A.payload;let Y=0;if(d(q=>{const ee=[...q,P];return ee.length>Ro?(Y=ee.length-Ro,ee.slice(-Ro)):ee}),Y>0&&p(q=>q+Y),P.eventType==="usage")try{const q=JSON.parse(P.content),ee=Number(q.input_tokens)||0,le=Number(q.output_tokens)||0,W=Number(q.cost_millicents)||0;(ee>0||le>0||W>0)&&s(re=>re.map($=>$.id===P.sessionId?{...$,inputTokens:($.inputTokens??0)+ee,outputTokens:($.outputTokens??0)+le,costMillicents:($.costMillicents??0)+W}:$))}catch{}if(P.eventType==="status"){const q=gk(P.content),ee=vk(P.content);s(le=>le.some(re=>re.id===P.sessionId)?le.map(re=>re.id===P.sessionId?{...re,status:q,...ee!==void 0?{endReason:ee}:{}}:re):[...le,{id:P.sessionId,environmentId:"",runtime:"",status:q,prompt:"",startedAt:P.timestamp,...ee!==void 0?{endReason:ee}:{}}])}return!0},[]),k=y.useCallback(A=>{x({type:"session_event",payload:A})},[x]),j=y.useCallback(A=>{var P,Y,q,ee,le;switch(A.type){case"sessions":{const W=Array.isArray((P=A.payload)==null?void 0:P.sessions)?A.payload.sessions:[];return s(W),!0}case"spawned":{const W=(Y=A.payload)==null?void 0:Y.sessionId;return typeof W=="string"&&W&&g(W),b().catch(()=>{}),!0}case"session_events":{const W=Array.isArray((q=A.payload)==null?void 0:q.events)?A.payload.events:[];return W.length>0&&d(W),!0}case"task_sessions":{const W=(ee=A.payload)==null?void 0:ee.taskId;if(typeof W=="string"&&W){const re=Array.isArray((le=A.payload)==null?void 0:le.sessions)?A.payload.sessions:[];_($=>({...$,[W]:re}))}return!0}default:return!1}},[b]),w=y.useCallback(async(A,P,Y,q,ee)=>{try{const le=await $e.spawnAgent({environmentId:A,prompt:P,personaId:Y||"",workingDirectory:q||"",workspaceId:ee||""});g(le.id),await b()}catch{}},[b]),T=y.useCallback(async(A,P)=>{await $e.sendInput({sessionId:A,text:P})},[]),C=y.useCallback(async A=>{try{await $e.killAgent({id:A,graceful:!1})}catch{}},[]),D=y.useCallback(async A=>{try{await $e.killAgent({id:A,graceful:!0})}catch{}},[]),O=y.useCallback(async A=>{try{const Y=(await $e.getSessionEvents({id:A})).events.map(RH);if(Y.length>0){let q=0;d(ee=>{const le=new Set;for(const $ of ee)$.sessionId===A&&le.add(`${$.timestamp}|${$.eventType}`);const W=Y.filter($=>!le.has(`${$.timestamp}|${$.eventType}`)),re=[...ee,...W].sort(($,B)=>$.sessionId!==B.sessionId?0:$.timestamp.localeCompare(B.timestamp));return re.length>Ro?(q=re.length-Ro,re.slice(-Ro)):re}),q>0&&p(ee=>ee+q)}}catch{}},[]),E=y.useCallback(()=>{d([]),p(0)},[]),M=y.useCallback(async A=>{try{const Y=(await $e.getTaskSessions({id:A})).sessions.map(g_);_(q=>({...q,[A]:Y}))}catch{}},[]);return{sessions:t,sessionsLoading:o,events:c,eventsDropped:u,lastSpawnedId:m,taskSessions:v,loadSessions:b,spawn:w,sendInput:T,kill:C,stopGraceful:D,loadSessionEvents:O,clearEvents:E,loadTaskSessions:M,handleMessage:x,handleSessionEvent:k,handleLegacyMessage:j,domainHook:{onConnect:()=>b(),onDisconnect:()=>{E()},handleEvent:()=>!1}}}function x_(t){return t instanceof fa?t.message:"Operation failed"}function qH(){const[t,s]=y.useState([]),{loading:o,track:r}=cs(),[c,d]=y.useState(!1),[u,p]=y.useState(""),m=y.useCallback(async()=>{try{const C=await r($e.listWorkspaces({}));s(C.workspaces.map(v_))}catch{}},[r]),g=y.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=y.useCallback(()=>{d(!1)},[]),_=y.useCallback(async(C,D,O,E,M,L,A,P,Y)=>{d(!0);try{const q=await $e.createWorkspace({name:C,description:D||"",repoUrl:O||"",environmentId:E||"",defaultPersonaId:M||void 0,useWorktrees:L??!0,workingDirectory:A||void 0}),ee=v_(q);s(le=>le.some(W=>W.id===ee.id)?le:[...le,ee]),d(!1),P==null||P(ee)}catch(q){d(!1);const ee=q instanceof fa?q.message:"Failed to create workspace";Y==null||Y(ee)}},[]),b=y.useCallback(async C=>{try{await $e.archiveWorkspace({id:C})}catch{}},[]),x=y.useCallback(async(C,D)=>{try{await $e.updateWorkspace({id:C,...D})}catch{}},[]),k=y.useCallback(()=>{p("")},[]),j=y.useCallback(async(C,D)=>{try{p(""),await $e.linkEnvironment({workspaceId:C,environmentId:D}),await m().catch(()=>{})}catch(O){p(x_(O))}},[m]),w=y.useCallback(async(C,D)=>{try{p(""),await $e.unlinkEnvironment({workspaceId:C,environmentId:D}),await m().catch(()=>{})}catch(O){p(x_(O))}},[m]);return{workspaces:t,workspacesLoading:o,workspaceCreating:c,loadWorkspaces:m,createWorkspace:_,archiveWorkspace:b,updateWorkspace:x,linkEnvironment:j,unlinkEnvironment:w,linkOperationError:u,clearLinkOperationError:k,handleEvent:g,onDisconnect:v,domainHook:{onConnect:()=>m(),onDisconnect:v,handleEvent:g}}}function GH(){const[t,s]=y.useState([]),{loading:o,track:r}=cs(),[c,d]=y.useState(void 0),u=y.useRef({}),p=y.useCallback(async E=>{try{const L=(await hn.listTasks({workspaceId:E})).tasks.map(y_);s(A=>[...A.filter(P=>P.workspaceId!==E),...L])}catch{}},[]),m=y.useCallback(async()=>{try{const M=(await r(hn.listTasks({}))).tasks.map(y_);s(L=>{const A=new Set(M.map(P=>P.id));return[...L.filter(P=>!A.has(P.id)),...M]})}catch{}},[r]),g=y.useCallback((E,M)=>{const L=A=>{clearTimeout(u.current[A]),u.current[A]=setTimeout(()=>{delete u.current[A],p(A).catch(()=>{})},200)};E?L(E):M&&s(A=>{const P=A.find(Y=>Y.id===M);return P!=null&&P.workspaceId?L(P.workspaceId):m().catch(()=>{}),A})},[p,m]),v=y.useCallback(E=>{const M=E.payload;switch(E.type){case"task.created":{const L=typeof M.workspaceId=="string"?M.workspaceId:"";return L&&p(L).catch(()=>{}),!0}case"task.started":{const L=typeof M.taskId=="string"?M.taskId:"",A=typeof M.sessionId=="string"?M.sessionId:"",P=typeof M.workspaceId=="string"?M.workspaceId:"";return d(Y=>L&&Y===L?void 0:Y),A&&L&&s(Y=>Y.map(q=>q.id===L?{...q,latestSessionId:A}:q)),g(P,L),!0}case"task.completed":case"task.deleted":case"task.reparented":case"task.updated":{const L=typeof M.workspaceId=="string"?M.workspaceId:"",A=typeof M.taskId=="string"?M.taskId:"";return d(P=>A&&P===A?void 0:P),g(L,A),!0}default:return!1}},[p,g]),_=y.useCallback(()=>{d(void 0)},[]),b=y.useCallback(E=>{var M,L;if(E.type==="tasks"){const A=Array.isArray((M=E.payload)==null?void 0:M.tasks)?E.payload.tasks:[],P=typeof((L=E.payload)==null?void 0:L.workspaceId)=="string"&&E.payload.workspaceId?E.payload.workspaceId:"";return s(P?Y=>[...Y.filter(q=>q.workspaceId!==P),...A]:Y=>{const q=new Set(A.map(ee=>ee.id));return[...Y.filter(ee=>!q.has(ee.id)),...A]}),!0}return!1},[]),x=y.useCallback(async(E,M,L,A,P,Y,q,ee,le)=>{try{await hn.createTask({workspaceId:E,title:M,description:L||"",dependsOn:A||[],parentTaskId:P||"",defaultPersonaId:Y||void 0,canDecompose:q??void 0}),ee==null||ee()}catch(W){const re=W instanceof fa?W.message:"Failed to create task";le==null||le(re)}},[]),k=y.useCallback(async(E,M,L,A)=>{d(E);try{await hn.startTask({taskId:E,personaId:M||"",environmentId:L||"",notes:A||""})}catch(P){if(P instanceof fa&&P.code===O_.ResourceExhausted)return;throw d(void 0),P}},[]),j=y.useCallback(async E=>{try{await hn.stopTask({id:E})}catch{}},[]),w=y.useCallback(async E=>{try{await hn.completeTask({id:E})}catch{}},[]),T=y.useCallback(async E=>{try{await hn.resumeTask({id:E})}catch{}},[]),C=y.useCallback(async(E,M,L,A,P)=>{try{await hn.updateTask({id:E,title:M,description:L,dependsOn:A,...P!==void 0?{defaultPersonaId:P}:{}})}catch{}},[]),D=y.useCallback(async E=>{try{await hn.deleteTask({id:E})}catch{}},[]);return{tasks:t,tasksLoading:o,taskStartingId:c,loadTasks:p,loadAllTasks:m,createTask:x,startTask:k,stopTask:j,completeTask:w,resumeTask:T,updateTask:C,deleteTask:D,handleEvent:v,onDisconnect:_,handleLegacyMessage:b,domainHook:{onConnect:()=>m(),onDisconnect:_,handleEvent:v}}}function FH(){const[t,s]=y.useState([]),[o,r]=y.useState(void 0),[c,d]=y.useState(!1),{loading:u,track:p}=cs(),m=y.useCallback(async k=>{try{const j=await p(hn.queryFindings({workspaceId:k}));s(j.findings.map(Vp))}catch{}},[p]),g=y.useCallback(async()=>{try{const k=await p(hn.queryFindings({workspaceId:""}));s(k.findings.map(Vp))}catch{}},[p]),v=y.useCallback(async k=>{r(void 0),d(!0);try{const j=await hn.getFinding({id:k});r(Vp(j))}catch{r(void 0)}finally{d(!1)}},[]),_=y.useCallback(k=>{if(k.type==="finding.posted"){const j=typeof k.payload.workspaceId=="string"?k.payload.workspaceId:"";return j&&m(j).catch(()=>{}),!0}return!1},[m]),b=y.useCallback(async(k,j,w,T,C)=>{try{await hn.postFinding({workspaceId:k,title:j,content:w,category:T??"general",tags:C??[]})}catch{}},[]);return{findings:t,selectedFinding:o,findingLoading:c,findingsLoading:u,loadFindings:m,loadAllFindings:g,loadFinding:v,postFinding:b,handleEvent:_,domainHook:{onConnect:()=>g(),onDisconnect:()=>{},handleEvent:_}}}function KH(){const[t,s]=y.useState([]),{loading:o,track:r}=cs(),c=y.useCallback(async()=>{try{const g=await r($e.listTokens({}));s(g.tokens.map(IH))}catch{}},[r]),d=y.useCallback(g=>g.type==="token.changed"?(c().catch(()=>{}),!0):!1,[c]),u=y.useCallback(async(g,v,_,b,x)=>{try{await $e.setToken({name:g,value:v,type:_,envVar:b,filePath:x})}catch{}},[]),p=y.useCallback(async g=>{try{await $e.deleteToken({name:g})}catch{}},[]);return{tokens:t,tokensLoading:o,loadTokens:c,setToken:u,deleteToken:p,handleEvent:d,domainHook:{onConnect:()=>c(),onDisconnect:()=>{},handleEvent:d}}}function ZH(){const[t,s]=y.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),{loading:o,track:r}=cs(),c=y.useCallback(async()=>{try{const m=await r($e.getCredentialProviders({}));s(OH(m))}catch{}},[r]),d=y.useCallback(m=>m.type==="credential.providers_changed"?(Qz(m.payload)&&s(m.payload),!0):!1,[]),u=y.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:_})=>$e.setCredentialProvider({provider:v,value:_})))},[]);return{credentialProviders:t,credentialsLoading:o,loadCredentials:c,updateCredentialProviders:u,handleEvent:d,domainHook:{onConnect:()=>c(),onDisconnect:()=>{},handleEvent:d}}}function YH(){const[t,s]=y.useState([]),[o,r]=y.useState(""),[c,d]=y.useState(""),[u,p]=y.useState(!1),m=y.useCallback(async _=>{try{const b=await $e.listCodespaces({githubAccountId:_??""});s(b.codespaces.map(LH)),d(b.error)}catch{}},[]),g=y.useCallback(async(_,b)=>{p(!0),r("");try{await $e.createCodespace({repo:_,machine:b??""}),p(!1),await m()}catch(x){p(!1);const k=x instanceof fa?x.message:"Failed to create codespace";r(k)}},[m]);return{codespaces:t,codespaceError:o,codespaceListError:c,codespaceCreating:u,listCodespaces:m,createCodespace:g,domainHook:{onConnect:()=>m(),onDisconnect:()=>{},handleEvent:()=>!1}}}function JH(){const[t,s]=y.useState([]),[o,r]=y.useState(""),c=y.useCallback(async()=>{try{const u=await $e.listDockerContainers({});s(u.containers.map(BH)),r(u.error)}catch(u){s([]),r(u instanceof Error?u.message:"Failed to list Docker containers")}},[]);return{dockerContainers:t,dockerContainersError:o,listDockerContainers:c,domainHook:{onConnect:async()=>{},onDisconnect:()=>{},handleEvent:()=>!1}}}function WH(){const[t,s]=y.useState([]),{loading:o,track:r}=cs(),c=y.useCallback(async()=>{try{const v=await r(hn.listPersonas({}));s(v.personas.map(qp))}catch{}},[r]),d=y.useCallback(v=>{switch(v.type){case"persona.created":case"persona.updated":case"persona.deleted":return c().catch(()=>{}),!0;default:return!1}},[c]),u=y.useCallback(async(v,_,b,x,k,j,w,T,C)=>{const D=await hn.createPersona({name:v,description:_,systemPrompt:b,runtime:x||"",model:k||"",maxTurns:j||0,type:w||"agent",script:T||"",allowedMcpTools:C||[]}),O=qp(D);return s(E=>[...E.filter(M=>M.id!==O.id),O]),O},[]),p=y.useCallback(async(v,_,b,x,k,j,w,T,C,D)=>{const O={id:v};_!==void 0&&(O.name=_),b!==void 0&&(O.description=b),x!==void 0&&(O.systemPrompt=x),k!==void 0&&(O.runtime=k),j!==void 0&&(O.model=j),w!==void 0&&(O.maxTurns=w),T!==void 0&&(O.type=T),C!==void 0&&(O.script=C),D!==void 0&&(O.allowedMcpTools={tools:D});const E=await hn.updatePersona(O),M=qp(E);return s(L=>L.map(A=>A.id===M.id?M:A)),M},[]),m=y.useCallback(async v=>{await hn.deletePersona({id:v}),s(_=>_.filter(b=>b.id!==v))},[]);return{personas:t,personasLoading:o,loadPersonas:c,createPersona:u,updatePersona:p,deletePersona:m,handleEvent:d,domainHook:{onConnect:()=>c(),onDisconnect:()=>{},handleEvent:d}}}function XH(){const[t,s]=y.useState([]),{loading:o,track:r}=cs(),c=y.useRef(void 0),d=y.useCallback(async()=>{try{const _=await r($c.listSchedules({}));s(_.schedules.map(Gp))}catch{}},[r]),u=y.useCallback(_=>{switch(_.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=y.useCallback(async(_,b,x,k,j,w)=>{const T=await $c.createSchedule({title:_,description:b,scheduleExpression:x,personaId:k,workspaceId:j||"",parentTaskId:w||""}),C=Gp(T);return s(D=>[...D.filter(O=>O.id!==C.id),C]),C},[]),m=y.useCallback(async(_,b)=>{const x={id:_};b.title!==void 0&&(x.title=b.title),b.description!==void 0&&(x.description=b.description),b.scheduleExpression!==void 0&&(x.scheduleExpression=b.scheduleExpression),b.personaId!==void 0&&(x.personaId=b.personaId),b.enabled!==void 0&&(x.enabled=b.enabled);const k=await $c.updateSchedule(x),j=Gp(k);return s(w=>w.map(T=>T.id===j.id?j:T)),j},[]),g=y.useCallback(async _=>{await $c.deleteSchedule({id:_}),s(b=>b.filter(x=>x.id!==_))},[]);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 QH(t){if(t)try{return JSON.parse(t)}catch{return}}function e9(){const[t,s]=y.useState(new Map),[o,r]=y.useState([]),[c,d]=y.useState(void 0),[u,p]=y.useState(void 0),[m,g]=y.useState(!1),[v,_]=y.useState(""),b=y.useRef(""),x=y.useCallback(async E=>{const M=E??"";b.current=M,_(""),g(!0);try{const L=await zc.listRecentKnowledgeNodes({limit:30,workspaceId:M}),A=new Map,P=[];for(const Y of L.nodes)A.set(Y.id,Qc(Y));for(const Y of L.edges)P.push(Fp(Y));for(const Y of P){const q=A.get(Y.source);q&&(q.val+=1);const ee=A.get(Y.target);ee&&(ee.val+=1)}s(A),r(P)}catch{}finally{g(!1)}},[]),k=y.useCallback(async E=>{if(E.trim()){_(E),p(void 0),d(void 0),g(!0);try{const M=await zc.searchKnowledge({query:E,limit:20,workspaceId:b.current}),L=new Map,A=[];for(const P of M.results){P.node&&L.set(P.node.id,Qc(P.node,P.edges.length));for(const Y of P.edges)A.push(Fp(Y))}s(L),r(A)}catch{}finally{g(!1)}}},[]),j=y.useCallback(()=>{x(b.current).catch(()=>{})},[x]),w=y.useCallback(async E=>{p(E);try{const M=await zc.getKnowledgeNode({id:E});if(!M.node){d(void 0);return}d({node:Qc(M.node,M.edges.length),edges:M.edges.map(L=>({fromId:L.fromId,toId:L.toId,type:L.type,metadata:QH(L.metadataJson)}))})}catch{d(void 0)}},[]),T=y.useCallback(()=>{p(void 0),d(void 0)},[]),C=y.useCallback(async E=>{try{const M=await zc.expandKnowledgeNode({id:E,depth:1});s(L=>{const A=new Map(L);for(const P of M.nodes)A.has(P.id)||A.set(P.id,Qc(P));return A}),r(L=>{const A=new Set(L.map(Y=>`${Y.source}:${Y.target}:${Y.type}`)),P=[];for(const Y of M.edges){const q=Fp(Y),ee=`${q.source}:${q.target}:${q.type}`;A.has(ee)||P.push(q)}return[...L,...P]})}catch{}},[]),D=y.useCallback(E=>!1,[]),O={onConnect:async()=>{},onDisconnect:()=>{},handleEvent:D};return{graphData:{nodes:[...t.values()],links:o},selectedNode:c,selectedId:u,loading:m,searchQuery:v,search:k,clearSearch:j,selectNode:w,clearSelection:T,expandNode:C,loadRecent:x,handleEvent:D,domainHook:O}}function t9(){const t=y.useRef("default");y.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:qd("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 n9(){const[t,s]=y.useState([]),[o,r]=y.useState(!1),[c,d]=y.useState(!1),{loading:u,track:p}=cs(),m=y.useRef(0),g=y.useCallback(async(b=!1)=>{const x=m.current;try{const k=await p($e.listStreams({includeInternal:b}));m.current===x&&(s(k.streams.map(HH)),d(!1))}catch{m.current===x&&d(!0)}finally{m.current===x&&r(!0)}},[p]),v=y.useCallback(b=>!1,[]);return{streams:t,streamsLoading:u,streamsLoadedOnce:o,streamsLoadError:c,loadStreams:g,handleEvent:v,domainHook:{onConnect:g,onDisconnect:()=>{m.current+=1,s([]),r(!1),d(!1)},handleEvent:v}}}function s9(){const[t,s]=y.useState([]),{loading:o,track:r}=cs(),c=y.useCallback(async()=>{try{const m=await r($e.listPlugins({}));s(m.plugins.map(g=>({name:g.name,description:g.description,enabled:g.enabled,required:g.required,loaded:g.loaded})))}catch{}},[r]),d=y.useCallback(m=>m.type==="plugin.changed"?(c().catch(()=>{}),!0):!1,[c]),u=y.useCallback(async(m,g)=>{try{const v=await $e.setPluginEnabled({name:m,enabled:g});s(_=>_.map(b=>b.name===v.name?{...b,enabled:v.enabled}:b))}catch{}},[]);return{plugins:t,pluginsLoading:o,loadPlugins:c,setPluginEnabled:u,domainHook:{onConnect:()=>c(),onDisconnect:()=>{},handleEvent:d}}}function a9(){const[t,s]=y.useState([]),{loading:o,track:r}=cs(),c=y.useCallback(async()=>{try{const _=await r($e.listGitHubAccounts({}));s(_.accounts.map(b=>({id:b.id,label:b.label,username:b.username,isDefault:b.isDefault,createdAt:b.createdAt})))}catch{}},[r]),d=y.useCallback(_=>_.type==="github_account.changed"?(c().catch(()=>{}),!0):!1,[c]),u=y.useCallback(async(_,b,x,k)=>{const j=await $e.addGitHubAccount({label:_,token:b,username:x,isDefault:k});s(w=>[...j.isDefault?w.map(C=>({...C,isDefault:!1})):w,{id:j.id,label:j.label,username:j.username,isDefault:j.isDefault,createdAt:j.createdAt}])},[]),p=y.useCallback(async(_,b)=>{const x=await $e.updateGitHubAccount({id:_,...b});s(k=>k.map(j=>j.id===x.id?{...j,label:x.label,username:x.username,isDefault:x.isDefault}:b.isDefault?{...j,isDefault:!1}:j))},[]),m=y.useCallback(async _=>{await $e.removeGitHubAccount({id:_}),s(b=>b.filter(x=>x.id!==_))},[]),g=y.useCallback(async()=>{const _=await $e.importGitHubAccounts({});return _.imported>0&&await c(),{imported:_.imported,usernames:_.usernames}},[c]);return{githubAccounts:t,githubAccountsLoading:o,loadGitHubAccounts:c,addGitHubAccount:u,updateGitHubAccount:p,removeGitHubAccount:m,importGitHubAccounts:g,domainHook:{onConnect:()=>c(),onDisconnect:()=>{},handleEvent:d}}}function i9(){const[t,s]=y.useState(""),[o,r]=y.useState(void 0),[c,d]=y.useState({}),{pluginNames:u}=Fd(),p=DH(u),m=PH(),g=VH(),v=qH(),_=GH(),b=FH(),x=KH(),k=ZH(),j=YH(),w=JH(),T=WH(),C=XH(),D=e9(),O=t9(),E=n9(),M=s9(),L=a9(),A=[...p.has("environments")?[m.domainHook]:[],...p.has("sessions")?[g.domainHook]:[],...p.has("workspaces")?[v.domainHook]:[],...p.has("tasks")?[_.domainHook]:[],...p.has("findings")?[b.domainHook]:[],...p.has("tokens")?[x.domainHook]:[],...p.has("credentials")?[k.domainHook]:[],...p.has("codespaces")?[j.domainHook]:[],...p.has("dockerContainers")?[w.domainHook]:[],...p.has("personas")?[T.domainHook]:[],...p.has("schedules")?[C.domainHook]:[],...p.has("knowledge")?[D.domainHook]:[],...p.has("notifications")?[O.domainHook]:[],...p.has("streams")?[E.domainHook]:[],...p.has("plugins")?[M.domainHook]:[],L.domainHook],{connectionStatus:P}=wH({onSessionEvent:oe=>{g.handleSessionEvent({sessionId:oe.sessionId,eventType:L_(oe.type),timestamp:oe.timestamp,content:oe.content,raw:oe.raw||void 0})},onDomainEvent:oe=>{try{const X=JSON.parse(oe.payloadJson);re({id:oe.id,type:oe.type,timestamp:oe.timestamp,payload:X})}catch{console.warn("[grackle] Failed to parse domain event payloadJson:",oe.payloadJson)}},onConnect:$,onDisconnect:B}),Y="default_persona_id",q="onboarding_completed",ee=y.useCallback(async oe=>{const X=await $e.setSetting({key:Y,value:oe});s(X.value)},[]),le=y.useCallback(async()=>{r(!0);try{await $e.setSetting({key:q,value:"true"})}catch{}},[]),W=y.useCallback(async(oe,X)=>{try{const ce=await $e.getUsage({scope:oe,id:X}),fe=`${oe}:${X}`;d(ge=>({...ge,[fe]:$H(ce)}))}catch{}},[]);function re(oe){const X=oe.payload.key,ce=oe.payload.value;if(oe.type==="setting.changed"){X===Y&&s(ce??""),X===q&&r(ce==="true");return}for(const fe of A)if(fe.handleEvent(oe))break;(oe.type==="environment.removed"||oe.type==="task.started")&&g.loadSessions().catch(()=>{}),(oe.type==="session.started"||oe.type==="session.stopped")&&E.loadStreams().catch(()=>{})}async function $(){for(const oe of A)oe.onConnect().catch(()=>{});try{const oe=await $e.getSetting({key:Y});s(oe.value)}catch{}try{const oe=await $e.getSetting({key:q});r(oe.value==="true")}catch{}}function B(){A.forEach(oe=>oe.onDisconnect())}const se=y.useCallback(()=>{m.loadEnvironments().catch(()=>{}),g.loadSessions().catch(()=>{}),v.loadWorkspaces().catch(()=>{}),x.loadTokens().catch(()=>{})},[m.loadEnvironments,g.loadSessions,v.loadWorkspaces,x.loadTokens]);return{connectionStatus:P,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:_.tasks,tasksLoading:_.tasksLoading,taskStartingId:_.taskStartingId,loadTasks:_.loadTasks,loadAllTasks:_.loadAllTasks,createTask:_.createTask,startTask:_.startTask,stopTask:_.stopTask,completeTask:_.completeTask,resumeTask:_.resumeTask,updateTask:_.updateTask,deleteTask:_.deleteTask,domainHook:_.domainHook},findings:{findings:b.findings,selectedFinding:b.selectedFinding,findingLoading:b.findingLoading,findingsLoading:b.findingsLoading,loadFindings:b.loadFindings,loadAllFindings:b.loadAllFindings,loadFinding:b.loadFinding,postFinding:b.postFinding,domainHook:b.domainHook},tokens:{tokens:x.tokens,tokensLoading:x.tokensLoading,loadTokens:x.loadTokens,setToken:x.setToken,deleteToken:x.deleteToken,domainHook:x.domainHook},credentials:{credentialProviders:k.credentialProviders,credentialsLoading:k.credentialsLoading,updateCredentialProviders:k.updateCredentialProviders,domainHook:k.domainHook},codespaces:{codespaces:j.codespaces,codespaceError:j.codespaceError,codespaceListError:j.codespaceListError,codespaceCreating:j.codespaceCreating,listCodespaces:j.listCodespaces,createCodespace:j.createCodespace,domainHook:j.domainHook},dockerContainers:{dockerContainers:w.dockerContainers,dockerContainersError:w.dockerContainersError,listDockerContainers:w.listDockerContainers,domainHook:w.domainHook},personas:{personas:T.personas,personasLoading:T.personasLoading,createPersona:T.createPersona,updatePersona:T.updatePersona,deletePersona:T.deletePersona,domainHook:T.domainHook},schedules:{schedules:C.schedules,schedulesLoading:C.schedulesLoading,createSchedule:C.createSchedule,updateSchedule:C.updateSchedule,deleteSchedule:C.deleteSchedule,domainHook:C.domainHook},streams:{streams:E.streams,streamsLoading:E.streamsLoading,streamsLoadedOnce:E.streamsLoadedOnce,streamsLoadError:E.streamsLoadError,loadStreams:E.loadStreams,domainHook:E.domainHook},knowledge:D,plugins:{plugins:M.plugins,pluginsLoading:M.pluginsLoading,loadPlugins:M.loadPlugins,setPluginEnabled:M.setPluginEnabled},githubAccounts:{githubAccounts:L.githubAccounts,githubAccountsLoading:L.githubAccountsLoading,loadGitHubAccounts:L.loadGitHubAccounts,addGitHubAccount:L.addGitHubAccount,updateGitHubAccount:L.updateGitHubAccount,removeGitHubAccount:L.removeGitHubAccount,importGitHubAccounts:L.importGitHubAccounts},appDefaultPersonaId:t,setAppDefaultPersonaId:ee,onboardingCompleted:o,completeOnboarding:le,usageCache:c,loadUsage:W,refresh:se}}function o9({children:t}){const s=i9();return a.jsx(_h.Provider,{value:s,children:t})}function r9(t,s){const o=y.useRef(null);y.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);p&&p.status!==u.status&&(u.status==="sleeping"||u.status==="connecting"||(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")))}for(const u of r)d.has(u.id)||s("Environment removed","info")},[t,s])}function l9(t,s,o){const r=y.useRef(t);y.useEffect(()=>{t&&t!==r.current&&(o(t,"error"),s()),r.current=t},[t,s,o])}const c9={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 d9(t){return c9[t]}function u9(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=d9(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 f9(t,s){const o=y.useRef(void 0);y.useEffect(()=>{const r=o.current;o.current=t;const c=u9(r,t);for(const d of c)s(d.message,d.variant)},[t,s])}const p9="_dashboard_16pzm_1",m9="_kpiStrip_16pzm_11",h9="_kpiCard_16pzm_23",g9="_kpiValue_16pzm_68",v9="_kpiLabel_16pzm_76",y9="_bodyGrid_16pzm_84",b9="_section_16pzm_96",_9="_sectionHeader_16pzm_109",x9="_sectionIcon_16pzm_118",k9="_sectionTitle_16pzm_123",S9="_sectionCount_16pzm_131",j9="_sectionBody_16pzm_138",w9="_emptyHint_16pzm_143",T9="_sessionRow_16pzm_150",N9="_sessionPrompt_16pzm_177",C9="_sessionEnv_16pzm_186",E9="_sessionRuntime_16pzm_192",A9="_sessionStatus_16pzm_198",D9="_statusDot_16pzm_207",M9="_attentionRow_16pzm_233",R9="_attentionTitle_16pzm_259",I9="_attentionMeta_16pzm_267",O9="_reasonBadge_16pzm_274",L9="_bottomGrid_16pzm_301",B9="_envRow_16pzm_312",$9="_envName_16pzm_323",z9="_envStatusBadge_16pzm_333",H9="_workspaceRow_16pzm_369",P9="_workspaceTop_16pzm_395",U9="_workspaceName_16pzm_401",V9="_workspaceCounts_16pzm_407",q9="_progressBar_16pzm_415",G9="_progressFill_16pzm_422",he={dashboard:p9,kpiStrip:m9,kpiCard:h9,kpiValue:g9,kpiLabel:v9,bodyGrid:y9,section:b9,sectionHeader:_9,sectionIcon:x9,sectionTitle:k9,sectionCount:S9,sectionBody:j9,emptyHint:w9,sessionRow:T9,sessionPrompt:N9,sessionEnv:C9,sessionRuntime:E9,sessionStatus:A9,statusDot:D9,attentionRow:M9,attentionTitle:R9,attentionMeta:I9,reasonBadge:O9,bottomGrid:L9,envRow:B9,envName:$9,envStatusBadge:z9,workspaceRow:H9,workspaceTop:P9,workspaceName:U9,workspaceCounts:V9,progressBar:q9,progressFill:G9};function F9(){return a.jsxs("div",{className:he.dashboard,"aria-hidden":"true",children:[a.jsx("div",{className:he.kpiStrip,children:Array.from({length:4},(t,s)=>a.jsxs("div",{className:he.kpiCard,children:[a.jsx(we,{width:"3rem",height:"2rem"}),a.jsx(we,{width:"80%",height:"0.75rem"})]},s))}),a.jsxs("div",{className:he.bodyGrid,children:[a.jsxs("div",{className:he.section,children:[a.jsxs("div",{className:he.sectionHeader,children:[a.jsx(we,{width:"1rem",height:"1rem",variant:"circular"}),a.jsx(we,{width:"8rem",height:"0.75rem"}),a.jsx("span",{className:he.sectionCount,children:a.jsx(we,{width:"1rem",height:"0.75rem"})})]}),a.jsx("div",{className:he.sectionBody,children:Array.from({length:3},(t,s)=>a.jsxs("div",{className:he.sessionRow,style:{cursor:"default"},children:[a.jsx(we,{width:"60%",height:"0.875rem"}),a.jsx(we,{width:"4rem",height:"0.75rem"}),a.jsx(we,{width:"3rem",height:"0.75rem"}),a.jsx(we,{width:"3rem",height:"0.75rem"})]},s))})]}),a.jsxs("div",{className:he.section,children:[a.jsxs("div",{className:he.sectionHeader,children:[a.jsx(we,{width:"1rem",height:"1rem",variant:"circular"}),a.jsx(we,{width:"8rem",height:"0.75rem"}),a.jsx("span",{className:he.sectionCount,children:a.jsx(we,{width:"1rem",height:"0.75rem"})})]}),a.jsx("div",{className:he.sectionBody,children:Array.from({length:2},(t,s)=>a.jsxs("div",{className:he.attentionRow,style:{cursor:"default"},children:[a.jsxs("div",{className:he.attentionTitle,children:[a.jsx(we,{width:"3rem",height:"0.875rem",borderRadius:"var(--radius-sm)"}),a.jsx(we,{width:"70%",height:"0.875rem"})]}),a.jsx("div",{className:he.attentionMeta,children:a.jsx(we,{width:"5rem",height:"0.625rem"})})]},s))})]})]}),a.jsxs("div",{className:he.bottomGrid,children:[a.jsxs("div",{className:he.section,children:[a.jsxs("div",{className:he.sectionHeader,children:[a.jsx(we,{width:"1rem",height:"1rem",variant:"circular"}),a.jsx(we,{width:"9rem",height:"0.75rem"}),a.jsx("span",{className:he.sectionCount,children:a.jsx(we,{width:"1rem",height:"0.75rem"})})]}),a.jsx("div",{className:he.sectionBody,children:Array.from({length:2},(t,s)=>a.jsxs("div",{className:he.envRow,children:[a.jsx(we,{width:"60%",height:"0.875rem"}),a.jsx(we,{width:"4rem",height:"0.875rem",borderRadius:"var(--radius-sm)"})]},s))})]}),a.jsxs("div",{className:he.section,children:[a.jsxs("div",{className:he.sectionHeader,children:[a.jsx(we,{width:"1rem",height:"1rem",variant:"circular"}),a.jsx(we,{width:"6rem",height:"0.75rem"}),a.jsx("span",{className:he.sectionCount,children:a.jsx(we,{width:"1rem",height:"0.75rem"})})]}),a.jsx("div",{className:he.sectionBody,children:Array.from({length:2},(t,s)=>a.jsxs("div",{className:he.workspaceRow,style:{cursor:"default"},children:[a.jsxs("div",{className:he.workspaceTop,children:[a.jsx(we,{width:"50%",height:"0.875rem"}),a.jsx(we,{width:"2rem",height:"0.75rem"})]}),a.jsx("div",{className:he.progressBar,children:a.jsx("div",{className:he.progressFill,style:{width:"0%"}})})]},s))})]})]})]})}const K9={hidden:{opacity:0,y:12},visible:t=>({opacity:1,y:0,transition:{delay:t*.06,duration:.3,ease:"easeOut"}})},ed={hidden:{opacity:0,y:16},visible:t=>({opacity:1,y:0,transition:{delay:.15+t*.08,duration:.35,ease:"easeOut"}})};function Z9(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 td({value:t,label:s,accent:o,index:r,testId:c}){return a.jsxs(Ct.div,{className:he.kpiCard,"data-accent":o,"data-testid":c,variants:K9,initial:"hidden",animate:"visible",custom:r,children:[a.jsx("span",{className:he.kpiValue,children:t}),a.jsx("span",{className:he.kpiLabel,children:s})]})}function Y9(){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=ut(),v=y.useRef(new Set);y.useEffect(()=>{for(const w of t)v.current.has(w.id)||(v.current.add(w.id),c(w.id).catch(()=>{}))},[t,c]);const _=y.useMemo(()=>dH(d,o,p),[d,o,p]),b=y.useMemo(()=>fH(d,p),[d,p]),x=y.useMemo(()=>uH(o,t),[o,t]),k=y.useMemo(()=>pH(t,o),[t,o,p]);return d.length===0&&o.length===0&&p.length===0&&t.length===0&&(u||r||m||s)?a.jsx(F9,{}):a.jsxs("div",{className:he.dashboard,"data-testid":"dashboard",children:[a.jsxs("div",{className:he.kpiStrip,"data-testid":"dashboard-kpi-strip",children:[a.jsx(td,{value:_.activeSessions,label:"Active Sessions",accent:"green",index:0,testId:"kpi-active-sessions"}),a.jsx(td,{value:_.blockedTasks,label:"Blocked Tasks",accent:"yellow",index:1,testId:"kpi-blocked-tasks"}),a.jsx(td,{value:_.attentionTasks,label:"Needs Attention",accent:"red",index:2,testId:"kpi-attention-tasks"}),a.jsx(td,{value:_.unhealthyEnvironments,label:"Unhealthy Envs",accent:"blue",index:3,testId:"kpi-unhealthy-envs"})]}),a.jsxs("div",{className:he.bodyGrid,children:[a.jsxs(Ct.div,{className:he.section,variants:ed,initial:"hidden",animate:"visible",custom:0,"data-testid":"dashboard-active-sessions",children:[a.jsxs("div",{className:he.sectionHeader,children:[a.jsx("span",{className:he.sectionIcon,"aria-hidden":"true",children:"●"}),a.jsx("span",{className:he.sectionTitle,children:"Active Sessions"}),a.jsx("span",{className:he.sectionCount,children:b.length})]}),a.jsx("div",{className:he.sectionBody,children:b.length===0?a.jsx("div",{className:he.emptyHint,children:"No active sessions"}):b.map(({session:w,environmentName:T})=>a.jsxs("button",{type:"button",className:he.sessionRow,onClick:()=>g(Ld(w.id)),"data-testid":"session-row",children:[a.jsx("span",{className:he.sessionPrompt,title:w.prompt,children:w.prompt||"—"}),a.jsx("span",{className:he.sessionEnv,children:T}),a.jsx("span",{className:he.sessionRuntime,children:w.runtime}),a.jsxs("span",{className:he.sessionStatus,children:[a.jsx("span",{className:he.statusDot,"data-status":w.status}),w.status]})]},w.id))})]}),a.jsxs(Ct.div,{className:he.section,variants:ed,initial:"hidden",animate:"visible",custom:1,"data-testid":"dashboard-needs-attention",children:[a.jsxs("div",{className:he.sectionHeader,children:[a.jsx("span",{className:he.sectionIcon,"aria-hidden":"true",children:"⚑"}),a.jsx("span",{className:he.sectionTitle,children:"Needs Attention"}),a.jsx("span",{className:he.sectionCount,children:x.length})]}),a.jsx("div",{className:he.sectionBody,children:x.length===0?a.jsx("div",{className:he.emptyHint,children:"All clear"}):x.map(({task:w,reason:T,workspaceName:C})=>a.jsxs("button",{type:"button",className:he.attentionRow,onClick:()=>g(Pn(w.id)),"data-testid":"attention-row",children:[a.jsxs("div",{className:he.attentionTitle,children:[a.jsx("span",{className:he.reasonBadge,"data-reason":T,children:T}),w.title]}),a.jsx("div",{className:he.attentionMeta,children:a.jsx("span",{children:C})})]},w.id))})]})]}),a.jsxs("div",{className:he.bottomGrid,children:[a.jsxs(Ct.div,{className:he.section,variants:ed,initial:"hidden",animate:"visible",custom:2,"data-testid":"dashboard-env-health",children:[a.jsxs("div",{className:he.sectionHeader,children:[a.jsx("span",{className:he.sectionIcon,"aria-hidden":"true",children:"◈"}),a.jsx("span",{className:he.sectionTitle,children:"Environment Health"}),a.jsx("span",{className:he.sectionCount,children:p.length})]}),a.jsx("div",{className:he.sectionBody,children:p.length===0?a.jsx("div",{className:he.emptyHint,children:"No environments configured"}):p.map(w=>a.jsxs("div",{className:he.envRow,"data-testid":"dashboard-env-row",children:[a.jsx("span",{className:he.envName,children:w.displayName}),a.jsx("span",{className:he.envStatusBadge,"data-status":w.status,children:w.status})]},w.id))})]}),a.jsxs(Ct.div,{className:he.section,variants:ed,initial:"hidden",animate:"visible",custom:3,"data-testid":"dashboard-workspace-snapshot",children:[a.jsxs("div",{className:he.sectionHeader,children:[a.jsx("span",{className:he.sectionIcon,"aria-hidden":"true",children:"▦"}),a.jsx("span",{className:he.sectionTitle,children:"Workspaces"}),a.jsx("span",{className:he.sectionCount,children:t.length})]}),a.jsx("div",{className:he.sectionBody,children:k.length===0?a.jsx("div",{className:he.emptyHint,children:"No workspaces yet"}):k.map(({workspace:w,totalTasks:T,completedTasks:C,workingTasks:D,failedTasks:O})=>{const E=T>0?Math.round(C/T*100):0;return a.jsxs("button",{type:"button",className:he.workspaceRow,onClick:()=>g(Xa(w.id,w.linkedEnvironmentIds[0])),"data-testid":"workspace-row",children:[a.jsxs("div",{className:he.workspaceTop,children:[a.jsx("span",{className:he.workspaceName,children:w.name}),a.jsxs("span",{className:he.workspaceCounts,"aria-label":Z9(C,T,D,O),children:[C,"/",T,D>0&&a.jsxs("span",{style:{color:"var(--accent-green)"},"aria-hidden":"true",children:["▸",D]}),O>0&&a.jsxs("span",{style:{color:"var(--accent-red)"},"aria-hidden":"true",children:["✗",O]})]})]}),T>0&&a.jsx("div",{className:he.progressBar,children:a.jsx("div",{className:he.progressFill,style:{width:`${E}%`}})})]},w.id)})})]})]})]})}const J9="_panelContainer_1udy7_1",W9="_emptyState_1udy7_8",X9="_workspaceSummary_1udy7_17",Q9="_workspaceSummaryTitle_1udy7_28",eP="_workspaceSummarySubtitle_1udy7_32",tP="_header_1udy7_36",nP="_headerInfo_1udy7_71",sP="_headerTitle_1udy7_106",aP="_taskStatusBadge_1udy7_128",iP="_taskBranch_1udy7_137",oP="_taskBlockedBadge_1udy7_143",rP="_tabBar_1udy7_277",lP="_tab_1udy7_277",cP="_active_1udy7_303",dP="_eventScroll_1udy7_308",uP="_tabContent_1udy7_314",fP="_noContext_1udy7_319",pP="_overviewContent_1udy7_325",mP="_overviewDashboard_1udy7_334",hP="_overviewHero_1udy7_340",gP="_overviewSection_1udy7_347",vP="_overviewLabel_1udy7_353",yP="_envRow_1udy7_360",bP="_timeline_1udy7_366",_P="_timelineRow_1udy7_372",xP="_waitingMessage_1udy7_379",kP="_errorMessage_1udy7_383",SP="_emptyCta_1udy7_387",jP="_ctaTitle_1udy7_399",wP="_ctaDescription_1udy7_405",TP="_ctaButton_1udy7_412",NP="_workspaceHeader_1udy7_533",CP="_workspaceName_1udy7_558",EP="_workspaceMeta_1udy7_571",AP="_metaRow_1udy7_579",DP="_metaLabel_1udy7_592",MP="_metaValue_1udy7_607",RP="_archiveButton_1udy7_617",IP="_repoLink_1udy7_647",OP="_metaToggle_1udy7_657",LP="_metaToggleArrow_1udy7_678",BP="_metaToggleArrowOpen_1udy7_683",$P="_progressBarContainer_1udy7_687",zP="_progressBar_1udy7_687",HP="_progressFill_1udy7_703",PP="_progressLabel_1udy7_710",UP="_metaTimestamps_1udy7_717",VP="_metaTimestamp_1udy7_717",qP="_metaPlaceholder_1udy7_739",GP="_linkedEnvList_1udy7_744",FP="_linkedEnvChip_1udy7_750",KP="_chipDismiss_1udy7_762",ZP="_linkError_1udy7_777",YP="_linkEnvSelect_1udy7_782",J={panelContainer:J9,emptyState:W9,workspaceSummary:X9,workspaceSummaryTitle:Q9,workspaceSummarySubtitle:eP,header:tP,headerInfo:nP,headerTitle:sP,taskStatusBadge:aP,taskBranch:iP,taskBlockedBadge:oP,tabBar:rP,tab:lP,active:cP,eventScroll:dP,tabContent:uP,noContext:fP,overviewContent:pP,overviewDashboard:mP,overviewHero:hP,overviewSection:gP,overviewLabel:vP,envRow:yP,timeline:bP,timelineRow:_P,waitingMessage:xP,errorMessage:kP,emptyCta:SP,ctaTitle:jP,ctaDescription:wP,ctaButton:TP,workspaceHeader:NP,workspaceName:CP,workspaceMeta:EP,metaRow:AP,metaLabel:DP,metaValue:MP,archiveButton:RP,repoLink:IP,metaToggle:OP,metaToggleArrow:LP,metaToggleArrowOpen:BP,progressBarContainer:$P,progressBar:zP,progressFill:HP,progressLabel:PP,metaTimestamps:UP,metaTimestamp:VP,metaPlaceholder:qP,linkedEnvList:GP,linkedEnvChip:FP,chipDismiss:KP,linkError:ZP,linkEnvSelect:YP};function JP(){return a.jsx("div",{className:J.emptyState,children:"Select a task or click + to create one"})}function WP(){return a.jsx("div",{className:J.emptyState,children:"Select an environment to manage its workspaces, or add a new one."})}function XP(){const{workspaces:{workspaces:t},environments:{environments:s}}=ot(),o=ut(),r=s.length>0;return t.length>0?a.jsx(Y9,{}):a.jsxs("div",{className:J.emptyCta,"data-testid":"welcome-cta",children:[a.jsx("div",{className:J.ctaTitle,children:"Welcome to Grackle"}),a.jsx("div",{className:J.ctaDescription,children:"Organize your work into workspaces and let agents tackle the tasks."}),a.jsx("button",{className:J.ctaButton,onClick:()=>o(cx),disabled:!r,"data-testid":"welcome-create-button",children:"Create Your First Workspace"}),!r&&a.jsx("div",{className:J.ctaDescription,children:"Add an environment first before creating a workspace."})]})}const QP="_panelContainer_1rih4_1",eU="_chatHeader_1rih4_9",tU="_chatHeaderInfo_1rih4_38",nU="_chatHeaderActions_1rih4_44",sU="_emptyState_1rih4_64",aU="_emptyTitle_1rih4_76",iU="_emptyDescription_1rih4_82",oU="_emptyHint_1rih4_88",la={panelContainer:QP,chatHeader:eU,chatHeaderInfo:tU,chatHeaderActions:nU,emptyState:sU,emptyTitle:aU,emptyDescription:iU,emptyHint:oU};function k_(){return a.jsx("div",{className:la.panelContainer,"aria-hidden":"true",children:a.jsxs("div",{style:{flex:1,overflow:"hidden",padding:"var(--space-md)",display:"flex",flexDirection:"column",gap:"var(--space-md)"},children:[a.jsx(we,{width:"65%",height:"2.5rem",borderRadius:"var(--radius-sm)"}),a.jsx(we,{width:"85%",height:"4rem",borderRadius:"var(--radius-sm)"}),a.jsx(we,{width:"45%",height:"2rem",borderRadius:"var(--radius-sm)"}),a.jsx(we,{width:"75%",height:"3rem",borderRadius:"var(--radius-sm)"}),a.jsx(we,{width:"55%",height:"2.5rem",borderRadius:"var(--radius-sm)"})]})})}function rU({hasLocalEnvironment:t}){return a.jsxs("div",{className:la.emptyState,"data-testid":"chat-empty-state",children:[a.jsx("div",{className:la.emptyTitle,children:"Welcome to Grackle"}),a.jsx("div",{className:la.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&&a.jsx("div",{className:la.emptyHint,children:"Go to Settings → Environments to add one."})]})}function lU(){const t=jh(),{tasks:{tasks:s,tasksLoading:o,startTask:r},sessions:{sessions:c,sessionsLoading:d,events:u,eventsDropped:p,taskSessions:m,loadTaskSessions:g,loadSessionEvents:v,kill:_,stopGraceful:b,sendInput:x,spawn:k},environments:{environments:j,provisionEnvironment:w},personas:{personas:T}}=ot(),{showToast:C}=gn(),D=y.useRef(void 0),[O,E]=y.useState(),M=s.find(le=>le.id===Lc),L=M!=null&&M.latestSessionId?c.find(le=>le.id===M.latestSessionId)??(m[Lc]??[]).find(le=>le.id===M.latestSessionId):void 0;y.useEffect(()=>{g(Lc).catch(()=>{})},[M==null?void 0:M.latestSessionId,g]),y.useEffect(()=>{L&&L.id!==D.current&&(D.current=L.id,v(L.id).catch(()=>{}))},[L==null?void 0:L.id,v]);const A=y.useMemo(()=>{if(!L)return[];const le=u.filter(W=>W.sessionId===L.id);return Sh(kh(le))},[u,L==null?void 0:L.id]),P=j.find(le=>le.adapterType==="local"&&le.status==="connected"),Y=L!==void 0&&L.status!=="stopped"&&L.status!=="suspended",q=(L==null?void 0:L.status)==="idle";y.useEffect(()=>{O&&L&&q&&(x(L.id,O).catch(()=>{C("Failed to send message","error")}),E(void 0))},[O,q,L==null?void 0:L.id,x,C]);const ee=y.useCallback((le,W,re,$)=>{$&&E($),r(le,W,re).catch(()=>{})},[r]);return!M&&(d||o)?a.jsx(k_,{}):M!=null&&M.latestSessionId&&!L?a.jsx(k_,{}):a.jsxs("div",{className:la.panelContainer,"data-testid":"chat-page",children:[Y&&a.jsxs("div",{className:la.chatHeader,children:[a.jsxs("span",{className:la.chatHeaderInfo,children:["Session: ",L.id.slice(0,8)," | ",L.runtime," | ",L.status]}),a.jsx("div",{className:la.chatHeaderActions,children:a.jsx(ux,{label:"Stop",onClick:()=>{b(L.id).catch(()=>{})},variant:"danger",size:"sm","data-testid":"stop-split-button",options:[{label:"Stop",description:"Graceful shutdown",onClick:()=>{b(L.id).catch(()=>{})}},{label:"Kill",description:"Force kill",onClick:()=>{_(L.id).catch(()=>{})}}]})})]}),a.jsx(yh,{events:A,eventsDropped:p,sandboxProxyUrl:t,emptyState:a.jsx(rU,{hasLocalEnvironment:!!P}),onShowToast:C}),P&&a.jsx(Dd,{mode:Y?"send":"start",sessionId:Y?L.id:void 0,taskId:Lc,environmentId:Y?L.environmentId:P.id,personas:T,environments:j,onSendInput:(le,W)=>{x(le,W).catch(()=>{C("Failed to send message","error")})},onSpawn:(le,W,re)=>{k(le,W,re).catch(()=>{})},onStartTask:ee,onProvisionEnvironment:le=>{w(le).catch(()=>{})},onShowToast:C})]})}const cU="_container_1jtgv_1",dU={container:cU};function uU(){const{streams:{streams:t,streamsLoading:s,streamsLoadedOnce:o,streamsLoadError:r,loadStreams:c},sessions:{sessions:d},tasks:{tasks:u}}=ot(),[p,m]=y.useState(!1),[g,v]=y.useState(void 0),_=y.useRef(!1);y.useEffect(()=>{if(!_.current){_.current=!0;return}c(p).catch(()=>{})},[p,c]);const b=y.useCallback(()=>{c(p).catch(()=>{})},[c,p]),x=g!==void 0?t.find(k=>k.id===g):void 0;return a.jsxs("div",{className:dU.container,"data-testid":"coordination-page",children:[a.jsx(w$,{streams:t,sessions:d,tasks:u,loading:s,loadError:r,loadedOnce:o,showInternals:p,onToggleInternals:m,selectedStreamId:g,onSelectStream:v,onRefresh:b}),x&&a.jsx(nz,{stream:x,onClose:()=>v(void 0)})]})}function fU(){const t=sH(),[s]=Lm(),o=s.get("env")??"",{sessions:{sendInput:r,spawn:c},tasks:{startTask:d},personas:{personas:u},environments:{environments:p,provisionEnvironment:m}}=ot(),{showToast:g}=gn();return a.jsxs("div",{className:J.panelContainer,children:[a.jsx(ks,{segments:t}),a.jsx("div",{className:J.emptyState,children:"Enter a prompt below to start a new session"}),a.jsx(Dd,{mode:"spawn",environmentId:o,showPersonaSelect:!0,personas:u,environments:p,onSendInput:(v,_)=>{r(v,_).catch(()=>{g("Failed to send message","error")})},onSpawn:(v,_,b)=>{c(v,_,b).catch(()=>{})},onStartTask:(v,_,b)=>{d(v,_,b).catch(()=>{})},onProvisionEnvironment:v=>{m(v).catch(()=>{})},onShowToast:g})]})}function pU(){return a.jsxs("div",{className:J.panelContainer,"aria-hidden":"true",children:[a.jsxs("div",{className:J.header,children:[a.jsx("span",{children:a.jsx(we,{width:"10rem",height:"0.875rem"})}),a.jsx("span",{className:J.headerInfo,children:a.jsx(we,{width:"16rem",height:"0.875rem"})})]}),a.jsx("div",{className:J.eventScroll,children:a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--space-md)"},children:[a.jsx(we,{width:"70%",height:"2.5rem",borderRadius:"var(--radius-sm)"}),a.jsx(we,{width:"90%",height:"4rem",borderRadius:"var(--radius-sm)"}),a.jsx(we,{width:"50%",height:"2rem",borderRadius:"var(--radius-sm)"}),a.jsx(we,{width:"80%",height:"3.5rem",borderRadius:"var(--radius-sm)"}),a.jsx(we,{width:"60%",height:"2.5rem",borderRadius:"var(--radius-sm)"})]})})]})}function mU({sessionId:t,session:s,isActive:o,onStop:r,onKill:c}){return a.jsxs("div",{className:J.header,children:[a.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?` | ${Po((s.inputTokens??0)+(s.outputTokens??0))} tokens · ${Ms(s.costMillicents??0)}`:""]}),a.jsxs("span",{className:J.headerInfo,children:[s&&a.jsx("span",{children:s.prompt.length>60?s.prompt.slice(0,60)+"...":s.prompt}),o&&a.jsx(ux,{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 hU({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 a.jsx("div",{className:s?J.errorMessage:J.waitingMessage,children:o})}function gU(){const{sessionId:t}=ls(),s=jh(),{sessions:{events:o,eventsDropped:r,sessions:c,sessionsLoading:d,kill:u,stopGraceful:p,loadSessionEvents:m,sendInput:g,spawn:v},tasks:{startTask:_},personas:{personas:b},environments:{environments:x,provisionEnvironment:k}}=ot(),{showToast:j}=gn(),w=y.useRef(void 0),T=aH(t),C=c.find(E=>E.id===t)??void 0,D=y.useMemo(()=>{const E=t?o.filter(M=>M.sessionId===t):[];return Sh(kh(E))},[o,t]);if(y.useEffect(()=>{t&&t!==w.current&&(w.current=t,m(t).catch(()=>{}))},[t,m]),!C&&d)return a.jsx(pU,{});if(!t)return a.jsx("div",{className:J.emptyState,children:"No session selected"});const O=(C==null?void 0:C.status)==="running"||(C==null?void 0:C.status)==="idle";return a.jsxs("div",{className:J.panelContainer,children:[a.jsx(ks,{segments:T}),a.jsx(mU,{sessionId:t,session:C,isActive:O,onStop:()=>{p(t).catch(()=>{})},onKill:()=>{u(t).catch(()=>{})}}),a.jsx(yh,{events:D,eventsDropped:r,emptyState:a.jsx(hU,{session:C}),onShowToast:j,sandboxProxyUrl:s,sessions:c,currentSessionId:t,environments:x,personas:b,onForward:(E,M)=>g(E,M)}),O&&a.jsx(Dd,{mode:"send",sessionId:t,environmentId:C.environmentId,personas:b,environments:x,onSendInput:(E,M)=>{g(E,M).catch(()=>{j("Failed to send message","error")})},onSpawn:(E,M,L)=>{v(E,M,L).catch(()=>{})},onStartTask:(E,M,L)=>{_(E,M,L).catch(()=>{})},onProvisionEnvironment:E=>{k(E).catch(()=>{})},onShowToast:j})]})}function vU(t){if(!t)return!1;const s=t.tagName;return!!(s==="INPUT"||s==="TEXTAREA"||s==="SELECT"||t.isContentEditable)}function ua(t,s){const o=y.useRef(s);o.current=s;const{key:r,ctrl:c=!1,shift:d=!1,suppressInInputs:u=!0,enabled:p=!0}=t;y.useEffect(()=>{if(!p)return;const m=g=>{if(u&&vU(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 yU(){return a.jsxs("div",{className:J.panelContainer,"aria-hidden":"true",children:[a.jsx("div",{className:J.workspaceHeader,children:a.jsx("span",{className:J.workspaceName,children:a.jsx(we,{width:"12rem",height:"1.25rem"})})}),a.jsx("div",{className:J.metaToggle,style:{cursor:"default"},children:a.jsx(we,{width:"4rem",height:"0.625rem"})}),a.jsxs("div",{className:J.progressBarContainer,children:[a.jsx("div",{className:J.progressBar,children:a.jsx("div",{className:J.progressFill,style:{width:"0%"}})}),a.jsx(we,{width:"2rem",height:"0.625rem"})]}),a.jsxs("div",{className:J.tabBar,role:"tablist","aria-label":"Workspace view",children:[a.jsx("span",{className:`${J.tab} ${J.active}`,children:"Graph"}),a.jsx("span",{className:J.tab,children:"Board"}),a.jsx("span",{className:J.tab,children:"Tasks"})]}),a.jsx("div",{className:J.overviewContent,children:Array.from({length:3},(t,s)=>a.jsx(kd,{lines:2},s))})]})}function S_(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 bU(t){try{const s=new URL(t);return s.protocol!=="http:"&&s.protocol!=="https:"?void 0:s.toString()}catch{return}}function _U(){const{workspaceId:t,environmentId:s}=ls(),o=ut(),{tasks:{tasks:r},environments:{environments:c},workspaces:{workspaces:d,workspacesLoading:u,archiveWorkspace:p,updateWorkspace:m,linkEnvironment:g,unlinkEnvironment:v,linkOperationError:_,clearLinkOperationError:b},personas:{personas:x},sessions:{sessions:k},usageCache:j,loadUsage:w}=ot(),{resolvedThemeId:T}=uk(),[C,D]=y.useState("tasks"),[O,E]=y.useState(!1),[M,L]=y.useState(null),[A,P]=y.useState(!1),Y=y.useRef(void 0),q=d.find(X=>X.id===t),ee=s??(q==null?void 0:q.linkedEnvironmentIds[0])??"",le=iH(t,ee,d,c);ua({key:"1"},()=>D("graph")),ua({key:"2"},()=>D("board")),ua({key:"3"},()=>D("tasks")),y.useEffect(()=>{const X=Y.current;Y.current=t,!(X===void 0||X===t)&&M!==null&&L(null)},[t,M]);const W=k.reduce((X,ce)=>X+(ce.costMillicents??0),0);y.useEffect(()=>{t&&w("workspace",t).catch(()=>{})},[t,w,W]);const re=t?j[`workspace:${t}`]:void 0,$=r.filter(X=>X.workspaceId===t),B=$.filter(X=>X.status==="complete").length,se=$.length,oe=se>0?Math.round(B/se*100):0;return!q&&u?a.jsx(yU,{}):a.jsxs("div",{className:J.panelContainer,children:[a.jsx(ks,{segments:le}),a.jsxs("div",{className:J.workspaceHeader,children:[a.jsx("span",{className:J.workspaceName,"data-testid":"workspace-name",children:a.jsx(Pt,{value:(q==null?void 0:q.name)||"",onSave:X=>{q&&m(q.id,{name:X}).catch(()=>{})},validate:X=>{const ce=X.trim();if(!ce)return"Name is required";if(ce.length>Zp)return`Max ${Zp} characters`},maxLength:Zp,fieldId:"name",activeFieldId:M,onActivate:L,ariaLabel:"Workspace name",renderDisplay:X=>X||t||void 0,"data-testid":"edit-name"})}),a.jsx("button",{className:J.archiveButton,onClick:()=>E(!0),title:"Archive workspace","data-testid":"archive-workspace-button",children:"Archive"})]}),a.jsxs("button",{className:J.metaToggle,onClick:()=>P(!A),"aria-expanded":!A,"aria-controls":"workspace-meta-panel","data-testid":"meta-toggle",children:[a.jsx("span",{className:`${J.metaToggleArrow} ${A?"":J.metaToggleArrowOpen}`,children:"▶"}),"Details"]}),!A&&a.jsxs("div",{className:J.workspaceMeta,"data-testid":"workspace-meta",id:"workspace-meta-panel",children:[a.jsxs("div",{className:J.metaRow,children:[a.jsx("span",{className:J.metaLabel,children:"Description"}),a.jsx("div",{className:J.metaValue,children:a.jsx(bm,{value:(q==null?void 0:q.description)||"",onSave:X=>{q&&m(q.id,{description:X}).catch(()=>{})},fieldId:"description",activeFieldId:M,onActivate:L,renderDisplay:X=>X?a.jsx("span",{className:J.overviewMarkdown,children:a.jsx(Cd,{remarkPlugins:[Ed],children:X})}):void 0,placeholder:"No description",ariaLabel:"Workspace description","data-testid":"edit-description"})})]}),a.jsxs("div",{className:J.metaRow,children:[a.jsx("span",{className:J.metaLabel,children:"Repository"}),a.jsx("div",{className:J.metaValue,children:a.jsx(Pt,{value:(q==null?void 0:q.repoUrl)||"",onSave:X=>{q&&m(q.id,{repoUrl:X}).catch(()=>{})},validate:X=>{const ce=X.trim();if(ce&&!/^https?:\/\/.+/.test(ce))return"Must be a valid http(s) URL"},fieldId:"repoUrl",activeFieldId:M,onActivate:L,renderDisplay:X=>{const ce=bU(X);return ce?a.jsx("a",{className:J.repoLink,href:ce,target:"_blank",rel:"noopener noreferrer",onClick:fe=>fe.stopPropagation(),children:X}):X?a.jsx("span",{children:X}):void 0},placeholder:"No repository",ariaLabel:"Workspace repository URL","data-testid":"edit-repo"})})]}),a.jsxs("div",{className:J.metaRow,children:[a.jsx("span",{className:J.metaLabel,children:"Environments"}),a.jsx("div",{className:J.metaValue,"data-testid":"linked-environments",children:q?a.jsxs("span",{className:J.linkedEnvList,children:[(()=>{const X=[...new Set(q.linkedEnvironmentIds)];return X.length===0?a.jsx("span",{className:J.metaPlaceholder,children:"None"}):X.map(ce=>{const fe=c.find(ge=>ge.id===ce);return a.jsxs("span",{className:J.linkedEnvChip,"data-testid":`linked-env-${ce}`,children:[(fe==null?void 0:fe.displayName)||ce,a.jsx("button",{className:J.chipDismiss,onClick:()=>{v(q.id,ce).catch(()=>{})},title:`Unlink ${(fe==null?void 0:fe.displayName)||ce}`,"aria-label":`Unlink ${(fe==null?void 0:fe.displayName)||ce}`,"data-testid":`unlink-env-${ce}`,disabled:X.length<=1,children:"x"})]},ce)})})(),(()=>{const X=new Set(q.linkedEnvironmentIds),ce=c.filter(fe=>!X.has(fe.id));return ce.length===0?null:a.jsxs("select",{className:J.linkEnvSelect,value:"",onChange:fe=>{fe.target.value&&g(q.id,fe.target.value).catch(()=>{})},"aria-label":"Link environment","data-testid":"link-env-select",children:[a.jsx("option",{value:"",children:"+ Link"}),ce.map(fe=>a.jsx("option",{value:fe.id,children:fe.displayName||fe.id},fe.id))]})})(),_&&a.jsxs("span",{className:J.linkError,"data-testid":"link-operation-error",role:"alert",children:[_,a.jsx("button",{className:J.chipDismiss,onClick:b,"aria-label":"Dismiss error","data-testid":"dismiss-link-error",children:"x"})]})]}):a.jsx("span",{className:J.metaPlaceholder,children:"None"})})]}),a.jsxs("div",{className:J.metaRow,children:[a.jsx("span",{className:J.metaLabel,children:"Persona"}),a.jsx("div",{className:J.metaValue,children:a.jsx(Sd,{value:(q==null?void 0:q.defaultPersonaId)||"",onSave:X=>{q&&m(q.id,{defaultPersonaId:X}).catch(()=>{})},options:[{value:"",label:"(Inherit)"},...x.map(X=>({value:X.id,label:X.name}))],fieldId:"defaultPersonaId",activeFieldId:M,onActivate:L,renderDisplay:X=>{const ce=x.find(fe=>fe.id===X);if(ce)return a.jsx("span",{children:ce.name})},placeholder:(q==null?void 0:q.defaultPersonaId)||"(Inherit)",ariaLabel:"Workspace default persona","data-testid":"edit-persona"})})]}),a.jsxs("div",{className:J.metaRow,children:[a.jsx("span",{className:J.metaLabel,children:"Worktrees"}),a.jsx("div",{className:J.metaValue,children:a.jsx(JI,{checked:(q==null?void 0:q.useWorktrees)??!0,onChange:X=>{q&&m(q.id,{useWorktrees:X}).catch(()=>{})},label:"Enable worktree isolation","data-testid":"worktree-toggle"})})]}),a.jsxs("div",{className:J.metaRow,children:[a.jsx("span",{className:J.metaLabel,children:"Working Dir"}),a.jsx("div",{className:J.metaValue,children:a.jsx(Pt,{value:(q==null?void 0:q.workingDirectory)||"",onSave:X=>{q&&m(q.id,{workingDirectory:X}).catch(()=>{})},fieldId:"workingDirectory",activeFieldId:M,onActivate:L,placeholder:"Default (server default)",ariaLabel:"Working directory","data-testid":"edit-working-directory"})})]}),q&&a.jsxs("div",{className:J.metaTimestamps,children:[a.jsxs("span",{className:J.metaTimestamp,children:["Created ",S_(q.createdAt)]}),q.updatedAt&&q.updatedAt!==q.createdAt&&a.jsxs("span",{className:J.metaTimestamp,children:["· Updated ",S_(q.updatedAt)]})]})]}),se>0&&a.jsxs("div",{className:J.progressBarContainer,"data-testid":"progress-bar",children:[a.jsx("div",{className:J.progressBar,children:a.jsx("div",{className:J.progressFill,style:{width:`${oe}%`}})}),a.jsxs("span",{className:J.progressLabel,children:[B,"/",se]})]}),re&&re.costMillicents>0&&a.jsx("div",{className:J.progressBarContainer,children:a.jsxs("span",{className:J.progressLabel,children:["Usage: ",Ms(re.costMillicents)," (",re.sessionCount," session",re.sessionCount!==1?"s":"",")"]})}),q&&(q.tokenBudget>0||q.costBudgetMillicents>0)&&a.jsx("div",{className:J.progressBarContainer,children:a.jsxs("span",{className:J.progressLabel,children:["Budget:"," ",q.tokenBudget>0&&a.jsxs(a.Fragment,{children:["Tokens: ",Po(((re==null?void 0:re.inputTokens)??0)+((re==null?void 0:re.outputTokens)??0))," / ",Po(q.tokenBudget)]}),q.tokenBudget>0&&q.costBudgetMillicents>0&&" | ",q.costBudgetMillicents>0&&a.jsxs(a.Fragment,{children:["Cost: ",Ms((re==null?void 0:re.costMillicents)??0)," / ",Ms(q.costBudgetMillicents)]})]})}),a.jsxs("div",{className:J.tabBar,role:"tablist","aria-label":"Workspace view",children:[a.jsx("button",{role:"tab","aria-selected":C==="graph",className:`${J.tab} ${C==="graph"?J.active:""}`,onClick:()=>D("graph"),children:"Graph"}),a.jsx("button",{role:"tab","aria-selected":C==="board",className:`${J.tab} ${C==="board"?J.active:""}`,onClick:()=>D("board"),"data-testid":"board-tab",children:"Board"}),a.jsx("button",{role:"tab","aria-selected":C==="tasks",className:`${J.tab} ${C==="tasks"?J.active:""}`,onClick:()=>D("tasks"),children:"Tasks"})]}),C==="tasks"&&se>0&&a.jsxs("div",{className:J.workspaceSummary,children:[a.jsx("span",{className:J.workspaceSummaryTitle,children:`${B}/${se} tasks complete`}),a.jsx("span",{className:J.workspaceSummarySubtitle,children:"Select a task or click + to create one"})]}),C==="tasks"&&se===0&&a.jsxs("div",{className:J.emptyCta,children:[a.jsx("button",{className:J.ctaButton,onClick:()=>o(Hi(t,void 0,ee)),children:"Create Task"}),a.jsx("div",{className:J.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}),C==="board"&&a.jsx(Cz,{workspaceId:t,environmentId:ee,tasks:r,sessions:k,personas:x,environments:c}),C==="graph"&&a.jsx(cC,{workspaceId:t,environmentId:ee,tasks:r,resolvedThemeId:T}),a.jsx(xs,{isOpen:O,title:"Archive Workspace?",description:"This will hide the workspace from the sidebar. Tasks will not be deleted.",confirmLabel:"Archive",onConfirm:()=>{q&&(p(q.id).catch(()=>{}),o("/",{replace:!0})),E(!1)},onCancel:()=>E(!1)})]})}const xU="_container_3pgew_1",kU="_header_3pgew_8",SU="_headerTitle_3pgew_35",jU="_headerActions_3pgew_44",wU="_body_3pgew_51",TU="_btnPrimary_3pgew_63",NU="_btnGhost_3pgew_94",CU="_error_3pgew_116",Ka={container:xU,header:kU,headerTitle:SU,headerActions:jU,body:wU,btnPrimary:TU,btnGhost:NU,error:CU};function EU(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 AU=[{label:"Home",url:Zo},{label:"New Workspace",url:void 0}];function DU(){const[t]=Lm(),s=t.get("environment")??void 0,{environments:{environments:o},personas:{personas:r},workspaces:{createWorkspace:c,workspaceCreating:d}}=ot(),{showToast:u}=gn(),p=ut(),[m,g]=y.useState(()=>{var w;return zz(void 0,s||((w=o[0])==null?void 0:w.id))}),[v,_]=y.useState(),[b,x]=y.useState();y.useEffect(()=>{s||m.environmentId||o.length===0||g(w=>{var T;return w.environmentId?w:{...w,environmentId:((T=o[0])==null?void 0:T.id)??""}})},[o,s,m.environmentId]);const k=()=>{const w=EU(m);if(w){_(w),x(void 0);return}_(void 0),x(void 0),c(m.name.trim(),m.description,m.repoUrl.trim(),m.environmentId,m.defaultPersonaId,m.useWorktrees,m.workingDirectory,T=>{u("Workspace created","success"),p(Xa(T.id,T.linkedEnvironmentIds[0]??m.environmentId),{replace:!0})},T=>{x(T)}).catch(()=>{})},j=()=>{p(s?Li(s):Zo,{replace:!0})};return a.jsxs("div",{className:Ka.container,children:[a.jsxs("div",{className:Ka.header,children:[a.jsx("div",{className:Ka.headerTitle,children:a.jsx(ks,{segments:AU})}),a.jsxs("div",{className:Ka.headerActions,children:[a.jsx("button",{className:Ka.btnGhost,onClick:j,disabled:d,"data-testid":"workspace-create-cancel",children:"Cancel"}),a.jsx("button",{className:Ka.btnPrimary,onClick:k,disabled:d||!m.name.trim()||!m.environmentId,"data-testid":"workspace-create-save",children:d?a.jsx(U1,{size:"sm",label:"Creating"}):"Create Workspace"})]})]}),a.jsxs("div",{className:Ka.body,children:[a.jsx(Pz,{values:m,onChange:w=>{g(w),_(void 0),x(void 0)},environments:o,personas:r,errors:v,disabled:d,autoFocusName:!0}),b&&a.jsx("div",{className:Ka.error,"data-testid":"workspace-create-submit-error",children:b})]})]})}function j_(){const{workspaceId:t,environmentId:s}=ls(),[o]=Lm(),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}=gn();return a.jsx(sk,{mode:"new",workspaceId:r,parentTaskId:c,environmentId:s,tasks:d,workspaces:m,personas:g,onCreateTask:(_,b,x,k,j,w,T,C,D)=>{u(_,b,x,k,j,w,T,C,D).catch(()=>{})},onUpdateTask:(_,b,x,k,j)=>{p(_,b,x,k,j).catch(()=>{})},onShowToast:v})}function MU(){return a.jsxs("div",{className:J.panelContainer,"aria-hidden":"true",children:[a.jsx("div",{className:J.header,children:a.jsxs("span",{className:J.headerTitle,children:[a.jsx(we,{width:"12rem",height:"1rem"}),a.jsx(we,{width:"4rem",height:"1rem",borderRadius:"var(--radius-full)"})]})}),a.jsxs("div",{className:J.tabBar,role:"tablist","aria-label":"Task view",children:[a.jsx("span",{className:`${J.tab} ${J.active}`,children:"Overview"}),a.jsx("span",{className:J.tab,children:"Stream"}),a.jsx("span",{className:J.tab,children:"Findings"})]}),a.jsx("div",{className:J.overviewContent,children:a.jsxs("div",{className:J.overviewDashboard,children:[a.jsx("div",{className:J.overviewHero,children:a.jsx(we,{width:"5rem",height:"1.5rem",borderRadius:"var(--radius-full)"})}),a.jsxs("div",{className:J.overviewSection,children:[a.jsx("div",{className:J.overviewLabel,children:"Description"}),a.jsx(ym,{lines:2})]}),a.jsxs("div",{className:J.overviewSection,children:[a.jsx("div",{className:J.overviewLabel,children:"Environment"}),a.jsxs("div",{className:J.envRow,children:[a.jsx(we,{width:"0.5rem",height:"0.5rem",variant:"circular"}),a.jsx(we,{width:"8rem",height:"0.875rem"})]})]}),a.jsxs("div",{className:J.overviewSection,children:[a.jsx("div",{className:J.overviewLabel,children:"Dependencies"}),a.jsx(ym,{lines:2})]}),a.jsxs("div",{className:J.overviewSection,children:[a.jsx("div",{className:J.overviewLabel,children:"Timeline"}),a.jsx("div",{className:J.timeline,children:Array.from({length:4},(t,s)=>a.jsxs("div",{className:J.timelineRow,children:[a.jsx(we,{width:"4rem",height:"0.75rem"}),a.jsx(we,{width:"10rem",height:"0.75rem"})]},s))})]})]})})]})}function Za(){const{taskId:t,workspaceId:s,environmentId:o}=ls(),r=jh(),c=an(),d=ut(),{showToast:u}=gn(),{sessions:{events:p,eventsDropped:m,sessions:g,loadSessionEvents:v,taskSessions:_,loadTaskSessions:b,sendInput:x,spawn:k,kill:j},tasks:{tasks:w,tasksLoading:T,startTask:C,stopTask:D,resumeTask:O,deleteTask:E,createTask:M,updateTask:L},environments:{environments:A,provisionEnvironment:P},findings:{findings:Y,loadFindings:q},workspaces:{workspaces:ee},personas:{personas:le},usageCache:W,loadUsage:re}=ot(),$=y.useRef(void 0),B=y.useRef(void 0),se=y.useRef(void 0),oe=y.useRef(void 0),X=y.useRef(void 0),ce=c.pathname.endsWith("/stream")?"stream":c.pathname.endsWith("/findings")?"findings":"overview",fe=c.pathname.endsWith("/edit"),[ge,Ae]=y.useState(ce),[vt,wt]=y.useState(!1),[_e,qe]=y.useState(void 0),[Bt,Wt]=y.useState(""),[de,Ue]=y.useState(fe),yt=y.useRef(ce),At=y.useRef(fe),H=w.find(Ne=>Ne.id===t),ve=(H==null?void 0:H.workspaceId)||void 0,tt=ee.find(Ne=>Ne.id===ve);y.useEffect(()=>{ce!==yt.current&&(yt.current=ce,ce!==ge&&Ae(ce))},[ce,ge]),y.useEffect(()=>{fe!==At.current&&(At.current=fe,fe!==de&&Ue(fe))},[fe,de]),y.useEffect(()=>{if(Bt===""){if(tt!=null&&tt.linkedEnvironmentIds[0])Wt(tt.linkedEnvironmentIds[0]);else if(A.length>0){const Ne=A.find(ze=>ze.status==="connected");Wt((Ne==null?void 0:Ne.id)??A[0].id)}}},[Bt,tt==null?void 0:tt.linkedEnvironmentIds[0],A]);const Dt=H?_[H.id]??[]:[];let Ge;_e&&Dt.some(Ne=>Ne.id===_e)?Ge=_e:Ge=(H==null?void 0:H.latestSessionId)||void 0;const Xt=()=>{wt(!0)},bn=()=>{if(!H)return;E(H.id).catch(()=>{}),wt(!1);const Ne=o??(tt==null?void 0:tt.linkedEnvironmentIds[0]);d(H.workspaceId&&Ne?Xa(H.workspaceId,Ne):"/",{replace:!0})};y.useEffect(()=>{(H==null?void 0:H.id)!==B.current&&(B.current=H==null?void 0:H.id,qe(void 0),Wt(""),Ue(fe))},[H==null?void 0:H.id,fe]),y.useEffect(()=>{if(!(H!=null&&H.id))return;const Ne=H.id!==oe.current,ze=H.latestSessionId!==X.current;(Ne||ze)&&(oe.current=H.id,X.current=H.latestSessionId,b(H.id).catch(()=>{}))},[H==null?void 0:H.id,H==null?void 0:H.latestSessionId,b]),y.useEffect(()=>{if((H==null?void 0:H.status)!==se.current){const Ne=se.current===void 0;se.current=H==null?void 0:H.status;const ze=(H==null?void 0:H.status)==="not_started"?"overview":(H==null?void 0:H.status)==="working"||(H==null?void 0:H.status)==="paused"?"stream":(H==null?void 0:H.status)==="complete"?"findings":void 0;ze&&ze!==ge&&!(Ne&&ce!=="overview")&&Ae(ze)}},[H==null?void 0:H.status,ge,ce]);const Bs=y.useMemo(()=>new Map(w.map(Ne=>[Ne.id,Ne])),[w]),si=y.useMemo(()=>{const Ne=Ge?p.filter(ze=>ze.sessionId===Ge):[];return Sh(kh(Ne))},[p,Ge]),qt=H?H.dependsOn.some(Ne=>{const ze=Bs.get(Ne);return ze!==void 0&&ze.status!=="complete"}):!1,Ui=y.useMemo(()=>oH(t,o,ee,A,Bs),[t,o,ee,A,Bs]);y.useEffect(()=>{Ge&&Ge!==$.current&&($.current=Ge,v(Ge).catch(()=>{}))},[Ge,v]),y.useEffect(()=>{ge==="findings"&&ve&&q(ve).catch(()=>{})},[ge,ve,q]);const ai=Dt.reduce((Ne,ze)=>Ne+(ze.costMillicents??0),0);y.useEffect(()=>{H&&(re("task",H.id).catch(()=>{}),H.childTaskIds.length>0&&re("task_tree",H.id).catch(()=>{}))},[H==null?void 0:H.id,H==null?void 0:H.childTaskIds.length,re,ai]);const va=H?`task:${H.id}`:"",$s=va in W?W[va]:void 0,ii=H?`task_tree:${H.id}`:"",oi=H&&H.childTaskIds.length>0&&ii in W?W[ii]:void 0,ds=Ne=>{Ae(Ne),d(Pn(t,Ne==="overview"?void 0:Ne,s,o))};return ua({key:"1"},()=>ds("overview")),ua({key:"2"},()=>ds("stream")),ua({key:"3"},()=>ds("findings")),!H&&T?a.jsx(MU,{}):a.jsxs("div",{className:J.panelContainer,children:[a.jsx(ks,{segments:Ui}),a.jsxs("div",{className:J.header,children:[a.jsxs("span",{className:J.headerTitle,children:[a.jsx("span",{"data-testid":"task-title",children:(H==null?void 0:H.title)||t}),H&&a.jsx("span",{className:J.taskStatusBadge,"data-testid":"task-status",children:H.status}),(H==null?void 0:H.branch)&&a.jsx("span",{className:J.taskBranch,children:H.branch}),qt&&a.jsx("span",{className:J.taskBlockedBadge,children:"blocked"})]}),H&&a.jsx(VB,{task:H,sessionId:Ge,isBlocked:qt,onStart:()=>{C(H.id,void 0,Bt).catch(Ne=>{const ze=Ne instanceof fa?Ne.message:"Failed to start task";u(ze,"error")})},onResume:()=>{O(H.id).catch(()=>{})},onStop:()=>{D(H.id).catch(()=>{})},onPause:()=>{Ge&&j(Ge).catch(()=>{})},onDelete:Xt,onEdit:()=>Ue(!0)})]}),a.jsxs("div",{className:J.tabBar,role:"tablist","aria-label":"Task view",children:[a.jsx("button",{role:"tab","aria-selected":ge==="overview",className:`${J.tab} ${ge==="overview"?J.active:""}`,onClick:()=>ds("overview"),children:"Overview"}),a.jsx("button",{role:"tab","aria-selected":ge==="stream",className:`${J.tab} ${ge==="stream"?J.active:""}`,onClick:()=>ds("stream"),children:"Stream"}),a.jsx("button",{role:"tab","aria-selected":ge==="findings",className:`${J.tab} ${ge==="findings"?J.active:""}`,onClick:()=>ds("findings"),children:"Findings"})]}),a.jsxs(is,{mode:"wait",children:[ge==="overview"&&a.jsx(Ct.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:J.overviewContent,"data-testid":"task-overview",children:de&&H?a.jsx(sk,{mode:"edit",taskId:H.id,workspaceId:ve,environmentId:o,tasks:w,workspaces:ee,personas:le,onCreateTask:(Ne,ze,ht,Qt,Gt,Vi,qi,Gi,zs)=>{M(Ne,ze,ht,Qt,Gt,Vi,qi,Gi,zs).catch(()=>{})},onUpdateTask:(Ne,ze,ht,Qt,Gt)=>{L(Ne,ze,ht,Qt,Gt).catch(()=>{})},onEditDone:()=>{fe?d(Pn(H.id,void 0,s,o),{replace:!0}):Ue(!1)},onShowToast:u}):H?a.jsx(A8,{task:H,tasksById:Bs,environments:A,workspaces:ee,taskSessions:Dt,selectedEnvId:Bt,taskUsage:$s,treeUsage:oi}):a.jsx("div",{className:J.waitingMessage,children:"No additional details"})},"overview"),ge==="stream"&&a.jsxs(Ct.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:[a.jsx(E6,{taskSessions:Dt,selectedSessionId:Ge,onSelect:Ne=>qe(Ne)}),a.jsx(yh,{events:si,eventsDropped:m,sandboxProxyUrl:r,emptyState:!Ge&&H?qt?a.jsx("div",{className:J.emptyCta,"data-testid":"stream-blocked-message",children:a.jsx("div",{className:J.ctaDescription,children:"This task is blocked by incomplete dependencies"})}):a.jsxs("div",{className:J.emptyCta,children:[a.jsx("button",{"data-testid":"stream-start-cta",className:J.ctaButton,onClick:()=>{C(H.id,void 0,Bt).catch(Ne=>{const ze=Ne instanceof fa?Ne.message:"Failed to start task";u(ze,"error")})},children:"Start Task"}),a.jsx("div",{className:J.ctaDescription,children:"Click to begin agent execution"})]}):Ge&&si.length===0?a.jsx("div",{className:J.waitingMessage,children:"Waiting for events..."}):void 0,onShowToast:u})]},"stream"),ge==="findings"&&a.jsx(Ct.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:J.tabContent,children:ve?a.jsx(tk,{findings:Y.filter(Ne=>Ne.workspaceId===ve)}):a.jsx("div",{className:J.noContext,children:"Navigate to a task within a workspace to view findings"})},"findings")]}),(()=>{if(!H||H.status!=="working"&&H.status!=="paused")return;const Ne=Ge?g.find(ze=>ze.id===Ge):void 0;if(!(!Ne||Ne.status==="stopped"))return a.jsx(Dd,{mode:"send",sessionId:Ne.id,environmentId:Ne.environmentId,personas:le,environments:A,onSendInput:(ze,ht)=>{x(ze,ht).catch(()=>{u("Failed to send message","error")})},onSpawn:(ze,ht,Qt)=>{k(ze,ht,Qt,void 0,ve).catch(()=>{})},onStartTask:(ze,ht,Qt)=>{C(ze,ht,Qt).catch(()=>{})},onProvisionEnvironment:ze=>{P(ze).catch(()=>{})},onShowToast:u})})(),H&&a.jsx(xs,{isOpen:vt,title:"Delete Task?",description:`"${H.title}" will be permanently removed.`,onConfirm:bn,onCancel:()=>wt(!1)})]})}function RU(){const{environments:{environments:t,addEnvironment:s,updateEnvironment:o},codespaces:{codespaces:r,codespaceError:c,codespaceListError:d,codespaceCreating:u,listCodespaces:p,createCodespace:m},dockerContainers:{dockerContainers:g,dockerContainersError:v,listDockerContainers:_},githubAccounts:{githubAccounts:b}}=ot(),{showToast:x}=gn();return a.jsx(ak,{mode:"new",environments:t,githubAccounts:b,onAddEnvironment:(k,j,w,T)=>{s(k,j,w,T).catch(()=>{})},onUpdateEnvironment:(k,j)=>{o(k,j).catch(()=>{})},onListCodespaces:k=>{p(k).catch(()=>{})},codespaces:r,codespaceError:c,codespaceListError:d,codespaceCreating:u,onCreateCodespace:(k,j)=>{m(k,j).catch(()=>{})},onListDockerContainers:()=>{_().catch(()=>{})},dockerContainers:g,dockerContainersError:v,onShowToast:x})}function IU(){const{environmentId:t}=ls(),{environments:{environments:s,addEnvironment:o,updateEnvironment:r},codespaces:{codespaces:c,codespaceError:d,codespaceListError:u,codespaceCreating:p,listCodespaces:m,createCodespace:g},dockerContainers:{dockerContainers:v,dockerContainersError:_,listDockerContainers:b},githubAccounts:{githubAccounts:x}}=ot(),{showToast:k}=gn();return a.jsx(ak,{mode:"edit",environmentId:t,environments:s,githubAccounts:x,onAddEnvironment:(j,w,T,C)=>{o(j,w,T,C).catch(()=>{})},onUpdateEnvironment:(j,w)=>{r(j,w).catch(()=>{})},onListCodespaces:j=>{m(j).catch(()=>{})},codespaces:c,codespaceError:d,codespaceListError:u,codespaceCreating:p,onCreateCodespace:(j,w)=>{g(j,w).catch(()=>{})},onListDockerContainers:()=>{b().catch(()=>{})},dockerContainers:v,dockerContainersError:_,onShowToast:k})}const OU="_layout_11u79_1",LU="_content_11u79_8",BU="_tabPanel_11u79_14",il={layout:OU,content:LU,tabPanel:BU};function $U(){const t=nH();return a.jsxs("div",{className:il.layout,children:[a.jsx(ks,{segments:t}),a.jsx("div",{className:il.content,children:a.jsx(ti,{})})]})}const zU="_container_144a4_1",HU="_envHeader_144a4_6",PU="_envTitleRow_144a4_10",UU="_statusDot_144a4_16",VU="_envName_144a4_21",qU="_statusBadge_144a4_27",GU="_envMeta_144a4_33",FU="_metaTag_144a4_39",KU="_actions_144a4_51",ZU="_provisionMessage_144a4_59",YU="_errorMessage_144a4_64",JU="_section_144a4_69",WU="_sectionHeader_144a4_73",XU="_cardList_144a4_121",QU="_card_144a4_121",eV="_cardHeader_144a4_138",tV="_cardName_144a4_144",nV="_cardActions_144a4_149",sV="_cardDescription_144a4_154",aV="_cardMeta_144a4_160",iV="_repoLink_144a4_166",oV="_empty_144a4_174",rV="_errorHint_144a4_180",lV="_btnPrimary_144a4_186",cV="_btnOutline_144a4_220",dV="_btnSmall_144a4_247",uV="_btnDanger_144a4_273",De={container:zU,envHeader:HU,envTitleRow:PU,statusDot:UU,envName:VU,statusBadge:qU,envMeta:GU,metaTag:FU,actions:KU,provisionMessage:ZU,errorMessage:YU,section:JU,sectionHeader:WU,cardList:XU,card:QU,cardHeader:eV,cardName:tV,cardActions:nV,cardDescription:sV,cardMeta:aV,repoLink:iV,empty:oV,errorHint:rV,btnPrimary:lV,btnOutline:cV,btnSmall:dV,btnDanger:uV};function fV(){return a.jsxs("div",{className:De.container,"aria-hidden":"true",children:[a.jsxs("div",{className:De.envHeader,children:[a.jsxs("div",{className:De.envTitleRow,children:[a.jsx(we,{width:"0.875rem",height:"0.875rem",variant:"circular"}),a.jsx(we,{width:"12rem",height:"1.5rem"}),a.jsx(we,{width:"4rem",height:"0.875rem"})]}),a.jsxs("div",{className:De.envMeta,children:[a.jsx(we,{width:"6rem",height:"1.25rem",borderRadius:"var(--radius-sm)"}),a.jsx(we,{width:"5rem",height:"1.25rem",borderRadius:"var(--radius-sm)"}),a.jsx(we,{width:"4.5rem",height:"1.25rem",borderRadius:"var(--radius-sm)"})]})]}),a.jsxs("div",{className:De.actions,children:[a.jsx(we,{width:"5rem",height:"2rem",borderRadius:"var(--radius-sm)"}),a.jsx(we,{width:"4rem",height:"2rem",borderRadius:"var(--radius-sm)"})]}),a.jsxs("div",{className:De.section,children:[a.jsx("div",{className:De.sectionHeader,children:a.jsx("h3",{style:{margin:0},children:"Workspaces"})}),a.jsxs("div",{className:De.cardList,children:[a.jsx(kd,{lines:2}),a.jsx(kd,{lines:2})]})]})]})}const pV={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function mV(){const{environmentId:t}=ls(),s=ut(),{environments:{environments:o,environmentsLoading:r,provisionStatus:c,provisionEnvironment:d,stopEnvironment:u,removeEnvironment:p},workspaces:{workspaces:m,archiveWorkspace:g,linkEnvironment:v,unlinkEnvironment:_,linkOperationError:b,clearLinkOperationError:x},sessions:{sessions:k}}=ot(),[j,w]=y.useState(!1),[T,C]=y.useState(!1),[D,O]=y.useState(void 0),E=o.find(B=>B.id===t);if(!E&&r)return a.jsx(fV,{});if(!t||!E)return a.jsx(zn,{to:Ho,replace:!0});const M=m.filter(B=>B.linkedEnvironmentIds.includes(E.id)),L=k.filter(B=>B.environmentId===E.id),A=L.reduce((B,se)=>B+(se.costMillicents??0),0),P=pV[E.status]||"var(--text-tertiary)",Y=E.status==="connected",q=E.status==="connecting",ee=E.status==="disconnected"||E.status==="error"||E.status==="sleeping",le=E.id in c?c[E.id]:void 0,W=()=>{p(E.id).catch(()=>{}),w(!1),s(Ho,{replace:!0})},re=()=>{C(!1),d(E.id,!0).catch(()=>{})},$=B=>{g(B).catch(()=>{}),O(void 0)};return a.jsxs("div",{className:De.container,children:[a.jsx(xs,{isOpen:j,title:"Delete Environment?",description:`"${E.displayName||E.id}" will be permanently removed along with all its data.`,onConfirm:W,onCancel:()=>w(!1)}),a.jsx(xs,{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:re,onCancel:()=>C(!1)}),a.jsxs("div",{className:De.envHeader,children:[a.jsxs("div",{className:De.envTitleRow,children:[a.jsx("span",{className:De.statusDot,style:{color:P},children:"●"}),a.jsx("h2",{className:De.envName,children:E.displayName||E.id}),a.jsx("span",{className:De.statusBadge,style:{color:P},children:E.status})]}),a.jsxs("div",{className:De.envMeta,children:[a.jsxs("span",{className:De.metaTag,children:["Adapter: ",E.adapterType]}),L.length>0&&a.jsxs("span",{className:De.metaTag,children:[L.length," session",L.length!==1?"s":""]}),A>0&&a.jsxs("span",{className:De.metaTag,children:["Cost: ",Ms(A)]})]})]}),a.jsxs("div",{className:De.actions,children:[Y&&a.jsxs(a.Fragment,{children:[a.jsx("button",{className:De.btnPrimary,onClick:()=>s(ix(E.id)),children:"New Chat"}),a.jsx("button",{className:De.btnOutline,onClick:()=>{u(E.id).catch(()=>{})},children:"Stop"}),a.jsx("button",{className:De.btnOutline,onClick:()=>C(!0),disabled:le!==void 0,"data-testid":"env-reprovision-btn",children:"Reprovision"})]}),ee&&a.jsx("button",{className:De.btnPrimary,onClick:()=>{d(E.id).catch(()=>{})},children:E.status==="error"?"Retry":E.status==="sleeping"?"Wake":"Connect"}),q&&le!==void 0&&a.jsx("span",{className:De.provisionMessage,children:le.message}),E.status==="error"&&(le==null?void 0:le.stage)==="error"&&a.jsx("span",{className:De.errorMessage,children:le.message}),a.jsx("button",{className:De.btnOutline,onClick:()=>s(XN(E.id)),"data-testid":"env-edit-btn",children:"Edit Config"}),a.jsx("button",{className:De.btnDanger,onClick:()=>w(!0),children:"Delete"})]}),a.jsxs("div",{className:De.section,children:[a.jsxs("div",{className:De.sectionHeader,children:[a.jsx("h3",{children:"Workspaces"}),a.jsx("button",{className:De.btnPrimary,onClick:()=>s(`${cx}?environment=${encodeURIComponent(E.id)}`),"data-testid":"workspace-create-button",children:"+ New Workspace"}),(()=>{const B=m.filter(se=>!se.linkedEnvironmentIds.includes(E.id)&&se.status==="active");return B.length===0?null:a.jsxs("select",{className:De.btnPrimary,value:"",onChange:se=>{se.target.value&&v(se.target.value,E.id).catch(()=>{})},"aria-label":"Link a workspace","data-testid":"link-workspace-select",children:[a.jsx("option",{value:"",children:"+ Link Workspace"}),B.map(se=>a.jsx("option",{value:se.id,children:se.name},se.id))]})})()]}),b&&a.jsxs("p",{className:De.errorHint,"data-testid":"link-operation-error",role:"alert",children:[b,a.jsx("button",{className:De.btnSmall,onClick:x,"aria-label":"Dismiss error","data-testid":"dismiss-link-error",children:"Dismiss"})]}),M.length===0&&a.jsx("p",{className:De.empty,"data-testid":"linked-workspaces-empty",children:"No workspaces yet. Create one to get started."}),a.jsx("div",{className:De.cardList,"data-testid":"linked-workspaces-list",children:M.map(B=>a.jsx(hV,{workspace:B,confirmArchiveId:D,onOpen:()=>s(Xa(B.id,E.id)),onArchive:()=>O(B.id),onConfirmArchive:()=>$(B.id),onCancelArchive:()=>O(void 0),onUnlink:()=>{_(B.id,E.id).catch(()=>{})}},B.id))})]})]})}function hV({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 a.jsxs("div",{className:De.card,"data-testid":"workspace-card","data-workspace-id":t.id,children:[a.jsxs("div",{className:De.cardHeader,children:[a.jsx("strong",{className:De.cardName,children:t.name}),a.jsxs("div",{className:De.cardActions,children:[a.jsx("button",{className:De.btnSmall,onClick:o,children:"Open"}),a.jsx("button",{className:De.btnSmall,onClick:u,disabled:t.linkedEnvironmentIds.length<=1,"data-testid":`unlink-workspace-${t.id}`,children:"Unlink"}),p?a.jsxs(a.Fragment,{children:[a.jsx("button",{className:De.btnDanger,onClick:c,children:"Confirm"}),a.jsx("button",{className:De.btnSmall,onClick:d,children:"Cancel"})]}):a.jsx("button",{className:De.btnSmall,onClick:r,children:"Archive"})]})]}),t.description&&a.jsx("p",{className:De.cardDescription,children:t.description}),t.repoUrl&&a.jsx("div",{className:De.cardMeta,children:m?a.jsx("a",{href:t.repoUrl,target:"_blank",rel:"noopener noreferrer",className:De.repoLink,children:t.repoUrl}):a.jsx("span",{children:t.repoUrl})})]})}const gV={credentials:"Credentials","github-accounts":"GitHub Accounts",personas:"Personas",schedules:"Schedules",appearance:"Appearance",about:"About",shortcuts:"Shortcuts",plugins:"Plugins"};function vV(){const s=an().pathname.replace(/^\/settings\/?/,"").split("/")[0],o=gV[s],r=tH(o);return a.jsxs("div",{className:il.layout,children:[a.jsx(ks,{segments:r}),a.jsx("div",{className:il.content,children:a.jsx("div",{className:il.tabPanel,children:a.jsx(ti,{})},s)})]})}function yV(){const{tokens:{tokens:t,setToken:s,deleteToken:o},credentials:{credentialProviders:r,updateCredentialProviders:c}}=ot(),{showToast:d}=gn();return a.jsxs(a.Fragment,{children:[a.jsx(c7,{credentialProviders:r,onUpdateCredentialProviders:u=>{c(u).catch(()=>{})}}),a.jsx(pB,{tokens:t,onSetToken:(u,p,m,g,v)=>{s(u,p,m,g,v).catch(()=>{})},onDeleteToken:u=>{o(u).catch(()=>{})},onShowToast:d})]})}function bV(){const{githubAccounts:{githubAccounts:t,githubAccountsLoading:s,addGitHubAccount:o,updateGitHubAccount:r,removeGitHubAccount:c,importGitHubAccounts:d}}=ot(),{showToast:u}=gn();return a.jsx(M8,{githubAccounts:t,githubAccountsLoading:s,onAddGitHubAccount:o,onUpdateGitHubAccount:r,onRemoveGitHubAccount:c,onImportGitHubAccounts:d,onShowToast:u})}function _V(){const{personas:{personas:t,deletePersona:s},appDefaultPersonaId:o,setAppDefaultPersonaId:r}=ot(),{showToast:c}=gn(),d=ut();return a.jsx(k7,{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(eC),onNavigateToPersona:u=>d(ox(u))})}const xV="_container_1ooin_1",kV="_form_1ooin_7",SV="_formActions_1ooin_75",jV="_editableSection_1ooin_82",wV="_defaultBadge_1ooin_93",TV="_typeToggle_1ooin_107",NV="_scriptEditor_1ooin_121",CV="_optional_1ooin_128",ys={container:xV,form:kV,formActions:SV,editableSection:jV,defaultBadge:wV,typeToggle:TV,scriptEditor:NV,optional:CV},w_=[{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)"}],T_=[{value:"genaiscript",label:"genaiscript"}],EV="0";function N_(){const{personaId:t}=ls(),s=ut(),{showToast:o}=gn(),{personas:{personas:r,createPersona:c,updatePersona:d,deletePersona:u},appDefaultPersonaId:p,setAppDefaultPersonaId:m}=ot(),g=t===void 0,v=g?void 0:r.find(b=>b.id===t);if(!g&&r.length>0&&!v)return a.jsx(zn,{to:cp,replace:!0});const _=[{label:"Settings",url:Ii},{label:"Personas",url:cp},{label:g?"New Persona":(v==null?void 0:v.name)??"Persona",url:void 0}];return a.jsxs("div",{className:ys.container,children:[a.jsx(ks,{segments:_}),a.jsx(AV,{existing:v,isNew:g,appDefaultPersonaId:p,onCreatePersona:c,onUpdatePersona:d,onDeletePersona:u,onSetAppDefaultPersonaId:m,onDone:()=>{s(cp)},showToast:o})]})}function AV({existing:t,isNew:s,appDefaultPersonaId:o,onCreatePersona:r,onUpdatePersona:c,onDeletePersona:d,onSetAppDefaultPersonaId:u,onDone:p,showToast:m}){const g=ut(),[v,_]=y.useState((t==null?void 0:t.name)??""),[b,x]=y.useState((t==null?void 0:t.description)??""),[k,j]=y.useState((t==null?void 0:t.systemPrompt)??""),[w,T]=y.useState((t==null?void 0:t.runtime)??"claude-code"),[C,D]=y.useState((t==null?void 0:t.model)??"sonnet"),[O,E]=y.useState((t==null?void 0:t.maxTurns)??0),[M,L]=y.useState((t==null?void 0:t.type)==="script"?"script":"agent"),[A,P]=y.useState((t==null?void 0:t.script)??""),[Y,q]=y.useState((t==null?void 0:t.allowedMcpTools)??[]),[ee,le]=y.useState(!1),[W,re]=y.useState(null),[$,B]=y.useState(!!s);y.useEffect(()=>{if(!s&&t&&!$){B(!0),_(t.name),x(t.description),j(t.systemPrompt);const de=t.type==="script"?"script":"agent";T(de==="script"?t.runtime||"genaiscript":t.runtime),D(t.model),E(t.maxTurns),L(de),P(t.script||""),q(t.allowedMcpTools)}},[s,t,$]);const se=de=>{L(de),de==="script"?T("genaiscript"):w==="genaiscript"&&T("claude-code")},oe=!s&&t===void 0,X=v.trim().length>0&&!oe&&k.trim().length>0&&(M==="script"?A.trim().length>0:!!w&&!!C),ce=s&&X,fe=!s&&o===(t==null?void 0:t.id),ge=!s&&t&&!fe&&M==="agent"&&!!w&&!!C,Ae=(de,Ue)=>{if(!de.trim())return`${Ue} is required`},vt=de=>{if(de.preventDefault(),!(oe||!X)){if(t){c(t.id,v,b,k,w,C,O,M,A).then(()=>{m("Persona updated","success"),p()},()=>{m("Failed to save persona","error")});return}r(v,b,k,w,C,O,M,A,Y).then(Ue=>{m("Persona created","success"),g(ox(Ue.id),{replace:!0})},()=>{m("Failed to save persona","error")})}},wt=()=>{t&&d(t.id).then(()=>{m("Persona deleted","success"),p()},()=>{m("Failed to delete persona","error")})},_e=async(de,Ue,yt,At)=>de().then(()=>{Ue(),m(yt,"success")},()=>{m(At,"error")}),qe=(de,Ue)=>{if(!t)return;const yt=de==="type"?String(Ue):M,At=de==="runtime"?String(Ue):de==="type"?String(Ue)==="script"?"genaiscript":w==="genaiscript"?"claude-code":w:w,H=de==="model"?String(Ue):C,ve=de==="maxTurns"?Number(Ue):O,tt=de==="systemPrompt"?String(Ue):k,Dt=de==="script"?String(Ue):A;_e(()=>c(t.id,de==="name"?String(Ue):v,de==="description"?String(Ue):b,tt,At,H,ve,yt,Dt),()=>{if(de==="type"){const Ge=String(Ue)==="script"?"script":"agent";L(Ge),T(At)}de==="runtime"&&T(String(Ue)),de==="name"&&_(String(Ue)),de==="description"&&x(String(Ue)),de==="systemPrompt"&&j(String(Ue)),de==="model"&&D(String(Ue)),de==="maxTurns"&&E(Number(Ue)),de==="script"&&P(String(Ue))},"Persona updated","Failed to update persona").catch(()=>{})},Bt=de=>{vt(de)},Wt=()=>{t&&u(t.id).then(()=>{m("Set as app default","success")},()=>{m("Failed to set app default","error")})};return a.jsxs(a.Fragment,{children:[oe?a.jsxs("div",{className:ys.form,children:[a.jsx("h3",{children:"Edit Persona"}),a.jsx("p",{children:"Loading persona..."})]}):s?a.jsxs("form",{onSubmit:Bt,className:ys.form,children:[a.jsx("h3",{children:"Create Persona"}),a.jsxs("div",{className:ys.typeToggle,"data-testid":"persona-type-toggle",children:[a.jsxs("label",{children:[a.jsx("input",{type:"radio",name:"personaType",value:"agent",checked:M==="agent",onChange:()=>se("agent")}),"Agent"]}),a.jsxs("label",{children:[a.jsx("input",{type:"radio",name:"personaType",value:"script",checked:M==="script",onChange:()=>se("script")}),"Script"]})]}),a.jsxs("label",{children:["Name",a.jsx("input",{type:"text",value:v,onChange:de=>_(de.target.value),placeholder:M==="script"?"e.g. Nightly Report":"e.g. Frontend Engineer",required:!0,"data-testid":"persona-detail-name"})]}),a.jsxs("label",{children:["Description",a.jsx("input",{type:"text",value:b,onChange:de=>x(de.target.value),placeholder:"Brief description...","data-testid":"persona-detail-description"})]}),a.jsxs("label",{children:["Runtime",a.jsx("select",{value:w,onChange:de=>T(de.target.value),"data-testid":"persona-runtime-select",children:(M==="script"?T_:w_).map(de=>a.jsx("option",{value:de.value,children:de.label},de.value))})]}),M==="agent"&&a.jsxs(a.Fragment,{children:[a.jsxs("label",{children:["Model",a.jsx("input",{type:"text",value:C,onChange:de=>D(de.target.value),placeholder:"e.g. sonnet","data-testid":"persona-detail-model"})]}),a.jsxs("label",{children:["Max Turns",a.jsx("input",{type:"number",value:O,onChange:de=>E(parseInt(de.target.value,10)||0),min:0,"data-testid":"persona-detail-max-turns"})]}),a.jsxs("label",{children:["System Prompt",a.jsx("textarea",{value:k,onChange:de=>j(de.target.value),placeholder:"You are a senior frontend engineer...",rows:10,required:!0,"data-testid":"persona-detail-prompt"})]})]}),M==="script"&&a.jsxs(a.Fragment,{children:[a.jsxs("label",{children:["Model ",a.jsx("span",{className:ys.optional,children:"(optional)"}),a.jsx("input",{type:"text",value:C,onChange:de=>D(de.target.value),placeholder:"e.g. sonnet (leave empty for script-only)","data-testid":"persona-detail-model"})]}),a.jsxs("label",{children:["System Prompt",a.jsx("textarea",{value:k,onChange:de=>j(de.target.value),placeholder:"Context for the script...",rows:4,required:!0,"data-testid":"persona-detail-prompt"})]}),a.jsxs("label",{children:["Script",a.jsx("textarea",{value:A,onChange:de=>P(de.target.value),placeholder:`script({ model: "openai:gpt-4o" });
|
|
756
|
+
|
|
757
|
+
const grackle = await host.mcpServer({
|
|
758
|
+
id: "grackle",
|
|
759
|
+
url: env.vars.GRACKLE_MCP_URL,
|
|
760
|
+
});
|
|
761
|
+
|
|
762
|
+
$\`Summarize the current tasks.\`;`,rows:20,className:ys.scriptEditor,required:!0,"data-testid":"persona-script-editor"})]})]}),M==="agent"&&a.jsxs("div",{children:[a.jsx("label",{children:"Allowed MCP Tools"}),a.jsx(d_,{selectedTools:Y,onChange:q})]}),a.jsxs("div",{className:ys.formActions,children:[a.jsx(cn,{type:"submit",variant:"primary",size:"md",disabled:!ce,"data-testid":"persona-detail-save",children:"Create"}),a.jsx(cn,{type:"button",variant:"outline",size:"md",onClick:p,"data-testid":"persona-detail-cancel",children:"Cancel"})]})]}):t?a.jsxs("div",{className:ys.form,children:[a.jsx("h3",{children:"Edit Persona"}),a.jsxs("div",{className:ys.formActions,children:[a.jsx(cn,{type:"button",variant:"outline",size:"md",onClick:p,"data-testid":"persona-detail-cancel",children:"Back to Personas"}),ge&&a.jsx(cn,{type:"button",variant:"ghost",size:"md",onClick:Wt,"data-testid":"persona-detail-set-default",children:"Set as App Default"}),fe&&a.jsx("span",{className:ys.defaultBadge,children:"App Default"}),a.jsx(cn,{type:"button",variant:"danger",size:"md",onClick:()=>le(!0),"data-testid":"persona-detail-delete",children:"Delete"})]}),a.jsxs("div",{className:ys.editableSection,children:[a.jsxs("label",{children:["Name",a.jsx(Pt,{value:v,onSave:de=>{qe("name",de)},validate:de=>Ae(de,"Name"),fieldId:"persona-name",activeFieldId:W,onActivate:re,ariaLabel:"Persona name","data-testid":"persona-detail-name"})]}),a.jsxs("label",{children:["Description",a.jsx(Pt,{value:b,onSave:de=>{qe("description",de)},fieldId:"persona-description",activeFieldId:W,onActivate:re,placeholder:"Brief description...",ariaLabel:"Persona description","data-testid":"persona-detail-description"})]}),a.jsxs("label",{children:["Type",a.jsx(Sd,{value:M,onSave:de=>{qe("type",de)},options:[{value:"agent",label:"Agent"},{value:"script",label:"Script"}],fieldId:"persona-type",activeFieldId:W,onActivate:re,ariaLabel:"Persona type","data-testid":"persona-type-toggle"})]}),a.jsxs("label",{children:["Runtime",a.jsx(Sd,{value:w,onSave:de=>{qe("runtime",de)},options:M==="script"?T_:w_,fieldId:"persona-runtime",activeFieldId:W,onActivate:re,ariaLabel:"Persona runtime","data-testid":"persona-runtime"})]}),a.jsxs("label",{children:["Model",M==="script"?" (optional)":"",a.jsx(Pt,{value:C,onSave:de=>{qe("model",de)},validate:M==="agent"?de=>Ae(de,"Model"):void 0,fieldId:"persona-model",activeFieldId:W,onActivate:re,placeholder:M==="script"?"e.g. sonnet (leave empty for script-only)":"e.g. sonnet",ariaLabel:"Persona model","data-testid":"persona-detail-model"})]}),a.jsxs("label",{children:["Max Turns",a.jsx(Pt,{value:String(O),onSave:de=>{qe("maxTurns",parseInt(de,10)||0)},validate:de=>/^\d+$/.test(de.trim())?void 0:"Max Turns must be a non-negative integer",fieldId:"persona-max-turns",activeFieldId:W,onActivate:re,placeholder:EV,ariaLabel:"Persona max turns","data-testid":"persona-detail-max-turns"})]}),a.jsxs("label",{children:["System Prompt",a.jsx(bm,{value:k,onSave:de=>{qe("systemPrompt",de)},validate:de=>Ae(de,"System Prompt"),fieldId:"persona-system-prompt",activeFieldId:W,onActivate:re,placeholder:M==="script"?"Context for the script...":"You are a senior frontend engineer...",ariaLabel:"Persona system prompt","data-testid":"persona-detail-prompt"})]}),M==="script"&&a.jsxs("label",{children:["Script",a.jsx(bm,{value:A,onSave:de=>{qe("script",de)},validate:de=>Ae(de,"Script"),fieldId:"persona-script",activeFieldId:W,onActivate:re,placeholder:`script({ model: "openai:gpt-4o" });
|
|
763
|
+
|
|
764
|
+
const grackle = await host.mcpServer({
|
|
765
|
+
id: "grackle",
|
|
766
|
+
url: env.vars.GRACKLE_MCP_URL,
|
|
767
|
+
});
|
|
768
|
+
|
|
769
|
+
$\`Summarize the current tasks.\`;`,ariaLabel:"Persona script","data-testid":"persona-script-editor"})]}),M==="agent"&&a.jsxs("div",{children:[a.jsx("label",{children:"Allowed MCP Tools"}),a.jsx(d_,{selectedTools:Y,onChange:de=>{q(de),_e(()=>c(t.id,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,de),()=>{},"MCP tools updated","Failed to update MCP tools").catch(()=>{})}})]})]}),!ge&&!fe&&a.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,a.jsx(xs,{isOpen:ee,title:"Delete Persona?",description:`"${t==null?void 0:t.name}" will be permanently removed.`,confirmLabel:"Delete",onConfirm:wt,onCancel:()=>le(!1)})]})}function DV(){const{schedules:{schedules:t,deleteSchedule:s,updateSchedule:o},personas:{personas:r}}=ot(),{showToast:c}=gn(),d=ut();return a.jsx(W7,{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(tC),onNavigateToSchedule:u=>d(rx(u))})}const MV="_container_1g4qh_1",RV="_form_1g4qh_7",IV="_formActions_1g4qh_66",OV="_editableSection_1g4qh_73",LV="_helperText_1g4qh_84",BV="_metaSection_1g4qh_90",$V="_optional_1g4qh_108",zV="_readonlyValue_1g4qh_113",$n={container:MV,form:RV,formActions:IV,editableSection:OV,helperText:LV,metaSection:BV,optional:$V,readonlyValue:zV};function C_(){const{scheduleId:t}=ls(),s=ut(),{showToast:o}=gn(),{schedules:{schedules:r,schedulesLoading:c,createSchedule:d,updateSchedule:u,deleteSchedule:p},personas:{personas:m},workspaces:{workspaces:g}}=ot(),v=t===void 0,_=v?void 0:r.find(x=>x.id===t);if(!v&&!c&&r.length>0&&!_)return a.jsx(zn,{to:dp,replace:!0});const b=[{label:"Settings",url:Ii},{label:"Schedules",url:dp},{label:v?"New Schedule":(_==null?void 0:_.title)??"Schedule",url:void 0}];return a.jsxs("div",{className:$n.container,children:[a.jsx(ks,{segments:b}),a.jsx(HV,{existing:_,isNew:v,personas:m,workspaces:g,onCreateSchedule:d,onUpdateSchedule:u,onDeleteSchedule:p,onDone:()=>{s(dp)},showToast:o})]})}function HV({existing:t,isNew:s,personas:o,workspaces:r,onCreateSchedule:c,onUpdateSchedule:d,onDeleteSchedule:u,onDone:p,showToast:m}){var $;const g=ut(),[v,_]=y.useState((t==null?void 0:t.title)??""),[b,x]=y.useState((t==null?void 0:t.description)??""),[k,j]=y.useState((t==null?void 0:t.scheduleExpression)??""),[w,T]=y.useState((t==null?void 0:t.personaId)??""),[C,D]=y.useState((t==null?void 0:t.workspaceId)??""),[O,E]=y.useState(!1),[M,L]=y.useState(null);y.useEffect(()=>{s||t&&M===null&&(_(t.title),x(t.description),j(t.scheduleExpression),T(t.personaId),D(t.workspaceId))},[s,t,M]);const A=!s&&t===void 0,P=s&&v.trim().length>0&&k.trim().length>0&&w.length>0,Y=o.map(B=>({value:B.id,label:B.name})),q=[{value:"",label:"System-level (no workspace)"},...r.map(B=>({value:B.id,label:B.name}))],ee=B=>{B.preventDefault(),P&&c(v,b,k,w,C||void 0).then(se=>{m("Schedule created","success"),g(rx(se.id),{replace:!0})},()=>{m("Failed to create schedule","error")})},le=(B,se)=>{t&&d(t.id,{[B]:se}).then(()=>{m("Schedule updated","success"),B==="title"&&_(String(se)),B==="description"&&x(String(se)),B==="scheduleExpression"&&j(String(se)),B==="personaId"&&T(String(se))},()=>{m("Failed to update schedule","error")})},W=()=>{if(!t)return;const B=!t.enabled;d(t.id,{enabled:B}).then(()=>{m(B?"Schedule enabled":"Schedule disabled","success")},()=>{m("Failed to update schedule","error")})},re=()=>{t&&u(t.id).then(()=>{m("Schedule deleted","success"),p()},()=>{m("Failed to delete schedule","error")})};return a.jsxs(a.Fragment,{children:[A?a.jsxs("div",{className:$n.form,children:[a.jsx("h3",{children:"Edit Schedule"}),a.jsx("p",{children:"Loading schedule..."})]}):s?a.jsxs("form",{onSubmit:ee,className:$n.form,children:[a.jsx("h3",{children:"Create Schedule"}),a.jsxs("label",{children:["Title",a.jsx("input",{type:"text",value:v,onChange:B=>_(B.target.value),placeholder:"e.g. Nightly Review",required:!0,"data-testid":"schedule-detail-title"})]}),a.jsxs("label",{children:["Description ",a.jsx("span",{className:$n.optional,children:"(optional)"}),a.jsx("input",{type:"text",value:b,onChange:B=>x(B.target.value),placeholder:"Brief description...","data-testid":"schedule-detail-description"})]}),a.jsxs("label",{children:["Schedule Expression",a.jsx("input",{type:"text",value:k,onChange:B=>j(B.target.value),placeholder:"e.g. 30s, 5m, 1h, or 0 9 * * MON",required:!0,"data-testid":"schedule-detail-expression"}),a.jsxs("p",{className:$n.helperText,children:["Interval: ",a.jsx("code",{children:"30s"}),", ",a.jsx("code",{children:"5m"}),", ",a.jsx("code",{children:"1h"}),", ",a.jsx("code",{children:"1d"})," (min 10s) | Cron: ",a.jsx("code",{children:"0 9 * * MON"})," (standard 5-field cron syntax)"]})]}),a.jsxs("label",{children:["Persona",a.jsxs("select",{value:w,onChange:B=>T(B.target.value),required:!0,"data-testid":"schedule-detail-persona",children:[a.jsx("option",{value:"",children:"Select a persona..."}),Y.map(B=>a.jsx("option",{value:B.value,children:B.label},B.value))]})]}),a.jsxs("label",{children:["Workspace ",a.jsx("span",{className:$n.optional,children:"(optional)"}),a.jsx("select",{value:C,onChange:B=>D(B.target.value),"data-testid":"schedule-detail-workspace",children:q.map(B=>a.jsx("option",{value:B.value,children:B.label},B.value))})]}),a.jsxs("div",{className:$n.formActions,children:[a.jsx(cn,{type:"submit",variant:"primary",size:"md",disabled:!P,"data-testid":"schedule-detail-save",children:"Create"}),a.jsx(cn,{type:"button",variant:"outline",size:"md",onClick:p,"data-testid":"schedule-detail-cancel",children:"Cancel"})]})]}):t?a.jsxs("div",{className:$n.form,children:[a.jsx("h3",{children:"Edit Schedule"}),a.jsxs("div",{className:$n.formActions,children:[a.jsx(cn,{type:"button",variant:"outline",size:"md",onClick:p,"data-testid":"schedule-detail-cancel",children:"Back to Schedules"}),a.jsx(cn,{type:"button",variant:t.enabled?"ghost":"primary",size:"md",onClick:W,"data-testid":"schedule-detail-toggle",children:t.enabled?"Disable":"Enable"}),a.jsx(cn,{type:"button",variant:"danger",size:"md",onClick:()=>E(!0),"data-testid":"schedule-detail-delete",children:"Delete"})]}),a.jsxs("div",{className:$n.editableSection,children:[a.jsxs("label",{children:["Title",a.jsx(Pt,{value:v,onSave:B=>{le("title",B)},validate:B=>B.trim()?void 0:"Title is required",fieldId:"schedule-title",activeFieldId:M,onActivate:L,ariaLabel:"Schedule title","data-testid":"schedule-detail-title"})]}),a.jsxs("label",{children:["Description",a.jsx(Pt,{value:b,onSave:B=>{le("description",B)},fieldId:"schedule-description",activeFieldId:M,onActivate:L,placeholder:"Brief description...",ariaLabel:"Schedule description","data-testid":"schedule-detail-description"})]}),a.jsxs("label",{children:["Schedule Expression",a.jsx(Pt,{value:k,onSave:B=>{le("scheduleExpression",B)},validate:B=>B.trim()?void 0:"Schedule expression is required",fieldId:"schedule-expression",activeFieldId:M,onActivate:L,placeholder:"e.g. 30s, 5m, 1h, or 0 9 * * MON",ariaLabel:"Schedule expression","data-testid":"schedule-detail-expression"})]}),a.jsxs("label",{children:["Persona",a.jsx(Sd,{value:w,onSave:B=>{le("personaId",B)},options:Y,fieldId:"schedule-persona",activeFieldId:M,onActivate:L,ariaLabel:"Schedule persona","data-testid":"schedule-detail-persona"})]}),a.jsxs("label",{children:["Workspace ",a.jsx("span",{className:$n.optional,children:"(optional — set at creation)"}),a.jsx("span",{className:$n.readonlyValue,"data-testid":"schedule-detail-workspace",children:(($=r.find(B=>B.id===t.workspaceId))==null?void 0:$.name)??"System-level (no workspace)"})]})]}),a.jsxs("div",{className:$n.metaSection,children:[t.lastRunAt?a.jsxs("span",{children:["Last run: ",Go(t.lastRunAt)]}):a.jsx("span",{children:"Last run: Never"}),t.enabled&&t.nextRunAt?a.jsxs("span",{children:["Next run: ",J1(t.nextRunAt)]}):null,t.runCount>0&&a.jsxs("span",{children:["Total runs: ",t.runCount]}),a.jsxs("span",{children:["Created: ",Go(t.createdAt)]})]})]}):null,a.jsx(xs,{isOpen:O,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:re,onCancel:()=>E(!1)})]})}function PV(){const{themeId:t,resolvedThemeId:s,setTheme:o,preferSystem:r,setPreferSystem:c}=uk();return a.jsx(mB,{themeId:t,resolvedThemeId:s,onSetTheme:o,preferSystem:r,onSetPreferSystem:c})}function UV(){const[t,s]=y.useState(void 0);return y.useEffect(()=>{let o=!1;return(async()=>{try{const c=await $e.getVersionStatus({});o||s({currentVersion:c.currentVersion,latestVersion:c.latestVersion,updateAvailable:c.updateAvailable,isDocker:c.isDocker})}catch{}})().catch(()=>{}),()=>{o=!0}},[]),t}function VV(){const{connectionStatus:t,environments:{environments:s},sessions:{sessions:o}}=ot(),r=UV();return a.jsxs(a.Fragment,{children:[r&&a.jsx(mL,{currentVersion:r.currentVersion,latestVersion:r.latestVersion,updateAvailable:r.updateAvailable,isDocker:r.isDocker}),a.jsx(vB,{connectionStatus:t,environments:s,sessions:o})]})}function qV(){return a.jsx(r7,{})}function GV(){const{plugins:{plugins:t,pluginsLoading:s,setPluginEnabled:o}}=ot();return a.jsx(D8,{plugins:t,loading:s,onSetPluginEnabled:(r,c)=>{o(r,c).catch(()=>{})}})}const E_=Hi();function FV(){const t=ut();return ua({key:"?"},()=>{t(nC)}),ua({key:"n"},()=>{t(E_)}),ua({key:"N"},()=>{t(E_)}),a.jsx(a.Fragment,{})}function xl(t){const s=Jz();y.useLayoutEffect(()=>(s(t),()=>{s(void 0)}),[t,s])}function KV(){const{workspaces:{workspaces:t},tasks:{tasks:s}}=ot(),o=y.useMemo(()=>a.jsx(qO,{workspaces:t,tasks:s}),[t,s]);return xl(o),a.jsx(ti,{})}function ZV(){const{environments:{environments:t}}=ot(),s=y.useMemo(()=>a.jsx(eO,{environments:t}),[t]);return xl(s),a.jsx(ti,{})}function YV(){const t=y.useMemo(()=>a.jsx(n$,{}),[]);return xl(t),a.jsx(ti,{})}function JV(){const{findings:{findings:t,loadFindings:s,loadAllFindings:o}}=ot(),{workspaceId:r,environmentId:c}=ls();y.useEffect(()=>{r?s(r).catch(()=>{}):o().catch(()=>{})},[r,s,o]);const d=y.useMemo(()=>a.jsx(uO,{findings:t,workspaceId:r,environmentId:c}),[t,r,c]);return xl(d),a.jsx(ti,{})}function WV(){const{knowledge:t,workspaces:{workspaces:s}}=ot(),o=y.useCallback(p=>{t.search(p).catch(()=>{})},[t]),r=y.useCallback(()=>{t.clearSearch()},[t]),c=y.useCallback(p=>{t.selectNode(p).catch(()=>{})},[t]),d=y.useCallback(p=>{t.loadRecent(p||void 0).catch(()=>{})},[t]),u=y.useMemo(()=>a.jsx(c5,{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 xl(u),a.jsx(ti,{})}const XV="_container_ce571_1",QV="_title_ce571_6",Td={container:XV,title:QV};function eq(){return a.jsxs("div",{className:Td.container,"aria-hidden":"true",children:[a.jsx("h1",{className:Td.title,children:"Findings"}),a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--space-sm)"},children:Array.from({length:4},(t,s)=>a.jsx(kd,{lines:3},s))})]})}function A_(){const{environmentId:t,workspaceId:s}=ls(),{findings:{findings:o,findingsLoading:r,loadFindings:c},workspaces:{workspaces:d},environments:{environments:u}}=ot(),p=ut();y.useEffect(()=>{s&&c(s).catch(()=>{})},[s,c]);const m=y.useCallback(v=>{p(em(v,s,t))},[p,s,t]);if(r)return a.jsx(eq,{});const g=s&&t?yk("Findings",s,t,d,u).slice(0,-1):lH();return a.jsxs("div",{className:Td.container,"data-testid":"findings-list-page",children:[a.jsx(ks,{segments:g}),a.jsx("h1",{className:Td.title,children:"Findings"}),a.jsx(tk,{findings:o,onFindingClick:m})]})}const tq="_container_1wwpb_1",nq="_notFound_1wwpb_6",sq="_header_1wwpb_12",aq="_categoryBadge_1wwpb_19",iq="_title_1wwpb_28",oq="_content_1wwpb_35",rq="_tags_1wwpb_77",lq="_tag_1wwpb_77",cq="_meta_1wwpb_92",dq="_metaTimestamp_1wwpb_100",uq="_metaLink_1wwpb_105",kn={container:tq,notFound:nq,header:sq,categoryBadge:aq,title:iq,content:oq,tags:rq,tag:lq,meta:cq,metaTimestamp:dq,metaLink:uq};function D_(){const{findingId:t,environmentId:s,workspaceId:o}=ls(),{findings:{selectedFinding:r,findingLoading:c,loadFinding:d},workspaces:{workspaces:u},environments:{environments:p}}=ot(),m=ut();if(y.useEffect(()=>{t&&d(t).catch(()=>{})},[t,d]),c)return a.jsx("div",{className:kn.container,"data-testid":"finding-detail-page",children:a.jsx("div",{className:kn.notFound,children:"Loading..."})});if(!r)return a.jsx("div",{className:kn.container,"data-testid":"finding-detail-page",children:a.jsx("div",{className:kn.notFound,children:"Finding not found."})});const g=yk(r.title,o,s,u,p),v=jd(r.category);return a.jsxs("div",{className:kn.container,"data-testid":"finding-detail-page",children:[a.jsx(ks,{segments:g}),a.jsxs("div",{className:kn.header,children:[a.jsx("span",{className:kn.categoryBadge,style:{background:v.bg,color:v.text},children:r.category}),a.jsx("h1",{className:kn.title,children:r.title})]}),r.content&&a.jsx("div",{className:kn.content,children:a.jsx(Cd,{remarkPlugins:[Ed],children:r.content})}),r.tags.length>0&&a.jsx("div",{className:kn.tags,children:r.tags.map(_=>a.jsx("span",{className:kn.tag,children:_},_))}),a.jsxs("div",{className:kn.meta,children:[a.jsx("span",{className:kn.metaTimestamp,title:r.createdAt,children:Go(r.createdAt)}),r.taskId&&a.jsx("button",{type:"button",className:kn.metaLink,onClick:()=>{m(Pn(r.taskId))},children:"View Task"}),r.sessionId&&a.jsx("button",{type:"button",className:kn.metaLink,onClick:()=>{m(Ld(r.sessionId))},children:"View Session"})]})]})}const fq="_wizard_1260s_1",pq="_container_1260s_10",mq="_stepContent_1260s_19",hq="_logoArea_1260s_28",gq="_logoImage_1260s_32",vq="_heading_1260s_41",yq="_tagline_1260s_49",bq="_subtitle_1260s_56",_q="_featureList_1260s_64",xq="_runtimeGrid_1260s_89",kq="_runtimeCard_1260s_101",Sq="_runtimeName_1260s_133",jq="_runtimeDescription_1260s_139",wq="_buttonRow_1260s_144",Tq="_primaryButton_1260s_151",Nq="_ghostButton_1260s_185",Cq="_dots_1260s_213",Eq="_dot_1260s_213",et={wizard:fq,container:pq,stepContent:mq,logoArea:hq,logoImage:gq,heading:vq,tagline:yq,subtitle:bq,featureList:_q,runtimeGrid:xq,runtimeCard:kq,runtimeName:Sq,runtimeDescription:jq,buttonRow:wq,primaryButton:Tq,ghostButton:Nq,dots:Cq,dot:Eq};function Aq({onNext:t}){return a.jsxs("div",{className:et.stepContent,"data-testid":"setup-welcome",children:[a.jsx("div",{className:et.logoArea,children:a.jsx("img",{src:qd("grackle-logo.png"),alt:"Grackle",className:et.logoImage})}),a.jsx("h1",{className:et.heading,children:"Welcome to Grackle"}),a.jsx("p",{className:et.tagline,children:"Multi-agent orchestration for software teams"}),a.jsx("button",{type:"button",className:et.primaryButton,onClick:t,"data-testid":"setup-get-started",children:"Get Started"})]})}function Dq({onNext:t,onBack:s}){return a.jsxs("div",{className:et.stepContent,"data-testid":"setup-about",children:[a.jsx("h2",{className:et.heading,children:"What is Grackle?"}),a.jsxs("ul",{className:et.featureList,children:[a.jsx("li",{children:"Run Claude, Copilot, and Codex agents side by side"}),a.jsx("li",{children:"Provision and control dev environments — SSH, Codespaces, or local"}),a.jsx("li",{children:"Organize work into workspaces with agent-executable tasks"}),a.jsx("li",{children:"Customize agent behavior with personas, tools, and MCP servers"}),a.jsx("li",{children:"Live-stream agent sessions with full terminal replay"})]}),a.jsxs("div",{className:et.buttonRow,children:[a.jsx("button",{type:"button",className:et.ghostButton,onClick:s,children:"Back"}),a.jsx("button",{type:"button",className:et.primaryButton,onClick:t,"data-testid":"setup-about-next",children:"Next"})]})]})}const Mq=[{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 Rq({currentRuntime:t,onFinish:s,onBack:o,finishDisabled:r}){const[c,d]=y.useState(t||"claude-code");return y.useEffect(()=>{t&&d(t)},[t]),a.jsxs("div",{className:et.stepContent,"data-testid":"setup-runtime",children:[a.jsx("h2",{className:et.heading,children:"Choose Your Runtime"}),a.jsx("p",{className:et.subtitle,children:"Select the primary agent runtime for your workspace. You can change this later."}),a.jsx("div",{className:et.runtimeGrid,children:Mq.map(u=>a.jsxs("button",{type:"button",className:et.runtimeCard,"data-selected":c===u.id,"aria-pressed":c===u.id,"data-testid":`runtime-card-${u.id}`,onClick:()=>d(u.id),children:[a.jsx("span",{className:et.runtimeName,children:u.name}),a.jsx("span",{className:et.runtimeDescription,children:u.description})]},u.id))}),a.jsxs("div",{className:et.buttonRow,children:[a.jsx("button",{type:"button",className:et.ghostButton,onClick:o,children:"Back"}),a.jsx("button",{type:"button",className:et.primaryButton,onClick:()=>{s(c)},disabled:r,"data-testid":"setup-runtime-next",children:"Next"})]})]})}function Iq(){return typeof Notification<"u"}function Oq({onFinish:t,onBack:s,finishDisabled:o}){const r=Iq(),c=r&&Notification.permission!=="default";function d(){r&&Notification.requestPermission().catch(()=>{}),t()}return a.jsxs("div",{className:et.stepContent,"data-testid":"setup-notifications",children:[a.jsx("h2",{className:et.heading,children:"Stay in the Loop"}),a.jsx("p",{className:et.subtitle,children:"Grackle can send you a browser notification when an agent needs your input, so you never miss an important moment."}),c?a.jsx("p",{className:et.subtitle,children:Notification.permission==="granted"?"Notifications are already enabled.":"Notifications have been blocked. You can change this in your browser settings."}):null,a.jsxs("div",{className:et.buttonRow,children:[a.jsx("button",{type:"button",className:et.ghostButton,onClick:s,disabled:o,children:"Back"}),!c&&r?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:et.ghostButton,onClick:t,disabled:o,"data-testid":"setup-notifications-skip",children:"Skip"}),a.jsx("button",{type:"button",className:et.primaryButton,onClick:d,disabled:o,"data-testid":"setup-notifications-enable",children:"Enable Notifications"})]}):a.jsx("button",{type:"button",className:et.primaryButton,onClick:t,disabled:o,"data-testid":"setup-finish",children:"Finish"})]})]})}const Lq=4,M_={"claude-code":"sonnet",copilot:"gpt-4o",codex:"o3",goose:""};function Bq(){const{personas:{personas:t,updatePersona:s},completeOnboarding:o,onboardingCompleted:r}=ot(),{showToast:c}=gn(),d=ut(),[u,p]=y.useState(0),[m,g]=y.useState("claude-code"),[v,_]=y.useState(!1),b=t.find(j=>j.id==="claude-code"),x=y.useCallback(j=>{g(j),p(3)},[]),k=y.useCallback(()=>{const j=m;_(!0);const w=[];if(b&&j!==b.runtime){const C=M_[j]??"sonnet";w.push(s(b.id,void 0,void 0,void 0,j,C))}const T=t.find(C=>C.id===vy);if(T&&j!==T.runtime){const C=M_[j]??"sonnet";w.push(s(vy,void 0,void 0,void 0,j,C))}Promise.all(w).then(()=>o()).then(()=>{d("/",{replace:!0})},()=>{c("Failed to update runtime -- please try again","error"),_(!1)})},[m,b,t,s,o,d,c]);return r===!0?a.jsx(zn,{to:"/",replace:!0}):a.jsx("div",{className:et.wizard,"data-testid":"setup-wizard",children:a.jsxs("div",{className:et.container,children:[a.jsx(is,{mode:"wait",children:a.jsxs(Ct.div,{initial:{opacity:0,x:40},animate:{opacity:1,x:0},exit:{opacity:0,x:-40},transition:{duration:.2,ease:"easeInOut"},children:[u===0&&a.jsx(Aq,{onNext:()=>p(1)}),u===1&&a.jsx(Dq,{onNext:()=>p(2),onBack:()=>p(0)}),u===2&&a.jsx(Rq,{currentRuntime:m,onFinish:x,onBack:()=>p(1),finishDisabled:!b}),u===3&&a.jsx(Oq,{onFinish:k,onBack:()=>p(2),finishDisabled:v})]},u)}),a.jsx("div",{className:et.dots,children:Array.from({length:Lq},(j,w)=>a.jsx("span",{className:et.dot,"data-active":w===u},w))})]})})}const $q="_root_zndgp_1",zq="_body_zndgp_7",Hq="_main_zndgp_19",Pq="_sidebarWrapper_zndgp_26",Uq="_overlay_zndgp_51",Qr={root:$q,body:zq,main:Hq,sidebarWrapper:Pq,overlay:Uq},Vq=y.lazy(()=>B_(()=>import("./KnowledgePage-CUjPQAzX.js"),__vite__mapDeps([2,1,3,4,5])).then(t=>({default:t.KnowledgePage}))),Sk=typeof window<"u"&&new URLSearchParams(window.location.search).has("mock");function qq({tabs:t}){const{connectionStatus:s,environments:{environments:o},sessions:{sessions:r},tasks:{tasks:c}}=ot(),{toasts:d,dismissToast:u}=gn(),p=an(),m=Yz(),g=m!==void 0,[v,_]=y.useState(!1),b=y.useCallback(()=>_(x=>!x),[]);return y.useEffect(()=>{_(!1)},[p.pathname]),y.useEffect(()=>{if(!v)return;const x=k=>{k.key==="Escape"&&_(!1)};return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x)}},[v]),a.jsxs(a.Fragment,{children:[a.jsx(k5,{connectionStatus:s,environments:o,sessions:r,onToggleSidebar:g?b:void 0,sidebarOpen:v}),a.jsx(A5,{tabs:t}),a.jsxs("div",{className:Qr.body,children:[g&&a.jsx("div",{className:Qr.sidebarWrapper,"data-sidebar-open":v,children:a.jsx(L5,{content:m})}),g&&v&&a.jsx("div",{className:Qr.overlay,"data-testid":"drawer-overlay",onClick:()=>_(!1)}),a.jsxs("div",{className:Qr.main,children:[a.jsx(ti,{}),a.jsx(q5,{sessions:r,tasks:c,environments:o})]})]}),a.jsx(sL,{toasts:d,onDismiss:u}),a.jsx(FV,{})]})}function Gq(){const{sessions:{lastSpawnedId:t},environments:{environments:s,operationError:o,clearOperationError:r},tasks:{tasks:c},connectionStatus:d,onboardingCompleted:u}=ot(),{pluginNames:p}=Fd(),{showToast:m}=gn();r9(s,m),f9(c,m),l9(o,r,m);const g=ut(),v=an();if(y.useEffect(()=>{t&&!v.pathname.includes("/tasks/")&&g(Ld(t),{replace:!0})},[t,g,v.pathname]),d==="connected"&&u===!1)return a.jsx(zn,{to:"/setup",replace:!0});const _=AH(p);return a.jsx(Zz,{children:a.jsxs("div",{className:Qr.root,children:[Sk&&a.jsx(MC,{}),a.jsx(qq,{tabs:_})]})})}function Yp(){const{workspaceId:t}=ls(),{workspaces:{workspaces:s}}=ot(),o=an(),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:a.jsx(zn,{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 a.jsx(zn,{to:m,replace:!0})}function Fq(){const{pluginNames:t}=Fd(),s=t.includes("orchestration"),o=t.includes("knowledge");return a.jsxs(gN,{children:[a.jsx(je,{path:"setup",element:a.jsx(Bq,{})}),a.jsxs(je,{element:a.jsx(Gq,{}),children:[a.jsx(je,{index:!0,element:a.jsx(XP,{})}),a.jsx(je,{path:"sessions/new",element:a.jsx(fU,{})}),a.jsx(je,{path:"chat",element:a.jsx(lU,{})}),a.jsx(je,{path:"chat/:streamId",element:a.jsx(zn,{to:"/coordination",replace:!0})}),a.jsx(je,{path:"coordination",element:a.jsx(uU,{})}),a.jsx(je,{path:"sessions/:sessionId",element:a.jsx(gU,{})}),o&&a.jsx(je,{element:a.jsx(WV,{}),children:a.jsx(je,{path:"knowledge",element:a.jsx(y.Suspense,{fallback:a.jsx(V1,{}),children:a.jsx(Vq,{})})})}),s&&a.jsxs(je,{element:a.jsx(KV,{}),children:[a.jsx(je,{path:"tasks",element:a.jsx(JP,{})}),a.jsx(je,{path:"tasks/new",element:a.jsx(j_,{})}),a.jsx(je,{path:"tasks/:taskId",element:a.jsx(Za,{})}),a.jsx(je,{path:"tasks/:taskId/edit",element:a.jsx(Za,{})}),a.jsx(je,{path:"tasks/:taskId/stream",element:a.jsx(Za,{})}),a.jsx(je,{path:"tasks/:taskId/findings",element:a.jsx(Za,{})})]}),s&&a.jsxs(je,{element:a.jsx(JV,{}),children:[a.jsx(je,{path:"findings",element:a.jsx(A_,{})}),a.jsx(je,{path:"findings/:findingId",element:a.jsx(D_,{})}),a.jsx(je,{path:"environments/:environmentId/workspaces/:workspaceId/findings",element:a.jsx(A_,{})}),a.jsx(je,{path:"environments/:environmentId/workspaces/:workspaceId/findings/:findingId",element:a.jsx(D_,{})})]}),a.jsxs(je,{element:a.jsx(ZV,{}),children:[a.jsx(je,{path:"workspaces",element:a.jsx(zn,{to:"/environments",replace:!0})}),a.jsx(je,{path:"workspaces/new",element:a.jsx(DU,{})}),a.jsx(je,{path:"workspaces/:workspaceId",element:a.jsx(Yp,{})}),a.jsx(je,{path:"workspaces/:workspaceId/tasks/:taskId",element:a.jsx(Yp,{})}),a.jsx(je,{path:"workspaces/:workspaceId/tasks/:taskId/*",element:a.jsx(Yp,{})}),a.jsx(je,{path:"environments/:environmentId/workspaces/:workspaceId",element:a.jsx(_U,{})}),a.jsx(je,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/new",element:a.jsx(j_,{})}),a.jsx(je,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId",element:a.jsx(Za,{})}),a.jsx(je,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit",element:a.jsx(Za,{})}),a.jsx(je,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream",element:a.jsx(Za,{})}),a.jsx(je,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings",element:a.jsx(Za,{})}),a.jsxs(je,{path:"environments",element:a.jsx($U,{}),children:[a.jsx(je,{index:!0,element:a.jsx(WP,{})}),a.jsx(je,{path:"new",element:a.jsx(RU,{})}),a.jsx(je,{path:":environmentId",element:a.jsx(mV,{})}),a.jsx(je,{path:":environmentId/edit",element:a.jsx(IU,{})})]})]}),a.jsx(je,{element:a.jsx(YV,{}),children:a.jsxs(je,{path:"settings",element:a.jsx(vV,{}),children:[a.jsx(je,{index:!0,element:a.jsx(zn,{to:"credentials",replace:!0})}),a.jsx(je,{path:"environments",element:a.jsx(zn,{to:"/environments",replace:!0})}),a.jsx(je,{path:"credentials",element:a.jsx(yV,{})}),a.jsx(je,{path:"github-accounts",element:a.jsx(bV,{})}),a.jsx(je,{path:"tokens",element:a.jsx(zn,{to:"../credentials",replace:!0})}),a.jsx(je,{path:"personas",element:a.jsx(_V,{})}),a.jsx(je,{path:"personas/new",element:a.jsx(N_,{})}),a.jsx(je,{path:"personas/:personaId",element:a.jsx(N_,{})}),a.jsx(je,{path:"schedules",element:a.jsx(DV,{})}),a.jsx(je,{path:"schedules/new",element:a.jsx(C_,{})}),a.jsx(je,{path:"schedules/:scheduleId",element:a.jsx(C_,{})}),a.jsx(je,{path:"appearance",element:a.jsx(PV,{})}),a.jsx(je,{path:"shortcuts",element:a.jsx(qV,{})}),a.jsx(je,{path:"plugins",element:a.jsx(GV,{})}),a.jsx(je,{path:"about",element:a.jsx(VV,{})})]})}),a.jsx(je,{path:"*",element:a.jsx(zn,{to:"/",replace:!0})})]})]})}const Kq=1e4;function Zq(){const{onboardingCompleted:t}=ot(),[s,o]=y.useState(!1);y.useEffect(()=>{if(t!==void 0)return;const c=setTimeout(()=>o(!0),Kq);return()=>clearTimeout(c)},[t]);const r=t===void 0&&!s;return a.jsx(is,{mode:"wait",children:r?a.jsx(Ct.div,{initial:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:a.jsx(V1,{})},"splash"):a.jsx(Ct.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.25},style:{minHeight:"100vh"},children:a.jsx(PN,{basename:"/".replace(/\/$/,""),children:a.jsx(Fq,{})})},"app")})}function Yq(){const t=Sk?SH:o9;return a.jsx(TH,{children:a.jsx(Kz,{children:a.jsx(Vz,{children:a.jsx(t,{children:a.jsx(Zq,{})})})})})}lj.createRoot(document.getElementById("root")).render(a.jsx(y.StrictMode,{children:a.jsx(Yq,{})}));export{ks as B,dx as K,ot as a,em as f,Ld as s,Pn as t,ut as u};
|