@grackle-ai/web 0.80.0 → 0.82.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.
@@ -0,0 +1,119 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/KnowledgePage-M1FUjnXJ.js","assets/markdown-gcy1Jmzi.js","assets/dagview-BA5TtMAQ.js","assets/grpc-_MkPbpJw.js","assets/KnowledgePage-DMqJ4jlP.css"])))=>i.map(i=>d[i]);
2
+ import{r as OS,a as y,j as r,v as BS,b as LS,t as zr,i as IS,f as zS,M as $f,c as Kf}from"./markdown-gcy1Jmzi.js";import{r as US,d as Ug,H as Vg,P as Hg,i as VS,B as HS,a as PS,C as GS,M as qS}from"./dagview-BA5TtMAQ.js";import{c as $S,a as KS,G as YS,e as FS,w as ZS,t as XS,p as Ur,b as QS,C as Yf,f as WS,M as JS,R as Ko,A as q0,D as $0,W as eT,O as tT,d as nT,S as Pg}from"./grpc-_MkPbpJw.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))l(c);new MutationObserver(c=>{for(const u of c)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&l(f)}).observe(document,{childList:!0,subtree:!0});function i(c){const u={};return c.integrity&&(u.integrity=c.integrity),c.referrerPolicy&&(u.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?u.credentials="include":c.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(c){if(c.ep)return;c.ep=!0;const u=i(c);fetch(c.href,u)}})();var Hd={exports:{}},Yo={},Pd={exports:{}},Gd={};/**
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 Gg;function aT(){return Gg||(Gg=1,(function(n){function a(O,G){var Q=O.length;O.push(G);e:for(;0<Q;){var oe=Q-1>>>1,le=O[oe];if(0<c(le,G))O[oe]=G,O[Q]=le,Q=oe;else break e}}function i(O){return O.length===0?null:O[0]}function l(O){if(O.length===0)return null;var G=O[0],Q=O.pop();if(Q!==G){O[0]=Q;e:for(var oe=0,le=O.length,De=le>>>1;oe<De;){var we=2*(oe+1)-1,Se=O[we],Oe=we+1,ce=O[Oe];if(0>c(Se,Q))Oe<le&&0>c(ce,Se)?(O[oe]=ce,O[Oe]=Q,oe=Oe):(O[oe]=Se,O[we]=Q,oe=we);else if(Oe<le&&0>c(ce,Q))O[oe]=ce,O[Oe]=Q,oe=Oe;else break e}}return G}function c(O,G){var Q=O.sortIndex-G.sortIndex;return Q!==0?Q:O.id-G.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var f=Date,p=f.now();n.unstable_now=function(){return f.now()-p}}var m=[],v=[],g=1,b=null,_=3,S=!1,T=!1,C=!1,w=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function R(O){for(var G=i(v);G!==null;){if(G.callback===null)l(v);else if(G.startTime<=O)l(v),G.sortIndex=G.expirationTime,a(m,G);else break;G=i(v)}}function N(O){if(C=!1,R(O),!T)if(i(m)!==null)T=!0,z||(z=!0,ne());else{var G=i(v);G!==null&&ae(N,G.startTime-O)}}var z=!1,H=-1,B=5,K=-1;function W(){return w?!0:!(n.unstable_now()-K<B)}function se(){if(w=!1,z){var O=n.unstable_now();K=O;var G=!0;try{e:{T=!1,C&&(C=!1,E(H),H=-1),S=!0;var Q=_;try{t:{for(R(O),b=i(m);b!==null&&!(b.expirationTime>O&&W());){var oe=b.callback;if(typeof oe=="function"){b.callback=null,_=b.priorityLevel;var le=oe(b.expirationTime<=O);if(O=n.unstable_now(),typeof le=="function"){b.callback=le,R(O),G=!0;break t}b===i(m)&&l(m),R(O)}else l(m);b=i(m)}if(b!==null)G=!0;else{var De=i(v);De!==null&&ae(N,De.startTime-O),G=!1}}break e}finally{b=null,_=Q,S=!1}G=void 0}}finally{G?ne():z=!1}}}var ne;if(typeof A=="function")ne=function(){A(se)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,$=re.port2;re.port1.onmessage=se,ne=function(){$.postMessage(null)}}else ne=function(){k(se,0)};function ae(O,G){H=k(function(){O(n.unstable_now())},G)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(O){O.callback=null},n.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<O?Math.floor(1e3/O):5},n.unstable_getCurrentPriorityLevel=function(){return _},n.unstable_next=function(O){switch(_){case 1:case 2:case 3:var G=3;break;default:G=_}var Q=_;_=G;try{return O()}finally{_=Q}},n.unstable_requestPaint=function(){w=!0},n.unstable_runWithPriority=function(O,G){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var Q=_;_=O;try{return G()}finally{_=Q}},n.unstable_scheduleCallback=function(O,G,Q){var oe=n.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?oe+Q:oe):Q=oe,O){case 1:var le=-1;break;case 2:le=250;break;case 5:le=1073741823;break;case 4:le=1e4;break;default:le=5e3}return le=Q+le,O={id:g++,callback:G,priorityLevel:O,startTime:Q,expirationTime:le,sortIndex:-1},Q>oe?(O.sortIndex=Q,a(v,O),i(m)===null&&O===i(v)&&(C?(E(H),H=-1):C=!0,ae(N,Q-oe))):(O.sortIndex=le,a(m,O),T||S||(T=!0,z||(z=!0,ne()))),O},n.unstable_shouldYield=W,n.unstable_wrapCallback=function(O){var G=_;return function(){var Q=_;_=G;try{return O.apply(this,arguments)}finally{_=Q}}}})(Gd)),Gd}var qg;function sT(){return qg||(qg=1,Pd.exports=aT()),Pd.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 $g;function iT(){if($g)return Yo;$g=1;var n=sT(),a=OS(),i=US();function l(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function f(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(u(e)!==e)throw Error(l(188))}function v(e){var t=e.alternate;if(!t){if(t=u(e),t===null)throw Error(l(188));return t!==e?null:e}for(var s=e,o=t;;){var d=s.return;if(d===null)break;var h=d.alternate;if(h===null){if(o=d.return,o!==null){s=o;continue}break}if(d.child===h.child){for(h=d.child;h;){if(h===s)return m(d),e;if(h===o)return m(d),t;h=h.sibling}throw Error(l(188))}if(s.return!==o.return)s=d,o=h;else{for(var x=!1,j=d.child;j;){if(j===s){x=!0,s=d,o=h;break}if(j===o){x=!0,o=d,s=h;break}j=j.sibling}if(!x){for(j=h.child;j;){if(j===s){x=!0,s=h,o=d;break}if(j===o){x=!0,o=h,s=d;break}j=j.sibling}if(!x)throw Error(l(189))}}if(s.alternate!==o)throw Error(l(190))}if(s.tag!==3)throw Error(l(188));return s.stateNode.current===s?e:t}function g(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=g(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,_=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),A=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),W=Symbol.for("react.memo_cache_sentinel"),se=Symbol.iterator;function ne(e){return e===null||typeof e!="object"?null:(e=se&&e[se]||e["@@iterator"],typeof e=="function"?e:null)}var re=Symbol.for("react.client.reference");function $(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===re?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case C:return"Fragment";case k:return"Profiler";case w:return"StrictMode";case N:return"Suspense";case z:return"SuspenseList";case K:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case A:return e.displayName||"Context";case E:return(e._context.displayName||"Context")+".Consumer";case R:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case H:return t=e.displayName||null,t!==null?t:$(e.type)||"Memo";case B:t=e._payload,e=e._init;try{return $(e(t))}catch{}}return null}var ae=Array.isArray,O=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},oe=[],le=-1;function De(e){return{current:e}}function we(e){0>le||(e.current=oe[le],oe[le]=null,le--)}function Se(e,t){le++,oe[le]=e.current,e.current=t}var Oe=De(null),ce=De(null),me=De(null),fe=De(null);function Ge(e,t){switch(Se(me,t),Se(ce,e),Se(Oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?rg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=rg(t),e=cg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}we(Oe),Se(Oe,e)}function Kt(){we(Oe),we(ce),we(me)}function te(e){e.memoizedState!==null&&Se(fe,e);var t=Oe.current,s=cg(t,e.type);t!==s&&(Se(ce,e),Se(Oe,s))}function J(e){ce.current===e&&(we(Oe),we(ce)),fe.current===e&&(we(fe),Po._currentValue=Q)}var Ce,rn;function Ue(e){if(Ce===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);Ce=t&&t[1]||"",rn=-1<s.stack.indexOf(`
19
+ at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
20
+ `+Ce+e+rn}var qn=!1;function $n(e,t){if(!e||qn)return"";qn=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(t){var X=function(){throw Error()};if(Object.defineProperty(X.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(X,[])}catch(q){var P=q}Reflect.construct(e,[],X)}else{try{X.call()}catch(q){P=q}e.call(X.prototype)}}else{try{throw Error()}catch(q){P=q}(X=e())&&typeof X.catch=="function"&&X.catch(function(){})}}catch(q){if(q&&P&&typeof q.stack=="string")return[q.stack,P.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=o.DetermineComponentFrameRoot(),x=h[0],j=h[1];if(x&&j){var D=x.split(`
21
+ `),V=j.split(`
22
+ `);for(d=o=0;o<D.length&&!D[o].includes("DetermineComponentFrameRoot");)o++;for(;d<V.length&&!V[d].includes("DetermineComponentFrameRoot");)d++;if(o===D.length||d===V.length)for(o=D.length-1,d=V.length-1;1<=o&&0<=d&&D[o]!==V[d];)d--;for(;1<=o&&0<=d;o--,d--)if(D[o]!==V[d]){if(o!==1||d!==1)do if(o--,d--,0>d||D[o]!==V[d]){var F=`
23
+ `+D[o].replace(" at new "," at ");return e.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",e.displayName)),F}while(1<=o&&0<=d);break}}}finally{qn=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?Ue(s):""}function In(e,t){switch(e.tag){case 26:case 27:case 5:return Ue(e.type);case 16:return Ue("Lazy");case 13:return e.child!==t&&t!==null?Ue("Suspense Fallback"):Ue("Suspense");case 19:return Ue("SuspenseList");case 0:case 15:return $n(e.type,!1);case 11:return $n(e.type.render,!1);case 1:return $n(e.type,!0);case 31:return Ue("Activity");default:return""}}function Kn(e){try{var t="",s=null;do t+=In(e,s),s=e,e=e.return;while(e);return t}catch(o){return`
24
+ Error generating stack: `+o.message+`
25
+ `+o.stack}}var xn=Object.prototype.hasOwnProperty,Da=n.unstable_scheduleCallback,cn=n.unstable_cancelCallback,Ee=n.unstable_shouldYield,At=n.unstable_requestPaint,Yt=n.unstable_now,kl=n.unstable_getCurrentPriorityLevel,Ji=n.unstable_ImmediatePriority,jl=n.unstable_UserBlockingPriority,Y=n.unstable_NormalPriority,ie=n.unstable_LowPriority,ue=n.unstable_IdlePriority,je=n.log,_e=n.unstable_setDisableYieldValue,Fe=null,ye=null;function Qe(e){if(typeof je=="function"&&_e(e),ye&&typeof ye.setStrictMode=="function")try{ye.setStrictMode(Fe,e)}catch{}}var Me=Math.clz32?Math.clz32:zt,Tt=Math.log,Dt=Math.LN2;function zt(e){return e>>>=0,e===0?32:31-(Tt(e)/Dt|0)|0}var Rt=256,ht=262144,zn=4194304;function Xt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ra(e,t,s){var o=e.pendingLanes;if(o===0)return 0;var d=0,h=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var j=o&134217727;return j!==0?(o=j&~h,o!==0?d=Xt(o):(x&=j,x!==0?d=Xt(x):s||(s=j&~e,s!==0&&(d=Xt(s))))):(j=o&~h,j!==0?d=Xt(j):x!==0?d=Xt(x):s||(s=o&~e,s!==0&&(d=Xt(s)))),d===0?0:t!==0&&t!==d&&(t&h)===0&&(h=d&-d,s=t&-t,h>=s||h===32&&(s&4194048)!==0)?t:d}function eo(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function xx(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Gh(){var e=zn;return zn<<=1,(zn&62914560)===0&&(zn=4194304),e}function Ec(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function to(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Sx(e,t,s,o,d,h){var x=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var j=e.entanglements,D=e.expirationTimes,V=e.hiddenUpdates;for(s=x&~s;0<s;){var F=31-Me(s),X=1<<F;j[F]=0,D[F]=-1;var P=V[F];if(P!==null)for(V[F]=null,F=0;F<P.length;F++){var q=P[F];q!==null&&(q.lane&=-536870913)}s&=~X}o!==0&&qh(e,o,0),h!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=h&~(x&~t))}function qh(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var o=31-Me(t);e.entangledLanes|=t,e.entanglements[o]=e.entanglements[o]|1073741824|s&261930}function $h(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var o=31-Me(s),d=1<<o;d&t|e[o]&t&&(e[o]|=t),s&=~d}}function Kh(e,t){var s=t&-t;return s=(s&42)!==0?1:Ac(s),(s&(e.suspendedLanes|t))!==0?0:s}function Ac(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 Dc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Yh(){var e=G.p;return e!==0?e:(e=window.event,e===void 0?32:Rg(e.type))}function Fh(e,t){var s=G.p;try{return G.p=e,t()}finally{G.p=s}}var Ma=Math.random().toString(36).slice(2),Ut="__reactFiber$"+Ma,en="__reactProps$"+Ma,Fs="__reactContainer$"+Ma,Rc="__reactEvents$"+Ma,Tx="__reactListeners$"+Ma,kx="__reactHandles$"+Ma,Zh="__reactResources$"+Ma,no="__reactMarker$"+Ma;function Mc(e){delete e[Ut],delete e[en],delete e[Rc],delete e[Tx],delete e[kx]}function Zs(e){var t=e[Ut];if(t)return t;for(var s=e.parentNode;s;){if(t=s[Fs]||s[Ut]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=vg(e);e!==null;){if(s=e[Ut])return s;e=vg(e)}return t}e=s,s=e.parentNode}return null}function Xs(e){if(e=e[Ut]||e[Fs]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ao(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(l(33))}function Qs(e){var t=e[Zh];return t||(t=e[Zh]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Lt(e){e[no]=!0}var Xh=new Set,Qh={};function hs(e,t){Ws(e,t),Ws(e+"Capture",t)}function Ws(e,t){for(Qh[e]=t,e=0;e<t.length;e++)Xh.add(t[e])}var jx=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]*$"),Wh={},Jh={};function wx(e){return xn.call(Jh,e)?!0:xn.call(Wh,e)?!1:jx.test(e)?Jh[e]=!0:(Wh[e]=!0,!1)}function wl(e,t,s){if(wx(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var o=t.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+s)}}function Cl(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+s)}}function aa(e,t,s,o){if(o===null)e.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+o)}}function Sn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ep(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Cx(e,t,s){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var d=o.get,h=o.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(x){s=""+x,h.call(this,x)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return s},setValue:function(x){s=""+x},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Oc(e){if(!e._valueTracker){var t=ep(e)?"checked":"value";e._valueTracker=Cx(e,t,""+e[t])}}function tp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),o="";return e&&(o=ep(e)?e.checked?"true":"false":e.value),e=o,e!==s?(t.setValue(e),!0):!1}function Nl(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 Nx=/[\n"\\]/g;function Tn(e){return e.replace(Nx,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Bc(e,t,s,o,d,h,x,j){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),t!=null?x==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Sn(t)):e.value!==""+Sn(t)&&(e.value=""+Sn(t)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),t!=null?Lc(e,x,Sn(t)):s!=null?Lc(e,x,Sn(s)):o!=null&&e.removeAttribute("value"),d==null&&h!=null&&(e.defaultChecked=!!h),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.name=""+Sn(j):e.removeAttribute("name")}function np(e,t,s,o,d,h,x,j){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),t!=null||s!=null){if(!(h!=="submit"&&h!=="reset"||t!=null)){Oc(e);return}s=s!=null?""+Sn(s):"",t=t!=null?""+Sn(t):s,j||t===e.value||(e.value=t),e.defaultValue=t}o=o??d,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=j?e.checked:!!o,e.defaultChecked=!!o,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),Oc(e)}function Lc(e,t,s){t==="number"&&Nl(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function Js(e,t,s,o){if(e=e.options,t){t={};for(var d=0;d<s.length;d++)t["$"+s[d]]=!0;for(s=0;s<e.length;s++)d=t.hasOwnProperty("$"+e[s].value),e[s].selected!==d&&(e[s].selected=d),d&&o&&(e[s].defaultSelected=!0)}else{for(s=""+Sn(s),t=null,d=0;d<e.length;d++){if(e[d].value===s){e[d].selected=!0,o&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function ap(e,t,s){if(t!=null&&(t=""+Sn(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+Sn(s):""}function sp(e,t,s,o){if(t==null){if(o!=null){if(s!=null)throw Error(l(92));if(ae(o)){if(1<o.length)throw Error(l(93));o=o[0]}s=o}s==null&&(s=""),t=s}s=Sn(t),e.defaultValue=s,o=e.textContent,o===s&&o!==""&&o!==null&&(e.value=o),Oc(e)}function ei(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var Ex=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 ip(e,t,s){var o=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?o?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":o?e.setProperty(t,s):typeof s!="number"||s===0||Ex.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function op(e,t,s){if(t!=null&&typeof t!="object")throw Error(l(62));if(e=e.style,s!=null){for(var o in s)!s.hasOwnProperty(o)||t!=null&&t.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="");for(var d in t)o=t[d],t.hasOwnProperty(d)&&s[d]!==o&&ip(e,d,o)}else for(var h in t)t.hasOwnProperty(h)&&ip(e,h,t[h])}function Ic(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 Ax=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"]]),Dx=/^[\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 El(e){return Dx.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function sa(){}var zc=null;function Uc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ti=null,ni=null;function lp(e){var t=Xs(e);if(t&&(e=t.stateNode)){var s=e[en]||null;e:switch(e=t.stateNode,t.type){case"input":if(Bc(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Tn(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var o=s[t];if(o!==e&&o.form===e.form){var d=o[en]||null;if(!d)throw Error(l(90));Bc(o,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(t=0;t<s.length;t++)o=s[t],o.form===e.form&&tp(o)}break e;case"textarea":ap(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&Js(e,!!s.multiple,t,!1)}}}var Vc=!1;function rp(e,t,s){if(Vc)return e(t,s);Vc=!0;try{var o=e(t);return o}finally{if(Vc=!1,(ti!==null||ni!==null)&&(vr(),ti&&(t=ti,e=ni,ni=ti=null,lp(t),e)))for(t=0;t<e.length;t++)lp(e[t])}}function so(e,t){var s=e.stateNode;if(s===null)return null;var o=s[en]||null;if(o===null)return null;s=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(l(231,t,typeof s));return s}var ia=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hc=!1;if(ia)try{var io={};Object.defineProperty(io,"passive",{get:function(){Hc=!0}}),window.addEventListener("test",io,io),window.removeEventListener("test",io,io)}catch{Hc=!1}var Oa=null,Pc=null,Al=null;function cp(){if(Al)return Al;var e,t=Pc,s=t.length,o,d="value"in Oa?Oa.value:Oa.textContent,h=d.length;for(e=0;e<s&&t[e]===d[e];e++);var x=s-e;for(o=1;o<=x&&t[s-o]===d[h-o];o++);return Al=d.slice(e,1<o?1-o:void 0)}function Dl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Rl(){return!0}function up(){return!1}function tn(e){function t(s,o,d,h,x){this._reactName=s,this._targetInst=d,this.type=o,this.nativeEvent=h,this.target=x,this.currentTarget=null;for(var j in e)e.hasOwnProperty(j)&&(s=e[j],this[j]=s?s(h):h[j]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Rl:up,this.isPropagationStopped=up,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Rl)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Rl)},persist:function(){},isPersistent:Rl}),t}var ps={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ml=tn(ps),oo=b({},ps,{view:0,detail:0}),Rx=tn(oo),Gc,qc,lo,Ol=b({},oo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kc,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!==lo&&(lo&&e.type==="mousemove"?(Gc=e.screenX-lo.screenX,qc=e.screenY-lo.screenY):qc=Gc=0,lo=e),Gc)},movementY:function(e){return"movementY"in e?e.movementY:qc}}),dp=tn(Ol),Mx=b({},Ol,{dataTransfer:0}),Ox=tn(Mx),Bx=b({},oo,{relatedTarget:0}),$c=tn(Bx),Lx=b({},ps,{animationName:0,elapsedTime:0,pseudoElement:0}),Ix=tn(Lx),zx=b({},ps,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ux=tn(zx),Vx=b({},ps,{data:0}),fp=tn(Vx),Hx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Px={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"},Gx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function qx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Gx[e])?!!t[e]:!1}function Kc(){return qx}var $x=b({},oo,{key:function(e){if(e.key){var t=Hx[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Dl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Px[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kc,charCode:function(e){return e.type==="keypress"?Dl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Dl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Kx=tn($x),Yx=b({},Ol,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),hp=tn(Yx),Fx=b({},oo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kc}),Zx=tn(Fx),Xx=b({},ps,{propertyName:0,elapsedTime:0,pseudoElement:0}),Qx=tn(Xx),Wx=b({},Ol,{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}),Jx=tn(Wx),e1=b({},ps,{newState:0,oldState:0}),t1=tn(e1),n1=[9,13,27,32],Yc=ia&&"CompositionEvent"in window,ro=null;ia&&"documentMode"in document&&(ro=document.documentMode);var a1=ia&&"TextEvent"in window&&!ro,pp=ia&&(!Yc||ro&&8<ro&&11>=ro),mp=" ",vp=!1;function gp(e,t){switch(e){case"keyup":return n1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ai=!1;function s1(e,t){switch(e){case"compositionend":return yp(t);case"keypress":return t.which!==32?null:(vp=!0,mp);case"textInput":return e=t.data,e===mp&&vp?null:e;default:return null}}function i1(e,t){if(ai)return e==="compositionend"||!Yc&&gp(e,t)?(e=cp(),Al=Pc=Oa=null,ai=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return pp&&t.locale!=="ko"?null:t.data;default:return null}}var o1={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 bp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!o1[e.type]:t==="textarea"}function _p(e,t,s,o){ti?ni?ni.push(o):ni=[o]:ti=o,t=Tr(t,"onChange"),0<t.length&&(s=new Ml("onChange","change",null,s,o),e.push({event:s,listeners:t}))}var co=null,uo=null;function l1(e){ng(e,0)}function Bl(e){var t=ao(e);if(tp(t))return e}function xp(e,t){if(e==="change")return t}var Sp=!1;if(ia){var Fc;if(ia){var Zc="oninput"in document;if(!Zc){var Tp=document.createElement("div");Tp.setAttribute("oninput","return;"),Zc=typeof Tp.oninput=="function"}Fc=Zc}else Fc=!1;Sp=Fc&&(!document.documentMode||9<document.documentMode)}function kp(){co&&(co.detachEvent("onpropertychange",jp),uo=co=null)}function jp(e){if(e.propertyName==="value"&&Bl(uo)){var t=[];_p(t,uo,e,Uc(e)),rp(l1,t)}}function r1(e,t,s){e==="focusin"?(kp(),co=t,uo=s,co.attachEvent("onpropertychange",jp)):e==="focusout"&&kp()}function c1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Bl(uo)}function u1(e,t){if(e==="click")return Bl(t)}function d1(e,t){if(e==="input"||e==="change")return Bl(t)}function f1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var un=typeof Object.is=="function"?Object.is:f1;function fo(e,t){if(un(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),o=Object.keys(t);if(s.length!==o.length)return!1;for(o=0;o<s.length;o++){var d=s[o];if(!xn.call(t,d)||!un(e[d],t[d]))return!1}return!0}function wp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Cp(e,t){var s=wp(e);e=0;for(var o;s;){if(s.nodeType===3){if(o=e+s.textContent.length,e<=t&&o>=t)return{node:s,offset:t-e};e=o}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=wp(s)}}function Np(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Np(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ep(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Nl(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=Nl(e.document)}return t}function Xc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var h1=ia&&"documentMode"in document&&11>=document.documentMode,si=null,Qc=null,ho=null,Wc=!1;function Ap(e,t,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Wc||si==null||si!==Nl(o)||(o=si,"selectionStart"in o&&Xc(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),ho&&fo(ho,o)||(ho=o,o=Tr(Qc,"onSelect"),0<o.length&&(t=new Ml("onSelect","select",null,t,s),e.push({event:t,listeners:o}),t.target=si)))}function ms(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var ii={animationend:ms("Animation","AnimationEnd"),animationiteration:ms("Animation","AnimationIteration"),animationstart:ms("Animation","AnimationStart"),transitionrun:ms("Transition","TransitionRun"),transitionstart:ms("Transition","TransitionStart"),transitioncancel:ms("Transition","TransitionCancel"),transitionend:ms("Transition","TransitionEnd")},Jc={},Dp={};ia&&(Dp=document.createElement("div").style,"AnimationEvent"in window||(delete ii.animationend.animation,delete ii.animationiteration.animation,delete ii.animationstart.animation),"TransitionEvent"in window||delete ii.transitionend.transition);function vs(e){if(Jc[e])return Jc[e];if(!ii[e])return e;var t=ii[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in Dp)return Jc[e]=t[s];return e}var Rp=vs("animationend"),Mp=vs("animationiteration"),Op=vs("animationstart"),p1=vs("transitionrun"),m1=vs("transitionstart"),v1=vs("transitioncancel"),Bp=vs("transitionend"),Lp=new Map,eu="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(" ");eu.push("scrollEnd");function Un(e,t){Lp.set(e,t),hs(t,[e])}var Ll=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},kn=[],oi=0,tu=0;function Il(){for(var e=oi,t=tu=oi=0;t<e;){var s=kn[t];kn[t++]=null;var o=kn[t];kn[t++]=null;var d=kn[t];kn[t++]=null;var h=kn[t];if(kn[t++]=null,o!==null&&d!==null){var x=o.pending;x===null?d.next=d:(d.next=x.next,x.next=d),o.pending=d}h!==0&&Ip(s,d,h)}}function zl(e,t,s,o){kn[oi++]=e,kn[oi++]=t,kn[oi++]=s,kn[oi++]=o,tu|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function nu(e,t,s,o){return zl(e,t,s,o),Ul(e)}function gs(e,t){return zl(e,null,null,t),Ul(e)}function Ip(e,t,s){e.lanes|=s;var o=e.alternate;o!==null&&(o.lanes|=s);for(var d=!1,h=e.return;h!==null;)h.childLanes|=s,o=h.alternate,o!==null&&(o.childLanes|=s),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(d=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,d&&t!==null&&(d=31-Me(s),e=h.hiddenUpdates,o=e[d],o===null?e[d]=[t]:o.push(t),t.lane=s|536870912),h):null}function Ul(e){if(50<Bo)throw Bo=0,dd=null,Error(l(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var li={};function g1(e,t,s,o){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function dn(e,t,s,o){return new g1(e,t,s,o)}function au(e){return e=e.prototype,!(!e||!e.isReactComponent)}function oa(e,t){var s=e.alternate;return s===null?(s=dn(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function zp(e,t){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Vl(e,t,s,o,d,h){var x=0;if(o=e,typeof e=="function")au(e)&&(x=1);else if(typeof e=="string")x=SS(e,s,Oe.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case K:return e=dn(31,s,t,d),e.elementType=K,e.lanes=h,e;case C:return ys(s.children,d,h,t);case w:x=8,d|=24;break;case k:return e=dn(12,s,t,d|2),e.elementType=k,e.lanes=h,e;case N:return e=dn(13,s,t,d),e.elementType=N,e.lanes=h,e;case z:return e=dn(19,s,t,d),e.elementType=z,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case A:x=10;break e;case E:x=9;break e;case R:x=11;break e;case H:x=14;break e;case B:x=16,o=null;break e}x=29,s=Error(l(130,e===null?"null":typeof e,"")),o=null}return t=dn(x,s,t,d),t.elementType=e,t.type=o,t.lanes=h,t}function ys(e,t,s,o){return e=dn(7,e,o,t),e.lanes=s,e}function su(e,t,s){return e=dn(6,e,null,t),e.lanes=s,e}function Up(e){var t=dn(18,null,null,0);return t.stateNode=e,t}function iu(e,t,s){return t=dn(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Vp=new WeakMap;function jn(e,t){if(typeof e=="object"&&e!==null){var s=Vp.get(e);return s!==void 0?s:(t={value:e,source:t,stack:Kn(t)},Vp.set(e,t),t)}return{value:e,source:t,stack:Kn(t)}}var ri=[],ci=0,Hl=null,po=0,wn=[],Cn=0,Ba=null,Yn=1,Fn="";function la(e,t){ri[ci++]=po,ri[ci++]=Hl,Hl=e,po=t}function Hp(e,t,s){wn[Cn++]=Yn,wn[Cn++]=Fn,wn[Cn++]=Ba,Ba=e;var o=Yn;e=Fn;var d=32-Me(o)-1;o&=~(1<<d),s+=1;var h=32-Me(t)+d;if(30<h){var x=d-d%5;h=(o&(1<<x)-1).toString(32),o>>=x,d-=x,Yn=1<<32-Me(t)+d|s<<d|o,Fn=h+e}else Yn=1<<h|s<<d|o,Fn=e}function ou(e){e.return!==null&&(la(e,1),Hp(e,1,0))}function lu(e){for(;e===Hl;)Hl=ri[--ci],ri[ci]=null,po=ri[--ci],ri[ci]=null;for(;e===Ba;)Ba=wn[--Cn],wn[Cn]=null,Fn=wn[--Cn],wn[Cn]=null,Yn=wn[--Cn],wn[Cn]=null}function Pp(e,t){wn[Cn++]=Yn,wn[Cn++]=Fn,wn[Cn++]=Ba,Yn=t.id,Fn=t.overflow,Ba=e}var Vt=null,it=null,Ve=!1,La=null,Nn=!1,ru=Error(l(519));function Ia(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw mo(jn(t,e)),ru}function Gp(e){var t=e.stateNode,s=e.type,o=e.memoizedProps;switch(t[Ut]=e,t[en]=o,s){case"dialog":Le("cancel",t),Le("close",t);break;case"iframe":case"object":case"embed":Le("load",t);break;case"video":case"audio":for(s=0;s<Io.length;s++)Le(Io[s],t);break;case"source":Le("error",t);break;case"img":case"image":case"link":Le("error",t),Le("load",t);break;case"details":Le("toggle",t);break;case"input":Le("invalid",t),np(t,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Le("invalid",t);break;case"textarea":Le("invalid",t),sp(t,o.value,o.defaultValue,o.children)}s=o.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||o.suppressHydrationWarning===!0||og(t.textContent,s)?(o.popover!=null&&(Le("beforetoggle",t),Le("toggle",t)),o.onScroll!=null&&Le("scroll",t),o.onScrollEnd!=null&&Le("scrollend",t),o.onClick!=null&&(t.onclick=sa),t=!0):t=!1,t||Ia(e,!0)}function qp(e){for(Vt=e.return;Vt;)switch(Vt.tag){case 5:case 31:case 13:Nn=!1;return;case 27:case 3:Nn=!0;return;default:Vt=Vt.return}}function ui(e){if(e!==Vt)return!1;if(!Ve)return qp(e),Ve=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||wd(e.type,e.memoizedProps)),s=!s),s&&it&&Ia(e),qp(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));it=mg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));it=mg(e)}else t===27?(t=it,Qa(e.type)?(e=Dd,Dd=null,it=e):it=t):it=Vt?An(e.stateNode.nextSibling):null;return!0}function bs(){it=Vt=null,Ve=!1}function cu(){var e=La;return e!==null&&(on===null?on=e:on.push.apply(on,e),La=null),e}function mo(e){La===null?La=[e]:La.push(e)}var uu=De(null),_s=null,ra=null;function za(e,t,s){Se(uu,t._currentValue),t._currentValue=s}function ca(e){e._currentValue=uu.current,we(uu)}function du(e,t,s){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===s)break;e=e.return}}function fu(e,t,s,o){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var h=d.dependencies;if(h!==null){var x=d.child;h=h.firstContext;e:for(;h!==null;){var j=h;h=d;for(var D=0;D<t.length;D++)if(j.context===t[D]){h.lanes|=s,j=h.alternate,j!==null&&(j.lanes|=s),du(h.return,s,e),o||(x=null);break e}h=j.next}}else if(d.tag===18){if(x=d.return,x===null)throw Error(l(341));x.lanes|=s,h=x.alternate,h!==null&&(h.lanes|=s),du(x,s,e),x=null}else x=d.child;if(x!==null)x.return=d;else for(x=d;x!==null;){if(x===e){x=null;break}if(d=x.sibling,d!==null){d.return=x.return,x=d;break}x=x.return}d=x}}function di(e,t,s,o){e=null;for(var d=t,h=!1;d!==null;){if(!h){if((d.flags&524288)!==0)h=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var x=d.alternate;if(x===null)throw Error(l(387));if(x=x.memoizedProps,x!==null){var j=d.type;un(d.pendingProps.value,x.value)||(e!==null?e.push(j):e=[j])}}else if(d===fe.current){if(x=d.alternate,x===null)throw Error(l(387));x.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Po):e=[Po])}d=d.return}e!==null&&fu(t,e,s,o),t.flags|=262144}function Pl(e){for(e=e.firstContext;e!==null;){if(!un(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function xs(e){_s=e,ra=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ht(e){return $p(_s,e)}function Gl(e,t){return _s===null&&xs(e),$p(e,t)}function $p(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},ra===null){if(e===null)throw Error(l(308));ra=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ra=ra.next=t;return s}var y1=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,o){e.push(o)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},b1=n.unstable_scheduleCallback,_1=n.unstable_NormalPriority,kt={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function hu(){return{controller:new y1,data:new Map,refCount:0}}function vo(e){e.refCount--,e.refCount===0&&b1(_1,function(){e.controller.abort()})}var go=null,pu=0,fi=0,hi=null;function x1(e,t){if(go===null){var s=go=[];pu=0,fi=gd(),hi={status:"pending",value:void 0,then:function(o){s.push(o)}}}return pu++,t.then(Kp,Kp),t}function Kp(){if(--pu===0&&go!==null){hi!==null&&(hi.status="fulfilled");var e=go;go=null,fi=0,hi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function S1(e,t){var s=[],o={status:"pending",value:null,reason:null,then:function(d){s.push(d)}};return e.then(function(){o.status="fulfilled",o.value=t;for(var d=0;d<s.length;d++)(0,s[d])(t)},function(d){for(o.status="rejected",o.reason=d,d=0;d<s.length;d++)(0,s[d])(void 0)}),o}var Yp=O.S;O.S=function(e,t){Av=Yt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&x1(e,t),Yp!==null&&Yp(e,t)};var Ss=De(null);function mu(){var e=Ss.current;return e!==null?e:at.pooledCache}function ql(e,t){t===null?Se(Ss,Ss.current):Se(Ss,t.pool)}function Fp(){var e=mu();return e===null?null:{parent:kt._currentValue,pool:e}}var pi=Error(l(460)),vu=Error(l(474)),$l=Error(l(542)),Kl={then:function(){}};function Zp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Xp(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(sa,sa),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Wp(e),e;default:if(typeof t.status=="string")t.then(sa,sa);else{if(e=at,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=t,e.status="pending",e.then(function(o){if(t.status==="pending"){var d=t;d.status="fulfilled",d.value=o}},function(o){if(t.status==="pending"){var d=t;d.status="rejected",d.reason=o}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Wp(e),e}throw ks=t,pi}}function Ts(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(ks=s,pi):s}}var ks=null;function Qp(){if(ks===null)throw Error(l(459));var e=ks;return ks=null,e}function Wp(e){if(e===pi||e===$l)throw Error(l(483))}var mi=null,yo=0;function Yl(e){var t=yo;return yo+=1,mi===null&&(mi=[]),Xp(mi,e,t)}function bo(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Fl(e,t){throw t.$$typeof===_?Error(l(525)):(e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Jp(e){function t(L,M){if(e){var U=L.deletions;U===null?(L.deletions=[M],L.flags|=16):U.push(M)}}function s(L,M){if(!e)return null;for(;M!==null;)t(L,M),M=M.sibling;return null}function o(L){for(var M=new Map;L!==null;)L.key!==null?M.set(L.key,L):M.set(L.index,L),L=L.sibling;return M}function d(L,M){return L=oa(L,M),L.index=0,L.sibling=null,L}function h(L,M,U){return L.index=U,e?(U=L.alternate,U!==null?(U=U.index,U<M?(L.flags|=67108866,M):U):(L.flags|=67108866,M)):(L.flags|=1048576,M)}function x(L){return e&&L.alternate===null&&(L.flags|=67108866),L}function j(L,M,U,Z){return M===null||M.tag!==6?(M=su(U,L.mode,Z),M.return=L,M):(M=d(M,U),M.return=L,M)}function D(L,M,U,Z){var ve=U.type;return ve===C?F(L,M,U.props.children,Z,U.key):M!==null&&(M.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===B&&Ts(ve)===M.type)?(M=d(M,U.props),bo(M,U),M.return=L,M):(M=Vl(U.type,U.key,U.props,null,L.mode,Z),bo(M,U),M.return=L,M)}function V(L,M,U,Z){return M===null||M.tag!==4||M.stateNode.containerInfo!==U.containerInfo||M.stateNode.implementation!==U.implementation?(M=iu(U,L.mode,Z),M.return=L,M):(M=d(M,U.children||[]),M.return=L,M)}function F(L,M,U,Z,ve){return M===null||M.tag!==7?(M=ys(U,L.mode,Z,ve),M.return=L,M):(M=d(M,U),M.return=L,M)}function X(L,M,U){if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return M=su(""+M,L.mode,U),M.return=L,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case S:return U=Vl(M.type,M.key,M.props,null,L.mode,U),bo(U,M),U.return=L,U;case T:return M=iu(M,L.mode,U),M.return=L,M;case B:return M=Ts(M),X(L,M,U)}if(ae(M)||ne(M))return M=ys(M,L.mode,U,null),M.return=L,M;if(typeof M.then=="function")return X(L,Yl(M),U);if(M.$$typeof===A)return X(L,Gl(L,M),U);Fl(L,M)}return null}function P(L,M,U,Z){var ve=M!==null?M.key:null;if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return ve!==null?null:j(L,M,""+U,Z);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case S:return U.key===ve?D(L,M,U,Z):null;case T:return U.key===ve?V(L,M,U,Z):null;case B:return U=Ts(U),P(L,M,U,Z)}if(ae(U)||ne(U))return ve!==null?null:F(L,M,U,Z,null);if(typeof U.then=="function")return P(L,M,Yl(U),Z);if(U.$$typeof===A)return P(L,M,Gl(L,U),Z);Fl(L,U)}return null}function q(L,M,U,Z,ve){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return L=L.get(U)||null,j(M,L,""+Z,ve);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case S:return L=L.get(Z.key===null?U:Z.key)||null,D(M,L,Z,ve);case T:return L=L.get(Z.key===null?U:Z.key)||null,V(M,L,Z,ve);case B:return Z=Ts(Z),q(L,M,U,Z,ve)}if(ae(Z)||ne(Z))return L=L.get(U)||null,F(M,L,Z,ve,null);if(typeof Z.then=="function")return q(L,M,U,Yl(Z),ve);if(Z.$$typeof===A)return q(L,M,U,Gl(M,Z),ve);Fl(M,Z)}return null}function he(L,M,U,Z){for(var ve=null,$e=null,pe=M,Ae=M=0,ze=null;pe!==null&&Ae<U.length;Ae++){pe.index>Ae?(ze=pe,pe=null):ze=pe.sibling;var Ke=P(L,pe,U[Ae],Z);if(Ke===null){pe===null&&(pe=ze);break}e&&pe&&Ke.alternate===null&&t(L,pe),M=h(Ke,M,Ae),$e===null?ve=Ke:$e.sibling=Ke,$e=Ke,pe=ze}if(Ae===U.length)return s(L,pe),Ve&&la(L,Ae),ve;if(pe===null){for(;Ae<U.length;Ae++)pe=X(L,U[Ae],Z),pe!==null&&(M=h(pe,M,Ae),$e===null?ve=pe:$e.sibling=pe,$e=pe);return Ve&&la(L,Ae),ve}for(pe=o(pe);Ae<U.length;Ae++)ze=q(pe,L,Ae,U[Ae],Z),ze!==null&&(e&&ze.alternate!==null&&pe.delete(ze.key===null?Ae:ze.key),M=h(ze,M,Ae),$e===null?ve=ze:$e.sibling=ze,$e=ze);return e&&pe.forEach(function(ns){return t(L,ns)}),Ve&&la(L,Ae),ve}function be(L,M,U,Z){if(U==null)throw Error(l(151));for(var ve=null,$e=null,pe=M,Ae=M=0,ze=null,Ke=U.next();pe!==null&&!Ke.done;Ae++,Ke=U.next()){pe.index>Ae?(ze=pe,pe=null):ze=pe.sibling;var ns=P(L,pe,Ke.value,Z);if(ns===null){pe===null&&(pe=ze);break}e&&pe&&ns.alternate===null&&t(L,pe),M=h(ns,M,Ae),$e===null?ve=ns:$e.sibling=ns,$e=ns,pe=ze}if(Ke.done)return s(L,pe),Ve&&la(L,Ae),ve;if(pe===null){for(;!Ke.done;Ae++,Ke=U.next())Ke=X(L,Ke.value,Z),Ke!==null&&(M=h(Ke,M,Ae),$e===null?ve=Ke:$e.sibling=Ke,$e=Ke);return Ve&&la(L,Ae),ve}for(pe=o(pe);!Ke.done;Ae++,Ke=U.next())Ke=q(pe,L,Ae,Ke.value,Z),Ke!==null&&(e&&Ke.alternate!==null&&pe.delete(Ke.key===null?Ae:Ke.key),M=h(Ke,M,Ae),$e===null?ve=Ke:$e.sibling=Ke,$e=Ke);return e&&pe.forEach(function(MS){return t(L,MS)}),Ve&&la(L,Ae),ve}function nt(L,M,U,Z){if(typeof U=="object"&&U!==null&&U.type===C&&U.key===null&&(U=U.props.children),typeof U=="object"&&U!==null){switch(U.$$typeof){case S:e:{for(var ve=U.key;M!==null;){if(M.key===ve){if(ve=U.type,ve===C){if(M.tag===7){s(L,M.sibling),Z=d(M,U.props.children),Z.return=L,L=Z;break e}}else if(M.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===B&&Ts(ve)===M.type){s(L,M.sibling),Z=d(M,U.props),bo(Z,U),Z.return=L,L=Z;break e}s(L,M);break}else t(L,M);M=M.sibling}U.type===C?(Z=ys(U.props.children,L.mode,Z,U.key),Z.return=L,L=Z):(Z=Vl(U.type,U.key,U.props,null,L.mode,Z),bo(Z,U),Z.return=L,L=Z)}return x(L);case T:e:{for(ve=U.key;M!==null;){if(M.key===ve)if(M.tag===4&&M.stateNode.containerInfo===U.containerInfo&&M.stateNode.implementation===U.implementation){s(L,M.sibling),Z=d(M,U.children||[]),Z.return=L,L=Z;break e}else{s(L,M);break}else t(L,M);M=M.sibling}Z=iu(U,L.mode,Z),Z.return=L,L=Z}return x(L);case B:return U=Ts(U),nt(L,M,U,Z)}if(ae(U))return he(L,M,U,Z);if(ne(U)){if(ve=ne(U),typeof ve!="function")throw Error(l(150));return U=ve.call(U),be(L,M,U,Z)}if(typeof U.then=="function")return nt(L,M,Yl(U),Z);if(U.$$typeof===A)return nt(L,M,Gl(L,U),Z);Fl(L,U)}return typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint"?(U=""+U,M!==null&&M.tag===6?(s(L,M.sibling),Z=d(M,U),Z.return=L,L=Z):(s(L,M),Z=su(U,L.mode,Z),Z.return=L,L=Z),x(L)):s(L,M)}return function(L,M,U,Z){try{yo=0;var ve=nt(L,M,U,Z);return mi=null,ve}catch(pe){if(pe===pi||pe===$l)throw pe;var $e=dn(29,pe,null,L.mode);return $e.lanes=Z,$e.return=L,$e}finally{}}}var js=Jp(!0),em=Jp(!1),Ua=!1;function gu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function yu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Va(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ha(e,t,s){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Ze&2)!==0){var d=o.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),o.pending=t,t=Ul(e),Ip(e,null,s),t}return zl(e,o,t,s),Ul(e)}function _o(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,$h(e,s)}}function bu(e,t){var s=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,s===o)){var d=null,h=null;if(s=s.firstBaseUpdate,s!==null){do{var x={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};h===null?d=h=x:h=h.next=x,s=s.next}while(s!==null);h===null?d=h=t:h=h.next=t}else d=h=t;s={baseState:o.baseState,firstBaseUpdate:d,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var _u=!1;function xo(){if(_u){var e=hi;if(e!==null)throw e}}function So(e,t,s,o){_u=!1;var d=e.updateQueue;Ua=!1;var h=d.firstBaseUpdate,x=d.lastBaseUpdate,j=d.shared.pending;if(j!==null){d.shared.pending=null;var D=j,V=D.next;D.next=null,x===null?h=V:x.next=V,x=D;var F=e.alternate;F!==null&&(F=F.updateQueue,j=F.lastBaseUpdate,j!==x&&(j===null?F.firstBaseUpdate=V:j.next=V,F.lastBaseUpdate=D))}if(h!==null){var X=d.baseState;x=0,F=V=D=null,j=h;do{var P=j.lane&-536870913,q=P!==j.lane;if(q?(Ie&P)===P:(o&P)===P){P!==0&&P===fi&&(_u=!0),F!==null&&(F=F.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var he=e,be=j;P=t;var nt=s;switch(be.tag){case 1:if(he=be.payload,typeof he=="function"){X=he.call(nt,X,P);break e}X=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=be.payload,P=typeof he=="function"?he.call(nt,X,P):he,P==null)break e;X=b({},X,P);break e;case 2:Ua=!0}}P=j.callback,P!==null&&(e.flags|=64,q&&(e.flags|=8192),q=d.callbacks,q===null?d.callbacks=[P]:q.push(P))}else q={lane:P,tag:j.tag,payload:j.payload,callback:j.callback,next:null},F===null?(V=F=q,D=X):F=F.next=q,x|=P;if(j=j.next,j===null){if(j=d.shared.pending,j===null)break;q=j,j=q.next,q.next=null,d.lastBaseUpdate=q,d.shared.pending=null}}while(!0);F===null&&(D=X),d.baseState=D,d.firstBaseUpdate=V,d.lastBaseUpdate=F,h===null&&(d.shared.lanes=0),Ka|=x,e.lanes=x,e.memoizedState=X}}function tm(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function nm(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)tm(s[e],t)}var vi=De(null),Zl=De(0);function am(e,t){e=ya,Se(Zl,e),Se(vi,t),ya=e|t.baseLanes}function xu(){Se(Zl,ya),Se(vi,vi.current)}function Su(){ya=Zl.current,we(vi),we(Zl)}var fn=De(null),En=null;function Pa(e){var t=e.alternate;Se(_t,_t.current&1),Se(fn,e),En===null&&(t===null||vi.current!==null||t.memoizedState!==null)&&(En=e)}function Tu(e){Se(_t,_t.current),Se(fn,e),En===null&&(En=e)}function sm(e){e.tag===22?(Se(_t,_t.current),Se(fn,e),En===null&&(En=e)):Ga()}function Ga(){Se(_t,_t.current),Se(fn,fn.current)}function hn(e){we(fn),En===e&&(En=null),we(_t)}var _t=De(0);function Xl(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Ed(s)||Ad(s)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ua=0,Ne=null,et=null,jt=null,Ql=!1,gi=!1,ws=!1,Wl=0,To=0,yi=null,T1=0;function vt(){throw Error(l(321))}function ku(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!un(e[s],t[s]))return!1;return!0}function ju(e,t,s,o,d,h){return ua=h,Ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,O.H=e===null||e.memoizedState===null?Hm:Vu,ws=!1,h=s(o,d),ws=!1,gi&&(h=om(t,s,o,d)),im(e),h}function im(e){O.H=wo;var t=et!==null&&et.next!==null;if(ua=0,jt=et=Ne=null,Ql=!1,To=0,yi=null,t)throw Error(l(300));e===null||wt||(e=e.dependencies,e!==null&&Pl(e)&&(wt=!0))}function om(e,t,s,o){Ne=e;var d=0;do{if(gi&&(yi=null),To=0,gi=!1,25<=d)throw Error(l(301));if(d+=1,jt=et=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}O.H=Pm,h=t(s,o)}while(gi);return h}function k1(){var e=O.H,t=e.useState()[0];return t=typeof t.then=="function"?ko(t):t,e=e.useState()[0],(et!==null?et.memoizedState:null)!==e&&(Ne.flags|=1024),t}function wu(){var e=Wl!==0;return Wl=0,e}function Cu(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function Nu(e){if(Ql){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ql=!1}ua=0,jt=et=Ne=null,gi=!1,To=Wl=0,yi=null}function Qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jt===null?Ne.memoizedState=jt=e:jt=jt.next=e,jt}function xt(){if(et===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=et.next;var t=jt===null?Ne.memoizedState:jt.next;if(t!==null)jt=t,et=e;else{if(e===null)throw Ne.alternate===null?Error(l(467)):Error(l(310));et=e,e={memoizedState:et.memoizedState,baseState:et.baseState,baseQueue:et.baseQueue,queue:et.queue,next:null},jt===null?Ne.memoizedState=jt=e:jt=jt.next=e}return jt}function Jl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ko(e){var t=To;return To+=1,yi===null&&(yi=[]),e=Xp(yi,e,t),t=Ne,(jt===null?t.memoizedState:jt.next)===null&&(t=t.alternate,O.H=t===null||t.memoizedState===null?Hm:Vu),e}function er(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ko(e);if(e.$$typeof===A)return Ht(e)}throw Error(l(438,String(e)))}function Eu(e){var t=null,s=Ne.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var o=Ne.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(t={data:o.data.map(function(d){return d.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=Jl(),Ne.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),o=0;o<e;o++)s[o]=W;return t.index++,s}function da(e,t){return typeof t=="function"?t(e):t}function tr(e){var t=xt();return Au(t,et,e)}function Au(e,t,s){var o=e.queue;if(o===null)throw Error(l(311));o.lastRenderedReducer=s;var d=e.baseQueue,h=o.pending;if(h!==null){if(d!==null){var x=d.next;d.next=h.next,h.next=x}t.baseQueue=d=h,o.pending=null}if(h=e.baseState,d===null)e.memoizedState=h;else{t=d.next;var j=x=null,D=null,V=t,F=!1;do{var X=V.lane&-536870913;if(X!==V.lane?(Ie&X)===X:(ua&X)===X){var P=V.revertLane;if(P===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),X===fi&&(F=!0);else if((ua&P)===P){V=V.next,P===fi&&(F=!0);continue}else X={lane:0,revertLane:V.revertLane,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},D===null?(j=D=X,x=h):D=D.next=X,Ne.lanes|=P,Ka|=P;X=V.action,ws&&s(h,X),h=V.hasEagerState?V.eagerState:s(h,X)}else P={lane:X,revertLane:V.revertLane,gesture:V.gesture,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},D===null?(j=D=P,x=h):D=D.next=P,Ne.lanes|=X,Ka|=X;V=V.next}while(V!==null&&V!==t);if(D===null?x=h:D.next=j,!un(h,e.memoizedState)&&(wt=!0,F&&(s=hi,s!==null)))throw s;e.memoizedState=h,e.baseState=x,e.baseQueue=D,o.lastRenderedState=h}return d===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function Du(e){var t=xt(),s=t.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=e;var o=s.dispatch,d=s.pending,h=t.memoizedState;if(d!==null){s.pending=null;var x=d=d.next;do h=e(h,x.action),x=x.next;while(x!==d);un(h,t.memoizedState)||(wt=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),s.lastRenderedState=h}return[h,o]}function lm(e,t,s){var o=Ne,d=xt(),h=Ve;if(h){if(s===void 0)throw Error(l(407));s=s()}else s=t();var x=!un((et||d).memoizedState,s);if(x&&(d.memoizedState=s,wt=!0),d=d.queue,Ou(um.bind(null,o,d,e),[e]),d.getSnapshot!==t||x||jt!==null&&jt.memoizedState.tag&1){if(o.flags|=2048,bi(9,{destroy:void 0},cm.bind(null,o,d,s,t),null),at===null)throw Error(l(349));h||(ua&127)!==0||rm(o,t,s)}return s}function rm(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=Ne.updateQueue,t===null?(t=Jl(),Ne.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function cm(e,t,s,o){t.value=s,t.getSnapshot=o,dm(t)&&fm(e)}function um(e,t,s){return s(function(){dm(t)&&fm(e)})}function dm(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!un(e,s)}catch{return!0}}function fm(e){var t=gs(e,2);t!==null&&ln(t,e,2)}function Ru(e){var t=Qt();if(typeof e=="function"){var s=e;if(e=s(),ws){Qe(!0);try{s()}finally{Qe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:da,lastRenderedState:e},t}function hm(e,t,s,o){return e.baseState=s,Au(e,et,typeof o=="function"?o:da)}function j1(e,t,s,o,d){if(sr(e))throw Error(l(485));if(e=t.action,e!==null){var h={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){h.listeners.push(x)}};O.T!==null?s(!0):h.isTransition=!1,o(h),s=t.pending,s===null?(h.next=t.pending=h,pm(t,h)):(h.next=s.next,t.pending=s.next=h)}}function pm(e,t){var s=t.action,o=t.payload,d=e.state;if(t.isTransition){var h=O.T,x={};O.T=x;try{var j=s(d,o),D=O.S;D!==null&&D(x,j),mm(e,t,j)}catch(V){Mu(e,t,V)}finally{h!==null&&x.types!==null&&(h.types=x.types),O.T=h}}else try{h=s(d,o),mm(e,t,h)}catch(V){Mu(e,t,V)}}function mm(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(o){vm(e,t,o)},function(o){return Mu(e,t,o)}):vm(e,t,s)}function vm(e,t,s){t.status="fulfilled",t.value=s,gm(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,pm(e,s)))}function Mu(e,t,s){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do t.status="rejected",t.reason=s,gm(t),t=t.next;while(t!==o)}e.action=null}function gm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ym(e,t){return t}function bm(e,t){if(Ve){var s=at.formState;if(s!==null){e:{var o=Ne;if(Ve){if(it){t:{for(var d=it,h=Nn;d.nodeType!==8;){if(!h){d=null;break t}if(d=An(d.nextSibling),d===null){d=null;break t}}h=d.data,d=h==="F!"||h==="F"?d:null}if(d){it=An(d.nextSibling),o=d.data==="F!";break e}}Ia(o)}o=!1}o&&(t=s[0])}}return s=Qt(),s.memoizedState=s.baseState=t,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ym,lastRenderedState:t},s.queue=o,s=zm.bind(null,Ne,o),o.dispatch=s,o=Ru(!1),h=Uu.bind(null,Ne,!1,o.queue),o=Qt(),d={state:t,dispatch:null,action:e,pending:null},o.queue=d,s=j1.bind(null,Ne,d,h,s),d.dispatch=s,o.memoizedState=e,[t,s,!1]}function _m(e){var t=xt();return xm(t,et,e)}function xm(e,t,s){if(t=Au(e,t,ym)[0],e=tr(da)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var o=ko(t)}catch(x){throw x===pi?$l:x}else o=t;t=xt();var d=t.queue,h=d.dispatch;return s!==t.memoizedState&&(Ne.flags|=2048,bi(9,{destroy:void 0},w1.bind(null,d,s),null)),[o,h,e]}function w1(e,t){e.action=t}function Sm(e){var t=xt(),s=et;if(s!==null)return xm(t,s,e);xt(),t=t.memoizedState,s=xt();var o=s.queue.dispatch;return s.memoizedState=e,[t,o,!1]}function bi(e,t,s,o){return e={tag:e,create:s,deps:o,inst:t,next:null},t=Ne.updateQueue,t===null&&(t=Jl(),Ne.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(o=s.next,s.next=e,e.next=o,t.lastEffect=e),e}function Tm(){return xt().memoizedState}function nr(e,t,s,o){var d=Qt();Ne.flags|=e,d.memoizedState=bi(1|t,{destroy:void 0},s,o===void 0?null:o)}function ar(e,t,s,o){var d=xt();o=o===void 0?null:o;var h=d.memoizedState.inst;et!==null&&o!==null&&ku(o,et.memoizedState.deps)?d.memoizedState=bi(t,h,s,o):(Ne.flags|=e,d.memoizedState=bi(1|t,h,s,o))}function km(e,t){nr(8390656,8,e,t)}function Ou(e,t){ar(2048,8,e,t)}function C1(e){Ne.flags|=4;var t=Ne.updateQueue;if(t===null)t=Jl(),Ne.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function jm(e){var t=xt().memoizedState;return C1({ref:t,nextImpl:e}),function(){if((Ze&2)!==0)throw Error(l(440));return t.impl.apply(void 0,arguments)}}function wm(e,t){return ar(4,2,e,t)}function Cm(e,t){return ar(4,4,e,t)}function Nm(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Em(e,t,s){s=s!=null?s.concat([e]):null,ar(4,4,Nm.bind(null,t,e),s)}function Bu(){}function Am(e,t){var s=xt();t=t===void 0?null:t;var o=s.memoizedState;return t!==null&&ku(t,o[1])?o[0]:(s.memoizedState=[e,t],e)}function Dm(e,t){var s=xt();t=t===void 0?null:t;var o=s.memoizedState;if(t!==null&&ku(t,o[1]))return o[0];if(o=e(),ws){Qe(!0);try{e()}finally{Qe(!1)}}return s.memoizedState=[o,t],o}function Lu(e,t,s){return s===void 0||(ua&1073741824)!==0&&(Ie&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=Rv(),Ne.lanes|=e,Ka|=e,s)}function Rm(e,t,s,o){return un(s,t)?s:vi.current!==null?(e=Lu(e,s,o),un(e,t)||(wt=!0),e):(ua&42)===0||(ua&1073741824)!==0&&(Ie&261930)===0?(wt=!0,e.memoizedState=s):(e=Rv(),Ne.lanes|=e,Ka|=e,t)}function Mm(e,t,s,o,d){var h=G.p;G.p=h!==0&&8>h?h:8;var x=O.T,j={};O.T=j,Uu(e,!1,t,s);try{var D=d(),V=O.S;if(V!==null&&V(j,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var F=S1(D,o);jo(e,t,F,vn(e))}else jo(e,t,o,vn(e))}catch(X){jo(e,t,{then:function(){},status:"rejected",reason:X},vn())}finally{G.p=h,x!==null&&j.types!==null&&(x.types=j.types),O.T=x}}function N1(){}function Iu(e,t,s,o){if(e.tag!==5)throw Error(l(476));var d=Om(e).queue;Mm(e,d,t,Q,s===null?N1:function(){return Bm(e),s(o)})}function Om(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:da,lastRenderedState:Q},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:da,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Bm(e){var t=Om(e);t.next===null&&(t=e.alternate.memoizedState),jo(e,t.next.queue,{},vn())}function zu(){return Ht(Po)}function Lm(){return xt().memoizedState}function Im(){return xt().memoizedState}function E1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=vn();e=Va(s);var o=Ha(t,e,s);o!==null&&(ln(o,t,s),_o(o,t,s)),t={cache:hu()},e.payload=t;return}t=t.return}}function A1(e,t,s){var o=vn();s={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},sr(e)?Um(t,s):(s=nu(e,t,s,o),s!==null&&(ln(s,e,o),Vm(s,t,o)))}function zm(e,t,s){var o=vn();jo(e,t,s,o)}function jo(e,t,s,o){var d={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(sr(e))Um(t,d);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var x=t.lastRenderedState,j=h(x,s);if(d.hasEagerState=!0,d.eagerState=j,un(j,x))return zl(e,t,d,0),at===null&&Il(),!1}catch{}finally{}if(s=nu(e,t,d,o),s!==null)return ln(s,e,o),Vm(s,t,o),!0}return!1}function Uu(e,t,s,o){if(o={lane:2,revertLane:gd(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},sr(e)){if(t)throw Error(l(479))}else t=nu(e,s,o,2),t!==null&&ln(t,e,2)}function sr(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function Um(e,t){gi=Ql=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function Vm(e,t,s){if((s&4194048)!==0){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,$h(e,s)}}var wo={readContext:Ht,use:er,useCallback:vt,useContext:vt,useEffect:vt,useImperativeHandle:vt,useLayoutEffect:vt,useInsertionEffect:vt,useMemo:vt,useReducer:vt,useRef:vt,useState:vt,useDebugValue:vt,useDeferredValue:vt,useTransition:vt,useSyncExternalStore:vt,useId:vt,useHostTransitionStatus:vt,useFormState:vt,useActionState:vt,useOptimistic:vt,useMemoCache:vt,useCacheRefresh:vt};wo.useEffectEvent=vt;var Hm={readContext:Ht,use:er,useCallback:function(e,t){return Qt().memoizedState=[e,t===void 0?null:t],e},useContext:Ht,useEffect:km,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,nr(4194308,4,Nm.bind(null,t,e),s)},useLayoutEffect:function(e,t){return nr(4194308,4,e,t)},useInsertionEffect:function(e,t){nr(4,2,e,t)},useMemo:function(e,t){var s=Qt();t=t===void 0?null:t;var o=e();if(ws){Qe(!0);try{e()}finally{Qe(!1)}}return s.memoizedState=[o,t],o},useReducer:function(e,t,s){var o=Qt();if(s!==void 0){var d=s(t);if(ws){Qe(!0);try{s(t)}finally{Qe(!1)}}}else d=t;return o.memoizedState=o.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},o.queue=e,e=e.dispatch=A1.bind(null,Ne,e),[o.memoizedState,e]},useRef:function(e){var t=Qt();return e={current:e},t.memoizedState=e},useState:function(e){e=Ru(e);var t=e.queue,s=zm.bind(null,Ne,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:Bu,useDeferredValue:function(e,t){var s=Qt();return Lu(s,e,t)},useTransition:function(){var e=Ru(!1);return e=Mm.bind(null,Ne,e.queue,!0,!1),Qt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var o=Ne,d=Qt();if(Ve){if(s===void 0)throw Error(l(407));s=s()}else{if(s=t(),at===null)throw Error(l(349));(Ie&127)!==0||rm(o,t,s)}d.memoizedState=s;var h={value:s,getSnapshot:t};return d.queue=h,km(um.bind(null,o,h,e),[e]),o.flags|=2048,bi(9,{destroy:void 0},cm.bind(null,o,h,s,t),null),s},useId:function(){var e=Qt(),t=at.identifierPrefix;if(Ve){var s=Fn,o=Yn;s=(o&~(1<<32-Me(o)-1)).toString(32)+s,t="_"+t+"R_"+s,s=Wl++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=T1++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:zu,useFormState:bm,useActionState:bm,useOptimistic:function(e){var t=Qt();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Uu.bind(null,Ne,!0,s),s.dispatch=t,[e,t]},useMemoCache:Eu,useCacheRefresh:function(){return Qt().memoizedState=E1.bind(null,Ne)},useEffectEvent:function(e){var t=Qt(),s={impl:e};return t.memoizedState=s,function(){if((Ze&2)!==0)throw Error(l(440));return s.impl.apply(void 0,arguments)}}},Vu={readContext:Ht,use:er,useCallback:Am,useContext:Ht,useEffect:Ou,useImperativeHandle:Em,useInsertionEffect:wm,useLayoutEffect:Cm,useMemo:Dm,useReducer:tr,useRef:Tm,useState:function(){return tr(da)},useDebugValue:Bu,useDeferredValue:function(e,t){var s=xt();return Rm(s,et.memoizedState,e,t)},useTransition:function(){var e=tr(da)[0],t=xt().memoizedState;return[typeof e=="boolean"?e:ko(e),t]},useSyncExternalStore:lm,useId:Lm,useHostTransitionStatus:zu,useFormState:_m,useActionState:_m,useOptimistic:function(e,t){var s=xt();return hm(s,et,e,t)},useMemoCache:Eu,useCacheRefresh:Im};Vu.useEffectEvent=jm;var Pm={readContext:Ht,use:er,useCallback:Am,useContext:Ht,useEffect:Ou,useImperativeHandle:Em,useInsertionEffect:wm,useLayoutEffect:Cm,useMemo:Dm,useReducer:Du,useRef:Tm,useState:function(){return Du(da)},useDebugValue:Bu,useDeferredValue:function(e,t){var s=xt();return et===null?Lu(s,e,t):Rm(s,et.memoizedState,e,t)},useTransition:function(){var e=Du(da)[0],t=xt().memoizedState;return[typeof e=="boolean"?e:ko(e),t]},useSyncExternalStore:lm,useId:Lm,useHostTransitionStatus:zu,useFormState:Sm,useActionState:Sm,useOptimistic:function(e,t){var s=xt();return et!==null?hm(s,et,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:Eu,useCacheRefresh:Im};Pm.useEffectEvent=jm;function Hu(e,t,s,o){t=e.memoizedState,s=s(o,t),s=s==null?t:b({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Pu={enqueueSetState:function(e,t,s){e=e._reactInternals;var o=vn(),d=Va(o);d.payload=t,s!=null&&(d.callback=s),t=Ha(e,d,o),t!==null&&(ln(t,e,o),_o(t,e,o))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var o=vn(),d=Va(o);d.tag=1,d.payload=t,s!=null&&(d.callback=s),t=Ha(e,d,o),t!==null&&(ln(t,e,o),_o(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=vn(),o=Va(s);o.tag=2,t!=null&&(o.callback=t),t=Ha(e,o,s),t!==null&&(ln(t,e,s),_o(t,e,s))}};function Gm(e,t,s,o,d,h,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,h,x):t.prototype&&t.prototype.isPureReactComponent?!fo(s,o)||!fo(d,h):!0}function qm(e,t,s,o){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,o),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,o),t.state!==e&&Pu.enqueueReplaceState(t,t.state,null)}function Cs(e,t){var s=t;if("ref"in t){s={};for(var o in t)o!=="ref"&&(s[o]=t[o])}if(e=e.defaultProps){s===t&&(s=b({},s));for(var d in e)s[d]===void 0&&(s[d]=e[d])}return s}function $m(e){Ll(e)}function Km(e){console.error(e)}function Ym(e){Ll(e)}function ir(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(o){setTimeout(function(){throw o})}}function Fm(e,t,s){try{var o=e.onCaughtError;o(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function Gu(e,t,s){return s=Va(s),s.tag=3,s.payload={element:null},s.callback=function(){ir(e,t)},s}function Zm(e){return e=Va(e),e.tag=3,e}function Xm(e,t,s,o){var d=s.type.getDerivedStateFromError;if(typeof d=="function"){var h=o.value;e.payload=function(){return d(h)},e.callback=function(){Fm(t,s,o)}}var x=s.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){Fm(t,s,o),typeof d!="function"&&(Ya===null?Ya=new Set([this]):Ya.add(this));var j=o.stack;this.componentDidCatch(o.value,{componentStack:j!==null?j:""})})}function D1(e,t,s,o,d){if(s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(t=s.alternate,t!==null&&di(t,s,d,!0),s=fn.current,s!==null){switch(s.tag){case 31:case 13:return En===null?gr():s.alternate===null&&gt===0&&(gt=3),s.flags&=-257,s.flags|=65536,s.lanes=d,o===Kl?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([o]):t.add(o),pd(e,o,d)),!1;case 22:return s.flags|=65536,o===Kl?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([o])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([o]):s.add(o)),pd(e,o,d)),!1}throw Error(l(435,s.tag))}return pd(e,o,d),gr(),!1}if(Ve)return t=fn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=d,o!==ru&&(e=Error(l(422),{cause:o}),mo(jn(e,s)))):(o!==ru&&(t=Error(l(423),{cause:o}),mo(jn(t,s))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,o=jn(o,s),d=Gu(e.stateNode,o,d),bu(e,d),gt!==4&&(gt=2)),!1;var h=Error(l(520),{cause:o});if(h=jn(h,s),Oo===null?Oo=[h]:Oo.push(h),gt!==4&&(gt=2),t===null)return!0;o=jn(o,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=d&-d,s.lanes|=e,e=Gu(s.stateNode,o,e),bu(s,e),!1;case 1:if(t=s.type,h=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Ya===null||!Ya.has(h))))return s.flags|=65536,d&=-d,s.lanes|=d,d=Zm(d),Xm(d,e,s,o),bu(s,d),!1}s=s.return}while(s!==null);return!1}var qu=Error(l(461)),wt=!1;function Pt(e,t,s,o){t.child=e===null?em(t,null,s,o):js(t,e.child,s,o)}function Qm(e,t,s,o,d){s=s.render;var h=t.ref;if("ref"in o){var x={};for(var j in o)j!=="ref"&&(x[j]=o[j])}else x=o;return xs(t),o=ju(e,t,s,x,h,d),j=wu(),e!==null&&!wt?(Cu(e,t,d),fa(e,t,d)):(Ve&&j&&ou(t),t.flags|=1,Pt(e,t,o,d),t.child)}function Wm(e,t,s,o,d){if(e===null){var h=s.type;return typeof h=="function"&&!au(h)&&h.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=h,Jm(e,t,h,o,d)):(e=Vl(s.type,null,o,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!Wu(e,d)){var x=h.memoizedProps;if(s=s.compare,s=s!==null?s:fo,s(x,o)&&e.ref===t.ref)return fa(e,t,d)}return t.flags|=1,e=oa(h,o),e.ref=t.ref,e.return=t,t.child=e}function Jm(e,t,s,o,d){if(e!==null){var h=e.memoizedProps;if(fo(h,o)&&e.ref===t.ref)if(wt=!1,t.pendingProps=o=h,Wu(e,d))(e.flags&131072)!==0&&(wt=!0);else return t.lanes=e.lanes,fa(e,t,d)}return $u(e,t,s,o,d)}function ev(e,t,s,o){var d=o.children,h=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((t.flags&128)!==0){if(h=h!==null?h.baseLanes|s:s,e!==null){for(o=t.child=e.child,d=0;o!==null;)d=d|o.lanes|o.childLanes,o=o.sibling;o=d&~h}else o=0,t.child=null;return tv(e,t,h,s,o)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ql(t,h!==null?h.cachePool:null),h!==null?am(t,h):xu(),sm(t);else return o=t.lanes=536870912,tv(e,t,h!==null?h.baseLanes|s:s,s,o)}else h!==null?(ql(t,h.cachePool),am(t,h),Ga(),t.memoizedState=null):(e!==null&&ql(t,null),xu(),Ga());return Pt(e,t,d,s),t.child}function Co(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function tv(e,t,s,o,d){var h=mu();return h=h===null?null:{parent:kt._currentValue,pool:h},t.memoizedState={baseLanes:s,cachePool:h},e!==null&&ql(t,null),xu(),sm(t),e!==null&&di(e,t,o,!0),t.childLanes=d,null}function or(e,t){return t=rr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function nv(e,t,s){return js(t,e.child,null,s),e=or(t,t.pendingProps),e.flags|=2,hn(t),t.memoizedState=null,e}function R1(e,t,s){var o=t.pendingProps,d=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ve){if(o.mode==="hidden")return e=or(t,o),t.lanes=536870912,Co(null,e);if(Tu(t),(e=it)?(e=pg(e,Nn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ba!==null?{id:Yn,overflow:Fn}:null,retryLane:536870912,hydrationErrors:null},s=Up(e),s.return=t,t.child=s,Vt=t,it=null)):e=null,e===null)throw Ia(t);return t.lanes=536870912,null}return or(t,o)}var h=e.memoizedState;if(h!==null){var x=h.dehydrated;if(Tu(t),d)if(t.flags&256)t.flags&=-257,t=nv(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(l(558));else if(wt||di(e,t,s,!1),d=(s&e.childLanes)!==0,wt||d){if(o=at,o!==null&&(x=Kh(o,s),x!==0&&x!==h.retryLane))throw h.retryLane=x,gs(e,x),ln(o,e,x),qu;gr(),t=nv(e,t,s)}else e=h.treeContext,it=An(x.nextSibling),Vt=t,Ve=!0,La=null,Nn=!1,e!==null&&Pp(t,e),t=or(t,o),t.flags|=4096;return t}return e=oa(e.child,{mode:o.mode,children:o.children}),e.ref=t.ref,t.child=e,e.return=t,e}function lr(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(l(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function $u(e,t,s,o,d){return xs(t),s=ju(e,t,s,o,void 0,d),o=wu(),e!==null&&!wt?(Cu(e,t,d),fa(e,t,d)):(Ve&&o&&ou(t),t.flags|=1,Pt(e,t,s,d),t.child)}function av(e,t,s,o,d,h){return xs(t),t.updateQueue=null,s=om(t,o,s,d),im(e),o=wu(),e!==null&&!wt?(Cu(e,t,h),fa(e,t,h)):(Ve&&o&&ou(t),t.flags|=1,Pt(e,t,s,h),t.child)}function sv(e,t,s,o,d){if(xs(t),t.stateNode===null){var h=li,x=s.contextType;typeof x=="object"&&x!==null&&(h=Ht(x)),h=new s(o,h),t.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Pu,t.stateNode=h,h._reactInternals=t,h=t.stateNode,h.props=o,h.state=t.memoizedState,h.refs={},gu(t),x=s.contextType,h.context=typeof x=="object"&&x!==null?Ht(x):li,h.state=t.memoizedState,x=s.getDerivedStateFromProps,typeof x=="function"&&(Hu(t,s,x,o),h.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(x=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),x!==h.state&&Pu.enqueueReplaceState(h,h.state,null),So(t,o,h,d),xo(),h.state=t.memoizedState),typeof h.componentDidMount=="function"&&(t.flags|=4194308),o=!0}else if(e===null){h=t.stateNode;var j=t.memoizedProps,D=Cs(s,j);h.props=D;var V=h.context,F=s.contextType;x=li,typeof F=="object"&&F!==null&&(x=Ht(F));var X=s.getDerivedStateFromProps;F=typeof X=="function"||typeof h.getSnapshotBeforeUpdate=="function",j=t.pendingProps!==j,F||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(j||V!==x)&&qm(t,h,o,x),Ua=!1;var P=t.memoizedState;h.state=P,So(t,o,h,d),xo(),V=t.memoizedState,j||P!==V||Ua?(typeof X=="function"&&(Hu(t,s,X,o),V=t.memoizedState),(D=Ua||Gm(t,s,D,o,P,V,x))?(F||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=o,t.memoizedState=V),h.props=o,h.state=V,h.context=x,o=D):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{h=t.stateNode,yu(e,t),x=t.memoizedProps,F=Cs(s,x),h.props=F,X=t.pendingProps,P=h.context,V=s.contextType,D=li,typeof V=="object"&&V!==null&&(D=Ht(V)),j=s.getDerivedStateFromProps,(V=typeof j=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(x!==X||P!==D)&&qm(t,h,o,D),Ua=!1,P=t.memoizedState,h.state=P,So(t,o,h,d),xo();var q=t.memoizedState;x!==X||P!==q||Ua||e!==null&&e.dependencies!==null&&Pl(e.dependencies)?(typeof j=="function"&&(Hu(t,s,j,o),q=t.memoizedState),(F=Ua||Gm(t,s,F,o,P,q,D)||e!==null&&e.dependencies!==null&&Pl(e.dependencies))?(V||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(o,q,D),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(o,q,D)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||x===e.memoizedProps&&P===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&P===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=q),h.props=o,h.state=q,h.context=D,o=F):(typeof h.componentDidUpdate!="function"||x===e.memoizedProps&&P===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&P===e.memoizedState||(t.flags|=1024),o=!1)}return h=o,lr(e,t),o=(t.flags&128)!==0,h||o?(h=t.stateNode,s=o&&typeof s.getDerivedStateFromError!="function"?null:h.render(),t.flags|=1,e!==null&&o?(t.child=js(t,e.child,null,d),t.child=js(t,null,s,d)):Pt(e,t,s,d),t.memoizedState=h.state,e=t.child):e=fa(e,t,d),e}function iv(e,t,s,o){return bs(),t.flags|=256,Pt(e,t,s,o),t.child}var Ku={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Yu(e){return{baseLanes:e,cachePool:Fp()}}function Fu(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=mn),e}function ov(e,t,s){var o=t.pendingProps,d=!1,h=(t.flags&128)!==0,x;if((x=h)||(x=e!==null&&e.memoizedState===null?!1:(_t.current&2)!==0),x&&(d=!0,t.flags&=-129),x=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ve){if(d?Pa(t):Ga(),(e=it)?(e=pg(e,Nn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ba!==null?{id:Yn,overflow:Fn}:null,retryLane:536870912,hydrationErrors:null},s=Up(e),s.return=t,t.child=s,Vt=t,it=null)):e=null,e===null)throw Ia(t);return Ad(e)?t.lanes=32:t.lanes=536870912,null}var j=o.children;return o=o.fallback,d?(Ga(),d=t.mode,j=rr({mode:"hidden",children:j},d),o=ys(o,d,s,null),j.return=t,o.return=t,j.sibling=o,t.child=j,o=t.child,o.memoizedState=Yu(s),o.childLanes=Fu(e,x,s),t.memoizedState=Ku,Co(null,o)):(Pa(t),Zu(t,j))}var D=e.memoizedState;if(D!==null&&(j=D.dehydrated,j!==null)){if(h)t.flags&256?(Pa(t),t.flags&=-257,t=Xu(e,t,s)):t.memoizedState!==null?(Ga(),t.child=e.child,t.flags|=128,t=null):(Ga(),j=o.fallback,d=t.mode,o=rr({mode:"visible",children:o.children},d),j=ys(j,d,s,null),j.flags|=2,o.return=t,j.return=t,o.sibling=j,t.child=o,js(t,e.child,null,s),o=t.child,o.memoizedState=Yu(s),o.childLanes=Fu(e,x,s),t.memoizedState=Ku,t=Co(null,o));else if(Pa(t),Ad(j)){if(x=j.nextSibling&&j.nextSibling.dataset,x)var V=x.dgst;x=V,o=Error(l(419)),o.stack="",o.digest=x,mo({value:o,source:null,stack:null}),t=Xu(e,t,s)}else if(wt||di(e,t,s,!1),x=(s&e.childLanes)!==0,wt||x){if(x=at,x!==null&&(o=Kh(x,s),o!==0&&o!==D.retryLane))throw D.retryLane=o,gs(e,o),ln(x,e,o),qu;Ed(j)||gr(),t=Xu(e,t,s)}else Ed(j)?(t.flags|=192,t.child=e.child,t=null):(e=D.treeContext,it=An(j.nextSibling),Vt=t,Ve=!0,La=null,Nn=!1,e!==null&&Pp(t,e),t=Zu(t,o.children),t.flags|=4096);return t}return d?(Ga(),j=o.fallback,d=t.mode,D=e.child,V=D.sibling,o=oa(D,{mode:"hidden",children:o.children}),o.subtreeFlags=D.subtreeFlags&65011712,V!==null?j=oa(V,j):(j=ys(j,d,s,null),j.flags|=2),j.return=t,o.return=t,o.sibling=j,t.child=o,Co(null,o),o=t.child,j=e.child.memoizedState,j===null?j=Yu(s):(d=j.cachePool,d!==null?(D=kt._currentValue,d=d.parent!==D?{parent:D,pool:D}:d):d=Fp(),j={baseLanes:j.baseLanes|s,cachePool:d}),o.memoizedState=j,o.childLanes=Fu(e,x,s),t.memoizedState=Ku,Co(e.child,o)):(Pa(t),s=e.child,e=s.sibling,s=oa(s,{mode:"visible",children:o.children}),s.return=t,s.sibling=null,e!==null&&(x=t.deletions,x===null?(t.deletions=[e],t.flags|=16):x.push(e)),t.child=s,t.memoizedState=null,s)}function Zu(e,t){return t=rr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function rr(e,t){return e=dn(22,e,null,t),e.lanes=0,e}function Xu(e,t,s){return js(t,e.child,null,s),e=Zu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function lv(e,t,s){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),du(e.return,t,s)}function Qu(e,t,s,o,d,h){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:o,tail:s,tailMode:d,treeForkCount:h}:(x.isBackwards=t,x.rendering=null,x.renderingStartTime=0,x.last=o,x.tail=s,x.tailMode=d,x.treeForkCount=h)}function rv(e,t,s){var o=t.pendingProps,d=o.revealOrder,h=o.tail;o=o.children;var x=_t.current,j=(x&2)!==0;if(j?(x=x&1|2,t.flags|=128):x&=1,Se(_t,x),Pt(e,t,o,s),o=Ve?po:0,!j&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&lv(e,s,t);else if(e.tag===19)lv(e,s,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(d){case"forwards":for(s=t.child,d=null;s!==null;)e=s.alternate,e!==null&&Xl(e)===null&&(d=s),s=s.sibling;s=d,s===null?(d=t.child,t.child=null):(d=s.sibling,s.sibling=null),Qu(t,!1,d,s,h,o);break;case"backwards":case"unstable_legacy-backwards":for(s=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&Xl(e)===null){t.child=d;break}e=d.sibling,d.sibling=s,s=d,d=e}Qu(t,!0,s,null,h,o);break;case"together":Qu(t,!1,null,null,void 0,o);break;default:t.memoizedState=null}return t.child}function fa(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),Ka|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(di(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(l(153));if(t.child!==null){for(e=t.child,s=oa(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=oa(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function Wu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Pl(e)))}function M1(e,t,s){switch(t.tag){case 3:Ge(t,t.stateNode.containerInfo),za(t,kt,e.memoizedState.cache),bs();break;case 27:case 5:te(t);break;case 4:Ge(t,t.stateNode.containerInfo);break;case 10:za(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Tu(t),null;break;case 13:var o=t.memoizedState;if(o!==null)return o.dehydrated!==null?(Pa(t),t.flags|=128,null):(s&t.child.childLanes)!==0?ov(e,t,s):(Pa(t),e=fa(e,t,s),e!==null?e.sibling:null);Pa(t);break;case 19:var d=(e.flags&128)!==0;if(o=(s&t.childLanes)!==0,o||(di(e,t,s,!1),o=(s&t.childLanes)!==0),d){if(o)return rv(e,t,s);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),Se(_t,_t.current),o)break;return null;case 22:return t.lanes=0,ev(e,t,s,t.pendingProps);case 24:za(t,kt,e.memoizedState.cache)}return fa(e,t,s)}function cv(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)wt=!0;else{if(!Wu(e,s)&&(t.flags&128)===0)return wt=!1,M1(e,t,s);wt=(e.flags&131072)!==0}else wt=!1,Ve&&(t.flags&1048576)!==0&&Hp(t,po,t.index);switch(t.lanes=0,t.tag){case 16:e:{var o=t.pendingProps;if(e=Ts(t.elementType),t.type=e,typeof e=="function")au(e)?(o=Cs(e,o),t.tag=1,t=sv(null,t,e,o,s)):(t.tag=0,t=$u(null,t,e,o,s));else{if(e!=null){var d=e.$$typeof;if(d===R){t.tag=11,t=Qm(null,t,e,o,s);break e}else if(d===H){t.tag=14,t=Wm(null,t,e,o,s);break e}}throw t=$(e)||e,Error(l(306,t,""))}}return t;case 0:return $u(e,t,t.type,t.pendingProps,s);case 1:return o=t.type,d=Cs(o,t.pendingProps),sv(e,t,o,d,s);case 3:e:{if(Ge(t,t.stateNode.containerInfo),e===null)throw Error(l(387));o=t.pendingProps;var h=t.memoizedState;d=h.element,yu(e,t),So(t,o,null,s);var x=t.memoizedState;if(o=x.cache,za(t,kt,o),o!==h.cache&&fu(t,[kt],s,!0),xo(),o=x.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:x.cache},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){t=iv(e,t,o,s);break e}else if(o!==d){d=jn(Error(l(424)),t),mo(d),t=iv(e,t,o,s);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(it=An(e.firstChild),Vt=t,Ve=!0,La=null,Nn=!0,s=em(t,null,o,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(bs(),o===d){t=fa(e,t,s);break e}Pt(e,t,o,s)}t=t.child}return t;case 26:return lr(e,t),e===null?(s=_g(t.type,null,t.pendingProps,null))?t.memoizedState=s:Ve||(s=t.type,e=t.pendingProps,o=kr(me.current).createElement(s),o[Ut]=t,o[en]=e,Gt(o,s,e),Lt(o),t.stateNode=o):t.memoizedState=_g(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return te(t),e===null&&Ve&&(o=t.stateNode=gg(t.type,t.pendingProps,me.current),Vt=t,Nn=!0,d=it,Qa(t.type)?(Dd=d,it=An(o.firstChild)):it=d),Pt(e,t,t.pendingProps.children,s),lr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ve&&((d=o=it)&&(o=cS(o,t.type,t.pendingProps,Nn),o!==null?(t.stateNode=o,Vt=t,it=An(o.firstChild),Nn=!1,d=!0):d=!1),d||Ia(t)),te(t),d=t.type,h=t.pendingProps,x=e!==null?e.memoizedProps:null,o=h.children,wd(d,h)?o=null:x!==null&&wd(d,x)&&(t.flags|=32),t.memoizedState!==null&&(d=ju(e,t,k1,null,null,s),Po._currentValue=d),lr(e,t),Pt(e,t,o,s),t.child;case 6:return e===null&&Ve&&((e=s=it)&&(s=uS(s,t.pendingProps,Nn),s!==null?(t.stateNode=s,Vt=t,it=null,e=!0):e=!1),e||Ia(t)),null;case 13:return ov(e,t,s);case 4:return Ge(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=js(t,null,o,s):Pt(e,t,o,s),t.child;case 11:return Qm(e,t,t.type,t.pendingProps,s);case 7:return Pt(e,t,t.pendingProps,s),t.child;case 8:return Pt(e,t,t.pendingProps.children,s),t.child;case 12:return Pt(e,t,t.pendingProps.children,s),t.child;case 10:return o=t.pendingProps,za(t,t.type,o.value),Pt(e,t,o.children,s),t.child;case 9:return d=t.type._context,o=t.pendingProps.children,xs(t),d=Ht(d),o=o(d),t.flags|=1,Pt(e,t,o,s),t.child;case 14:return Wm(e,t,t.type,t.pendingProps,s);case 15:return Jm(e,t,t.type,t.pendingProps,s);case 19:return rv(e,t,s);case 31:return R1(e,t,s);case 22:return ev(e,t,s,t.pendingProps);case 24:return xs(t),o=Ht(kt),e===null?(d=mu(),d===null&&(d=at,h=hu(),d.pooledCache=h,h.refCount++,h!==null&&(d.pooledCacheLanes|=s),d=h),t.memoizedState={parent:o,cache:d},gu(t),za(t,kt,d)):((e.lanes&s)!==0&&(yu(e,t),So(t,null,null,s),xo()),d=e.memoizedState,h=t.memoizedState,d.parent!==o?(d={parent:o,cache:o},t.memoizedState=d,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=d),za(t,kt,o)):(o=h.cache,za(t,kt,o),o!==d.cache&&fu(t,[kt],s,!0))),Pt(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function ha(e){e.flags|=4}function Ju(e,t,s,o,d){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(d&335544128)===d)if(e.stateNode.complete)e.flags|=8192;else if(Lv())e.flags|=8192;else throw ks=Kl,vu}else e.flags&=-16777217}function uv(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!jg(t))if(Lv())e.flags|=8192;else throw ks=Kl,vu}function cr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Gh():536870912,e.lanes|=t,Ti|=t)}function No(e,t){if(!Ve)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function ot(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,o=0;if(t)for(var d=e.child;d!==null;)s|=d.lanes|d.childLanes,o|=d.subtreeFlags&65011712,o|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)s|=d.lanes|d.childLanes,o|=d.subtreeFlags,o|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=o,e.childLanes=s,t}function O1(e,t,s){var o=t.pendingProps;switch(lu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ot(t),null;case 1:return ot(t),null;case 3:return s=t.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),ca(kt),Kt(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ui(t)?ha(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,cu())),ot(t),null;case 26:var d=t.type,h=t.memoizedState;return e===null?(ha(t),h!==null?(ot(t),uv(t,h)):(ot(t),Ju(t,d,null,o,s))):h?h!==e.memoizedState?(ha(t),ot(t),uv(t,h)):(ot(t),t.flags&=-16777217):(e=e.memoizedProps,e!==o&&ha(t),ot(t),Ju(t,d,e,o,s)),null;case 27:if(J(t),s=me.current,d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&ha(t);else{if(!o){if(t.stateNode===null)throw Error(l(166));return ot(t),null}e=Oe.current,ui(t)?Gp(t):(e=gg(d,o,s),t.stateNode=e,ha(t))}return ot(t),null;case 5:if(J(t),d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&ha(t);else{if(!o){if(t.stateNode===null)throw Error(l(166));return ot(t),null}if(h=Oe.current,ui(t))Gp(t);else{var x=kr(me.current);switch(h){case 1:h=x.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:h=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":h=x.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":h=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":h=x.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?x.createElement("select",{is:o.is}):x.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?x.createElement(d,{is:o.is}):x.createElement(d)}}h[Ut]=t,h[en]=o;e:for(x=t.child;x!==null;){if(x.tag===5||x.tag===6)h.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===t)break e;for(;x.sibling===null;){if(x.return===null||x.return===t)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}t.stateNode=h;e:switch(Gt(h,d,o),d){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&ha(t)}}return ot(t),Ju(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==o&&ha(t);else{if(typeof o!="string"&&t.stateNode===null)throw Error(l(166));if(e=me.current,ui(t)){if(e=t.stateNode,s=t.memoizedProps,o=null,d=Vt,d!==null)switch(d.tag){case 27:case 5:o=d.memoizedProps}e[Ut]=t,e=!!(e.nodeValue===s||o!==null&&o.suppressHydrationWarning===!0||og(e.nodeValue,s)),e||Ia(t,!0)}else e=kr(e).createTextNode(o),e[Ut]=t,t.stateNode=e}return ot(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(o=ui(t),s!==null){if(e===null){if(!o)throw Error(l(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[Ut]=t}else bs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ot(t),e=!1}else s=cu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(hn(t),t):(hn(t),null);if((t.flags&128)!==0)throw Error(l(558))}return ot(t),null;case 13:if(o=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=ui(t),o!==null&&o.dehydrated!==null){if(e===null){if(!d)throw Error(l(318));if(d=t.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(l(317));d[Ut]=t}else bs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ot(t),d=!1}else d=cu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return t.flags&256?(hn(t),t):(hn(t),null)}return hn(t),(t.flags&128)!==0?(t.lanes=s,t):(s=o!==null,e=e!==null&&e.memoizedState!==null,s&&(o=t.child,d=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(d=o.alternate.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==d&&(o.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),cr(t,t.updateQueue),ot(t),null);case 4:return Kt(),e===null&&xd(t.stateNode.containerInfo),ot(t),null;case 10:return ca(t.type),ot(t),null;case 19:if(we(_t),o=t.memoizedState,o===null)return ot(t),null;if(d=(t.flags&128)!==0,h=o.rendering,h===null)if(d)No(o,!1);else{if(gt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=Xl(e),h!==null){for(t.flags|=128,No(o,!1),e=h.updateQueue,t.updateQueue=e,cr(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)zp(s,e),s=s.sibling;return Se(_t,_t.current&1|2),Ve&&la(t,o.treeForkCount),t.child}e=e.sibling}o.tail!==null&&Yt()>pr&&(t.flags|=128,d=!0,No(o,!1),t.lanes=4194304)}else{if(!d)if(e=Xl(h),e!==null){if(t.flags|=128,d=!0,e=e.updateQueue,t.updateQueue=e,cr(t,e),No(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!Ve)return ot(t),null}else 2*Yt()-o.renderingStartTime>pr&&s!==536870912&&(t.flags|=128,d=!0,No(o,!1),t.lanes=4194304);o.isBackwards?(h.sibling=t.child,t.child=h):(e=o.last,e!==null?e.sibling=h:t.child=h,o.last=h)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Yt(),e.sibling=null,s=_t.current,Se(_t,d?s&1|2:s&1),Ve&&la(t,o.treeForkCount),e):(ot(t),null);case 22:case 23:return hn(t),Su(),o=t.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(t.flags|=8192):o&&(t.flags|=8192),o?(s&536870912)!==0&&(t.flags&128)===0&&(ot(t),t.subtreeFlags&6&&(t.flags|=8192)):ot(t),s=t.updateQueue,s!==null&&cr(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),o=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),o!==s&&(t.flags|=2048),e!==null&&we(Ss),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),ca(kt),ot(t),null;case 25:return null;case 30:return null}throw Error(l(156,t.tag))}function B1(e,t){switch(lu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ca(kt),Kt(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return J(t),null;case 31:if(t.memoizedState!==null){if(hn(t),t.alternate===null)throw Error(l(340));bs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(hn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));bs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return we(_t),null;case 4:return Kt(),null;case 10:return ca(t.type),null;case 22:case 23:return hn(t),Su(),e!==null&&we(Ss),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ca(kt),null;case 25:return null;default:return null}}function dv(e,t){switch(lu(t),t.tag){case 3:ca(kt),Kt();break;case 26:case 27:case 5:J(t);break;case 4:Kt();break;case 31:t.memoizedState!==null&&hn(t);break;case 13:hn(t);break;case 19:we(_t);break;case 10:ca(t.type);break;case 22:case 23:hn(t),Su(),e!==null&&we(Ss);break;case 24:ca(kt)}}function Eo(e,t){try{var s=t.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var d=o.next;s=d;do{if((s.tag&e)===e){o=void 0;var h=s.create,x=s.inst;o=h(),x.destroy=o}s=s.next}while(s!==d)}}catch(j){Je(t,t.return,j)}}function qa(e,t,s){try{var o=t.updateQueue,d=o!==null?o.lastEffect:null;if(d!==null){var h=d.next;o=h;do{if((o.tag&e)===e){var x=o.inst,j=x.destroy;if(j!==void 0){x.destroy=void 0,d=t;var D=s,V=j;try{V()}catch(F){Je(d,D,F)}}}o=o.next}while(o!==h)}}catch(F){Je(t,t.return,F)}}function fv(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{nm(t,s)}catch(o){Je(e,e.return,o)}}}function hv(e,t,s){s.props=Cs(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(o){Je(e,t,o)}}function Ao(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof s=="function"?e.refCleanup=s(o):s.current=o}}catch(d){Je(e,t,d)}}function Zn(e,t){var s=e.ref,o=e.refCleanup;if(s!==null)if(typeof o=="function")try{o()}catch(d){Je(e,t,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(d){Je(e,t,d)}else s.current=null}function pv(e){var t=e.type,s=e.memoizedProps,o=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&o.focus();break e;case"img":s.src?o.src=s.src:s.srcSet&&(o.srcset=s.srcSet)}}catch(d){Je(e,e.return,d)}}function ed(e,t,s){try{var o=e.stateNode;aS(o,e.type,s,t),o[en]=t}catch(d){Je(e,e.return,d)}}function mv(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Qa(e.type)||e.tag===4}function td(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||mv(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&&Qa(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 nd(e,t,s){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(e),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=sa));else if(o!==4&&(o===27&&Qa(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(nd(e,t,s),e=e.sibling;e!==null;)nd(e,t,s),e=e.sibling}function ur(e,t,s){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(o!==4&&(o===27&&Qa(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(ur(e,t,s),e=e.sibling;e!==null;)ur(e,t,s),e=e.sibling}function vv(e){var t=e.stateNode,s=e.memoizedProps;try{for(var o=e.type,d=t.attributes;d.length;)t.removeAttributeNode(d[0]);Gt(t,o,s),t[Ut]=e,t[en]=s}catch(h){Je(e,e.return,h)}}var pa=!1,Ct=!1,ad=!1,gv=typeof WeakSet=="function"?WeakSet:Set,It=null;function L1(e,t){if(e=e.containerInfo,kd=Dr,e=Ep(e),Xc(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var o=s.getSelection&&s.getSelection();if(o&&o.rangeCount!==0){s=o.anchorNode;var d=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{s.nodeType,h.nodeType}catch{s=null;break e}var x=0,j=-1,D=-1,V=0,F=0,X=e,P=null;t:for(;;){for(var q;X!==s||d!==0&&X.nodeType!==3||(j=x+d),X!==h||o!==0&&X.nodeType!==3||(D=x+o),X.nodeType===3&&(x+=X.nodeValue.length),(q=X.firstChild)!==null;)P=X,X=q;for(;;){if(X===e)break t;if(P===s&&++V===d&&(j=x),P===h&&++F===o&&(D=x),(q=X.nextSibling)!==null)break;X=P,P=X.parentNode}X=q}s=j===-1||D===-1?null:{start:j,end:D}}else s=null}s=s||{start:0,end:0}}else s=null;for(jd={focusedElem:e,selectionRange:s},Dr=!1,It=t;It!==null;)if(t=It,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,It=e;else for(;It!==null;){switch(t=It,h=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)d=e[s],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,s=t,d=h.memoizedProps,h=h.memoizedState,o=s.stateNode;try{var he=Cs(s.type,d);e=o.getSnapshotBeforeUpdate(he,h),o.__reactInternalSnapshotBeforeUpdate=e}catch(be){Je(s,s.return,be)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)Nd(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Nd(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(l(163))}if(e=t.sibling,e!==null){e.return=t.return,It=e;break}It=t.return}}function yv(e,t,s){var o=s.flags;switch(s.tag){case 0:case 11:case 15:va(e,s),o&4&&Eo(5,s);break;case 1:if(va(e,s),o&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(x){Je(s,s.return,x)}else{var d=Cs(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(d,t,e.__reactInternalSnapshotBeforeUpdate)}catch(x){Je(s,s.return,x)}}o&64&&fv(s),o&512&&Ao(s,s.return);break;case 3:if(va(e,s),o&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{nm(e,t)}catch(x){Je(s,s.return,x)}}break;case 27:t===null&&o&4&&vv(s);case 26:case 5:va(e,s),t===null&&o&4&&pv(s),o&512&&Ao(s,s.return);break;case 12:va(e,s);break;case 31:va(e,s),o&4&&xv(e,s);break;case 13:va(e,s),o&4&&Sv(e,s),o&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=$1.bind(null,s),dS(e,s))));break;case 22:if(o=s.memoizedState!==null||pa,!o){t=t!==null&&t.memoizedState!==null||Ct,d=pa;var h=Ct;pa=o,(Ct=t)&&!h?ga(e,s,(s.subtreeFlags&8772)!==0):va(e,s),pa=d,Ct=h}break;case 30:break;default:va(e,s)}}function bv(e){var t=e.alternate;t!==null&&(e.alternate=null,bv(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Mc(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var dt=null,nn=!1;function ma(e,t,s){for(s=s.child;s!==null;)_v(e,t,s),s=s.sibling}function _v(e,t,s){if(ye&&typeof ye.onCommitFiberUnmount=="function")try{ye.onCommitFiberUnmount(Fe,s)}catch{}switch(s.tag){case 26:Ct||Zn(s,t),ma(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Ct||Zn(s,t);var o=dt,d=nn;Qa(s.type)&&(dt=s.stateNode,nn=!1),ma(e,t,s),Uo(s.stateNode),dt=o,nn=d;break;case 5:Ct||Zn(s,t);case 6:if(o=dt,d=nn,dt=null,ma(e,t,s),dt=o,nn=d,dt!==null)if(nn)try{(dt.nodeType===9?dt.body:dt.nodeName==="HTML"?dt.ownerDocument.body:dt).removeChild(s.stateNode)}catch(h){Je(s,t,h)}else try{dt.removeChild(s.stateNode)}catch(h){Je(s,t,h)}break;case 18:dt!==null&&(nn?(e=dt,fg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Di(e)):fg(dt,s.stateNode));break;case 4:o=dt,d=nn,dt=s.stateNode.containerInfo,nn=!0,ma(e,t,s),dt=o,nn=d;break;case 0:case 11:case 14:case 15:qa(2,s,t),Ct||qa(4,s,t),ma(e,t,s);break;case 1:Ct||(Zn(s,t),o=s.stateNode,typeof o.componentWillUnmount=="function"&&hv(s,t,o)),ma(e,t,s);break;case 21:ma(e,t,s);break;case 22:Ct=(o=Ct)||s.memoizedState!==null,ma(e,t,s),Ct=o;break;default:ma(e,t,s)}}function xv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Di(e)}catch(s){Je(t,t.return,s)}}}function Sv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Di(e)}catch(s){Je(t,t.return,s)}}function I1(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new gv),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new gv),t;default:throw Error(l(435,e.tag))}}function dr(e,t){var s=I1(e);t.forEach(function(o){if(!s.has(o)){s.add(o);var d=K1.bind(null,e,o);o.then(d,d)}})}function an(e,t){var s=t.deletions;if(s!==null)for(var o=0;o<s.length;o++){var d=s[o],h=e,x=t,j=x;e:for(;j!==null;){switch(j.tag){case 27:if(Qa(j.type)){dt=j.stateNode,nn=!1;break e}break;case 5:dt=j.stateNode,nn=!1;break e;case 3:case 4:dt=j.stateNode.containerInfo,nn=!0;break e}j=j.return}if(dt===null)throw Error(l(160));_v(h,x,d),dt=null,nn=!1,h=d.alternate,h!==null&&(h.return=null),d.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Tv(t,e),t=t.sibling}var Vn=null;function Tv(e,t){var s=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:an(t,e),sn(e),o&4&&(qa(3,e,e.return),Eo(3,e),qa(5,e,e.return));break;case 1:an(t,e),sn(e),o&512&&(Ct||s===null||Zn(s,s.return)),o&64&&pa&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?o:s.concat(o))));break;case 26:var d=Vn;if(an(t,e),sn(e),o&512&&(Ct||s===null||Zn(s,s.return)),o&4){var h=s!==null?s.memoizedState:null;if(o=e.memoizedState,s===null)if(o===null)if(e.stateNode===null){e:{o=e.type,s=e.memoizedProps,d=d.ownerDocument||d;t:switch(o){case"title":h=d.getElementsByTagName("title")[0],(!h||h[no]||h[Ut]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=d.createElement(o),d.head.insertBefore(h,d.querySelector("head > title"))),Gt(h,o,s),h[Ut]=e,Lt(h),o=h;break e;case"link":var x=Tg("link","href",d).get(o+(s.href||""));if(x){for(var j=0;j<x.length;j++)if(h=x[j],h.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&h.getAttribute("rel")===(s.rel==null?null:s.rel)&&h.getAttribute("title")===(s.title==null?null:s.title)&&h.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){x.splice(j,1);break t}}h=d.createElement(o),Gt(h,o,s),d.head.appendChild(h);break;case"meta":if(x=Tg("meta","content",d).get(o+(s.content||""))){for(j=0;j<x.length;j++)if(h=x[j],h.getAttribute("content")===(s.content==null?null:""+s.content)&&h.getAttribute("name")===(s.name==null?null:s.name)&&h.getAttribute("property")===(s.property==null?null:s.property)&&h.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&h.getAttribute("charset")===(s.charSet==null?null:s.charSet)){x.splice(j,1);break t}}h=d.createElement(o),Gt(h,o,s),d.head.appendChild(h);break;default:throw Error(l(468,o))}h[Ut]=e,Lt(h),o=h}e.stateNode=o}else kg(d,e.type,e.stateNode);else e.stateNode=Sg(d,o,e.memoizedProps);else h!==o?(h===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):h.count--,o===null?kg(d,e.type,e.stateNode):Sg(d,o,e.memoizedProps)):o===null&&e.stateNode!==null&&ed(e,e.memoizedProps,s.memoizedProps)}break;case 27:an(t,e),sn(e),o&512&&(Ct||s===null||Zn(s,s.return)),s!==null&&o&4&&ed(e,e.memoizedProps,s.memoizedProps);break;case 5:if(an(t,e),sn(e),o&512&&(Ct||s===null||Zn(s,s.return)),e.flags&32){d=e.stateNode;try{ei(d,"")}catch(he){Je(e,e.return,he)}}o&4&&e.stateNode!=null&&(d=e.memoizedProps,ed(e,d,s!==null?s.memoizedProps:d)),o&1024&&(ad=!0);break;case 6:if(an(t,e),sn(e),o&4){if(e.stateNode===null)throw Error(l(162));o=e.memoizedProps,s=e.stateNode;try{s.nodeValue=o}catch(he){Je(e,e.return,he)}}break;case 3:if(Cr=null,d=Vn,Vn=jr(t.containerInfo),an(t,e),Vn=d,sn(e),o&4&&s!==null&&s.memoizedState.isDehydrated)try{Di(t.containerInfo)}catch(he){Je(e,e.return,he)}ad&&(ad=!1,kv(e));break;case 4:o=Vn,Vn=jr(e.stateNode.containerInfo),an(t,e),sn(e),Vn=o;break;case 12:an(t,e),sn(e);break;case 31:an(t,e),sn(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,dr(e,o)));break;case 13:an(t,e),sn(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(hr=Yt()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,dr(e,o)));break;case 22:d=e.memoizedState!==null;var D=s!==null&&s.memoizedState!==null,V=pa,F=Ct;if(pa=V||d,Ct=F||D,an(t,e),Ct=F,pa=V,sn(e),o&8192)e:for(t=e.stateNode,t._visibility=d?t._visibility&-2:t._visibility|1,d&&(s===null||D||pa||Ct||Ns(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){D=s=t;try{if(h=D.stateNode,d)x=h.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{j=D.stateNode;var X=D.memoizedProps.style,P=X!=null&&X.hasOwnProperty("display")?X.display:null;j.style.display=P==null||typeof P=="boolean"?"":(""+P).trim()}}catch(he){Je(D,D.return,he)}}}else if(t.tag===6){if(s===null){D=t;try{D.stateNode.nodeValue=d?"":D.memoizedProps}catch(he){Je(D,D.return,he)}}}else if(t.tag===18){if(s===null){D=t;try{var q=D.stateNode;d?hg(q,!0):hg(D.stateNode,!1)}catch(he){Je(D,D.return,he)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;s===t&&(s=null),t=t.return}s===t&&(s=null),t.sibling.return=t.return,t=t.sibling}o&4&&(o=e.updateQueue,o!==null&&(s=o.retryQueue,s!==null&&(o.retryQueue=null,dr(e,s))));break;case 19:an(t,e),sn(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,dr(e,o)));break;case 30:break;case 21:break;default:an(t,e),sn(e)}}function sn(e){var t=e.flags;if(t&2){try{for(var s,o=e.return;o!==null;){if(mv(o)){s=o;break}o=o.return}if(s==null)throw Error(l(160));switch(s.tag){case 27:var d=s.stateNode,h=td(e);ur(e,h,d);break;case 5:var x=s.stateNode;s.flags&32&&(ei(x,""),s.flags&=-33);var j=td(e);ur(e,j,x);break;case 3:case 4:var D=s.stateNode.containerInfo,V=td(e);nd(e,V,D);break;default:throw Error(l(161))}}catch(F){Je(e,e.return,F)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function kv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;kv(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function va(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)yv(e,t.alternate,t),t=t.sibling}function Ns(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:qa(4,t,t.return),Ns(t);break;case 1:Zn(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&hv(t,t.return,s),Ns(t);break;case 27:Uo(t.stateNode);case 26:case 5:Zn(t,t.return),Ns(t);break;case 22:t.memoizedState===null&&Ns(t);break;case 30:Ns(t);break;default:Ns(t)}e=e.sibling}}function ga(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var o=t.alternate,d=e,h=t,x=h.flags;switch(h.tag){case 0:case 11:case 15:ga(d,h,s),Eo(4,h);break;case 1:if(ga(d,h,s),o=h,d=o.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(V){Je(o,o.return,V)}if(o=h,d=o.updateQueue,d!==null){var j=o.stateNode;try{var D=d.shared.hiddenCallbacks;if(D!==null)for(d.shared.hiddenCallbacks=null,d=0;d<D.length;d++)tm(D[d],j)}catch(V){Je(o,o.return,V)}}s&&x&64&&fv(h),Ao(h,h.return);break;case 27:vv(h);case 26:case 5:ga(d,h,s),s&&o===null&&x&4&&pv(h),Ao(h,h.return);break;case 12:ga(d,h,s);break;case 31:ga(d,h,s),s&&x&4&&xv(d,h);break;case 13:ga(d,h,s),s&&x&4&&Sv(d,h);break;case 22:h.memoizedState===null&&ga(d,h,s),Ao(h,h.return);break;case 30:break;default:ga(d,h,s)}t=t.sibling}}function sd(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&vo(s))}function id(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&vo(e))}function Hn(e,t,s,o){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)jv(e,t,s,o),t=t.sibling}function jv(e,t,s,o){var d=t.flags;switch(t.tag){case 0:case 11:case 15:Hn(e,t,s,o),d&2048&&Eo(9,t);break;case 1:Hn(e,t,s,o);break;case 3:Hn(e,t,s,o),d&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&vo(e)));break;case 12:if(d&2048){Hn(e,t,s,o),e=t.stateNode;try{var h=t.memoizedProps,x=h.id,j=h.onPostCommit;typeof j=="function"&&j(x,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(D){Je(t,t.return,D)}}else Hn(e,t,s,o);break;case 31:Hn(e,t,s,o);break;case 13:Hn(e,t,s,o);break;case 23:break;case 22:h=t.stateNode,x=t.alternate,t.memoizedState!==null?h._visibility&2?Hn(e,t,s,o):Do(e,t):h._visibility&2?Hn(e,t,s,o):(h._visibility|=2,_i(e,t,s,o,(t.subtreeFlags&10256)!==0||!1)),d&2048&&sd(x,t);break;case 24:Hn(e,t,s,o),d&2048&&id(t.alternate,t);break;default:Hn(e,t,s,o)}}function _i(e,t,s,o,d){for(d=d&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var h=e,x=t,j=s,D=o,V=x.flags;switch(x.tag){case 0:case 11:case 15:_i(h,x,j,D,d),Eo(8,x);break;case 23:break;case 22:var F=x.stateNode;x.memoizedState!==null?F._visibility&2?_i(h,x,j,D,d):Do(h,x):(F._visibility|=2,_i(h,x,j,D,d)),d&&V&2048&&sd(x.alternate,x);break;case 24:_i(h,x,j,D,d),d&&V&2048&&id(x.alternate,x);break;default:_i(h,x,j,D,d)}t=t.sibling}}function Do(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,o=t,d=o.flags;switch(o.tag){case 22:Do(s,o),d&2048&&sd(o.alternate,o);break;case 24:Do(s,o),d&2048&&id(o.alternate,o);break;default:Do(s,o)}t=t.sibling}}var Ro=8192;function xi(e,t,s){if(e.subtreeFlags&Ro)for(e=e.child;e!==null;)wv(e,t,s),e=e.sibling}function wv(e,t,s){switch(e.tag){case 26:xi(e,t,s),e.flags&Ro&&e.memoizedState!==null&&TS(s,Vn,e.memoizedState,e.memoizedProps);break;case 5:xi(e,t,s);break;case 3:case 4:var o=Vn;Vn=jr(e.stateNode.containerInfo),xi(e,t,s),Vn=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=Ro,Ro=16777216,xi(e,t,s),Ro=o):xi(e,t,s));break;default:xi(e,t,s)}}function Cv(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Mo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var o=t[s];It=o,Ev(o,e)}Cv(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Nv(e),e=e.sibling}function Nv(e){switch(e.tag){case 0:case 11:case 15:Mo(e),e.flags&2048&&qa(9,e,e.return);break;case 3:Mo(e);break;case 12:Mo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,fr(e)):Mo(e);break;default:Mo(e)}}function fr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var o=t[s];It=o,Ev(o,e)}Cv(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:qa(8,t,t.return),fr(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,fr(t));break;default:fr(t)}e=e.sibling}}function Ev(e,t){for(;It!==null;){var s=It;switch(s.tag){case 0:case 11:case 15:qa(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var o=s.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:vo(s.memoizedState.cache)}if(o=s.child,o!==null)o.return=s,It=o;else e:for(s=e;It!==null;){o=It;var d=o.sibling,h=o.return;if(bv(o),o===s){It=null;break e}if(d!==null){d.return=h,It=d;break e}It=h}}}var z1={getCacheForType:function(e){var t=Ht(kt),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Ht(kt).controller.signal}},U1=typeof WeakMap=="function"?WeakMap:Map,Ze=0,at=null,Be=null,Ie=0,We=0,pn=null,$a=!1,Si=!1,od=!1,ya=0,gt=0,Ka=0,Es=0,ld=0,mn=0,Ti=0,Oo=null,on=null,rd=!1,hr=0,Av=0,pr=1/0,mr=null,Ya=null,Mt=0,Fa=null,ki=null,ba=0,cd=0,ud=null,Dv=null,Bo=0,dd=null;function vn(){return(Ze&2)!==0&&Ie!==0?Ie&-Ie:O.T!==null?gd():Yh()}function Rv(){if(mn===0)if((Ie&536870912)===0||Ve){var e=ht;ht<<=1,(ht&3932160)===0&&(ht=262144),mn=e}else mn=536870912;return e=fn.current,e!==null&&(e.flags|=32),mn}function ln(e,t,s){(e===at&&(We===2||We===9)||e.cancelPendingCommit!==null)&&(ji(e,0),Za(e,Ie,mn,!1)),to(e,s),((Ze&2)===0||e!==at)&&(e===at&&((Ze&2)===0&&(Es|=s),gt===4&&Za(e,Ie,mn,!1)),Xn(e))}function Mv(e,t,s){if((Ze&6)!==0)throw Error(l(327));var o=!s&&(t&127)===0&&(t&e.expiredLanes)===0||eo(e,t),d=o?P1(e,t):hd(e,t,!0),h=o;do{if(d===0){Si&&!o&&Za(e,t,0,!1);break}else{if(s=e.current.alternate,h&&!V1(s)){d=hd(e,t,!1),h=!1;continue}if(d===2){if(h=t,e.errorRecoveryDisabledLanes&h)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){t=x;e:{var j=e;d=Oo;var D=j.current.memoizedState.isDehydrated;if(D&&(ji(j,x).flags|=256),x=hd(j,x,!1),x!==2){if(od&&!D){j.errorRecoveryDisabledLanes|=h,Es|=h,d=4;break e}h=on,on=d,h!==null&&(on===null?on=h:on.push.apply(on,h))}d=x}if(h=!1,d!==2)continue}}if(d===1){ji(e,0),Za(e,t,0,!0);break}e:{switch(o=e,h=d,h){case 0:case 1:throw Error(l(345));case 4:if((t&4194048)!==t)break;case 6:Za(o,t,mn,!$a);break e;case 2:on=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(d=hr+300-Yt(),10<d)){if(Za(o,t,mn,!$a),Ra(o,0,!0)!==0)break e;ba=t,o.timeoutHandle=ug(Ov.bind(null,o,s,on,mr,rd,t,mn,Es,Ti,$a,h,"Throttled",-0,0),d);break e}Ov(o,s,on,mr,rd,t,mn,Es,Ti,$a,h,null,-0,0)}}break}while(!0);Xn(e)}function Ov(e,t,s,o,d,h,x,j,D,V,F,X,P,q){if(e.timeoutHandle=-1,X=t.subtreeFlags,X&8192||(X&16785408)===16785408){X={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:sa},wv(t,h,X);var he=(h&62914560)===h?hr-Yt():(h&4194048)===h?Av-Yt():0;if(he=kS(X,he),he!==null){ba=h,e.cancelPendingCommit=he(Pv.bind(null,e,t,h,s,o,d,x,j,D,F,X,null,P,q)),Za(e,h,x,!V);return}}Pv(e,t,h,s,o,d,x,j,D)}function V1(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var o=0;o<s.length;o++){var d=s[o],h=d.getSnapshot;d=d.value;try{if(!un(h(),d))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Za(e,t,s,o){t&=~ld,t&=~Es,e.suspendedLanes|=t,e.pingedLanes&=~t,o&&(e.warmLanes|=t),o=e.expirationTimes;for(var d=t;0<d;){var h=31-Me(d),x=1<<h;o[h]=-1,d&=~x}s!==0&&qh(e,s,t)}function vr(){return(Ze&6)===0?(Lo(0),!1):!0}function fd(){if(Be!==null){if(We===0)var e=Be.return;else e=Be,ra=_s=null,Nu(e),mi=null,yo=0,e=Be;for(;e!==null;)dv(e.alternate,e),e=e.return;Be=null}}function ji(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,oS(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),ba=0,fd(),at=e,Be=s=oa(e.current,null),Ie=t,We=0,pn=null,$a=!1,Si=eo(e,t),od=!1,Ti=mn=ld=Es=Ka=gt=0,on=Oo=null,rd=!1,(t&8)!==0&&(t|=t&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=t;0<o;){var d=31-Me(o),h=1<<d;t|=e[d],o&=~h}return ya=t,Il(),s}function Bv(e,t){Ne=null,O.H=wo,t===pi||t===$l?(t=Qp(),We=3):t===vu?(t=Qp(),We=4):We=t===qu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,pn=t,Be===null&&(gt=1,ir(e,jn(t,e.current)))}function Lv(){var e=fn.current;return e===null?!0:(Ie&4194048)===Ie?En===null:(Ie&62914560)===Ie||(Ie&536870912)!==0?e===En:!1}function Iv(){var e=O.H;return O.H=wo,e===null?wo:e}function zv(){var e=O.A;return O.A=z1,e}function gr(){gt=4,$a||(Ie&4194048)!==Ie&&fn.current!==null||(Si=!0),(Ka&134217727)===0&&(Es&134217727)===0||at===null||Za(at,Ie,mn,!1)}function hd(e,t,s){var o=Ze;Ze|=2;var d=Iv(),h=zv();(at!==e||Ie!==t)&&(mr=null,ji(e,t)),t=!1;var x=gt;e:do try{if(We!==0&&Be!==null){var j=Be,D=pn;switch(We){case 8:fd(),x=6;break e;case 3:case 2:case 9:case 6:fn.current===null&&(t=!0);var V=We;if(We=0,pn=null,wi(e,j,D,V),s&&Si){x=0;break e}break;default:V=We,We=0,pn=null,wi(e,j,D,V)}}H1(),x=gt;break}catch(F){Bv(e,F)}while(!0);return t&&e.shellSuspendCounter++,ra=_s=null,Ze=o,O.H=d,O.A=h,Be===null&&(at=null,Ie=0,Il()),x}function H1(){for(;Be!==null;)Uv(Be)}function P1(e,t){var s=Ze;Ze|=2;var o=Iv(),d=zv();at!==e||Ie!==t?(mr=null,pr=Yt()+500,ji(e,t)):Si=eo(e,t);e:do try{if(We!==0&&Be!==null){t=Be;var h=pn;t:switch(We){case 1:We=0,pn=null,wi(e,t,h,1);break;case 2:case 9:if(Zp(h)){We=0,pn=null,Vv(t);break}t=function(){We!==2&&We!==9||at!==e||(We=7),Xn(e)},h.then(t,t);break e;case 3:We=7;break e;case 4:We=5;break e;case 7:Zp(h)?(We=0,pn=null,Vv(t)):(We=0,pn=null,wi(e,t,h,7));break;case 5:var x=null;switch(Be.tag){case 26:x=Be.memoizedState;case 5:case 27:var j=Be;if(x?jg(x):j.stateNode.complete){We=0,pn=null;var D=j.sibling;if(D!==null)Be=D;else{var V=j.return;V!==null?(Be=V,yr(V)):Be=null}break t}}We=0,pn=null,wi(e,t,h,5);break;case 6:We=0,pn=null,wi(e,t,h,6);break;case 8:fd(),gt=6;break e;default:throw Error(l(462))}}G1();break}catch(F){Bv(e,F)}while(!0);return ra=_s=null,O.H=o,O.A=d,Ze=s,Be!==null?0:(at=null,Ie=0,Il(),gt)}function G1(){for(;Be!==null&&!Ee();)Uv(Be)}function Uv(e){var t=cv(e.alternate,e,ya);e.memoizedProps=e.pendingProps,t===null?yr(e):Be=t}function Vv(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=av(s,t,t.pendingProps,t.type,void 0,Ie);break;case 11:t=av(s,t,t.pendingProps,t.type.render,t.ref,Ie);break;case 5:Nu(t);default:dv(s,t),t=Be=zp(t,ya),t=cv(s,t,ya)}e.memoizedProps=e.pendingProps,t===null?yr(e):Be=t}function wi(e,t,s,o){ra=_s=null,Nu(t),mi=null,yo=0;var d=t.return;try{if(D1(e,d,t,s,Ie)){gt=1,ir(e,jn(s,e.current)),Be=null;return}}catch(h){if(d!==null)throw Be=d,h;gt=1,ir(e,jn(s,e.current)),Be=null;return}t.flags&32768?(Ve||o===1?e=!0:Si||(Ie&536870912)!==0?e=!1:($a=e=!0,(o===2||o===9||o===3||o===6)&&(o=fn.current,o!==null&&o.tag===13&&(o.flags|=16384))),Hv(t,e)):yr(t)}function yr(e){var t=e;do{if((t.flags&32768)!==0){Hv(t,$a);return}e=t.return;var s=O1(t.alternate,t,ya);if(s!==null){Be=s;return}if(t=t.sibling,t!==null){Be=t;return}Be=t=e}while(t!==null);gt===0&&(gt=5)}function Hv(e,t){do{var s=B1(e.alternate,e);if(s!==null){s.flags&=32767,Be=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){Be=e;return}Be=e=s}while(e!==null);gt=6,Be=null}function Pv(e,t,s,o,d,h,x,j,D){e.cancelPendingCommit=null;do br();while(Mt!==0);if((Ze&6)!==0)throw Error(l(327));if(t!==null){if(t===e.current)throw Error(l(177));if(h=t.lanes|t.childLanes,h|=tu,Sx(e,s,h,x,j,D),e===at&&(Be=at=null,Ie=0),ki=t,Fa=e,ba=s,cd=h,ud=d,Dv=o,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Y1(Y,function(){return Yv(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||o){o=O.T,O.T=null,d=G.p,G.p=2,x=Ze,Ze|=4;try{L1(e,t,s)}finally{Ze=x,G.p=d,O.T=o}}Mt=1,Gv(),qv(),$v()}}function Gv(){if(Mt===1){Mt=0;var e=Fa,t=ki,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=O.T,O.T=null;var o=G.p;G.p=2;var d=Ze;Ze|=4;try{Tv(t,e);var h=jd,x=Ep(e.containerInfo),j=h.focusedElem,D=h.selectionRange;if(x!==j&&j&&j.ownerDocument&&Np(j.ownerDocument.documentElement,j)){if(D!==null&&Xc(j)){var V=D.start,F=D.end;if(F===void 0&&(F=V),"selectionStart"in j)j.selectionStart=V,j.selectionEnd=Math.min(F,j.value.length);else{var X=j.ownerDocument||document,P=X&&X.defaultView||window;if(P.getSelection){var q=P.getSelection(),he=j.textContent.length,be=Math.min(D.start,he),nt=D.end===void 0?be:Math.min(D.end,he);!q.extend&&be>nt&&(x=nt,nt=be,be=x);var L=Cp(j,be),M=Cp(j,nt);if(L&&M&&(q.rangeCount!==1||q.anchorNode!==L.node||q.anchorOffset!==L.offset||q.focusNode!==M.node||q.focusOffset!==M.offset)){var U=X.createRange();U.setStart(L.node,L.offset),q.removeAllRanges(),be>nt?(q.addRange(U),q.extend(M.node,M.offset)):(U.setEnd(M.node,M.offset),q.addRange(U))}}}}for(X=[],q=j;q=q.parentNode;)q.nodeType===1&&X.push({element:q,left:q.scrollLeft,top:q.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<X.length;j++){var Z=X[j];Z.element.scrollLeft=Z.left,Z.element.scrollTop=Z.top}}Dr=!!kd,jd=kd=null}finally{Ze=d,G.p=o,O.T=s}}e.current=t,Mt=2}}function qv(){if(Mt===2){Mt=0;var e=Fa,t=ki,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=O.T,O.T=null;var o=G.p;G.p=2;var d=Ze;Ze|=4;try{yv(e,t.alternate,t)}finally{Ze=d,G.p=o,O.T=s}}Mt=3}}function $v(){if(Mt===4||Mt===3){Mt=0,At();var e=Fa,t=ki,s=ba,o=Dv;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Mt=5:(Mt=0,ki=Fa=null,Kv(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(Ya=null),Dc(s),t=t.stateNode,ye&&typeof ye.onCommitFiberRoot=="function")try{ye.onCommitFiberRoot(Fe,t,void 0,(t.current.flags&128)===128)}catch{}if(o!==null){t=O.T,d=G.p,G.p=2,O.T=null;try{for(var h=e.onRecoverableError,x=0;x<o.length;x++){var j=o[x];h(j.value,{componentStack:j.stack})}}finally{O.T=t,G.p=d}}(ba&3)!==0&&br(),Xn(e),d=e.pendingLanes,(s&261930)!==0&&(d&42)!==0?e===dd?Bo++:(Bo=0,dd=e):Bo=0,Lo(0)}}function Kv(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,vo(t)))}function br(){return Gv(),qv(),$v(),Yv()}function Yv(){if(Mt!==5)return!1;var e=Fa,t=cd;cd=0;var s=Dc(ba),o=O.T,d=G.p;try{G.p=32>s?32:s,O.T=null,s=ud,ud=null;var h=Fa,x=ba;if(Mt=0,ki=Fa=null,ba=0,(Ze&6)!==0)throw Error(l(331));var j=Ze;if(Ze|=4,Nv(h.current),jv(h,h.current,x,s),Ze=j,Lo(0,!1),ye&&typeof ye.onPostCommitFiberRoot=="function")try{ye.onPostCommitFiberRoot(Fe,h)}catch{}return!0}finally{G.p=d,O.T=o,Kv(e,t)}}function Fv(e,t,s){t=jn(s,t),t=Gu(e.stateNode,t,2),e=Ha(e,t,2),e!==null&&(to(e,2),Xn(e))}function Je(e,t,s){if(e.tag===3)Fv(e,e,s);else for(;t!==null;){if(t.tag===3){Fv(t,e,s);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Ya===null||!Ya.has(o))){e=jn(s,e),s=Zm(2),o=Ha(t,s,2),o!==null&&(Xm(s,o,t,e),to(o,2),Xn(o));break}}t=t.return}}function pd(e,t,s){var o=e.pingCache;if(o===null){o=e.pingCache=new U1;var d=new Set;o.set(t,d)}else d=o.get(t),d===void 0&&(d=new Set,o.set(t,d));d.has(s)||(od=!0,d.add(s),e=q1.bind(null,e,t,s),t.then(e,e))}function q1(e,t,s){var o=e.pingCache;o!==null&&o.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,at===e&&(Ie&s)===s&&(gt===4||gt===3&&(Ie&62914560)===Ie&&300>Yt()-hr?(Ze&2)===0&&ji(e,0):ld|=s,Ti===Ie&&(Ti=0)),Xn(e)}function Zv(e,t){t===0&&(t=Gh()),e=gs(e,t),e!==null&&(to(e,t),Xn(e))}function $1(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Zv(e,s)}function K1(e,t){var s=0;switch(e.tag){case 31:case 13:var o=e.stateNode,d=e.memoizedState;d!==null&&(s=d.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(l(314))}o!==null&&o.delete(t),Zv(e,s)}function Y1(e,t){return Da(e,t)}var _r=null,Ci=null,md=!1,xr=!1,vd=!1,Xa=0;function Xn(e){e!==Ci&&e.next===null&&(Ci===null?_r=Ci=e:Ci=Ci.next=e),xr=!0,md||(md=!0,Z1())}function Lo(e,t){if(!vd&&xr){vd=!0;do for(var s=!1,o=_r;o!==null;){if(e!==0){var d=o.pendingLanes;if(d===0)var h=0;else{var x=o.suspendedLanes,j=o.pingedLanes;h=(1<<31-Me(42|e)+1)-1,h&=d&~(x&~j),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(s=!0,Jv(o,h))}else h=Ie,h=Ra(o,o===at?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||eo(o,h)||(s=!0,Jv(o,h));o=o.next}while(s);vd=!1}}function F1(){Xv()}function Xv(){xr=md=!1;var e=0;Xa!==0&&iS()&&(e=Xa);for(var t=Yt(),s=null,o=_r;o!==null;){var d=o.next,h=Qv(o,t);h===0?(o.next=null,s===null?_r=d:s.next=d,d===null&&(Ci=s)):(s=o,(e!==0||(h&3)!==0)&&(xr=!0)),o=d}Mt!==0&&Mt!==5||Lo(e),Xa!==0&&(Xa=0)}function Qv(e,t){for(var s=e.suspendedLanes,o=e.pingedLanes,d=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var x=31-Me(h),j=1<<x,D=d[x];D===-1?((j&s)===0||(j&o)!==0)&&(d[x]=xx(j,t)):D<=t&&(e.expiredLanes|=j),h&=~j}if(t=at,s=Ie,s=Ra(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,s===0||e===t&&(We===2||We===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&cn(o),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||eo(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(o!==null&&cn(o),Dc(s)){case 2:case 8:s=jl;break;case 32:s=Y;break;case 268435456:s=ue;break;default:s=Y}return o=Wv.bind(null,e),s=Da(s,o),e.callbackPriority=t,e.callbackNode=s,t}return o!==null&&o!==null&&cn(o),e.callbackPriority=2,e.callbackNode=null,2}function Wv(e,t){if(Mt!==0&&Mt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(br()&&e.callbackNode!==s)return null;var o=Ie;return o=Ra(e,e===at?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(Mv(e,o,t),Qv(e,Yt()),e.callbackNode!=null&&e.callbackNode===s?Wv.bind(null,e):null)}function Jv(e,t){if(br())return null;Mv(e,t,!0)}function Z1(){lS(function(){(Ze&6)!==0?Da(Ji,F1):Xv()})}function gd(){if(Xa===0){var e=fi;e===0&&(e=Rt,Rt<<=1,(Rt&261888)===0&&(Rt=256)),Xa=e}return Xa}function eg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:El(""+e)}function tg(e,t){var s=t.ownerDocument.createElement("input");return s.name=t.name,s.value=t.value,e.id&&s.setAttribute("form",e.id),t.parentNode.insertBefore(s,t),e=new FormData(e),s.parentNode.removeChild(s),e}function X1(e,t,s,o,d){if(t==="submit"&&s&&s.stateNode===d){var h=eg((d[en]||null).action),x=o.submitter;x&&(t=(t=x[en]||null)?eg(t.formAction):x.getAttribute("formAction"),t!==null&&(h=t,x=null));var j=new Ml("action","action",null,o,d);e.push({event:j,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(Xa!==0){var D=x?tg(d,x):new FormData(d);Iu(s,{pending:!0,data:D,method:d.method,action:h},null,D)}}else typeof h=="function"&&(j.preventDefault(),D=x?tg(d,x):new FormData(d),Iu(s,{pending:!0,data:D,method:d.method,action:h},h,D))},currentTarget:d}]})}}for(var yd=0;yd<eu.length;yd++){var bd=eu[yd],Q1=bd.toLowerCase(),W1=bd[0].toUpperCase()+bd.slice(1);Un(Q1,"on"+W1)}Un(Rp,"onAnimationEnd"),Un(Mp,"onAnimationIteration"),Un(Op,"onAnimationStart"),Un("dblclick","onDoubleClick"),Un("focusin","onFocus"),Un("focusout","onBlur"),Un(p1,"onTransitionRun"),Un(m1,"onTransitionStart"),Un(v1,"onTransitionCancel"),Un(Bp,"onTransitionEnd"),Ws("onMouseEnter",["mouseout","mouseover"]),Ws("onMouseLeave",["mouseout","mouseover"]),Ws("onPointerEnter",["pointerout","pointerover"]),Ws("onPointerLeave",["pointerout","pointerover"]),hs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),hs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),hs("onBeforeInput",["compositionend","keypress","textInput","paste"]),hs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),hs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),hs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Io="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(" "),J1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Io));function ng(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var o=e[s],d=o.event;o=o.listeners;e:{var h=void 0;if(t)for(var x=o.length-1;0<=x;x--){var j=o[x],D=j.instance,V=j.currentTarget;if(j=j.listener,D!==h&&d.isPropagationStopped())break e;h=j,d.currentTarget=V;try{h(d)}catch(F){Ll(F)}d.currentTarget=null,h=D}else for(x=0;x<o.length;x++){if(j=o[x],D=j.instance,V=j.currentTarget,j=j.listener,D!==h&&d.isPropagationStopped())break e;h=j,d.currentTarget=V;try{h(d)}catch(F){Ll(F)}d.currentTarget=null,h=D}}}}function Le(e,t){var s=t[Rc];s===void 0&&(s=t[Rc]=new Set);var o=e+"__bubble";s.has(o)||(ag(t,e,2,!1),s.add(o))}function _d(e,t,s){var o=0;t&&(o|=4),ag(s,e,o,t)}var Sr="_reactListening"+Math.random().toString(36).slice(2);function xd(e){if(!e[Sr]){e[Sr]=!0,Xh.forEach(function(s){s!=="selectionchange"&&(J1.has(s)||_d(s,!1,e),_d(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Sr]||(t[Sr]=!0,_d("selectionchange",!1,t))}}function ag(e,t,s,o){switch(Rg(t)){case 2:var d=CS;break;case 8:d=NS;break;default:d=Ld}s=d.bind(null,t,s,e),d=void 0,!Hc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(d=!0),o?d!==void 0?e.addEventListener(t,s,{capture:!0,passive:d}):e.addEventListener(t,s,!0):d!==void 0?e.addEventListener(t,s,{passive:d}):e.addEventListener(t,s,!1)}function Sd(e,t,s,o,d){var h=o;if((t&1)===0&&(t&2)===0&&o!==null)e:for(;;){if(o===null)return;var x=o.tag;if(x===3||x===4){var j=o.stateNode.containerInfo;if(j===d)break;if(x===4)for(x=o.return;x!==null;){var D=x.tag;if((D===3||D===4)&&x.stateNode.containerInfo===d)return;x=x.return}for(;j!==null;){if(x=Zs(j),x===null)return;if(D=x.tag,D===5||D===6||D===26||D===27){o=h=x;continue e}j=j.parentNode}}o=o.return}rp(function(){var V=h,F=Uc(s),X=[];e:{var P=Lp.get(e);if(P!==void 0){var q=Ml,he=e;switch(e){case"keypress":if(Dl(s)===0)break e;case"keydown":case"keyup":q=Kx;break;case"focusin":he="focus",q=$c;break;case"focusout":he="blur",q=$c;break;case"beforeblur":case"afterblur":q=$c;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":q=dp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":q=Ox;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":q=Zx;break;case Rp:case Mp:case Op:q=Ix;break;case Bp:q=Qx;break;case"scroll":case"scrollend":q=Rx;break;case"wheel":q=Jx;break;case"copy":case"cut":case"paste":q=Ux;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":q=hp;break;case"toggle":case"beforetoggle":q=t1}var be=(t&4)!==0,nt=!be&&(e==="scroll"||e==="scrollend"),L=be?P!==null?P+"Capture":null:P;be=[];for(var M=V,U;M!==null;){var Z=M;if(U=Z.stateNode,Z=Z.tag,Z!==5&&Z!==26&&Z!==27||U===null||L===null||(Z=so(M,L),Z!=null&&be.push(zo(M,Z,U))),nt)break;M=M.return}0<be.length&&(P=new q(P,he,null,s,F),X.push({event:P,listeners:be}))}}if((t&7)===0){e:{if(P=e==="mouseover"||e==="pointerover",q=e==="mouseout"||e==="pointerout",P&&s!==zc&&(he=s.relatedTarget||s.fromElement)&&(Zs(he)||he[Fs]))break e;if((q||P)&&(P=F.window===F?F:(P=F.ownerDocument)?P.defaultView||P.parentWindow:window,q?(he=s.relatedTarget||s.toElement,q=V,he=he?Zs(he):null,he!==null&&(nt=u(he),be=he.tag,he!==nt||be!==5&&be!==27&&be!==6)&&(he=null)):(q=null,he=V),q!==he)){if(be=dp,Z="onMouseLeave",L="onMouseEnter",M="mouse",(e==="pointerout"||e==="pointerover")&&(be=hp,Z="onPointerLeave",L="onPointerEnter",M="pointer"),nt=q==null?P:ao(q),U=he==null?P:ao(he),P=new be(Z,M+"leave",q,s,F),P.target=nt,P.relatedTarget=U,Z=null,Zs(F)===V&&(be=new be(L,M+"enter",he,s,F),be.target=U,be.relatedTarget=nt,Z=be),nt=Z,q&&he)t:{for(be=eS,L=q,M=he,U=0,Z=L;Z;Z=be(Z))U++;Z=0;for(var ve=M;ve;ve=be(ve))Z++;for(;0<U-Z;)L=be(L),U--;for(;0<Z-U;)M=be(M),Z--;for(;U--;){if(L===M||M!==null&&L===M.alternate){be=L;break t}L=be(L),M=be(M)}be=null}else be=null;q!==null&&sg(X,P,q,be,!1),he!==null&&nt!==null&&sg(X,nt,he,be,!0)}}e:{if(P=V?ao(V):window,q=P.nodeName&&P.nodeName.toLowerCase(),q==="select"||q==="input"&&P.type==="file")var $e=xp;else if(bp(P))if(Sp)$e=d1;else{$e=c1;var pe=r1}else q=P.nodeName,!q||q.toLowerCase()!=="input"||P.type!=="checkbox"&&P.type!=="radio"?V&&Ic(V.elementType)&&($e=xp):$e=u1;if($e&&($e=$e(e,V))){_p(X,$e,s,F);break e}pe&&pe(e,P,V),e==="focusout"&&V&&P.type==="number"&&V.memoizedProps.value!=null&&Lc(P,"number",P.value)}switch(pe=V?ao(V):window,e){case"focusin":(bp(pe)||pe.contentEditable==="true")&&(si=pe,Qc=V,ho=null);break;case"focusout":ho=Qc=si=null;break;case"mousedown":Wc=!0;break;case"contextmenu":case"mouseup":case"dragend":Wc=!1,Ap(X,s,F);break;case"selectionchange":if(h1)break;case"keydown":case"keyup":Ap(X,s,F)}var Ae;if(Yc)e:{switch(e){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else ai?gp(e,s)&&(ze="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(ze="onCompositionStart");ze&&(pp&&s.locale!=="ko"&&(ai||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&ai&&(Ae=cp()):(Oa=F,Pc="value"in Oa?Oa.value:Oa.textContent,ai=!0)),pe=Tr(V,ze),0<pe.length&&(ze=new fp(ze,e,null,s,F),X.push({event:ze,listeners:pe}),Ae?ze.data=Ae:(Ae=yp(s),Ae!==null&&(ze.data=Ae)))),(Ae=a1?s1(e,s):i1(e,s))&&(ze=Tr(V,"onBeforeInput"),0<ze.length&&(pe=new fp("onBeforeInput","beforeinput",null,s,F),X.push({event:pe,listeners:ze}),pe.data=Ae)),X1(X,e,V,s,F)}ng(X,t)})}function zo(e,t,s){return{instance:e,listener:t,currentTarget:s}}function Tr(e,t){for(var s=t+"Capture",o=[];e!==null;){var d=e,h=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||h===null||(d=so(e,s),d!=null&&o.unshift(zo(e,d,h)),d=so(e,t),d!=null&&o.push(zo(e,d,h))),e.tag===3)return o;e=e.return}return[]}function eS(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function sg(e,t,s,o,d){for(var h=t._reactName,x=[];s!==null&&s!==o;){var j=s,D=j.alternate,V=j.stateNode;if(j=j.tag,D!==null&&D===o)break;j!==5&&j!==26&&j!==27||V===null||(D=V,d?(V=so(s,h),V!=null&&x.unshift(zo(s,V,D))):d||(V=so(s,h),V!=null&&x.push(zo(s,V,D)))),s=s.return}x.length!==0&&e.push({event:t,listeners:x})}var tS=/\r\n?/g,nS=/\u0000|\uFFFD/g;function ig(e){return(typeof e=="string"?e:""+e).replace(tS,`
26
+ `).replace(nS,"")}function og(e,t){return t=ig(t),ig(e)===t}function tt(e,t,s,o,d,h){switch(s){case"children":typeof o=="string"?t==="body"||t==="textarea"&&o===""||ei(e,o):(typeof o=="number"||typeof o=="bigint")&&t!=="body"&&ei(e,""+o);break;case"className":Cl(e,"class",o);break;case"tabIndex":Cl(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Cl(e,s,o);break;case"style":op(e,o,h);break;case"data":if(t!=="object"){Cl(e,"data",o);break}case"src":case"href":if(o===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(s);break}o=El(""+o),e.setAttribute(s,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(s==="formAction"?(t!=="input"&&tt(e,t,"name",d.name,d,null),tt(e,t,"formEncType",d.formEncType,d,null),tt(e,t,"formMethod",d.formMethod,d,null),tt(e,t,"formTarget",d.formTarget,d,null)):(tt(e,t,"encType",d.encType,d,null),tt(e,t,"method",d.method,d,null),tt(e,t,"target",d.target,d,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(s);break}o=El(""+o),e.setAttribute(s,o);break;case"onClick":o!=null&&(e.onclick=sa);break;case"onScroll":o!=null&&Le("scroll",e);break;case"onScrollEnd":o!=null&&Le("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(l(61));if(s=o.__html,s!=null){if(d.children!=null)throw Error(l(60));e.innerHTML=s}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}s=El(""+o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,""+o):e.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":o===!0?e.setAttribute(s,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,o):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(s,o):e.removeAttribute(s);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(s):e.setAttribute(s,o);break;case"popover":Le("beforetoggle",e),Le("toggle",e),wl(e,"popover",o);break;case"xlinkActuate":aa(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":aa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":aa(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":aa(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":aa(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":aa(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":aa(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":aa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":aa(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":wl(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=Ax.get(s)||s,wl(e,s,o))}}function Td(e,t,s,o,d,h){switch(s){case"style":op(e,o,h);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(l(61));if(s=o.__html,s!=null){if(d.children!=null)throw Error(l(60));e.innerHTML=s}}break;case"children":typeof o=="string"?ei(e,o):(typeof o=="number"||typeof o=="bigint")&&ei(e,""+o);break;case"onScroll":o!=null&&Le("scroll",e);break;case"onScrollEnd":o!=null&&Le("scrollend",e);break;case"onClick":o!=null&&(e.onclick=sa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Qh.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(d=s.endsWith("Capture"),t=s.slice(2,d?s.length-7:void 0),h=e[en]||null,h=h!=null?h[s]:null,typeof h=="function"&&e.removeEventListener(t,h,d),typeof o=="function")){typeof h!="function"&&h!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,o,d);break e}s in e?e[s]=o:o===!0?e.setAttribute(s,""):wl(e,s,o)}}}function Gt(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Le("error",e),Le("load",e);var o=!1,d=!1,h;for(h in s)if(s.hasOwnProperty(h)){var x=s[h];if(x!=null)switch(h){case"src":o=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:tt(e,t,h,x,s,null)}}d&&tt(e,t,"srcSet",s.srcSet,s,null),o&&tt(e,t,"src",s.src,s,null);return;case"input":Le("invalid",e);var j=h=x=d=null,D=null,V=null;for(o in s)if(s.hasOwnProperty(o)){var F=s[o];if(F!=null)switch(o){case"name":d=F;break;case"type":x=F;break;case"checked":D=F;break;case"defaultChecked":V=F;break;case"value":h=F;break;case"defaultValue":j=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(l(137,t));break;default:tt(e,t,o,F,s,null)}}np(e,h,j,D,V,x,d,!1);return;case"select":Le("invalid",e),o=x=h=null;for(d in s)if(s.hasOwnProperty(d)&&(j=s[d],j!=null))switch(d){case"value":h=j;break;case"defaultValue":x=j;break;case"multiple":o=j;default:tt(e,t,d,j,s,null)}t=h,s=x,e.multiple=!!o,t!=null?Js(e,!!o,t,!1):s!=null&&Js(e,!!o,s,!0);return;case"textarea":Le("invalid",e),h=d=o=null;for(x in s)if(s.hasOwnProperty(x)&&(j=s[x],j!=null))switch(x){case"value":o=j;break;case"defaultValue":d=j;break;case"children":h=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(l(91));break;default:tt(e,t,x,j,s,null)}sp(e,o,d,h);return;case"option":for(D in s)if(s.hasOwnProperty(D)&&(o=s[D],o!=null))switch(D){case"selected":e.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:tt(e,t,D,o,s,null)}return;case"dialog":Le("beforetoggle",e),Le("toggle",e),Le("cancel",e),Le("close",e);break;case"iframe":case"object":Le("load",e);break;case"video":case"audio":for(o=0;o<Io.length;o++)Le(Io[o],e);break;case"image":Le("error",e),Le("load",e);break;case"details":Le("toggle",e);break;case"embed":case"source":case"link":Le("error",e),Le("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(V in s)if(s.hasOwnProperty(V)&&(o=s[V],o!=null))switch(V){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:tt(e,t,V,o,s,null)}return;default:if(Ic(t)){for(F in s)s.hasOwnProperty(F)&&(o=s[F],o!==void 0&&Td(e,t,F,o,s,void 0));return}}for(j in s)s.hasOwnProperty(j)&&(o=s[j],o!=null&&tt(e,t,j,o,s,null))}function aS(e,t,s,o){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,h=null,x=null,j=null,D=null,V=null,F=null;for(q in s){var X=s[q];if(s.hasOwnProperty(q)&&X!=null)switch(q){case"checked":break;case"value":break;case"defaultValue":D=X;default:o.hasOwnProperty(q)||tt(e,t,q,null,o,X)}}for(var P in o){var q=o[P];if(X=s[P],o.hasOwnProperty(P)&&(q!=null||X!=null))switch(P){case"type":h=q;break;case"name":d=q;break;case"checked":V=q;break;case"defaultChecked":F=q;break;case"value":x=q;break;case"defaultValue":j=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(l(137,t));break;default:q!==X&&tt(e,t,P,q,o,X)}}Bc(e,x,j,D,V,F,h,d);return;case"select":q=x=j=P=null;for(h in s)if(D=s[h],s.hasOwnProperty(h)&&D!=null)switch(h){case"value":break;case"multiple":q=D;default:o.hasOwnProperty(h)||tt(e,t,h,null,o,D)}for(d in o)if(h=o[d],D=s[d],o.hasOwnProperty(d)&&(h!=null||D!=null))switch(d){case"value":P=h;break;case"defaultValue":j=h;break;case"multiple":x=h;default:h!==D&&tt(e,t,d,h,o,D)}t=j,s=x,o=q,P!=null?Js(e,!!s,P,!1):!!o!=!!s&&(t!=null?Js(e,!!s,t,!0):Js(e,!!s,s?[]:"",!1));return;case"textarea":q=P=null;for(j in s)if(d=s[j],s.hasOwnProperty(j)&&d!=null&&!o.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:tt(e,t,j,null,o,d)}for(x in o)if(d=o[x],h=s[x],o.hasOwnProperty(x)&&(d!=null||h!=null))switch(x){case"value":P=d;break;case"defaultValue":q=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(l(91));break;default:d!==h&&tt(e,t,x,d,o,h)}ap(e,P,q);return;case"option":for(var he in s)if(P=s[he],s.hasOwnProperty(he)&&P!=null&&!o.hasOwnProperty(he))switch(he){case"selected":e.selected=!1;break;default:tt(e,t,he,null,o,P)}for(D in o)if(P=o[D],q=s[D],o.hasOwnProperty(D)&&P!==q&&(P!=null||q!=null))switch(D){case"selected":e.selected=P&&typeof P!="function"&&typeof P!="symbol";break;default:tt(e,t,D,P,o,q)}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 be in s)P=s[be],s.hasOwnProperty(be)&&P!=null&&!o.hasOwnProperty(be)&&tt(e,t,be,null,o,P);for(V in o)if(P=o[V],q=s[V],o.hasOwnProperty(V)&&P!==q&&(P!=null||q!=null))switch(V){case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(l(137,t));break;default:tt(e,t,V,P,o,q)}return;default:if(Ic(t)){for(var nt in s)P=s[nt],s.hasOwnProperty(nt)&&P!==void 0&&!o.hasOwnProperty(nt)&&Td(e,t,nt,void 0,o,P);for(F in o)P=o[F],q=s[F],!o.hasOwnProperty(F)||P===q||P===void 0&&q===void 0||Td(e,t,F,P,o,q);return}}for(var L in s)P=s[L],s.hasOwnProperty(L)&&P!=null&&!o.hasOwnProperty(L)&&tt(e,t,L,null,o,P);for(X in o)P=o[X],q=s[X],!o.hasOwnProperty(X)||P===q||P==null&&q==null||tt(e,t,X,P,o,q)}function lg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function sS(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),o=0;o<s.length;o++){var d=s[o],h=d.transferSize,x=d.initiatorType,j=d.duration;if(h&&j&&lg(x)){for(x=0,j=d.responseEnd,o+=1;o<s.length;o++){var D=s[o],V=D.startTime;if(V>j)break;var F=D.transferSize,X=D.initiatorType;F&&lg(X)&&(D=D.responseEnd,x+=F*(D<j?1:(j-V)/(D-V)))}if(--o,t+=8*(h+x)/(d.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var kd=null,jd=null;function kr(e){return e.nodeType===9?e:e.ownerDocument}function rg(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 cg(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function wd(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Cd=null;function iS(){var e=window.event;return e&&e.type==="popstate"?e===Cd?!1:(Cd=e,!0):(Cd=null,!1)}var ug=typeof setTimeout=="function"?setTimeout:void 0,oS=typeof clearTimeout=="function"?clearTimeout:void 0,dg=typeof Promise=="function"?Promise:void 0,lS=typeof queueMicrotask=="function"?queueMicrotask:typeof dg<"u"?function(e){return dg.resolve(null).then(e).catch(rS)}:ug;function rS(e){setTimeout(function(){throw e})}function Qa(e){return e==="head"}function fg(e,t){var s=t,o=0;do{var d=s.nextSibling;if(e.removeChild(s),d&&d.nodeType===8)if(s=d.data,s==="/$"||s==="/&"){if(o===0){e.removeChild(d),Di(t);return}o--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")o++;else if(s==="html")Uo(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,Uo(s);for(var h=s.firstChild;h;){var x=h.nextSibling,j=h.nodeName;h[no]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&h.rel.toLowerCase()==="stylesheet"||s.removeChild(h),h=x}}else s==="body"&&Uo(e.ownerDocument.body);s=d}while(s);Di(t)}function hg(e,t){var s=e;e=0;do{var o=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),o&&o.nodeType===8)if(s=o.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=o}while(s)}function Nd(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Nd(s),Mc(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function cS(e,t,s,o){for(;e.nodeType===1;){var d=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[no])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var h=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=An(e.nextSibling),e===null)break}return null}function uS(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=An(e.nextSibling),e===null))return null;return e}function pg(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=An(e.nextSibling),e===null))return null;return e}function Ed(e){return e.data==="$?"||e.data==="$~"}function Ad(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function dS(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var o=function(){t(),s.removeEventListener("DOMContentLoaded",o)};s.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function An(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Dd=null;function mg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return An(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function vg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function gg(e,t,s){switch(t=kr(s),e){case"html":if(e=t.documentElement,!e)throw Error(l(452));return e;case"head":if(e=t.head,!e)throw Error(l(453));return e;case"body":if(e=t.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function Uo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Mc(e)}var Dn=new Map,yg=new Set;function jr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _a=G.d;G.d={f:fS,r:hS,D:pS,C:mS,L:vS,m:gS,X:bS,S:yS,M:_S};function fS(){var e=_a.f(),t=vr();return e||t}function hS(e){var t=Xs(e);t!==null&&t.tag===5&&t.type==="form"?Bm(t):_a.r(e)}var Ni=typeof document>"u"?null:document;function bg(e,t,s){var o=Ni;if(o&&typeof t=="string"&&t){var d=Tn(t);d='link[rel="'+e+'"][href="'+d+'"]',typeof s=="string"&&(d+='[crossorigin="'+s+'"]'),yg.has(d)||(yg.add(d),e={rel:e,crossOrigin:s,href:t},o.querySelector(d)===null&&(t=o.createElement("link"),Gt(t,"link",e),Lt(t),o.head.appendChild(t)))}}function pS(e){_a.D(e),bg("dns-prefetch",e,null)}function mS(e,t){_a.C(e,t),bg("preconnect",e,t)}function vS(e,t,s){_a.L(e,t,s);var o=Ni;if(o&&e&&t){var d='link[rel="preload"][as="'+Tn(t)+'"]';t==="image"&&s&&s.imageSrcSet?(d+='[imagesrcset="'+Tn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(d+='[imagesizes="'+Tn(s.imageSizes)+'"]')):d+='[href="'+Tn(e)+'"]';var h=d;switch(t){case"style":h=Ei(e);break;case"script":h=Ai(e)}Dn.has(h)||(e=b({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),Dn.set(h,e),o.querySelector(d)!==null||t==="style"&&o.querySelector(Vo(h))||t==="script"&&o.querySelector(Ho(h))||(t=o.createElement("link"),Gt(t,"link",e),Lt(t),o.head.appendChild(t)))}}function gS(e,t){_a.m(e,t);var s=Ni;if(s&&e){var o=t&&typeof t.as=="string"?t.as:"script",d='link[rel="modulepreload"][as="'+Tn(o)+'"][href="'+Tn(e)+'"]',h=d;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Ai(e)}if(!Dn.has(h)&&(e=b({rel:"modulepreload",href:e},t),Dn.set(h,e),s.querySelector(d)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Ho(h)))return}o=s.createElement("link"),Gt(o,"link",e),Lt(o),s.head.appendChild(o)}}}function yS(e,t,s){_a.S(e,t,s);var o=Ni;if(o&&e){var d=Qs(o).hoistableStyles,h=Ei(e);t=t||"default";var x=d.get(h);if(!x){var j={loading:0,preload:null};if(x=o.querySelector(Vo(h)))j.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},s),(s=Dn.get(h))&&Rd(e,s);var D=x=o.createElement("link");Lt(D),Gt(D,"link",e),D._p=new Promise(function(V,F){D.onload=V,D.onerror=F}),D.addEventListener("load",function(){j.loading|=1}),D.addEventListener("error",function(){j.loading|=2}),j.loading|=4,wr(x,t,o)}x={type:"stylesheet",instance:x,count:1,state:j},d.set(h,x)}}}function bS(e,t){_a.X(e,t);var s=Ni;if(s&&e){var o=Qs(s).hoistableScripts,d=Ai(e),h=o.get(d);h||(h=s.querySelector(Ho(d)),h||(e=b({src:e,async:!0},t),(t=Dn.get(d))&&Md(e,t),h=s.createElement("script"),Lt(h),Gt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(d,h))}}function _S(e,t){_a.M(e,t);var s=Ni;if(s&&e){var o=Qs(s).hoistableScripts,d=Ai(e),h=o.get(d);h||(h=s.querySelector(Ho(d)),h||(e=b({src:e,async:!0,type:"module"},t),(t=Dn.get(d))&&Md(e,t),h=s.createElement("script"),Lt(h),Gt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(d,h))}}function _g(e,t,s,o){var d=(d=me.current)?jr(d):null;if(!d)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=Ei(s.href),s=Qs(d).hoistableStyles,o=s.get(t),o||(o={type:"style",instance:null,count:0,state:null},s.set(t,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=Ei(s.href);var h=Qs(d).hoistableStyles,x=h.get(e);if(x||(d=d.ownerDocument||d,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,x),(h=d.querySelector(Vo(e)))&&!h._p&&(x.instance=h,x.state.loading=5),Dn.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Dn.set(e,s),h||xS(d,e,s,x.state))),t&&o===null)throw Error(l(528,""));return x}if(t&&o!==null)throw Error(l(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ai(s),s=Qs(d).hoistableScripts,o=s.get(t),o||(o={type:"script",instance:null,count:0,state:null},s.set(t,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function Ei(e){return'href="'+Tn(e)+'"'}function Vo(e){return'link[rel="stylesheet"]['+e+"]"}function xg(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function xS(e,t,s,o){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?o.loading=1:(t=e.createElement("link"),o.preload=t,t.addEventListener("load",function(){return o.loading|=1}),t.addEventListener("error",function(){return o.loading|=2}),Gt(t,"link",s),Lt(t),e.head.appendChild(t))}function Ai(e){return'[src="'+Tn(e)+'"]'}function Ho(e){return"script[async]"+e}function Sg(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var o=e.querySelector('style[data-href~="'+Tn(s.href)+'"]');if(o)return t.instance=o,Lt(o),o;var d=b({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),Lt(o),Gt(o,"style",d),wr(o,s.precedence,e),t.instance=o;case"stylesheet":d=Ei(s.href);var h=e.querySelector(Vo(d));if(h)return t.state.loading|=4,t.instance=h,Lt(h),h;o=xg(s),(d=Dn.get(d))&&Rd(o,d),h=(e.ownerDocument||e).createElement("link"),Lt(h);var x=h;return x._p=new Promise(function(j,D){x.onload=j,x.onerror=D}),Gt(h,"link",o),t.state.loading|=4,wr(h,s.precedence,e),t.instance=h;case"script":return h=Ai(s.src),(d=e.querySelector(Ho(h)))?(t.instance=d,Lt(d),d):(o=s,(d=Dn.get(h))&&(o=b({},s),Md(o,d)),e=e.ownerDocument||e,d=e.createElement("script"),Lt(d),Gt(d,"link",o),e.head.appendChild(d),t.instance=d);case"void":return null;default:throw Error(l(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(o=t.instance,t.state.loading|=4,wr(o,s.precedence,e));return t.instance}function wr(e,t,s){for(var o=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=o.length?o[o.length-1]:null,h=d,x=0;x<o.length;x++){var j=o[x];if(j.dataset.precedence===t)h=j;else if(h!==d)break}h?h.parentNode.insertBefore(e,h.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function Rd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Md(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Cr=null;function Tg(e,t,s){if(Cr===null){var o=new Map,d=Cr=new Map;d.set(s,o)}else d=Cr,o=d.get(s),o||(o=new Map,d.set(s,o));if(o.has(e))return o;for(o.set(e,null),s=s.getElementsByTagName(e),d=0;d<s.length;d++){var h=s[d];if(!(h[no]||h[Ut]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var x=h.getAttribute(t)||"";x=e+x;var j=o.get(x);j?j.push(h):o.set(x,[h])}}return o}function kg(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function SS(e,t,s){if(s===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function jg(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function TS(e,t,s,o){if(s.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var d=Ei(o.href),h=t.querySelector(Vo(d));if(h){t=h._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Nr.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=h,Lt(h);return}h=t.ownerDocument||t,o=xg(o),(d=Dn.get(d))&&Rd(o,d),h=h.createElement("link"),Lt(h);var x=h;x._p=new Promise(function(j,D){x.onload=j,x.onerror=D}),Gt(h,"link",o),s.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=Nr.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var Od=0;function kS(e,t){return e.stylesheets&&e.count===0&&Ar(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var o=setTimeout(function(){if(e.stylesheets&&Ar(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+t);0<e.imgBytes&&Od===0&&(Od=62500*sS());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ar(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Od?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(d)}}:null}function Nr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ar(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Er=null;function Ar(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Er=new Map,t.forEach(jS,e),Er=null,Nr.call(e))}function jS(e,t){if(!(t.state.loading&4)){var s=Er.get(e);if(s)var o=s.get(null);else{s=new Map,Er.set(e,s);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<d.length;h++){var x=d[h];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(s.set(x.dataset.precedence,x),o=x)}o&&s.set(null,o)}d=t.instance,x=d.getAttribute("data-precedence"),h=s.get(x)||o,h===o&&s.set(null,d),s.set(x,d),this.count++,o=Nr.bind(this),d.addEventListener("load",o),d.addEventListener("error",o),h?h.parentNode.insertBefore(d,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),t.state.loading|=4}}var Po={$$typeof:A,Provider:null,Consumer:null,_currentValue:Q,_currentValue2:Q,_threadCount:0};function wS(e,t,s,o,d,h,x,j,D){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=Ec(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ec(0),this.hiddenUpdates=Ec(null),this.identifierPrefix=o,this.onUncaughtError=d,this.onCaughtError=h,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function wg(e,t,s,o,d,h,x,j,D,V,F,X){return e=new wS(e,t,s,x,D,V,F,X,j),t=1,h===!0&&(t|=24),h=dn(3,null,null,t),e.current=h,h.stateNode=e,t=hu(),t.refCount++,e.pooledCache=t,t.refCount++,h.memoizedState={element:o,isDehydrated:s,cache:t},gu(h),e}function Cg(e){return e?(e=li,e):li}function Ng(e,t,s,o,d,h){d=Cg(d),o.context===null?o.context=d:o.pendingContext=d,o=Va(t),o.payload={element:s},h=h===void 0?null:h,h!==null&&(o.callback=h),s=Ha(e,o,t),s!==null&&(ln(s,e,t),_o(s,e,t))}function Eg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Bd(e,t){Eg(e,t),(e=e.alternate)&&Eg(e,t)}function Ag(e){if(e.tag===13||e.tag===31){var t=gs(e,67108864);t!==null&&ln(t,e,67108864),Bd(e,67108864)}}function Dg(e){if(e.tag===13||e.tag===31){var t=vn();t=Ac(t);var s=gs(e,t);s!==null&&ln(s,e,t),Bd(e,t)}}var Dr=!0;function CS(e,t,s,o){var d=O.T;O.T=null;var h=G.p;try{G.p=2,Ld(e,t,s,o)}finally{G.p=h,O.T=d}}function NS(e,t,s,o){var d=O.T;O.T=null;var h=G.p;try{G.p=8,Ld(e,t,s,o)}finally{G.p=h,O.T=d}}function Ld(e,t,s,o){if(Dr){var d=Id(o);if(d===null)Sd(e,t,o,Rr,s),Mg(e,o);else if(AS(d,e,t,s,o))o.stopPropagation();else if(Mg(e,o),t&4&&-1<ES.indexOf(e)){for(;d!==null;){var h=Xs(d);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var x=Xt(h.pendingLanes);if(x!==0){var j=h;for(j.pendingLanes|=2,j.entangledLanes|=2;x;){var D=1<<31-Me(x);j.entanglements[1]|=D,x&=~D}Xn(h),(Ze&6)===0&&(pr=Yt()+500,Lo(0))}}break;case 31:case 13:j=gs(h,2),j!==null&&ln(j,h,2),vr(),Bd(h,2)}if(h=Id(o),h===null&&Sd(e,t,o,Rr,s),h===d)break;d=h}d!==null&&o.stopPropagation()}else Sd(e,t,o,null,s)}}function Id(e){return e=Uc(e),zd(e)}var Rr=null;function zd(e){if(Rr=null,e=Zs(e),e!==null){var t=u(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=f(t),e!==null)return e;e=null}else if(s===31){if(e=p(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Rr=e,null}function Rg(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(kl()){case Ji:return 2;case jl:return 8;case Y:case ie:return 32;case ue:return 268435456;default:return 32}default:return 32}}var Ud=!1,Wa=null,Ja=null,es=null,Go=new Map,qo=new Map,ts=[],ES="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 Mg(e,t){switch(e){case"focusin":case"focusout":Wa=null;break;case"dragenter":case"dragleave":Ja=null;break;case"mouseover":case"mouseout":es=null;break;case"pointerover":case"pointerout":Go.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":qo.delete(t.pointerId)}}function $o(e,t,s,o,d,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:s,eventSystemFlags:o,nativeEvent:h,targetContainers:[d]},t!==null&&(t=Xs(t),t!==null&&Ag(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function AS(e,t,s,o,d){switch(t){case"focusin":return Wa=$o(Wa,e,t,s,o,d),!0;case"dragenter":return Ja=$o(Ja,e,t,s,o,d),!0;case"mouseover":return es=$o(es,e,t,s,o,d),!0;case"pointerover":var h=d.pointerId;return Go.set(h,$o(Go.get(h)||null,e,t,s,o,d)),!0;case"gotpointercapture":return h=d.pointerId,qo.set(h,$o(qo.get(h)||null,e,t,s,o,d)),!0}return!1}function Og(e){var t=Zs(e.target);if(t!==null){var s=u(t);if(s!==null){if(t=s.tag,t===13){if(t=f(s),t!==null){e.blockedOn=t,Fh(e.priority,function(){Dg(s)});return}}else if(t===31){if(t=p(s),t!==null){e.blockedOn=t,Fh(e.priority,function(){Dg(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Mr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Id(e.nativeEvent);if(s===null){s=e.nativeEvent;var o=new s.constructor(s.type,s);zc=o,s.target.dispatchEvent(o),zc=null}else return t=Xs(s),t!==null&&Ag(t),e.blockedOn=s,!1;t.shift()}return!0}function Bg(e,t,s){Mr(e)&&s.delete(t)}function DS(){Ud=!1,Wa!==null&&Mr(Wa)&&(Wa=null),Ja!==null&&Mr(Ja)&&(Ja=null),es!==null&&Mr(es)&&(es=null),Go.forEach(Bg),qo.forEach(Bg)}function Or(e,t){e.blockedOn===t&&(e.blockedOn=null,Ud||(Ud=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,DS)))}var Br=null;function Lg(e){Br!==e&&(Br=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Br===e&&(Br=null);for(var t=0;t<e.length;t+=3){var s=e[t],o=e[t+1],d=e[t+2];if(typeof o!="function"){if(zd(o||s)===null)continue;break}var h=Xs(s);h!==null&&(e.splice(t,3),t-=3,Iu(h,{pending:!0,data:d,method:s.method,action:o},o,d))}}))}function Di(e){function t(D){return Or(D,e)}Wa!==null&&Or(Wa,e),Ja!==null&&Or(Ja,e),es!==null&&Or(es,e),Go.forEach(t),qo.forEach(t);for(var s=0;s<ts.length;s++){var o=ts[s];o.blockedOn===e&&(o.blockedOn=null)}for(;0<ts.length&&(s=ts[0],s.blockedOn===null);)Og(s),s.blockedOn===null&&ts.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(o=0;o<s.length;o+=3){var d=s[o],h=s[o+1],x=d[en]||null;if(typeof h=="function")x||Lg(s);else if(x){var j=null;if(h&&h.hasAttribute("formAction")){if(d=h,x=h[en]||null)j=x.formAction;else if(zd(d)!==null)continue}else j=x.action;typeof j=="function"?s[o+1]=j:(s.splice(o,3),o-=3),Lg(s)}}}function Ig(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(x){return d=x})},focusReset:"manual",scroll:"manual"})}function t(){d!==null&&(d(),d=null),o||setTimeout(s,20)}function s(){if(!o&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,d=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),d!==null&&(d(),d=null)}}}function Vd(e){this._internalRoot=e}Lr.prototype.render=Vd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));var s=t.current,o=vn();Ng(s,o,e,t,null,null)},Lr.prototype.unmount=Vd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ng(e.current,2,null,e,null,null),vr(),t[Fs]=null}};function Lr(e){this._internalRoot=e}Lr.prototype.unstable_scheduleHydration=function(e){if(e){var t=Yh();e={blockedOn:null,target:e,priority:t};for(var s=0;s<ts.length&&t!==0&&t<ts[s].priority;s++);ts.splice(s,0,e),s===0&&Og(e)}};var zg=a.version;if(zg!=="19.2.4")throw Error(l(527,zg,"19.2.4"));G.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=v(t),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var RS={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ir=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ir.isDisabled&&Ir.supportsFiber)try{Fe=Ir.inject(RS),ye=Ir}catch{}}return Yo.createRoot=function(e,t){if(!c(e))throw Error(l(299));var s=!1,o="",d=$m,h=Km,x=Ym;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onUncaughtError!==void 0&&(d=t.onUncaughtError),t.onCaughtError!==void 0&&(h=t.onCaughtError),t.onRecoverableError!==void 0&&(x=t.onRecoverableError)),t=wg(e,1,!1,null,null,s,o,null,d,h,x,Ig),e[Fs]=t.current,xd(e),new Vd(t)},Yo.hydrateRoot=function(e,t,s){if(!c(e))throw Error(l(299));var o=!1,d="",h=$m,x=Km,j=Ym,D=null;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(d=s.identifierPrefix),s.onUncaughtError!==void 0&&(h=s.onUncaughtError),s.onCaughtError!==void 0&&(x=s.onCaughtError),s.onRecoverableError!==void 0&&(j=s.onRecoverableError),s.formState!==void 0&&(D=s.formState)),t=wg(e,1,!0,t,s??null,o,d,D,h,x,j,Ig),t.context=Cg(null),s=t.current,o=vn(),o=Ac(o),d=Va(o),d.callback=null,Ha(s,d,o),s=o,t.current.lanes=s,to(t,s),Xn(t),e[Fs]=t.current,xd(e),new Lr(t)},Yo.version="19.2.4",Yo}var Kg;function oT(){if(Kg)return Hd.exports;Kg=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),Hd.exports=iT(),Hd.exports}var lT=oT();const rT="modulepreload",cT=function(n){return"/"+n},Yg={},uT=function(a,i,l){let c=Promise.resolve();if(i&&i.length>0){let f=function(v){return Promise.all(v.map(g=>Promise.resolve(g).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const p=document.querySelector("meta[property=csp-nonce]"),m=(p==null?void 0:p.nonce)||(p==null?void 0:p.getAttribute("nonce"));c=f(i.map(v=>{if(v=cT(v),v in Yg)return;Yg[v]=!0;const g=v.endsWith(".css"),b=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${v}"]${b}`))return;const _=document.createElement("link");if(_.rel=g?"stylesheet":rT,g||(_.as="script"),_.crossOrigin="",_.href=v,m&&_.setAttribute("nonce",m),document.head.appendChild(_),g)return new Promise((S,T)=>{_.addEventListener("load",S),_.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${v}`)))})}))}function u(f){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=f,window.dispatchEvent(p),!p.defaultPrevented)throw f}return c.then(f=>{for(const p of f||[])p.status==="rejected"&&u(p.reason);return a().catch(u)})};function Us(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function K0(n,a){return console.warn(`[ws] Malformed "${n}" message: ${a}`),!1}function dT(n){return Us(n)&&typeof n.id=="string"&&typeof n.type=="string"&&typeof n.timestamp=="string"&&Us(n.payload)}function fT(n){return Us(n)&&typeof n.sessionId=="string"&&typeof n.eventType=="string"&&typeof n.timestamp=="string"&&typeof n.content=="string"&&(n.raw===void 0||typeof n.raw=="string")}const hT=new Set(["off","subscription","api_key"]),Vr=new Set(["off","on"]);function pT(n){return Us(n)&&hT.has(n.claude)&&Vr.has(n.github)&&Vr.has(n.copilot)&&Vr.has(n.codex)&&Vr.has(n.goose)}function mT(n){let a;try{a=JSON.parse(n)}catch{console.warn("[ws] Failed to parse WebSocket message as JSON");return}if(!Us(a)||typeof a.type!="string"){console.warn("[ws] Received WebSocket message without a string 'type' field:",a);return}return typeof a.id=="string"&&typeof a.timestamp=="string"?{id:a.id,type:a.type,timestamp:a.timestamp,payload:Us(a.payload)?a.payload:{}}:{type:a.type,payload:Us(a.payload)?a.payload:void 0}}function Y0(n){switch(n){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 n}}function F0(n){switch(n){case"completed":return"completed";case"killed":return"killed";case"failed":return"interrupted";case"interrupted":return"interrupted";case"terminated":return"terminated";default:return}}const vT=3e3,Ri=5e3,gT=4001;/**
27
+ * react-router v7.13.2
28
+ *
29
+ * Copyright (c) Remix Software Inc.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE.md file in the root directory of this source tree.
33
+ *
34
+ * @license MIT
35
+ */var Fg="popstate";function Zg(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function yT(n={}){function a(l,c){var v;let u=(v=c.state)==null?void 0:v.masked,{pathname:f,search:p,hash:m}=u||l.location;return bf("",{pathname:f,search:p,hash:m},c.state&&c.state.usr||null,c.state&&c.state.key||"default",u?{pathname:l.location.pathname,search:l.location.search,hash:l.location.hash}:void 0)}function i(l,c){return typeof c=="string"?c:ul(c)}return _T(a,i,null,n)}function rt(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function Bn(n,a){if(!n){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function bT(){return Math.random().toString(36).substring(2,10)}function Xg(n,a){return{usr:n.state,key:n.key,idx:a,masked:n.unstable_mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function bf(n,a,i=null,l,c){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof a=="string"?Zi(a):a,state:i,key:a&&a.key||l||bT(),unstable_mask:c}}function ul({pathname:n="/",search:a="",hash:i=""}){return a&&a!=="?"&&(n+=a.charAt(0)==="?"?a:"?"+a),i&&i!=="#"&&(n+=i.charAt(0)==="#"?i:"#"+i),n}function Zi(n){let a={};if(n){let i=n.indexOf("#");i>=0&&(a.hash=n.substring(i),n=n.substring(0,i));let l=n.indexOf("?");l>=0&&(a.search=n.substring(l),n=n.substring(0,l)),n&&(a.pathname=n)}return a}function _T(n,a,i,l={}){let{window:c=document.defaultView,v5Compat:u=!1}=l,f=c.history,p="POP",m=null,v=g();v==null&&(v=0,f.replaceState({...f.state,idx:v},""));function g(){return(f.state||{idx:null}).idx}function b(){p="POP";let w=g(),k=w==null?null:w-v;v=w,m&&m({action:p,location:C.location,delta:k})}function _(w,k){p="PUSH";let E=Zg(w)?w:bf(C.location,w,k);v=g()+1;let A=Xg(E,v),R=C.createHref(E.unstable_mask||E);try{f.pushState(A,"",R)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;c.location.assign(R)}u&&m&&m({action:p,location:C.location,delta:1})}function S(w,k){p="REPLACE";let E=Zg(w)?w:bf(C.location,w,k);v=g();let A=Xg(E,v),R=C.createHref(E.unstable_mask||E);f.replaceState(A,"",R),u&&m&&m({action:p,location:C.location,delta:0})}function T(w){return xT(w)}let C={get action(){return p},get location(){return n(c,f)},listen(w){if(m)throw new Error("A history only accepts one active listener");return c.addEventListener(Fg,b),m=w,()=>{c.removeEventListener(Fg,b),m=null}},createHref(w){return a(c,w)},createURL:T,encodeLocation(w){let k=T(w);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:_,replace:S,go(w){return f.go(w)}};return C}function xT(n,a=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),rt(i,"No window.location.(origin|href) available to create URL");let l=typeof n=="string"?n:ul(n);return l=l.replace(/ $/,"%20"),!a&&l.startsWith("//")&&(l=i+l),new URL(l,i)}function Z0(n,a,i="/"){return ST(n,a,i,!1)}function ST(n,a,i,l){let c=typeof a=="string"?Zi(a):a,u=Na(c.pathname||"/",i);if(u==null)return null;let f=X0(n);TT(f);let p=null;for(let m=0;p==null&&m<f.length;++m){let v=W0(u);p=RT(f[m],v,l)}return p}function X0(n,a=[],i=[],l="",c=!1){let u=(f,p,m=c,v)=>{let g={relativePath:v===void 0?f.path||"":v,caseSensitive:f.caseSensitive===!0,childrenIndex:p,route:f};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(l)&&m)return;rt(g.relativePath.startsWith(l),`Absolute route path "${g.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(l.length)}let b=Wn([l,g.relativePath]),_=i.concat(g);f.children&&f.children.length>0&&(rt(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),X0(f.children,a,_,b,m)),!(f.path==null&&!f.index)&&a.push({path:b,score:AT(b,f.index),routesMeta:_})};return n.forEach((f,p)=>{var m;if(f.path===""||!((m=f.path)!=null&&m.includes("?")))u(f,p);else for(let v of Q0(f.path))u(f,p,!0,v)}),a}function Q0(n){let a=n.split("/");if(a.length===0)return[];let[i,...l]=a,c=i.endsWith("?"),u=i.replace(/\?$/,"");if(l.length===0)return c?[u,""]:[u];let f=Q0(l.join("/")),p=[];return p.push(...f.map(m=>m===""?u:[u,m].join("/"))),c&&p.push(...f),p.map(m=>n.startsWith("/")&&m===""?"/":m)}function TT(n){n.sort((a,i)=>a.score!==i.score?i.score-a.score:DT(a.routesMeta.map(l=>l.childrenIndex),i.routesMeta.map(l=>l.childrenIndex)))}var kT=/^:[\w-]+$/,jT=3,wT=2,CT=1,NT=10,ET=-2,Qg=n=>n==="*";function AT(n,a){let i=n.split("/"),l=i.length;return i.some(Qg)&&(l+=ET),a&&(l+=wT),i.filter(c=>!Qg(c)).reduce((c,u)=>c+(kT.test(u)?jT:u===""?CT:NT),l)}function DT(n,a){return n.length===a.length&&n.slice(0,-1).every((l,c)=>l===a[c])?n[n.length-1]-a[a.length-1]:0}function RT(n,a,i=!1){let{routesMeta:l}=n,c={},u="/",f=[];for(let p=0;p<l.length;++p){let m=l[p],v=p===l.length-1,g=u==="/"?a:a.slice(u.length)||"/",b=dl({path:m.relativePath,caseSensitive:m.caseSensitive,end:v},g),_=m.route;if(!b&&v&&i&&!l[l.length-1].route.index&&(b=dl({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},g)),!b)return null;Object.assign(c,b.params),f.push({params:c,pathname:Wn([u,b.pathname]),pathnameBase:IT(Wn([u,b.pathnameBase])),route:_}),b.pathnameBase!=="/"&&(u=Wn([u,b.pathnameBase]))}return f}function dl(n,a){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[i,l]=MT(n.path,n.caseSensitive,n.end),c=a.match(i);if(!c)return null;let u=c[0],f=u.replace(/(.)\/+$/,"$1"),p=c.slice(1);return{params:l.reduce((v,{paramName:g,isOptional:b},_)=>{if(g==="*"){let T=p[_]||"";f=u.slice(0,u.length-T.length).replace(/(.)\/+$/,"$1")}const S=p[_];return b&&!S?v[g]=void 0:v[g]=(S||"").replace(/%2F/g,"/"),v},{}),pathname:u,pathnameBase:f,pattern:n}}function MT(n,a=!1,i=!0){Bn(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let l=[],c="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,p,m,v,g)=>{if(l.push({paramName:p,isOptional:m!=null}),m){let b=g.charAt(v+f.length);return b&&b!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(l.push({paramName:"*"}),c+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?c+="\\/*$":n!==""&&n!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),l]}function W0(n){try{return n.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Bn(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),n}}function Na(n,a){if(a==="/")return n;if(!n.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,l=n.charAt(i);return l&&l!=="/"?null:n.slice(i)||"/"}var OT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function BT(n,a="/"){let{pathname:i,search:l="",hash:c=""}=typeof n=="string"?Zi(n):n,u;return i?(i=i.replace(/\/\/+/g,"/"),i.startsWith("/")?u=Wg(i.substring(1),"/"):u=Wg(i,a)):u=a,{pathname:u,search:zT(l),hash:UT(c)}}function Wg(n,a){let i=a.replace(/\/+$/,"").split("/");return n.split("/").forEach(c=>{c===".."?i.length>1&&i.pop():c!=="."&&i.push(c)}),i.length>1?i.join("/"):"/"}function qd(n,a,i,l){return`Cannot include a '${n}' character in a manually specified \`to.${a}\` field [${JSON.stringify(l)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function LT(n){return n.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function Ff(n){let a=LT(n);return a.map((i,l)=>l===a.length-1?i.pathname:i.pathnameBase)}function gc(n,a,i,l=!1){let c;typeof n=="string"?c=Zi(n):(c={...n},rt(!c.pathname||!c.pathname.includes("?"),qd("?","pathname","search",c)),rt(!c.pathname||!c.pathname.includes("#"),qd("#","pathname","hash",c)),rt(!c.search||!c.search.includes("#"),qd("#","search","hash",c)));let u=n===""||c.pathname==="",f=u?"/":c.pathname,p;if(f==null)p=i;else{let b=a.length-1;if(!l&&f.startsWith("..")){let _=f.split("/");for(;_[0]==="..";)_.shift(),b-=1;c.pathname=_.join("/")}p=b>=0?a[b]:"/"}let m=BT(c,p),v=f&&f!=="/"&&f.endsWith("/"),g=(u||f===".")&&i.endsWith("/");return!m.pathname.endsWith("/")&&(v||g)&&(m.pathname+="/"),m}var Wn=n=>n.join("/").replace(/\/\/+/g,"/"),IT=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),zT=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,UT=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,VT=class{constructor(n,a,i,l=!1){this.status=n,this.statusText=a||"",this.internal=l,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function HT(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function PT(n){return n.map(a=>a.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var J0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function eb(n,a){let i=n;if(typeof i!="string"||!OT.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let l=i,c=!1;if(J0)try{let u=new URL(window.location.href),f=i.startsWith("//")?new URL(u.protocol+i):new URL(i),p=Na(f.pathname,a);f.origin===u.origin&&p!=null?i=p+f.search+f.hash:c=!0}catch{Bn(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:l,isExternal:c,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var tb=["POST","PUT","PATCH","DELETE"];new Set(tb);var GT=["GET",...tb];new Set(GT);var Xi=y.createContext(null);Xi.displayName="DataRouter";var yc=y.createContext(null);yc.displayName="DataRouterState";var qT=y.createContext(!1),nb=y.createContext({isTransitioning:!1});nb.displayName="ViewTransition";var $T=y.createContext(new Map);$T.displayName="Fetchers";var KT=y.createContext(null);KT.displayName="Await";var _n=y.createContext(null);_n.displayName="Navigation";var yl=y.createContext(null);yl.displayName="Location";var Ln=y.createContext({outlet:null,matches:[],isDataRoute:!1});Ln.displayName="Route";var Zf=y.createContext(null);Zf.displayName="RouteError";var ab="REACT_ROUTER_ERROR",YT="REDIRECT",FT="ROUTE_ERROR_RESPONSE";function ZT(n){if(n.startsWith(`${ab}:${YT}:{`))try{let a=JSON.parse(n.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function XT(n){if(n.startsWith(`${ab}:${FT}:{`))try{let a=JSON.parse(n.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new VT(a.status,a.statusText,a.data)}catch{}}function QT(n,{relative:a}={}){rt(qs(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:l}=y.useContext(_n),{hash:c,pathname:u,search:f}=bl(n,{relative:a}),p=u;return i!=="/"&&(p=u==="/"?i:Wn([i,u])),l.createHref({pathname:p,search:f,hash:c})}function qs(){return y.useContext(yl)!=null}function Bt(){return rt(qs(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(yl).location}function Nt(n){rt(qs(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:a}=Bt();return y.useMemo(()=>dl(n,W0(a)),[a,n])}var sb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ib(n){y.useContext(_n).static||y.useLayoutEffect(n)}function bc(){let{isDataRoute:n}=y.useContext(Ln);return n?fk():WT()}function WT(){rt(qs(),"useNavigate() may be used only in the context of a <Router> component.");let n=y.useContext(Xi),{basename:a,navigator:i}=y.useContext(_n),{matches:l}=y.useContext(Ln),{pathname:c}=Bt(),u=JSON.stringify(Ff(l)),f=y.useRef(!1);return ib(()=>{f.current=!0}),y.useCallback((m,v={})=>{if(Bn(f.current,sb),!f.current)return;if(typeof m=="number"){i.go(m);return}let g=gc(m,JSON.parse(u),c,v.relative==="path");n==null&&a!=="/"&&(g.pathname=g.pathname==="/"?a:Wn([a,g.pathname])),(v.replace?i.replace:i.push)(g,v.state,v)},[a,i,u,c,n])}var JT=y.createContext(null);function ek(n){let a=y.useContext(Ln).outlet;return y.useMemo(()=>a&&y.createElement(JT.Provider,{value:n},a),[a,n])}function us(){let{matches:n}=y.useContext(Ln),a=n[n.length-1];return a?a.params:{}}function bl(n,{relative:a}={}){let{matches:i}=y.useContext(Ln),{pathname:l}=Bt(),c=JSON.stringify(Ff(i));return y.useMemo(()=>gc(n,JSON.parse(c),l,a==="path"),[n,c,l,a])}function tk(n,a){return ob(n,a)}function ob(n,a,i){var w;rt(qs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=y.useContext(_n),{matches:c}=y.useContext(Ln),u=c[c.length-1],f=u?u.params:{},p=u?u.pathname:"/",m=u?u.pathnameBase:"/",v=u&&u.route;{let k=v&&v.path||"";rb(p,!v||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
36
+
37
+ Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let g=Bt(),b;if(a){let k=typeof a=="string"?Zi(a):a;rt(m==="/"||((w=k.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 "${k.pathname}" was given in the \`location\` prop.`),b=k}else b=g;let _=b.pathname||"/",S=_;if(m!=="/"){let k=m.replace(/^\//,"").split("/");S="/"+_.replace(/^\//,"").split("/").slice(k.length).join("/")}let T=Z0(n,{pathname:S});Bn(v||T!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Bn(T==null||T[T.length-1].route.element!==void 0||T[T.length-1].route.Component!==void 0||T[T.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let C=ok(T&&T.map(k=>Object.assign({},k,{params:Object.assign({},f,k.params),pathname:Wn([m,l.encodeLocation?l.encodeLocation(k.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?m:Wn([m,l.encodeLocation?l.encodeLocation(k.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),c,i);return a&&C?y.createElement(yl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...b},navigationType:"POP"}},C):C}function nk(){let n=dk(),a=HT(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),i=n instanceof Error?n.stack:null,l="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:l},u={padding:"2px 4px",backgroundColor:l},f=null;return console.error("Error handled by React Router default ErrorBoundary:",n),f=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:u},"ErrorBoundary")," or"," ",y.createElement("code",{style:u},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},a),i?y.createElement("pre",{style:c},i):null,f)}var ak=y.createElement(nk,null),lb=class extends y.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,a){return a.location!==n.location||a.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:a.error,location:a.location,revalidation:n.revalidation||a.revalidation}}componentDidCatch(n,a){this.props.onError?this.props.onError(n,a):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const i=XT(n.digest);i&&(n=i)}let a=n!==void 0?y.createElement(Ln.Provider,{value:this.props.routeContext},y.createElement(Zf.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?y.createElement(sk,{error:n},a):a}};lb.contextType=qT;var $d=new WeakMap;function sk({children:n,error:a}){let{basename:i}=y.useContext(_n);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let l=ZT(a.digest);if(l){let c=$d.get(a);if(c)throw c;let u=eb(l.location,i);if(J0&&!$d.get(a))if(u.isExternal||l.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:l.replace}));throw $d.set(a,f),f}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return n}function ik({routeContext:n,match:a,children:i}){let l=y.useContext(Xi);return l&&l.static&&l.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=a.route.id),y.createElement(Ln.Provider,{value:n},i)}function ok(n,a=[],i){let l=i==null?void 0:i.state;if(n==null){if(!l)return null;if(l.errors)n=l.matches;else if(a.length===0&&!l.initialized&&l.matches.length>0)n=l.matches;else return null}let c=n,u=l==null?void 0:l.errors;if(u!=null){let g=c.findIndex(b=>b.route.id&&(u==null?void 0:u[b.route.id])!==void 0);rt(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),c=c.slice(0,Math.min(c.length,g+1))}let f=!1,p=-1;if(i&&l){f=l.renderFallback;for(let g=0;g<c.length;g++){let b=c[g];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(p=g),b.route.id){let{loaderData:_,errors:S}=l,T=b.route.loader&&!_.hasOwnProperty(b.route.id)&&(!S||S[b.route.id]===void 0);if(b.route.lazy||T){i.isStatic&&(f=!0),p>=0?c=c.slice(0,p+1):c=[c[0]];break}}}}let m=i==null?void 0:i.onError,v=l&&m?(g,b)=>{var _,S;m(g,{location:l.location,params:((S=(_=l.matches)==null?void 0:_[0])==null?void 0:S.params)??{},unstable_pattern:PT(l.matches),errorInfo:b})}:void 0;return c.reduceRight((g,b,_)=>{let S,T=!1,C=null,w=null;l&&(S=u&&b.route.id?u[b.route.id]:void 0,C=b.route.errorElement||ak,f&&(p<0&&_===0?(rb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),T=!0,w=null):p===_&&(T=!0,w=b.route.hydrateFallbackElement||null)));let k=a.concat(c.slice(0,_+1)),E=()=>{let A;return S?A=C:T?A=w:b.route.Component?A=y.createElement(b.route.Component,null):b.route.element?A=b.route.element:A=g,y.createElement(ik,{match:b,routeContext:{outlet:g,matches:k,isDataRoute:l!=null},children:A})};return l&&(b.route.ErrorBoundary||b.route.errorElement||_===0)?y.createElement(lb,{location:l.location,revalidation:l.revalidation,component:C,error:S,children:E(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:v}):E()},null)}function Xf(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function lk(n){let a=y.useContext(Xi);return rt(a,Xf(n)),a}function rk(n){let a=y.useContext(yc);return rt(a,Xf(n)),a}function ck(n){let a=y.useContext(Ln);return rt(a,Xf(n)),a}function Qf(n){let a=ck(n),i=a.matches[a.matches.length-1];return rt(i.route.id,`${n} can only be used on routes that contain a unique "id"`),i.route.id}function uk(){return Qf("useRouteId")}function dk(){var l;let n=y.useContext(Zf),a=rk("useRouteError"),i=Qf("useRouteError");return n!==void 0?n:(l=a.errors)==null?void 0:l[i]}function fk(){let{router:n}=lk("useNavigate"),a=Qf("useNavigate"),i=y.useRef(!1);return ib(()=>{i.current=!0}),y.useCallback(async(c,u={})=>{Bn(i.current,sb),i.current&&(typeof c=="number"?await n.navigate(c):await n.navigate(c,{fromRouteId:a,...u}))},[n,a])}var Jg={};function rb(n,a,i){!a&&!Jg[n]&&(Jg[n]=!0,Bn(!1,i))}y.memo(hk);function hk({routes:n,future:a,state:i,isStatic:l,onError:c}){return ob(n,void 0,{state:i,isStatic:l,onError:c})}function Gn({to:n,replace:a,state:i,relative:l}){rt(qs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=y.useContext(_n);Bn(!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:u}=y.useContext(Ln),{pathname:f}=Bt(),p=bc(),m=gc(n,Ff(u),f,l==="path"),v=JSON.stringify(m);return y.useEffect(()=>{p(JSON.parse(v),{replace:a,state:i,relative:l})},[p,v,l,a,i]),null}function $s(n){return ek(n.context)}function ke(n){rt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function pk({basename:n="/",children:a=null,location:i,navigationType:l="POP",navigator:c,static:u=!1,unstable_useTransitions:f}){rt(!qs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=n.replace(/^\/*/,"/"),m=y.useMemo(()=>({basename:p,navigator:c,static:u,unstable_useTransitions:f,future:{}}),[p,c,u,f]);typeof i=="string"&&(i=Zi(i));let{pathname:v="/",search:g="",hash:b="",state:_=null,key:S="default",unstable_mask:T}=i,C=y.useMemo(()=>{let w=Na(v,p);return w==null?null:{location:{pathname:w,search:g,hash:b,state:_,key:S,unstable_mask:T},navigationType:l}},[p,v,g,b,_,S,l,T]);return Bn(C!=null,`<Router basename="${p}"> is not able to match the URL "${v}${g}${b}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:y.createElement(_n.Provider,{value:m},y.createElement(yl.Provider,{children:a,value:C}))}function mk({children:n,location:a}){return tk(_f(n),a)}function _f(n,a=[]){let i=[];return y.Children.forEach(n,(l,c)=>{if(!y.isValidElement(l))return;let u=[...a,c];if(l.type===y.Fragment){i.push.apply(i,_f(l.props.children,u));return}rt(l.type===ke,`[${typeof l.type=="string"?l.type:l.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),rt(!l.props.index||!l.props.children,"An index route cannot have child routes.");let f={id:l.props.id||u.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,middleware:l.props.middleware,loader:l.props.loader,action:l.props.action,hydrateFallbackElement:l.props.hydrateFallbackElement,HydrateFallback:l.props.HydrateFallback,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.hasErrorBoundary===!0||l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(f.children=_f(l.props.children,u)),i.push(f)}),i}var Wr="get",Jr="application/x-www-form-urlencoded";function _c(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function vk(n){return _c(n)&&n.tagName.toLowerCase()==="button"}function gk(n){return _c(n)&&n.tagName.toLowerCase()==="form"}function yk(n){return _c(n)&&n.tagName.toLowerCase()==="input"}function bk(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function _k(n,a){return n.button===0&&(!a||a==="_self")&&!bk(n)}function xf(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((a,i)=>{let l=n[i];return a.concat(Array.isArray(l)?l.map(c=>[i,c]):[[i,l]])},[]))}function xk(n,a){let i=xf(n);return a&&a.forEach((l,c)=>{i.has(c)||a.getAll(c).forEach(u=>{i.append(c,u)})}),i}var Hr=null;function Sk(){if(Hr===null)try{new FormData(document.createElement("form"),0),Hr=!1}catch{Hr=!0}return Hr}var Tk=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Kd(n){return n!=null&&!Tk.has(n)?(Bn(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Jr}"`),null):n}function kk(n,a){let i,l,c,u,f;if(gk(n)){let p=n.getAttribute("action");l=p?Na(p,a):null,i=n.getAttribute("method")||Wr,c=Kd(n.getAttribute("enctype"))||Jr,u=new FormData(n)}else if(vk(n)||yk(n)&&(n.type==="submit"||n.type==="image")){let p=n.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=n.getAttribute("formaction")||p.getAttribute("action");if(l=m?Na(m,a):null,i=n.getAttribute("formmethod")||p.getAttribute("method")||Wr,c=Kd(n.getAttribute("formenctype"))||Kd(p.getAttribute("enctype"))||Jr,u=new FormData(p,n),!Sk()){let{name:v,type:g,value:b}=n;if(g==="image"){let _=v?`${v}.`:"";u.append(`${_}x`,"0"),u.append(`${_}y`,"0")}else v&&u.append(v,b)}}else{if(_c(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=Wr,l=null,c=Jr,f=n}return u&&c==="text/plain"&&(f=u,u=void 0),{action:l,method:i.toLowerCase(),encType:c,formData:u,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Wf(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function jk(n,a,i,l){let c=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return i?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${l}`:c.pathname=`${c.pathname}.${l}`:c.pathname==="/"?c.pathname=`_root.${l}`:a&&Na(c.pathname,a)==="/"?c.pathname=`${a.replace(/\/$/,"")}/_root.${l}`:c.pathname=`${c.pathname.replace(/\/$/,"")}.${l}`,c}async function wk(n,a){if(n.id in a)return a[n.id];try{let i=await import(n.module);return a[n.id]=i,i}catch(i){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ck(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function Nk(n,a,i){let l=await Promise.all(n.map(async c=>{let u=a.routes[c.route.id];if(u){let f=await wk(u,i);return f.links?f.links():[]}return[]}));return Rk(l.flat(1).filter(Ck).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function ey(n,a,i,l,c,u){let f=(m,v)=>i[v]?m.route.id!==i[v].route.id:!0,p=(m,v)=>{var g;return i[v].pathname!==m.pathname||((g=i[v].route.path)==null?void 0:g.endsWith("*"))&&i[v].params["*"]!==m.params["*"]};return u==="assets"?a.filter((m,v)=>f(m,v)||p(m,v)):u==="data"?a.filter((m,v)=>{var b;let g=l.routes[m.route.id];if(!g||!g.hasLoader)return!1;if(f(m,v)||p(m,v))return!0;if(m.route.shouldRevalidate){let _=m.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:((b=i[0])==null?void 0:b.params)||{},nextUrl:new URL(n,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof _=="boolean")return _}return!0}):[]}function Ek(n,a,{includeHydrateFallback:i}={}){return Ak(n.map(l=>{let c=a.routes[l.route.id];if(!c)return[];let u=[c.module];return c.clientActionModule&&(u=u.concat(c.clientActionModule)),c.clientLoaderModule&&(u=u.concat(c.clientLoaderModule)),i&&c.hydrateFallbackModule&&(u=u.concat(c.hydrateFallbackModule)),c.imports&&(u=u.concat(c.imports)),u}).flat(1))}function Ak(n){return[...new Set(n)]}function Dk(n){let a={},i=Object.keys(n).sort();for(let l of i)a[l]=n[l];return a}function Rk(n,a){let i=new Set;return new Set(a),n.reduce((l,c)=>{let u=JSON.stringify(Dk(c));return i.has(u)||(i.add(u),l.push({key:u,link:c})),l},[])}function cb(){let n=y.useContext(Xi);return Wf(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function Mk(){let n=y.useContext(yc);return Wf(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Jf=y.createContext(void 0);Jf.displayName="FrameworkContext";function ub(){let n=y.useContext(Jf);return Wf(n,"You must render this element inside a <HydratedRouter> element"),n}function Ok(n,a){let i=y.useContext(Jf),[l,c]=y.useState(!1),[u,f]=y.useState(!1),{onFocus:p,onBlur:m,onMouseEnter:v,onMouseLeave:g,onTouchStart:b}=a,_=y.useRef(null);y.useEffect(()=>{if(n==="render"&&f(!0),n==="viewport"){let C=k=>{k.forEach(E=>{f(E.isIntersecting)})},w=new IntersectionObserver(C,{threshold:.5});return _.current&&w.observe(_.current),()=>{w.disconnect()}}},[n]),y.useEffect(()=>{if(l){let C=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(C)}}},[l]);let S=()=>{c(!0)},T=()=>{c(!1),f(!1)};return i?n!=="intent"?[u,_,{}]:[u,_,{onFocus:Fo(p,S),onBlur:Fo(m,T),onMouseEnter:Fo(v,S),onMouseLeave:Fo(g,T),onTouchStart:Fo(b,S)}]:[!1,_,{}]}function Fo(n,a){return i=>{n&&n(i),i.defaultPrevented||a(i)}}function Bk({page:n,...a}){let{router:i}=cb(),l=y.useMemo(()=>Z0(i.routes,n,i.basename),[i.routes,n,i.basename]);return l?y.createElement(Ik,{page:n,matches:l,...a}):null}function Lk(n){let{manifest:a,routeModules:i}=ub(),[l,c]=y.useState([]);return y.useEffect(()=>{let u=!1;return Nk(n,a,i).then(f=>{u||c(f)}),()=>{u=!0}},[n,a,i]),l}function Ik({page:n,matches:a,...i}){let l=Bt(),{future:c,manifest:u,routeModules:f}=ub(),{basename:p}=cb(),{loaderData:m,matches:v}=Mk(),g=y.useMemo(()=>ey(n,a,v,u,l,"data"),[n,a,v,u,l]),b=y.useMemo(()=>ey(n,a,v,u,l,"assets"),[n,a,v,u,l]),_=y.useMemo(()=>{if(n===l.pathname+l.search+l.hash)return[];let C=new Set,w=!1;if(a.forEach(E=>{var R;let A=u.routes[E.route.id];!A||!A.hasLoader||(!g.some(N=>N.route.id===E.route.id)&&E.route.id in m&&((R=f[E.route.id])!=null&&R.shouldRevalidate)||A.hasClientLoader?w=!0:C.add(E.route.id))}),C.size===0)return[];let k=jk(n,p,c.unstable_trailingSlashAwareDataRequests,"data");return w&&C.size>0&&k.searchParams.set("_routes",a.filter(E=>C.has(E.route.id)).map(E=>E.route.id).join(",")),[k.pathname+k.search]},[p,c.unstable_trailingSlashAwareDataRequests,m,l,u,g,a,n,f]),S=y.useMemo(()=>Ek(b,u),[b,u]),T=Lk(b);return y.createElement(y.Fragment,null,_.map(C=>y.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...i})),S.map(C=>y.createElement("link",{key:C,rel:"modulepreload",href:C,...i})),T.map(({key:C,link:w})=>y.createElement("link",{key:C,nonce:i.nonce,...w,crossOrigin:w.crossOrigin??i.crossOrigin})))}function zk(...n){return a=>{n.forEach(i=>{typeof i=="function"?i(a):i!=null&&(i.current=a)})}}var Uk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Uk&&(window.__reactRouterVersion="7.13.2")}catch{}function Vk({basename:n,children:a,unstable_useTransitions:i,window:l}){let c=y.useRef();c.current==null&&(c.current=yT({window:l,v5Compat:!0}));let u=c.current,[f,p]=y.useState({action:u.action,location:u.location}),m=y.useCallback(v=>{i===!1?p(v):y.startTransition(()=>p(v))},[i]);return y.useLayoutEffect(()=>u.listen(m),[u,m]),y.createElement(pk,{basename:n,children:a,location:f.location,navigationType:f.action,navigator:u,unstable_useTransitions:i})}var db=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,eh=y.forwardRef(function({onClick:a,discover:i="render",prefetch:l="none",relative:c,reloadDocument:u,replace:f,unstable_mask:p,state:m,target:v,to:g,preventScrollReset:b,viewTransition:_,unstable_defaultShouldRevalidate:S,...T},C){let{basename:w,navigator:k,unstable_useTransitions:E}=y.useContext(_n),A=typeof g=="string"&&db.test(g),R=eb(g,w);g=R.to;let N=QT(g,{relative:c}),z=Bt(),H=null;if(p){let ae=gc(p,[],z.unstable_mask?z.unstable_mask.pathname:"/",!0);w!=="/"&&(ae.pathname=ae.pathname==="/"?w:Wn([w,ae.pathname])),H=k.createHref(ae)}let[B,K,W]=Ok(l,T),se=qk(g,{replace:f,unstable_mask:p,state:m,target:v,preventScrollReset:b,relative:c,viewTransition:_,unstable_defaultShouldRevalidate:S,unstable_useTransitions:E});function ne(ae){a&&a(ae),ae.defaultPrevented||se(ae)}let re=!(R.isExternal||u),$=y.createElement("a",{...T,...W,href:(re?H:void 0)||R.absoluteURL||N,onClick:re?ne:a,ref:zk(C,K),target:v,"data-discover":!A&&i==="render"?"true":void 0});return B&&!A?y.createElement(y.Fragment,null,$,y.createElement(Bk,{page:N})):$});eh.displayName="Link";var Hk=y.forwardRef(function({"aria-current":a="page",caseSensitive:i=!1,className:l="",end:c=!1,style:u,to:f,viewTransition:p,children:m,...v},g){let b=bl(f,{relative:v.relative}),_=Bt(),S=y.useContext(yc),{navigator:T,basename:C}=y.useContext(_n),w=S!=null&&Zk(b)&&p===!0,k=T.encodeLocation?T.encodeLocation(b).pathname:b.pathname,E=_.pathname,A=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;i||(E=E.toLowerCase(),A=A?A.toLowerCase():null,k=k.toLowerCase()),A&&C&&(A=Na(A,C)||A);const R=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let N=E===k||!c&&E.startsWith(k)&&E.charAt(R)==="/",z=A!=null&&(A===k||!c&&A.startsWith(k)&&A.charAt(k.length)==="/"),H={isActive:N,isPending:z,isTransitioning:w},B=N?a:void 0,K;typeof l=="function"?K=l(H):K=[l,N?"active":null,z?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let W=typeof u=="function"?u(H):u;return y.createElement(eh,{...v,"aria-current":B,className:K,ref:g,style:W,to:f,viewTransition:p},typeof m=="function"?m(H):m)});Hk.displayName="NavLink";var Pk=y.forwardRef(({discover:n="render",fetcherKey:a,navigate:i,reloadDocument:l,replace:c,state:u,method:f=Wr,action:p,onSubmit:m,relative:v,preventScrollReset:g,viewTransition:b,unstable_defaultShouldRevalidate:_,...S},T)=>{let{unstable_useTransitions:C}=y.useContext(_n),w=Yk(),k=Fk(p,{relative:v}),E=f.toLowerCase()==="get"?"get":"post",A=typeof p=="string"&&db.test(p),R=N=>{if(m&&m(N),N.defaultPrevented)return;N.preventDefault();let z=N.nativeEvent.submitter,H=(z==null?void 0:z.getAttribute("formmethod"))||f,B=()=>w(z||N.currentTarget,{fetcherKey:a,method:H,navigate:i,replace:c,state:u,relative:v,preventScrollReset:g,viewTransition:b,unstable_defaultShouldRevalidate:_});C&&i!==!1?y.startTransition(()=>B()):B()};return y.createElement("form",{ref:T,method:E,action:k,onSubmit:l?m:R,...S,"data-discover":!A&&n==="render"?"true":void 0})});Pk.displayName="Form";function Gk(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fb(n){let a=y.useContext(Xi);return rt(a,Gk(n)),a}function qk(n,{target:a,replace:i,unstable_mask:l,state:c,preventScrollReset:u,relative:f,viewTransition:p,unstable_defaultShouldRevalidate:m,unstable_useTransitions:v}={}){let g=bc(),b=Bt(),_=bl(n,{relative:f});return y.useCallback(S=>{if(_k(S,a)){S.preventDefault();let T=i!==void 0?i:ul(b)===ul(_),C=()=>g(n,{replace:T,unstable_mask:l,state:c,preventScrollReset:u,relative:f,viewTransition:p,unstable_defaultShouldRevalidate:m});v?y.startTransition(()=>C()):C()}},[b,g,_,i,l,c,a,n,u,f,p,m,v])}function th(n){Bn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let a=y.useRef(xf(n)),i=y.useRef(!1),l=Bt(),c=y.useMemo(()=>xk(l.search,i.current?null:a.current),[l.search]),u=bc(),f=y.useCallback((p,m)=>{const v=xf(typeof p=="function"?p(new URLSearchParams(c)):p);i.current=!0,u("?"+v,m)},[u,c]);return[c,f]}var $k=0,Kk=()=>`__${String(++$k)}__`;function Yk(){let{router:n}=fb("useSubmit"),{basename:a}=y.useContext(_n),i=uk(),l=n.fetch,c=n.navigate;return y.useCallback(async(u,f={})=>{let{action:p,method:m,encType:v,formData:g,body:b}=kk(u,a);if(f.navigate===!1){let _=f.fetcherKey||Kk();await l(_,i,f.action||p,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:g,body:b,formMethod:f.method||m,formEncType:f.encType||v,flushSync:f.flushSync})}else await c(f.action||p,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:g,body:b,formMethod:f.method||m,formEncType:f.encType||v,replace:f.replace,state:f.state,fromRouteId:i,flushSync:f.flushSync,viewTransition:f.viewTransition})},[l,c,a,i])}function Fk(n,{relative:a}={}){let{basename:i}=y.useContext(_n),l=y.useContext(Ln);rt(l,"useFormAction must be used inside a RouteContext");let[c]=l.matches.slice(-1),u={...bl(n||".",{relative:a})},f=Bt();if(n==null){u.search=f.search;let p=new URLSearchParams(u.search),m=p.getAll("index");if(m.some(g=>g==="")){p.delete("index"),m.filter(b=>b).forEach(b=>p.append("index",b));let g=p.toString();u.search=g?`?${g}`:""}}return(!n||n===".")&&c.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(u.pathname=u.pathname==="/"?i:Wn([i,u.pathname])),ul(u)}function Zk(n,{relative:a}={}){let i=y.useContext(nb);rt(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:l}=fb("useViewTransitionState"),c=bl(n,{relative:a});if(!i.isTransitioning)return!1;let u=Na(i.currentLocation.pathname,l)||i.currentLocation.pathname,f=Na(i.nextLocation.pathname,l)||i.nextLocation.pathname;return dl(c.pathname,f)!=null||dl(c.pathname,u)!=null}function bt(){const n=bc();return y.useCallback((a,i)=>{typeof a=="number"?n(a):n(a,i)},[n])}function hb(n){return`/sessions/${encodeURIComponent(n)}`}function Pi(n,a){return a?`/environments/${encodeURIComponent(a)}/workspaces/${encodeURIComponent(n)}`:`/workspaces/${encodeURIComponent(n)}`}function ta(n,a,i,l){const c=encodeURIComponent(n);let u;return i&&l?u=`/environments/${encodeURIComponent(l)}/workspaces/${encodeURIComponent(i)}/tasks/${c}`:i?u=`/workspaces/${encodeURIComponent(i)}/tasks/${c}`:u=`/tasks/${c}`,a?`${u}/${a}`:u}function Ks(n,a,i){const l=new URLSearchParams;n&&l.set("workspace",n),a&&l.set("parent",a);const c=l.toString();if(n&&i){const u=`/environments/${encodeURIComponent(i)}/workspaces/${encodeURIComponent(n)}/tasks/new`;return a?`${u}?parent=${encodeURIComponent(a)}`:u}return c?`/tasks/new?${c}`:"/tasks/new"}function pb(n){return`/sessions/new?${new URLSearchParams({env:n}).toString()}`}const Gi="/environments",Xk="/environments/new";function qi(n){return`/environments/${encodeURIComponent(n)}`}function Qk(n){return`/environments/${encodeURIComponent(n)}/edit`}const Hi="/settings",Wk="/settings/credentials",Yd="/settings/personas",Jk="/settings/personas/new";function mb(n){return`/settings/personas/${encodeURIComponent(n)}`}const ej="/settings/shortcuts",tj="/pair",nj="/chat",Hs="/",aj="/tasks",vb="/workspaces/new",gb="/knowledge";function sj(n,a){const i=typeof window<"u"?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`:"ws://localhost:3000",l=y.useRef(void 0),[c,u]=y.useState(!1),f=y.useRef(a.onMessage);f.current=a.onMessage;const p=y.useRef(a.onConnect);p.current=a.onConnect;const m=y.useRef(a.onDisconnect);m.current=a.onDisconnect;const v=y.useCallback(g=>{var b;((b=l.current)==null?void 0:b.readyState)===WebSocket.OPEN&&l.current.send(JSON.stringify(g))},[]);return y.useEffect(()=>{let g,b;function _(){g=new WebSocket(i),l.current=g,g.onopen=()=>{u(!0),p.current(v)},g.onmessage=S=>{if(typeof S.data!="string"){console.warn("[ws] Received non-string WebSocket message; ignoring");return}const T=mT(S.data);T&&f.current(T)},g.onclose=S=>{var T;if(u(!1),l.current=void 0,(T=m.current)==null||T.call(m),clearTimeout(b),S.code===gT){window.location.href=tj;return}b=setTimeout(_,vT)},g.onerror=()=>{g.close()}}return _(),()=>{clearTimeout(b),g==null||g.close()}},[i,v]),{connected:c,send:v}}const ij=new Proxy(globalThis.fetch,{apply(n,a,i){return Reflect.apply(globalThis.fetch,a,i)}}),oj=$S({baseUrl:"/",fetch:ij}),Te=KS(YS,oj);function lj(n){return{id:n.id,displayName:n.displayName,adapterType:n.adapterType,adapterConfig:n.adapterConfig||"{}",status:n.status,bootstrapped:n.bootstrapped}}function ty(n){return{id:n.id,environmentId:n.environmentId,runtime:n.runtime,status:n.status,prompt:n.prompt,startedAt:n.startedAt,endedAt:n.endedAt||void 0,error:n.error||void 0,endReason:n.endReason||void 0,personaId:n.personaId||void 0,inputTokens:n.inputTokens,outputTokens:n.outputTokens,costUsd:n.costUsd}}function rj(n){return{sessionId:n.sessionId,eventType:FS(n.type),timestamp:n.timestamp,content:n.content,raw:n.raw||void 0}}function cj(n){return{id:n.id,name:n.name,description:n.description,repoUrl:n.repoUrl,environmentId:n.environmentId,status:ZS(n.status),workingDirectory:n.workingDirectory,useWorktrees:n.useWorktrees,defaultPersonaId:n.defaultPersonaId,createdAt:n.createdAt,updatedAt:n.updatedAt}}function ny(n){return{id:n.id,workspaceId:n.workspaceId??void 0,title:n.title,description:n.description,status:XS(n.status),branch:n.branch,latestSessionId:n.latestSessionId,dependsOn:[...n.dependsOn],sortOrder:n.sortOrder,createdAt:n.createdAt,startedAt:n.startedAt||void 0,completedAt:n.completedAt||void 0,parentTaskId:n.parentTaskId,depth:n.depth,childTaskIds:[...n.childTaskIds],canDecompose:n.canDecompose,defaultPersonaId:n.defaultPersonaId,workpad:n.workpad}}function uj(n){return{id:n.id,workspaceId:n.workspaceId,taskId:n.taskId,sessionId:n.sessionId,category:n.category,title:n.title,content:n.content,tags:[...n.tags],createdAt:n.createdAt}}function dj(n){return{name:n.name,tokenType:n.type,envVar:n.envVar,filePath:n.filePath,expiresAt:n.expiresAt}}function fj(n){return{claude:QS(n.claude),github:Ur(n.github),copilot:Ur(n.copilot),codex:Ur(n.codex),goose:Ur(n.goose)}}function hj(n){return{name:n.name,repository:n.repository,state:n.state,gitStatus:n.gitStatus}}function Fd(n){return{id:n.id,name:n.name,description:n.description,systemPrompt:n.systemPrompt,toolConfig:n.toolConfig?JSON.stringify({allowedTools:[...n.toolConfig.allowedTools],disallowedTools:[...n.toolConfig.disallowedTools]}):"{}",runtime:n.runtime,model:n.model,maxTurns:n.maxTurns,mcpServers:JSON.stringify(n.mcpServers.map(a=>({name:a.name,command:a.command,args:[...a.args],tools:[...a.tools]}))),createdAt:n.createdAt,updatedAt:n.updatedAt,type:n.type||"agent",script:n.script,allowedMcpTools:[...n.allowedMcpTools]}}function pj(n){return{inputTokens:n.inputTokens,outputTokens:n.outputTokens,costUsd:n.costUsd,sessionCount:n.sessionCount}}function Pr(n,a=0){return{id:n.id,label:n.title||n.label||n.id,kind:n.kind,category:n.category||void 0,sourceType:n.sourceType||void 0,sourceId:n.sourceId||void 0,content:n.content||void 0,tags:n.tags.length>0?[...n.tags]:void 0,workspaceId:n.workspaceId||void 0,createdAt:n.createdAt||void 0,updatedAt:n.updatedAt||void 0,val:a}}function Zd(n){return{source:n.fromId,target:n.toId,type:n.type}}const ay=5e3;function mj(){const[n,a]=y.useState([]),[i,l]=y.useState({}),c=y.useCallback(()=>{Te.listEnvironments({}).then(_=>{a(_.environments.map(lj))},()=>{})},[]),u=y.useCallback(_=>{switch(_.type){case"environment.added":return!0;case"environment.removed":{const S=_.payload.environmentId;return S&&(a(T=>T.filter(C=>C.id!==S)),l(T=>{const C={...T};return delete C[S],C})),!0}case"environment.changed":return c(),!0;case"environment.provision_progress":{const S=_.payload;if(typeof S.environmentId!="string"||typeof S.stage!="string"||typeof S.message!="string"||typeof S.progress!="number")return K0("environment.provision_progress","invalid payload"),!0;if(l(T=>({...T,[S.environmentId]:{stage:S.stage,message:S.message,progress:S.progress}})),S.stage==="ready"){const T=S.environmentId;setTimeout(()=>{l(C=>{const w={...C};return delete w[T],w})},ay)}return!0}default:return!1}},[c]),f=y.useCallback(_=>{var S;if(_.type==="environments"){const T=Array.isArray((S=_.payload)==null?void 0:S.environments)?_.payload.environments:[];return a(T),!0}return!1},[]),p=y.useCallback((_,S,T)=>{Te.addEnvironment({displayName:_,adapterType:S,adapterConfig:JSON.stringify(T??{})}).catch(()=>{})},[]),m=y.useCallback((_,S)=>{Te.updateEnvironment({id:_,displayName:S.displayName,adapterConfig:S.adapterConfig?JSON.stringify(S.adapterConfig):void 0}).catch(()=>{})},[]),v=y.useCallback((_,S)=>{(async()=>{try{const C=Te.provisionEnvironment({id:_,force:S??!1});for await(const w of C)l(k=>({...k,[_]:{stage:w.stage,message:w.message,progress:w.progress}})),w.stage==="ready"&&setTimeout(()=>{l(k=>{const E={...k};return delete E[_],E})},ay)}catch{l(C=>{const w={...C};return delete w[_],w})}})().catch(()=>{})},[]),g=y.useCallback(_=>{Te.stopEnvironment({id:_}).catch(()=>{})},[]),b=y.useCallback(_=>{Te.removeEnvironment({id:_}).catch(()=>{})},[]);return{environments:n,provisionStatus:i,loadEnvironments:c,addEnvironment:p,updateEnvironment:m,provisionEnvironment:v,stopEnvironment:g,removeEnvironment:b,handleEvent:u,handleLegacyMessage:f}}const Xd=new Set(["pending","running","idle"]),vj=new Set(["completed","failed","interrupted","hibernating","suspended"]),sy=["pending","running","idle"];function gj(){const[n,a]=y.useState([]),[i,l]=y.useState([]),[c,u]=y.useState(0),[f,p]=y.useState(void 0),[m,v]=y.useState({}),g=y.useCallback(()=>{Te.listSessions({}).then(R=>{const N=R.sessions.map(ty);a(z=>{const H=new Map(z.map(B=>[B.id,B]));return N.map(B=>{const K=H.get(B.id),W=K==null?void 0:K.status;return!W||W===B.status?B:vj.has(W)&&Xd.has(B.status)?{...B,status:W,...K.endReason!==void 0?{endReason:K.endReason}:{}}:Xd.has(W)&&Xd.has(B.status)&&sy.indexOf(W)>sy.indexOf(B.status)?{...B,status:W}:B})})},()=>{})},[]),b=y.useCallback(R=>{if(R.type!=="session_event")return!1;if(!fT(R.payload))return K0("session_event","payload is not a valid SessionEvent"),!0;const N=R.payload;let z=0;if(l(H=>{const B=[...H,N];return B.length>Ri?(z=B.length-Ri,B.slice(-Ri)):B}),z>0&&u(H=>H+z),N.eventType==="usage")try{const H=JSON.parse(N.content),B=Number(H.input_tokens)||0,K=Number(H.output_tokens)||0,W=Number(H.cost_usd)||0;(B>0||K>0||W>0)&&a(se=>se.map(ne=>ne.id===N.sessionId?{...ne,inputTokens:(ne.inputTokens??0)+B,outputTokens:(ne.outputTokens??0)+K,costUsd:(ne.costUsd??0)+W}:ne))}catch{}if(N.eventType==="status"){const H=Y0(N.content),B=F0(N.content);a(K=>K.some(se=>se.id===N.sessionId)?K.map(se=>se.id===N.sessionId?{...se,status:H,...B!==void 0?{endReason:B}:{}}:se):[...K,{id:N.sessionId,environmentId:"",runtime:"",status:H,prompt:"",startedAt:N.timestamp,...B!==void 0?{endReason:B}:{}}])}return!0},[]),_=y.useCallback(R=>{var N,z,H,B,K;switch(R.type){case"sessions":{const W=Array.isArray((N=R.payload)==null?void 0:N.sessions)?R.payload.sessions:[];return a(W),!0}case"spawned":{const W=(z=R.payload)==null?void 0:z.sessionId;return typeof W=="string"&&W&&p(W),g(),!0}case"session_events":{const W=Array.isArray((H=R.payload)==null?void 0:H.events)?R.payload.events:[];return W.length>0&&l(W),!0}case"task_sessions":{const W=(B=R.payload)==null?void 0:B.taskId;if(typeof W=="string"&&W){const se=Array.isArray((K=R.payload)==null?void 0:K.sessions)?R.payload.sessions:[];v(ne=>({...ne,[W]:se}))}return!0}default:return!1}},[g]),S=y.useCallback((R,N,z,H)=>{Te.spawnAgent({environmentId:R,prompt:N,personaId:z||"",workingDirectory:H||""}).then(B=>{p(B.id),g()},()=>{})},[g]),T=y.useCallback((R,N)=>{Te.sendInput({sessionId:R,text:N}).catch(()=>{})},[]),C=y.useCallback(R=>{Te.killAgent({id:R,graceful:!1}).catch(()=>{})},[]),w=y.useCallback(R=>{Te.killAgent({id:R,graceful:!0}).catch(()=>{})},[]),k=y.useCallback(R=>{Te.getSessionEvents({id:R}).then(N=>{const z=N.events.map(rj);if(z.length>0){let H=0;l(B=>{const K=new Set;for(const ne of B)ne.sessionId===R&&K.add(`${ne.timestamp}|${ne.eventType}`);const W=z.filter(ne=>!K.has(`${ne.timestamp}|${ne.eventType}`)),se=[...B,...W].sort((ne,re)=>ne.sessionId!==re.sessionId?0:ne.timestamp.localeCompare(re.timestamp));return se.length>Ri?(H=se.length-Ri,se.slice(-Ri)):se}),H>0&&u(B=>B+H)}},()=>{})},[]),E=y.useCallback(()=>{l([]),u(0)},[]),A=y.useCallback(R=>{Te.getTaskSessions({id:R}).then(N=>{const z=N.sessions.map(ty);v(H=>({...H,[R]:z}))},()=>{})},[]);return{sessions:n,events:i,eventsDropped:c,lastSpawnedId:f,taskSessions:m,loadSessions:g,spawn:S,sendInput:T,kill:C,stopGraceful:w,loadSessionEvents:k,clearEvents:E,loadTaskSessions:A,handleMessage:b,handleLegacyMessage:_}}function yj(){const[n,a]=y.useState([]),[i,l]=y.useState(!1),c=y.useCallback(()=>{Te.listWorkspaces({}).then(g=>{a(g.workspaces.map(cj))},()=>{})},[]),u=y.useCallback(g=>{switch(g.type){case"workspace.created":return l(!1),c(),!0;case"workspace.archived":case"workspace.updated":return c(),!0;default:return!1}},[c]),f=y.useCallback(()=>{l(!1)},[]),p=y.useCallback((g,b,_,S,T,C,w,k,E)=>{l(!0),Te.createWorkspace({name:g,description:b||"",repoUrl:_||"",environmentId:S||"",defaultPersonaId:T||void 0,useWorktrees:C??!0,workingDirectory:w||void 0}).then(()=>{l(!1),k==null||k()},A=>{l(!1);const R=A instanceof Yf?A.message:"Failed to create workspace";E==null||E(R)})},[]),m=y.useCallback(g=>{Te.archiveWorkspace({id:g}).catch(()=>{})},[]),v=y.useCallback((g,b)=>{Te.updateWorkspace({id:g,...b}).catch(()=>{})},[]);return{workspaces:n,workspaceCreating:i,loadWorkspaces:c,createWorkspace:p,archiveWorkspace:m,updateWorkspace:v,handleEvent:u,onDisconnect:f}}function bj(){const[n,a]=y.useState([]),[i,l]=y.useState(void 0),c=y.useCallback(k=>{Te.listTasks({workspaceId:k}).then(E=>{const A=E.tasks.map(ny);a(R=>[...R.filter(N=>N.workspaceId!==k),...A])},()=>{})},[]),u=y.useCallback(()=>{Te.listTasks({}).then(k=>{const E=k.tasks.map(ny);a(A=>{const R=new Set(E.map(N=>N.id));return[...A.filter(N=>!R.has(N.id)),...E]})},()=>{})},[]),f=y.useCallback((k,E)=>{k?c(k):E&&a(A=>{const R=A.find(N=>N.id===E);return R!=null&&R.workspaceId?c(R.workspaceId):u(),A})},[c,u]),p=y.useCallback(k=>{const E=k.payload;switch(k.type){case"task.created":{const A=typeof E.workspaceId=="string"?E.workspaceId:"";return A&&c(A),!0}case"task.started":{const A=typeof E.taskId=="string"?E.taskId:"",R=typeof E.sessionId=="string"?E.sessionId:"",N=typeof E.workspaceId=="string"?E.workspaceId:"";return l(z=>A&&z===A?void 0:z),R&&A&&a(z=>z.map(H=>H.id===A?{...H,latestSessionId:R}:H)),f(N,A),!0}case"task.completed":case"task.deleted":case"task.updated":{const A=typeof E.workspaceId=="string"?E.workspaceId:"",R=typeof E.taskId=="string"?E.taskId:"";return f(A,R),!0}default:return!1}},[c,f]),m=y.useCallback(()=>{l(void 0)},[]),v=y.useCallback(k=>{var E,A;if(k.type==="tasks"){const R=Array.isArray((E=k.payload)==null?void 0:E.tasks)?k.payload.tasks:[],N=typeof((A=k.payload)==null?void 0:A.workspaceId)=="string"&&k.payload.workspaceId?k.payload.workspaceId:"";return a(N?z=>[...z.filter(H=>H.workspaceId!==N),...R]:z=>{const H=new Set(R.map(B=>B.id));return[...z.filter(B=>!H.has(B.id)),...R]}),!0}return!1},[]),g=y.useCallback((k,E,A,R,N,z,H,B,K)=>{Te.createTask({workspaceId:k,title:E,description:A||"",dependsOn:R||[],parentTaskId:N||"",defaultPersonaId:z||void 0,canDecompose:H??void 0}).then(()=>{B==null||B()},W=>{const se=W instanceof Yf?W.message:"Failed to create task";K==null||K(se)})},[]),b=y.useCallback((k,E,A,R)=>{l(k),Te.startTask({taskId:k,personaId:E||"",environmentId:A||"",notes:R||""}).catch(()=>{l(void 0)})},[]),_=y.useCallback(k=>{Te.stopTask({id:k}).catch(()=>{})},[]),S=y.useCallback(k=>{Te.completeTask({id:k}).catch(()=>{})},[]),T=y.useCallback(k=>{Te.resumeTask({id:k}).catch(()=>{})},[]),C=y.useCallback((k,E,A,R,N)=>{Te.updateTask({id:k,title:E,description:A,dependsOn:R,...N!==void 0?{defaultPersonaId:N}:{}}).catch(()=>{})},[]),w=y.useCallback(k=>{Te.deleteTask({id:k}).catch(()=>{})},[]);return{tasks:n,taskStartingId:i,loadTasks:c,loadAllTasks:u,createTask:g,startTask:b,stopTask:_,completeTask:S,resumeTask:T,updateTask:C,deleteTask:w,handleEvent:p,onDisconnect:m,handleLegacyMessage:v}}function _j(){const[n,a]=y.useState([]),i=y.useCallback(u=>{Te.queryFindings({workspaceId:u}).then(f=>{a(f.findings.map(uj))},()=>{})},[]),l=y.useCallback(u=>{if(u.type==="finding.posted"){const f=typeof u.payload.workspaceId=="string"?u.payload.workspaceId:"";return f&&i(f),!0}return!1},[i]),c=y.useCallback((u,f,p,m,v)=>{Te.postFinding({workspaceId:u,title:f,content:p,category:m??"general",tags:v??[]}).catch(()=>{})},[]);return{findings:n,loadFindings:i,postFinding:c,handleEvent:l}}function xj(){const[n,a]=y.useState([]),i=y.useCallback(()=>{Te.listTokens({}).then(f=>{a(f.tokens.map(dj))},()=>{})},[]),l=y.useCallback(f=>f.type==="token.changed"?(i(),!0):!1,[i]),c=y.useCallback((f,p,m,v,g)=>{Te.setToken({name:f,value:p,type:m,envVar:v,filePath:g}).catch(()=>{})},[]),u=y.useCallback(f=>{Te.deleteToken({name:f}).catch(()=>{})},[]);return{tokens:n,loadTokens:i,setToken:c,deleteToken:u,handleEvent:l}}function Sj(){const[n,a]=y.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),i=y.useCallback(()=>{Te.getCredentialProviders({}).then(u=>{a(fj(u))},()=>{})},[]),l=y.useCallback(u=>u.type==="credential.providers_changed"?(pT(u.payload)&&a(u.payload),!0):!1,[]),c=y.useCallback(u=>{const f=[{provider:"claude",value:u.claude},{provider:"github",value:u.github},{provider:"copilot",value:u.copilot},{provider:"codex",value:u.codex},{provider:"goose",value:u.goose}];for(const{provider:p,value:m}of f)Te.setCredentialProvider({provider:p,value:m}).catch(()=>{})},[]);return{credentialProviders:n,loadCredentials:i,updateCredentialProviders:c,handleEvent:l}}function Tj(){const[n,a]=y.useState([]),[i,l]=y.useState(""),[c,u]=y.useState(""),[f,p]=y.useState(!1),m=y.useCallback(()=>{Te.listCodespaces({}).then(g=>{a(g.codespaces.map(hj)),u(g.error)},()=>{})},[]),v=y.useCallback((g,b)=>{p(!0),l(""),Te.createCodespace({repo:g,machine:b??""}).then(()=>{p(!1),m()},_=>{p(!1);const S=_ instanceof Yf?_.message:"Failed to create codespace";l(S)})},[m]);return{codespaces:n,codespaceError:i,codespaceListError:c,codespaceCreating:f,listCodespaces:m,createCodespace:v}}function kj(){const[n,a]=y.useState([]),i=y.useCallback(()=>{Te.listPersonas({}).then(p=>{a(p.personas.map(Fd))},()=>{})},[]),l=y.useCallback(p=>{switch(p.type){case"persona.created":case"persona.updated":case"persona.deleted":return i(),!0;default:return!1}},[i]),c=y.useCallback((p,m,v,g,b,_,S,T,C)=>Te.createPersona({name:p,description:m,systemPrompt:v,runtime:g||"",model:b||"",maxTurns:_||0,type:S||"agent",script:T||"",allowedMcpTools:C||[]}).then(w=>{const k=Fd(w);return a(E=>[...E.filter(A=>A.id!==k.id),k]),k}),[]),u=y.useCallback((p,m,v,g,b,_,S,T,C,w)=>{const k={id:p};return m!==void 0&&(k.name=m),v!==void 0&&(k.description=v),g!==void 0&&(k.systemPrompt=g),b!==void 0&&(k.runtime=b),_!==void 0&&(k.model=_),S!==void 0&&(k.maxTurns=S),T!==void 0&&(k.type=T),C!==void 0&&(k.script=C),w!==void 0&&(k.allowedMcpTools=w),Te.updatePersona(k).then(E=>{const A=Fd(E);return a(R=>R.map(N=>N.id===A.id?A:N)),A})},[]),f=y.useCallback(async p=>{await Te.deletePersona({id:p}),a(m=>m.filter(v=>v.id!==p))},[]);return{personas:n,loadPersonas:i,createPersona:c,updatePersona:u,deletePersona:f,handleEvent:l}}function jj(n){if(n)try{return JSON.parse(n)}catch{return}}function wj(){const[n,a]=y.useState(new Map),[i,l]=y.useState([]),[c,u]=y.useState(void 0),[f,p]=y.useState(void 0),[m,v]=y.useState(!1),[g,b]=y.useState(""),_=y.useRef(""),S=y.useCallback(R=>{const N=R??"";_.current=N,b(""),v(!0),Te.listRecentKnowledgeNodes({limit:30,workspaceId:N}).then(z=>{const H=new Map,B=[];for(const K of z.nodes)H.set(K.id,Pr(K));for(const K of z.edges)B.push(Zd(K));for(const K of B){const W=H.get(K.source);W&&(W.val+=1);const se=H.get(K.target);se&&(se.val+=1)}a(H),l(B),v(!1)},()=>{v(!1)})},[]),T=y.useCallback(R=>{R.trim()&&(b(R),p(void 0),u(void 0),v(!0),Te.searchKnowledge({query:R,limit:20,workspaceId:_.current}).then(N=>{const z=new Map,H=[];for(const B of N.results){B.node&&z.set(B.node.id,Pr(B.node,B.edges.length));for(const K of B.edges)H.push(Zd(K))}a(z),l(H),v(!1)},()=>{v(!1)}))},[]),C=y.useCallback(()=>{S(_.current)},[S]),w=y.useCallback(R=>{p(R),Te.getKnowledgeNode({id:R}).then(N=>{if(!N.node){u(void 0);return}u({node:Pr(N.node,N.edges.length),edges:N.edges.map(z=>({fromId:z.fromId,toId:z.toId,type:z.type,metadata:jj(z.metadataJson)}))})},()=>{u(void 0)})},[]),k=y.useCallback(()=>{p(void 0),u(void 0)},[]),E=y.useCallback(R=>{Te.expandKnowledgeNode({id:R,depth:1}).then(N=>{a(z=>{const H=new Map(z);for(const B of N.nodes)H.has(B.id)||H.set(B.id,Pr(B));return H}),l(z=>{const H=new Set(z.map(K=>`${K.source}:${K.target}:${K.type}`)),B=[];for(const K of N.edges){const W=Zd(K),se=`${W.source}:${W.target}:${W.type}`;H.has(se)||B.push(W)}return[...z,...B]})},()=>{})},[]),A=y.useCallback(R=>!1,[]);return{graphData:{nodes:[...n.values()],links:i},selectedNode:c,selectedId:f,loading:m,searchQuery:g,search:T,clearSearch:C,selectNode:w,clearSelection:k,expandNode:E,loadRecent:S,handleEvent:A}}function Cj(n){const[a,i]=y.useState(""),[l,c]=y.useState(void 0),[u,f]=y.useState({}),{connected:p,send:m}=sj(n,{onMessage:K,onConnect:W,onDisconnect:se}),v=mj(),g=gj(),b=yj(),_=bj(),S=_j(),T=xj(),C=Sj(),w=Tj(),k=kj(),E=wj(),A="default_persona_id",R="onboarding_completed",N=y.useCallback(async re=>{const $=await Te.setSetting({key:A,value:re});i($.value)},[]),z=y.useCallback(()=>{c(!0),Te.setSetting({key:R,value:"true"}).catch(()=>{})},[]),H=y.useCallback((re,$)=>{Te.getUsage({scope:re,id:$}).then(ae=>{const O=`${re}:${$}`;f(G=>({...G,[O]:pj(ae)}))},()=>{})},[]);function B(re){const $=re.payload.key,ae=re.payload.value;if(re.type==="setting.changed"){$===A&&i(ae??""),$===R&&c(ae==="true");return}if(v.handleEvent(re)){(re.type==="environment.removed"||re.type==="environment.changed")&&g.loadSessions();return}if(!b.handleEvent(re)){if(_.handleEvent(re)){re.type==="task.started"&&g.loadSessions();return}S.handleEvent(re)||T.handleEvent(re)||C.handleEvent(re)||k.handleEvent(re)||E.handleEvent(re)}}function K(re){var $,ae,O,G;if(dT(re)){B(re);return}if(!g.handleMessage(re)&&!(($=g.handleLegacyMessage)!=null&&$.call(g,re))&&!((ae=v.handleLegacyMessage)!=null&&ae.call(v,re))&&!((O=_.handleLegacyMessage)!=null&&O.call(_,re))&&re.type==="error"){console.error("[ws]",(G=re.payload)==null?void 0:G.message);return}}function W(re){v.loadEnvironments(),g.loadSessions(),b.loadWorkspaces(),T.loadTokens(),C.loadCredentials(),k.loadPersonas(),Te.getSetting({key:A}).then($=>{i($.value)},()=>{}),Te.getSetting({key:R}).then($=>{c($.value==="true")},()=>{}),_.loadAllTasks(),re({type:"subscribe_all"})}function se(){b.onDisconnect(),_.onDisconnect()}const ne=y.useCallback(()=>{v.loadEnvironments(),g.loadSessions(),b.loadWorkspaces(),T.loadTokens()},[v.loadEnvironments,g.loadSessions,b.loadWorkspaces,T.loadTokens]);return{connected:p,send:m,environments:v.environments,sessions:g.sessions,events:g.events,eventsDropped:g.eventsDropped,lastSpawnedId:g.lastSpawnedId,workspaces:b.workspaces,tasks:_.tasks,findings:S.findings,tokens:T.tokens,spawn:g.spawn,sendInput:g.sendInput,kill:g.kill,stopGraceful:g.stopGraceful,refresh:ne,loadSessionEvents:g.loadSessionEvents,clearEvents:g.clearEvents,loadWorkspaces:b.loadWorkspaces,createWorkspace:b.createWorkspace,archiveWorkspace:b.archiveWorkspace,updateWorkspace:b.updateWorkspace,loadTasks:_.loadTasks,loadAllTasks:_.loadAllTasks,createTask:_.createTask,startTask:_.startTask,stopTask:_.stopTask,completeTask:_.completeTask,resumeTask:_.resumeTask,updateTask:_.updateTask,deleteTask:_.deleteTask,loadFindings:S.loadFindings,postFinding:S.postFinding,loadEnvironments:v.loadEnvironments,addEnvironment:v.addEnvironment,updateEnvironment:v.updateEnvironment,loadTokens:T.loadTokens,setToken:T.setToken,deleteToken:T.deleteToken,credentialProviders:C.credentialProviders,updateCredentialProviders:C.updateCredentialProviders,provisionStatus:v.provisionStatus,provisionEnvironment:v.provisionEnvironment,stopEnvironment:v.stopEnvironment,removeEnvironment:v.removeEnvironment,codespaces:w.codespaces,codespaceError:w.codespaceError,codespaceListError:w.codespaceListError,codespaceCreating:w.codespaceCreating,listCodespaces:w.listCodespaces,createCodespace:w.createCodespace,workspaceCreating:b.workspaceCreating,taskStartingId:_.taskStartingId,personas:k.personas,createPersona:k.createPersona,updatePersona:k.updatePersona,deletePersona:k.deletePersona,taskSessions:g.taskSessions,loadTaskSessions:g.loadTaskSessions,appDefaultPersonaId:a,setAppDefaultPersonaId:N,onboardingCompleted:l,completeOnboarding:z,usageCache:u,loadUsage:H,knowledge:E}}const nh=y.createContext(void 0);function Nj({children:n}){const a=Cj();return r.jsx(nh.Provider,{value:a,children:n})}function ut(){const n=y.useContext(nh);if(!n)throw new Error("useGrackle must be used within GrackleProvider");return n}const Ej=[{id:"env-local-01",displayName:"Local Dev",adapterType:"local",adapterConfig:"{}",status:"connected",bootstrapped:!0},{id:"env-docker-01",displayName:"Docker Sandbox",adapterType:"docker",adapterConfig:'{"image":"node:20"}',status:"connected",bootstrapped:!0},{id:"env-cs-01",displayName:"GitHub Codespace",adapterType:"codespace",adapterConfig:'{"codespaceName":"my-codespace"}',status:"connected",bootstrapped:!0},{id:"env-remote-01",displayName:"Staging (SSH)",adapterType:"ssh",adapterConfig:'{"host":"192.168.1.10","user":"deploy","sshPort":22}',status:"disconnected",bootstrapped:!1}],Aj=[{id:"sess-001-prev",environmentId:"env-local-01",runtime:"claude-code",status:"stopped",endReason:"interrupted",prompt:"Implement auth middleware",startedAt:"2026-02-26T14:00:00Z",endedAt:"2026-02-26T15:12:00Z",error:"Context window exceeded before completing implementation",inputTokens:84200,outputTokens:12750,costUsd:.41},{id:"sess-001",environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:"Refactor the authentication middleware to use JWT tokens",startedAt:"2026-02-27T08:15:00Z",inputTokens:42600,outputTokens:8100,costUsd:.22},{id:"sess-002",environmentId:"env-docker-01",runtime:"claude-code",status:"stopped",endReason:"completed",prompt:"Write unit tests for the user registration endpoint",startedAt:"2026-02-27T07:30:00Z",endedAt:"2026-02-27T07:33:00Z",inputTokens:31400,outputTokens:9800,costUsd:.18},{id:"sess-003",environmentId:"env-local-01",runtime:"claude-code",status:"stopped",endReason:"interrupted",prompt:"Migrate database schema to add audit_log table",startedAt:"2026-02-26T22:45:00Z",endedAt:"2026-02-26T23:10:00Z",inputTokens:56300,outputTokens:14200,costUsd:.31},{id:"sess-004",environmentId:"env-docker-01",runtime:"claude-code",status:"running",prompt:"Implement rate limiting for the public API",startedAt:"2026-02-27T09:00:00Z",inputTokens:18900,outputTokens:4500,costUsd:.1},{id:"sess-005",environmentId:"env-cs-01",runtime:"claude-code",status:"suspended",prompt:"Refactor database connection pooling for multi-tenant isolation",startedAt:"2026-02-27T06:00:00Z",inputTokens:67800,outputTokens:19300,costUsd:.38}],Dj=[{sessionId:"sess-001-prev",eventType:"status",timestamp:"2026-02-26T14:00:01Z",content:"running"},{sessionId:"sess-001-prev",eventType:"output",timestamp:"2026-02-26T14:00:05Z",content:"Reading src/middleware/auth.ts to understand the current authentication flow..."},{sessionId:"sess-001-prev",eventType:"error",timestamp:"2026-02-26T15:12:00Z",content:"Context window exceeded before completing implementation"},{sessionId:"sess-001",eventType:"status",timestamp:"2026-02-27T08:15:01Z",content:"running"},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:02Z",content:"Analyzing current authentication middleware in src/middleware/auth.ts..."},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:04Z",content:`Found 3 files using session-based auth:
38
+ - src/middleware/auth.ts
39
+ - src/routes/login.ts
40
+ - src/routes/protected.ts`},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:07Z",content:"Installing jsonwebtoken and @types/jsonwebtoken..."},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:12Z",content:`Rewriting auth middleware:
41
+ \`\`\`typescript
42
+ import jwt from "jsonwebtoken";
43
+ import type { Request, Response, NextFunction } from "express";
44
+
45
+ const JWT_SECRET = process.env.JWT_SECRET || "change-me";
46
+
47
+ export function verifyToken(req: Request, res: Response, next: NextFunction): void {
48
+ const header = req.headers.authorization;
49
+ if (!header?.startsWith("Bearer ")) {
50
+ res.status(401).json({ error: "Missing token" });
51
+ return;
52
+ }
53
+ try {
54
+ const decoded = jwt.verify(header.slice(7), JWT_SECRET);
55
+ req.user = decoded;
56
+ next();
57
+ } catch {
58
+ res.status(403).json({ error: "Invalid token" });
59
+ }
60
+ }
61
+ \`\`\``},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:18Z",content:"Updated login route to issue JWT tokens with 24h expiry."},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:22Z",content:"Running test suite... 14 tests passed, 2 updated, 0 failed."},{sessionId:"sess-002",eventType:"status",timestamp:"2026-02-27T07:30:01Z",content:"running"},{sessionId:"sess-002",eventType:"output",timestamp:"2026-02-27T07:30:05Z",content:"Generating pytest tests for POST /api/register endpoint..."},{sessionId:"sess-002",eventType:"output",timestamp:"2026-02-27T07:32:00Z",content:"Created 8 test cases covering: valid registration, duplicate email, weak password, missing fields, SQL injection, XSS payload, rate limit, and CORS headers."},{sessionId:"sess-002",eventType:"status",timestamp:"2026-02-27T07:33:00Z",content:"completed"}],Rj=[{id:"proj-alpha",name:"Workspace Alpha",description:"Core platform API and authentication services",repoUrl:"https://github.com/acme/alpha",environmentId:"env-local-01",status:"active",workingDirectory:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2026-01-15T10:00:00Z",updatedAt:"2026-01-15T10:00:00Z"},{id:"proj-beta",name:"Data Pipeline",description:"ETL pipelines for analytics and reporting",repoUrl:"https://github.com/acme/data-pipeline",environmentId:"env-docker-01",status:"active",workingDirectory:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2026-02-01T14:30:00Z",updatedAt:"2026-02-01T14:30:00Z"},{id:"proj-gamma",name:"Mobile App",description:"React Native cross-platform mobile application",repoUrl:"",environmentId:"env-local-01",status:"archived",workingDirectory:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2025-11-20T09:00:00Z",updatedAt:"2025-11-20T09:00:00Z"}],Mj=[{id:"task-001",workspaceId:"proj-alpha",title:"Implement JWT authentication",description:"Replace session-based auth with JWT tokens across all protected routes",status:"working",branch:"feat/jwt-auth",latestSessionId:"sess-001",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-25T10:00:00Z",parentTaskId:"",depth:0,childTaskIds:["task-001a","task-001b","task-001c"],canDecompose:!0,defaultPersonaId:"",workpad:""},{id:"task-001a",workspaceId:"proj-alpha",title:"Design token schema",description:"Define JWT payload structure, expiry, and refresh token strategy",status:"complete",branch:"feat/jwt-auth/design-token-schema",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-25T10:10:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-001b",workspaceId:"proj-alpha",title:"Implement auth middleware",description:"Build Express middleware that verifies JWT Bearer tokens",status:"working",branch:"feat/jwt-auth/implement-auth-middleware",latestSessionId:"sess-001",dependsOn:[],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-25T10:15:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-001c",workspaceId:"proj-alpha",title:"Write auth integration tests",description:"End-to-end tests for login flow, token refresh, and protected route access",status:"not_started",branch:"",latestSessionId:"",dependsOn:["task-001b"],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-25T10:20:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-002",workspaceId:"proj-alpha",title:"Add rate limiting",description:"Implement token-bucket rate limiting for public API endpoints",status:"not_started",branch:"",latestSessionId:"",dependsOn:["task-001"],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-25T10:05:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-003",workspaceId:"proj-alpha",title:"Set up OpenAPI documentation",description:"Generate Swagger docs from route decorators and serve at /api/docs",status:"paused",branch:"feat/openapi-docs",latestSessionId:"sess-002",dependsOn:[],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-24T16:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-004",workspaceId:"proj-alpha",title:"Database connection pooling",description:"Switch from single connection to a connection pool with health checks",status:"complete",branch:"feat/db-pool",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:4,createdAt:"2026-02-23T11:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-005",workspaceId:"proj-alpha",title:"Fix N+1 query in user list",description:"Use a JOIN instead of per-row lookups in GET /api/users",status:"not_started",branch:"fix/user-list-n1",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:5,createdAt:"2026-02-22T09:30:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-006",workspaceId:"proj-beta",title:"Add Parquet export support",description:"Allow pipeline outputs to be written as Parquet files for Spark consumption",status:"working",branch:"feat/parquet-export",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-26T08:00:00Z",parentTaskId:"",depth:0,childTaskIds:["task-006a","task-006b","task-006c","task-006d"],canDecompose:!0,defaultPersonaId:"",workpad:""},{id:"task-006a",workspaceId:"proj-beta",title:"Define Parquet schema mapping",description:"Map internal column types to Arrow/Parquet type system",status:"complete",branch:"feat/parquet-export/define-parquet-schema-mapping",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-26T08:05:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-006b",workspaceId:"proj-beta",title:"Implement row-group writer",description:"Write buffered row groups with configurable batch size",status:"complete",branch:"feat/parquet-export/implement-row-group-writer",latestSessionId:"",dependsOn:["task-006a"],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-26T08:10:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-006c",workspaceId:"proj-beta",title:"Add compression options",description:"Support Snappy, ZSTD, and GZIP compression for Parquet output",status:"working",branch:"feat/parquet-export/add-compression-options",latestSessionId:"sess-004",dependsOn:["task-006b"],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-26T08:15:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-006d",workspaceId:"proj-beta",title:"Write Parquet integration tests",description:"Round-trip tests: write Parquet, read back with pyarrow, verify data integrity",status:"not_started",branch:"",latestSessionId:"",dependsOn:["task-006c"],reviewNotes:void 0,sortOrder:4,createdAt:"2026-02-26T08:20:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-007",workspaceId:"proj-beta",title:"Implement incremental loads",description:"Track watermarks so pipelines only process new/changed rows",status:"working",branch:"feat/incremental",latestSessionId:"sess-004",dependsOn:[],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-26T08:30:00Z",parentTaskId:"",depth:0,childTaskIds:["task-007a","task-007b"],canDecompose:!0,defaultPersonaId:"",workpad:""},{id:"task-007a",workspaceId:"proj-beta",title:"Design watermark storage",description:"Define schema for per-pipeline high-watermark tracking",status:"complete",branch:"feat/incremental/design-watermark-storage",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-26T08:35:00Z",parentTaskId:"task-007",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-007b",workspaceId:"proj-beta",title:"Implement change detection query",description:"Generate WHERE clauses from watermarks to fetch only changed rows",status:"failed",branch:"feat/incremental/implement-change-detection-query",latestSessionId:"",dependsOn:["task-007a"],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-26T08:40:00Z",parentTaskId:"task-007",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""},{id:"task-008",workspaceId:"proj-beta",title:"Add pipeline monitoring dashboard",description:"Real-time metrics for pipeline throughput, latency, and error rates",status:"paused",branch:"feat/monitoring",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-26T09:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:""}],iy=[{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"}],Oj=[{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:""}],Bj=[{id:"persona-arch",name:"Software Architect",description:"Designs system architecture, defines interfaces, and decomposes large features into implementable tasks.",systemPrompt:"You are a senior software architect. Focus on clean interfaces, separation of concerns, and scalable patterns. When decomposing work, create concrete subtasks with clear acceptance criteria.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:50,mcpServers:"[]",createdAt:"2026-02-20T10:00:00Z",updatedAt:"2026-02-20T10:00:00Z",type:"agent",script:"",allowedMcpTools:[]},{id:"persona-fe",name:"Frontend Engineer",description:"React specialist — builds UI components, writes CSS, implements routing, and creates Playwright tests.",systemPrompt:"You are a frontend engineer specializing in React, TypeScript, and modern CSS. Follow component composition patterns, use semantic HTML, and write accessible markup.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit","Bash"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:100,mcpServers:"[]",createdAt:"2026-02-20T10:05:00Z",updatedAt:"2026-02-20T10:05:00Z",type:"agent",script:"",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-5-20250929",maxTurns:30,mcpServers:"[]",createdAt:"2026-02-20T10:10:00Z",updatedAt:"2026-02-20T10:10:00Z",type:"agent",script:"",allowedMcpTools:[]},{id:"persona-tester",name:"QA Engineer",description:"Writes comprehensive test suites — unit tests, integration tests, and E2E Playwright specs.",systemPrompt:"You are a QA engineer focused on test coverage. Write tests that cover happy paths, edge cases, error scenarios, and accessibility. Use Playwright for E2E tests.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit","Bash"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:80,mcpServers:"[]",createdAt:"2026-02-20T10:15:00Z",updatedAt:"2026-02-20T10:15:00Z",type:"agent",script:"",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));
62
+ for (const f of files) {
63
+ const eslintResult = await host.exec("npx", ["eslint", "--fix", f.filename]);
64
+ if (eslintResult.exitCode !== 0) {
65
+ env.findings.push({ category: "lint", title: \`Lint issues in \${f.filename}\`, content: eslintResult.stderr });
66
+ }
67
+ const prettierResult = await host.exec("npx", ["prettier", "--write", f.filename]);
68
+ if (prettierResult.exitCode !== 0) {
69
+ env.findings.push({ category: "format", title: \`Prettier issues in \${f.filename}\`, content: prettierResult.stderr });
70
+ }
71
+ }
72
+ env.findings.push({ category: "summary", title: "Lint & format pass complete", content: \`Ran ESLint and Prettier on \${files.length} files\` });`,allowedMcpTools:[]}],Lj={"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 Ot(n){return new Date(Date.now()+n).toISOString()}const oy=[{label:"API Refactor",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Ot(0),content:"running"}},{delayMs:800,event:{eventType:"output",timestamp:Ot(800),content:"Analyzing current API structure in src/routes/..."}},{delayMs:1600,event:{eventType:"output",timestamp:Ot(1600),content:`Found 5 endpoints that need refactoring:
73
+ - GET /api/users
74
+ - POST /api/users
75
+ - GET /api/users/:id
76
+ - PUT /api/users/:id
77
+ - DELETE /api/users/:id`}},{delayMs:2800,event:{eventType:"output",timestamp:Ot(2800),content:"Refactoring to use Express Router with middleware chain...\n```typescript\nconst router = Router();\nrouter.use(authenticate);\nrouter.use(validateBody);\n```"}},{delayMs:4e3,event:{eventType:"output",timestamp:Ot(4e3),content:"Running test suite... 22 tests passed, 3 updated, 0 failed."}},{delayMs:5e3,event:{eventType:"status",timestamp:Ot(5e3),content:"completed"}}]},{label:"Database Migration",pauseForInput:!0,pauseAfterStep:3,steps:[{delayMs:0,event:{eventType:"status",timestamp:Ot(0),content:"running"}},{delayMs:600,event:{eventType:"output",timestamp:Ot(600),content:"Scanning current schema for migration targets..."}},{delayMs:1400,event:{eventType:"output",timestamp:Ot(1400),content:`Found tables to modify:
78
+ - users (add column: last_login_at)
79
+ - sessions (add index on expires_at)
80
+ - audit_log (new table)`}},{delayMs:2200,event:{eventType:"output",timestamp:Ot(2200),content:`⚠ This migration will add a NOT NULL column to the users table.
81
+ The table has 50,000+ rows — this may lock the table briefly.
82
+
83
+ Please confirm to proceed.`}}],resumeSteps:[{delayMs:500,event:{eventType:"output",timestamp:Ot(0),content:"Proceeding with migration..."}},{delayMs:1500,event:{eventType:"output",timestamp:Ot(1e3),content:`Migration 001_add_last_login.sql applied successfully.
84
+ Migration 002_sessions_index.sql applied successfully.
85
+ Migration 003_audit_log.sql applied successfully.`}},{delayMs:2500,event:{eventType:"output",timestamp:Ot(2e3),content:"All 3 migrations applied. Running verification queries... OK."}},{delayMs:3200,event:{eventType:"status",timestamp:Ot(2700),content:"completed"}}]},{label:"Test Writer",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Ot(0),content:"running"}},{delayMs:700,event:{eventType:"output",timestamp:Ot(700),content:"Generating test scaffolding for src/services/billing.ts..."}},{delayMs:1800,event:{eventType:"output",timestamp:Ot(1800),content:`Writing test cases:
86
+ - should calculate monthly total
87
+ - should apply discount codes
88
+ - should handle currency conversion
89
+ - should reject expired cards`}},{delayMs:2800,event:{eventType:"output",timestamp:Ot(2800),content:`Error: Cannot resolve import 'src/services/stripe-client.ts' — module not found.
90
+ The billing service depends on a Stripe client that doesn't exist in this environment.`}},{delayMs:3500,event:{eventType:"status",timestamp:Ot(3500),content:"failed"}}]}],ly=400;function Ij({children:n}){const[a,i]=y.useState(Ej),[l,c]=y.useState(Aj),[u,f]=y.useState(Dj),[p,m]=y.useState(void 0),[v,g]=y.useState(Rj),[b,_]=y.useState(Mj),[S,T]=y.useState(iy),[C,w]=y.useState(Oj),[k,E]=y.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),[A,R]=y.useState(Bj),[N]=y.useState(Lj),[z,H]=y.useState(""),B=y.useRef(0),K=y.useRef(0),W=y.useRef(new Set),se=y.useRef(new Map),ne=y.useRef(b);ne.current=b;const re=y.useRef(new Map),$=y.useRef(new Map),ae=y.useCallback(Y=>(B.current+=1,`mock-${Y}-${String(B.current).padStart(3,"0")}`),[]),O=y.useCallback(()=>{const Y=oy[K.current%oy.length];return K.current+=1,Y},[]),G=y.useCallback((Y,ie,ue)=>{const je=setTimeout(()=>{var _e;W.current.delete(je),ue&&((_e=se.current.get(ue))==null||_e.delete(je)),Y()},ie);W.current.add(je),ue&&(se.current.has(ue)||se.current.set(ue,new Set),se.current.get(ue).add(je))},[]),Q=y.useCallback(Y=>{const ie=se.current.get(Y);ie&&(ie.forEach(ue=>{clearTimeout(ue),W.current.delete(ue)}),se.current.delete(Y))},[]),oe=y.useCallback((Y,ie,ue)=>{c(je=>je.map(_e=>_e.id===Y?{..._e,status:ie,...ue!==void 0?{endReason:ue}:{}}:_e))},[]),le=y.useCallback(Y=>{f(ie=>[...ie,Y])},[]),De=y.useCallback((Y,ie,ue)=>{ie.forEach((je,_e)=>{G(()=>{const Fe={sessionId:Y,...je.event,timestamp:new Date().toISOString()};if(le(Fe),je.event.eventType==="status"){const ye=Y0(je.event.content),Qe=F0(je.event.content);oe(Y,ye,Qe)}_e===ie.length-1&&ue&&ue()},je.delayMs,Y)})},[G,le,oe]),we=y.useCallback((Y,ie,ue,je)=>{console.log("[MockGrackle] spawn",{environmentId:Y,prompt:ie,runtime:je});const _e=ae("sess"),Fe={id:_e,environmentId:Y,runtime:je||"claude-code",status:"running",prompt:ie,startedAt:new Date().toISOString()};c(Qe=>[...Qe,Fe]),m(_e);const ye=O();if(console.log(`[MockGrackle] Playing scenario: ${ye.label}`),ye.pauseForInput){const Qe=ye.pauseAfterStep??ye.steps.length-1,Me=ye.steps.slice(0,Qe+1),Tt=Me.length>0?Me[Me.length-1].delayMs:0;De(_e,Me),G(()=>{oe(_e,"idle"),le({sessionId:_e,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},Tt+ly,_e),ye.resumeSteps&&re.current.set(_e,ye.resumeSteps)}else De(_e,ye.steps)},[ae,O,De,G,oe,le]),Se=y.useCallback(Y=>{console.log("[MockGrackle] kill",Y),Q(Y),re.current.delete(Y),oe(Y,"stopped","killed"),le({sessionId:Y,eventType:"status",timestamp:new Date().toISOString(),content:"killed"}),_(ie=>ie.map(ue=>ue.latestSessionId===Y&&ue.status==="working"?{...ue,status:"not_started"}:ue))},[Q,oe,le]),Oe=y.useCallback(Y=>{console.log("[MockGrackle] stopGraceful",Y),Q(Y),re.current.delete(Y),oe(Y,"stopped","terminated"),le({sessionId:Y,eventType:"status",timestamp:new Date().toISOString(),content:"terminated"}),_(ie=>ie.map(ue=>ue.latestSessionId===Y&&ue.status==="working"?{...ue,status:"not_started"}:ue))},[Q,oe,le]),ce=y.useCallback(()=>{console.log("[MockGrackle] refresh")},[]),me=y.useCallback(Y=>{console.log("[MockGrackle] loadSessionEvents",Y)},[]),fe=y.useCallback(()=>{console.log("[MockGrackle] clearEvents"),f([])},[]),Ge=y.useCallback((Y,ie,ue,je,_e,Fe,ye,Qe,Me)=>{console.log("[MockGrackle] createWorkspace",{name:Y,description:ie});const Tt={id:ae("proj"),name:Y,description:ie||"",repoUrl:ue||"",environmentId:je||"",status:"active",workingDirectory:ye||"",useWorktrees:Fe??!0,defaultPersonaId:_e||"",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};g(Dt=>[...Dt,Tt]),Qe&&Qe()},[ae]),Kt=y.useCallback(Y=>{console.log("[MockGrackle] archiveWorkspace",Y),g(ie=>ie.map(ue=>ue.id===Y?{...ue,status:"archived"}:ue))},[]),te=y.useCallback(Y=>{console.log("[MockGrackle] loadTasks",Y)},[]),J=y.useCallback((Y,ie,ue,je,_e,Fe,ye,Qe,Me)=>{console.log("[MockGrackle] createTask",{workspaceId:Y,title:ie,parentTaskId:_e}),_(Tt=>{const zt=Tt.filter(Xt=>Xt.workspaceId===Y).reduce((Xt,Ra)=>Math.max(Xt,Ra.sortOrder),0),Rt=_e?Tt.find(Xt=>Xt.id===_e):void 0;if(_e&&!Rt)return console.warn("[MockGrackle] Parent task not found:",_e),Tt;if(Rt&&!Rt.canDecompose)return console.warn("[MockGrackle] Parent task does not have decomposition rights:",_e),Tt;const ht=Rt?Rt.depth+1:0,zn={id:ae("task"),workspaceId:Y,title:ie,description:ue||"",status:"not_started",branch:"",latestSessionId:"",dependsOn:je||[],reviewNotes:void 0,sortOrder:zt+1,createdAt:new Date().toISOString(),parentTaskId:_e||"",depth:ht,childTaskIds:[],canDecompose:ye??!_e,defaultPersonaId:Fe||"",workpad:""};return[...Tt,zn]}),Qe&&Qe()},[ae]),Ce=y.useCallback((Y,ie,ue,je)=>{var Tt;console.log("[MockGrackle] startTask",{taskId:Y});const _e=ne.current.find(Dt=>Dt.id===Y),Fe=(_e==null?void 0:_e.title)??"",ye=ae("sess"),Qe={id:ye,environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:Fe||Y,startedAt:new Date().toISOString()};c(Dt=>[...Dt,Qe]),_(Dt=>Dt.map(zt=>zt.id===Y?{...zt,status:"working",latestSessionId:ye,branch:`mock/${Y.slice(0,8)}`}:zt));const Me=O();if(console.log(`[MockGrackle] Playing task scenario: ${Me.label}`),Me.pauseForInput){const Dt=Me.pauseAfterStep??Me.steps.length-1,zt=Me.steps.slice(0,Dt+1),Rt=zt.length>0?zt[zt.length-1].delayMs:0;if(De(ye,zt),G(()=>{oe(ye,"idle"),le({sessionId:ye,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},Rt+ly,ye),Me.resumeSteps){const ht=[...Me.resumeSteps];re.current.set(ye,ht);const zn=ht.reduce((Xt,Ra)=>Math.max(Xt,Ra.delayMs),0);$.current.set(ye,{taskId:Y,delayAfterResume:zn+200})}}else{const Dt=Me.steps.length>0?Me.steps[Me.steps.length-1].delayMs:0;De(ye,Me.steps);const zt=(Tt=Me.steps[Me.steps.length-1])==null?void 0:Tt.event.content;G(()=>{zt==="completed"?_(Rt=>Rt.map(ht=>ht.id===Y&&ht.status==="working"?{...ht,status:"paused"}:ht)):zt==="failed"&&_(Rt=>Rt.map(ht=>ht.id===Y&&ht.status==="working"?{...ht,status:"failed"}:ht))},Dt+100,ye)}},[ae,O,De,G,oe,le]),rn=y.useCallback((Y,ie)=>{console.log("[MockGrackle] sendInput",{sessionId:Y,text:ie}),le({sessionId:Y,eventType:"output",timestamp:new Date().toISOString(),content:`User input: ${ie}`}),oe(Y,"running"),le({sessionId:Y,eventType:"status",timestamp:new Date().toISOString(),content:"running"});const ue=re.current.get(Y);if(ue)re.current.delete(Y),De(Y,ue);else{const _e=[{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"}}];De(Y,_e)}const je=$.current.get(Y);je&&($.current.delete(Y),G(()=>{_(_e=>_e.map(Fe=>Fe.id===je.taskId&&Fe.status==="working"?{...Fe,status:"paused"}:Fe))},je.delayAfterResume,Y))},[le,oe,De,G]),Ue=y.useCallback(Y=>{console.log("[MockGrackle] completeTask",Y),_(ie=>ie.map(ue=>ue.id===Y?{...ue,status:"complete"}:ue))},[]),qn=y.useCallback(Y=>{console.log("[MockGrackle] resumeTask",Y)},[]),$n=y.useCallback((Y,ie,ue,je,_e)=>{console.log("[MockGrackle] updateTask",{taskId:Y,title:ie}),_(Fe=>Fe.map(ye=>ye.id===Y?{...ye,title:ie.trim()||ye.title,description:ue,dependsOn:je,..._e!==void 0?{defaultPersonaId:_e}:{}}:ye))},[]),In=y.useCallback(Y=>{console.log("[MockGrackle] deleteTask",Y),_(ie=>ie.filter(ue=>ue.id!==Y))},[]),Kn=y.useCallback(Y=>{console.log("[MockGrackle] loadFindings",Y),T(iy.filter(ie=>ie.workspaceId===Y))},[]),xn=y.useCallback((Y,ie,ue,je,_e)=>{console.log("[MockGrackle] postFinding",{workspaceId:Y,title:ie});const Fe={id:ae("find"),workspaceId:Y,taskId:"",sessionId:"",category:je||"general",title:ie,content:ue,tags:_e||[],createdAt:new Date().toISOString()};T(ye=>[...ye,Fe])},[ae]),Da=y.useCallback(()=>{console.log("[MockGrackle] loadEnvironments")},[]),cn=y.useCallback((Y,ie,ue)=>{console.log("[MockGrackle] addEnvironment",{displayName:Y,adapterType:ie,adapterConfig:ue})},[]),Ee=y.useCallback((Y,ie)=>{console.log("[MockGrackle] updateEnvironment",{environmentId:Y,...ie}),i(ue=>ue.map(je=>je.id!==Y?je:{...je,...ie.displayName!==void 0?{displayName:ie.displayName}:{},...ie.adapterConfig!==void 0?{adapterConfig:JSON.stringify(ie.adapterConfig)}:{}}))},[]),At=y.useCallback(()=>{console.log("[MockGrackle] loadTokens")},[]),Yt=y.useCallback((Y,ie,ue,je,_e)=>{console.log("[MockGrackle] setToken",{name:Y,tokenType:ue}),w(Fe=>[...Fe.filter(Qe=>Qe.name!==Y),{name:Y,tokenType:ue,envVar:je,filePath:_e,expiresAt:""}])},[]),kl=y.useCallback(Y=>{console.log("[MockGrackle] deleteToken",Y),w(ie=>ie.filter(ue=>ue.name!==Y))},[]),Ji=y.useCallback(Y=>{console.log("[MockGrackle] updateCredentialProviders",Y),E(Y)},[]);y.useEffect(()=>()=>{W.current.forEach(clearTimeout),W.current.clear()},[]);const jl=y.useMemo(()=>({connected:!0,send:()=>{},environments:a,sessions:l,events:u,eventsDropped:0,lastSpawnedId:p,workspaces:v,tasks:b,findings:S,tokens:C,credentialProviders:k,spawn:we,sendInput:rn,kill:Se,stopGraceful:Oe,refresh:ce,loadSessionEvents:me,clearEvents:fe,loadWorkspaces:()=>{console.log("[MockGrackle] loadWorkspaces")},createWorkspace:Ge,archiveWorkspace:Kt,updateWorkspace:(Y,ie)=>{console.log("[MockGrackle] updateWorkspace",{workspaceId:Y,...ie}),g(ue=>ue.map(je=>je.id!==Y?je:{...je,...ie.name!==void 0?{name:ie.name}:{},...ie.description!==void 0?{description:ie.description}:{},...ie.repoUrl!==void 0?{repoUrl:ie.repoUrl}:{},...ie.environmentId!==void 0?{environmentId:ie.environmentId}:{},...ie.workingDirectory!==void 0?{workingDirectory:ie.workingDirectory}:{},...ie.useWorktrees!==void 0?{useWorktrees:ie.useWorktrees}:{},...ie.defaultPersonaId!==void 0?{defaultPersonaId:ie.defaultPersonaId}:{},updatedAt:new Date().toISOString()}))},loadTasks:te,loadAllTasks:()=>{console.log("[MockGrackle] loadAllTasks")},createTask:J,startTask:Ce,stopTask:Y=>{console.log("[MockGrackle] stopTask",{taskId:Y}),Ue(Y)},completeTask:Ue,resumeTask:qn,updateTask:$n,deleteTask:In,loadFindings:Kn,postFinding:xn,loadEnvironments:Da,addEnvironment:cn,updateEnvironment:Ee,loadTokens:At,setToken:Yt,deleteToken:kl,updateCredentialProviders:Ji,provisionStatus:{},provisionEnvironment:(Y,ie)=>{},stopEnvironment:()=>{},removeEnvironment:()=>{},codespaces:[],codespaceError:"",codespaceListError:"",codespaceCreating:!1,listCodespaces:()=>{},createCodespace:()=>{},workspaceCreating:!1,taskStartingId:void 0,personas:A,createPersona:async(Y,ie,ue,je,_e,Fe,ye,Qe,Me)=>{console.log("[MockGrackle] createPersona",{name:Y});const Tt={id:`mock-persona-${Date.now()}`,name:Y,description:ie,systemPrompt:ue,toolConfig:"{}",runtime:je??"claude-code",model:_e||"",maxTurns:Fe||0,mcpServers:"[]",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),type:ye||"agent",script:Qe||"",allowedMcpTools:Me||[]};return R(Dt=>[...Dt,Tt]),Tt},updatePersona:async(Y,ie,ue,je,_e,Fe,ye,Qe,Me,Tt)=>{console.log("[MockGrackle] updatePersona",{personaId:Y,name:ie});const Dt=A.find(ht=>ht.id===Y);if(!Dt)throw new Error(`Persona not found: ${Y}`);const zt=new Date().toISOString(),Rt={...Dt,...ie!==void 0?{name:ie}:{},...ue!==void 0?{description:ue}:{},...je!==void 0?{systemPrompt:je}:{},..._e!==void 0?{runtime:_e}:{},...Fe!==void 0?{model:Fe}:{},...ye!==void 0?{maxTurns:ye}:{},...Qe!==void 0?{type:Qe}:{},...Me!==void 0?{script:Me}:{},...Tt!==void 0?{allowedMcpTools:Tt}:{},updatedAt:zt};return R(ht=>ht.map(zn=>zn.id===Y?Rt:zn)),Rt},deletePersona:async Y=>{console.log("[MockGrackle] deletePersona",Y),R(ie=>ie.filter(ue=>ue.id!==Y))},taskSessions:N,loadTaskSessions:Y=>{console.log("[MockGrackle] loadTaskSessions",Y)},appDefaultPersonaId:z,setAppDefaultPersonaId:async Y=>{console.log("[MockGrackle] setAppDefaultPersonaId",Y),H(Y)},onboardingCompleted:!0,completeOnboarding:()=>{console.log("[MockGrackle] completeOnboarding")},usageCache:{"workspace:proj-alpha":{inputTokens:214500,outputTokens:44850,costUsd:1.12,sessionCount:4},"workspace:proj-beta":{inputTokens:86700,outputTokens:23800,costUsd:.48,sessionCount:3},"task:task-001":{inputTokens:126800,outputTokens:20850,costUsd:.63,sessionCount:2},"task:task-006":{inputTokens:18900,outputTokens:4500,costUsd:.1,sessionCount:1},"task_tree:task-001":{inputTokens:126800,outputTokens:20850,costUsd:.63,sessionCount:2},"task_tree:task-006":{inputTokens:18900,outputTokens:4500,costUsd:.1,sessionCount:1}},loadUsage:(Y,ie)=>{console.log(`[MockGrackle] loadUsage(${Y}, ${ie})`)},knowledge:{graphData:{nodes:[],links:[]},selectedNode:void 0,loading:!1,selectedId:void 0,searchQuery:"",search:()=>{},clearSearch:()=>{},selectNode:()=>{},clearSelection:()=>{},expandNode:()=>{},loadRecent:()=>{},handleEvent:()=>!1}}),[a,l,u,p,v,b,S,C,k,A,N,z,we,rn,Se,Oe,ce,me,fe,Ge,Kt,te,J,Ce,Ue,qn,$n,In,Kn,xn,Da,cn,Ee,At,Yt,kl,Ji]);return r.jsx(nh.Provider,{value:jl,children:n})}const yb=y.createContext(void 0),zj=4e3;function Uj({children:n}){const[a,i]=y.useState([]),l=y.useRef(0),c=y.useCallback(f=>{i(p=>p.filter(m=>m.id!==f))},[]),u=y.useCallback((f,p="info",m=zj)=>{const v=`toast-${++l.current}`;i(g=>[...g,{id:v,message:f,variant:p,duration:m}])},[]);return r.jsx(yb.Provider,{value:{toasts:a,showToast:u,dismissToast:c},children:n})}function Aa(){const n=y.useContext(yb);if(!n)throw new Error("useToast must be used within ToastProvider");return n}const xc=[{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"]}],bb=new Set(xc.map(n=>n.id)),ry="grackle";function Sf(n){return xc.find(a=>a.id===n)}const Tf="grackle-theme",_b="grackle-prefer-system",xb="(prefers-color-scheme: dark)";let Jo=[],ec;function Qd(){ec=void 0;for(const n of Jo)n()}function kf(){return typeof window>"u"?!1:window.matchMedia(xb).matches}function sl(){if(typeof localStorage>"u")return ry;try{const n=localStorage.getItem(Tf);if(n!==null&&bb.has(n))return n}catch{}return ry}function oc(){if(typeof localStorage>"u")return!1;try{return localStorage.getItem(_b)==="true"}catch{return!1}}function jf(n){return xc.find(a=>a.variantLightId===n||a.variantDarkId===n)}function Sb(n,a){const i=Sf(n);if(i!=null&&i.variantDarkId)return a&&i.variantLightId?kf()?i.variantDarkId:i.variantLightId:i.variantDarkId;if(i!=null&&i.hidden&&a){const l=jf(n);if(l!=null&&l.variantLightId&&l.variantDarkId)return kf()?l.variantDarkId:l.variantLightId}return n}function Oi(n,a,i=!1){i&&document.documentElement.classList.add("no-transitions"),document.documentElement.dataset.theme=Sb(n,a),i&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove("no-transitions")}))}typeof document<"u"&&Oi(sl(),oc());function Vj(){return ec===void 0&&(ec={themeId:sl(),systemDark:kf(),preferSystem:oc()}),ec}function Hj(n){return Jo=[...Jo,n],()=>{Jo=Jo.filter(a=>a!==n)}}function Pj(){const n=y.useSyncExternalStore(Hj,Vj),{themeId:a,preferSystem:i}=n,l=Sb(a,i),c=y.useCallback(f=>{if(bb.has(f)){try{localStorage.setItem(Tf,f)}catch{}Oi(f,oc(),!0),Qd()}},[]),u=y.useCallback(f=>{try{localStorage.setItem(_b,f?"true":"false")}catch{}if(f){const p=sl(),m=Sf(p);if(m!=null&&m.hidden){const v=jf(p);if(v)try{localStorage.setItem(Tf,v.id)}catch{}}}Oi(sl(),f,!0),Qd()},[]);return y.useEffect(()=>{Oi(a,i)},[a,i]),y.useEffect(()=>{if(typeof window>"u")return;const f=window.matchMedia(xb),p=()=>{const m=sl(),v=oc();if(v){const g=Sf(m);if(g!=null&&g.variantDarkId&&g.variantLightId&&Oi(m,v),g!=null&&g.hidden){const b=jf(m);b!=null&&b.variantDarkId&&b.variantLightId&&Oi(m,v)}}Qd()};return f.addEventListener("change",p),()=>{f.removeEventListener("change",p)}},[]),{themeId:a,setTheme:c,resolvedThemeId:l,preferSystem:i,setPreferSystem:u}}const Tb=y.createContext(void 0);function Gj({children:n}){const a=Pj();return r.jsx(Tb.Provider,{value:a,children:n})}function kb(){const n=y.useContext(Tb);if(!n)throw new Error("useThemeContext must be used within ThemeProvider");return n}const qj="_container_1mq5u_1",$j="_hamburger_1mq5u_33",Kj="_brand_1mq5u_49",Yj="_brandLogo_1mq5u_68",Fj="_info_1mq5u_75",Zj="_connectionLabel_1mq5u_90",Xj="_connectionDot_1mq5u_103",Qj="_connected_1mq5u_106",Wj="_disconnected_1mq5u_110",xa={container:qj,hamburger:$j,brand:Kj,brandLogo:Yj,info:Fj,connectionLabel:Zj,connectionDot:Xj,connected:Qj,disconnected:Wj};function Jj({connected:n,environments:a,sessions:i,onToggleSidebar:l,sidebarOpen:c}){const u=bt(),f=a.length,p=a.filter(v=>v.status==="connected").length,m=i.filter(v=>["running","idle"].includes(v.status)).length;return r.jsxs("div",{className:xa.container,children:[l&&r.jsx("button",{type:"button",className:xa.hamburger,onClick:l,"aria-label":"Toggle sidebar","aria-expanded":c,children:"☰"}),r.jsxs("button",{type:"button",className:xa.brand,onClick:()=>u(Hs),title:"Home",children:[r.jsx("img",{src:"/icon-192x192.png",alt:"",className:xa.brandLogo,"aria-hidden":"true","data-testid":"statusbar-logo"}),"Grackle"]}),r.jsxs("div",{className:xa.info,children:[r.jsxs("span",{"aria-label":n?"Connected":"Disconnected",children:[r.jsx("span",{className:`${xa.connectionDot} ${n?xa.connected:xa.disconnected}`,"aria-hidden":"true",children:"●"})," ",r.jsx("span",{className:xa.connectionLabel,"aria-hidden":"true",children:n?"Connected":"Disconnected"})]}),r.jsxs("span",{children:[p,"/",f," env",f!==1?"s":""]}),r.jsxs("span",{children:[m," active"]})]})]})}const ew="_nav_13gkc_1",tw="_tab_13gkc_35",nw="_tabIcon_13gkc_68",aw="_tabLabel_13gkc_79",sw="_tabActive_13gkc_84",Zo={nav:ew,tab:tw,tabIcon:nw,tabLabel:aw,tabActive:sw},As=[{view:"dashboard",label:"Dashboard",icon:"🏠",route:Hs,testId:"sidebar-tab-dashboard"},{view:"chat",label:"Chat",icon:"💬",route:nj,testId:"sidebar-tab-chat"},{view:"tasks",label:"Tasks",icon:"📋",route:aj,testId:"sidebar-tab-tasks"},{view:"environments",label:"Environments",icon:"🖥️",route:Gi,testId:"sidebar-tab-environments"},{view:"knowledge",label:"Knowledge",icon:"🧠",route:gb,testId:"sidebar-tab-knowledge"},{view:"settings",label:"Settings",icon:"⚙️",route:Wk,testId:"sidebar-tab-settings"}];function iw(n){return n===Hs||n==="/"?"dashboard":n.startsWith("/chat")||n.startsWith("/sessions")?"chat":n.startsWith("/workspaces")||n.startsWith("/environments")?"environments":n.startsWith(gb)?"knowledge":n.startsWith(Hi)?"settings":"tasks"}function ow(){const n=Bt(),a=bt(),i=y.useRef(null),l=iw(n.pathname),c=y.useCallback(f=>{a(f.route)},[a]),u=y.useCallback(f=>{var b,_;const p=(b=i.current)==null?void 0:b.querySelectorAll('[role="tab"]');if(!p)return;const m=Array.from(p).findIndex(S=>S===document.activeElement),v=m>=0?m:As.findIndex(S=>S.view===l);let g=v;if(f.key==="ArrowRight"||f.key==="j"||f.key==="J")f.preventDefault(),g=(v+1)%As.length;else if(f.key==="ArrowLeft"||f.key==="k"||f.key==="K")f.preventDefault(),g=(v-1+As.length)%As.length;else if(f.key==="Home")f.preventDefault(),g=0;else if(f.key==="End")f.preventDefault(),g=As.length-1;else return;a(As[g].route),(_=p[g])==null||_.focus()},[l,a]);return r.jsx("nav",{className:Zo.nav,ref:i,role:"tablist","aria-orientation":"horizontal","aria-label":"App navigation",onKeyDown:u,"data-testid":"sidebar-nav",children:As.map(f=>{const p=f.view===l;return r.jsxs("button",{role:"tab",type:"button","aria-selected":p,tabIndex:p?0:-1,className:`${Zo.tab} ${p?Zo.tabActive:""}`,onClick:()=>c(f),"data-testid":f.testId,title:f.label,"aria-label":f.label,children:[r.jsx("span",{className:Zo.tabIcon,"aria-hidden":"true",children:f.icon}),r.jsx("span",{className:Zo.tabLabel,children:f.label})]},f.view)})})}const jb=y.createContext(void 0),wb=y.createContext(void 0);function lw({children:n}){const[a,i]=y.useState(void 0),l=y.useCallback(c=>{i(c)},[]);return r.jsx(wb.Provider,{value:l,children:r.jsx(jb.Provider,{value:a,children:n})})}function Cb(){return y.useContext(jb)}function rw(){const n=y.useContext(wb);if(n===void 0)throw new Error("useSidebarSetter must be used within a SidebarProvider");return n}const cw="_container_pi6ii_1",uw="_content_pi6ii_66",cy={container:cw,content:uw},dw=320,Nb=220,Eb=600,Ab="grackle-sidebar-width";function fw(){try{const n=localStorage.getItem(Ab);if(n!==null){const a=Number(n);if(Number.isFinite(a)&&a>=Nb&&a<=Eb)return a}}catch{}return dw}function hw(n){try{localStorage.setItem(Ab,String(n))}catch{}}function pw(){const[n]=y.useState(fw),a=y.useRef(null),i=Cb();if(y.useEffect(()=>{const l=a.current;if(!l)return;const c=new ResizeObserver(u=>{for(const f of u){const p=f.borderBoxSize[0];if(p){const m=Math.round(p.inlineSize);m>=Nb&&m<=Eb&&hw(m)}}});return c.observe(l),()=>{c.disconnect()}},[]),i!==void 0)return r.jsx("div",{className:cy.container,ref:a,"data-testid":"sidebar",style:{width:n},children:r.jsx("div",{className:cy.content,children:i})})}function Sc(n){const a=rw();y.useLayoutEffect(()=>(a(n),()=>{a(void 0)}),[n,a])}const ah=y.createContext({});function sh(n){const a=y.useRef(null);return a.current===null&&(a.current=n()),a.current}const Tc=y.createContext(null),ih=y.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"});class mw extends y.Component{getSnapshotBeforeUpdate(a){const i=this.props.childRef.current;if(i&&a.isPresent&&!this.props.isPresent){const l=this.props.sizeRef.current;l.height=i.offsetHeight||0,l.width=i.offsetWidth||0,l.top=i.offsetTop,l.left=i.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function vw({children:n,isPresent:a}){const i=y.useId(),l=y.useRef(null),c=y.useRef({width:0,height:0,top:0,left:0}),{nonce:u}=y.useContext(ih);return y.useInsertionEffect(()=>{const{width:f,height:p,top:m,left:v}=c.current;if(a||!l.current||!f||!p)return;l.current.dataset.motionPopId=i;const g=document.createElement("style");return u&&(g.nonce=u),document.head.appendChild(g),g.sheet&&g.sheet.insertRule(`
91
+ [data-motion-pop-id="${i}"] {
92
+ position: absolute !important;
93
+ width: ${f}px !important;
94
+ height: ${p}px !important;
95
+ top: ${m}px !important;
96
+ left: ${v}px !important;
97
+ }
98
+ `),()=>{document.head.removeChild(g)}},[a]),r.jsx(mw,{isPresent:a,childRef:l,sizeRef:c,children:y.cloneElement(n,{ref:l})})}const gw=({children:n,initial:a,isPresent:i,onExitComplete:l,custom:c,presenceAffectsLayout:u,mode:f})=>{const p=sh(yw),m=y.useId(),v=y.useCallback(b=>{p.set(b,!0);for(const _ of p.values())if(!_)return;l&&l()},[p,l]),g=y.useMemo(()=>({id:m,initial:a,isPresent:i,custom:c,onExitComplete:v,register:b=>(p.set(b,!1),()=>p.delete(b))}),u?[Math.random(),v]:[i,v]);return y.useMemo(()=>{p.forEach((b,_)=>p.set(_,!1))},[i]),y.useEffect(()=>{!i&&!p.size&&l&&l()},[i]),f==="popLayout"&&(n=r.jsx(vw,{isPresent:i,children:n})),r.jsx(Tc.Provider,{value:g,children:n})};function yw(){return new Map}function Db(n=!0){const a=y.useContext(Tc);if(a===null)return[!0,null];const{isPresent:i,onExitComplete:l,register:c}=a,u=y.useId();y.useEffect(()=>{n&&c(u)},[n]);const f=y.useCallback(()=>n&&l&&l(u),[u,l,n]);return!i&&l?[!1,f]:[!0]}const Gr=n=>n.key||"";function uy(n){const a=[];return y.Children.forEach(n,i=>{y.isValidElement(i)&&a.push(i)}),a}const oh=typeof window<"u",Rb=oh?y.useLayoutEffect:y.useEffect,na=({children:n,custom:a,initial:i=!0,onExitComplete:l,presenceAffectsLayout:c=!0,mode:u="sync",propagate:f=!1})=>{const[p,m]=Db(f),v=y.useMemo(()=>uy(n),[n]),g=f&&!p?[]:v.map(Gr),b=y.useRef(!0),_=y.useRef(v),S=sh(()=>new Map),[T,C]=y.useState(v),[w,k]=y.useState(v);Rb(()=>{b.current=!1,_.current=v;for(let R=0;R<w.length;R++){const N=Gr(w[R]);g.includes(N)?S.delete(N):S.get(N)!==!0&&S.set(N,!1)}},[w,g.length,g.join("-")]);const E=[];if(v!==T){let R=[...v];for(let N=0;N<w.length;N++){const z=w[N],H=Gr(z);g.includes(H)||(R.splice(N,0,z),E.push(z))}u==="wait"&&E.length&&(R=E),k(uy(R)),C(v);return}const{forceRender:A}=y.useContext(ah);return r.jsx(r.Fragment,{children:w.map(R=>{const N=Gr(R),z=f&&!p?!1:v===w||g.includes(N),H=()=>{if(S.has(N))S.set(N,!0);else return;let B=!0;S.forEach(K=>{K||(B=!1)}),B&&(A==null||A(),k(_.current),f&&(m==null||m()),l&&l())};return r.jsx(gw,{isPresent:z,initial:!b.current||i?void 0:!1,custom:z?void 0:a,presenceAffectsLayout:c,mode:u,onExitComplete:z?void 0:H,children:R},N)})})},yn=n=>n;let Mb=yn;const bw={useManualTiming:!1};function _w(n){let a=new Set,i=new Set,l=!1,c=!1;const u=new WeakSet;let f={delta:0,timestamp:0,isProcessing:!1};function p(v){u.has(v)&&(m.schedule(v),n()),v(f)}const m={schedule:(v,g=!1,b=!1)=>{const S=b&&l?a:i;return g&&u.add(v),S.has(v)||S.add(v),v},cancel:v=>{i.delete(v),u.delete(v)},process:v=>{if(f=v,l){c=!0;return}l=!0,[a,i]=[i,a],a.forEach(p),a.clear(),l=!1,c&&(c=!1,m.process(v))}};return m}const qr=["read","resolveKeyframes","update","preRender","render","postRender"],xw=40;function Ob(n,a){let i=!1,l=!0;const c={delta:0,timestamp:0,isProcessing:!1},u=()=>i=!0,f=qr.reduce((k,E)=>(k[E]=_w(u),k),{}),{read:p,resolveKeyframes:m,update:v,preRender:g,render:b,postRender:_}=f,S=()=>{const k=performance.now();i=!1,c.delta=l?1e3/60:Math.max(Math.min(k-c.timestamp,xw),1),c.timestamp=k,c.isProcessing=!0,p.process(c),m.process(c),v.process(c),g.process(c),b.process(c),_.process(c),c.isProcessing=!1,i&&a&&(l=!1,n(S))},T=()=>{i=!0,l=!0,c.isProcessing||n(S)};return{schedule:qr.reduce((k,E)=>{const A=f[E];return k[E]=(R,N=!1,z=!1)=>(i||T(),A.schedule(R,N,z)),k},{}),cancel:k=>{for(let E=0;E<qr.length;E++)f[qr[E]].cancel(k)},state:c,steps:f}}const{schedule:ct,cancel:ls,state:qt,steps:Wd}=Ob(typeof requestAnimationFrame<"u"?requestAnimationFrame:yn,!0),Bb=y.createContext({strict:!1}),dy={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"]},$i={};for(const n in dy)$i[n]={isEnabled:a=>dy[n].some(i=>!!a[i])};function Sw(n){for(const a in n)$i[a]={...$i[a],...n[a]}}const Tw=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 lc(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||Tw.has(n)}let Lb=n=>!lc(n);function kw(n){n&&(Lb=a=>a.startsWith("on")?!lc(a):n(a))}try{kw(require("@emotion/is-prop-valid").default)}catch{}function jw(n,a,i){const l={};for(const c in n)c==="values"&&typeof n.values=="object"||(Lb(c)||i===!0&&lc(c)||!a&&!lc(c)||n.draggable&&c.startsWith("onDrag"))&&(l[c]=n[c]);return l}function ww(n){if(typeof Proxy>"u")return n;const a=new Map,i=(...l)=>n(...l);return new Proxy(i,{get:(l,c)=>c==="create"?n:(a.has(c)||a.set(c,n(c)),a.get(c))})}const kc=y.createContext({});function fl(n){return typeof n=="string"||Array.isArray(n)}function jc(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}const lh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],rh=["initial",...lh];function wc(n){return jc(n.animate)||rh.some(a=>fl(n[a]))}function Ib(n){return!!(wc(n)||n.variants)}function Cw(n,a){if(wc(n)){const{initial:i,animate:l}=n;return{initial:i===!1||fl(i)?i:void 0,animate:fl(l)?l:void 0}}return n.inherit!==!1?a:{}}function Nw(n){const{initial:a,animate:i}=Cw(n,y.useContext(kc));return y.useMemo(()=>({initial:a,animate:i}),[fy(a),fy(i)])}function fy(n){return Array.isArray(n)?n.join(" "):n}const Ew=Symbol.for("motionComponentSymbol");function Bi(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function Aw(n,a,i){return y.useCallback(l=>{l&&n.onMount&&n.onMount(l),a&&(l?a.mount(l):a.unmount()),i&&(typeof i=="function"?i(l):Bi(i)&&(i.current=l))},[a])}const ch=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Dw="framerAppearId",zb="data-"+ch(Dw),{schedule:uh}=Ob(queueMicrotask,!1),Ub=y.createContext({});function Rw(n,a,i,l,c){var u,f;const{visualElement:p}=y.useContext(kc),m=y.useContext(Bb),v=y.useContext(Tc),g=y.useContext(ih).reducedMotion,b=y.useRef(null);l=l||m.renderer,!b.current&&l&&(b.current=l(n,{visualState:a,parent:p,props:i,presenceContext:v,blockInitialAnimation:v?v.initial===!1:!1,reducedMotionConfig:g}));const _=b.current,S=y.useContext(Ub);_&&!_.projection&&c&&(_.type==="html"||_.type==="svg")&&Mw(b.current,i,c,S);const T=y.useRef(!1);y.useInsertionEffect(()=>{_&&T.current&&_.update(i,v)});const C=i[zb],w=y.useRef(!!C&&!(!((u=window.MotionHandoffIsComplete)===null||u===void 0)&&u.call(window,C))&&((f=window.MotionHasOptimisedAnimation)===null||f===void 0?void 0:f.call(window,C)));return Rb(()=>{_&&(T.current=!0,window.MotionIsMounted=!0,_.updateFeatures(),uh.render(_.render),w.current&&_.animationState&&_.animationState.animateChanges())}),y.useEffect(()=>{_&&(!w.current&&_.animationState&&_.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var k;(k=window.MotionHandoffMarkAsComplete)===null||k===void 0||k.call(window,C)}),w.current=!1))}),_}function Mw(n,a,i,l){const{layoutId:c,layout:u,drag:f,dragConstraints:p,layoutScroll:m,layoutRoot:v}=a;n.projection=new i(n.latestValues,a["data-framer-portal-id"]?void 0:Vb(n.parent)),n.projection.setOptions({layoutId:c,layout:u,alwaysMeasureLayout:!!f||p&&Bi(p),visualElement:n,animationType:typeof u=="string"?u:"both",initialPromotionConfig:l,layoutScroll:m,layoutRoot:v})}function Vb(n){if(n)return n.options.allowProjection!==!1?n.projection:Vb(n.parent)}function Ow({preloadedFeatures:n,createVisualElement:a,useRender:i,useVisualState:l,Component:c}){var u,f;n&&Sw(n);function p(v,g){let b;const _={...y.useContext(ih),...v,layoutId:Bw(v)},{isStatic:S}=_,T=Nw(v),C=l(v,S);if(!S&&oh){Lw();const w=Iw(_);b=w.MeasureLayout,T.visualElement=Rw(c,C,_,a,w.ProjectionNode)}return r.jsxs(kc.Provider,{value:T,children:[b&&T.visualElement?r.jsx(b,{visualElement:T.visualElement,..._}):null,i(c,v,Aw(C,T.visualElement,g),C,S,T.visualElement)]})}p.displayName=`motion.${typeof c=="string"?c:`create(${(f=(u=c.displayName)!==null&&u!==void 0?u:c.name)!==null&&f!==void 0?f:""})`}`;const m=y.forwardRef(p);return m[Ew]=c,m}function Bw({layoutId:n}){const a=y.useContext(ah).id;return a&&n!==void 0?a+"-"+n:n}function Lw(n,a){y.useContext(Bb).strict}function Iw(n){const{drag:a,layout:i}=$i;if(!a&&!i)return{};const l={...a,...i};return{MeasureLayout:a!=null&&a.isEnabled(n)||i!=null&&i.isEnabled(n)?l.MeasureLayout:void 0,ProjectionNode:l.ProjectionNode}}const zw=["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 dh(n){return typeof n!="string"||n.includes("-")?!1:!!(zw.indexOf(n)>-1||/[A-Z]/u.test(n))}function hy(n){const a=[{},{}];return n==null||n.values.forEach((i,l)=>{a[0][l]=i.get(),a[1][l]=i.getVelocity()}),a}function fh(n,a,i,l){if(typeof a=="function"){const[c,u]=hy(l);a=a(i!==void 0?i:n.custom,c,u)}if(typeof a=="string"&&(a=n.variants&&n.variants[a]),typeof a=="function"){const[c,u]=hy(l);a=a(i!==void 0?i:n.custom,c,u)}return a}const wf=n=>Array.isArray(n),Uw=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),Vw=n=>wf(n)?n[n.length-1]||0:n,Zt=n=>!!(n&&n.getVelocity);function tc(n){const a=Zt(n)?n.get():n;return Uw(a)?a.toValue():a}function Hw({scrapeMotionValuesFromProps:n,createRenderState:a,onUpdate:i},l,c,u){const f={latestValues:Pw(l,c,u,n),renderState:a()};return i&&(f.onMount=p=>i({props:l,current:p,...f}),f.onUpdate=p=>i(p)),f}const Hb=n=>(a,i)=>{const l=y.useContext(kc),c=y.useContext(Tc),u=()=>Hw(n,a,l,c);return i?u():sh(u)};function Pw(n,a,i,l){const c={},u=l(n,{});for(const _ in u)c[_]=tc(u[_]);let{initial:f,animate:p}=n;const m=wc(n),v=Ib(n);a&&v&&!m&&n.inherit!==!1&&(f===void 0&&(f=a.initial),p===void 0&&(p=a.animate));let g=i?i.initial===!1:!1;g=g||f===!1;const b=g?p:f;if(b&&typeof b!="boolean"&&!jc(b)){const _=Array.isArray(b)?b:[b];for(let S=0;S<_.length;S++){const T=fh(n,_[S]);if(T){const{transitionEnd:C,transition:w,...k}=T;for(const E in k){let A=k[E];if(Array.isArray(A)){const R=g?A.length-1:0;A=A[R]}A!==null&&(c[E]=A)}for(const E in C)c[E]=C[E]}}}return c}const Qi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ys=new Set(Qi),Pb=n=>a=>typeof a=="string"&&a.startsWith(n),Gb=Pb("--"),Gw=Pb("var(--"),hh=n=>Gw(n)?qw.test(n.split("/*")[0].trim()):!1,qw=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,qb=(n,a)=>a&&typeof n=="number"?a.transform(n):n,Ea=(n,a,i)=>i>a?a:i<n?n:i,Wi={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},hl={...Wi,transform:n=>Ea(0,1,n)},$r={...Wi,default:1},_l=n=>({test:a=>typeof a=="string"&&a.endsWith(n)&&a.split(" ").length===1,parse:parseFloat,transform:a=>`${a}${n}`}),os=_l("deg"),Jn=_l("%"),xe=_l("px"),$w=_l("vh"),Kw=_l("vw"),py={...Jn,parse:n=>Jn.parse(n)/100,transform:n=>Jn.transform(n*100)},Yw={borderWidth:xe,borderTopWidth:xe,borderRightWidth:xe,borderBottomWidth:xe,borderLeftWidth:xe,borderRadius:xe,radius:xe,borderTopLeftRadius:xe,borderTopRightRadius:xe,borderBottomRightRadius:xe,borderBottomLeftRadius:xe,width:xe,maxWidth:xe,height:xe,maxHeight:xe,top:xe,right:xe,bottom:xe,left:xe,padding:xe,paddingTop:xe,paddingRight:xe,paddingBottom:xe,paddingLeft:xe,margin:xe,marginTop:xe,marginRight:xe,marginBottom:xe,marginLeft:xe,backgroundPositionX:xe,backgroundPositionY:xe},Fw={rotate:os,rotateX:os,rotateY:os,rotateZ:os,scale:$r,scaleX:$r,scaleY:$r,scaleZ:$r,skew:os,skewX:os,skewY:os,distance:xe,translateX:xe,translateY:xe,translateZ:xe,x:xe,y:xe,z:xe,perspective:xe,transformPerspective:xe,opacity:hl,originX:py,originY:py,originZ:xe},my={...Wi,transform:Math.round},ph={...Yw,...Fw,zIndex:my,size:xe,fillOpacity:hl,strokeOpacity:hl,numOctaves:my},Zw={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Xw=Qi.length;function Qw(n,a,i){let l="",c=!0;for(let u=0;u<Xw;u++){const f=Qi[u],p=n[f];if(p===void 0)continue;let m=!0;if(typeof p=="number"?m=p===(f.startsWith("scale")?1:0):m=parseFloat(p)===0,!m||i){const v=qb(p,ph[f]);if(!m){c=!1;const g=Zw[f]||f;l+=`${g}(${v}) `}i&&(a[f]=v)}}return l=l.trim(),i?l=i(a,c?"":l):c&&(l="none"),l}function mh(n,a,i){const{style:l,vars:c,transformOrigin:u}=n;let f=!1,p=!1;for(const m in a){const v=a[m];if(Ys.has(m)){f=!0;continue}else if(Gb(m)){c[m]=v;continue}else{const g=qb(v,ph[m]);m.startsWith("origin")?(p=!0,u[m]=g):l[m]=g}}if(a.transform||(f||i?l.transform=Qw(a,n.transform,i):l.transform&&(l.transform="none")),p){const{originX:m="50%",originY:v="50%",originZ:g=0}=u;l.transformOrigin=`${m} ${v} ${g}`}}const Ww={offset:"stroke-dashoffset",array:"stroke-dasharray"},Jw={offset:"strokeDashoffset",array:"strokeDasharray"};function eC(n,a,i=1,l=0,c=!0){n.pathLength=1;const u=c?Ww:Jw;n[u.offset]=xe.transform(-l);const f=xe.transform(a),p=xe.transform(i);n[u.array]=`${f} ${p}`}function vy(n,a,i){return typeof n=="string"?n:xe.transform(a+i*n)}function tC(n,a,i){const l=vy(a,n.x,n.width),c=vy(i,n.y,n.height);return`${l} ${c}`}function vh(n,{attrX:a,attrY:i,attrScale:l,originX:c,originY:u,pathLength:f,pathSpacing:p=1,pathOffset:m=0,...v},g,b){if(mh(n,v,b),g){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:_,style:S,dimensions:T}=n;_.transform&&(T&&(S.transform=_.transform),delete _.transform),T&&(c!==void 0||u!==void 0||S.transform)&&(S.transformOrigin=tC(T,c!==void 0?c:.5,u!==void 0?u:.5)),a!==void 0&&(_.x=a),i!==void 0&&(_.y=i),l!==void 0&&(_.scale=l),f!==void 0&&eC(_,f,p,m,!1)}const gh=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),$b=()=>({...gh(),attrs:{}}),yh=n=>typeof n=="string"&&n.toLowerCase()==="svg";function Kb(n,{style:a,vars:i},l,c){Object.assign(n.style,a,c&&c.getProjectionStyles(l));for(const u in i)n.style.setProperty(u,i[u])}const Yb=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 Fb(n,a,i,l){Kb(n,a,void 0,l);for(const c in a.attrs)n.setAttribute(Yb.has(c)?c:ch(c),a.attrs[c])}const rc={};function nC(n){Object.assign(rc,n)}function Zb(n,{layout:a,layoutId:i}){return Ys.has(n)||n.startsWith("origin")||(a||i!==void 0)&&(!!rc[n]||n==="opacity")}function bh(n,a,i){var l;const{style:c}=n,u={};for(const f in c)(Zt(c[f])||a.style&&Zt(a.style[f])||Zb(f,n)||((l=i==null?void 0:i.getValue(f))===null||l===void 0?void 0:l.liveStyle)!==void 0)&&(u[f]=c[f]);return u}function Xb(n,a,i){const l=bh(n,a,i);for(const c in n)if(Zt(n[c])||Zt(a[c])){const u=Qi.indexOf(c)!==-1?"attr"+c.charAt(0).toUpperCase()+c.substring(1):c;l[u]=n[c]}return l}function aC(n,a){try{a.dimensions=typeof n.getBBox=="function"?n.getBBox():n.getBoundingClientRect()}catch{a.dimensions={x:0,y:0,width:0,height:0}}}const gy=["x","y","width","height","cx","cy","r"],sC={useVisualState:Hb({scrapeMotionValuesFromProps:Xb,createRenderState:$b,onUpdate:({props:n,prevProps:a,current:i,renderState:l,latestValues:c})=>{if(!i)return;let u=!!n.drag;if(!u){for(const p in c)if(Ys.has(p)){u=!0;break}}if(!u)return;let f=!a;if(a)for(let p=0;p<gy.length;p++){const m=gy[p];n[m]!==a[m]&&(f=!0)}f&&ct.read(()=>{aC(i,l),ct.render(()=>{vh(l,c,yh(i.tagName),n.transformTemplate),Fb(i,l)})})}})},iC={useVisualState:Hb({scrapeMotionValuesFromProps:bh,createRenderState:gh})};function Qb(n,a,i){for(const l in a)!Zt(a[l])&&!Zb(l,i)&&(n[l]=a[l])}function oC({transformTemplate:n},a){return y.useMemo(()=>{const i=gh();return mh(i,a,n),Object.assign({},i.vars,i.style)},[a])}function lC(n,a){const i=n.style||{},l={};return Qb(l,i,n),Object.assign(l,oC(n,a)),l}function rC(n,a){const i={},l=lC(n,a);return n.drag&&n.dragListener!==!1&&(i.draggable=!1,l.userSelect=l.WebkitUserSelect=l.WebkitTouchCallout="none",l.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(i.tabIndex=0),i.style=l,i}function cC(n,a,i,l){const c=y.useMemo(()=>{const u=$b();return vh(u,a,yh(l),n.transformTemplate),{...u.attrs,style:{...u.style}}},[a]);if(n.style){const u={};Qb(u,n.style,n),c.style={...u,...c.style}}return c}function uC(n=!1){return(i,l,c,{latestValues:u},f)=>{const m=(dh(i)?cC:rC)(l,u,f,i),v=jw(l,typeof i=="string",n),g=i!==y.Fragment?{...v,...m,ref:c}:{},{children:b}=l,_=y.useMemo(()=>Zt(b)?b.get():b,[b]);return y.createElement(i,{...g,children:_})}}function dC(n,a){return function(l,{forwardMotionProps:c}={forwardMotionProps:!1}){const f={...dh(l)?sC:iC,preloadedFeatures:n,useRender:uC(c),createVisualElement:a,Component:l};return Ow(f)}}function Wb(n,a){if(!Array.isArray(a))return!1;const i=a.length;if(i!==n.length)return!1;for(let l=0;l<i;l++)if(a[l]!==n[l])return!1;return!0}function Cc(n,a,i){const l=n.getProps();return fh(l,a,i!==void 0?i:l.custom,n)}function _h(n,a){return n?n[a]||n.default||n:void 0}const Jb=new Set(["width","height","top","left","right","bottom",...Qi]);let nc;function fC(){nc=void 0}const ea={now:()=>(nc===void 0&&ea.set(qt.isProcessing||bw.useManualTiming?qt.timestamp:performance.now()),nc),set:n=>{nc=n,queueMicrotask(fC)}};function xh(n,a){n.indexOf(a)===-1&&n.push(a)}function Sh(n,a){const i=n.indexOf(a);i>-1&&n.splice(i,1)}class Th{constructor(){this.subscriptions=[]}add(a){return xh(this.subscriptions,a),()=>Sh(this.subscriptions,a)}notify(a,i,l){const c=this.subscriptions.length;if(c)if(c===1)this.subscriptions[0](a,i,l);else for(let u=0;u<c;u++){const f=this.subscriptions[u];f&&f(a,i,l)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function e_(n,a){return a?n*(1e3/a):0}const yy=30,hC=n=>!isNaN(parseFloat(n));class pC{constructor(a,i={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(l,c=!0)=>{const u=ea.now();this.updatedAt!==u&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(l),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),c&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(a),this.owner=i.owner}setCurrent(a){this.current=a,this.updatedAt=ea.now(),this.canTrackVelocity===null&&a!==void 0&&(this.canTrackVelocity=hC(this.current))}setPrevFrameValue(a=this.current){this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt}onChange(a){return this.on("change",a)}on(a,i){this.events[a]||(this.events[a]=new Th);const l=this.events[a].add(i);return a==="change"?()=>{l(),ct.read(()=>{this.events.change.getSize()||this.stop()})}:l}clearListeners(){for(const a in this.events)this.events[a].clear()}attach(a,i){this.passiveEffect=a,this.stopPassiveEffect=i}set(a,i=!0){!i||!this.passiveEffect?this.updateAndNotify(a,i):this.passiveEffect(a,this.updateAndNotify)}setWithVelocity(a,i,l){this.set(i),this.prev=void 0,this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt-l}jump(a,i=!0){this.updateAndNotify(a),this.prev=a,this.prevUpdatedAt=this.prevFrameValue=void 0,i&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const a=ea.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||a-this.updatedAt>yy)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,yy);return e_(parseFloat(this.current)-parseFloat(this.prevFrameValue),i)}start(a){return this.stop(),new Promise(i=>{this.hasAnimated=!0,this.animation=a(i),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function pl(n,a){return new pC(n,a)}function mC(n,a,i){n.hasValue(a)?n.getValue(a).set(i):n.addValue(a,pl(i))}function vC(n,a){const i=Cc(n,a);let{transitionEnd:l={},transition:c={},...u}=i||{};u={...u,...l};for(const f in u){const p=Vw(u[f]);mC(n,f,p)}}function gC(n){return!!(Zt(n)&&n.add)}function Cf(n,a){const i=n.getValue("willChange");if(gC(i))return i.add(a)}function t_(n){return n.props[zb]}function kh(n){let a;return()=>(a===void 0&&(a=n()),a)}const yC=kh(()=>window.ScrollTimeline!==void 0);class bC{constructor(a){this.stop=()=>this.runAll("stop"),this.animations=a.filter(Boolean)}get finished(){return Promise.all(this.animations.map(a=>"finished"in a?a.finished:a))}getAll(a){return this.animations[0][a]}setAll(a,i){for(let l=0;l<this.animations.length;l++)this.animations[l][a]=i}attachTimeline(a,i){const l=this.animations.map(c=>{if(yC()&&c.attachTimeline)return c.attachTimeline(a);if(typeof i=="function")return i(c)});return()=>{l.forEach((c,u)=>{c&&c(),this.animations[u].stop()})}}get time(){return this.getAll("time")}set time(a){this.setAll("time",a)}get speed(){return this.getAll("speed")}set speed(a){this.setAll("speed",a)}get startTime(){return this.getAll("startTime")}get duration(){let a=0;for(let i=0;i<this.animations.length;i++)a=Math.max(a,this.animations[i].duration);return a}runAll(a){this.animations.forEach(i=>i[a]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class _C extends bC{then(a,i){return Promise.all(this.animations).then(a).catch(i)}}const ja=n=>n*1e3,wa=n=>n/1e3;function jh(n){return typeof n=="function"}function by(n,a){n.timeline=a,n.onfinish=null}const wh=n=>Array.isArray(n)&&typeof n[0]=="number",xC={linearEasing:void 0};function SC(n,a){const i=kh(n);return()=>{var l;return(l=xC[a])!==null&&l!==void 0?l:i()}}const cc=SC(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ki=(n,a,i)=>{const l=a-n;return l===0?1:(i-n)/l},n_=(n,a,i=10)=>{let l="";const c=Math.max(Math.round(a/i),2);for(let u=0;u<c;u++)l+=n(Ki(0,c-1,u))+", ";return`linear(${l.substring(0,l.length-2)})`};function a_(n){return!!(typeof n=="function"&&cc()||!n||typeof n=="string"&&(n in Nf||cc())||wh(n)||Array.isArray(n)&&n.every(a_))}const el=([n,a,i,l])=>`cubic-bezier(${n}, ${a}, ${i}, ${l})`,Nf={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:el([0,.65,.55,1]),circOut:el([.55,0,1,.45]),backIn:el([.31,.01,.66,-.59]),backOut:el([.33,1.53,.69,.99])};function s_(n,a){if(n)return typeof n=="function"&&cc()?n_(n,a):wh(n)?el(n):Array.isArray(n)?n.map(i=>s_(i,a)||Nf.easeOut):Nf[n]}const i_=(n,a,i)=>(((1-3*i+3*a)*n+(3*i-6*a))*n+3*a)*n,TC=1e-7,kC=12;function jC(n,a,i,l,c){let u,f,p=0;do f=a+(i-a)/2,u=i_(f,l,c)-n,u>0?i=f:a=f;while(Math.abs(u)>TC&&++p<kC);return f}function xl(n,a,i,l){if(n===a&&i===l)return yn;const c=u=>jC(u,0,1,n,i);return u=>u===0||u===1?u:i_(c(u),a,l)}const o_=n=>a=>a<=.5?n(2*a)/2:(2-n(2*(1-a)))/2,l_=n=>a=>1-n(1-a),r_=xl(.33,1.53,.69,.99),Ch=l_(r_),c_=o_(Ch),u_=n=>(n*=2)<1?.5*Ch(n):.5*(2-Math.pow(2,-10*(n-1))),Nh=n=>1-Math.sin(Math.acos(n)),d_=l_(Nh),f_=o_(Nh),h_=n=>/^0[^.\s]+$/u.test(n);function wC(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||h_(n):!0}const il=n=>Math.round(n*1e5)/1e5,Eh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function CC(n){return n==null}const NC=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ah=(n,a)=>i=>!!(typeof i=="string"&&NC.test(i)&&i.startsWith(n)||a&&!CC(i)&&Object.prototype.hasOwnProperty.call(i,a)),p_=(n,a,i)=>l=>{if(typeof l!="string")return l;const[c,u,f,p]=l.match(Eh);return{[n]:parseFloat(c),[a]:parseFloat(u),[i]:parseFloat(f),alpha:p!==void 0?parseFloat(p):1}},EC=n=>Ea(0,255,n),Jd={...Wi,transform:n=>Math.round(EC(n))},Is={test:Ah("rgb","red"),parse:p_("red","green","blue"),transform:({red:n,green:a,blue:i,alpha:l=1})=>"rgba("+Jd.transform(n)+", "+Jd.transform(a)+", "+Jd.transform(i)+", "+il(hl.transform(l))+")"};function AC(n){let a="",i="",l="",c="";return n.length>5?(a=n.substring(1,3),i=n.substring(3,5),l=n.substring(5,7),c=n.substring(7,9)):(a=n.substring(1,2),i=n.substring(2,3),l=n.substring(3,4),c=n.substring(4,5),a+=a,i+=i,l+=l,c+=c),{red:parseInt(a,16),green:parseInt(i,16),blue:parseInt(l,16),alpha:c?parseInt(c,16)/255:1}}const Ef={test:Ah("#"),parse:AC,transform:Is.transform},Li={test:Ah("hsl","hue"),parse:p_("hue","saturation","lightness"),transform:({hue:n,saturation:a,lightness:i,alpha:l=1})=>"hsla("+Math.round(n)+", "+Jn.transform(il(a))+", "+Jn.transform(il(i))+", "+il(hl.transform(l))+")"},Ft={test:n=>Is.test(n)||Ef.test(n)||Li.test(n),parse:n=>Is.test(n)?Is.parse(n):Li.test(n)?Li.parse(n):Ef.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?Is.transform(n):Li.transform(n)},DC=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function RC(n){var a,i;return isNaN(n)&&typeof n=="string"&&(((a=n.match(Eh))===null||a===void 0?void 0:a.length)||0)+(((i=n.match(DC))===null||i===void 0?void 0:i.length)||0)>0}const m_="number",v_="color",MC="var",OC="var(",_y="${}",BC=/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 ml(n){const a=n.toString(),i=[],l={color:[],number:[],var:[]},c=[];let u=0;const p=a.replace(BC,m=>(Ft.test(m)?(l.color.push(u),c.push(v_),i.push(Ft.parse(m))):m.startsWith(OC)?(l.var.push(u),c.push(MC),i.push(m)):(l.number.push(u),c.push(m_),i.push(parseFloat(m))),++u,_y)).split(_y);return{values:i,split:p,indexes:l,types:c}}function g_(n){return ml(n).values}function y_(n){const{split:a,types:i}=ml(n),l=a.length;return c=>{let u="";for(let f=0;f<l;f++)if(u+=a[f],c[f]!==void 0){const p=i[f];p===m_?u+=il(c[f]):p===v_?u+=Ft.transform(c[f]):u+=c[f]}return u}}const LC=n=>typeof n=="number"?0:n;function IC(n){const a=g_(n);return y_(n)(a.map(LC))}const rs={test:RC,parse:g_,createTransformer:y_,getAnimatableNone:IC},zC=new Set(["brightness","contrast","saturate","opacity"]);function UC(n){const[a,i]=n.slice(0,-1).split("(");if(a==="drop-shadow")return n;const[l]=i.match(Eh)||[];if(!l)return n;const c=i.replace(l,"");let u=zC.has(a)?1:0;return l!==i&&(u*=100),a+"("+u+c+")"}const VC=/\b([a-z-]*)\(.*?\)/gu,Af={...rs,getAnimatableNone:n=>{const a=n.match(VC);return a?a.map(UC).join(" "):n}},HC={...ph,color:Ft,backgroundColor:Ft,outlineColor:Ft,fill:Ft,stroke:Ft,borderColor:Ft,borderTopColor:Ft,borderRightColor:Ft,borderBottomColor:Ft,borderLeftColor:Ft,filter:Af,WebkitFilter:Af},Dh=n=>HC[n];function b_(n,a){let i=Dh(n);return i!==Af&&(i=rs),i.getAnimatableNone?i.getAnimatableNone(a):void 0}const PC=new Set(["auto","none","0"]);function GC(n,a,i){let l=0,c;for(;l<n.length&&!c;){const u=n[l];typeof u=="string"&&!PC.has(u)&&ml(u).values.length&&(c=n[l]),l++}if(c&&i)for(const u of a)n[u]=b_(i,c)}const xy=n=>n===Wi||n===xe,Sy=(n,a)=>parseFloat(n.split(", ")[a]),Ty=(n,a)=>(i,{transform:l})=>{if(l==="none"||!l)return 0;const c=l.match(/^matrix3d\((.+)\)$/u);if(c)return Sy(c[1],a);{const u=l.match(/^matrix\((.+)\)$/u);return u?Sy(u[1],n):0}},qC=new Set(["x","y","z"]),$C=Qi.filter(n=>!qC.has(n));function KC(n){const a=[];return $C.forEach(i=>{const l=n.getValue(i);l!==void 0&&(a.push([i,l.get()]),l.set(i.startsWith("scale")?1:0))}),a}const Yi={width:({x:n},{paddingLeft:a="0",paddingRight:i="0"})=>n.max-n.min-parseFloat(a)-parseFloat(i),height:({y:n},{paddingTop:a="0",paddingBottom:i="0"})=>n.max-n.min-parseFloat(a)-parseFloat(i),top:(n,{top:a})=>parseFloat(a),left:(n,{left:a})=>parseFloat(a),bottom:({y:n},{top:a})=>parseFloat(a)+(n.max-n.min),right:({x:n},{left:a})=>parseFloat(a)+(n.max-n.min),x:Ty(4,13),y:Ty(5,14)};Yi.translateX=Yi.x;Yi.translateY=Yi.y;const Vs=new Set;let Df=!1,Rf=!1;function __(){if(Rf){const n=Array.from(Vs).filter(l=>l.needsMeasurement),a=new Set(n.map(l=>l.element)),i=new Map;a.forEach(l=>{const c=KC(l);c.length&&(i.set(l,c),l.render())}),n.forEach(l=>l.measureInitialState()),a.forEach(l=>{l.render();const c=i.get(l);c&&c.forEach(([u,f])=>{var p;(p=l.getValue(u))===null||p===void 0||p.set(f)})}),n.forEach(l=>l.measureEndState()),n.forEach(l=>{l.suspendedScrollY!==void 0&&window.scrollTo(0,l.suspendedScrollY)})}Rf=!1,Df=!1,Vs.forEach(n=>n.complete()),Vs.clear()}function x_(){Vs.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(Rf=!0)})}function YC(){x_(),__()}class Rh{constructor(a,i,l,c,u,f=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...a],this.onComplete=i,this.name=l,this.motionValue=c,this.element=u,this.isAsync=f}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Vs.add(this),Df||(Df=!0,ct.read(x_),ct.resolveKeyframes(__))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:a,name:i,element:l,motionValue:c}=this;for(let u=0;u<a.length;u++)if(a[u]===null)if(u===0){const f=c==null?void 0:c.get(),p=a[a.length-1];if(f!==void 0)a[0]=f;else if(l&&i){const m=l.readValue(i,p);m!=null&&(a[0]=m)}a[0]===void 0&&(a[0]=p),c&&f===void 0&&c.set(a[0])}else a[u]=a[u-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Vs.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Vs.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const S_=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),FC=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ZC(n){const a=FC.exec(n);if(!a)return[,];const[,i,l,c]=a;return[`--${i??l}`,c]}function T_(n,a,i=1){const[l,c]=ZC(n);if(!l)return;const u=window.getComputedStyle(a).getPropertyValue(l);if(u){const f=u.trim();return S_(f)?parseFloat(f):f}return hh(c)?T_(c,a,i+1):c}const k_=n=>a=>a.test(n),XC={test:n=>n==="auto",parse:n=>n},j_=[Wi,xe,Jn,os,Kw,$w,XC],ky=n=>j_.find(k_(n));class w_ extends Rh{constructor(a,i,l,c,u){super(a,i,l,c,u,!0)}readKeyframes(){const{unresolvedKeyframes:a,element:i,name:l}=this;if(!i||!i.current)return;super.readKeyframes();for(let m=0;m<a.length;m++){let v=a[m];if(typeof v=="string"&&(v=v.trim(),hh(v))){const g=T_(v,i.current);g!==void 0&&(a[m]=g),m===a.length-1&&(this.finalKeyframe=v)}}if(this.resolveNoneKeyframes(),!Jb.has(l)||a.length!==2)return;const[c,u]=a,f=ky(c),p=ky(u);if(f!==p)if(xy(f)&&xy(p))for(let m=0;m<a.length;m++){const v=a[m];typeof v=="string"&&(a[m]=parseFloat(v))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:a,name:i}=this,l=[];for(let c=0;c<a.length;c++)wC(a[c])&&l.push(c);l.length&&GC(a,l,i)}measureInitialState(){const{element:a,unresolvedKeyframes:i,name:l}=this;if(!a||!a.current)return;l==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Yi[l](a.measureViewportBox(),window.getComputedStyle(a.current)),i[0]=this.measuredOrigin;const c=i[i.length-1];c!==void 0&&a.getValue(l,c).jump(c,!1)}measureEndState(){var a;const{element:i,name:l,unresolvedKeyframes:c}=this;if(!i||!i.current)return;const u=i.getValue(l);u&&u.jump(this.measuredOrigin,!1);const f=c.length-1,p=c[f];c[f]=Yi[l](i.measureViewportBox(),window.getComputedStyle(i.current)),p!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=p),!((a=this.removedTransforms)===null||a===void 0)&&a.length&&this.removedTransforms.forEach(([m,v])=>{i.getValue(m).set(v)}),this.resolveNoneKeyframes()}}const jy=(n,a)=>a==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(rs.test(n)||n==="0")&&!n.startsWith("url("));function QC(n){const a=n[0];if(n.length===1)return!0;for(let i=0;i<n.length;i++)if(n[i]!==a)return!0}function WC(n,a,i,l){const c=n[0];if(c===null)return!1;if(a==="display"||a==="visibility")return!0;const u=n[n.length-1],f=jy(c,a),p=jy(u,a);return!f||!p?!1:QC(n)||(i==="spring"||jh(i))&&l}const JC=n=>n!==null;function Nc(n,{repeat:a,repeatType:i="loop"},l){const c=n.filter(JC),u=a&&i!=="loop"&&a%2===1?0:c.length-1;return!u||l===void 0?c[u]:l}const eN=40;class C_{constructor({autoplay:a=!0,delay:i=0,type:l="keyframes",repeat:c=0,repeatDelay:u=0,repeatType:f="loop",...p}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=ea.now(),this.options={autoplay:a,delay:i,type:l,repeat:c,repeatDelay:u,repeatType:f,...p},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>eN?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&YC(),this._resolved}onKeyframesResolved(a,i){this.resolvedAt=ea.now(),this.hasAttemptedResolve=!0;const{name:l,type:c,velocity:u,delay:f,onComplete:p,onUpdate:m,isGenerator:v}=this.options;if(!v&&!WC(a,l,c,u))if(f)this.options.duration=0;else{m&&m(Nc(a,this.options,i)),p&&p(),this.resolveFinishedPromise();return}const g=this.initPlayback(a,i);g!==!1&&(this._resolved={keyframes:a,finalKeyframe:i,...g},this.onPostResolved())}onPostResolved(){}then(a,i){return this.currentFinishedPromise.then(a,i)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(a=>{this.resolveFinishedPromise=a})}}const Mf=2e4;function N_(n){let a=0;const i=50;let l=n.next(a);for(;!l.done&&a<Mf;)a+=i,l=n.next(a);return a>=Mf?1/0:a}const mt=(n,a,i)=>n+(a-n)*i;function ef(n,a,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?n+(a-n)*6*i:i<1/2?a:i<2/3?n+(a-n)*(2/3-i)*6:n}function tN({hue:n,saturation:a,lightness:i,alpha:l}){n/=360,a/=100,i/=100;let c=0,u=0,f=0;if(!a)c=u=f=i;else{const p=i<.5?i*(1+a):i+a-i*a,m=2*i-p;c=ef(m,p,n+1/3),u=ef(m,p,n),f=ef(m,p,n-1/3)}return{red:Math.round(c*255),green:Math.round(u*255),blue:Math.round(f*255),alpha:l}}function uc(n,a){return i=>i>0?a:n}const tf=(n,a,i)=>{const l=n*n,c=i*(a*a-l)+l;return c<0?0:Math.sqrt(c)},nN=[Ef,Is,Li],aN=n=>nN.find(a=>a.test(n));function wy(n){const a=aN(n);if(!a)return!1;let i=a.parse(n);return a===Li&&(i=tN(i)),i}const Cy=(n,a)=>{const i=wy(n),l=wy(a);if(!i||!l)return uc(n,a);const c={...i};return u=>(c.red=tf(i.red,l.red,u),c.green=tf(i.green,l.green,u),c.blue=tf(i.blue,l.blue,u),c.alpha=mt(i.alpha,l.alpha,u),Is.transform(c))},sN=(n,a)=>i=>a(n(i)),Sl=(...n)=>n.reduce(sN),Of=new Set(["none","hidden"]);function iN(n,a){return Of.has(n)?i=>i<=0?n:a:i=>i>=1?a:n}function oN(n,a){return i=>mt(n,a,i)}function Mh(n){return typeof n=="number"?oN:typeof n=="string"?hh(n)?uc:Ft.test(n)?Cy:cN:Array.isArray(n)?E_:typeof n=="object"?Ft.test(n)?Cy:lN:uc}function E_(n,a){const i=[...n],l=i.length,c=n.map((u,f)=>Mh(u)(u,a[f]));return u=>{for(let f=0;f<l;f++)i[f]=c[f](u);return i}}function lN(n,a){const i={...n,...a},l={};for(const c in i)n[c]!==void 0&&a[c]!==void 0&&(l[c]=Mh(n[c])(n[c],a[c]));return c=>{for(const u in l)i[u]=l[u](c);return i}}function rN(n,a){var i;const l=[],c={color:0,var:0,number:0};for(let u=0;u<a.values.length;u++){const f=a.types[u],p=n.indexes[f][c[f]],m=(i=n.values[p])!==null&&i!==void 0?i:0;l[u]=m,c[f]++}return l}const cN=(n,a)=>{const i=rs.createTransformer(a),l=ml(n),c=ml(a);return l.indexes.var.length===c.indexes.var.length&&l.indexes.color.length===c.indexes.color.length&&l.indexes.number.length>=c.indexes.number.length?Of.has(n)&&!c.values.length||Of.has(a)&&!l.values.length?iN(n,a):Sl(E_(rN(l,c),c.values),i):uc(n,a)};function A_(n,a,i){return typeof n=="number"&&typeof a=="number"&&typeof i=="number"?mt(n,a,i):Mh(n)(n,a)}const uN=5;function D_(n,a,i){const l=Math.max(a-uN,0);return e_(i-n(l),a-l)}const yt={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},nf=.001;function dN({duration:n=yt.duration,bounce:a=yt.bounce,velocity:i=yt.velocity,mass:l=yt.mass}){let c,u,f=1-a;f=Ea(yt.minDamping,yt.maxDamping,f),n=Ea(yt.minDuration,yt.maxDuration,wa(n)),f<1?(c=v=>{const g=v*f,b=g*n,_=g-i,S=Bf(v,f),T=Math.exp(-b);return nf-_/S*T},u=v=>{const b=v*f*n,_=b*i+i,S=Math.pow(f,2)*Math.pow(v,2)*n,T=Math.exp(-b),C=Bf(Math.pow(v,2),f);return(-c(v)+nf>0?-1:1)*((_-S)*T)/C}):(c=v=>{const g=Math.exp(-v*n),b=(v-i)*n+1;return-nf+g*b},u=v=>{const g=Math.exp(-v*n),b=(i-v)*(n*n);return g*b});const p=5/n,m=hN(c,u,p);if(n=ja(n),isNaN(m))return{stiffness:yt.stiffness,damping:yt.damping,duration:n};{const v=Math.pow(m,2)*l;return{stiffness:v,damping:f*2*Math.sqrt(l*v),duration:n}}}const fN=12;function hN(n,a,i){let l=i;for(let c=1;c<fN;c++)l=l-n(l)/a(l);return l}function Bf(n,a){return n*Math.sqrt(1-a*a)}const pN=["duration","bounce"],mN=["stiffness","damping","mass"];function Ny(n,a){return a.some(i=>n[i]!==void 0)}function vN(n){let a={velocity:yt.velocity,stiffness:yt.stiffness,damping:yt.damping,mass:yt.mass,isResolvedFromDuration:!1,...n};if(!Ny(n,mN)&&Ny(n,pN))if(n.visualDuration){const i=n.visualDuration,l=2*Math.PI/(i*1.2),c=l*l,u=2*Ea(.05,1,1-(n.bounce||0))*Math.sqrt(c);a={...a,mass:yt.mass,stiffness:c,damping:u}}else{const i=dN(n);a={...a,...i,mass:yt.mass},a.isResolvedFromDuration=!0}return a}function R_(n=yt.visualDuration,a=yt.bounce){const i=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:a}:n;let{restSpeed:l,restDelta:c}=i;const u=i.keyframes[0],f=i.keyframes[i.keyframes.length-1],p={done:!1,value:u},{stiffness:m,damping:v,mass:g,duration:b,velocity:_,isResolvedFromDuration:S}=vN({...i,velocity:-wa(i.velocity||0)}),T=_||0,C=v/(2*Math.sqrt(m*g)),w=f-u,k=wa(Math.sqrt(m/g)),E=Math.abs(w)<5;l||(l=E?yt.restSpeed.granular:yt.restSpeed.default),c||(c=E?yt.restDelta.granular:yt.restDelta.default);let A;if(C<1){const N=Bf(k,C);A=z=>{const H=Math.exp(-C*k*z);return f-H*((T+C*k*w)/N*Math.sin(N*z)+w*Math.cos(N*z))}}else if(C===1)A=N=>f-Math.exp(-k*N)*(w+(T+k*w)*N);else{const N=k*Math.sqrt(C*C-1);A=z=>{const H=Math.exp(-C*k*z),B=Math.min(N*z,300);return f-H*((T+C*k*w)*Math.sinh(B)+N*w*Math.cosh(B))/N}}const R={calculatedDuration:S&&b||null,next:N=>{const z=A(N);if(S)p.done=N>=b;else{let H=0;C<1&&(H=N===0?ja(T):D_(A,N,z));const B=Math.abs(H)<=l,K=Math.abs(f-z)<=c;p.done=B&&K}return p.value=p.done?f:z,p},toString:()=>{const N=Math.min(N_(R),Mf),z=n_(H=>R.next(N*H).value,N,30);return N+"ms "+z}};return R}function Ey({keyframes:n,velocity:a=0,power:i=.8,timeConstant:l=325,bounceDamping:c=10,bounceStiffness:u=500,modifyTarget:f,min:p,max:m,restDelta:v=.5,restSpeed:g}){const b=n[0],_={done:!1,value:b},S=B=>p!==void 0&&B<p||m!==void 0&&B>m,T=B=>p===void 0?m:m===void 0||Math.abs(p-B)<Math.abs(m-B)?p:m;let C=i*a;const w=b+C,k=f===void 0?w:f(w);k!==w&&(C=k-b);const E=B=>-C*Math.exp(-B/l),A=B=>k+E(B),R=B=>{const K=E(B),W=A(B);_.done=Math.abs(K)<=v,_.value=_.done?k:W};let N,z;const H=B=>{S(_.value)&&(N=B,z=R_({keyframes:[_.value,T(_.value)],velocity:D_(A,B,_.value),damping:c,stiffness:u,restDelta:v,restSpeed:g}))};return H(0),{calculatedDuration:null,next:B=>{let K=!1;return!z&&N===void 0&&(K=!0,R(B),H(B)),N!==void 0&&B>=N?z.next(B-N):(!K&&R(B),_)}}}const gN=xl(.42,0,1,1),yN=xl(0,0,.58,1),M_=xl(.42,0,.58,1),bN=n=>Array.isArray(n)&&typeof n[0]!="number",_N={linear:yn,easeIn:gN,easeInOut:M_,easeOut:yN,circIn:Nh,circInOut:f_,circOut:d_,backIn:Ch,backInOut:c_,backOut:r_,anticipate:u_},Ay=n=>{if(wh(n)){Mb(n.length===4);const[a,i,l,c]=n;return xl(a,i,l,c)}else if(typeof n=="string")return _N[n];return n};function xN(n,a,i){const l=[],c=i||A_,u=n.length-1;for(let f=0;f<u;f++){let p=c(n[f],n[f+1]);if(a){const m=Array.isArray(a)?a[f]||yn:a;p=Sl(m,p)}l.push(p)}return l}function SN(n,a,{clamp:i=!0,ease:l,mixer:c}={}){const u=n.length;if(Mb(u===a.length),u===1)return()=>a[0];if(u===2&&a[0]===a[1])return()=>a[1];const f=n[0]===n[1];n[0]>n[u-1]&&(n=[...n].reverse(),a=[...a].reverse());const p=xN(a,l,c),m=p.length,v=g=>{if(f&&g<n[0])return a[0];let b=0;if(m>1)for(;b<n.length-2&&!(g<n[b+1]);b++);const _=Ki(n[b],n[b+1],g);return p[b](_)};return i?g=>v(Ea(n[0],n[u-1],g)):v}function TN(n,a){const i=n[n.length-1];for(let l=1;l<=a;l++){const c=Ki(0,a,l);n.push(mt(i,1,c))}}function kN(n){const a=[0];return TN(a,n.length-1),a}function jN(n,a){return n.map(i=>i*a)}function wN(n,a){return n.map(()=>a||M_).splice(0,n.length-1)}function dc({duration:n=300,keyframes:a,times:i,ease:l="easeInOut"}){const c=bN(l)?l.map(Ay):Ay(l),u={done:!1,value:a[0]},f=jN(i&&i.length===a.length?i:kN(a),n),p=SN(f,a,{ease:Array.isArray(c)?c:wN(a,c)});return{calculatedDuration:n,next:m=>(u.value=p(m),u.done=m>=n,u)}}const CN=n=>{const a=({timestamp:i})=>n(i);return{start:()=>ct.update(a,!0),stop:()=>ls(a),now:()=>qt.isProcessing?qt.timestamp:ea.now()}},NN={decay:Ey,inertia:Ey,tween:dc,keyframes:dc,spring:R_},EN=n=>n/100;class Oh extends C_{constructor(a){super(a),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:m}=this.options;m&&m()};const{name:i,motionValue:l,element:c,keyframes:u}=this.options,f=(c==null?void 0:c.KeyframeResolver)||Rh,p=(m,v)=>this.onKeyframesResolved(m,v);this.resolver=new f(u,p,i,l,c),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(a){const{type:i="keyframes",repeat:l=0,repeatDelay:c=0,repeatType:u,velocity:f=0}=this.options,p=jh(i)?i:NN[i]||dc;let m,v;p!==dc&&typeof a[0]!="number"&&(m=Sl(EN,A_(a[0],a[1])),a=[0,100]);const g=p({...this.options,keyframes:a});u==="mirror"&&(v=p({...this.options,keyframes:[...a].reverse(),velocity:-f})),g.calculatedDuration===null&&(g.calculatedDuration=N_(g));const{calculatedDuration:b}=g,_=b+c,S=_*(l+1)-c;return{generator:g,mirroredGenerator:v,mapPercentToKeyframes:m,calculatedDuration:b,resolvedDuration:_,totalDuration:S}}onPostResolved(){const{autoplay:a=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!a?this.pause():this.state=this.pendingPlayState}tick(a,i=!1){const{resolved:l}=this;if(!l){const{keyframes:B}=this.options;return{done:!0,value:B[B.length-1]}}const{finalKeyframe:c,generator:u,mirroredGenerator:f,mapPercentToKeyframes:p,keyframes:m,calculatedDuration:v,totalDuration:g,resolvedDuration:b}=l;if(this.startTime===null)return u.next(0);const{delay:_,repeat:S,repeatType:T,repeatDelay:C,onUpdate:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,a):this.speed<0&&(this.startTime=Math.min(a-g/this.speed,this.startTime)),i?this.currentTime=a:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(a-this.startTime)*this.speed;const k=this.currentTime-_*(this.speed>=0?1:-1),E=this.speed>=0?k<0:k>g;this.currentTime=Math.max(k,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=g);let A=this.currentTime,R=u;if(S){const B=Math.min(this.currentTime,g)/b;let K=Math.floor(B),W=B%1;!W&&B>=1&&(W=1),W===1&&K--,K=Math.min(K,S+1),!!(K%2)&&(T==="reverse"?(W=1-W,C&&(W-=C/b)):T==="mirror"&&(R=f)),A=Ea(0,1,W)*b}const N=E?{done:!1,value:m[0]}:R.next(A);p&&(N.value=p(N.value));let{done:z}=N;!E&&v!==null&&(z=this.speed>=0?this.currentTime>=g:this.currentTime<=0);const H=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&z);return H&&c!==void 0&&(N.value=Nc(m,this.options,c)),w&&w(N.value),H&&this.finish(),N}get duration(){const{resolved:a}=this;return a?wa(a.calculatedDuration):0}get time(){return wa(this.currentTime)}set time(a){a=ja(a),this.currentTime=a,this.holdTime!==null||this.speed===0?this.holdTime=a:this.driver&&(this.startTime=this.driver.now()-a/this.speed)}get speed(){return this.playbackSpeed}set speed(a){const i=this.playbackSpeed!==a;this.playbackSpeed=a,i&&(this.time=wa(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:a=CN,onPlay:i,startTime:l}=this.options;this.driver||(this.driver=a(u=>this.tick(u))),i&&i();const c=this.driver.now();this.holdTime!==null?this.startTime=c-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=c):this.startTime=l??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var a;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(a=this.currentTime)!==null&&a!==void 0?a:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:a}=this.options;a&&a()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(a){return this.startTime=0,this.tick(a,!0)}}const AN=new Set(["opacity","clipPath","filter","transform"]);function DN(n,a,i,{delay:l=0,duration:c=300,repeat:u=0,repeatType:f="loop",ease:p="easeInOut",times:m}={}){const v={[a]:i};m&&(v.offset=m);const g=s_(p,c);return Array.isArray(g)&&(v.easing=g),n.animate(v,{delay:l,duration:c,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:u+1,direction:f==="reverse"?"alternate":"normal"})}const RN=kh(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),fc=10,MN=2e4;function ON(n){return jh(n.type)||n.type==="spring"||!a_(n.ease)}function BN(n,a){const i=new Oh({...a,keyframes:n,repeat:0,delay:0,isGenerator:!0});let l={done:!1,value:n[0]};const c=[];let u=0;for(;!l.done&&u<MN;)l=i.sample(u),c.push(l.value),u+=fc;return{times:void 0,keyframes:c,duration:u-fc,ease:"linear"}}const O_={anticipate:u_,backInOut:c_,circInOut:f_};function LN(n){return n in O_}class Dy extends C_{constructor(a){super(a);const{name:i,motionValue:l,element:c,keyframes:u}=this.options;this.resolver=new w_(u,(f,p)=>this.onKeyframesResolved(f,p),i,l,c),this.resolver.scheduleResolve()}initPlayback(a,i){let{duration:l=300,times:c,ease:u,type:f,motionValue:p,name:m,startTime:v}=this.options;if(!p.owner||!p.owner.current)return!1;if(typeof u=="string"&&cc()&&LN(u)&&(u=O_[u]),ON(this.options)){const{onComplete:b,onUpdate:_,motionValue:S,element:T,...C}=this.options,w=BN(a,C);a=w.keyframes,a.length===1&&(a[1]=a[0]),l=w.duration,c=w.times,u=w.ease,f="keyframes"}const g=DN(p.owner.current,m,a,{...this.options,duration:l,times:c,ease:u});return g.startTime=v??this.calcStartTime(),this.pendingTimeline?(by(g,this.pendingTimeline),this.pendingTimeline=void 0):g.onfinish=()=>{const{onComplete:b}=this.options;p.set(Nc(a,this.options,i)),b&&b(),this.cancel(),this.resolveFinishedPromise()},{animation:g,duration:l,times:c,type:f,ease:u,keyframes:a}}get duration(){const{resolved:a}=this;if(!a)return 0;const{duration:i}=a;return wa(i)}get time(){const{resolved:a}=this;if(!a)return 0;const{animation:i}=a;return wa(i.currentTime||0)}set time(a){const{resolved:i}=this;if(!i)return;const{animation:l}=i;l.currentTime=ja(a)}get speed(){const{resolved:a}=this;if(!a)return 1;const{animation:i}=a;return i.playbackRate}set speed(a){const{resolved:i}=this;if(!i)return;const{animation:l}=i;l.playbackRate=a}get state(){const{resolved:a}=this;if(!a)return"idle";const{animation:i}=a;return i.playState}get startTime(){const{resolved:a}=this;if(!a)return null;const{animation:i}=a;return i.startTime}attachTimeline(a){if(!this._resolved)this.pendingTimeline=a;else{const{resolved:i}=this;if(!i)return yn;const{animation:l}=i;by(l,a)}return yn}play(){if(this.isStopped)return;const{resolved:a}=this;if(!a)return;const{animation:i}=a;i.playState==="finished"&&this.updateFinishedPromise(),i.play()}pause(){const{resolved:a}=this;if(!a)return;const{animation:i}=a;i.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:a}=this;if(!a)return;const{animation:i,keyframes:l,duration:c,type:u,ease:f,times:p}=a;if(i.playState==="idle"||i.playState==="finished")return;if(this.time){const{motionValue:v,onUpdate:g,onComplete:b,element:_,...S}=this.options,T=new Oh({...S,keyframes:l,duration:c,type:u,ease:f,times:p,isGenerator:!0}),C=ja(this.time);v.setWithVelocity(T.sample(C-fc).value,T.sample(C).value,fc)}const{onStop:m}=this.options;m&&m(),this.cancel()}complete(){const{resolved:a}=this;a&&a.animation.finish()}cancel(){const{resolved:a}=this;a&&a.animation.cancel()}static supports(a){const{motionValue:i,name:l,repeatDelay:c,repeatType:u,damping:f,type:p}=a;if(!i||!i.owner||!(i.owner.current instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:v}=i.owner.getProps();return RN()&&l&&AN.has(l)&&!m&&!v&&!c&&u!=="mirror"&&f!==0&&p!=="inertia"}}const IN={type:"spring",stiffness:500,damping:25,restSpeed:10},zN=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),UN={type:"keyframes",duration:.8},VN={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},HN=(n,{keyframes:a})=>a.length>2?UN:Ys.has(n)?n.startsWith("scale")?zN(a[1]):IN:VN;function PN({when:n,delay:a,delayChildren:i,staggerChildren:l,staggerDirection:c,repeat:u,repeatType:f,repeatDelay:p,from:m,elapsed:v,...g}){return!!Object.keys(g).length}const Bh=(n,a,i,l={},c,u)=>f=>{const p=_h(l,n)||{},m=p.delay||l.delay||0;let{elapsed:v=0}=l;v=v-ja(m);let g={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:a.getVelocity(),...p,delay:-v,onUpdate:_=>{a.set(_),p.onUpdate&&p.onUpdate(_)},onComplete:()=>{f(),p.onComplete&&p.onComplete()},name:n,motionValue:a,element:u?void 0:c};PN(p)||(g={...g,...HN(n,g)}),g.duration&&(g.duration=ja(g.duration)),g.repeatDelay&&(g.repeatDelay=ja(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let b=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(g.duration=0,g.delay===0&&(b=!0)),b&&!u&&a.get()!==void 0){const _=Nc(g.keyframes,p);if(_!==void 0)return ct.update(()=>{g.onUpdate(_),g.onComplete()}),new _C([])}return!u&&Dy.supports(g)?new Dy(g):new Oh(g)};function GN({protectedKeys:n,needsAnimating:a},i){const l=n.hasOwnProperty(i)&&a[i]!==!0;return a[i]=!1,l}function B_(n,a,{delay:i=0,transitionOverride:l,type:c}={}){var u;let{transition:f=n.getDefaultTransition(),transitionEnd:p,...m}=a;l&&(f=l);const v=[],g=c&&n.animationState&&n.animationState.getState()[c];for(const b in m){const _=n.getValue(b,(u=n.latestValues[b])!==null&&u!==void 0?u:null),S=m[b];if(S===void 0||g&&GN(g,b))continue;const T={delay:i,..._h(f||{},b)};let C=!1;if(window.MotionHandoffAnimation){const k=t_(n);if(k){const E=window.MotionHandoffAnimation(k,b,ct);E!==null&&(T.startTime=E,C=!0)}}Cf(n,b),_.start(Bh(b,_,S,n.shouldReduceMotion&&Jb.has(b)?{type:!1}:T,n,C));const w=_.animation;w&&v.push(w)}return p&&Promise.all(v).then(()=>{ct.update(()=>{p&&vC(n,p)})}),v}function Lf(n,a,i={}){var l;const c=Cc(n,a,i.type==="exit"?(l=n.presenceContext)===null||l===void 0?void 0:l.custom:void 0);let{transition:u=n.getDefaultTransition()||{}}=c||{};i.transitionOverride&&(u=i.transitionOverride);const f=c?()=>Promise.all(B_(n,c,i)):()=>Promise.resolve(),p=n.variantChildren&&n.variantChildren.size?(v=0)=>{const{delayChildren:g=0,staggerChildren:b,staggerDirection:_}=u;return qN(n,a,g+v,b,_,i)}:()=>Promise.resolve(),{when:m}=u;if(m){const[v,g]=m==="beforeChildren"?[f,p]:[p,f];return v().then(()=>g())}else return Promise.all([f(),p(i.delay)])}function qN(n,a,i=0,l=0,c=1,u){const f=[],p=(n.variantChildren.size-1)*l,m=c===1?(v=0)=>v*l:(v=0)=>p-v*l;return Array.from(n.variantChildren).sort($N).forEach((v,g)=>{v.notify("AnimationStart",a),f.push(Lf(v,a,{...u,delay:i+m(g)}).then(()=>v.notify("AnimationComplete",a)))}),Promise.all(f)}function $N(n,a){return n.sortNodePosition(a)}function KN(n,a,i={}){n.notify("AnimationStart",a);let l;if(Array.isArray(a)){const c=a.map(u=>Lf(n,u,i));l=Promise.all(c)}else if(typeof a=="string")l=Lf(n,a,i);else{const c=typeof a=="function"?Cc(n,a,i.custom):a;l=Promise.all(B_(n,c,i))}return l.then(()=>{n.notify("AnimationComplete",a)})}const YN=rh.length;function L_(n){if(!n)return;if(!n.isControllingVariants){const i=n.parent?L_(n.parent)||{}:{};return n.props.initial!==void 0&&(i.initial=n.props.initial),i}const a={};for(let i=0;i<YN;i++){const l=rh[i],c=n.props[l];(fl(c)||c===!1)&&(a[l]=c)}return a}const FN=[...lh].reverse(),ZN=lh.length;function XN(n){return a=>Promise.all(a.map(({animation:i,options:l})=>KN(n,i,l)))}function QN(n){let a=XN(n),i=Ry(),l=!0;const c=m=>(v,g)=>{var b;const _=Cc(n,g,m==="exit"?(b=n.presenceContext)===null||b===void 0?void 0:b.custom:void 0);if(_){const{transition:S,transitionEnd:T,...C}=_;v={...v,...C,...T}}return v};function u(m){a=m(n)}function f(m){const{props:v}=n,g=L_(n.parent)||{},b=[],_=new Set;let S={},T=1/0;for(let w=0;w<ZN;w++){const k=FN[w],E=i[k],A=v[k]!==void 0?v[k]:g[k],R=fl(A),N=k===m?E.isActive:null;N===!1&&(T=w);let z=A===g[k]&&A!==v[k]&&R;if(z&&l&&n.manuallyAnimateOnMount&&(z=!1),E.protectedKeys={...S},!E.isActive&&N===null||!A&&!E.prevProp||jc(A)||typeof A=="boolean")continue;const H=WN(E.prevProp,A);let B=H||k===m&&E.isActive&&!z&&R||w>T&&R,K=!1;const W=Array.isArray(A)?A:[A];let se=W.reduce(c(k),{});N===!1&&(se={});const{prevResolvedValues:ne={}}=E,re={...ne,...se},$=G=>{B=!0,_.has(G)&&(K=!0,_.delete(G)),E.needsAnimating[G]=!0;const Q=n.getValue(G);Q&&(Q.liveStyle=!1)};for(const G in re){const Q=se[G],oe=ne[G];if(S.hasOwnProperty(G))continue;let le=!1;wf(Q)&&wf(oe)?le=!Wb(Q,oe):le=Q!==oe,le?Q!=null?$(G):_.add(G):Q!==void 0&&_.has(G)?$(G):E.protectedKeys[G]=!0}E.prevProp=A,E.prevResolvedValues=se,E.isActive&&(S={...S,...se}),l&&n.blockInitialAnimation&&(B=!1),B&&(!(z&&H)||K)&&b.push(...W.map(G=>({animation:G,options:{type:k}})))}if(_.size){const w={};_.forEach(k=>{const E=n.getBaseTarget(k),A=n.getValue(k);A&&(A.liveStyle=!0),w[k]=E??null}),b.push({animation:w})}let C=!!b.length;return l&&(v.initial===!1||v.initial===v.animate)&&!n.manuallyAnimateOnMount&&(C=!1),l=!1,C?a(b):Promise.resolve()}function p(m,v){var g;if(i[m].isActive===v)return Promise.resolve();(g=n.variantChildren)===null||g===void 0||g.forEach(_=>{var S;return(S=_.animationState)===null||S===void 0?void 0:S.setActive(m,v)}),i[m].isActive=v;const b=f(m);for(const _ in i)i[_].protectedKeys={};return b}return{animateChanges:f,setActive:p,setAnimateFunction:u,getState:()=>i,reset:()=>{i=Ry(),l=!0}}}function WN(n,a){return typeof a=="string"?a!==n:Array.isArray(a)?!Wb(a,n):!1}function Ds(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ry(){return{animate:Ds(!0),whileInView:Ds(),whileHover:Ds(),whileTap:Ds(),whileDrag:Ds(),whileFocus:Ds(),exit:Ds()}}class ds{constructor(a){this.isMounted=!1,this.node=a}update(){}}class JN extends ds{constructor(a){super(a),a.animationState||(a.animationState=QN(a))}updateAnimationControlsSubscription(){const{animate:a}=this.node.getProps();jc(a)&&(this.unmountControls=a.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:a}=this.node.getProps(),{animate:i}=this.node.prevProps||{};a!==i&&this.updateAnimationControlsSubscription()}unmount(){var a;this.node.animationState.reset(),(a=this.unmountControls)===null||a===void 0||a.call(this)}}let eE=0;class tE extends ds{constructor(){super(...arguments),this.id=eE++}update(){if(!this.node.presenceContext)return;const{isPresent:a,onExitComplete:i}=this.node.presenceContext,{isPresent:l}=this.node.prevPresenceContext||{};if(!this.node.animationState||a===l)return;const c=this.node.animationState.setActive("exit",!a);i&&!a&&c.then(()=>i(this.id))}mount(){const{register:a}=this.node.presenceContext||{};a&&(this.unmount=a(this.id))}unmount(){}}const nE={animation:{Feature:JN},exit:{Feature:tE}},Pn={x:!1,y:!1};function I_(){return Pn.x||Pn.y}function aE(n){return n==="x"||n==="y"?Pn[n]?null:(Pn[n]=!0,()=>{Pn[n]=!1}):Pn.x||Pn.y?null:(Pn.x=Pn.y=!0,()=>{Pn.x=Pn.y=!1})}const Lh=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1;function vl(n,a,i,l={passive:!0}){return n.addEventListener(a,i,l),()=>n.removeEventListener(a,i)}function Tl(n){return{point:{x:n.pageX,y:n.pageY}}}const sE=n=>a=>Lh(a)&&n(a,Tl(a));function ol(n,a,i,l){return vl(n,a,sE(i),l)}const My=(n,a)=>Math.abs(n-a);function iE(n,a){const i=My(n.x,a.x),l=My(n.y,a.y);return Math.sqrt(i**2+l**2)}class z_{constructor(a,i,{transformPagePoint:l,contextWindow:c,dragSnapToOrigin:u=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=sf(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,S=iE(b.offset,{x:0,y:0})>=3;if(!_&&!S)return;const{point:T}=b,{timestamp:C}=qt;this.history.push({...T,timestamp:C});const{onStart:w,onMove:k}=this.handlers;_||(w&&w(this.lastMoveEvent,b),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,b)},this.handlePointerMove=(b,_)=>{this.lastMoveEvent=b,this.lastMoveEventInfo=af(_,this.transformPagePoint),ct.update(this.updatePoint,!0)},this.handlePointerUp=(b,_)=>{this.end();const{onEnd:S,onSessionEnd:T,resumeAnimation:C}=this.handlers;if(this.dragSnapToOrigin&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=sf(b.type==="pointercancel"?this.lastMoveEventInfo:af(_,this.transformPagePoint),this.history);this.startEvent&&S&&S(b,w),T&&T(b,w)},!Lh(a))return;this.dragSnapToOrigin=u,this.handlers=i,this.transformPagePoint=l,this.contextWindow=c||window;const f=Tl(a),p=af(f,this.transformPagePoint),{point:m}=p,{timestamp:v}=qt;this.history=[{...m,timestamp:v}];const{onSessionStart:g}=i;g&&g(a,sf(p,this.history)),this.removeListeners=Sl(ol(this.contextWindow,"pointermove",this.handlePointerMove),ol(this.contextWindow,"pointerup",this.handlePointerUp),ol(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(a){this.handlers=a}end(){this.removeListeners&&this.removeListeners(),ls(this.updatePoint)}}function af(n,a){return a?{point:a(n.point)}:n}function Oy(n,a){return{x:n.x-a.x,y:n.y-a.y}}function sf({point:n},a){return{point:n,delta:Oy(n,U_(a)),offset:Oy(n,oE(a)),velocity:lE(a,.1)}}function oE(n){return n[0]}function U_(n){return n[n.length-1]}function lE(n,a){if(n.length<2)return{x:0,y:0};let i=n.length-1,l=null;const c=U_(n);for(;i>=0&&(l=n[i],!(c.timestamp-l.timestamp>ja(a)));)i--;if(!l)return{x:0,y:0};const u=wa(c.timestamp-l.timestamp);if(u===0)return{x:0,y:0};const f={x:(c.x-l.x)/u,y:(c.y-l.y)/u};return f.x===1/0&&(f.x=0),f.y===1/0&&(f.y=0),f}const V_=1e-4,rE=1-V_,cE=1+V_,H_=.01,uE=0-H_,dE=0+H_;function bn(n){return n.max-n.min}function fE(n,a,i){return Math.abs(n-a)<=i}function By(n,a,i,l=.5){n.origin=l,n.originPoint=mt(a.min,a.max,n.origin),n.scale=bn(i)/bn(a),n.translate=mt(i.min,i.max,n.origin)-n.originPoint,(n.scale>=rE&&n.scale<=cE||isNaN(n.scale))&&(n.scale=1),(n.translate>=uE&&n.translate<=dE||isNaN(n.translate))&&(n.translate=0)}function ll(n,a,i,l){By(n.x,a.x,i.x,l?l.originX:void 0),By(n.y,a.y,i.y,l?l.originY:void 0)}function Ly(n,a,i){n.min=i.min+a.min,n.max=n.min+bn(a)}function hE(n,a,i){Ly(n.x,a.x,i.x),Ly(n.y,a.y,i.y)}function Iy(n,a,i){n.min=a.min-i.min,n.max=n.min+bn(a)}function rl(n,a,i){Iy(n.x,a.x,i.x),Iy(n.y,a.y,i.y)}function pE(n,{min:a,max:i},l){return a!==void 0&&n<a?n=l?mt(a,n,l.min):Math.max(n,a):i!==void 0&&n>i&&(n=l?mt(i,n,l.max):Math.min(n,i)),n}function zy(n,a,i){return{min:a!==void 0?n.min+a:void 0,max:i!==void 0?n.max+i-(n.max-n.min):void 0}}function mE(n,{top:a,left:i,bottom:l,right:c}){return{x:zy(n.x,i,c),y:zy(n.y,a,l)}}function Uy(n,a){let i=a.min-n.min,l=a.max-n.max;return a.max-a.min<n.max-n.min&&([i,l]=[l,i]),{min:i,max:l}}function vE(n,a){return{x:Uy(n.x,a.x),y:Uy(n.y,a.y)}}function gE(n,a){let i=.5;const l=bn(n),c=bn(a);return c>l?i=Ki(a.min,a.max-l,n.min):l>c&&(i=Ki(n.min,n.max-c,a.min)),Ea(0,1,i)}function yE(n,a){const i={};return a.min!==void 0&&(i.min=a.min-n.min),a.max!==void 0&&(i.max=a.max-n.min),i}const If=.35;function bE(n=If){return n===!1?n=0:n===!0&&(n=If),{x:Vy(n,"left","right"),y:Vy(n,"top","bottom")}}function Vy(n,a,i){return{min:Hy(n,a),max:Hy(n,i)}}function Hy(n,a){return typeof n=="number"?n:n[a]||0}const Py=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ii=()=>({x:Py(),y:Py()}),Gy=()=>({min:0,max:0}),St=()=>({x:Gy(),y:Gy()});function On(n){return[n("x"),n("y")]}function P_({top:n,left:a,right:i,bottom:l}){return{x:{min:a,max:i},y:{min:n,max:l}}}function _E({x:n,y:a}){return{top:a.min,right:n.max,bottom:a.max,left:n.min}}function xE(n,a){if(!a)return n;const i=a({x:n.left,y:n.top}),l=a({x:n.right,y:n.bottom});return{top:i.y,left:i.x,bottom:l.y,right:l.x}}function of(n){return n===void 0||n===1}function zf({scale:n,scaleX:a,scaleY:i}){return!of(n)||!of(a)||!of(i)}function Bs(n){return zf(n)||G_(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function G_(n){return qy(n.x)||qy(n.y)}function qy(n){return n&&n!=="0%"}function hc(n,a,i){const l=n-i,c=a*l;return i+c}function $y(n,a,i,l,c){return c!==void 0&&(n=hc(n,c,l)),hc(n,i,l)+a}function Uf(n,a=0,i=1,l,c){n.min=$y(n.min,a,i,l,c),n.max=$y(n.max,a,i,l,c)}function q_(n,{x:a,y:i}){Uf(n.x,a.translate,a.scale,a.originPoint),Uf(n.y,i.translate,i.scale,i.originPoint)}const Ky=.999999999999,Yy=1.0000000000001;function SE(n,a,i,l=!1){const c=i.length;if(!c)return;a.x=a.y=1;let u,f;for(let p=0;p<c;p++){u=i[p],f=u.projectionDelta;const{visualElement:m}=u.options;m&&m.props.style&&m.props.style.display==="contents"||(l&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Ui(n,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),f&&(a.x*=f.x.scale,a.y*=f.y.scale,q_(n,f)),l&&Bs(u.latestValues)&&Ui(n,u.latestValues))}a.x<Yy&&a.x>Ky&&(a.x=1),a.y<Yy&&a.y>Ky&&(a.y=1)}function zi(n,a){n.min=n.min+a,n.max=n.max+a}function Fy(n,a,i,l,c=.5){const u=mt(n.min,n.max,c);Uf(n,a,i,u,l)}function Ui(n,a){Fy(n.x,a.x,a.scaleX,a.scale,a.originX),Fy(n.y,a.y,a.scaleY,a.scale,a.originY)}function $_(n,a){return P_(xE(n.getBoundingClientRect(),a))}function TE(n,a,i){const l=$_(n,i),{scroll:c}=a;return c&&(zi(l.x,c.offset.x),zi(l.y,c.offset.y)),l}const K_=({current:n})=>n?n.ownerDocument.defaultView:null,kE=new WeakMap;class jE{constructor(a){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=St(),this.visualElement=a}start(a,{snapToCursor:i=!1}={}){const{presenceContext:l}=this.visualElement;if(l&&l.isPresent===!1)return;const c=g=>{const{dragSnapToOrigin:b}=this.getProps();b?this.pauseAnimation():this.stopAnimation(),i&&this.snapToCursor(Tl(g).point)},u=(g,b)=>{const{drag:_,dragPropagation:S,onDragStart:T}=this.getProps();if(_&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=aE(_),!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),On(w=>{let k=this.getAxisMotionValue(w).get()||0;if(Jn.test(k)){const{projection:E}=this.visualElement;if(E&&E.layout){const A=E.layout.layoutBox[w];A&&(k=bn(A)*(parseFloat(k)/100))}}this.originPoint[w]=k}),T&&ct.postRender(()=>T(g,b)),Cf(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},f=(g,b)=>{const{dragPropagation:_,dragDirectionLock:S,onDirectionLock:T,onDrag:C}=this.getProps();if(!_&&!this.openDragLock)return;const{offset:w}=b;if(S&&this.currentDirection===null){this.currentDirection=wE(w),this.currentDirection!==null&&T&&T(this.currentDirection);return}this.updateAxis("x",b.point,w),this.updateAxis("y",b.point,w),this.visualElement.render(),C&&C(g,b)},p=(g,b)=>this.stop(g,b),m=()=>On(g=>{var b;return this.getAnimationState(g)==="paused"&&((b=this.getAxisMotionValue(g).animation)===null||b===void 0?void 0:b.play())}),{dragSnapToOrigin:v}=this.getProps();this.panSession=new z_(a,{onSessionStart:c,onStart:u,onMove:f,onSessionEnd:p,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:v,contextWindow:K_(this.visualElement)})}stop(a,i){const l=this.isDragging;if(this.cancel(),!l)return;const{velocity:c}=i;this.startAnimation(c);const{onDragEnd:u}=this.getProps();u&&ct.postRender(()=>u(a,i))}cancel(){this.isDragging=!1;const{projection:a,animationState:i}=this.visualElement;a&&(a.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:l}=this.getProps();!l&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}updateAxis(a,i,l){const{drag:c}=this.getProps();if(!l||!Kr(a,c,this.currentDirection))return;const u=this.getAxisMotionValue(a);let f=this.originPoint[a]+l[a];this.constraints&&this.constraints[a]&&(f=pE(f,this.constraints[a],this.elastic[a])),u.set(f)}resolveConstraints(){var a;const{dragConstraints:i,dragElastic:l}=this.getProps(),c=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)===null||a===void 0?void 0:a.layout,u=this.constraints;i&&Bi(i)?this.constraints||(this.constraints=this.resolveRefConstraints()):i&&c?this.constraints=mE(c.layoutBox,i):this.constraints=!1,this.elastic=bE(l),u!==this.constraints&&c&&this.constraints&&!this.hasMutatedConstraints&&On(f=>{this.constraints!==!1&&this.getAxisMotionValue(f)&&(this.constraints[f]=yE(c.layoutBox[f],this.constraints[f]))})}resolveRefConstraints(){const{dragConstraints:a,onMeasureDragConstraints:i}=this.getProps();if(!a||!Bi(a))return!1;const l=a.current,{projection:c}=this.visualElement;if(!c||!c.layout)return!1;const u=TE(l,c.root,this.visualElement.getTransformPagePoint());let f=vE(c.layout.layoutBox,u);if(i){const p=i(_E(f));this.hasMutatedConstraints=!!p,p&&(f=P_(p))}return f}startAnimation(a){const{drag:i,dragMomentum:l,dragElastic:c,dragTransition:u,dragSnapToOrigin:f,onDragTransitionEnd:p}=this.getProps(),m=this.constraints||{},v=On(g=>{if(!Kr(g,i,this.currentDirection))return;let b=m&&m[g]||{};f&&(b={min:0,max:0});const _=c?200:1e6,S=c?40:1e7,T={type:"inertia",velocity:l?a[g]:0,bounceStiffness:_,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...u,...b};return this.startAxisValueAnimation(g,T)});return Promise.all(v).then(p)}startAxisValueAnimation(a,i){const l=this.getAxisMotionValue(a);return Cf(this.visualElement,a),l.start(Bh(a,l,0,i,this.visualElement,!1))}stopAnimation(){On(a=>this.getAxisMotionValue(a).stop())}pauseAnimation(){On(a=>{var i;return(i=this.getAxisMotionValue(a).animation)===null||i===void 0?void 0:i.pause()})}getAnimationState(a){var i;return(i=this.getAxisMotionValue(a).animation)===null||i===void 0?void 0:i.state}getAxisMotionValue(a){const i=`_drag${a.toUpperCase()}`,l=this.visualElement.getProps(),c=l[i];return c||this.visualElement.getValue(a,(l.initial?l.initial[a]:void 0)||0)}snapToCursor(a){On(i=>{const{drag:l}=this.getProps();if(!Kr(i,l,this.currentDirection))return;const{projection:c}=this.visualElement,u=this.getAxisMotionValue(i);if(c&&c.layout){const{min:f,max:p}=c.layout.layoutBox[i];u.set(a[i]-mt(f,p,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:a,dragConstraints:i}=this.getProps(),{projection:l}=this.visualElement;if(!Bi(i)||!l||!this.constraints)return;this.stopAnimation();const c={x:0,y:0};On(f=>{const p=this.getAxisMotionValue(f);if(p&&this.constraints!==!1){const m=p.get();c[f]=gE({min:m,max:m},this.constraints[f])}});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",l.root&&l.root.updateScroll(),l.updateLayout(),this.resolveConstraints(),On(f=>{if(!Kr(f,a,null))return;const p=this.getAxisMotionValue(f),{min:m,max:v}=this.constraints[f];p.set(mt(m,v,c[f]))})}addListeners(){if(!this.visualElement.current)return;kE.set(this.visualElement,this);const a=this.visualElement.current,i=ol(a,"pointerdown",m=>{const{drag:v,dragListener:g=!0}=this.getProps();v&&g&&this.start(m)}),l=()=>{const{dragConstraints:m}=this.getProps();Bi(m)&&m.current&&(this.constraints=this.resolveRefConstraints())},{projection:c}=this.visualElement,u=c.addEventListener("measure",l);c&&!c.layout&&(c.root&&c.root.updateScroll(),c.updateLayout()),ct.read(l);const f=vl(window,"resize",()=>this.scalePositionWithinConstraints()),p=c.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:v})=>{this.isDragging&&v&&(On(g=>{const b=this.getAxisMotionValue(g);b&&(this.originPoint[g]+=m[g].translate,b.set(b.get()+m[g].translate))}),this.visualElement.render())}));return()=>{f(),i(),u(),p&&p()}}getProps(){const a=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:l=!1,dragPropagation:c=!1,dragConstraints:u=!1,dragElastic:f=If,dragMomentum:p=!0}=a;return{...a,drag:i,dragDirectionLock:l,dragPropagation:c,dragConstraints:u,dragElastic:f,dragMomentum:p}}}function Kr(n,a,i){return(a===!0||a===n)&&(i===null||i===n)}function wE(n,a=10){let i=null;return Math.abs(n.y)>a?i="y":Math.abs(n.x)>a&&(i="x"),i}class CE extends ds{constructor(a){super(a),this.removeGroupControls=yn,this.removeListeners=yn,this.controls=new jE(a)}mount(){const{dragControls:a}=this.node.getProps();a&&(this.removeGroupControls=a.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||yn}unmount(){this.removeGroupControls(),this.removeListeners()}}const Zy=n=>(a,i)=>{n&&ct.postRender(()=>n(a,i))};class NE extends ds{constructor(){super(...arguments),this.removePointerDownListener=yn}onPointerDown(a){this.session=new z_(a,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:K_(this.node)})}createPanHandlers(){const{onPanSessionStart:a,onPanStart:i,onPan:l,onPanEnd:c}=this.node.getProps();return{onSessionStart:Zy(a),onStart:Zy(i),onMove:l,onEnd:(u,f)=>{delete this.session,c&&ct.postRender(()=>c(u,f))}}}mount(){this.removePointerDownListener=ol(this.node.current,"pointerdown",a=>this.onPointerDown(a))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const ac={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Xy(n,a){return a.max===a.min?0:n/(a.max-a.min)*100}const Xo={correct:(n,a)=>{if(!a.target)return n;if(typeof n=="string")if(xe.test(n))n=parseFloat(n);else return n;const i=Xy(n,a.target.x),l=Xy(n,a.target.y);return`${i}% ${l}%`}},EE={correct:(n,{treeScale:a,projectionDelta:i})=>{const l=n,c=rs.parse(n);if(c.length>5)return l;const u=rs.createTransformer(n),f=typeof c[0]!="number"?1:0,p=i.x.scale*a.x,m=i.y.scale*a.y;c[0+f]/=p,c[1+f]/=m;const v=mt(p,m,.5);return typeof c[2+f]=="number"&&(c[2+f]/=v),typeof c[3+f]=="number"&&(c[3+f]/=v),u(c)}};class AE extends y.Component{componentDidMount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:l,layoutId:c}=this.props,{projection:u}=a;nC(DE),u&&(i.group&&i.group.add(u),l&&l.register&&c&&l.register(u),u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,onExitComplete:()=>this.safeToRemove()})),ac.hasEverUpdated=!0}getSnapshotBeforeUpdate(a){const{layoutDependency:i,visualElement:l,drag:c,isPresent:u}=this.props,f=l.projection;return f&&(f.isPresent=u,c||a.layoutDependency!==i||i===void 0?f.willUpdate():this.safeToRemove(),a.isPresent!==u&&(u?f.promote():f.relegate()||ct.postRender(()=>{const p=f.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:a}=this.props.visualElement;a&&(a.root.didUpdate(),uh.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:l}=this.props,{projection:c}=a;c&&(c.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(c),l&&l.deregister&&l.deregister(c))}safeToRemove(){const{safeToRemove:a}=this.props;a&&a()}render(){return null}}function Y_(n){const[a,i]=Db(),l=y.useContext(ah);return r.jsx(AE,{...n,layoutGroup:l,switchLayoutGroup:y.useContext(Ub),isPresent:a,safeToRemove:i})}const DE={borderRadius:{...Xo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Xo,borderTopRightRadius:Xo,borderBottomLeftRadius:Xo,borderBottomRightRadius:Xo,boxShadow:EE};function RE(n,a,i){const l=Zt(n)?n:pl(n);return l.start(Bh("",l,a,i)),l.animation}function ME(n){return n instanceof SVGElement&&n.tagName!=="svg"}const OE=(n,a)=>n.depth-a.depth;class BE{constructor(){this.children=[],this.isDirty=!1}add(a){xh(this.children,a),this.isDirty=!0}remove(a){Sh(this.children,a),this.isDirty=!0}forEach(a){this.isDirty&&this.children.sort(OE),this.isDirty=!1,this.children.forEach(a)}}function LE(n,a){const i=ea.now(),l=({timestamp:c})=>{const u=c-i;u>=a&&(ls(l),n(u-a))};return ct.read(l,!0),()=>ls(l)}const F_=["TopLeft","TopRight","BottomLeft","BottomRight"],IE=F_.length,Qy=n=>typeof n=="string"?parseFloat(n):n,Wy=n=>typeof n=="number"||xe.test(n);function zE(n,a,i,l,c,u){c?(n.opacity=mt(0,i.opacity!==void 0?i.opacity:1,UE(l)),n.opacityExit=mt(a.opacity!==void 0?a.opacity:1,0,VE(l))):u&&(n.opacity=mt(a.opacity!==void 0?a.opacity:1,i.opacity!==void 0?i.opacity:1,l));for(let f=0;f<IE;f++){const p=`border${F_[f]}Radius`;let m=Jy(a,p),v=Jy(i,p);if(m===void 0&&v===void 0)continue;m||(m=0),v||(v=0),m===0||v===0||Wy(m)===Wy(v)?(n[p]=Math.max(mt(Qy(m),Qy(v),l),0),(Jn.test(v)||Jn.test(m))&&(n[p]+="%")):n[p]=v}(a.rotate||i.rotate)&&(n.rotate=mt(a.rotate||0,i.rotate||0,l))}function Jy(n,a){return n[a]!==void 0?n[a]:n.borderRadius}const UE=Z_(0,.5,d_),VE=Z_(.5,.95,yn);function Z_(n,a,i){return l=>l<n?0:l>a?1:i(Ki(n,a,l))}function e0(n,a){n.min=a.min,n.max=a.max}function Rn(n,a){e0(n.x,a.x),e0(n.y,a.y)}function t0(n,a){n.translate=a.translate,n.scale=a.scale,n.originPoint=a.originPoint,n.origin=a.origin}function n0(n,a,i,l,c){return n-=a,n=hc(n,1/i,l),c!==void 0&&(n=hc(n,1/c,l)),n}function HE(n,a=0,i=1,l=.5,c,u=n,f=n){if(Jn.test(a)&&(a=parseFloat(a),a=mt(f.min,f.max,a/100)-f.min),typeof a!="number")return;let p=mt(u.min,u.max,l);n===u&&(p-=a),n.min=n0(n.min,a,i,p,c),n.max=n0(n.max,a,i,p,c)}function a0(n,a,[i,l,c],u,f){HE(n,a[i],a[l],a[c],a.scale,u,f)}const PE=["x","scaleX","originX"],GE=["y","scaleY","originY"];function s0(n,a,i,l){a0(n.x,a,PE,i?i.x:void 0,l?l.x:void 0),a0(n.y,a,GE,i?i.y:void 0,l?l.y:void 0)}function i0(n){return n.translate===0&&n.scale===1}function X_(n){return i0(n.x)&&i0(n.y)}function o0(n,a){return n.min===a.min&&n.max===a.max}function qE(n,a){return o0(n.x,a.x)&&o0(n.y,a.y)}function l0(n,a){return Math.round(n.min)===Math.round(a.min)&&Math.round(n.max)===Math.round(a.max)}function Q_(n,a){return l0(n.x,a.x)&&l0(n.y,a.y)}function r0(n){return bn(n.x)/bn(n.y)}function c0(n,a){return n.translate===a.translate&&n.scale===a.scale&&n.originPoint===a.originPoint}class $E{constructor(){this.members=[]}add(a){xh(this.members,a),a.scheduleRender()}remove(a){if(Sh(this.members,a),a===this.prevLead&&(this.prevLead=void 0),a===this.lead){const i=this.members[this.members.length-1];i&&this.promote(i)}}relegate(a){const i=this.members.findIndex(c=>a===c);if(i===0)return!1;let l;for(let c=i;c>=0;c--){const u=this.members[c];if(u.isPresent!==!1){l=u;break}}return l?(this.promote(l),!0):!1}promote(a,i){const l=this.lead;if(a!==l&&(this.prevLead=l,this.lead=a,a.show(),l)){l.instance&&l.scheduleRender(),a.scheduleRender(),a.resumeFrom=l,i&&(a.resumeFrom.preserveOpacity=!0),l.snapshot&&(a.snapshot=l.snapshot,a.snapshot.latestValues=l.animationValues||l.latestValues),a.root&&a.root.isUpdating&&(a.isLayoutDirty=!0);const{crossfade:c}=a.options;c===!1&&l.hide()}}exitAnimationComplete(){this.members.forEach(a=>{const{options:i,resumingFrom:l}=a;i.onExitComplete&&i.onExitComplete(),l&&l.options.onExitComplete&&l.options.onExitComplete()})}scheduleRender(){this.members.forEach(a=>{a.instance&&a.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function KE(n,a,i){let l="";const c=n.x.translate/a.x,u=n.y.translate/a.y,f=(i==null?void 0:i.z)||0;if((c||u||f)&&(l=`translate3d(${c}px, ${u}px, ${f}px) `),(a.x!==1||a.y!==1)&&(l+=`scale(${1/a.x}, ${1/a.y}) `),i){const{transformPerspective:v,rotate:g,rotateX:b,rotateY:_,skewX:S,skewY:T}=i;v&&(l=`perspective(${v}px) ${l}`),g&&(l+=`rotate(${g}deg) `),b&&(l+=`rotateX(${b}deg) `),_&&(l+=`rotateY(${_}deg) `),S&&(l+=`skewX(${S}deg) `),T&&(l+=`skewY(${T}deg) `)}const p=n.x.scale*a.x,m=n.y.scale*a.y;return(p!==1||m!==1)&&(l+=`scale(${p}, ${m})`),l||"none"}const Ls={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},tl=typeof window<"u"&&window.MotionDebug!==void 0,lf=["","X","Y","Z"],YE={visibility:"hidden"},u0=1e3;let FE=0;function rf(n,a,i,l){const{latestValues:c}=a;c[n]&&(i[n]=c[n],a.setStaticValue(n,0),l&&(l[n]=0))}function W_(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:a}=n.options;if(!a)return;const i=t_(a);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:c,layoutId:u}=n.options;window.MotionCancelOptimisedAnimation(i,"transform",ct,!(c||u))}const{parent:l}=n;l&&!l.hasCheckedOptimisedAppear&&W_(l)}function J_({attachResizeListener:n,defaultParent:a,measureScroll:i,checkIsScrollRoot:l,resetTransform:c}){return class{constructor(f={},p=a==null?void 0:a()){this.id=FE++,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,tl&&(Ls.totalNodes=Ls.resolvedTargetDeltas=Ls.recalculatedProjection=0),this.nodes.forEach(QE),this.nodes.forEach(n2),this.nodes.forEach(a2),this.nodes.forEach(WE),tl&&window.MotionDebug.record(Ls)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=f,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 BE)}addEventListener(f,p){return this.eventHandlers.has(f)||this.eventHandlers.set(f,new Th),this.eventHandlers.get(f).add(p)}notifyListeners(f,...p){const m=this.eventHandlers.get(f);m&&m.notify(...p)}hasListeners(f){return this.eventHandlers.has(f)}mount(f,p=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=ME(f),this.instance=f;const{layoutId:m,layout:v,visualElement:g}=this.options;if(g&&!g.current&&g.mount(f),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),p&&(v||m)&&(this.isLayoutDirty=!0),n){let b;const _=()=>this.root.updateBlockedByResize=!1;n(f,()=>{this.root.updateBlockedByResize=!0,b&&b(),b=LE(_,250),ac.hasAnimatedSinceResize&&(ac.hasAnimatedSinceResize=!1,this.nodes.forEach(f0))})}m&&this.root.registerSharedNode(m,this),this.options.animate!==!1&&g&&(m||v)&&this.addEventListener("didUpdate",({delta:b,hasLayoutChanged:_,hasRelativeTargetChanged:S,layout:T})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const C=this.options.transition||g.getDefaultTransition()||r2,{onLayoutAnimationStart:w,onLayoutAnimationComplete:k}=g.getProps(),E=!this.targetLayout||!Q_(this.targetLayout,T)||S,A=!_&&S;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||A||_&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(b,A);const R={..._h(C,"layout"),onPlay:w,onComplete:k};(g.shouldReduceMotion||this.options.layoutRoot)&&(R.delay=0,R.type=!1),this.startAnimation(R)}else _||f0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=T})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const f=this.getStack();f&&f.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,ls(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(s2),this.animationId++)}getTransformTemplate(){const{visualElement:f}=this.options;return f&&f.getProps().transformTemplate}willUpdate(f=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&W_(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let g=0;g<this.path.length;g++){const b=this.path[g];b.shouldResetTransform=!0,b.updateScroll("snapshot"),b.options.layoutRoot&&b.willUpdate(!1)}const{layoutId:p,layout:m}=this.options;if(p===void 0&&!m)return;const v=this.getTransformTemplate();this.prevTransformTemplateValue=v?v(this.latestValues,""):void 0,this.updateSnapshot(),f&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(d0);return}this.isUpdating||this.nodes.forEach(e2),this.isUpdating=!1,this.nodes.forEach(t2),this.nodes.forEach(ZE),this.nodes.forEach(XE),this.clearAllSnapshots();const p=ea.now();qt.delta=Ea(0,1e3/60,p-qt.timestamp),qt.timestamp=p,qt.isProcessing=!0,Wd.update.process(qt),Wd.preRender.process(qt),Wd.render.process(qt),qt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,uh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(JE),this.sharedNodes.forEach(i2)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ct.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ct.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let m=0;m<this.path.length;m++)this.path[m].updateScroll();const f=this.layout;this.layout=this.measure(!1),this.layoutCorrected=St(),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,f?f.layoutBox:void 0)}updateScroll(f="measure"){let p=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===f&&(p=!1),p){const m=l(this.instance);this.scroll={animationId:this.root.animationId,phase:f,isRoot:m,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!c)return;const f=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,p=this.projectionDelta&&!X_(this.projectionDelta),m=this.getTransformTemplate(),v=m?m(this.latestValues,""):void 0,g=v!==this.prevTransformTemplateValue;f&&(p||Bs(this.latestValues)||g)&&(c(this.instance,v),this.shouldResetTransform=!1,this.scheduleRender())}measure(f=!0){const p=this.measurePageBox();let m=this.removeElementScroll(p);return f&&(m=this.removeTransform(m)),c2(m),{animationId:this.root.animationId,measuredBox:p,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){var f;const{visualElement:p}=this.options;if(!p)return St();const m=p.measureViewportBox();if(!(((f=this.scroll)===null||f===void 0?void 0:f.wasRoot)||this.path.some(u2))){const{scroll:g}=this.root;g&&(zi(m.x,g.offset.x),zi(m.y,g.offset.y))}return m}removeElementScroll(f){var p;const m=St();if(Rn(m,f),!((p=this.scroll)===null||p===void 0)&&p.wasRoot)return m;for(let v=0;v<this.path.length;v++){const g=this.path[v],{scroll:b,options:_}=g;g!==this.root&&b&&_.layoutScroll&&(b.wasRoot&&Rn(m,f),zi(m.x,b.offset.x),zi(m.y,b.offset.y))}return m}applyTransform(f,p=!1){const m=St();Rn(m,f);for(let v=0;v<this.path.length;v++){const g=this.path[v];!p&&g.options.layoutScroll&&g.scroll&&g!==g.root&&Ui(m,{x:-g.scroll.offset.x,y:-g.scroll.offset.y}),Bs(g.latestValues)&&Ui(m,g.latestValues)}return Bs(this.latestValues)&&Ui(m,this.latestValues),m}removeTransform(f){const p=St();Rn(p,f);for(let m=0;m<this.path.length;m++){const v=this.path[m];if(!v.instance||!Bs(v.latestValues))continue;zf(v.latestValues)&&v.updateSnapshot();const g=St(),b=v.measurePageBox();Rn(g,b),s0(p,v.latestValues,v.snapshot?v.snapshot.layoutBox:void 0,g)}return Bs(this.latestValues)&&s0(p,this.latestValues),p}setTargetDelta(f){this.targetDelta=f,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(f){this.options={...this.options,...f,crossfade:f.crossfade!==void 0?f.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==qt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(f=!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 v=!!this.resumingFrom||this!==m;if(!(f||v&&this.isSharedProjectionDirty||this.isProjectionDirty||!((p=this.parent)===null||p===void 0)&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:b,layoutId:_}=this.options;if(!(!this.layout||!(b||_))){if(this.resolvedRelativeTargetAt=qt.timestamp,!this.targetDelta&&!this.relativeTarget){const S=this.getClosestProjectingParent();S&&S.layout&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=St(),this.relativeTargetOrigin=St(),rl(this.relativeTargetOrigin,this.layout.layoutBox,S.layout.layoutBox),Rn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=St(),this.targetWithTransforms=St()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),hE(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Rn(this.target,this.layout.layoutBox),q_(this.target,this.targetDelta)):Rn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const S=this.getClosestProjectingParent();S&&!!S.resumingFrom==!!this.resumingFrom&&!S.options.layoutScroll&&S.target&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=St(),this.relativeTargetOrigin=St(),rl(this.relativeTargetOrigin,this.target,S.target),Rn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}tl&&Ls.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||zf(this.parent.latestValues)||G_(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var f;const p=this.getLead(),m=!!this.resumingFrom||this!==p;let v=!0;if((this.isProjectionDirty||!((f=this.parent)===null||f===void 0)&&f.isProjectionDirty)&&(v=!1),m&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(v=!1),this.resolvedRelativeTargetAt===qt.timestamp&&(v=!1),v)return;const{layout:g,layoutId:b}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(g||b))return;Rn(this.layoutCorrected,this.layout.layoutBox);const _=this.treeScale.x,S=this.treeScale.y;SE(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=St());const{target:T}=p;if(!T){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(t0(this.prevProjectionDelta.x,this.projectionDelta.x),t0(this.prevProjectionDelta.y,this.projectionDelta.y)),ll(this.projectionDelta,this.layoutCorrected,T,this.latestValues),(this.treeScale.x!==_||this.treeScale.y!==S||!c0(this.projectionDelta.x,this.prevProjectionDelta.x)||!c0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",T)),tl&&Ls.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(f=!0){var p;if((p=this.options.visualElement)===null||p===void 0||p.scheduleRender(),f){const m=this.getStack();m&&m.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ii(),this.projectionDelta=Ii(),this.projectionDeltaWithTransform=Ii()}setAnimationOrigin(f,p=!1){const m=this.snapshot,v=m?m.latestValues:{},g={...this.latestValues},b=Ii();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const _=St(),S=m?m.source:void 0,T=this.layout?this.layout.source:void 0,C=S!==T,w=this.getStack(),k=!w||w.members.length<=1,E=!!(C&&!k&&this.options.crossfade===!0&&!this.path.some(l2));this.animationProgress=0;let A;this.mixTargetDelta=R=>{const N=R/1e3;h0(b.x,f.x,N),h0(b.y,f.y,N),this.setTargetDelta(b),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(rl(_,this.layout.layoutBox,this.relativeParent.layout.layoutBox),o2(this.relativeTarget,this.relativeTargetOrigin,_,N),A&&qE(this.relativeTarget,A)&&(this.isProjectionDirty=!1),A||(A=St()),Rn(A,this.relativeTarget)),C&&(this.animationValues=g,zE(g,v,this.latestValues,N,E,k)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=N},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(f){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(ls(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ct.update(()=>{ac.hasAnimatedSinceResize=!0,this.currentAnimation=RE(0,u0,{...f,onUpdate:p=>{this.mixTargetDelta(p),f.onUpdate&&f.onUpdate(p)},onComplete:()=>{f.onComplete&&f.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const f=this.getStack();f&&f.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(u0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const f=this.getLead();let{targetWithTransforms:p,target:m,layout:v,latestValues:g}=f;if(!(!p||!m||!v)){if(this!==f&&this.layout&&v&&ex(this.options.animationType,this.layout.layoutBox,v.layoutBox)){m=this.target||St();const b=bn(this.layout.layoutBox.x);m.x.min=f.target.x.min,m.x.max=m.x.min+b;const _=bn(this.layout.layoutBox.y);m.y.min=f.target.y.min,m.y.max=m.y.min+_}Rn(p,m),Ui(p,g),ll(this.projectionDeltaWithTransform,this.layoutCorrected,p,g)}}registerSharedNode(f,p){this.sharedNodes.has(f)||this.sharedNodes.set(f,new $E),this.sharedNodes.get(f).add(p);const v=p.options.initialPromotionConfig;p.promote({transition:v?v.transition:void 0,preserveFollowOpacity:v&&v.shouldPreserveFollowOpacity?v.shouldPreserveFollowOpacity(p):void 0})}isLead(){const f=this.getStack();return f?f.lead===this:!0}getLead(){var f;const{layoutId:p}=this.options;return p?((f=this.getStack())===null||f===void 0?void 0:f.lead)||this:this}getPrevLead(){var f;const{layoutId:p}=this.options;return p?(f=this.getStack())===null||f===void 0?void 0:f.prevLead:void 0}getStack(){const{layoutId:f}=this.options;if(f)return this.root.sharedNodes.get(f)}promote({needsReset:f,transition:p,preserveFollowOpacity:m}={}){const v=this.getStack();v&&v.promote(this,m),f&&(this.projectionDelta=void 0,this.needsReset=!0),p&&this.setOptions({transition:p})}relegate(){const f=this.getStack();return f?f.relegate(this):!1}resetSkewAndRotation(){const{visualElement:f}=this.options;if(!f)return;let p=!1;const{latestValues:m}=f;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(p=!0),!p)return;const v={};m.z&&rf("z",f,v,this.animationValues);for(let g=0;g<lf.length;g++)rf(`rotate${lf[g]}`,f,v,this.animationValues),rf(`skew${lf[g]}`,f,v,this.animationValues);f.render();for(const g in v)f.setStaticValue(g,v[g]),this.animationValues&&(this.animationValues[g]=v[g]);f.scheduleRender()}getProjectionStyles(f){var p,m;if(!this.instance||this.isSVG)return;if(!this.isVisible)return YE;const v={visibility:""},g=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,v.opacity="",v.pointerEvents=tc(f==null?void 0:f.pointerEvents)||"",v.transform=g?g(this.latestValues,""):"none",v;const b=this.getLead();if(!this.projectionDelta||!this.layout||!b.target){const C={};return this.options.layoutId&&(C.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,C.pointerEvents=tc(f==null?void 0:f.pointerEvents)||""),this.hasProjected&&!Bs(this.latestValues)&&(C.transform=g?g({},""):"none",this.hasProjected=!1),C}const _=b.animationValues||b.latestValues;this.applyTransformsToTarget(),v.transform=KE(this.projectionDeltaWithTransform,this.treeScale,_),g&&(v.transform=g(_,v.transform));const{x:S,y:T}=this.projectionDelta;v.transformOrigin=`${S.origin*100}% ${T.origin*100}% 0`,b.animationValues?v.opacity=b===this?(m=(p=_.opacity)!==null&&p!==void 0?p:this.latestValues.opacity)!==null&&m!==void 0?m:1:this.preserveOpacity?this.latestValues.opacity:_.opacityExit:v.opacity=b===this?_.opacity!==void 0?_.opacity:"":_.opacityExit!==void 0?_.opacityExit:0;for(const C in rc){if(_[C]===void 0)continue;const{correct:w,applyTo:k}=rc[C],E=v.transform==="none"?_[C]:w(_[C],b);if(k){const A=k.length;for(let R=0;R<A;R++)v[k[R]]=E}else v[C]=E}return this.options.layoutId&&(v.pointerEvents=b===this?tc(f==null?void 0:f.pointerEvents)||"":"none"),v}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(f=>{var p;return(p=f.currentAnimation)===null||p===void 0?void 0:p.stop()}),this.root.nodes.forEach(d0),this.root.sharedNodes.clear()}}}function ZE(n){n.updateLayout()}function XE(n){var a;const i=((a=n.resumeFrom)===null||a===void 0?void 0:a.snapshot)||n.snapshot;if(n.isLead()&&n.layout&&i&&n.hasListeners("didUpdate")){const{layoutBox:l,measuredBox:c}=n.layout,{animationType:u}=n.options,f=i.source!==n.layout.source;u==="size"?On(b=>{const _=f?i.measuredBox[b]:i.layoutBox[b],S=bn(_);_.min=l[b].min,_.max=_.min+S}):ex(u,i.layoutBox,l)&&On(b=>{const _=f?i.measuredBox[b]:i.layoutBox[b],S=bn(l[b]);_.max=_.min+S,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[b].max=n.relativeTarget[b].min+S)});const p=Ii();ll(p,l,i.layoutBox);const m=Ii();f?ll(m,n.applyTransform(c,!0),i.measuredBox):ll(m,l,i.layoutBox);const v=!X_(p);let g=!1;if(!n.resumeFrom){const b=n.getClosestProjectingParent();if(b&&!b.resumeFrom){const{snapshot:_,layout:S}=b;if(_&&S){const T=St();rl(T,i.layoutBox,_.layoutBox);const C=St();rl(C,l,S.layoutBox),Q_(T,C)||(g=!0),b.options.layoutRoot&&(n.relativeTarget=C,n.relativeTargetOrigin=T,n.relativeParent=b)}}}n.notifyListeners("didUpdate",{layout:l,snapshot:i,delta:m,layoutDelta:p,hasLayoutChanged:v,hasRelativeTargetChanged:g})}else if(n.isLead()){const{onExitComplete:l}=n.options;l&&l()}n.options.transition=void 0}function QE(n){tl&&Ls.totalNodes++,n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=!!(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}function WE(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function JE(n){n.clearSnapshot()}function d0(n){n.clearMeasurements()}function e2(n){n.isLayoutDirty=!1}function t2(n){const{visualElement:a}=n.options;a&&a.getProps().onBeforeLayoutMeasure&&a.notify("BeforeLayoutMeasure"),n.resetTransform()}function f0(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function n2(n){n.resolveTargetDelta()}function a2(n){n.calcProjection()}function s2(n){n.resetSkewAndRotation()}function i2(n){n.removeLeadSnapshot()}function h0(n,a,i){n.translate=mt(a.translate,0,i),n.scale=mt(a.scale,1,i),n.origin=a.origin,n.originPoint=a.originPoint}function p0(n,a,i,l){n.min=mt(a.min,i.min,l),n.max=mt(a.max,i.max,l)}function o2(n,a,i,l){p0(n.x,a.x,i.x,l),p0(n.y,a.y,i.y,l)}function l2(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const r2={duration:.45,ease:[.4,0,.1,1]},m0=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),v0=m0("applewebkit/")&&!m0("chrome/")?Math.round:yn;function g0(n){n.min=v0(n.min),n.max=v0(n.max)}function c2(n){g0(n.x),g0(n.y)}function ex(n,a,i){return n==="position"||n==="preserve-aspect"&&!fE(r0(a),r0(i),.2)}function u2(n){var a;return n!==n.root&&((a=n.scroll)===null||a===void 0?void 0:a.wasRoot)}const d2=J_({attachResizeListener:(n,a)=>vl(n,"resize",a),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),cf={current:void 0},tx=J_({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!cf.current){const n=new d2({});n.mount(window),n.setOptions({layoutScroll:!0}),cf.current=n}return cf.current},resetTransform:(n,a)=>{n.style.transform=a!==void 0?a:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),f2={pan:{Feature:NE},drag:{Feature:CE,ProjectionNode:tx,MeasureLayout:Y_}};function h2(n,a,i){var l;if(n instanceof Element)return[n];if(typeof n=="string"){let c=document;const u=(l=void 0)!==null&&l!==void 0?l:c.querySelectorAll(n);return u?Array.from(u):[]}return Array.from(n)}function nx(n,a){const i=h2(n),l=new AbortController,c={passive:!0,...a,signal:l.signal};return[i,c,()=>l.abort()]}function y0(n){return a=>{a.pointerType==="touch"||I_()||n(a)}}function p2(n,a,i={}){const[l,c,u]=nx(n,i),f=y0(p=>{const{target:m}=p,v=a(p);if(typeof v!="function"||!m)return;const g=y0(b=>{v(b),m.removeEventListener("pointerleave",g)});m.addEventListener("pointerleave",g,c)});return l.forEach(p=>{p.addEventListener("pointerenter",f,c)}),u}function b0(n,a,i){const{props:l}=n;n.animationState&&l.whileHover&&n.animationState.setActive("whileHover",i==="Start");const c="onHover"+i,u=l[c];u&&ct.postRender(()=>u(a,Tl(a)))}class m2 extends ds{mount(){const{current:a}=this.node;a&&(this.unmount=p2(a,i=>(b0(this.node,i,"Start"),l=>b0(this.node,l,"End"))))}unmount(){}}class v2 extends ds{constructor(){super(...arguments),this.isActive=!1}onFocus(){let a=!1;try{a=this.node.current.matches(":focus-visible")}catch{a=!0}!a||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Sl(vl(this.node.current,"focus",()=>this.onFocus()),vl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const ax=(n,a)=>a?n===a?!0:ax(n,a.parentElement):!1,g2=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function y2(n){return g2.has(n.tagName)||n.tabIndex!==-1}const nl=new WeakSet;function _0(n){return a=>{a.key==="Enter"&&n(a)}}function uf(n,a){n.dispatchEvent(new PointerEvent("pointer"+a,{isPrimary:!0,bubbles:!0}))}const b2=(n,a)=>{const i=n.currentTarget;if(!i)return;const l=_0(()=>{if(nl.has(i))return;uf(i,"down");const c=_0(()=>{uf(i,"up")}),u=()=>uf(i,"cancel");i.addEventListener("keyup",c,a),i.addEventListener("blur",u,a)});i.addEventListener("keydown",l,a),i.addEventListener("blur",()=>i.removeEventListener("keydown",l),a)};function x0(n){return Lh(n)&&!I_()}function _2(n,a,i={}){const[l,c,u]=nx(n,i),f=p=>{const m=p.currentTarget;if(!x0(p)||nl.has(m))return;nl.add(m);const v=a(p),g=(S,T)=>{window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",_),!(!x0(S)||!nl.has(m))&&(nl.delete(m),typeof v=="function"&&v(S,{success:T}))},b=S=>{g(S,i.useGlobalTarget||ax(m,S.target))},_=S=>{g(S,!1)};window.addEventListener("pointerup",b,c),window.addEventListener("pointercancel",_,c)};return l.forEach(p=>{!y2(p)&&p.getAttribute("tabindex")===null&&(p.tabIndex=0),(i.useGlobalTarget?window:p).addEventListener("pointerdown",f,c),p.addEventListener("focus",v=>b2(v,c),c)}),u}function S0(n,a,i){const{props:l}=n;n.animationState&&l.whileTap&&n.animationState.setActive("whileTap",i==="Start");const c="onTap"+(i==="End"?"":i),u=l[c];u&&ct.postRender(()=>u(a,Tl(a)))}class x2 extends ds{mount(){const{current:a}=this.node;a&&(this.unmount=_2(a,i=>(S0(this.node,i,"Start"),(l,{success:c})=>S0(this.node,l,c?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Vf=new WeakMap,df=new WeakMap,S2=n=>{const a=Vf.get(n.target);a&&a(n)},T2=n=>{n.forEach(S2)};function k2({root:n,...a}){const i=n||document;df.has(i)||df.set(i,{});const l=df.get(i),c=JSON.stringify(a);return l[c]||(l[c]=new IntersectionObserver(T2,{root:n,...a})),l[c]}function j2(n,a,i){const l=k2(a);return Vf.set(n,i),l.observe(n),()=>{Vf.delete(n),l.unobserve(n)}}const w2={some:0,all:1};class C2 extends ds{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:a={}}=this.node.getProps(),{root:i,margin:l,amount:c="some",once:u}=a,f={root:i?i.current:void 0,rootMargin:l,threshold:typeof c=="number"?c:w2[c]},p=m=>{const{isIntersecting:v}=m;if(this.isInView===v||(this.isInView=v,u&&!v&&this.hasEnteredView))return;v&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",v);const{onViewportEnter:g,onViewportLeave:b}=this.node.getProps(),_=v?g:b;_&&_(m)};return j2(this.node.current,f,p)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:a,prevProps:i}=this.node;["amount","margin","root"].some(N2(a,i))&&this.startObserver()}unmount(){}}function N2({viewport:n={}},{viewport:a={}}={}){return i=>n[i]!==a[i]}const E2={inView:{Feature:C2},tap:{Feature:x2},focus:{Feature:v2},hover:{Feature:m2}},A2={layout:{ProjectionNode:tx,MeasureLayout:Y_}},pc={current:null},Ih={current:!1};function sx(){if(Ih.current=!0,!!oh)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),a=()=>pc.current=n.matches;n.addListener(a),a()}else pc.current=!1}const D2=[...j_,Ft,rs],R2=n=>D2.find(k_(n)),T0=new WeakMap;function M2(n,a,i){for(const l in a){const c=a[l],u=i[l];if(Zt(c))n.addValue(l,c);else if(Zt(u))n.addValue(l,pl(c,{owner:n}));else if(u!==c)if(n.hasValue(l)){const f=n.getValue(l);f.liveStyle===!0?f.jump(c):f.hasAnimated||f.set(c)}else{const f=n.getStaticValue(l);n.addValue(l,pl(f!==void 0?f:c,{owner:n}))}}for(const l in i)a[l]===void 0&&n.removeValue(l);return a}const k0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class O2{scrapeMotionValuesFromProps(a,i,l){return{}}constructor({parent:a,props:i,presenceContext:l,reducedMotionConfig:c,blockInitialAnimation:u,visualState:f},p={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Rh,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 S=ea.now();this.renderScheduledAt<S&&(this.renderScheduledAt=S,ct.render(this.render,!1,!0))};const{latestValues:m,renderState:v,onUpdate:g}=f;this.onUpdate=g,this.latestValues=m,this.baseTarget={...m},this.initialValues=i.initial?{...m}:{},this.renderState=v,this.parent=a,this.props=i,this.presenceContext=l,this.depth=a?a.depth+1:0,this.reducedMotionConfig=c,this.options=p,this.blockInitialAnimation=!!u,this.isControllingVariants=wc(i),this.isVariantNode=Ib(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(a&&a.current);const{willChange:b,..._}=this.scrapeMotionValuesFromProps(i,{},this);for(const S in _){const T=_[S];m[S]!==void 0&&Zt(T)&&T.set(m[S],!1)}}mount(a){this.current=a,T0.set(a,this),this.projection&&!this.projection.instance&&this.projection.mount(a),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,l)=>this.bindToMotionValue(l,i)),Ih.current||sx(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:pc.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){T0.delete(this.current),this.projection&&this.projection.unmount(),ls(this.notifyUpdate),ls(this.render),this.valueSubscriptions.forEach(a=>a()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const a in this.events)this.events[a].clear();for(const a in this.features){const i=this.features[a];i&&(i.unmount(),i.isMounted=!1)}this.current=null}bindToMotionValue(a,i){this.valueSubscriptions.has(a)&&this.valueSubscriptions.get(a)();const l=Ys.has(a),c=i.on("change",p=>{this.latestValues[a]=p,this.props.onUpdate&&ct.preRender(this.notifyUpdate),l&&this.projection&&(this.projection.isTransformDirty=!0)}),u=i.on("renderRequest",this.scheduleRender);let f;window.MotionCheckAppearSync&&(f=window.MotionCheckAppearSync(this,a,i)),this.valueSubscriptions.set(a,()=>{c(),u(),f&&f(),i.owner&&i.stop()})}sortNodePosition(a){return!this.current||!this.sortInstanceNodePosition||this.type!==a.type?0:this.sortInstanceNodePosition(this.current,a.current)}updateFeatures(){let a="animation";for(a in $i){const i=$i[a];if(!i)continue;const{isEnabled:l,Feature:c}=i;if(!this.features[a]&&c&&l(this.props)&&(this.features[a]=new c(this)),this.features[a]){const u=this.features[a];u.isMounted?u.update():(u.mount(),u.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):St()}getStaticValue(a){return this.latestValues[a]}setStaticValue(a,i){this.latestValues[a]=i}update(a,i){(a.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=a,this.prevPresenceContext=this.presenceContext,this.presenceContext=i;for(let l=0;l<k0.length;l++){const c=k0[l];this.propEventSubscriptions[c]&&(this.propEventSubscriptions[c](),delete this.propEventSubscriptions[c]);const u="on"+c,f=a[u];f&&(this.propEventSubscriptions[c]=this.on(c,f))}this.prevMotionValues=M2(this,this.scrapeMotionValuesFromProps(a,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(a){return this.props.variants?this.props.variants[a]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(a){const i=this.getClosestVariantNode();if(i)return i.variantChildren&&i.variantChildren.add(a),()=>i.variantChildren.delete(a)}addValue(a,i){const l=this.values.get(a);i!==l&&(l&&this.removeValue(a),this.bindToMotionValue(a,i),this.values.set(a,i),this.latestValues[a]=i.get())}removeValue(a){this.values.delete(a);const i=this.valueSubscriptions.get(a);i&&(i(),this.valueSubscriptions.delete(a)),delete this.latestValues[a],this.removeValueFromRenderState(a,this.renderState)}hasValue(a){return this.values.has(a)}getValue(a,i){if(this.props.values&&this.props.values[a])return this.props.values[a];let l=this.values.get(a);return l===void 0&&i!==void 0&&(l=pl(i===null?void 0:i,{owner:this}),this.addValue(a,l)),l}readValue(a,i){var l;let c=this.latestValues[a]!==void 0||!this.current?this.latestValues[a]:(l=this.getBaseTargetFromProps(this.props,a))!==null&&l!==void 0?l:this.readValueFromInstance(this.current,a,this.options);return c!=null&&(typeof c=="string"&&(S_(c)||h_(c))?c=parseFloat(c):!R2(c)&&rs.test(i)&&(c=b_(a,i)),this.setBaseTarget(a,Zt(c)?c.get():c)),Zt(c)?c.get():c}setBaseTarget(a,i){this.baseTarget[a]=i}getBaseTarget(a){var i;const{initial:l}=this.props;let c;if(typeof l=="string"||typeof l=="object"){const f=fh(this.props,l,(i=this.presenceContext)===null||i===void 0?void 0:i.custom);f&&(c=f[a])}if(l&&c!==void 0)return c;const u=this.getBaseTargetFromProps(this.props,a);return u!==void 0&&!Zt(u)?u:this.initialValues[a]!==void 0&&c===void 0?void 0:this.baseTarget[a]}on(a,i){return this.events[a]||(this.events[a]=new Th),this.events[a].add(i)}notify(a,...i){this.events[a]&&this.events[a].notify(...i)}}class ix extends O2{constructor(){super(...arguments),this.KeyframeResolver=w_}sortInstanceNodePosition(a,i){return a.compareDocumentPosition(i)&2?1:-1}getBaseTargetFromProps(a,i){return a.style?a.style[i]:void 0}removeValueFromRenderState(a,{vars:i,style:l}){delete i[a],delete l[a]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:a}=this.props;Zt(a)&&(this.childSubscription=a.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}function B2(n){return window.getComputedStyle(n)}class L2 extends ix{constructor(){super(...arguments),this.type="html",this.renderInstance=Kb}readValueFromInstance(a,i){if(Ys.has(i)){const l=Dh(i);return l&&l.default||0}else{const l=B2(a),c=(Gb(i)?l.getPropertyValue(i):l[i])||0;return typeof c=="string"?c.trim():c}}measureInstanceViewportBox(a,{transformPagePoint:i}){return $_(a,i)}build(a,i,l){mh(a,i,l.transformTemplate)}scrapeMotionValuesFromProps(a,i,l){return bh(a,i,l)}}class I2 extends ix{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=St}getBaseTargetFromProps(a,i){return a[i]}readValueFromInstance(a,i){if(Ys.has(i)){const l=Dh(i);return l&&l.default||0}return i=Yb.has(i)?i:ch(i),a.getAttribute(i)}scrapeMotionValuesFromProps(a,i,l){return Xb(a,i,l)}build(a,i,l){vh(a,i,this.isSVGTag,l.transformTemplate)}renderInstance(a,i,l,c){Fb(a,i,l,c)}mount(a){this.isSVGTag=yh(a.tagName),super.mount(a)}}const z2=(n,a)=>dh(n)?new I2(a):new L2(a,{allowProjection:n!==y.Fragment}),U2=dC({...nE,...E2,...f2,...A2},z2),Et=ww(U2);function V2(){!Ih.current&&sx();const[n]=y.useState(pc.current);return n}const Hf={not_started:{color:"var(--text-tertiary)",icon:"○",label:"Not Started"},working:{color:"var(--accent-green)",icon:"●",label:"Working"},paused:{color:"var(--accent-yellow)",icon:"◉",label:"Paused"},complete:{color:"var(--accent-green)",icon:"✓",label:"Complete"},failed:{color:"var(--accent-red)",icon:"✗",label:"Failed"},blocked:{color:"var(--accent-yellow)",icon:"⦸",label:"Blocked"}};function cs(n){return n==="blocked"?Hf.blocked:Hf[zh(n)]}const H2={not_started:"statusPending",working:"statusInProgress",paused:"statusWaitingInput",complete:"statusDone",failed:"statusFailed"};function P2(n){return H2[zh(n)]??"statusPending"}const G2=["working","paused","failed","not_started","blocked","complete"],j0=["not_started","working","paused","complete","failed"],q2={pending:"not_started",assigned:"not_started",in_progress:"working",waiting_input:"paused",review:"paused",done:"complete"};function zh(n){return n in Hf&&n!=="blocked"?n:q2[n]??"not_started"}const $2={not_started:"--text-tertiary",working:"--accent-green",paused:"--accent-yellow",complete:"--accent-green",failed:"--accent-red",pending:"--text-tertiary",assigned:"--text-tertiary",in_progress:"--accent-green",review:"--accent-yellow",done:"--accent-green",waiting_input:"--accent-yellow"};function K2(n){if(n.length===0)return[];const a=[...n].sort((l,c)=>l[0]-c[0]),i=[[a[0][0],a[0][1]]];for(let l=1;l<a.length;l++){const c=i[i.length-1],[u,f]=a[l];u<=c[1]+1?c[1]=Math.max(c[1],f):i.push([u,f])}return i}function ox({text:n,indices:a,highlightClass:i}){if(!a||a.length===0)return r.jsx(r.Fragment,{children:n});const l=K2(a),c=[];let u=0;for(const[f,p]of l)f>u&&c.push(r.jsx("span",{children:n.slice(u,f)},`p${u}`)),c.push(r.jsx("mark",{className:i,children:n.slice(f,p+1)},`m${f}`)),u=p+1;return u<n.length&&c.push(r.jsx("span",{children:n.slice(u)},`p${u}`)),r.jsx(r.Fragment,{children:c})}function Y2(n){const a=new Map(n.map(l=>[l.id,{...l,children:[]}])),i=[];for(const l of a.values())l.parentTaskId&&a.has(l.parentTaskId)?a.get(l.parentTaskId).children.push(l):i.push(l);for(const l of a.values())l.children.sort((c,u)=>c.sortOrder-u.sortOrder);return i.sort((l,c)=>l.sortOrder-c.sortOrder)}function F2(n,a){const i=new Map;for(const u of n){const p=u.dependsOn.length>0&&u.dependsOn.some(v=>a.get(v)!=="complete")?"blocked":u.status,m=i.get(p);m?m.push(u):i.set(p,[u])}const l=[],c=new Set;for(const u of G2){c.add(u);const f=i.get(u);if(f&&f.length>0){f.sort((m,v)=>m.sortOrder-v.sortOrder);const p=cs(u);l.push({status:u,label:p.label,style:p,tasks:f})}}for(const[u,f]of i)if(!c.has(u)&&f.length>0){f.sort((m,v)=>m.sortOrder-v.sortOrder);const p=cs(u);l.push({status:u,label:p.label,style:p,tasks:f})}return l}const Z2="_container_z4i38_1",X2="_header_z4i38_5",Q2="_headerActions_z4i38_17",W2="_searchInput_z4i38_23",J2="_searchHighlight_z4i38_56",eA="_groupToggle_z4i38_62",tA="_groupToggleActive_z4i38_89",nA="_addButton_z4i38_93",aA="_taskRow_z4i38_120",sA="_selected_z4i38_140",iA="_expandArrow_z4i38_150",oA="_expanded_z4i38_157",lA="_leafSpacer_z4i38_161",rA="_taskStatusIcon_z4i38_166",cA="_taskTitle_z4i38_170",uA="_workspaceBadge_z4i38_177",dA="_childCountBadge_z4i38_195",fA="_dependencyBadge_z4i38_208",hA="_blockedBadge_z4i38_220",pA="_addChildButton_z4i38_225",mA="_emptyState_z4i38_268",vA="_statusGroupHeader_z4i38_275",gA="_statusGroupIcon_z4i38_294",yA="_statusGroupLabel_z4i38_298",bA="_statusGroupCount_z4i38_303",Pe={container:Z2,header:X2,headerActions:Q2,searchInput:W2,searchHighlight:J2,groupToggle:eA,groupToggleActive:tA,addButton:nA,taskRow:aA,selected:sA,expandArrow:iA,expanded:oA,leafSpacer:lA,taskStatusIcon:rA,taskTitle:cA,workspaceBadge:uA,childCountBadge:dA,dependencyBadge:fA,blockedBadge:hA,addChildButton:pA,emptyState:mA,statusGroupHeader:vA,statusGroupIcon:gA,statusGroupLabel:yA,statusGroupCount:bA},_A=[{name:"title",weight:2},{name:"description",weight:1}],lx=16,xA=16,rx="grackle-task-group-by-status";function w0(){try{return localStorage.getItem(rx)==="true"}catch{return!1}}function SA(n){try{localStorage.setItem(rx,String(n))}catch{}}function TA({group:n,isExpanded:a,onToggle:i,selectedTaskId:l,navigate:c,titleHighlights:u,workspaceNames:f}){return r.jsxs("div",{"data-testid":`status-group-${n.status}`,children:[r.jsxs("div",{className:Pe.statusGroupHeader,role:"button",tabIndex:0,"aria-expanded":a,onClick:i,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),i())},children:[r.jsx("span",{className:`${Pe.expandArrow} ${a?Pe.expanded:""}`,children:"▸"}),r.jsx("span",{className:Pe.statusGroupIcon,style:{color:n.style.color},children:n.style.icon}),r.jsx("span",{className:Pe.statusGroupLabel,children:n.label}),r.jsx("span",{className:Pe.statusGroupCount,children:n.tasks.length})]}),r.jsx(na,{children:a&&r.jsx(Et.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},style:{overflow:"hidden"},children:n.tasks.map(p=>{const m=cs(p.status),v=l===p.id,g=p.parentTaskId||!p.workspaceId?void 0:f.get(p.workspaceId);return r.jsxs("div",{onClick:()=>c(ta(p.id)),className:`${Pe.taskRow} ${v?Pe.selected:""}`,style:{"--task-indent":`${lx}px`},"data-task-id":p.id,children:[r.jsx("span",{className:Pe.leafSpacer}),r.jsx("span",{className:Pe.taskStatusIcon,style:{color:m.color},children:m.icon}),r.jsx("span",{className:Pe.taskTitle,title:p.title,children:r.jsx(ox,{text:p.title,indices:u.get(p.id),highlightClass:Pe.searchHighlight})}),g&&r.jsx("span",{className:Pe.workspaceBadge,title:g,children:g})]},p.id)})})})]})}function cx({node:n,depth:a,expandedTasks:i,toggleTask:l,selectedTaskId:c,navigate:u,taskStatusById:f,titleHighlights:p,workspaceNames:m}){const v=cs(n.status),g=n.dependsOn.length>0&&n.dependsOn.some(k=>f.get(k)!=="complete"),b=i.has(n.id),_=n.children.length>0,S=c===n.id,T=lx+a*xA,w=a===0&&!n.parentTaskId&&n.workspaceId?m.get(n.workspaceId):void 0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{onClick:()=>u(ta(n.id)),className:`${Pe.taskRow} ${S?Pe.selected:""}`,style:{"--task-indent":`${T}px`},"data-task-id":n.id,children:[_&&r.jsx("span",{className:`${Pe.expandArrow} ${b?Pe.expanded:""}`,role:"button",tabIndex:0,"aria-label":b?"Collapse task":"Expand task",onClick:k=>{k.stopPropagation(),l(n.id)},onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),k.stopPropagation(),l(n.id))},children:"▸"}),!_&&r.jsx("span",{className:Pe.leafSpacer}),r.jsx("span",{className:Pe.taskStatusIcon,style:{color:v.color},children:v.icon}),r.jsx("span",{className:Pe.taskTitle,title:n.title,children:r.jsx(ox,{text:n.title,indices:p.get(n.id),highlightClass:Pe.searchHighlight})}),w&&r.jsx("span",{className:Pe.workspaceBadge,title:w,children:w}),_&&r.jsxs("span",{className:Pe.childCountBadge,children:[n.children.filter(k=>k.status==="complete").length,"/",n.children.length]}),n.dependsOn.length>0&&r.jsx("span",{className:`${Pe.dependencyBadge} ${g?Pe.blockedBadge:""}`,title:`Depends on: ${n.dependsOn.join(", ")}`,children:g?"blocked":"dep"}),a<JS&&r.jsx("button",{onClick:k=>{k.stopPropagation(),u(Ks(n.workspaceId,n.id))},title:"Add child task","aria-label":"Add child task",className:Pe.addChildButton,children:"+"})]}),r.jsx(na,{children:_&&b&&r.jsx(Et.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.15},style:{overflow:"hidden"},children:n.children.map(k=>r.jsx(cx,{node:k,depth:a+1,expandedTasks:i,toggleTask:l,selectedTaskId:c,navigate:u,taskStatusById:f,titleHighlights:p,workspaceNames:m},k.id))})})]})}function kA({workspaces:n,tasks:a}){const i=bt(),[l,c]=y.useState(new Set),[u,f]=y.useState(new Set),[p,m]=y.useState(w0),[v,g]=y.useState(w0),[b,_]=y.useState(new Map),S=Nt("/tasks/:taskId/*"),T=(S==null?void 0:S.params.taskId)!=="new"?S==null?void 0:S.params.taskId:void 0,C=y.useMemo(()=>new Map(a.map($=>[$.id,$.status])),[a]),w=y.useMemo(()=>new Map(n.map($=>[$.id,$.name])),[n]),k=()=>{const $=!p;SA($),m($),$&&(g(!0),_(new Map))},E=$=>{_(ae=>{const O=new Map(ae),G=O.has($)?O.get($):v;return O.set($,!G),O})},A=$=>b.has($)?b.get($):v,R=$=>{c(ae=>{const O=new Set(ae);return O.has($)?(O.delete($),f(G=>new Set(G).add($))):(O.add($),f(G=>{const Q=new Set(G);return Q.delete($),Q})),O})};y.useEffect(()=>{const $=new Set(a.filter(ae=>ae.parentTaskId).map(ae=>ae.parentTaskId));$.size>0&&c(ae=>{const O=new Set(ae);for(const G of $)u.has(G)||O.add(G);return O})},[a,u]);const[N,z]=y.useState(""),{directMatchTaskIds:H,treeMatchTaskIds:B,titleHighlights:K}=y.useMemo(()=>{if(!N.trim())return{directMatchTaskIds:null,treeMatchTaskIds:null,titleHighlights:new Map};const $=WS(a,N,_A),ae=new Set($.map(oe=>oe.item.id)),O=new Map;for(const oe of $){const le=oe.matches.find(De=>De.key==="title");le&&O.set(oe.item.id,le.indices)}const G=new Set(ae),Q=new Map(a.map(oe=>[oe.id,oe]));for(const oe of[...ae]){let le=Q.get(oe);for(;le!=null&&le.parentTaskId;)G.add(le.parentTaskId),le=Q.get(le.parentTaskId)}return{directMatchTaskIds:ae,treeMatchTaskIds:G,titleHighlights:O}},[N,a]),W=H!==null,se=W?p?H:B:null,ne=se?a.filter($=>se.has($.id)):a,re=p?[]:Y2(ne);return r.jsxs("div",{className:Pe.container,children:[r.jsxs("div",{className:Pe.header,children:[r.jsx("span",{children:"Tasks"}),r.jsxs("div",{className:Pe.headerActions,children:[r.jsx("button",{className:`${Pe.groupToggle} ${p?Pe.groupToggleActive:""}`,onClick:k,"aria-label":p?"Switch to tree view":"Group tasks by status","aria-pressed":p,title:p?"Switch to tree view":"Group tasks by status","data-testid":"task-group-by-status-toggle",children:"≡"}),r.jsx("button",{className:Pe.addButton,onClick:()=>i(Ks()),"aria-label":"New task",title:"New task","data-testid":"new-task-button",children:"+"})]})]}),a.length>0&&r.jsx("input",{type:"text",value:N,onChange:$=>z($.target.value),placeholder:"Filter...","aria-label":"Filter tasks",className:Pe.searchInput,"data-testid":"sidebar-search"}),p?F2(ne,C).map($=>r.jsx(TA,{group:$,isExpanded:A($.status),onToggle:()=>E($.status),selectedTaskId:T,navigate:i,titleHighlights:K,workspaceNames:w},$.status)):re.map($=>r.jsx(cx,{node:$,depth:0,expandedTasks:l,toggleTask:R,selectedTaskId:T,navigate:i,taskStatusById:C,titleHighlights:K,workspaceNames:w},$.id)),ne.length===0&&!W&&r.jsx("div",{className:Pe.emptyState,children:"No tasks yet. Click + to create one."}),ne.length===0&&W&&r.jsx("div",{className:Pe.emptyState,children:"No matching tasks"})]})}const jA="_nav_14i94_1",wA="_tab_14i94_24",CA="_tabActive_14i94_62",NA="_tabLabel_14i94_75",EA="_statusDot_14i94_81",AA="_pulse_14i94_87",DA="_addButton_14i94_99",RA="_empty_14i94_132",as={nav:jA,tab:wA,tabActive:CA,tabLabel:NA,statusDot:EA,pulse:AA,addButton:DA,empty:RA},MA={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function OA({environments:n}){const a=bt(),i=y.useRef(null),l=Nt("/environments/:environmentId"),c=Nt("/environments/:environmentId/edit"),u=Nt("/environments/:environmentId/workspaces/:workspaceId"),f=Nt("/environments/:environmentId/workspaces/:workspaceId/*"),p=(l==null?void 0:l.params.environmentId)??(c==null?void 0:c.params.environmentId)??(u==null?void 0:u.params.environmentId)??(f==null?void 0:f.params.environmentId),m=p==="new"?void 0:p,v=y.useCallback(_=>{a(qi(_))},[a]),g=y.useCallback(_=>{var k;const S=(k=i.current)==null?void 0:k.querySelectorAll('[role="tab"]');if(!S||S.length===0)return;const T=Array.from(S).findIndex(E=>E===document.activeElement),C=T>=0?T:n.findIndex(E=>E.id===m);let w=C;if(_.key==="ArrowDown"||_.key==="j"||_.key==="J")_.preventDefault(),w=(C+1)%S.length;else if(_.key==="ArrowUp"||_.key==="k"||_.key==="K")_.preventDefault(),w=(C-1+S.length)%S.length;else if(_.key==="Home")_.preventDefault(),w=0;else if(_.key==="End")_.preventDefault(),w=S.length-1;else return;w<n.length&&a(qi(n[w].id)),S[w].focus()},[m,n,a]),b=m??(n.length>0?n[0].id:void 0);return r.jsxs("div",{className:as.nav,"data-testid":"environment-nav",children:[r.jsx("nav",{ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Environments",onKeyDown:g,children:n.map(_=>{const S=_.id===m,T=_.id===b,C=MA[_.status]||"var(--text-tertiary)",w=_.status==="connected";return r.jsxs("button",{role:"tab",type:"button","aria-selected":S,tabIndex:T?0:-1,className:`${as.tab} ${S?as.tabActive:""}`,onClick:()=>v(_.id),"data-testid":"env-nav-item",children:[r.jsx("span",{className:`${as.statusDot} ${w?as.pulse:""}`,style:{color:C},children:"●"}),r.jsx("span",{className:as.tabLabel,title:_.displayName||_.id,children:_.displayName||_.id})]},_.id)})}),r.jsx("button",{type:"button",className:as.addButton,onClick:()=>a(Xk),title:"Add environment","data-testid":"env-nav-add",children:"+ Add Environment"}),n.length===0&&r.jsx("div",{className:as.empty,children:"No environments yet."})]})}const BA="_nav_1bhou_1",LA="_tab_1bhou_24",IA="_tabIcon_1bhou_62",zA="_tabActive_1bhou_68",Yr={nav:BA,tab:LA,tabIcon:IA,tabActive:zA},Sa=[{path:"credentials",label:"Credentials",icon:"🔑"},{path:"personas",label:"Personas",icon:"👤"},{path:"appearance",label:"Appearance",icon:"🎨"},{path:"shortcuts",label:"Shortcuts",icon:"⌨️"},{path:"about",label:"About",icon:"ℹ️"}];function UA(){var f;const n=Bt(),a=bt(),i=y.useRef(null),l=((f=Sa.find(p=>{const m=`${Hi}/${p.path}`;return n.pathname===m||n.pathname.startsWith(`${m}/`)}))==null?void 0:f.path)??Sa[0].path,c=y.useCallback(p=>{a(`${Hi}/${p}`)},[a]),u=y.useCallback(p=>{var S,T;const m=(S=i.current)==null?void 0:S.querySelectorAll('[role="tab"]');if(!m)return;const v=Array.from(m).findIndex(C=>C===document.activeElement),g=v>=0?v:Sa.findIndex(C=>C.path===l);let b=g;if(p.key==="ArrowDown"||p.key==="j"||p.key==="J")p.preventDefault(),b=(g+1)%Sa.length;else if(p.key==="ArrowUp"||p.key==="k"||p.key==="K")p.preventDefault(),b=(g-1+Sa.length)%Sa.length;else if(p.key==="Home")p.preventDefault(),b=0;else if(p.key==="End")p.preventDefault(),b=Sa.length-1;else return;const _=Sa[b].path;a(`${Hi}/${_}`),(T=m[b])==null||T.focus()},[l,a]);return r.jsx("nav",{className:Yr.nav,ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Settings",onKeyDown:u,children:Sa.map(p=>{const m=p.path===l;return r.jsxs("button",{role:"tab",type:"button","aria-selected":m,tabIndex:m?0:-1,className:`${Yr.tab} ${m?Yr.tabActive:""}`,onClick:()=>c(p.path),children:[r.jsx("span",{className:Yr.tabIcon,"aria-hidden":"true",children:p.icon}),p.label]},p.path)})})}const VA="_nav_1snmp_1",HA="_searchForm_1snmp_8",PA="_searchInput_1snmp_15",GA="_searchButton_1snmp_33",qA="_clearButton_1snmp_68",$A="_workspaceSelect_1snmp_85",KA="_listHeader_1snmp_99",YA="_nodeList_1snmp_108",FA="_nodeItem_1snmp_116",ZA="_indicator_1snmp_129",XA="_label_1snmp_136",QA="_badge_1snmp_145",Mn={nav:VA,searchForm:HA,searchInput:PA,searchButton:GA,clearButton:qA,workspaceSelect:$A,listHeader:KA,nodeList:YA,nodeItem:FA,indicator:ZA,label:XA,badge:QA};function WA({nodes:n,workspaces:a,loading:i,searchQuery:l,onSearch:c,onClearSearch:u,onSelectNode:f,onWorkspaceChange:p}){const[m,v]=y.useState(""),g=y.useCallback(T=>{T.preventDefault(),m.trim()&&c(m.trim())},[m,c]),b=y.useCallback(()=>{v(""),u()},[u]),_=y.useCallback(T=>{f(T)},[f]),S=y.useCallback(T=>{v(""),p(T)},[p]);return r.jsxs("div",{className:Mn.nav,"data-testid":"knowledge-nav",children:[r.jsxs("form",{className:Mn.searchForm,onSubmit:g,children:[r.jsx("input",{className:Mn.searchInput,type:"text",placeholder:"Search...",value:m,onChange:T=>{v(T.target.value)},"data-testid":"knowledge-search-input"}),r.jsx("button",{type:"submit",className:Mn.searchButton,disabled:i,children:"Go"})]}),l&&r.jsx("button",{type:"button",className:Mn.clearButton,onClick:b,children:"Clear search"}),r.jsxs("select",{className:Mn.workspaceSelect,onChange:T=>{S(T.target.value)},"data-testid":"knowledge-workspace-filter",children:[r.jsx("option",{value:"",children:"All workspaces"}),a.map(T=>r.jsx("option",{value:T.id,children:T.name},T.id))]}),r.jsxs("div",{className:Mn.listHeader,children:["Nodes (",n.length,")"]}),r.jsx("ul",{className:Mn.nodeList,children:n.map(T=>r.jsxs("li",{className:Mn.nodeItem,onClick:()=>{_(T.id)},onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),_(T.id))},role:"button",tabIndex:0,children:[r.jsx("span",{className:Mn.indicator,style:{backgroundColor:T.kind==="reference"?"#4A9EFF":T.category==="decision"?"#22C55E":T.category==="concept"?"#A855F7":T.category==="snippet"?"#6B7280":"#EAB308"}}),r.jsx("span",{className:Mn.label,children:T.label}),r.jsx("span",{className:Mn.badge,children:T.kind==="reference"?T.sourceType:T.category})]},T.id))})]})}function JA(){const{workspaces:n,tasks:a}=ut(),i=y.useMemo(()=>r.jsx(kA,{workspaces:n,tasks:a}),[n,a]);return Sc(i),r.jsx($s,{})}function eD(){const{environments:n}=ut(),a=y.useMemo(()=>r.jsx(OA,{environments:n}),[n]);return Sc(a),r.jsx($s,{})}function tD(){const n=y.useMemo(()=>r.jsx(UA,{}),[]);return Sc(n),r.jsx($s,{})}function nD(){const{knowledge:n,workspaces:a}=ut(),i=y.useCallback(p=>{n.search(p)},[n]),l=y.useCallback(()=>{n.clearSearch()},[n]),c=y.useCallback(p=>{n.selectNode(p)},[n]),u=y.useCallback(p=>{n.loadRecent(p||void 0)},[n]),f=y.useMemo(()=>r.jsx(WA,{nodes:n.graphData.nodes,workspaces:a,loading:n.loading,searchQuery:n.searchQuery,onSearch:i,onClearSearch:l,onSelectNode:c,onWorkspaceChange:u}),[n,a,i,l,c,u]);return Sc(f),r.jsx($s,{})}const aD="_bar_tnfsh_1",sD="_btnPrimary_tnfsh_32",iD="_statusText_tnfsh_85",oD="_statusCompleted_tnfsh_90",lD="_statusFailed_tnfsh_94",rD="_statusBlocked_tnfsh_98",cD="_hintText_tnfsh_103",ft={bar:aD,btnPrimary:sD,statusText:iD,statusCompleted:oD,statusFailed:lD,statusBlocked:rD,hintText:cD};function uD({sessions:n,tasks:a,environments:i}){const l=bt(),c=Bt(),u=Nt("/sessions/:sessionId"),f=Nt("/tasks/:taskId"),p=Nt("/tasks/:taskId/stream"),m=Nt("/tasks/:taskId/findings"),v=Nt("/tasks/:taskId/edit"),g=Nt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId"),b=Nt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream"),_=Nt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings"),S=Nt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit"),T=Nt("/sessions/new"),C=Nt("/environments/:environmentId/workspaces/:workspaceId"),w=Nt("/tasks/new"),k=Nt("/chat"),E=Nt("/"),A=Nt("/settings/*"),R=u==null?void 0:u.params.sessionId,N=(f==null?void 0:f.params.taskId)??(p==null?void 0:p.params.taskId)??(m==null?void 0:m.params.taskId)??(g==null?void 0:g.params.taskId)??(b==null?void 0:b.params.taskId)??(_==null?void 0:_.params.taskId)??(S==null?void 0:S.params.taskId),z=g??b??_??S,H=(z==null?void 0:z.params.environmentId)??(C==null?void 0:C.params.environmentId),B=c.pathname.startsWith("/environments")&&!C&&!z,K=!!k,W=!!T,se=!!C&&!g&&!b&&!_&&!S,ne=!!w;if(!!E&&!W&&!se&&!ne||!!A||(!!v||!!S)||ne||B||W)return r.jsx(r.Fragment,{});if(K)return i.find(G=>G.adapterType==="local"&&G.status==="connected")?r.jsx(r.Fragment,{}):r.jsx("div",{className:ft.bar,children:r.jsx("span",{className:ft.hintText,children:"Add a local environment to start chatting"})});if(se)return r.jsx("div",{className:ft.bar,children:r.jsx("span",{className:ft.hintText,children:"Select a task or click + to create one"})});if(N){const O=a.find(oe=>oe.id===N);if(!O)return r.jsx("div",{className:ft.bar,children:r.jsx("span",{className:ft.hintText,children:"Loading..."})});const G=new Map(a.map(oe=>[oe.id,oe])),Q=O.dependsOn.some(oe=>{const le=G.get(oe);return le!==void 0&&le.status!=="complete"});if(O.status==="not_started"){const oe=Q?O.dependsOn.map(le=>G.get(le)).filter(le=>le&&le.status!=="complete").map(le=>le.title):[];return r.jsx("div",{className:ft.bar,children:Q?r.jsxs("span",{className:ft.statusBlocked,children:["Blocked by: ",oe.join(", ")]}):r.jsx("span",{className:ft.hintText,children:"Use the buttons above to start or manage this task"})})}if(O.status==="working"||O.status==="paused"){const oe=O.latestSessionId||void 0,le=oe?n.find(we=>we.id===oe):void 0;return le&&le.status!=="stopped"?r.jsx(r.Fragment,{}):r.jsx("div",{className:ft.bar,children:r.jsx("span",{className:ft.hintText,children:"Waiting for agent..."})})}if(O.status==="complete")return r.jsxs("div",{className:ft.bar,children:[r.jsx("span",{className:`${ft.statusText} ${ft.statusCompleted}`,children:"Task completed"}),r.jsx("button",{onClick:()=>l(Ks(O.workspaceId,void 0,H)),className:ft.btnPrimary,children:"+ New Task"})]});if(O.status==="failed")return r.jsx("div",{className:ft.bar,children:r.jsx("span",{className:`${ft.statusText} ${ft.statusFailed}`,children:"Task failed"})})}if(R){const O=n.find(oe=>oe.id===R),G=(O==null?void 0:O.status)==="stopped";if(O!==void 0&&!G)return r.jsx(r.Fragment,{});if(G)return r.jsxs("div",{className:ft.bar,children:[r.jsxs("span",{className:`${ft.statusText} ${ft.hintText}`,children:["Session ",O.endReason||O.status]}),r.jsx("button",{onClick:()=>l(pb(O.environmentId)),className:ft.btnPrimary,children:"+ New Chat"})]})}return r.jsx("div",{className:ft.bar,children:r.jsx("span",{className:ft.hintText,children:"Loading..."})})}const dD="_toast_da8ll_1",fD="_success_da8ll_18",hD="_icon_da8ll_22",pD="_error_da8ll_25",mD="_warning_da8ll_32",vD="_info_da8ll_38",gD="_message_da8ll_53",yD="_close_da8ll_60",Qo={toast:dD,success:fD,icon:hD,error:pD,warning:mD,info:vD,message:gD,close:yD},bD={success:"✓",error:"✕",warning:"⚠",info:"ℹ"};function _D({toast:n,onDismiss:a}){return y.useEffect(()=>{const i=setTimeout(()=>a(n.id),n.duration);return()=>clearTimeout(i)},[n.id,n.duration,a]),r.jsxs(Et.div,{className:`${Qo.toast} ${Qo[n.variant]}`,role:"status",initial:{opacity:0,y:-16,scale:.94},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.94},transition:{duration:.2,ease:"easeOut"},layout:!0,children:[r.jsx("span",{className:Qo.icon,"aria-hidden":"true",children:bD[n.variant]}),r.jsx("span",{className:Qo.message,children:n.message}),r.jsx("button",{type:"button",className:Qo.close,onClick:()=>a(n.id),"aria-label":"Dismiss notification",children:"×"})]})}const xD="_container_qqse2_1",SD={container:xD};function TD(){const{toasts:n,dismissToast:a}=Aa();return r.jsx("div",{className:SD.container,"data-testid":"toast-container",children:r.jsx(na,{children:n.map(i=>r.jsx(_D,{toast:i,onDismiss:a},i.id))})})}const kD="_callout_1jaue_1",jD="_success_1jaue_11",wD="_icon_1jaue_15",CD="_error_1jaue_18",ND="_warning_1jaue_25",ED="_info_1jaue_32",AD="_content_1jaue_48",DD="_close_1jaue_53",Wo={callout:kD,success:jD,icon:wD,error:CD,warning:ND,info:ED,content:AD,close:DD},RD={success:"✓",error:"✕",warning:"⚠",info:"ℹ"};function MD({variant:n="info",children:a,dismissible:i=!1,className:l}){const[c,u]=y.useState(!1);return r.jsx(r.Fragment,{children:!c&&r.jsxs("div",{className:[Wo.callout,Wo[n],l].filter(Boolean).join(" "),role:n==="error"||n==="warning"?"alert":"status",children:[r.jsx("span",{className:Wo.icon,"aria-hidden":"true",children:RD[n]}),r.jsx("span",{className:Wo.content,children:a}),i&&r.jsx("button",{type:"button",className:Wo.close,onClick:()=>u(!0),"aria-label":"Dismiss",children:"×"})]})})}const OD="_breadcrumbs_17or2_1",BD="_list_17or2_11",LD="_item_17or2_21",ID="_separator_17or2_28",zD="_link_17or2_34",UD="_current_17or2_57",Mi={breadcrumbs:OD,list:BD,item:LD,separator:ID,link:zD,current:UD},VD="›";function fs({segments:n}){return r.jsx("nav",{className:Mi.breadcrumbs,"aria-label":"Breadcrumb","data-testid":"breadcrumbs",children:r.jsx("ol",{className:Mi.list,children:n.map((a,i)=>{const l=i===n.length-1;return r.jsxs("li",{className:Mi.item,children:[i>0&&r.jsx("span",{className:Mi.separator,"aria-hidden":"true",children:VD}),a.url&&!l?r.jsx(eh,{className:Mi.link,to:a.url,title:a.label,children:a.label}):r.jsx("span",{className:Mi.current,"aria-current":"page",title:a.label,children:a.label})]},i)})})})}const HD="_btn_dwk2o_1",PD="_sm_dwk2o_22",GD="_md_dwk2o_28",qD="_lg_dwk2o_34",$D="_primary_dwk2o_40",KD="_danger_dwk2o_55",YD="_outline_dwk2o_70",FD="_ghost_dwk2o_80",ff={btn:HD,sm:PD,md:GD,lg:qD,primary:$D,danger:KD,outline:YD,ghost:FD},ka=y.forwardRef(function({variant:a="primary",size:i="md",className:l,children:c,...u},f){const p=[ff.btn,ff[a],ff[i],l].filter(Boolean).join(" ");return r.jsx("button",{ref:f,className:p,...u,children:c})}),ZD="_banner_bxqlh_1",XD="_label_bxqlh_15",QD="_text_bxqlh_25",WD="_link_bxqlh_29",Fr={banner:ZD,label:XD,text:QD,link:WD};function JD(){return r.jsxs("div",{className:Fr.banner,"data-testid":"demo-banner",children:[r.jsx("span",{className:Fr.label,children:"DEMO"}),r.jsxs("span",{className:Fr.text,children:["This is an interactive demo with mock data."," ",r.jsx("a",{href:"https://github.com/nick-pape/grackle",target:"_blank",rel:"noopener noreferrer",className:Fr.link,children:"Install Grackle"})," ","to use it for real."]})]})}const eR="_container_og0yp_1",tR="_chevronButton_og0yp_6",nR="_mainButton_og0yp_6",aR="_sm_og0yp_34",sR="_md_og0yp_34",iR="_lg_og0yp_34",oR="_primary_og0yp_57",lR="_danger_og0yp_70",rR="_outline_og0yp_83",cR="_ghost_og0yp_92",uR="_dropdown_og0yp_100",dR="_option_og0yp_113",fR="_optionLabel_og0yp_130",hR="_optionDesc_og0yp_135",Ta={container:eR,chevronButton:tR,mainButton:nR,sm:aR,md:sR,lg:iR,primary:oR,danger:lR,outline:rR,ghost:cR,dropdown:uR,option:dR,optionLabel:fR,optionDesc:hR};function ux({label:n,onClick:a,options:i,variant:l="primary",size:c="md","data-testid":u}){const[f,p]=y.useState(!1),m=y.useRef(null);y.useEffect(()=>{if(!f)return;function _(S){m.current&&S.target instanceof Node&&!m.current.contains(S.target)&&p(!1)}return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[f]),y.useEffect(()=>{if(!f)return;function _(S){S.key==="Escape"&&p(!1)}return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[f]);const v=Ta[l]||"",g=Ta[c]||"",b=()=>{f&&p(!1),a()};return r.jsxs("div",{ref:m,className:Ta.container,"data-testid":u,children:[r.jsx("button",{type:"button",className:`${Ta.mainButton} ${v} ${g}`,onClick:b,"data-testid":u?`${u}-main`:void 0,children:n}),r.jsx("button",{type:"button",className:`${Ta.chevronButton} ${v} ${g}`,onClick:()=>p(_=>!_),"aria-label":`More options for ${n}`,"aria-haspopup":"menu","aria-expanded":f,"data-testid":u?`${u}-chevron`:void 0,children:"▾"}),f&&r.jsx("div",{className:Ta.dropdown,"data-testid":u?`${u}-menu`:void 0,children:i.map((_,S)=>r.jsxs("button",{type:"button",className:Ta.option,onClick:()=>{_.onClick(),p(!1)},children:[r.jsx("span",{className:Ta.optionLabel,children:_.label}),_.description&&r.jsx("span",{className:Ta.optionDesc,children:_.description})]},S))})]})}function Pf(){Pf=function(c,u){return new i(c,void 0,u)};var n=RegExp.prototype,a=new WeakMap;function i(c,u,f){var p=new RegExp(c,u);return a.set(p,f||a.get(c)),mc(p,i.prototype)}function l(c,u){var f=a.get(u);return Object.keys(f).reduce(function(p,m){var v=f[m];if(typeof v=="number")p[m]=c[v];else{for(var g=0;c[v[g]]===void 0&&g+1<v.length;)g++;p[m]=c[v[g]]}return p},Object.create(null))}return(function(c,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(u&&u.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),u&&mc(c,u)})(i,RegExp),i.prototype.exec=function(c){var u=n.exec.call(this,c);if(u){u.groups=l(u,this);var f=u.indices;f&&(f.groups=l(f,this))}return u},i.prototype[Symbol.replace]=function(c,u){if(typeof u=="string"){var f=a.get(this);return n[Symbol.replace].call(this,c,u.replace(/\$<([^>]+)>/g,function(m,v){var g=f[v];return"$"+(Array.isArray(g)?g.join("$"):g)}))}if(typeof u=="function"){var p=this;return n[Symbol.replace].call(this,c,function(){var m=arguments;return typeof m[m.length-1]!="object"&&(m=[].slice.call(m)).push(l(m,p)),u.apply(this,m)})}return n[Symbol.replace].call(this,c,u)},Pf.apply(this,arguments)}function mc(n,a){return mc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,l){return i.__proto__=l,i},mc(n,a)}function C0(n,a){(a==null||a>n.length)&&(a=n.length);for(var i=0,l=new Array(a);i<a;i++)l[i]=n[i];return l}function hf(n,a){var i=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i)return(i=i.call(n)).next.bind(i);if(Array.isArray(n)||(i=(function(c,u){if(c){if(typeof c=="string")return C0(c,u);var f=Object.prototype.toString.call(c).slice(8,-1);return f==="Object"&&c.constructor&&(f=c.constructor.name),f==="Map"||f==="Set"?Array.from(c):f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f)?C0(c,u):void 0}})(n))||a){i&&(n=i);var l=0;return function(){return l>=n.length?{done:!0}:{done:!1,value:n[l++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
99
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var pR=(function(n){return function(a){return a===void 0&&(a={}),(function(l,c){if(c&&!l.registered(c))throw new Error('The default language "'+c+'" is not registered with refractor.')})(n,a.defaultLanguage),function(l){BS(l,"element",i)};function i(l,c,u){var f,p;if(u&&u.tagName==="pre"&&l.tagName==="code"){var m=(l==null||(f=l.data)==null?void 0:f.meta)||(l==null||(p=l.properties)==null?void 0:p.metastring)||"";l.properties.className?typeof l.properties.className=="boolean"?l.properties.className=[]:Array.isArray(l.properties.className)||(l.properties.className=[l.properties.className]):l.properties.className=[];var v,g,b=(function(N){for(var z,H=hf(N.properties.className);!(z=H()).done;){var B=z.value;if(B.slice(0,9)==="language-")return B.slice(9).toLowerCase()}return null})(l);if(!b&&a.defaultLanguage&&l.properties.className.push("language-"+(b=a.defaultLanguage)),l.properties.className.push("code-highlight"),b)try{var _,S;S=(_=b)!=null&&_.includes("diff-")?b.split("-")[1]:b,v=n.highlight(zr(l),S),u.properties.className=(u.properties.className||[]).concat("language-"+S)}catch(N){if(!a.ignoreMissing||!/Unknown language/.test(N.message))throw N;v=l}else v=l;v.children=(g=1,function N(z){return z.reduce(function(H,B){if(B.type==="text"){var K=B.value,W=(K.match(/\n/g)||"").length;if(W===0)B.position={start:{line:g,column:1},end:{line:g,column:1}},H.push(B);else for(var se,ne=K.split(`
100
+ `),re=hf(ne.entries());!(se=re()).done;){var $=se.value,ae=$[0],O=$[1];H.push({type:"text",value:ae===ne.length-1?O:O+`
101
+ `,position:{start:{line:g+ae,column:1},end:{line:g+ae,column:1}}})}return g+=W,H}if(Object.prototype.hasOwnProperty.call(B,"children")){var G=g;return B.children=N(B.children),H.push(B),B.position={start:{line:G,column:1},end:{line:g,column:1}},H}return H.push(B),H},[])})(v.children),v.position=v.children.length>0?{start:{line:v.children[0].position.start.line,column:0},end:{line:v.children[v.children.length-1].position.end.line,column:0}}:{start:{line:0,column:0},end:{line:0,column:0}};for(var T,C=(function(N){var z=/{([\d,-]+)}/,H=N.split(",").map(function(W){return W.trim()}).join();if(z.test(H)){var B=z.exec(H)[1],K=IS(B);return function(W){return K.includes(W+1)}}return function(){return!1}})(m),w=(function(N){var z=Pf(/showLineNumbers=(\d+)/i,{lines:1});if(z.test(N)){var H=z.exec(N);return Number(H.groups.lines)}return 1})(m),k=(function(N){for(var z=new Array(N),H=0;H<N;H++)z[H]={type:"element",tagName:"span",properties:{className:[]},children:[]};return z})(v.position.end.line),E=["showlinenumbers=false",'showlinenumbers="false"',"showlinenumbers={false}"],A=function(){var N,z,H=T.value,B=H[0],K=H[1];K.properties.className=["code-line"];var W=zS(v,function(se){return se.position.start.line<=B+1&&se.position.end.line>=B+1});K.children=W.children,(m.toLowerCase().includes("showLineNumbers".toLowerCase())||a.showLineNumbers===!0||typeof a.showLineNumbers=="object"&&a.showLineNumbers.includes(b))&&!E.some(function(se){return m.toLowerCase().includes(se)})&&(K.properties.line=[(B+w).toString()],K.properties.className.push("line-number")),C(B)&&K.properties.className.push("highlight-line"),(b==="diff"||(N=b)!=null&&N.includes("diff-"))&&zr(K).substring(0,1)==="-"?K.properties.className.push("deleted"):(b==="diff"||(z=b)!=null&&z.includes("diff-"))&&zr(K).substring(0,1)==="+"&&K.properties.className.push("inserted")},R=hf(k.entries());!(T=R()).done;)A();k.length>0&&zr(k[k.length-1]).trim()===""&&k.pop(),l.children=k}}}})(LS);function dx(n){if(n>=1e6)return`${(n/1e6).toFixed(1)}M`;if(n>=1e3){const a=Number((n/1e3).toFixed(1));return a>=1e3?`${(n/1e6).toFixed(1)}M`:`${a.toFixed(1)}k`}return String(n)}function Fi(n){return n===0?"-":n<.01?`$${n.toFixed(4)}`:`$${n.toFixed(2)}`}const mR="_systemContextEvent_1qbiw_1",vR="_systemContextHeader_1qbiw_7",gR="_systemContextBadge_1qbiw_28",yR="_systemContextToggle_1qbiw_37",bR="_systemContextPre_1qbiw_43",_R="_systemContextEllipsis_1qbiw_54",xR="_systemEvent_1qbiw_58",SR="_systemTimestamp_1qbiw_65",TR="_textEvent_1qbiw_69",kR="_toolUseEvent_1qbiw_155",jR="_toolUseHeader_1qbiw_175",wR="_toolUsePrefix_1qbiw_182",CR="_toolUseName_1qbiw_187",NR="_toolUseArgs_1qbiw_192",ER="_toolResultEvent_1qbiw_203",AR="_toolResultHeader_1qbiw_208",DR="_toolResultIndicatorOk_1qbiw_232",RR="_toolResultIndicatorError_1qbiw_239",MR="_toolResultLabel_1qbiw_246",OR="_toolResultToggle_1qbiw_250",BR="_toolResultCommand_1qbiw_256",LR="_toolResultEllipsis_1qbiw_266",IR="_toolResultPre_1qbiw_270",zR="_errorEvent_1qbiw_291",UR="_statusEvent_1qbiw_299",VR="_userInputEvent_1qbiw_308",HR="_userInputContent_1qbiw_314",PR="_signalEvent_1qbiw_331",GR="_signalBadge_1qbiw_342",qR="_signalContent_1qbiw_351",$R="_usageEvent_1qbiw_356",KR="_usageBadge_1qbiw_363",YR="_defaultEvent_1qbiw_372",qe={systemContextEvent:mR,systemContextHeader:vR,systemContextBadge:gR,systemContextToggle:yR,systemContextPre:bR,systemContextEllipsis:_R,systemEvent:xR,systemTimestamp:SR,textEvent:TR,toolUseEvent:kR,toolUseHeader:jR,toolUsePrefix:wR,toolUseName:CR,toolUseArgs:NR,toolResultEvent:ER,toolResultHeader:AR,toolResultIndicatorOk:DR,toolResultIndicatorError:RR,toolResultLabel:MR,toolResultToggle:OR,toolResultCommand:BR,toolResultEllipsis:LR,toolResultPre:IR,errorEvent:zR,statusEvent:UR,userInputEvent:VR,userInputContent:HR,signalEvent:PR,signalBadge:GR,signalContent:qR,usageEvent:$R,usageBadge:KR,defaultEvent:YR},N0=3;function FR({content:n}){const[a,i]=y.useState(!1),l=n.split(`
102
+ `),c=l.length>N0,u=a?n:l.slice(0,N0).join(`
103
+ `);return r.jsxs("div",{className:qe.systemContextEvent,"data-testid":"system-context-event",children:[r.jsxs("button",{type:"button",className:qe.systemContextHeader,onClick:()=>{i(f=>!f)},"aria-expanded":a,children:[r.jsx("span",{className:qe.systemContextBadge,children:"SYSTEM PROMPT"}),c&&r.jsx("span",{className:qe.systemContextToggle,"aria-hidden":"true",children:a?"▾":"▸"})]}),r.jsxs("pre",{className:qe.systemContextPre,children:[u,!a&&c&&r.jsx("span",{className:qe.systemContextEllipsis,children:"…"})]})]})}function ZR({time:n,content:a}){return r.jsxs("div",{className:qe.systemEvent,children:[r.jsxs("span",{className:qe.systemTimestamp,children:["[",n,"]"]})," ",a]})}function XR({content:n}){return r.jsx("div",{className:qe.textEvent,children:r.jsx($f,{remarkPlugins:[Kf],rehypePlugins:[pR],children:n})})}function QR({content:n}){let a="",i=n;try{const l=JSON.parse(n);a=l.tool||"",i=JSON.stringify(l.args,null,2)}catch{}return r.jsxs("div",{className:qe.toolUseEvent,children:[r.jsxs("div",{className:qe.toolUseHeader,children:[r.jsx("span",{className:qe.toolUsePrefix,children:">"}),a?r.jsx("span",{className:qe.toolUseName,children:a}):null]}),r.jsx("pre",{className:qe.toolUseArgs,children:i})]})}const E0=5;function WR(n,a){if(a==null)return"";if(typeof a!="object")return String(a);const i=a;if(typeof i.command=="string")return i.command;if(typeof i.file_path=="string")return i.file_path;if(typeof i.pattern=="string"){const l=typeof i.path=="string"?` in ${i.path}`:"";return`${i.pattern}${l}`}if(typeof i.path=="string")return i.path;if(typeof i.query=="string")return i.query;try{const l=JSON.stringify(a);return l.length>150?`${l.slice(0,150)}…`:l}catch{return""}}function JR({content:n,raw:a,toolUseCtx:i}){const[l,c]=y.useState(!1);let u=!1;if(a)try{u=JSON.parse(a).is_error===!0}catch{}const f=n.split(`
104
+ `),p=f.length>E0,m=l?n:f.slice(0,E0).join(`
105
+ `),g=((i==null?void 0:i.tool)??"")||(u?"Tool error":"Tool output"),b=i?WR(i.tool,i.args):"",_=r.jsxs(r.Fragment,{children:[r.jsx("span",{className:u?qe.toolResultIndicatorError:qe.toolResultIndicatorOk,"aria-label":u?"error":"success","data-testid":u?"tool-result-indicator-error":"tool-result-indicator-ok",children:u?"✗":"✓"}),r.jsx("span",{className:qe.toolResultLabel,"data-testid":"tool-result-label",children:g}),p&&r.jsx("span",{className:qe.toolResultToggle,"aria-hidden":"true",children:l?"▾":"▸"})]});return r.jsxs("div",{className:qe.toolResultEvent,"data-testid":"tool-result",children:[p?r.jsx("button",{className:qe.toolResultHeader,"data-testid":"tool-result-header",onClick:()=>{c(S=>!S)},"aria-expanded":l,children:_}):r.jsx("div",{className:qe.toolResultHeader,"data-testid":"tool-result-header",children:_}),b&&r.jsx("div",{className:qe.toolResultCommand,children:b}),r.jsxs("pre",{className:qe.toolResultPre,"data-testid":"tool-result-content",children:[m,!l&&p&&r.jsx("span",{className:qe.toolResultEllipsis,children:"…"})]})]})}function eM({content:n}){return r.jsxs("div",{className:qe.errorEvent,children:["Error: ",n]})}function tM({content:n}){return r.jsxs("div",{className:qe.statusEvent,children:["--- ",n," ---"]})}function nM({content:n}){return r.jsx("div",{className:qe.userInputEvent,children:r.jsx("span",{className:qe.userInputContent,children:n})})}function aM({content:n}){return r.jsxs("div",{className:qe.signalEvent,"data-testid":"signal-event",children:[r.jsx("span",{className:qe.signalBadge,children:"SIGNAL"}),r.jsx("span",{className:qe.signalContent,children:n})]})}function sM({content:n}){let a=n;try{const i=JSON.parse(n),l=Number(i.input_tokens)||0,c=Number(i.output_tokens)||0,u=dx(l+c),f=Fi(Number(i.cost_usd)||0);a=`${u} tokens · ${f}`}catch{}return r.jsx("div",{className:qe.usageEvent,"data-testid":"usage-event",children:r.jsx("span",{className:qe.usageBadge,children:a})})}function iM({content:n}){return r.jsx("div",{className:qe.defaultEvent,children:n})}function oM({event:n,toolUseCtx:a}){const i=new Date(n.timestamp).toLocaleTimeString();switch(n.eventType){case"system":{if(n.raw)try{if(JSON.parse(n.raw).systemContext===!0)return r.jsx(FR,{content:n.content})}catch{}return r.jsx(ZR,{time:i,content:n.content})}case"text":case"output":return r.jsx(XR,{content:n.content});case"tool_use":return r.jsx(QR,{content:n.content});case"tool_result":return r.jsx(JR,{content:n.content,raw:n.raw,toolUseCtx:a});case"error":return r.jsx(eM,{content:n.content});case"status":return r.jsx(tM,{content:n.content});case"user_input":return r.jsx(nM,{content:n.content});case"signal":return r.jsx(aM,{content:n.content});case"usage":return r.jsx(sM,{content:n.content});default:return r.jsx(iM,{content:n.content})}}const lM="_overlay_cmicx_1",rM="_dialog_cmicx_11",cM="_title_cmicx_30",uM="_description_cmicx_38",dM="_actions_cmicx_45",fM="_cancelButton_cmicx_52",hM="_confirmButton_cmicx_79",Rs={overlay:lM,dialog:rM,title:cM,description:uM,actions:dM,cancelButton:fM,confirmButton:hM};function Ps({isOpen:n,title:a,description:i,confirmLabel:l="Delete",onConfirm:c,onCancel:u}){const f=y.useId(),p=y.useId();return r.jsx(na,{children:n&&r.jsx(Et.div,{className:Rs.overlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},onClick:u,onKeyDown:m=>{m.key==="Escape"&&u()},role:"dialog","aria-modal":"true","aria-labelledby":f,"aria-describedby":i?p:void 0,children:r.jsxs(Et.div,{className:Rs.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:[r.jsx("h3",{id:f,className:Rs.title,children:a}),i&&r.jsx("p",{id:p,className:Rs.description,children:i}),r.jsxs("div",{className:Rs.actions,children:[r.jsx("button",{type:"button",className:Rs.cancelButton,onClick:u,autoFocus:!0,children:"Cancel"}),r.jsx("button",{type:"button",className:Rs.confirmButton,onClick:c,children:l})]})]})})})}const pM="_spinner_1uyt1_1",mM="_spin_1uyt1_1",vM="_sm_1uyt1_14",gM="_md_1uyt1_20",yM="_lg_1uyt1_26",bM="_xl_1uyt1_32",A0={spinner:pM,spin:mM,sm:vM,md:gM,lg:yM,xl:bM};function fx({size:n="md",className:a,label:i="Loading",liveRegion:l=!1}){return r.jsx("span",{className:`${A0.spinner} ${A0[n]} ${a??""}`,role:l?"status":void 0,"aria-label":i,"aria-hidden":l?void 0:!0})}const _M="_splash_1bn1g_1",xM="_logo_1bn1g_11",D0={splash:_M,logo:xM};function hx(){return r.jsxs("div",{className:D0.splash,"data-testid":"splash-screen",children:[r.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:D0.logo}),r.jsx(fx,{size:"xl",label:"Loading Grackle",liveRegion:!0})]})}function SM(n,a){const i=y.useRef(null);y.useEffect(()=>{const l=i.current;if(i.current=n,l===null)return;const c=new Map;for(const f of l)c.set(f.id,f);const u=new Set;for(const f of n){u.add(f.id);const p=c.get(f.id);if(p&&p.status!==f.status&&f.status!=="sleeping"){if(f.status==="connecting"){a("Provisioning environment…","info");continue}f.status==="connected"?a("Environment connected","success"):f.status==="error"?a("Environment provision failed","error"):f.status==="disconnected"&&(p.status==="connected"?a("Environment disconnected","warning"):a("Environment stopped","info"))}}for(const f of l)u.has(f.id)||a("Environment removed","info")},[n,a])}const TM={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 kM(n){return TM[n]}function jM(n,a){if(n===void 0)return[];const i=[],l=new Map;for(const u of n)l.set(u.id,u);const c=new Set;for(const u of a){c.add(u.id);const f=l.get(u.id);if(!f||f.status===u.status)continue;const p=kM(u.status);p&&i.push(p)}for(const u of n)c.has(u.id)||i.push({message:"Task deleted",variant:"info"});return i}function wM(n,a){const i=y.useRef(void 0);y.useEffect(()=>{const l=i.current;i.current=n;const c=jM(l,n);for(const u of c)a(u.message,u.variant)},[n,a])}function CM(n,a,i){const l=n.filter(m=>m.status==="running"||m.status==="idle"||m.status==="waiting").length,c=px(a),u=a.filter(m=>Gf(m,c)).length,f=a.filter(m=>m.status==="paused"||m.status==="failed"||Gf(m,c)).length,p=i.filter(m=>m.status==="disconnected"||m.status==="error").length;return{activeSessions:l,blockedTasks:u,attentionTasks:f,unhealthyEnvironments:p}}function px(n){const a=new Map;for(const i of n)a.set(i.id,i.status);return a}function Gf(n,a){return n.dependsOn.some(i=>a.get(i)!=="complete")}function NM(n,a){var f;const i=new Map;for(const p of a)i.set(p.id,p);const l=px(n),c=[];for(const p of n){const m=p.workspaceId?((f=i.get(p.workspaceId))==null?void 0:f.name)??"Unknown":"Unknown";p.status==="failed"?c.push({task:p,reason:"failed",workspaceName:m}):Gf(p,l)?c.push({task:p,reason:"blocked",workspaceName:m}):p.status==="paused"&&c.push({task:p,reason:"paused",workspaceName:m})}const u={failed:0,blocked:1,paused:2};return c.sort((p,m)=>(u[p.reason]??3)-(u[m.reason]??3)),c}function EM(n,a){const i=new Map;for(const l of a)i.set(l.id,l);return n.filter(l=>l.status==="running"||l.status==="idle"||l.status==="waiting").map(l=>{var c;return{session:l,environmentName:((c=i.get(l.environmentId))==null?void 0:c.displayName)??"Unknown"}})}function AM(n,a,i){const l=new Map;for(const c of a){if(!c.workspaceId)continue;let u=l.get(c.workspaceId);u||(u={totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0},l.set(c.workspaceId,u)),u.totalTasks+=1,c.status==="complete"?u.completedTasks+=1:c.status==="working"?u.workingTasks+=1:c.status==="failed"&&(u.failedTasks+=1)}return n.map(c=>{const u=l.get(c.id)??{totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0};return{workspace:c,totalTasks:u.totalTasks,completedTasks:u.completedTasks,workingTasks:u.workingTasks,failedTasks:u.failedTasks}})}const DM="_dashboard_16pzm_1",RM="_kpiStrip_16pzm_11",MM="_kpiCard_16pzm_23",OM="_kpiValue_16pzm_68",BM="_kpiLabel_16pzm_76",LM="_bodyGrid_16pzm_84",IM="_section_16pzm_96",zM="_sectionHeader_16pzm_109",UM="_sectionIcon_16pzm_118",VM="_sectionTitle_16pzm_123",HM="_sectionCount_16pzm_131",PM="_sectionBody_16pzm_138",GM="_emptyHint_16pzm_143",qM="_sessionRow_16pzm_150",$M="_sessionPrompt_16pzm_177",KM="_sessionEnv_16pzm_186",YM="_sessionRuntime_16pzm_192",FM="_sessionStatus_16pzm_198",ZM="_statusDot_16pzm_207",XM="_attentionRow_16pzm_233",QM="_attentionTitle_16pzm_259",WM="_attentionMeta_16pzm_267",JM="_reasonBadge_16pzm_274",e3="_bottomGrid_16pzm_301",t3="_envRow_16pzm_312",n3="_envName_16pzm_323",a3="_envStatusBadge_16pzm_333",s3="_workspaceRow_16pzm_369",i3="_workspaceTop_16pzm_395",o3="_workspaceName_16pzm_401",l3="_workspaceCounts_16pzm_407",r3="_progressBar_16pzm_415",c3="_progressFill_16pzm_422",ge={dashboard:DM,kpiStrip:RM,kpiCard:MM,kpiValue:OM,kpiLabel:BM,bodyGrid:LM,section:IM,sectionHeader:zM,sectionIcon:UM,sectionTitle:VM,sectionCount:HM,sectionBody:PM,emptyHint:GM,sessionRow:qM,sessionPrompt:$M,sessionEnv:KM,sessionRuntime:YM,sessionStatus:FM,statusDot:ZM,attentionRow:XM,attentionTitle:QM,attentionMeta:WM,reasonBadge:JM,bottomGrid:e3,envRow:t3,envName:n3,envStatusBadge:a3,workspaceRow:s3,workspaceTop:i3,workspaceName:o3,workspaceCounts:l3,progressBar:r3,progressFill:c3},u3={hidden:{opacity:0,y:12},visible:n=>({opacity:1,y:0,transition:{delay:n*.06,duration:.3,ease:"easeOut"}})},Zr={hidden:{opacity:0,y:16},visible:n=>({opacity:1,y:0,transition:{delay:.15+n*.08,duration:.35,ease:"easeOut"}})};function d3(n,a,i,l){const c=[`${n} of ${a} tasks completed`];return i>0&&c.push(`${i} in progress`),l>0&&c.push(`${l} failed`),c.join(", ")}function Xr({value:n,label:a,accent:i,index:l,testId:c}){return r.jsxs(Et.div,{className:ge.kpiCard,"data-accent":i,"data-testid":c,variants:u3,initial:"hidden",animate:"visible",custom:l,children:[r.jsx("span",{className:ge.kpiValue,children:n}),r.jsx("span",{className:ge.kpiLabel,children:a})]})}function f3(){const{workspaces:n,tasks:a,sessions:i,environments:l,loadTasks:c}=ut(),u=bt(),f=y.useRef(new Set);y.useEffect(()=>{for(const b of n)f.current.has(b.id)||(f.current.add(b.id),c(b.id))},[n,c]);const p=y.useMemo(()=>CM(i,a,l),[i,a,l]),m=y.useMemo(()=>EM(i,l),[i,l]),v=y.useMemo(()=>NM(a,n),[a,n]),g=y.useMemo(()=>AM(n,a),[n,a,l]);return r.jsxs("div",{className:ge.dashboard,"data-testid":"dashboard",children:[r.jsxs("div",{className:ge.kpiStrip,"data-testid":"dashboard-kpi-strip",children:[r.jsx(Xr,{value:p.activeSessions,label:"Active Sessions",accent:"green",index:0,testId:"kpi-active-sessions"}),r.jsx(Xr,{value:p.blockedTasks,label:"Blocked Tasks",accent:"yellow",index:1,testId:"kpi-blocked-tasks"}),r.jsx(Xr,{value:p.attentionTasks,label:"Needs Attention",accent:"red",index:2,testId:"kpi-attention-tasks"}),r.jsx(Xr,{value:p.unhealthyEnvironments,label:"Unhealthy Envs",accent:"blue",index:3,testId:"kpi-unhealthy-envs"})]}),r.jsxs("div",{className:ge.bodyGrid,children:[r.jsxs(Et.div,{className:ge.section,variants:Zr,initial:"hidden",animate:"visible",custom:0,"data-testid":"dashboard-active-sessions",children:[r.jsxs("div",{className:ge.sectionHeader,children:[r.jsx("span",{className:ge.sectionIcon,"aria-hidden":"true",children:"●"}),r.jsx("span",{className:ge.sectionTitle,children:"Active Sessions"}),r.jsx("span",{className:ge.sectionCount,children:m.length})]}),r.jsx("div",{className:ge.sectionBody,children:m.length===0?r.jsx("div",{className:ge.emptyHint,children:"No active sessions"}):m.map(({session:b,environmentName:_})=>r.jsxs("button",{type:"button",className:ge.sessionRow,onClick:()=>u(hb(b.id)),"data-testid":"session-row",children:[r.jsx("span",{className:ge.sessionPrompt,title:b.prompt,children:b.prompt||"—"}),r.jsx("span",{className:ge.sessionEnv,children:_}),r.jsx("span",{className:ge.sessionRuntime,children:b.runtime}),r.jsxs("span",{className:ge.sessionStatus,children:[r.jsx("span",{className:ge.statusDot,"data-status":b.status}),b.status]})]},b.id))})]}),r.jsxs(Et.div,{className:ge.section,variants:Zr,initial:"hidden",animate:"visible",custom:1,"data-testid":"dashboard-needs-attention",children:[r.jsxs("div",{className:ge.sectionHeader,children:[r.jsx("span",{className:ge.sectionIcon,"aria-hidden":"true",children:"⚑"}),r.jsx("span",{className:ge.sectionTitle,children:"Needs Attention"}),r.jsx("span",{className:ge.sectionCount,children:v.length})]}),r.jsx("div",{className:ge.sectionBody,children:v.length===0?r.jsx("div",{className:ge.emptyHint,children:"All clear"}):v.map(({task:b,reason:_,workspaceName:S})=>r.jsxs("button",{type:"button",className:ge.attentionRow,onClick:()=>u(ta(b.id)),"data-testid":"attention-row",children:[r.jsxs("div",{className:ge.attentionTitle,children:[r.jsx("span",{className:ge.reasonBadge,"data-reason":_,children:_}),b.title]}),r.jsx("div",{className:ge.attentionMeta,children:r.jsx("span",{children:S})})]},b.id))})]})]}),r.jsxs("div",{className:ge.bottomGrid,children:[r.jsxs(Et.div,{className:ge.section,variants:Zr,initial:"hidden",animate:"visible",custom:2,"data-testid":"dashboard-env-health",children:[r.jsxs("div",{className:ge.sectionHeader,children:[r.jsx("span",{className:ge.sectionIcon,"aria-hidden":"true",children:"◈"}),r.jsx("span",{className:ge.sectionTitle,children:"Environment Health"}),r.jsx("span",{className:ge.sectionCount,children:l.length})]}),r.jsx("div",{className:ge.sectionBody,children:l.length===0?r.jsx("div",{className:ge.emptyHint,children:"No environments configured"}):l.map(b=>r.jsxs("div",{className:ge.envRow,"data-testid":"dashboard-env-row",children:[r.jsx("span",{className:ge.envName,children:b.displayName}),r.jsx("span",{className:ge.envStatusBadge,"data-status":b.status,children:b.status})]},b.id))})]}),r.jsxs(Et.div,{className:ge.section,variants:Zr,initial:"hidden",animate:"visible",custom:3,"data-testid":"dashboard-workspace-snapshot",children:[r.jsxs("div",{className:ge.sectionHeader,children:[r.jsx("span",{className:ge.sectionIcon,"aria-hidden":"true",children:"▦"}),r.jsx("span",{className:ge.sectionTitle,children:"Workspaces"}),r.jsx("span",{className:ge.sectionCount,children:n.length})]}),r.jsx("div",{className:ge.sectionBody,children:g.length===0?r.jsx("div",{className:ge.emptyHint,children:"No workspaces yet"}):g.map(({workspace:b,totalTasks:_,completedTasks:S,workingTasks:T,failedTasks:C})=>{const w=_>0?Math.round(S/_*100):0;return r.jsxs("button",{type:"button",className:ge.workspaceRow,onClick:()=>u(Pi(b.id,b.environmentId)),"data-testid":"workspace-row",children:[r.jsxs("div",{className:ge.workspaceTop,children:[r.jsx("span",{className:ge.workspaceName,children:b.name}),r.jsxs("span",{className:ge.workspaceCounts,"aria-label":d3(S,_,T,C),children:[S,"/",_,T>0&&r.jsxs("span",{style:{color:"var(--accent-green)"},"aria-hidden":"true",children:["▸",T]}),C>0&&r.jsxs("span",{style:{color:"var(--accent-red)"},"aria-hidden":"true",children:["✗",C]})]})]}),_>0&&r.jsx("div",{className:ge.progressBar,children:r.jsx("div",{className:ge.progressFill,style:{width:`${w}%`}})})]},b.id)})})]})]})]})}const h3="_panelContainer_1h5qd_1",p3="_emptyState_1h5qd_8",m3="_fadeIn_1h5qd_1",v3="_workspaceSummary_1h5qd_17",g3="_workspaceSummaryTitle_1h5qd_28",y3="_workspaceSummarySubtitle_1h5qd_32",b3="_header_1h5qd_36",_3="_headerInfo_1h5qd_71",x3="_killButton_1h5qd_77",S3="_headerTitle_1h5qd_106",T3="_headerActions_1h5qd_121",k3="_taskStatusBadge_1h5qd_128",j3="_taskBranch_1h5qd_137",w3="_taskBlockedBadge_1h5qd_143",C3="_btnPrimary_1h5qd_151",N3="_btnDanger_1h5qd_182",E3="_btnGhost_1h5qd_221",A3="_rejectInput_1h5qd_247",D3="_tabBar_1h5qd_277",R3="_tab_1h5qd_277",M3="_active_1h5qd_303",O3="_eventScroll_1h5qd_308",B3="_tabContent_1h5qd_314",L3="_noContext_1h5qd_319",I3="_overviewContent_1h5qd_325",z3="_overviewDashboard_1h5qd_334",U3="_overviewHero_1h5qd_340",V3="_statusBadge_1h5qd_347",H3="_statusPending_1h5qd_359",P3="_statusAssigned_1h5qd_364",G3="_statusInProgress_1h5qd_369",q3="_statusReview_1h5qd_374",$3="_statusDone_1h5qd_379",K3="_statusFailed_1h5qd_384",Y3="_statusWaitingInput_1h5qd_389",F3="_overviewBranchPill_1h5qd_394",Z3="_branchLink_1h5qd_409",X3="_overviewSection_1h5qd_420",Q3="_overviewLabel_1h5qd_426",W3="_overviewValue_1h5qd_433",J3="_overviewMuted_1h5qd_438",eO="_overviewMarkdown_1h5qd_444",tO="_envRow_1h5qd_513",nO="_envDot_1h5qd_519",aO="_envDotGreen_1h5qd_526",sO="_envDotYellow_1h5qd_530",iO="_envDotRed_1h5qd_534",oO="_envDotGray_1h5qd_538",lO="_depList_1h5qd_542",rO="_depItem_1h5qd_548",cO="_depBlocked_1h5qd_555",uO="_depDone_1h5qd_559",dO="_timeline_1h5qd_563",fO="_timelineRow_1h5qd_569",hO="_timelineKey_1h5qd_576",pO="_timelineValue_1h5qd_582",mO="_timelineDelta_1h5qd_586",vO="_reviewNotes_1h5qd_597",gO="_overviewDescription_1h5qd_608",yO="_waitingMessage_1h5qd_614",bO="_errorMessage_1h5qd_618",_O="_eventOverflowWarning_1h5qd_622",xO="_attemptSelector_1h5qd_636",SO="_attemptLabel_1h5qd_652",TO="_attemptButton_1h5qd_656",kO="_attemptActive_1h5qd_673",jO="_attemptStatus_1h5qd_679",wO="_emptyCta_1h5qd_685",CO="_ctaTitle_1h5qd_697",NO="_ctaDescription_1h5qd_703",EO="_ctaButton_1h5qd_710",AO="_ctaCreateForm_1h5qd_745",DO="_ctaCreateInput_1h5qd_751",RO="_ctaCreateOk_1h5qd_782",MO="_ctaLink_1h5qd_817",OO="_workspaceHeader_1h5qd_831",BO="_workspaceName_1h5qd_856",LO="_workspaceMeta_1h5qd_869",IO="_metaRow_1h5qd_877",zO="_metaLabel_1h5qd_890",UO="_metaValue_1h5qd_905",VO="_archiveButton_1h5qd_915",HO="_repoLink_1h5qd_945",PO="_metaToggle_1h5qd_955",GO="_metaToggleArrow_1h5qd_976",qO="_metaToggleArrowOpen_1h5qd_981",$O="_progressBarContainer_1h5qd_985",KO="_progressBar_1h5qd_985",YO="_progressFill_1h5qd_1001",FO="_progressLabel_1h5qd_1008",ZO="_metaTimestamps_1h5qd_1015",XO="_metaTimestamp_1h5qd_1015",I={panelContainer:h3,emptyState:p3,fadeIn:m3,workspaceSummary:v3,workspaceSummaryTitle:g3,workspaceSummarySubtitle:y3,header:b3,headerInfo:_3,killButton:x3,headerTitle:S3,headerActions:T3,taskStatusBadge:k3,taskBranch:j3,taskBlockedBadge:w3,btnPrimary:C3,btnDanger:N3,btnGhost:E3,rejectInput:A3,tabBar:D3,tab:R3,active:M3,eventScroll:O3,tabContent:B3,noContext:L3,overviewContent:I3,overviewDashboard:z3,overviewHero:U3,statusBadge:V3,statusPending:H3,statusAssigned:P3,statusInProgress:G3,statusReview:q3,statusDone:$3,statusFailed:K3,statusWaitingInput:Y3,overviewBranchPill:F3,branchLink:Z3,overviewSection:X3,overviewLabel:Q3,overviewValue:W3,overviewMuted:J3,overviewMarkdown:eO,envRow:tO,envDot:nO,envDotGreen:aO,envDotYellow:sO,envDotRed:iO,envDotGray:oO,depList:lO,depItem:rO,depBlocked:cO,depDone:uO,timeline:dO,timelineRow:fO,timelineKey:hO,timelineValue:pO,timelineDelta:mO,reviewNotes:vO,overviewDescription:gO,waitingMessage:yO,errorMessage:bO,eventOverflowWarning:_O,attemptSelector:xO,attemptLabel:SO,attemptButton:TO,attemptActive:kO,attemptStatus:jO,emptyCta:wO,ctaTitle:CO,ctaDescription:NO,ctaButton:EO,ctaCreateForm:AO,ctaCreateInput:DO,ctaCreateOk:RO,ctaLink:MO,workspaceHeader:OO,workspaceName:BO,workspaceMeta:LO,metaRow:IO,metaLabel:zO,metaValue:UO,archiveButton:VO,repoLink:HO,metaToggle:PO,metaToggleArrow:GO,metaToggleArrowOpen:qO,progressBarContainer:$O,progressBar:KO,progressFill:YO,progressLabel:FO,metaTimestamps:ZO,metaTimestamp:XO};function QO(){return r.jsx("div",{className:I.emptyState,children:"Select a task or click + to create one"})}function WO(){return r.jsx("div",{className:I.emptyState,children:"Select an environment to manage its workspaces, or add a new one."})}function JO(){const{workspaces:n,environments:a}=ut(),i=bt(),l=a.length>0;return n.length>0?r.jsx(f3,{}):r.jsxs("div",{className:I.emptyCta,"data-testid":"welcome-cta",children:[r.jsx("div",{className:I.ctaTitle,children:"Welcome to Grackle"}),r.jsx("div",{className:I.ctaDescription,children:"Organize your work into workspaces and let agents tackle the tasks."}),r.jsx("button",{className:I.ctaButton,onClick:()=>i(vb),disabled:!l,"data-testid":"welcome-create-button",children:"Create Your First Workspace"}),!l&&r.jsx("div",{className:I.ctaDescription,children:"Add an environment first before creating a workspace."})]})}const mx=50;function e5(n,a,i,l,c=mx){return l?n<c:a-n-i<c}function t5(n,a){const i=a-n;return i>0?i:0}function n5({scrollRef:n,contentLength:a,isReversed:i}){const[l,c]=y.useState(!0),u=y.useRef(0),f=y.useRef(!1),p=y.useRef(0);y.useEffect(()=>{const v=n.current;if(!v)return;let g=!0;const b=()=>{p.current||(p.current=requestAnimationFrame(()=>{p.current=0;const _=e5(v.scrollTop,v.scrollHeight,v.clientHeight,i,mx);_!==g&&(g=_,c(_))}))};return v.addEventListener("scroll",b,{passive:!0}),()=>{v.removeEventListener("scroll",b),p.current&&(cancelAnimationFrame(p.current),p.current=0)}},[n,i]),y.useLayoutEffect(()=>{const v=n.current;!v||f.current||(f.current=!0,i?v.scrollTop=0:v.scrollTop=v.scrollHeight,c(!0))},[n,i]),y.useLayoutEffect(()=>{const v=n.current;if(v){if(i&&!l){const g=t5(u.current,v.scrollHeight);g>0&&(v.scrollTop+=g)}l&&(i?v.scrollTo({top:0,behavior:"smooth"}):v.scrollTo({top:v.scrollHeight,behavior:"smooth"})),u.current=v.scrollHeight}},[a,l,i,n]);const m=y.useCallback(()=>{const v=n.current;if(!v)return;const g=i?0:v.scrollHeight;v.scrollTo({top:g,behavior:"smooth"}),c(!0)},[n,i]);return{isAtAnchor:l,scrollToAnchor:m}}const a5="_wrapper_p24zt_1",s5="_scrollContainer_p24zt_9",i5="_toolbar_p24zt_15",o5="_directionToggle_p24zt_22",l5="_scrollToAnchor_p24zt_60",r5="_scrollToAnchorBottom_p24zt_84",c5="_scrollToAnchorTop_p24zt_88",Ms={wrapper:a5,scrollContainer:s5,toolbar:i5,directionToggle:o5,scrollToAnchor:l5,scrollToAnchorBottom:r5,scrollToAnchorTop:c5},vx="grackle-stream-direction";function u5(){try{return localStorage.getItem(vx)==="reversed"}catch{return!1}}function d5({eventsDropped:n}){return n<=0?r.jsx(r.Fragment,{}):r.jsxs("div",{className:I.eventOverflowWarning,role:"alert",children:["⚠"," ",n.toLocaleString()," older event",n===1?"":"s"," were dropped — only the most recent 5,000 are shown. Full history is available in the session log."]})}function Uh({events:n,eventsDropped:a,emptyState:i}){const l=y.useRef(null),[c,u]=y.useState(u5),f=V2(),p=y.useMemo(()=>c?[...n].reverse():n,[n,c]),{isAtAnchor:m,scrollToAnchor:v}=n5({scrollRef:l,contentLength:n.length,isReversed:c}),g=()=>{const S=!c;u(S);try{localStorage.setItem(vx,S?"reversed":"default")}catch{}},b=f?0:.2,_=c?-8:8;return r.jsxs("div",{className:Ms.wrapper,children:[r.jsx("div",{className:Ms.toolbar,children:r.jsx("button",{className:Ms.directionToggle,onClick:g,title:c?"Showing newest first":"Showing oldest first","aria-label":c?"Switch to newest at bottom":"Switch to newest at top","data-testid":"direction-toggle",children:c?"↓":"↑"})}),r.jsxs("div",{ref:l,className:Ms.scrollContainer,"data-testid":"event-stream-scroll",children:[n.length===0&&i,r.jsx(d5,{eventsDropped:a}),r.jsx(na,{initial:!1,children:p.map((S,T)=>{const C=c?n.length-1-T:T;return r.jsx(Et.div,{initial:{opacity:0,y:_},animate:{opacity:1,y:0},transition:{duration:b,ease:"easeOut"},children:r.jsx(oM,{event:S,toolUseCtx:S.toolUseCtx})},`${S.sessionId}-${S.timestamp}-${C}`)})})]}),r.jsx(na,{children:!m&&r.jsxs(Et.button,{className:`${Ms.scrollToAnchor} ${c?Ms.scrollToAnchorTop:Ms.scrollToAnchorBottom}`,onClick:v,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.15},"aria-label":"Scroll to latest","data-testid":"scroll-to-anchor",children:[c?"↑":"↓"," New events"]})})]})}const f5="_bar_1xhb4_1",h5="_input_1xhb4_32",p5="_select_1xhb4_67",m5="_btnPrimary_1xhb4_103",v5="_btnGhost_1xhb4_173",g5="_badge_1xhb4_195",y5="_disconnectHint_1xhb4_205",gn={bar:f5,input:h5,select:p5,btnPrimary:m5,btnGhost:v5,badge:g5,disconnectHint:y5};function b5(n,a){if(!n)return!1;const i=a.find(l=>l.id===n);return i!==void 0&&(i.status==="disconnected"||i.status==="error")}function _5({environmentId:n,onReconnect:a}){return r.jsxs(r.Fragment,{children:[r.jsx("span",{className:gn.disconnectHint,"data-testid":"env-disconnect-hint",children:"Environment unavailable"}),r.jsx("button",{type:"button",onClick:()=>a(n),className:gn.btnGhost,"data-testid":"reconnect-btn",title:"Reconnect the environment to resume messaging",children:"Reconnect"})]})}function gl({mode:n,sessionId:a,environmentId:i,taskId:l,showPersonaSelect:c,personas:u,environments:f,onSendInput:p,onSpawn:m,onStartTask:v,onProvisionEnvironment:g}){const{showToast:b}=Aa(),[_,S]=y.useState(""),[T,C]=y.useState(""),w=b5(i,f),k=E=>{if(E.preventDefault(),!!_.trim())if(n==="send"){if(!a||w)return;p(a,_),S("")}else if(n==="spawn"){if(!i)return;m(i,_,T),b("Session started","success"),S(""),C("")}else{if(!l)return;v(l,void 0,i,_),S("")}};return n==="spawn"?r.jsxs("form",{onSubmit:k,className:gn.bar,children:[r.jsx("span",{className:gn.badge,children:"new chat"}),r.jsx("input",{type:"text",value:_,onChange:E=>S(E.target.value),placeholder:"Enter prompt...",autoFocus:!0,className:gn.input}),c&&r.jsxs("select",{value:T,onChange:E=>C(E.target.value),className:gn.select,children:[r.jsx("option",{value:"",children:"(Default)"}),u.map(E=>r.jsx("option",{value:E.id,children:E.name},E.id))]}),r.jsx("button",{type:"submit",disabled:!_.trim()||!i,className:gn.btnPrimary,children:"Go"})]}):n==="start"?r.jsxs("form",{onSubmit:k,className:gn.bar,children:[r.jsx("input",{type:"text",value:_,onChange:E=>S(E.target.value),placeholder:"Type a message...",autoFocus:!0,className:gn.input}),r.jsx("button",{type:"submit",disabled:!_.trim(),className:gn.btnPrimary,children:"Send"})]}):r.jsxs("form",{onSubmit:k,className:gn.bar,children:[w&&i&&r.jsx(_5,{environmentId:i,onReconnect:g}),r.jsx("input",{type:"text",value:_,onChange:E=>S(E.target.value),placeholder:"Type a message...",autoFocus:!w,disabled:w,className:gn.input}),r.jsx("span",{title:w?"Environment is unavailable — reconnect first":void 0,children:r.jsx("button",{type:"submit",disabled:!_.trim()||w,className:gn.btnPrimary,children:"Send"})})]})}function Vh(n){const a=[];for(const i of n){const l=a[a.length-1];i.eventType==="text"&&(l==null?void 0:l.eventType)==="text"?a[a.length-1]={...l,content:l.content+i.content}:a.push(i)}return a}function Hh(n){const a=new Map;for(const u of n)if(u.raw)try{a.set(u,JSON.parse(u.raw))}catch{}const i=new Map;for(const u of n){if(u.eventType!=="tool_use")continue;const f=a.get(u);if(!(!f||typeof f.id!="string"))try{const p=JSON.parse(u.content);i.set(f.id,{tool:p.tool,args:p.args})}catch{}}const l=new Set;return n.map(u=>{if(u.eventType!=="tool_result")return u;const f=a.get(u);if(!f||typeof f.tool_use_id!="string")return u;const p=i.get(f.tool_use_id);return p?(l.add(f.tool_use_id),{...u,toolUseCtx:p}):u}).filter(u=>{if(u.eventType!=="tool_use")return!0;const f=a.get(u);return f&&typeof f.id=="string"?!l.has(f.id):!0})}const x5="_panelContainer_19poq_1",S5="_chatHeader_19poq_8",T5="_chatHeaderInfo_19poq_37",k5="_emptyState_19poq_43",j5="_emptyTitle_19poq_55",w5="_emptyDescription_19poq_61",C5="_emptyHint_19poq_67",zs={panelContainer:x5,chatHeader:S5,chatHeaderInfo:T5,emptyState:k5,emptyTitle:j5,emptyDescription:w5,emptyHint:C5};function N5({hasLocalEnvironment:n}){return r.jsxs("div",{className:zs.emptyState,"data-testid":"chat-empty-state",children:[r.jsx("div",{className:zs.emptyTitle,children:"Welcome to Grackle"}),r.jsx("div",{className:zs.emptyDescription,children:n?"Type a message below to start chatting with the System agent. It can help you plan work, create tasks, and coordinate agents.":"Add a local environment in Settings to start chatting."}),!n&&r.jsx("div",{className:zs.emptyHint,children:"Go to Settings → Environments to add one."})]})}function E5(){const{tasks:n,sessions:a,events:i,eventsDropped:l,environments:c,loadTaskSessions:u,loadSessionEvents:f,kill:p,stopGraceful:m,taskSessions:v,sendInput:g,spawn:b,startTask:_,personas:S,provisionEnvironment:T}=ut(),C=y.useRef(void 0),[w,k]=y.useState(),E=n.find(K=>K.id===Ko),A=E!=null&&E.latestSessionId?a.find(K=>K.id===E.latestSessionId)??(v[Ko]??[]).find(K=>K.id===E.latestSessionId):void 0;y.useEffect(()=>{u(Ko)},[u]),y.useEffect(()=>{E!=null&&E.latestSessionId&&u(Ko)},[E==null?void 0:E.latestSessionId,u]),y.useEffect(()=>{A&&A.id!==C.current&&(C.current=A.id,f(A.id))},[A==null?void 0:A.id,f]);const R=y.useMemo(()=>{if(!A)return[];const K=i.filter(W=>W.sessionId===A.id);return Hh(Vh(K))},[i,A==null?void 0:A.id]),N=c.find(K=>K.adapterType==="local"&&K.status==="connected"),z=A!==void 0&&A.status!=="stopped"&&A.status!=="suspended",H=(A==null?void 0:A.status)==="idle";y.useEffect(()=>{w&&A&&H&&(g(A.id,w),k(void 0))},[w,H,A==null?void 0:A.id,g]);const B=y.useCallback((K,W,se,ne)=>{ne&&k(ne),_(K,W,se)},[_]);return r.jsxs("div",{className:zs.panelContainer,"data-testid":"chat-page",children:[z&&r.jsxs("div",{className:zs.chatHeader,children:[r.jsxs("span",{className:zs.chatHeaderInfo,children:["Session: ",A.id.slice(0,8)," | ",A.runtime," | ",A.status]}),r.jsx(ux,{label:"Stop",onClick:()=>m(A.id),variant:"danger",size:"sm","data-testid":"stop-split-button",options:[{label:"Stop",description:"Graceful shutdown",onClick:()=>m(A.id)},{label:"Kill",description:"Force kill",onClick:()=>p(A.id)}]})]}),r.jsx(Uh,{events:R,eventsDropped:l,emptyState:r.jsx(N5,{hasLocalEnvironment:!!N})}),N&&z&&r.jsx(gl,{mode:"send",sessionId:A.id,environmentId:A.environmentId,personas:S,environments:c,onSendInput:g,onSpawn:b,onStartTask:_,onProvisionEnvironment:T}),N&&!z&&r.jsx(gl,{mode:"start",taskId:Ko,environmentId:N.id,personas:S,environments:c,onSendInput:g,onSpawn:b,onStartTask:B,onProvisionEnvironment:T})]})}function A5(n,a){const i=[];let l=n;const c=new Set;for(;l&&a.has(l)&&!c.has(l);){c.add(l);const u=a.get(l);i.unshift(u),l=u.parentTaskId||void 0}return i}const Gs={label:"Home",url:Hs};function D5(n){return n?[Gs,{label:"Settings",url:Hi},{label:n,url:void 0}]:[Gs,{label:"Settings",url:void 0}]}const gx={label:"Environments",url:Gi};function R5(){return[Gs,{label:"Environments",url:void 0}]}function M5(){return[Gs,{label:"New Chat",url:void 0}]}function O5(n){return[Gs,{label:`Session ${n.slice(0,8)}`,url:void 0}]}function B5(n,a,i,l){const c=i.find(f=>f.id===n),u=l.find(f=>f.id===a);return[Gs,gx,{label:(u==null?void 0:u.displayName)??"Environment",url:qi(a)},{label:(c==null?void 0:c.name)??"Workspace",url:void 0}]}function L5(n,a,i,l,c){const u=A5(n,c),f=c.get(n),p=f==null?void 0:f.workspaceId,m=p?i.find(S=>S.id===p):void 0,v=a??(m==null?void 0:m.environmentId),g=v?l.find(S=>S.id===v):void 0,b=[Gs];g&&v&&(b.push(gx),b.push({label:g.displayName,url:qi(v)})),m&&v&&b.push({label:m.name,url:Pi(m.id,v)});for(let S=0;S<u.length-1;S++)b.push({label:u[S].title,url:ta(u[S].id,void 0,p,v)});const _=u[u.length-1];return b.push({label:(_==null?void 0:_.title)??n,url:void 0}),b}function I5(){const n=M5(),[a]=th(),i=a.get("env")??"",{sendInput:l,spawn:c,startTask:u,personas:f,environments:p,provisionEnvironment:m}=ut();return r.jsxs("div",{className:I.panelContainer,children:[r.jsx(fs,{segments:n}),r.jsx("div",{className:I.emptyState,children:"Enter a prompt below to start a new session"}),r.jsx(gl,{mode:"spawn",environmentId:i,showPersonaSelect:!0,personas:f,environments:p,onSendInput:l,onSpawn:c,onStartTask:u,onProvisionEnvironment:m})]})}function z5({sessionId:n,session:a,isActive:i,onStop:l,onKill:c}){return r.jsxs("div",{className:I.header,children:[r.jsxs("span",{children:["Session: ",n.slice(0,8),a&&` | ${a.runtime} | ${a.endReason||a.status}`,a!=null&&a.inputTokens||a!=null&&a.outputTokens||a!=null&&a.costUsd?` | ${dx((a.inputTokens??0)+(a.outputTokens??0))} tokens · ${Fi(a.costUsd??0)}`:""]}),r.jsxs("span",{className:I.headerInfo,children:[a&&r.jsx("span",{children:a.prompt.length>60?a.prompt.slice(0,60)+"...":a.prompt}),i&&r.jsx(ux,{label:"Stop",onClick:l,variant:"danger",size:"sm","data-testid":"stop-split-button",options:[{label:"Stop",description:"Graceful shutdown",onClick:l},{label:"Kill",description:"Force kill",onClick:c}]})]})]})}function U5({session:n}){const a=n&&(n.status==="stopped"||n.status==="suspended"),i=a?`Session ${n.endReason||n.status} with no events recorded.`:"Waiting for events...";return r.jsx("div",{className:a?I.errorMessage:I.waitingMessage,children:i})}function V5(){const{sessionId:n}=us(),{events:a,eventsDropped:i,sessions:l,kill:c,stopGraceful:u,loadSessionEvents:f,sendInput:p,spawn:m,startTask:v,personas:g,environments:b,provisionEnvironment:_}=ut(),S=y.useRef(void 0),T=O5(n),C=l.find(E=>E.id===n)??void 0,w=y.useMemo(()=>{const E=n?a.filter(A=>A.sessionId===n):[];return Hh(Vh(E))},[a,n]);if(y.useEffect(()=>{n&&n!==S.current&&(S.current=n,f(n))},[n,f]),!n)return r.jsx("div",{className:I.emptyState,children:"No session selected"});const k=(C==null?void 0:C.status)==="running"||(C==null?void 0:C.status)==="idle";return r.jsxs("div",{className:I.panelContainer,children:[r.jsx(fs,{segments:T}),r.jsx(z5,{sessionId:n,session:C,isActive:k,onStop:()=>u(n),onKill:()=>c(n)}),r.jsx(Uh,{events:w,eventsDropped:i,emptyState:r.jsx(U5,{session:C})}),k&&r.jsx(gl,{mode:"send",sessionId:n,environmentId:C.environmentId,personas:g,environments:b,onSendInput:p,onSpawn:m,onStartTask:v,onProvisionEnvironment:_})]})}function H5(n){if(!n)return!1;const a=n.tagName;return!!(a==="INPUT"||a==="TEXTAREA"||a==="SELECT"||n.isContentEditable)}function Ca(n,a){const i=y.useRef(a);i.current=a;const{key:l,ctrl:c=!1,shift:u=!1,suppressInInputs:f=!0,enabled:p=!0}=n;y.useEffect(()=>{if(!p)return;const m=v=>{if(f&&H5(document.activeElement??void 0))return;const g=v.ctrlKey||v.metaKey;c===g&&(u&&!v.shiftKey||v.key===l&&i.current())};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[l,c,u,f,p])}const R0=220,M0=70,P5=40,G5=60,q5="hierarchy",$5="dependency";function K5(n){return y.useMemo(()=>{if(n.length===0)return{nodes:[],edges:[]};const a=new Ug.graphlib.Graph({multigraph:!0});a.setDefaultEdgeLabel(()=>({})),a.setGraph({rankdir:"TB",nodesep:P5,ranksep:G5});const i=new Map(n.map(f=>[f.id,f])),l=new Map;for(const f of n)if(f.parentTaskId&&i.has(f.parentTaskId)){const p=l.get(f.parentTaskId)||[];p.push(f),l.set(f.parentTaskId,p)}for(const f of n)a.setNode(f.id,{width:R0,height:M0});const c=[];for(const f of n){if(f.parentTaskId&&i.has(f.parentTaskId)){const p=`hierarchy-${f.parentTaskId}-${f.id}`;a.setEdge(f.parentTaskId,f.id,{},p),c.push({id:p,source:f.parentTaskId,target:f.id,type:"smoothstep",data:{edgeType:q5},style:{stroke:"var(--accent-green)",strokeWidth:2},animated:!1})}for(const p of f.dependsOn)if(i.has(p)){const m=`dependency-${p}-${f.id}`;a.setEdge(p,f.id,{},m),c.push({id:m,source:p,target:f.id,type:"smoothstep",data:{edgeType:$5},style:{stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeDasharray:"6 3"},animated:!1})}}return Ug.layout(a),{nodes:n.map(f=>{const p=a.node(f.id),m=l.get(f.id)||[];return{id:f.id,type:"task",position:{x:p.x-R0/2,y:p.y-M0/2},data:{task:f,childCount:m.length,doneChildCount:m.filter(v=>v.status==="complete").length,hasDependencies:f.dependsOn.length>0}}}),edges:c}},[n])}const Y5="_dagContainer_js4w6_1",F5="_taskNode_js4w6_26",Z5="_taskNodeBorder_js4w6_54",X5="_taskNodeContent_js4w6_60",Q5="_taskNodeHeader_js4w6_70",W5="_taskNodeIcon_js4w6_77",J5="_taskNodeTitle_js4w6_82",e6="_taskNodeBadges_js4w6_90",t6="_childBadge_js4w6_95",n6="_depBadge_js4w6_107",a6="_handle_js4w6_119",s6="_emptyCta_js4w6_126",i6="_ctaDescription_js4w6_137",o6="_ctaButton_js4w6_144",Jt={dagContainer:Y5,taskNode:F5,taskNodeBorder:Z5,taskNodeContent:X5,taskNodeHeader:Q5,taskNodeIcon:W5,taskNodeTitle:J5,taskNodeBadges:e6,childBadge:t6,depBadge:n6,handle:a6,emptyCta:s6,ctaDescription:i6,ctaButton:o6};function l6({data:n}){const{task:a,childCount:i,doneChildCount:l,hasDependencies:c}=n,u=cs(a.status);return r.jsxs("div",{className:Jt.taskNode,"data-task-id":a.id,"data-task-title":a.title,children:[r.jsx(Vg,{type:"target",position:Hg.Top,className:Jt.handle}),r.jsx("div",{className:Jt.taskNodeBorder,style:{backgroundColor:u.color}}),r.jsxs("div",{className:Jt.taskNodeContent,children:[r.jsxs("div",{className:Jt.taskNodeHeader,children:[r.jsx("span",{className:Jt.taskNodeIcon,style:{color:u.color},children:u.icon}),r.jsx("span",{className:Jt.taskNodeTitle,children:a.title})]}),r.jsxs("div",{className:Jt.taskNodeBadges,children:[i>0&&r.jsxs("span",{className:Jt.childBadge,children:[l,"/",i]}),c&&r.jsx("span",{className:Jt.depBadge,children:"dep"})]})]}),r.jsx(Vg,{type:"source",position:Hg.Bottom,className:Jt.handle})]})}const r6=$2,c6={task:l6};function u6({workspaceId:n,environmentId:a,tasks:i}){const l=bt(),{resolvedThemeId:c}=kb(),u=y.useMemo(()=>i.filter(b=>b.workspaceId===n),[i,n]),{nodes:f,edges:p}=K5(u),m=y.useMemo(()=>{const b=getComputedStyle(document.documentElement),_={};for(const[S,T]of Object.entries(r6))_[S]=b.getPropertyValue(T).trim()||"#6b7a8d";return _},[c]),v=y.useCallback((b,_)=>{l(ta(_.id,void 0,n,a))},[l,n,a]),g=y.useCallback(b=>{const _=b.data;return m[_.task.status]||m.pending},[m]);return u.length===0?r.jsxs("div",{className:Jt.emptyCta,children:[r.jsx("button",{className:Jt.ctaButton,onClick:()=>l(Ks(n,void 0,a)),children:"Create Task"}),r.jsx("div",{className:Jt.ctaDescription,children:"Create tasks to see the dependency graph"})]}):r.jsx("div",{className:Jt.dagContainer,children:r.jsxs(VS,{nodes:f,edges:p,nodeTypes:c6,onNodeClick:v,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,children:[r.jsx(HS,{variant:PS.Dots,gap:24,size:1,color:"var(--text-disabled)"}),r.jsx(GS,{showInteractive:!1}),r.jsx(qS,{nodeColor:g,maskColor:"var(--bg-overlay)",style:{background:"var(--bg-inset)"}})]})})}function d6({tasks:n,taskStatusById:a,sessionStatusByTaskId:i}){const l=new Map;for(const u of n)if(u.parentTaskId){const f=l.get(u.parentTaskId);f?f.push(u):l.set(u.parentTaskId,[u])}const c=new Map(j0.map(u=>[u,[]]));for(const u of n){const f=zh(u.status),p=u.dependsOn.length>0&&u.dependsOn.some(T=>a.get(T)!=="complete"),m=l.get(u.id)??[],v=m.length,g=m.filter(T=>T.status==="complete").length;let b;if(f==="paused"&&i){const T=i.get(u.id);T==="idle"?b="Needs input":T==="completed"&&(b="Ready to complete")}const _={task:u,isBlocked:p,childCount:v,doneChildCount:g,pausedSubBadge:b},S=c.get(f);S?S.push(_):c.get("not_started").push(_)}for(const u of c.values())u.sort((f,p)=>f.task.sortOrder-p.task.sortOrder);return j0.map(u=>{const f=cs(u);return{status:u,label:f.label,style:f,tasks:c.get(u)??[]}})}const f6="_boardContainer_1c4y1_1",h6="_column_1c4y1_17",p6="_columnHeader_1c4y1_34",m6="_columnIcon_1c4y1_47",v6="_columnLabel_1c4y1_52",g6="_columnCount_1c4y1_57",y6="_cardList_1c4y1_67",b6="_emptyPlaceholder_1c4y1_76",_6="_card_1c4y1_67",x6="_cardHeader_1c4y1_107",S6="_cardStatusIcon_1c4y1_113",T6="_cardTitle_1c4y1_119",k6="_cardBadges_1c4y1_127",j6="_badge_1c4y1_134",w6="_blockedBadge_1c4y1_146",C6="_childBadge_1c4y1_151",N6="_depBadge_1c4y1_155",E6="_parentBadge_1c4y1_159",A6="_pausedSubBadge_1c4y1_166",D6="_personaBadge_1c4y1_170",R6="_envBadge_1c4y1_174",M6="_emptyCta_1c4y1_178",O6="_ctaButton_1c4y1_188",B6="_ctaDescription_1c4y1_204",Xe={boardContainer:f6,column:h6,columnHeader:p6,columnIcon:m6,columnLabel:v6,columnCount:g6,cardList:y6,emptyPlaceholder:b6,card:_6,cardHeader:x6,cardStatusIcon:S6,cardTitle:T6,cardBadges:k6,badge:j6,blockedBadge:w6,childBadge:C6,depBadge:N6,parentBadge:E6,pausedSubBadge:A6,personaBadge:D6,envBadge:R6,emptyCta:M6,ctaButton:O6,ctaDescription:B6};function L6({workspaceId:n,environmentId:a,tasks:i,sessions:l,personas:c,environments:u}){const f=bt(),p=y.useMemo(()=>i.filter(_=>_.workspaceId===n),[i,n]),m=y.useMemo(()=>new Map(i.map(_=>[_.id,_.status])),[i]),v=y.useMemo(()=>new Map(p.map(_=>[_.id,_])),[p]),g=y.useMemo(()=>{const _=new Map(l.map(E=>[E.id,E])),S=new Map(c.map(E=>[E.id,E])),T=new Map(u.map(E=>[E.id,E])),C=new Map,w=new Map,k=new Map;for(const E of p)if(E.latestSessionId){const A=_.get(E.latestSessionId);if(A){if(C.set(E.id,A.endReason||A.status),A.personaId){const R=S.get(A.personaId);R&&w.set(E.id,R.name)}if(A.environmentId){const R=T.get(A.environmentId);R&&k.set(E.id,R.displayName)}}}return{sessionStatusByTaskId:C,personaNameByTaskId:w,environmentNameByTaskId:k}},[p,l,c,u]),b=y.useMemo(()=>d6({tasks:p,taskStatusById:m,sessionStatusByTaskId:g.sessionStatusByTaskId}),[p,m,g]);return p.length===0?r.jsxs("div",{className:Xe.emptyCta,"data-testid":"board-empty-cta",children:[r.jsx("button",{className:Xe.ctaButton,onClick:()=>f(Ks(n,void 0,a)),children:"Create Task"}),r.jsx("div",{className:Xe.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}):r.jsx("div",{className:Xe.boardContainer,"data-testid":"board-container",children:b.map(_=>r.jsxs("section",{className:Xe.column,"data-testid":`board-column-${_.status}`,"aria-label":`${_.label}, ${_.tasks.length} ${_.tasks.length===1?"task":"tasks"}`,children:[r.jsxs("div",{className:Xe.columnHeader,children:[r.jsx("span",{className:Xe.columnIcon,style:{color:_.style.color},children:_.style.icon}),r.jsx("span",{className:Xe.columnLabel,children:_.label}),r.jsx("span",{className:Xe.columnCount,"data-testid":`board-count-${_.status}`,children:_.tasks.length})]}),r.jsx("div",{className:Xe.cardList,children:_.tasks.length===0?r.jsx("div",{className:Xe.emptyPlaceholder,children:"No tasks"}):r.jsx(na,{mode:"popLayout",children:_.tasks.map(S=>r.jsx(Et.div,{layout:!0,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},children:r.jsx(I6,{boardTask:S,tasksById:v,personaName:g.personaNameByTaskId.get(S.task.id),envName:g.environmentNameByTaskId.get(S.task.id),onClick:()=>f(ta(S.task.id,void 0,n,a))})},S.task.id))})})]},_.status))})}function I6({boardTask:n,tasksById:a,personaName:i,envName:l,onClick:c}){const{task:u,isBlocked:f,childCount:p,doneChildCount:m,pausedSubBadge:v}=n,g=cs(u.status),b=u.parentTaskId?a.get(u.parentTaskId):void 0;return r.jsxs("div",{className:Xe.card,tabIndex:0,role:"button","data-testid":`board-card-${u.id}`,onClick:c,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),c())},children:[r.jsxs("div",{className:Xe.cardHeader,children:[r.jsx("span",{className:Xe.cardStatusIcon,style:{color:g.color},children:g.icon}),r.jsx("span",{className:Xe.cardTitle,children:u.title})]}),r.jsxs("div",{className:Xe.cardBadges,children:[b&&r.jsx("span",{className:`${Xe.badge} ${Xe.parentBadge}`,title:b.title,children:b.title}),p>0&&r.jsxs("span",{className:`${Xe.badge} ${Xe.childBadge}`,children:[m,"/",p]}),f&&r.jsx("span",{className:`${Xe.badge} ${Xe.blockedBadge}`,children:"blocked"}),u.dependsOn.length>0&&!f&&r.jsx("span",{className:`${Xe.badge} ${Xe.depBadge}`,children:"dep"}),v&&r.jsx("span",{className:`${Xe.badge} ${Xe.pausedSubBadge}`,children:v}),i&&r.jsx("span",{className:`${Xe.badge} ${Xe.personaBadge}`,children:i}),l&&r.jsx("span",{className:`${Xe.badge} ${Xe.envBadge}`,children:l})]})]})}function Ph(n){const{value:a,onSave:i,validate:l,fieldId:c,activeFieldId:u,onActivate:f,enterToSave:p=!0,trimOnSave:m=!0}=n,[v,g]=y.useState(""),[b,_]=y.useState(""),S=y.useRef(!1),T=u===c,C=y.useCallback(H=>{g(H),_("")},[]),w=y.useCallback(()=>{_("")},[]),k=y.useCallback(()=>{S.current=!1,f==null||f(null),g(""),_("")},[f]),E=y.useCallback(()=>{const H=m?v.trim():v;if(l){const K=l(v);if(K){_(K);return}}const B=m?a.trim():a;if(H===B){k();return}i(H),k()},[v,a,m,l,i,k]),A=y.useCallback(()=>{S.current=!0,f==null||f(c),g(a),_("")},[c,a,f]),R=y.useCallback(H=>{if(S.current){S.current=!1;return}H.relatedTarget instanceof HTMLElement&&H.relatedTarget.dataset.editAction===c||E()},[c,E]),N=y.useCallback(H=>{H.key==="Escape"?k():H.key==="Enter"&&p&&E()},[k,p,E]),z=(()=>{if(!T)return!1;const H=m?a.trim():a;return(m?v.trim():v)!==H})();return y.useEffect(()=>{!T&&(v!==""||b!=="")&&(g(""),_(""))},[T,v,b]),{isEditing:T,draft:v,error:b,isDirty:z,startEdit:A,cancelEdit:k,save:E,setDraft:C,clearError:w,handleBlur:R,handleKeyDown:N,ignoreInitialBlurRef:S}}const z6="_editFieldWrapper_yuzty_1",U6="_editInput_yuzty_10",V6="_editTextarea_yuzty_42",H6="_editSelect_yuzty_78",P6="_editError_yuzty_111",G6="_editInputInvalid_yuzty_118",q6="_editHint_yuzty_123",$6="_unsavedDot_yuzty_132",K6="_metaValueClickable_yuzty_140",Y6="_editButton_yuzty_159",F6="_metaPlaceholder_yuzty_175",Z6="_worktreeToggle_yuzty_180",Ye={editFieldWrapper:z6,editInput:U6,editTextarea:V6,editSelect:H6,editError:P6,editInputInvalid:G6,editHint:q6,unsavedDot:$6,metaValueClickable:K6,editButton:Y6,metaPlaceholder:F6,worktreeToggle:Z6};function $t(n){const{value:a,onSave:i,validate:l,mode:c="edit",fieldId:u="text",activeFieldId:f,onActivate:p,onChange:m,renderDisplay:v,placeholder:g,maxLength:b,ariaLabel:_,"data-testid":S}=n,T=y.useRef(null),C=Ph({value:a,onSave:i,validate:l,fieldId:u,activeFieldId:f,onActivate:p,enterToSave:!0,trimOnSave:!0});if(y.useEffect(()=>{if(C.isEditing){const k=window.setTimeout(()=>{var E;(E=T.current)==null||E.focus()},0);return()=>window.clearTimeout(k)}},[C.isEditing]),c==="create"){const k=A=>{m==null||m(A.target.value)},E=l==null?void 0:l(a);return r.jsxs("div",{className:Ye.editFieldWrapper,children:[r.jsx("input",{className:`${Ye.editInput} ${E?Ye.editInputInvalid:""}`,value:a,onChange:k,maxLength:b,placeholder:g,"aria-label":_,"data-testid":S?`${S}-input`:void 0}),E&&r.jsx("span",{className:Ye.editError,"data-testid":"edit-error",children:E})]})}if(C.isEditing)return r.jsxs("div",{className:Ye.editFieldWrapper,children:[r.jsx("input",{ref:T,className:`${Ye.editInput} ${C.error?Ye.editInputInvalid:""}`,value:C.draft,onChange:k=>C.setDraft(k.target.value),onBlur:C.handleBlur,onKeyDown:C.handleKeyDown,maxLength:b,placeholder:g,"aria-label":_,"data-testid":S?`${S}-input`:void 0}),C.isDirty&&r.jsx("span",{className:Ye.unsavedDot,title:"Unsaved changes"}),C.error&&r.jsx("span",{className:Ye.editError,"data-testid":"edit-error",children:C.error}),r.jsx("span",{className:Ye.editHint,children:"Enter to save · Esc to cancel"})]});const w=v==null?void 0:v(a);return r.jsxs("span",{role:"button",tabIndex:0,className:Ye.metaValueClickable,onClick:()=>C.startEdit(),onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),C.startEdit())},title:"Click to edit","aria-label":_,"data-testid":S?`${S}-button`:void 0,children:[w!==void 0?w:a?r.jsx("span",{children:a}):r.jsx("span",{className:Ye.metaPlaceholder,children:g||"None"}),r.jsx("span",{className:Ye.editButton,"aria-hidden":"true",children:"✏️"})]})}function qf(n){const{value:a,onSave:i,validate:l,mode:c="edit",fieldId:u="textarea",activeFieldId:f,onActivate:p,onChange:m,renderDisplay:v,placeholder:g,ariaLabel:b,"data-testid":_}=n,S=y.useRef(null),T=Ph({value:a,onSave:i,validate:l,fieldId:u,activeFieldId:f,onActivate:p,enterToSave:!1,trimOnSave:!1});if(y.useEffect(()=>{if(T.isEditing){const w=window.setTimeout(()=>{var k;(k=S.current)==null||k.focus()},0);return()=>window.clearTimeout(w)}},[T.isEditing]),c==="create"){const w=E=>{m==null||m(E.target.value)},k=l==null?void 0:l(a);return r.jsxs("div",{className:Ye.editFieldWrapper,children:[r.jsx("textarea",{className:`${Ye.editTextarea} ${k?Ye.editInputInvalid:""}`,value:a,onChange:w,placeholder:g,"aria-label":b,"data-testid":_?`${_}-input`:void 0}),k&&r.jsx("span",{className:Ye.editError,"data-testid":"edit-error",children:k})]})}if(T.isEditing)return r.jsxs("div",{className:Ye.editFieldWrapper,children:[r.jsx("textarea",{ref:S,className:`${Ye.editTextarea} ${T.error?Ye.editInputInvalid:""}`,value:T.draft,onChange:w=>T.setDraft(w.target.value),onBlur:T.handleBlur,onKeyDown:T.handleKeyDown,title:b,"aria-label":b,"data-testid":_?`${_}-input`:void 0}),T.isDirty&&r.jsx("span",{className:Ye.unsavedDot,title:"Unsaved changes"}),T.error&&r.jsx("span",{className:Ye.editError,"data-testid":"edit-error",children:T.error}),r.jsx("span",{className:Ye.editHint,children:"Tab to save · Esc to cancel"})]});const C=v==null?void 0:v(a);return r.jsxs("span",{role:"button",tabIndex:0,className:Ye.metaValueClickable,onClick:()=>T.startEdit(),onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),T.startEdit())},title:"Click to edit","aria-label":b,"data-testid":_?`${_}-button`:void 0,children:[C!==void 0?C:a?r.jsx("span",{children:a}):r.jsx("span",{className:Ye.metaPlaceholder,children:g||"None"}),r.jsx("span",{className:Ye.editButton,"aria-hidden":"true",children:"✏️"})]})}function vc(n){var A;const{value:a,onSave:i,mode:l="edit",options:c,fieldId:u="select",activeFieldId:f,onActivate:p,onChange:m,renderDisplay:v,placeholder:g,ariaLabel:b,"data-testid":_}=n,S=y.useRef(null),T=Ph({value:a,onSave:i,fieldId:u,activeFieldId:f,onActivate:p,enterToSave:!1,trimOnSave:!1});y.useEffect(()=>{if(T.isEditing){const R=window.setTimeout(()=>{var N;(N=S.current)==null||N.focus()},0);return()=>window.clearTimeout(R)}},[T.isEditing]);const C=y.useCallback(R=>{const N=R.target.value;T.ignoreInitialBlurRef.current=!1,N!==a&&i(N),T.cancelEdit()},[a,i,T]),w=y.useCallback(R=>{if(T.ignoreInitialBlurRef.current){T.ignoreInitialBlurRef.current=!1;return}R.relatedTarget instanceof HTMLElement&&R.relatedTarget.dataset.editAction===u||T.cancelEdit()},[u,T]);if(l==="create")return r.jsx("select",{className:Ye.editSelect,value:a,onChange:R=>m==null?void 0:m(R.target.value),"aria-label":b,"data-testid":_?`${_}-select`:void 0,children:c.map(R=>r.jsx("option",{value:R.value,children:R.label},R.value))});if(T.isEditing)return r.jsx("select",{ref:S,className:Ye.editSelect,value:T.draft,onChange:C,onBlur:w,title:b,"aria-label":b,"data-testid":_?`${_}-select`:void 0,children:c.map(R=>r.jsx("option",{value:R.value,children:R.label},R.value))});const k=v==null?void 0:v(a),E=(A=c.find(R=>R.value===a))==null?void 0:A.label;return r.jsxs("button",{type:"button",className:Ye.metaValueClickable,onClick:()=>T.startEdit(),title:"Click to change","aria-label":b,"data-testid":_?`${_}-button`:void 0,children:[k!==void 0?k:E?r.jsx("span",{children:E}):r.jsx("span",{className:Ye.metaPlaceholder,children:g||"None"}),r.jsx("span",{className:Ye.editButton,"aria-hidden":"true",children:"✏️"})]})}function X6(n){const{checked:a,onChange:i,label:l,ariaLabel:c,"data-testid":u}=n;return r.jsxs("label",{className:Ye.worktreeToggle,"data-testid":u,children:[r.jsx("input",{type:"checkbox",checked:a,onChange:f=>i(f.target.checked),"aria-label":c}),r.jsx("span",{children:l})]})}const Q6="_envRow_1e1r5_1",W6="_envDot_1e1r5_7",J6="_envDotGreen_1e1r5_14",eB="_envDotYellow_1e1r5_18",tB="_envDotRed_1e1r5_22",nB="_envDotGray_1e1r5_26",Vi={envRow:Q6,envDot:W6,envDotGreen:J6,envDotYellow:eB,envDotRed:tB,envDotGray:nB};function aB(n){const a=n.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?Vi.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?Vi.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?Vi.envDotRed:Vi.envDotGray}function sB(n){const{value:a,onSave:i,environments:l,allowNone:c=!1,fieldId:u="environment",activeFieldId:f,onActivate:p,placeholder:m="No environment",ariaLabel:v="Environment","data-testid":g}=n,b=l.find(T=>T.id===a),_=[...c?[{value:"",label:"None"}]:[],...l.map(T=>({value:T.id,label:T.displayName}))],S=()=>{if(b)return r.jsxs("span",{className:Vi.envRow,children:[r.jsx("span",{className:`${Vi.envDot} ${aB(b.status)}`}),b.displayName]})};return r.jsx(vc,{value:a,onSave:i,options:_,fieldId:u,activeFieldId:f,onActivate:p,renderDisplay:S,placeholder:m,ariaLabel:v,"data-testid":g})}function O0(n){if(!n)return"";const a=new Date(n);if(isNaN(a.getTime()))return"";const l=Date.now()-a.getTime();if(l<0)return"just now";const c=Math.floor(l/6e4);if(c<1)return"just now";if(c<60)return`${c}m ago`;const u=Math.floor(c/60);if(u<24)return`${u}h ago`;const f=Math.floor(u/24);return f<30?`${f}d ago`:a.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}const pf=100;function iB(n){try{const a=new URL(n);return a.protocol!=="http:"&&a.protocol!=="https:"?void 0:a.toString()}catch{return}}function oB(){const{workspaceId:n,environmentId:a}=us(),i=bt(),{tasks:l,environments:c,workspaces:u,personas:f,sessions:p,archiveWorkspace:m,updateWorkspace:v,usageCache:g,loadUsage:b}=ut(),[_,S]=y.useState("tasks"),[T,C]=y.useState(!1),[w,k]=y.useState(null),[E,A]=y.useState(!1),R=y.useRef(void 0),N=u.find($=>$.id===n),z=a??(N==null?void 0:N.environmentId)??"",H=B5(n,z,u,c);Ca({key:"1"},()=>S("graph")),Ca({key:"2"},()=>S("board")),Ca({key:"3"},()=>S("tasks")),y.useEffect(()=>{const $=R.current;R.current=n,!($===void 0||$===n)&&w!==null&&k(null)},[n,w]);const B=p.reduce(($,ae)=>$+(ae.costUsd??0),0);y.useEffect(()=>{n&&b("workspace",n)},[n,b,B]);const K=n?g[`workspace:${n}`]:void 0,W=l.filter($=>$.workspaceId===n),se=W.filter($=>$.status==="complete").length,ne=W.length,re=ne>0?Math.round(se/ne*100):0;return r.jsxs("div",{className:I.panelContainer,children:[r.jsx(fs,{segments:H}),r.jsxs("div",{className:I.workspaceHeader,children:[r.jsx("span",{className:I.workspaceName,"data-testid":"workspace-name",children:r.jsx($t,{value:(N==null?void 0:N.name)||"",onSave:$=>{N&&v(N.id,{name:$})},validate:$=>{const ae=$.trim();if(!ae)return"Name is required";if(ae.length>pf)return`Max ${pf} characters`},maxLength:pf,fieldId:"name",activeFieldId:w,onActivate:k,ariaLabel:"Workspace name",renderDisplay:$=>$||n||void 0,"data-testid":"edit-name"})}),r.jsx("button",{className:I.archiveButton,onClick:()=>C(!0),title:"Archive workspace","data-testid":"archive-workspace-button",children:"Archive"})]}),r.jsxs("button",{className:I.metaToggle,onClick:()=>A(!E),"aria-expanded":!E,"aria-controls":"workspace-meta-panel","data-testid":"meta-toggle",children:[r.jsx("span",{className:`${I.metaToggleArrow} ${E?"":I.metaToggleArrowOpen}`,children:"▶"}),"Details"]}),!E&&r.jsxs("div",{className:I.workspaceMeta,"data-testid":"workspace-meta",id:"workspace-meta-panel",children:[r.jsxs("div",{className:I.metaRow,children:[r.jsx("span",{className:I.metaLabel,children:"Description"}),r.jsx("div",{className:I.metaValue,children:r.jsx(qf,{value:(N==null?void 0:N.description)||"",onSave:$=>{N&&v(N.id,{description:$})},fieldId:"description",activeFieldId:w,onActivate:k,renderDisplay:$=>$?r.jsx("span",{className:I.overviewMarkdown,children:r.jsx($f,{remarkPlugins:[Kf],children:$})}):void 0,placeholder:"No description",ariaLabel:"Workspace description","data-testid":"edit-description"})})]}),r.jsxs("div",{className:I.metaRow,children:[r.jsx("span",{className:I.metaLabel,children:"Repository"}),r.jsx("div",{className:I.metaValue,children:r.jsx($t,{value:(N==null?void 0:N.repoUrl)||"",onSave:$=>{N&&v(N.id,{repoUrl:$})},validate:$=>{const ae=$.trim();if(ae&&!/^https?:\/\/.+/.test(ae))return"Must be a valid http(s) URL"},fieldId:"repoUrl",activeFieldId:w,onActivate:k,renderDisplay:$=>{const ae=iB($);return ae?r.jsx("a",{className:I.repoLink,href:ae,target:"_blank",rel:"noopener noreferrer",onClick:O=>O.stopPropagation(),children:$}):$?r.jsx("span",{children:$}):void 0},placeholder:"No repository",ariaLabel:"Workspace repository URL","data-testid":"edit-repo"})})]}),r.jsxs("div",{className:I.metaRow,children:[r.jsx("span",{className:I.metaLabel,children:"Environment"}),r.jsx("div",{className:I.metaValue,children:r.jsx(sB,{value:(N==null?void 0:N.environmentId)||"",onSave:$=>{N&&$&&v(N.id,{environmentId:$})},environments:c,fieldId:"environmentId",activeFieldId:w,onActivate:k,placeholder:"Select environment",ariaLabel:"Workspace environment","data-testid":"edit-env"})})]}),r.jsxs("div",{className:I.metaRow,children:[r.jsx("span",{className:I.metaLabel,children:"Persona"}),r.jsx("div",{className:I.metaValue,children:r.jsx(vc,{value:(N==null?void 0:N.defaultPersonaId)||"",onSave:$=>{N&&v(N.id,{defaultPersonaId:$})},options:[{value:"",label:"(Inherit)"},...f.map($=>({value:$.id,label:$.name}))],fieldId:"defaultPersonaId",activeFieldId:w,onActivate:k,renderDisplay:$=>{const ae=f.find(O=>O.id===$);if(ae)return r.jsx("span",{children:ae.name})},placeholder:(N==null?void 0:N.defaultPersonaId)||"(Inherit)",ariaLabel:"Workspace default persona","data-testid":"edit-persona"})})]}),r.jsxs("div",{className:I.metaRow,children:[r.jsx("span",{className:I.metaLabel,children:"Worktrees"}),r.jsx("div",{className:I.metaValue,children:r.jsx(X6,{checked:(N==null?void 0:N.useWorktrees)??!0,onChange:$=>{N&&v(N.id,{useWorktrees:$})},label:"Enable worktree isolation","data-testid":"worktree-toggle"})})]}),r.jsxs("div",{className:I.metaRow,children:[r.jsx("span",{className:I.metaLabel,children:"Working Dir"}),r.jsx("div",{className:I.metaValue,children:r.jsx($t,{value:(N==null?void 0:N.workingDirectory)||"",onSave:$=>{N&&v(N.id,{workingDirectory:$})},fieldId:"workingDirectory",activeFieldId:w,onActivate:k,placeholder:"Default (server default)",ariaLabel:"Working directory","data-testid":"edit-working-directory"})})]}),N&&r.jsxs("div",{className:I.metaTimestamps,children:[r.jsxs("span",{className:I.metaTimestamp,children:["Created ",O0(N.createdAt)]}),N.updatedAt&&N.updatedAt!==N.createdAt&&r.jsxs("span",{className:I.metaTimestamp,children:["· Updated ",O0(N.updatedAt)]})]})]}),ne>0&&r.jsxs("div",{className:I.progressBarContainer,"data-testid":"progress-bar",children:[r.jsx("div",{className:I.progressBar,children:r.jsx("div",{className:I.progressFill,style:{width:`${re}%`}})}),r.jsxs("span",{className:I.progressLabel,children:[se,"/",ne]})]}),K&&K.costUsd>0&&r.jsx("div",{className:I.progressBarContainer,children:r.jsxs("span",{className:I.progressLabel,children:["Usage: ",Fi(K.costUsd)," (",K.sessionCount," session",K.sessionCount!==1?"s":"",")"]})}),r.jsxs("div",{className:I.tabBar,role:"tablist","aria-label":"Workspace view",children:[r.jsx("button",{role:"tab","aria-selected":_==="graph",className:`${I.tab} ${_==="graph"?I.active:""}`,onClick:()=>S("graph"),children:"Graph"}),r.jsx("button",{role:"tab","aria-selected":_==="board",className:`${I.tab} ${_==="board"?I.active:""}`,onClick:()=>S("board"),"data-testid":"board-tab",children:"Board"}),r.jsx("button",{role:"tab","aria-selected":_==="tasks",className:`${I.tab} ${_==="tasks"?I.active:""}`,onClick:()=>S("tasks"),children:"Tasks"})]}),_==="tasks"&&ne>0&&r.jsxs("div",{className:I.workspaceSummary,children:[r.jsx("span",{className:I.workspaceSummaryTitle,children:`${se}/${ne} tasks complete`}),r.jsx("span",{className:I.workspaceSummarySubtitle,children:"Select a task or click + to create one"})]}),_==="tasks"&&ne===0&&r.jsxs("div",{className:I.emptyCta,children:[r.jsx("button",{className:I.ctaButton,onClick:()=>i(Ks(n,void 0,z)),children:"Create Task"}),r.jsx("div",{className:I.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}),_==="board"&&r.jsx(L6,{workspaceId:n,environmentId:z,tasks:l,sessions:p,personas:f,environments:c}),_==="graph"&&r.jsx(u6,{workspaceId:n,environmentId:z,tasks:l}),r.jsx(Ps,{isOpen:T,title:"Archive Workspace?",description:"This will hide the workspace from the sidebar. Tasks will not be deleted.",confirmLabel:"Archive",onConfirm:()=>{N&&(m(N.id),i("/",{replace:!0})),C(!1)},onCancel:()=>C(!1)})]})}const lB="_formContent_ymnez_1",rB="_section_ymnez_13",cB="_label_ymnez_19",uB="_titleInput_ymnez_26",dB="_descriptionTextarea_ymnez_58",fB="_selectField_ymnez_94",hB="_checkboxRow_ymnez_128",pB="_checkboxLabel_ymnez_141",mB="_fieldError_ymnez_146",lt={formContent:lB,section:rB,label:cB,titleInput:uB,descriptionTextarea:dB,selectField:fB,checkboxRow:hB,checkboxLabel:pB,fieldError:mB};function vB(n,a){return{name:(n==null?void 0:n.name)??"",description:(n==null?void 0:n.description)??"",repoUrl:(n==null?void 0:n.repoUrl)??"",environmentId:(n==null?void 0:n.environmentId)??a??"",defaultPersonaId:(n==null?void 0:n.defaultPersonaId)??"",useWorktrees:(n==null?void 0:n.useWorktrees)??!0,workingDirectory:(n==null?void 0:n.workingDirectory)??""}}const gB=100;function yB({values:n,onChange:a,environments:i,personas:l,errors:c,disabled:u,autoFocusName:f}){const p=(m,v)=>{a({...n,[m]:v})};return r.jsxs("div",{className:lt.formContent,children:[r.jsxs("div",{className:lt.section,children:[r.jsx("label",{className:lt.label,htmlFor:"ws-name",children:"Name"}),r.jsx("input",{id:"ws-name",className:lt.titleInput,type:"text",value:n.name,onChange:m=>p("name",m.target.value),placeholder:"Workspace name",maxLength:gB,autoFocus:f,disabled:u,"data-testid":"workspace-form-name"}),(c==null?void 0:c.name)&&r.jsx("span",{className:lt.fieldError,"data-testid":"workspace-form-error-name",children:c.name})]}),r.jsxs("div",{className:lt.section,children:[r.jsx("label",{className:lt.label,htmlFor:"ws-description",children:"Description"}),r.jsx("textarea",{id:"ws-description",className:lt.descriptionTextarea,value:n.description,onChange:m=>p("description",m.target.value),placeholder:"Optional description (Markdown supported)",disabled:u,"data-testid":"workspace-form-description"})]}),r.jsxs("div",{className:lt.section,children:[r.jsx("label",{className:lt.label,htmlFor:"ws-repo",children:"Repository URL"}),r.jsx("input",{id:"ws-repo",className:lt.titleInput,type:"text",value:n.repoUrl,onChange:m=>p("repoUrl",m.target.value),placeholder:"https://github.com/org/repo",disabled:u,"data-testid":"workspace-form-repo"}),(c==null?void 0:c.repoUrl)&&r.jsx("span",{className:lt.fieldError,"data-testid":"workspace-form-error-repoUrl",children:c.repoUrl})]}),r.jsxs("div",{className:lt.section,children:[r.jsx("label",{className:lt.label,htmlFor:"ws-environment",children:"Environment"}),r.jsxs("select",{id:"ws-environment",className:lt.selectField,value:n.environmentId,onChange:m=>p("environmentId",m.target.value),disabled:u,"data-testid":"workspace-form-environment",children:[r.jsx("option",{value:"",children:"Select environment…"}),i.map(m=>r.jsx("option",{value:m.id,children:m.displayName||m.id},m.id))]}),(c==null?void 0:c.environmentId)&&r.jsx("span",{className:lt.fieldError,"data-testid":"workspace-form-error-environmentId",children:c.environmentId})]}),r.jsxs("div",{className:lt.section,children:[r.jsx("label",{className:lt.label,htmlFor:"ws-persona",children:"Default Persona"}),r.jsxs("select",{id:"ws-persona",className:lt.selectField,value:n.defaultPersonaId,onChange:m=>p("defaultPersonaId",m.target.value),disabled:u,"data-testid":"workspace-form-persona",children:[r.jsx("option",{value:"",children:"(Inherit)"}),l.map(m=>r.jsx("option",{value:m.id,children:m.name},m.id))]})]}),r.jsx("div",{className:lt.section,children:r.jsxs("label",{className:lt.checkboxRow,children:[r.jsx("input",{type:"checkbox",checked:n.useWorktrees,onChange:m=>p("useWorktrees",m.target.checked),disabled:u,"data-testid":"workspace-form-worktrees"}),r.jsx("span",{className:lt.checkboxLabel,children:"Enable worktree isolation"})]})}),r.jsxs("div",{className:lt.section,children:[r.jsx("label",{className:lt.label,htmlFor:"ws-workdir",children:"Working Directory"}),r.jsx("input",{id:"ws-workdir",className:lt.titleInput,type:"text",value:n.workingDirectory,onChange:m=>p("workingDirectory",m.target.value),placeholder:"Default (server default)",disabled:u,"data-testid":"workspace-form-workdir"})]})]})}const bB="_container_cddyd_1",_B="_header_cddyd_8",xB="_headerTitle_cddyd_35",SB="_badge_cddyd_44",TB="_headerActions_cddyd_54",kB="_body_cddyd_61",jB="_formContent_cddyd_73",wB="_section_cddyd_85",CB="_label_cddyd_91",NB="_titleInput_cddyd_98",EB="_descriptionTextarea_cddyd_131",AB="_parentContext_cddyd_167",DB="_parentLabel_cddyd_175",RB="_parentName_cddyd_182",MB="_personaSelect_cddyd_186",OB="_depList_cddyd_220",BB="_depItem_cddyd_226",LB="_depItemSelected_cddyd_248",IB="_noDeps_cddyd_252",zB="_btnPrimary_cddyd_258",UB="_btnGhost_cddyd_289",Re={container:bB,header:_B,headerTitle:xB,badge:SB,headerActions:TB,body:kB,formContent:jB,section:wB,label:CB,titleInput:NB,descriptionTextarea:EB,parentContext:AB,parentLabel:DB,parentName:RB,personaSelect:MB,depList:OB,depItem:BB,depItemSelected:LB,noDeps:IB,btnPrimary:zB,btnGhost:UB};function VB(n){const a={};return n.name.trim()||(a.name="Name is required"),n.repoUrl.trim()&&!/^https?:\/\/.+/i.test(n.repoUrl.trim())&&(a.repoUrl="Must be a valid http(s) URL"),n.environmentId||(a.environmentId="Environment is required"),Object.keys(a).length>0?a:void 0}const HB=[{label:"Home",url:Hs},{label:"New Workspace",url:void 0}];function PB(){const[n]=th(),a=n.get("environment")??void 0,{environments:i,personas:l,createWorkspace:c,workspaceCreating:u}=ut(),{showToast:f}=Aa(),p=bt(),[m,v]=y.useState(()=>{var w;return vB(void 0,a||((w=i[0])==null?void 0:w.id))}),[g,b]=y.useState(),[_,S]=y.useState();y.useEffect(()=>{a||m.environmentId||i.length===0||v(w=>{var k;return w.environmentId?w:{...w,environmentId:((k=i[0])==null?void 0:k.id)??""}})},[i,a,m.environmentId]);const T=()=>{const w=VB(m);if(w){b(w),S(void 0);return}b(void 0),S(void 0),c(m.name.trim(),m.description,m.repoUrl.trim(),m.environmentId,m.defaultPersonaId,m.useWorktrees,m.workingDirectory,()=>{f("Workspace created","success"),p(Hs,{replace:!0})},k=>{S(k)})},C=()=>{p(a?qi(a):Hs,{replace:!0})};return r.jsxs("div",{className:Re.container,children:[r.jsxs("div",{className:Re.header,children:[r.jsx("div",{className:Re.headerTitle,children:r.jsx(fs,{segments:HB})}),r.jsxs("div",{className:Re.headerActions,children:[r.jsx("button",{className:Re.btnGhost,onClick:C,disabled:u,"data-testid":"workspace-create-cancel",children:"Cancel"}),r.jsx("button",{className:Re.btnPrimary,onClick:T,disabled:u||!m.name.trim()||!m.environmentId,"data-testid":"workspace-create-save",children:u?r.jsx(fx,{size:"sm",label:"Creating"}):"Create Workspace"})]})]}),r.jsxs("div",{className:Re.body,children:[r.jsx(yB,{values:m,onChange:w=>{v(w),b(void 0),S(void 0)},environments:i,personas:l,errors:g,disabled:u,autoFocusName:!0}),_&&r.jsx("div",{className:Re.error,"data-testid":"workspace-create-submit-error",children:_})]})]})}function yx({mode:n,taskId:a,workspaceId:i,parentTaskId:l,environmentId:c,tasks:u,workspaces:f,personas:p,onCreateTask:m,onUpdateTask:v,onEditDone:g}){const{showToast:b}=Aa(),_=bt(),S=n==="edit",T=S&&a?u.find(fe=>fe.id===a):void 0,C=S?(T==null?void 0:T.workspaceId)??"":i??"",[w,k]=y.useState(C),E=C||w,A=f.find(fe=>fe.id===E),R=c??(A==null?void 0:A.environmentId),N=!S&&!i,z=S?(T==null?void 0:T.parentTaskId)??"":l??"",H=z?u.find(fe=>fe.id===z):void 0,[B,K]=y.useState((T==null?void 0:T.title)??""),[W,se]=y.useState((T==null?void 0:T.description)??""),[ne,re]=y.useState((T==null?void 0:T.dependsOn)??[]),[$,ae]=y.useState((T==null?void 0:T.defaultPersonaId)??""),[O,G]=y.useState((T==null?void 0:T.canDecompose)??!1),[Q,oe]=y.useState(!1),le=y.useRef(!1);y.useEffect(()=>{S&&T&&!le.current&&(le.current=!0,K(T.title),se(T.description),re(T.dependsOn),ae(T.defaultPersonaId),G(T.canDecompose))},[S,T]);const De=u.filter(fe=>fe.workspaceId===E&&(!S||fe.id!==a)&&fe.id!==z),we=B.trim().length>0&&(!S||T!==void 0)&&E.length>0,Se=fe=>{re(Ge=>Ge.includes(fe)?Ge.filter(Kt=>Kt!==fe):[...Ge,fe])},Oe=()=>{!we||Q||S&&T===void 0||(S&&a?(v(a,B.trim(),W,ne,$),b("Task updated","success"),g?g():_(ta(a,void 0,E,R),{replace:!0})):(oe(!0),m(E,B.trim(),W,ne.length>0?ne:void 0,z||void 0,$,O,()=>{b("Task created","success"),_(i?Pi(i,R):"/tasks",{replace:!0})},fe=>{b(fe,"error"),oe(!1)})))},ce=()=>{if(g){g();return}_(S&&a?ta(a,void 0,E,R):i?Pi(i,R):"/tasks")},me=S?"edit task":z?"child task":"new task";return r.jsxs("div",{className:Re.container,children:[r.jsxs("div",{className:Re.header,children:[r.jsxs("div",{className:Re.headerTitle,children:[r.jsx("span",{className:Re.badge,children:me}),H&&r.jsxs("span",{className:Re.parentContext,children:[r.jsx("span",{className:Re.parentLabel,children:"Child of"}),r.jsx("span",{className:Re.parentName,children:H.title})]})]}),r.jsxs("div",{className:Re.headerActions,children:[r.jsx("button",{onClick:Oe,disabled:!we||Q,className:Re.btnPrimary,"data-testid":"task-edit-save",children:Q?"Creating…":S?"Save Changes":"Create"}),r.jsx("button",{onClick:ce,className:Re.btnGhost,children:"Cancel"})]})]}),r.jsx("div",{className:Re.body,children:r.jsxs("div",{className:Re.formContent,children:[N&&r.jsxs("div",{className:Re.section,children:[r.jsx("label",{className:Re.label,htmlFor:"task-edit-workspace",children:"Workspace"}),r.jsxs("select",{id:"task-edit-workspace",value:w,onChange:fe=>k(fe.target.value),className:Re.personaSelect,"data-testid":"task-edit-workspace",children:[r.jsx("option",{value:"",children:"Select a workspace..."}),f.map(fe=>r.jsx("option",{value:fe.id,children:fe.name},fe.id))]})]}),r.jsxs("div",{className:Re.section,children:[r.jsx("label",{className:Re.label,htmlFor:"task-edit-title",children:"Title"}),r.jsx("input",{id:"task-edit-title",type:"text",value:B,onChange:fe=>K(fe.target.value),placeholder:"Task title...",autoFocus:!0,className:Re.titleInput,"data-testid":"task-edit-title",onKeyDown:fe=>{fe.key==="Enter"&&we&&Oe()}})]}),r.jsxs("div",{className:Re.section,children:[r.jsx("label",{className:Re.label,htmlFor:"task-edit-description",children:"Description"}),r.jsx("textarea",{id:"task-edit-description",value:W,onChange:fe=>se(fe.target.value),placeholder:"Describe the task... (markdown supported)",className:Re.descriptionTextarea,"data-testid":"task-edit-description",rows:8})]}),r.jsxs("div",{className:Re.section,children:[r.jsx("label",{className:Re.label,htmlFor:"task-edit-persona",children:"Default Persona"}),r.jsxs("select",{id:"task-edit-persona",value:$,onChange:fe=>ae(fe.target.value),className:Re.personaSelect,"data-testid":"task-edit-persona",children:[r.jsx("option",{value:"",children:"(Inherit)"}),p.map(fe=>r.jsx("option",{value:fe.id,children:fe.name},fe.id))]})]}),!S&&r.jsx("div",{className:Re.section,children:r.jsxs("label",{className:Re.depItem,"data-testid":"task-edit-can-decompose",children:[r.jsx("input",{type:"checkbox",checked:O,onChange:fe=>G(fe.target.checked)}),"Can spawn subtasks"]})}),r.jsxs("div",{className:Re.section,children:[r.jsx("div",{className:Re.label,children:"Dependencies"}),De.length===0?r.jsx("div",{className:Re.noDeps,children:"No other tasks in this workspace"}):r.jsx("div",{className:Re.depList,children:De.map(fe=>{const Ge=ne.includes(fe.id);return r.jsxs("label",{className:`${Re.depItem} ${Ge?Re.depItemSelected:""}`,"data-testid":`dep-option-${fe.id}`,children:[r.jsx("input",{type:"checkbox",checked:Ge,onChange:()=>Se(fe.id)}),fe.title,r.jsxs("span",{style:{opacity:.5,fontSize:"11px",marginLeft:"4px"},children:["(",fe.status,")"]})]},fe.id)})})]})]})})]})}function B0(){const{workspaceId:n,environmentId:a}=us(),[i]=th(),l=n??i.get("workspace")??"",c=i.get("parent")??void 0,{tasks:u,workspaces:f,personas:p,createTask:m,updateTask:v}=ut();return r.jsx(yx,{mode:"new",workspaceId:l,parentTaskId:c,environmentId:a,tasks:u,workspaces:f,personas:p,onCreateTask:m,onUpdateTask:v})}const GB="_container_1pqxm_1",qB="_emptyState_1pqxm_8",$B="_card_1pqxm_14",KB="_cardHeader_1pqxm_34",YB="_categoryBadge_1pqxm_46",FB="_findingTitle_1pqxm_54",ZB="_findingDate_1pqxm_60",XB="_findingContent_1pqxm_72",QB="_tags_1pqxm_78",WB="_tag_1pqxm_78",Qn={container:GB,emptyState:qB,card:$B,cardHeader:KB,categoryBadge:YB,findingTitle:FB,findingDate:ZB,findingContent:XB,tags:QB,tag:WB};function JB(n){const a=new Date(n),i=new Date,l=i.getTime()-a.getTime(),c=Math.floor(l/1e3),u=Math.floor(c/60),f=Math.floor(u/60),p=Math.floor(f/24);if(c<60)return"just now";if(u<60)return`${u}m ago`;if(f<24)return`${f}h ago`;if(p===1)return"yesterday";if(p<7)return`${p} days ago`;const m=a.getFullYear()===i.getFullYear(),v=a.toLocaleString("en-US",{month:"short"}),g=a.getDate();return m?`${v} ${g}`:`${v} ${g} ${a.getFullYear()}`}const L0={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 e4({findings:n}){return n.length===0?r.jsx("div",{className:Qn.emptyState,children:"No findings yet. Agents will post discoveries here."}):r.jsx("div",{className:Qn.container,children:n.map((a,i)=>{const l=L0[a.category]||L0.general;return r.jsxs(Et.div,{className:Qn.card,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:i*.05,duration:.2},children:[r.jsxs("div",{className:Qn.cardHeader,children:[r.jsx("span",{className:Qn.categoryBadge,style:{background:l.bg,color:l.text},children:a.category}),r.jsx("span",{className:Qn.findingTitle,children:a.title}),r.jsx("span",{className:Qn.findingDate,title:a.createdAt,children:JB(a.createdAt)})]}),r.jsx("div",{className:Qn.findingContent,children:a.content.length>300?a.content.slice(0,300)+"...":a.content}),a.tags.length>0&&r.jsx("div",{className:Qn.tags,children:a.tags.map(c=>r.jsx("span",{className:Qn.tag,style:{color:l.text,textShadow:`0 0 8px ${l.text}`},children:c},c))})]},a.id)})})}const t4="_workpadSection_y8nj9_1",n4="_workpadLabel_y8nj9_9",a4="_workpadStatus_y8nj9_17",s4="_workpadSummary_y8nj9_23",i4="_workpadExtra_y8nj9_29",ss={workpadSection:t4,workpadLabel:n4,workpadStatus:a4,workpadSummary:s4,workpadExtra:i4};function o4({workpad:n}){if(!n)return;let a;try{const i=JSON.parse(n);if(i==null||typeof i!="object"||Array.isArray(i))return;a=i}catch{return r.jsxs("div",{className:ss.workpadSection,"data-testid":"workpad-panel",children:[r.jsx("div",{className:ss.workpadLabel,children:"Workpad"}),r.jsx("div",{className:ss.workpadExtra,children:n})]})}if(!(!a.status&&!a.summary&&!a.extra))return r.jsxs("div",{className:ss.workpadSection,"data-testid":"workpad-panel",children:[r.jsx("div",{className:ss.workpadLabel,children:"Workpad"}),a.status&&r.jsx("div",{className:ss.workpadStatus,"data-testid":"workpad-status",children:a.status}),a.summary&&r.jsx("div",{className:ss.workpadSummary,"data-testid":"workpad-summary",children:a.summary}),a.extra&&Object.keys(a.extra).length>0&&r.jsx("div",{className:ss.workpadExtra,"data-testid":"workpad-extra",children:JSON.stringify(a.extra,null,2)})]})}function Qr(n){if(!n)return"—";const a=new Date(n);return isNaN(a.getTime())?"—":a.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})}function mf(n,a){if(!n||!a)return;const i=new Date(a).getTime()-new Date(n).getTime();if(isNaN(i)||i<0)return;const l=Math.floor(i/6e4),c=Math.floor(i%6e4/1e3);if(l===0)return`${c}s`;const u=Math.floor(l/60),f=l%60;return u===0?`${l}m ${c}s`:`${u}h ${f}m`}function I0(n){const a=n.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?I.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?I.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?I.envDotRed:I.envDotGray}function l4({status:n}){const a=cs(n),i=P2(n);return r.jsx("span",{className:`${I.statusBadge} ${I[i]??I.statusPending}`,children:a.label})}function r4({task:n,tasksById:a,environments:i,workspaces:l,taskSessions:c,selectedEnvId:u}){const{loadUsage:f,usageCache:p}=ut(),m=c.reduce((A,R)=>A+(R.costUsd??0),0);y.useEffect(()=>{f("task",n.id),n.childTaskIds.length>0&&f("task_tree",n.id)},[n.id,n.childTaskIds.length,f,m]);const v=`task:${n.id}`,g=v in p?p[v]:void 0,b=`task_tree:${n.id}`,_=n.childTaskIds.length>0&&b in p?p[b]:void 0,S=c.length>0?c[c.length-1]:void 0,T=(S==null?void 0:S.environmentId)??"",C=T?i.find(A=>A.id===T):void 0,w=l.find(A=>A.id===n.workspaceId),k=i.find(A=>A.id===u),E=n.branch&&(w!=null&&w.repoUrl)?`${w.repoUrl.replace(/\/$/,"")}/tree/${encodeURIComponent(n.branch)}`:void 0;return r.jsxs("div",{className:I.overviewDashboard,children:[r.jsxs("div",{className:I.overviewHero,children:[r.jsx(l4,{status:n.status}),n.branch&&r.jsx("span",{className:I.overviewBranchPill,children:E?r.jsxs("a",{href:E,target:"_blank",rel:"noreferrer noopener",className:I.branchLink,children:["🔗"," ",n.branch]}):r.jsxs("span",{children:["🔗"," ",n.branch]})})]}),typeof n.description=="string"&&n.description&&r.jsxs("div",{className:I.overviewSection,children:[r.jsx("div",{className:I.overviewLabel,children:"Description"}),r.jsx("div",{className:I.overviewMarkdown,children:r.jsx($f,{remarkPlugins:[Kf],children:n.description})})]}),n.workpad&&r.jsx(o4,{workpad:n.workpad}),r.jsxs("div",{className:I.overviewSection,children:[r.jsx("div",{className:I.overviewLabel,children:"Environment"}),T&&C?r.jsxs("div",{className:I.envRow,"data-testid":"task-overview-environment",children:[r.jsx("span",{className:`${I.envDot} ${I0(C.status)}`,title:C.status,"aria-label":`Status: ${C.status}`,role:"img"}),r.jsx("span",{className:I.overviewValue,children:C.displayName})]}):k?r.jsxs("div",{className:I.envRow,"data-testid":"task-overview-environment",children:[r.jsx("span",{className:`${I.envDot} ${I0(k.status)}`,title:k.status,"aria-label":`Status: ${k.status}`,role:"img"}),r.jsx("span",{className:I.overviewValue,children:k.displayName}),r.jsx("span",{className:I.overviewMuted,children:"(workspace default)"})]}):r.jsx("div",{className:I.overviewMuted,children:"Set in workspace settings"})]}),r.jsxs("div",{className:I.overviewSection,"data-testid":"task-overview-dependencies",children:[r.jsx("div",{className:I.overviewLabel,children:"Dependencies"}),n.dependsOn.length===0?r.jsx("div",{className:I.overviewMuted,children:"None"}):r.jsx("div",{className:I.depList,children:n.dependsOn.map(A=>{const R=a.get(A),N=(R==null?void 0:R.status)==="complete";return r.jsxs("div",{className:`${I.depItem} ${N?I.depDone:I.depBlocked}`,children:[r.jsx("span",{children:N?"✓":"○"}),r.jsx("span",{children:(R==null?void 0:R.title)??A})]},A)})})]}),r.jsxs("div",{className:I.overviewSection,children:[r.jsx("div",{className:I.overviewLabel,children:"Timeline"}),r.jsxs("div",{className:I.timeline,children:[n.createdAt&&r.jsxs("div",{className:I.timelineRow,children:[r.jsx("span",{className:I.timelineKey,children:"Created"}),r.jsx("span",{className:I.timelineValue,children:Qr(n.createdAt)})]}),n.assignedAt&&(()=>{const A=mf(n.createdAt,n.assignedAt);return r.jsxs("div",{className:I.timelineRow,children:[r.jsx("span",{className:I.timelineKey,children:"Assigned"}),r.jsx("span",{className:I.timelineValue,children:Qr(n.assignedAt)}),A!==void 0&&r.jsx("span",{className:I.timelineDelta,children:A})]})})(),n.startedAt&&(()=>{const A=mf(n.assignedAt??n.createdAt,n.startedAt);return r.jsxs("div",{className:I.timelineRow,children:[r.jsx("span",{className:I.timelineKey,children:"Started"}),r.jsx("span",{className:I.timelineValue,children:Qr(n.startedAt)}),A!==void 0&&r.jsx("span",{className:I.timelineDelta,children:A})]})})(),n.completedAt&&(()=>{const A=mf(n.startedAt,n.completedAt);return r.jsxs("div",{className:I.timelineRow,children:[r.jsx("span",{className:I.timelineKey,children:"Completed"}),r.jsx("span",{className:I.timelineValue,children:Qr(n.completedAt)}),A!==void 0&&r.jsx("span",{className:I.timelineDelta,children:A})]})})(),!n.createdAt&&!n.assignedAt&&!n.startedAt&&!n.completedAt&&r.jsx("div",{className:I.overviewMuted,children:"No timing data"})]})]}),g&&g.costUsd>0&&r.jsxs("div",{className:I.overviewSection,children:[r.jsx("div",{className:I.overviewLabel,children:"Usage"}),r.jsxs("div",{className:I.timeline,children:[r.jsxs("div",{className:I.timelineRow,children:[r.jsx("span",{className:I.timelineKey,children:"Cost"}),r.jsx("span",{className:I.timelineValue,children:Fi(g.costUsd)}),r.jsxs("span",{className:I.timelineDelta,children:[g.sessionCount," session",g.sessionCount!==1?"s":""]})]}),_&&_.costUsd>g.costUsd&&r.jsxs("div",{className:I.timelineRow,children:[r.jsx("span",{className:I.timelineKey,children:"Total (incl. subtasks)"}),r.jsx("span",{className:I.timelineValue,children:Fi(_.costUsd)}),r.jsxs("span",{className:I.timelineDelta,children:[_.sessionCount," session",_.sessionCount!==1?"s":""]})]})]})]}),n.reviewNotes&&r.jsxs("div",{className:I.overviewSection,children:[r.jsx("div",{className:I.overviewLabel,children:"Review Notes"}),r.jsx("div",{className:I.reviewNotes,children:n.reviewNotes})]})]})}function c4({task:n,sessionId:a,isBlocked:i,onStart:l,onResume:c,onStop:u,onPause:f,onDelete:p,onEdit:m}){if(n.status==="not_started")return i?r.jsxs("div",{className:I.headerActions,children:[r.jsx("button",{onClick:m,className:I.btnGhost,children:"Edit"}),r.jsx("button",{onClick:p,className:I.btnDanger,children:"Delete"})]}):r.jsxs("div",{className:I.headerActions,children:[r.jsx("button",{"data-testid":"task-header-start",onClick:l,className:I.btnPrimary,children:"Start"}),r.jsx("button",{onClick:m,className:I.btnGhost,children:"Edit"}),r.jsx("button",{onClick:p,className:I.btnDanger,children:"Delete"})]});if(n.status==="working")return r.jsxs("div",{className:I.headerActions,children:[r.jsx("button",{onClick:u,className:I.btnDanger,children:"Stop"}),r.jsx("button",{onClick:f,disabled:!a,className:I.btnGhost,children:"Pause"})]});if(n.status==="paused")return r.jsxs("div",{className:I.headerActions,children:[r.jsx("button",{onClick:u,className:I.btnPrimary,children:"Stop"}),r.jsx("button",{onClick:c,className:I.btnGhost,children:"Resume"}),r.jsx("button",{onClick:p,className:I.btnDanger,children:"Delete"})]});if(n.status==="complete")return r.jsx("div",{className:I.headerActions,children:r.jsx("button",{onClick:p,className:I.btnDanger,children:"Delete"})});if(n.status==="failed")return r.jsxs("div",{className:I.headerActions,children:[r.jsx("button",{onClick:l,className:I.btnPrimary,children:"Retry"}),r.jsx("button",{onClick:p,className:I.btnDanger,children:"Delete"})]})}function u4({taskSessions:n,selectedSessionId:a,onSelect:i}){if(!(n.length<2))return r.jsxs("div",{className:I.attemptSelector,"data-testid":"attempt-selector",children:[r.jsx("span",{className:I.attemptLabel,children:"Attempts:"}),n.map((l,c)=>{const u=l.id===a,f=l.status==="stopped"&&l.endReason==="completed"?"✓":l.status==="stopped"?"✗":l.status==="running"||l.status==="idle"?"●":"";return r.jsxs("button",{className:`${I.attemptButton} ${u?I.attemptActive:""}`,onClick:()=>i(l.id),title:`Attempt #${c+1} — ${l.status}`,"aria-label":`Attempt #${c+1}, ${l.status}`,"aria-pressed":u,"data-testid":`attempt-${c+1}`,children:["#",c+1,f&&r.jsx("span",{className:I.attemptStatus,children:f})]},l.id)})]})}function is(){const{taskId:n,workspaceId:a,environmentId:i}=us(),l=Bt(),c=bt(),{events:u,eventsDropped:f,tasks:p,sessions:m,environments:v,findings:g,loadSessionEvents:b,loadFindings:_,kill:S,startTask:T,stopTask:C,resumeTask:w,deleteTask:k,createTask:E,updateTask:A,workspaces:R,taskSessions:N,loadTaskSessions:z,sendInput:H,spawn:B,personas:K,provisionEnvironment:W}=ut(),se=y.useRef(void 0),ne=y.useRef(void 0),re=y.useRef(void 0),$=y.useRef(void 0),ae=y.useRef(void 0),O=l.pathname.endsWith("/stream")?"stream":l.pathname.endsWith("/findings")?"findings":"overview",G=l.pathname.endsWith("/edit"),[Q,oe]=y.useState(O),[le,De]=y.useState(!1),[we,Se]=y.useState(void 0),[Oe,ce]=y.useState(""),[me,fe]=y.useState(G),Ge=y.useRef(O),Kt=y.useRef(G),te=p.find(Ee=>Ee.id===n),J=(te==null?void 0:te.workspaceId)||void 0,Ce=R.find(Ee=>Ee.id===J);y.useEffect(()=>{O!==Ge.current&&(Ge.current=O,O!==Q&&oe(O))},[O,Q]),y.useEffect(()=>{G!==Kt.current&&(Kt.current=G,G!==me&&fe(G))},[G,me]),y.useEffect(()=>{if(Oe===""){if(Ce!=null&&Ce.environmentId)ce(Ce.environmentId);else if(v.length>0){const Ee=v.find(At=>At.status==="connected");ce((Ee==null?void 0:Ee.id)??v[0].id)}}},[Oe,Ce==null?void 0:Ce.environmentId,v]);const rn=te?N[te.id]??[]:[];let Ue;we&&rn.some(Ee=>Ee.id===we)?Ue=we:Ue=(te==null?void 0:te.latestSessionId)||void 0;const qn=()=>{De(!0)},$n=()=>{if(!te)return;k(te.id),De(!1);const Ee=i??(Ce==null?void 0:Ce.environmentId);c(te.workspaceId&&Ee?Pi(te.workspaceId,Ee):"/",{replace:!0})};y.useEffect(()=>{(te==null?void 0:te.id)!==ne.current&&(ne.current=te==null?void 0:te.id,Se(void 0),ce(""),fe(G))},[te==null?void 0:te.id,G]),y.useEffect(()=>{if(!(te!=null&&te.id))return;const Ee=te.id!==$.current,At=te.latestSessionId!==ae.current;(Ee||At)&&($.current=te.id,ae.current=te.latestSessionId,z(te.id))},[te==null?void 0:te.id,te==null?void 0:te.latestSessionId,z]),y.useEffect(()=>{if((te==null?void 0:te.status)!==re.current){const Ee=re.current===void 0;re.current=te==null?void 0:te.status;const At=(te==null?void 0:te.status)==="not_started"?"overview":(te==null?void 0:te.status)==="working"||(te==null?void 0:te.status)==="paused"?"stream":(te==null?void 0:te.status)==="complete"?"findings":void 0;At&&At!==Q&&!(Ee&&O!=="overview")&&oe(At)}},[te==null?void 0:te.status,Q,O]);const In=y.useMemo(()=>new Map(p.map(Ee=>[Ee.id,Ee])),[p]),Kn=y.useMemo(()=>{const Ee=Ue?u.filter(At=>At.sessionId===Ue):[];return Hh(Vh(Ee))},[u,Ue]),xn=te?te.dependsOn.some(Ee=>{const At=In.get(Ee);return At!==void 0&&At.status!=="complete"}):!1,Da=y.useMemo(()=>L5(n,i,R,v,In),[n,i,R,v,In]);y.useEffect(()=>{Ue&&Ue!==se.current&&(se.current=Ue,b(Ue))},[Ue,b]),y.useEffect(()=>{Q==="findings"&&J&&_(J)},[Q,J,_]);const cn=Ee=>{oe(Ee),c(ta(n,Ee==="overview"?void 0:Ee,a,i))};return Ca({key:"1"},()=>cn("overview")),Ca({key:"2"},()=>cn("stream")),Ca({key:"3"},()=>cn("findings")),r.jsxs("div",{className:I.panelContainer,children:[r.jsx(fs,{segments:Da}),r.jsxs("div",{className:I.header,children:[r.jsxs("span",{className:I.headerTitle,children:[r.jsx("span",{"data-testid":"task-title",children:(te==null?void 0:te.title)||n}),te&&r.jsx("span",{className:I.taskStatusBadge,"data-testid":"task-status",children:te.status}),(te==null?void 0:te.branch)&&r.jsx("span",{className:I.taskBranch,children:te.branch}),xn&&r.jsx("span",{className:I.taskBlockedBadge,children:"blocked"})]}),te&&r.jsx(c4,{task:te,sessionId:Ue,isBlocked:xn,onStart:()=>T(te.id,void 0,Oe),onResume:()=>w(te.id),onStop:()=>C(te.id),onPause:()=>Ue&&S(Ue),onDelete:qn,onEdit:()=>fe(!0)})]}),r.jsxs("div",{className:I.tabBar,role:"tablist","aria-label":"Task view",children:[r.jsx("button",{role:"tab","aria-selected":Q==="overview",className:`${I.tab} ${Q==="overview"?I.active:""}`,onClick:()=>cn("overview"),children:"Overview"}),r.jsx("button",{role:"tab","aria-selected":Q==="stream",className:`${I.tab} ${Q==="stream"?I.active:""}`,onClick:()=>cn("stream"),children:"Stream"}),r.jsx("button",{role:"tab","aria-selected":Q==="findings",className:`${I.tab} ${Q==="findings"?I.active:""}`,onClick:()=>cn("findings"),children:"Findings"})]}),r.jsxs(na,{mode:"wait",children:[Q==="overview"&&r.jsx(Et.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:I.overviewContent,"data-testid":"task-overview",children:me&&te?r.jsx(yx,{mode:"edit",taskId:te.id,workspaceId:J,environmentId:i,tasks:p,workspaces:R,personas:K,onCreateTask:E,onUpdateTask:A,onEditDone:()=>{G?c(ta(te.id,void 0,a,i),{replace:!0}):fe(!1)}}):te?r.jsx(r4,{task:te,tasksById:In,environments:v,workspaces:R,taskSessions:rn,selectedEnvId:Oe}):r.jsx("div",{className:I.waitingMessage,children:"No additional details"})},"overview"),Q==="stream"&&r.jsxs(Et.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden"},children:[r.jsx(u4,{taskSessions:rn,selectedSessionId:Ue,onSelect:Ee=>Se(Ee)}),r.jsx(Uh,{events:Kn,eventsDropped:f,emptyState:!Ue&&te?xn?r.jsx("div",{className:I.emptyCta,"data-testid":"stream-blocked-message",children:r.jsx("div",{className:I.ctaDescription,children:"This task is blocked by incomplete dependencies"})}):r.jsxs("div",{className:I.emptyCta,children:[r.jsx("button",{"data-testid":"stream-start-cta",className:I.ctaButton,onClick:()=>T(te.id,void 0,Oe),children:"Start Task"}),r.jsx("div",{className:I.ctaDescription,children:"Click to begin agent execution"})]}):Ue&&Kn.length===0?r.jsx("div",{className:I.waitingMessage,children:"Waiting for events..."}):void 0})]},"stream"),Q==="findings"&&r.jsx(Et.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:I.tabContent,children:J?r.jsx(e4,{findings:g.filter(Ee=>Ee.workspaceId===J)}):r.jsx("div",{className:I.noContext,children:"Navigate to a task within a workspace to view findings"})},"findings")]}),(()=>{if(!te||te.status!=="working"&&te.status!=="paused")return;const Ee=Ue?m.find(At=>At.id===Ue):void 0;if(!(!Ee||Ee.status==="stopped"))return r.jsx(gl,{mode:"send",sessionId:Ee.id,environmentId:Ee.environmentId,personas:K,environments:v,onSendInput:H,onSpawn:B,onStartTask:T,onProvisionEnvironment:W})})(),te&&r.jsx(Ps,{isOpen:le,title:"Delete Task?",description:`"${te.title}" will be permanently removed.`,onConfirm:$n,onCancel:()=>De(!1)})]})}const d4="_container_legrg_1",f4="_header_legrg_8",h4="_headerTitle_legrg_35",p4="_badge_legrg_44",m4="_headerActions_legrg_54",v4="_body_legrg_61",g4="_formContent_legrg_73",y4="_section_legrg_85",b4="_label_legrg_91",_4="_nameInput_legrg_98",x4="_fieldInput_legrg_131",S4="_adapterSelect_legrg_164",T4="_readOnlyValue_legrg_198",k4="_codespaceSection_legrg_204",j4="_codespaceActions_legrg_210",w4="_creatingHint_legrg_216",C4="_errorHint_legrg_222",N4="_btnPrimary_legrg_235",E4="_btnGhost_legrg_266",ee={container:d4,header:f4,headerTitle:h4,badge:p4,headerActions:m4,body:v4,formContent:g4,section:y4,label:b4,nameInput:_4,fieldInput:x4,adapterSelect:S4,readOnlyValue:T4,codespaceSection:k4,codespaceActions:j4,creatingHint:w4,errorHint:C4,btnPrimary:N4,btnGhost:E4},sc=1,ic=65535;function vf(n){if(!n.trim())return!0;const a=Number(n);return Number.isInteger(a)&&a>=sc&&a<=ic}function gf(n){try{const a=JSON.parse(n);if(typeof a=="object"&&a!==null&&!Array.isArray(a))return a}catch{}return{}}function A4({codespaceName:n,onCodespaceNameChange:a,envName:i,onEnvNameChange:l,codespaces:c,codespaceError:u,codespaceListError:f,codespaceCreating:p,onCreateCodespace:m}){const[v,g]=y.useState("pick"),[b,_]=y.useState(""),[S,T]=y.useState("");return v==="create"?r.jsxs("div",{className:ee.codespaceSection,children:[r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,children:"Repository"}),r.jsx("input",{type:"text",value:b,onChange:C=>_(C.target.value),placeholder:"owner/repo",className:ee.fieldInput,"data-testid":"env-codespace-repo"})]}),r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,children:"Machine Type"}),r.jsx("input",{type:"text",value:S,onChange:C=>T(C.target.value),placeholder:"Machine type (optional)...",className:ee.fieldInput,"data-testid":"env-codespace-machine"})]}),r.jsxs("div",{className:ee.codespaceActions,children:[r.jsx("button",{onClick:()=>{b.trim()&&(m(b.trim(),S.trim()||void 0),g("pick"),_(""),T(""))},disabled:!b.trim(),className:ee.btnPrimary,children:"Create"}),r.jsx("button",{onClick:()=>{g("pick"),_(""),T("")},className:ee.btnGhost,children:"Cancel"})]})]}):r.jsx("div",{className:ee.codespaceSection,children:r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,children:"Codespace"}),!f&&r.jsxs("select",{value:n,onChange:C=>{C.target.value==="__create__"?(g("create"),a("")):(a(C.target.value),C.target.value&&!i.trim()&&l(C.target.value))},disabled:p,className:ee.adapterSelect,"data-testid":"env-codespace-select",children:[r.jsx("option",{value:"",children:"Select a codespace..."}),c.map(C=>r.jsxs("option",{value:C.name,children:[C.name," (",C.repository,") — ",C.state]},C.name)),r.jsx("option",{value:"__create__",children:"Create new from repo..."})]}),p&&r.jsx("span",{className:ee.creatingHint,children:"Creating codespace..."}),f&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:ee.errorHint,children:f}),r.jsx("input",{type:"text",value:n,onChange:C=>a(C.target.value),placeholder:"Or enter codespace name manually...",className:ee.fieldInput,"data-testid":"env-codespace-manual"})]}),u&&!f&&r.jsx("span",{className:ee.errorHint,children:u})]})})}function bx({mode:n,environmentId:a,environments:i,onAddEnvironment:l,onUpdateEnvironment:c,onListCodespaces:u,codespaces:f,codespaceError:p,codespaceListError:m,codespaceCreating:v,onCreateCodespace:g}){const{showToast:b}=Aa(),_=bt(),S=n==="edit",T=S&&a?i.find(ce=>ce.id===a):void 0,[C,w]=y.useState(""),[k,E]=y.useState("local"),[A,R]=y.useState(""),[N,z]=y.useState(""),[H,B]=y.useState(""),[K,W]=y.useState(""),[se,ne]=y.useState(""),[re,$]=y.useState(""),[ae,O]=y.useState(""),[G,Q]=y.useState(null),oe=y.useCallback(()=>{const ce={};if(k==="local"){if(A.trim()&&(ce.host=A.trim()),N.trim()){const me=Number(N);Number.isInteger(me)&&(ce.port=me)}}else if(k==="ssh"){if(ce.host=A.trim(),H.trim()&&(ce.user=H.trim()),N.trim()){const me=Number(N);Number.isInteger(me)&&(ce.sshPort=me)}K.trim()&&(ce.identityFile=K.trim())}else k==="docker"?(se.trim()&&(ce.image=se.trim()),re.trim()&&(ce.repo=re.trim())):k==="codespace"&&(ce.codespaceName=ae.trim());return ce},[k,A,N,H,K,se,re,ae]),le=()=>!(!C.trim()||k==="ssh"&&!A.trim()||k==="codespace"&&!ae.trim()||(k==="local"||k==="ssh")&&!vf(N)),De=()=>{le()&&(l(C.trim(),k,oe()),b("Environment added successfully","success"),_(Gi,{replace:!0}))},we=()=>{_(a?qi(a):Gi)},Se=y.useCallback((ce,me)=>{if(!T||!a)return;const fe=gf(T.adapterConfig),Ge=me.trim();Ge?fe[ce]=Ge:delete fe[ce],c(a,{adapterConfig:fe})},[T,a,c]),Oe=y.useCallback((ce,me)=>{if(!T||!a)return;const fe=gf(T.adapterConfig);if(me.trim()){const Ge=Number(me);Number.isInteger(Ge)&&Ge>=sc&&Ge<=ic&&(fe[ce]=Ge)}else delete fe[ce];c(a,{adapterConfig:fe})},[T,a,c]);if(S){if(!T)return r.jsxs("div",{className:ee.container,children:[r.jsxs("div",{className:ee.header,children:[r.jsx("div",{className:ee.headerTitle,children:r.jsx("span",{className:ee.badge,children:"edit environment"})}),r.jsx("div",{className:ee.headerActions,children:r.jsx("button",{onClick:we,className:ee.btnGhost,children:"Back"})})]}),r.jsx("div",{className:ee.body,children:r.jsx("div",{className:ee.formContent,children:r.jsx("span",{className:ee.readOnlyValue,children:"Environment not found"})})})]});const ce=gf(T.adapterConfig);return r.jsxs("div",{className:ee.container,"data-testid":"env-edit-panel",children:[r.jsxs("div",{className:ee.header,children:[r.jsx("div",{className:ee.headerTitle,children:r.jsx("span",{className:ee.badge,children:"edit environment"})}),r.jsx("div",{className:ee.headerActions,children:r.jsx("button",{onClick:we,className:ee.btnGhost,"data-testid":"env-edit-back",children:"Back"})})]}),r.jsx("div",{className:ee.body,children:r.jsxs("div",{className:ee.formContent,children:[r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,children:"Name"}),r.jsx($t,{value:T.displayName,onSave:me=>{a&&c(a,{displayName:me})},validate:me=>me.trim()===""?"Name cannot be empty":void 0,mode:"edit",fieldId:"name",activeFieldId:G,onActivate:Q,placeholder:"Environment name",ariaLabel:"Environment name","data-testid":"env-edit-name"})]}),r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,children:"Adapter Type"}),r.jsx("span",{className:ee.readOnlyValue,"data-testid":"env-edit-adapter-type",children:T.adapterType})]}),T.adapterType==="local"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,children:"Host"}),r.jsx($t,{value:String(ce.host??""),onSave:me=>Se("host",me),mode:"edit",fieldId:"host",activeFieldId:G,onActivate:Q,placeholder:"(default)",ariaLabel:"Host","data-testid":"env-edit-host"})]}),r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,children:"Port"}),r.jsx($t,{value:String(ce.port??""),onSave:me=>Oe("port",me),validate:me=>vf(me)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"port",activeFieldId:G,onActivate:Q,placeholder:"(default)",ariaLabel:"Port","data-testid":"env-edit-port"})]})]}),T.adapterType==="ssh"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,children:"Host"}),r.jsx($t,{value:String(ce.host??""),onSave:me=>Se("host",me),validate:me=>me.trim()===""?"Host is required":void 0,mode:"edit",fieldId:"host",activeFieldId:G,onActivate:Q,placeholder:"hostname or IP",ariaLabel:"Host","data-testid":"env-edit-host"})]}),r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,children:"User"}),r.jsx($t,{value:String(ce.user??""),onSave:me=>Se("user",me),mode:"edit",fieldId:"user",activeFieldId:G,onActivate:Q,placeholder:"(default)",ariaLabel:"User","data-testid":"env-edit-user"})]}),r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,children:"SSH Port"}),r.jsx($t,{value:String(ce.sshPort??""),onSave:me=>Oe("sshPort",me),validate:me=>vf(me)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"sshPort",activeFieldId:G,onActivate:Q,placeholder:"22",ariaLabel:"SSH Port","data-testid":"env-edit-ssh-port"})]}),r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,children:"Identity File"}),r.jsx($t,{value:String(ce.identityFile??""),onSave:me=>Se("identityFile",me),mode:"edit",fieldId:"identityFile",activeFieldId:G,onActivate:Q,placeholder:"~/.ssh/id_rsa",ariaLabel:"Identity File","data-testid":"env-edit-identity-file"})]})]}),T.adapterType==="docker"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,children:"Image"}),r.jsx($t,{value:String(ce.image??""),onSave:me=>Se("image",me),mode:"edit",fieldId:"image",activeFieldId:G,onActivate:Q,placeholder:"(default)",ariaLabel:"Image","data-testid":"env-edit-image"})]}),r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,children:"Repo"}),r.jsx($t,{value:String(ce.repo??""),onSave:me=>Se("repo",me),mode:"edit",fieldId:"repo",activeFieldId:G,onActivate:Q,placeholder:"(none)",ariaLabel:"Repo","data-testid":"env-edit-repo"})]})]}),T.adapterType==="codespace"&&r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,children:"Codespace Name"}),r.jsx($t,{value:String(ce.codespaceName??""),onSave:me=>Se("codespaceName",me),validate:me=>me.trim()===""?"Codespace name is required":void 0,mode:"edit",fieldId:"codespaceName",activeFieldId:G,onActivate:Q,placeholder:"codespace-name",ariaLabel:"Codespace Name","data-testid":"env-edit-codespace-name"})]})]})})]})}return r.jsxs("div",{className:ee.container,"data-testid":"env-create-panel",children:[r.jsxs("div",{className:ee.header,children:[r.jsx("div",{className:ee.headerTitle,children:r.jsx("span",{className:ee.badge,children:"new environment"})}),r.jsxs("div",{className:ee.headerActions,children:[r.jsx("button",{onClick:De,disabled:!le(),className:ee.btnPrimary,"data-testid":"env-create-submit",children:"Create"}),r.jsx("button",{onClick:we,className:ee.btnGhost,children:"Cancel"})]})]}),r.jsx("div",{className:ee.body,children:r.jsxs("div",{className:ee.formContent,children:[r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,htmlFor:"env-create-name",children:"Name"}),r.jsx("input",{id:"env-create-name",type:"text",value:C,onChange:ce=>w(ce.target.value),placeholder:"Environment name...",autoFocus:!0,className:ee.nameInput,"data-testid":"env-create-name",onKeyDown:ce=>{ce.key==="Enter"&&le()&&De()}})]}),r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,htmlFor:"env-create-adapter",children:"Adapter Type"}),r.jsxs("select",{id:"env-create-adapter",value:k,onChange:ce=>{E(ce.target.value),ce.target.value==="codespace"&&u()},className:ee.adapterSelect,"data-testid":"env-create-adapter",children:[r.jsx("option",{value:"local",children:"local"}),r.jsx("option",{value:"ssh",children:"ssh"}),r.jsx("option",{value:"docker",children:"docker"}),r.jsx("option",{value:"codespace",children:"codespace"})]})]}),k==="local"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,htmlFor:"env-create-host",children:"Host"}),r.jsx("input",{id:"env-create-host",type:"text",value:A,onChange:ce=>R(ce.target.value),placeholder:"Host (optional)...",className:ee.fieldInput,"data-testid":"env-create-host"})]}),r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,htmlFor:"env-create-port",children:"Port"}),r.jsx("input",{id:"env-create-port",type:"number",min:sc,max:ic,value:N,onChange:ce=>z(ce.target.value),placeholder:"Port (optional)...",className:ee.fieldInput,"data-testid":"env-create-port"})]})]}),k==="ssh"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,htmlFor:"env-create-host",children:"Host"}),r.jsx("input",{id:"env-create-host",type:"text",value:A,onChange:ce=>R(ce.target.value),placeholder:"Host (required)...",className:ee.fieldInput,"data-testid":"env-create-host"})]}),r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,htmlFor:"env-create-user",children:"User"}),r.jsx("input",{id:"env-create-user",type:"text",value:H,onChange:ce=>B(ce.target.value),placeholder:"User (optional)...",className:ee.fieldInput,"data-testid":"env-create-user"})]}),r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,htmlFor:"env-create-port",children:"SSH Port"}),r.jsx("input",{id:"env-create-port",type:"number",min:sc,max:ic,value:N,onChange:ce=>z(ce.target.value),placeholder:"SSH port (optional)...",className:ee.fieldInput,"data-testid":"env-create-port"})]}),r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,htmlFor:"env-create-identity",children:"Identity File"}),r.jsx("input",{id:"env-create-identity",type:"text",value:K,onChange:ce=>W(ce.target.value),placeholder:"Identity file (optional)...",className:ee.fieldInput,"data-testid":"env-create-identity"})]})]}),k==="docker"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,htmlFor:"env-create-image",children:"Image"}),r.jsx("input",{id:"env-create-image",type:"text",value:se,onChange:ce=>ne(ce.target.value),placeholder:"Image (optional)...",className:ee.fieldInput,"data-testid":"env-create-image"})]}),r.jsxs("div",{className:ee.section,children:[r.jsx("label",{className:ee.label,htmlFor:"env-create-repo",children:"Repo"}),r.jsx("input",{id:"env-create-repo",type:"text",value:re,onChange:ce=>$(ce.target.value),placeholder:"Repo (optional)...",className:ee.fieldInput,"data-testid":"env-create-repo"})]})]}),k==="codespace"&&r.jsx(A4,{codespaceName:ae,onCodespaceNameChange:O,envName:C,onEnvNameChange:w,codespaces:f,codespaceError:p,codespaceListError:m,codespaceCreating:v,onCreateCodespace:g})]})})]})}function D4(){const{environments:n,addEnvironment:a,updateEnvironment:i,listCodespaces:l,codespaces:c,codespaceError:u,codespaceListError:f,codespaceCreating:p,createCodespace:m}=ut();return r.jsx(bx,{mode:"new",environments:n,onAddEnvironment:a,onUpdateEnvironment:i,onListCodespaces:l,codespaces:c,codespaceError:u,codespaceListError:f,codespaceCreating:p,onCreateCodespace:m})}function R4(){const{environmentId:n}=us(),{environments:a,addEnvironment:i,updateEnvironment:l,listCodespaces:c,codespaces:u,codespaceError:f,codespaceListError:p,codespaceCreating:m,createCodespace:v}=ut();return r.jsx(bx,{mode:"edit",environmentId:n,environments:a,onAddEnvironment:i,onUpdateEnvironment:l,onListCodespaces:c,codespaces:u,codespaceError:f,codespaceListError:p,codespaceCreating:m,onCreateCodespace:v})}const M4="_layout_11u79_1",O4="_content_11u79_8",B4="_tabPanel_11u79_14",cl={layout:M4,content:O4,tabPanel:B4};function L4(){const n=R5();return r.jsxs("div",{className:cl.layout,children:[r.jsx(fs,{segments:n}),r.jsx("div",{className:cl.content,children:r.jsx($s,{})})]})}const I4="_container_13sb6_1",z4="_envHeader_13sb6_6",U4="_envTitleRow_13sb6_10",V4="_statusDot_13sb6_16",H4="_envName_13sb6_21",P4="_statusBadge_13sb6_27",G4="_envMeta_13sb6_33",q4="_metaTag_13sb6_39",$4="_actions_13sb6_51",K4="_provisionMessage_13sb6_59",Y4="_errorMessage_13sb6_64",F4="_section_13sb6_69",Z4="_sectionHeader_13sb6_73",X4="_cardList_13sb6_121",Q4="_card_13sb6_121",W4="_cardHeader_13sb6_138",J4="_cardName_13sb6_144",eL="_cardActions_13sb6_149",tL="_cardDescription_13sb6_154",nL="_cardMeta_13sb6_160",aL="_repoLink_13sb6_166",sL="_empty_13sb6_174",iL="_btnPrimary_13sb6_180",oL="_btnOutline_13sb6_214",lL="_btnSmall_13sb6_241",rL="_btnDanger_13sb6_267",He={container:I4,envHeader:z4,envTitleRow:U4,statusDot:V4,envName:H4,statusBadge:P4,envMeta:G4,metaTag:q4,actions:$4,provisionMessage:K4,errorMessage:Y4,section:F4,sectionHeader:Z4,cardList:X4,card:Q4,cardHeader:W4,cardName:J4,cardActions:eL,cardDescription:tL,cardMeta:nL,repoLink:aL,empty:sL,btnPrimary:iL,btnOutline:oL,btnSmall:lL,btnDanger:rL},cL={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function uL(){const{environmentId:n}=us(),a=bt(),{environments:i,workspaces:l,sessions:c,provisionStatus:u,provisionEnvironment:f,stopEnvironment:p,removeEnvironment:m,archiveWorkspace:v}=ut(),[g,b]=y.useState(!1),[_,S]=y.useState(!1),[T,C]=y.useState(void 0),w=i.find(ne=>ne.id===n);if(!n||!w)return r.jsx(Gn,{to:Gi,replace:!0});const k=l.filter(ne=>ne.environmentId===w.id),E=c.filter(ne=>ne.environmentId===w.id),A=E.reduce((ne,re)=>ne+(re.costUsd??0),0),R=cL[w.status]||"var(--text-tertiary)",N=w.status==="connected",z=w.status==="connecting",H=w.status==="disconnected"||w.status==="error",B=w.id in u?u[w.id]:void 0,K=()=>{m(w.id),b(!1),a(Gi,{replace:!0})},W=()=>{S(!1),f(w.id,!0)},se=ne=>{v(ne),C(void 0)};return r.jsxs("div",{className:He.container,children:[r.jsx(Ps,{isOpen:g,title:"Delete Environment?",description:`"${w.displayName||w.id}" will be permanently removed along with all its data.`,onConfirm:K,onCancel:()=>b(!1)}),r.jsx(Ps,{isOpen:_,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:W,onCancel:()=>S(!1)}),r.jsxs("div",{className:He.envHeader,children:[r.jsxs("div",{className:He.envTitleRow,children:[r.jsx("span",{className:He.statusDot,style:{color:R},children:"●"}),r.jsx("h2",{className:He.envName,children:w.displayName||w.id}),r.jsx("span",{className:He.statusBadge,style:{color:R},children:w.status})]}),r.jsxs("div",{className:He.envMeta,children:[r.jsxs("span",{className:He.metaTag,children:["Adapter: ",w.adapterType]}),E.length>0&&r.jsxs("span",{className:He.metaTag,children:[E.length," session",E.length!==1?"s":""]}),A>0&&r.jsxs("span",{className:He.metaTag,children:["Cost: ",Fi(A)]})]})]}),r.jsxs("div",{className:He.actions,children:[N&&r.jsxs(r.Fragment,{children:[r.jsx("button",{className:He.btnPrimary,onClick:()=>a(pb(w.id)),children:"New Chat"}),r.jsx("button",{className:He.btnOutline,onClick:()=>p(w.id),children:"Stop"}),r.jsx("button",{className:He.btnOutline,onClick:()=>S(!0),disabled:B!==void 0,"data-testid":"env-reprovision-btn",children:"Reprovision"})]}),H&&r.jsx("button",{className:He.btnPrimary,onClick:()=>f(w.id),children:w.status==="error"?"Retry":"Connect"}),z&&B!==void 0&&r.jsx("span",{className:He.provisionMessage,children:B.message}),w.status==="error"&&(B==null?void 0:B.stage)==="error"&&r.jsx("span",{className:He.errorMessage,children:B.message}),r.jsx("button",{className:He.btnOutline,onClick:()=>a(Qk(w.id)),"data-testid":"env-edit-btn",children:"Edit Config"}),r.jsx("button",{className:He.btnDanger,onClick:()=>b(!0),children:"Delete"})]}),r.jsxs("div",{className:He.section,children:[r.jsxs("div",{className:He.sectionHeader,children:[r.jsx("h3",{children:"Workspaces"}),r.jsx("button",{className:He.btnPrimary,onClick:()=>a(`${vb}?environment=${encodeURIComponent(w.id)}`),"data-testid":"workspace-create-button",children:"+ New Workspace"})]}),k.length===0&&r.jsx("p",{className:He.empty,children:"No workspaces yet. Create one to get started."}),r.jsx("div",{className:He.cardList,children:k.map(ne=>r.jsx(dL,{workspace:ne,confirmArchiveId:T,onOpen:()=>a(Pi(ne.id,w.id)),onArchive:()=>C(ne.id),onConfirmArchive:()=>se(ne.id),onCancelArchive:()=>C(void 0)},ne.id))})]})]})}function dL({workspace:n,confirmArchiveId:a,onOpen:i,onArchive:l,onConfirmArchive:c,onCancelArchive:u}){const f=a===n.id,p=n.repoUrl&&/^https?:\/\//.test(n.repoUrl);return r.jsxs("div",{className:He.card,"data-testid":"workspace-card",children:[r.jsxs("div",{className:He.cardHeader,children:[r.jsx("strong",{className:He.cardName,children:n.name}),r.jsxs("div",{className:He.cardActions,children:[r.jsx("button",{className:He.btnSmall,onClick:i,children:"Open"}),f?r.jsxs(r.Fragment,{children:[r.jsx("button",{className:He.btnDanger,onClick:c,children:"Confirm"}),r.jsx("button",{className:He.btnSmall,onClick:u,children:"Cancel"})]}):r.jsx("button",{className:He.btnSmall,onClick:l,children:"Archive"})]})]}),n.description&&r.jsx("p",{className:He.cardDescription,children:n.description}),n.repoUrl&&r.jsx("div",{className:He.cardMeta,children:p?r.jsx("a",{href:n.repoUrl,target:"_blank",rel:"noopener noreferrer",className:He.repoLink,children:n.repoUrl}):r.jsx("span",{children:n.repoUrl})})]})}const fL={credentials:"Credentials",personas:"Personas",appearance:"Appearance",about:"About",shortcuts:"Shortcuts"};function hL(){const a=Bt().pathname.replace(/^\/settings\/?/,"").split("/")[0],i=fL[a],l=D5(i);return r.jsxs("div",{className:cl.layout,children:[r.jsx(fs,{segments:l}),r.jsx("div",{className:cl.content,children:r.jsx("div",{className:cl.tabPanel,children:r.jsx($s,{})},a)})]})}const pL="_section_1ingb_14",mL="_sectionTitle_1ingb_26",vL="_sectionDescription_1ingb_35",gL="_tokenList_1ingb_48",yL="_tokenRow_1ingb_55",bL="_tokenBadge_1ingb_68",_L="_tokenName_1ingb_83",xL="_tokenTarget_1ingb_90",SL="_deleteButton_1ingb_99",TL="_addForm_1ingb_113",kL="_formRow_1ingb_119",jL="_input_1ingb_125",wL="_select_1ingb_155",CL="_addButton_1ingb_187",NL="_emptyStateInfo_1ingb_221",EL="_themeOptions_1ingb_229",AL="_themeOption_1ingb_229",DL="_themeOptionSelected_1ingb_254",RL="_themeOptionHeader_1ingb_259",ML="_themeOptionLabel_1ingb_266",OL="_themeOptionDesc_1ingb_273",BL="_variantToggle_1ingb_279",LL="_variantButton_1ingb_286",IL="_variantActive_1ingb_305",zL="_themeSwatches_1ingb_311",UL="_themeSwatch_1ingb_311",VL="_systemToggle_1ingb_325",HL="_systemToggleHint_1ingb_341",PL="_themeActive_1ingb_348",GL="_aboutGrid_1ingb_354",qL="_aboutItem_1ingb_360",$L="_aboutLabel_1ingb_373",KL="_aboutValue_1ingb_379",YL="_aboutDot_1ingb_387",FL="_aboutDotConnected_1ingb_394",ZL="_aboutDotDisconnected_1ingb_398",de={section:pL,sectionTitle:mL,sectionDescription:vL,tokenList:gL,tokenRow:yL,tokenBadge:bL,tokenName:_L,tokenTarget:xL,deleteButton:SL,addForm:TL,formRow:kL,input:jL,select:wL,addButton:CL,emptyStateInfo:NL,themeOptions:EL,themeOption:AL,themeOptionSelected:DL,themeOptionHeader:RL,themeOptionLabel:ML,themeOptionDesc:OL,variantToggle:BL,variantButton:LL,variantActive:IL,themeSwatches:zL,themeSwatch:UL,systemToggle:VL,systemToggleHint:HL,themeActive:PL,aboutGrid:GL,aboutItem:qL,aboutLabel:$L,aboutValue:KL,aboutDot:YL,aboutDotConnected:FL,aboutDotDisconnected:ZL},XL=[{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 QL({credentialProviders:n,onUpdateCredentialProviders:a}){const i=(l,c)=>{const u={...n};l==="claude"?u.claude=c:u[l]=c,a(u)};return r.jsxs("section",{className:de.section,children:[r.jsx("h3",{className:de.sectionTitle,children:"Credential Providers"}),r.jsx("p",{className:de.sectionDescription,children:"Enable providers to automatically forward credentials to environments at task start. Credentials are read fresh from the host each time."}),r.jsx("div",{className:de.tokenList,children:XL.map(l=>r.jsxs("div",{className:de.tokenRow,children:[r.jsx("span",{className:de.tokenName,children:l.label}),r.jsx("span",{className:de.tokenTarget,children:l.description}),r.jsx("select",{className:de.select,value:n[l.key],onChange:c=>i(l.key,c.target.value),children:l.options.map(c=>r.jsx("option",{value:c.value,children:c.label},c.value))})]},l.key))})]})}const WL=[{value:"env_var",label:"Environment Variable"},{value:"file",label:"File"}];function JL({tokens:n,onSetToken:a,onDeleteToken:i}){const{showToast:l}=Aa(),[c,u]=y.useState(""),[f,p]=y.useState(""),[m,v]=y.useState("env_var"),[g,b]=y.useState(""),[_,S]=y.useState(null),T=k=>{if(k.preventDefault(),!c||!f)return;const E=m==="env_var"?g||c.toUpperCase()+"_TOKEN":"";a(c,f,m,E,m==="file"?g:""),l("Token saved successfully","success"),u(""),p(""),b("")},C=k=>{S(k)},w=()=>{_&&(i(_),l("Token deleted","info")),S(null)};return r.jsxs(r.Fragment,{children:[r.jsx(Ps,{isOpen:_!==null,title:"Delete Token?",description:_?`"${_}" will be permanently removed.`:void 0,onConfirm:w,onCancel:()=>S(null)}),r.jsxs("section",{className:de.section,children:[r.jsx("h3",{className:de.sectionTitle,children:"Tokens"}),r.jsx("p",{className:de.sectionDescription,children:"API tokens are auto-pushed to environments when set or updated. Values are write-only."}),n.length===0?r.jsx("div",{className:de.emptyStateInfo,children:"Add your first API token to enable service integrations."}):r.jsx("div",{className:de.tokenList,children:n.map(k=>r.jsxs("div",{className:de.tokenRow,children:[r.jsx("span",{className:de.tokenBadge,children:k.tokenType}),r.jsx("span",{className:de.tokenName,children:k.name}),r.jsx("span",{className:de.tokenTarget,children:k.tokenType==="env_var"?k.envVar:k.filePath}),r.jsx("button",{className:de.deleteButton,onClick:()=>C(k.name),title:`Delete ${k.name}`,children:"×"})]},k.name))}),r.jsxs("form",{className:de.addForm,onSubmit:T,children:[r.jsxs("div",{className:de.formRow,children:[r.jsx("input",{className:de.input,type:"text",placeholder:"Token name",value:c,onChange:k=>u(k.target.value)}),r.jsx("input",{className:de.input,type:"password",placeholder:"Value",value:f,onChange:k=>p(k.target.value)})]}),r.jsxs("div",{className:de.formRow,children:[r.jsx("select",{className:de.select,value:m,onChange:k=>v(k.target.value),children:WL.map(k=>r.jsx("option",{value:k.value,children:k.label},k.value))}),r.jsx("input",{className:de.input,type:"text",placeholder:m==="env_var"?"Env var name (e.g. API_TOKEN)":"File path (e.g. /home/user/.token)",value:g,onChange:k=>b(k.target.value)}),r.jsx("button",{className:de.addButton,type:"submit",children:"Add Token"})]})]})]})]})}function eI(){const{tokens:n,setToken:a,deleteToken:i,credentialProviders:l,updateCredentialProviders:c}=ut();return r.jsxs(r.Fragment,{children:[r.jsx(QL,{credentialProviders:l,onUpdateCredentialProviders:c}),r.jsx(JL,{tokens:n,onSetToken:a,onDeleteToken:i})]})}const tI="_container_10efq_1",nI="_header_10efq_7",aI="_form_10efq_19",sI="_formActions_10efq_87",iI="_editableSection_10efq_94",oI="_list_10efq_105",lI="_card_10efq_111",rI="_cardHeader_10efq_125",cI="_cardTitle_10efq_135",uI="_defaultBadge_10efq_141",dI="_cardActions_10efq_155",fI="_description_10efq_160",hI="_meta_10efq_166",pI="_empty_10efq_212",mI="_typeToggle_10efq_348",vI="_typeBadge_10efq_362",gI="_scriptEditor_10efq_376",yI="_optional_10efq_383",pt={container:tI,header:nI,form:aI,formActions:sI,editableSection:iI,list:oI,card:lI,cardHeader:rI,cardTitle:cI,defaultBadge:uI,cardActions:dI,description:fI,meta:hI,empty:pI,typeToggle:mI,typeBadge:vI,scriptEditor:gI,optional:yI};function bI({personas:n,appDefaultPersonaId:a,onDeletePersona:i,onSetAppDefaultPersonaId:l,onNavigateToNew:c,onNavigateToPersona:u}){const[f,p]=y.useState(null),m=f?n.find(g=>g.id===f):void 0,v=async g=>{await i(g),p(null)};return r.jsxs("div",{className:pt.container,children:[r.jsxs("div",{className:pt.header,children:[r.jsx("h2",{children:"Personas"}),r.jsx(ka,{variant:"primary",size:"md",onClick:c,"data-testid":"persona-new-button",children:"+ New Persona"})]}),n.length===0?r.jsx("p",{className:pt.empty,children:"No personas yet. Create one to get started."}):r.jsx("div",{className:pt.list,children:n.map(g=>{const b=a===g.id,_=g.type==="script";return r.jsxs("div",{className:pt.card,"data-testid":`persona-card-${g.id}`,onClick:()=>u(g.id),role:"button",tabIndex:0,onKeyDown:S=>{S.currentTarget===S.target&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),u(g.id))},children:[r.jsxs("div",{className:pt.cardHeader,children:[r.jsxs("span",{className:pt.cardTitle,children:[r.jsx("strong",{children:g.name}),r.jsx("span",{className:pt.typeBadge,"data-testid":`persona-type-badge-${g.id}`,children:_?"Script":"Agent"}),b&&r.jsx("span",{className:pt.defaultBadge,"data-testid":`persona-default-badge-${g.id}`,children:"App Default"})]}),r.jsxs("div",{className:pt.cardActions,onClick:S=>S.stopPropagation(),children:[!b&&r.jsx(ka,{variant:"ghost",size:"sm",onClick:()=>{l(g.id).catch(()=>{})},"data-testid":`persona-set-default-${g.id}`,title:"Set as app default persona",children:"Set Default"}),r.jsx(ka,{variant:"ghost",size:"sm",onClick:()=>u(g.id),children:"Edit"}),r.jsx(ka,{variant:"ghost",size:"sm",onClick:()=>p(g.id),"data-testid":`persona-delete-${g.id}`,children:"Delete"})]})]}),g.description&&r.jsx("p",{className:pt.description,children:g.description}),r.jsxs("div",{className:pt.meta,children:[g.runtime&&r.jsxs("span",{children:["Runtime: ",g.runtime]}),g.model&&r.jsxs("span",{children:["Model: ",g.model]}),g.maxTurns>0&&r.jsxs("span",{children:["Max turns: ",g.maxTurns]})]})]},g.id)})}),r.jsx(Ps,{isOpen:f!==null,title:"Delete Persona?",description:`"${(m==null?void 0:m.name)??""}" will be permanently removed.`,confirmLabel:"Delete",onConfirm:()=>{f&&v(f).catch(()=>{})},onCancel:()=>p(null)})]})}function _I(){const{personas:n,deletePersona:a,appDefaultPersonaId:i,setAppDefaultPersonaId:l}=ut(),{showToast:c}=Aa(),u=bt();return r.jsx(bI,{personas:n,appDefaultPersonaId:i,onDeletePersona:async f=>{try{await a(f)}catch(p){throw console.error("Failed to delete persona",{personaId:f,error:p}),c("Failed to delete persona","error"),p}},onSetAppDefaultPersonaId:async f=>{try{await l(f)}catch(p){console.error("Failed to set app default persona ID",{personaId:f,error:p}),c("Failed to set app default persona","error")}},onNavigateToNew:()=>u(Jk),onNavigateToPersona:f=>u(mb(f))})}const xI="_container_uy08i_1",SI="_header_uy08i_7",TI="_count_uy08i_13",kI="_presets_uy08i_18",jI="_presetButton_uy08i_24",wI="_filterInput_uy08i_41",CI="_groups_uy08i_53",NI="_group_uy08i_53",EI="_groupHeader_uy08i_68",AI="_groupName_uy08i_77",DI="_groupCount_uy08i_81",RI="_toolList_uy08i_87",MI="_toolItem_uy08i_95",OI="_toolName_uy08i_103",Wt={container:xI,header:SI,count:TI,presets:kI,presetButton:jI,filterInput:wI,groups:CI,group:NI,groupHeader:EI,groupName:AI,groupCount:DI,toolList:RI,toolItem:MI,toolName:OI},BI=(()=>{const n=new Map;for(const a of q0){const i=a==="get_version_status"?"version":a.split("_")[0];n.has(i)||n.set(i,[]),n.get(i).push(a)}return[...n.entries()].sort(([a],[i])=>a.localeCompare(i)).map(([a,i])=>({group:a,tools:i.sort()}))})(),LI=[{name:"default",label:"Default",tools:$0},{name:"worker",label:"Worker",tools:eT},{name:"orchestrator",label:"Orchestrator",tools:tT},{name:"admin",label:"Admin",tools:nT}];function z0({selectedTools:n,onChange:a,disabled:i}){const[l,c]=y.useState(""),u=y.useMemo(()=>new Set(n),[n]),f=y.useCallback(g=>{if(i)return;const b=new Set(u);b.has(g)?b.delete(g):b.add(g),a([...b].sort())},[u,a,i]),p=y.useCallback((g,b)=>{if(i)return;const _=new Set(u);for(const S of g)b?_.delete(S):_.add(S);a([..._].sort())},[u,a,i]),m=y.useCallback(g=>{i||a([...g].sort())},[a,i]),v=l.toLowerCase();return r.jsxs("div",{className:Wt.container,"data-testid":"mcp-tool-selector",children:[r.jsx("div",{className:Wt.header,children:r.jsx("span",{className:Wt.count,children:n.length===0?`Using default (${$0.length} tools)`:`${n.length} of ${q0.size} tools selected`})}),r.jsxs("div",{className:Wt.presets,"data-testid":"mcp-tool-presets",children:[LI.map(g=>r.jsx("button",{type:"button",className:Wt.presetButton,disabled:i,onClick:()=>m(g.tools),"data-testid":`preset-${g.name}`,children:g.label},g.name)),r.jsx("button",{type:"button",className:Wt.presetButton,disabled:i,onClick:()=>a([]),"data-testid":"preset-clear",children:"Clear"})]}),r.jsx("input",{type:"text",className:Wt.filterInput,placeholder:"Filter tools...",value:l,onChange:g=>c(g.target.value),disabled:i,"data-testid":"mcp-tool-filter"}),r.jsx("div",{className:Wt.groups,children:BI.map(({group:g,tools:b})=>{const _=v?b.filter(T=>T.toLowerCase().includes(v)):b;if(_.length===0)return null;const S=_.every(T=>u.has(T));return r.jsxs("div",{className:Wt.group,"data-testid":`tool-group-${g}`,children:[r.jsxs("label",{className:Wt.groupHeader,children:[r.jsx("input",{type:"checkbox",checked:S,onChange:()=>p(_,S),disabled:i,"data-testid":`group-toggle-${g}`}),r.jsx("span",{className:Wt.groupName,children:g}),r.jsxs("span",{className:Wt.groupCount,children:["(",_.filter(T=>u.has(T)).length,"/",_.length,")"]})]}),r.jsx("div",{className:Wt.toolList,children:_.map(T=>r.jsxs("label",{className:Wt.toolItem,children:[r.jsx("input",{type:"checkbox",checked:u.has(T),onChange:()=>f(T),disabled:i,"data-testid":`tool-${T}`}),r.jsx("span",{className:Wt.toolName,children:T})]},T))})]},g)})})]})}const U0=[{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)"}],V0=[{value:"genaiscript",label:"genaiscript"}],II="0";function H0(){const{personaId:n}=us(),a=bt(),{showToast:i}=Aa(),{personas:l,createPersona:c,updatePersona:u,deletePersona:f,appDefaultPersonaId:p,setAppDefaultPersonaId:m}=ut(),v=n===void 0,g=v?void 0:l.find(_=>_.id===n);if(!v&&l.length>0&&!g)return r.jsx(Gn,{to:Yd,replace:!0});const b=[{label:"Settings",url:Hi},{label:"Personas",url:Yd},{label:v?"New Persona":(g==null?void 0:g.name)??"Persona",url:void 0}];return r.jsxs("div",{className:pt.container,children:[r.jsx(fs,{segments:b}),r.jsx(zI,{existing:g,isNew:v,appDefaultPersonaId:p,onCreatePersona:c,onUpdatePersona:u,onDeletePersona:f,onSetAppDefaultPersonaId:m,onDone:()=>{a(Yd)},showToast:i})]})}function zI({existing:n,isNew:a,appDefaultPersonaId:i,onCreatePersona:l,onUpdatePersona:c,onDeletePersona:u,onSetAppDefaultPersonaId:f,onDone:p,showToast:m}){const v=bt(),[g,b]=y.useState((n==null?void 0:n.name)??""),[_,S]=y.useState((n==null?void 0:n.description)??""),[T,C]=y.useState((n==null?void 0:n.systemPrompt)??""),[w,k]=y.useState((n==null?void 0:n.runtime)??"claude-code"),[E,A]=y.useState((n==null?void 0:n.model)??"sonnet"),[R,N]=y.useState((n==null?void 0:n.maxTurns)??0),[z,H]=y.useState((n==null?void 0:n.type)==="script"?"script":"agent"),[B,K]=y.useState((n==null?void 0:n.script)??""),[W,se]=y.useState((n==null?void 0:n.allowedMcpTools)??[]),[ne,re]=y.useState(!1),[$,ae]=y.useState(null),[O,G]=y.useState(!!a);y.useEffect(()=>{if(!a&&n&&!O){G(!0),b(n.name),S(n.description),C(n.systemPrompt);const J=n.type==="script"?"script":"agent";k(J==="script"?n.runtime||"genaiscript":n.runtime),A(n.model),N(n.maxTurns),H(J),K(n.script||""),se(n.allowedMcpTools)}},[a,n,O]);const Q=J=>{H(J),J==="script"?k("genaiscript"):w==="genaiscript"&&k("claude-code")},oe=!a&&n===void 0,le=g.trim().length>0&&!oe&&T.trim().length>0&&(z==="script"?B.trim().length>0:!!w&&!!E),De=a&&le,we=!a&&i===(n==null?void 0:n.id),Se=!a&&n&&!we&&z==="agent"&&!!w&&!!E,Oe=(J,Ce)=>{if(!J.trim())return`${Ce} is required`},ce=J=>{if(J.preventDefault(),!(oe||!le)){if(n){c(n.id,g,_,T,w,E,R,z,B).then(()=>{m("Persona updated","success"),p()},()=>{m("Failed to save persona","error")});return}l(g,_,T,w,E,R,z,B,W).then(Ce=>{m("Persona created","success"),v(mb(Ce.id),{replace:!0})},()=>{m("Failed to save persona","error")})}},me=()=>{n&&u(n.id).then(()=>{m("Persona deleted","success"),p()},()=>{m("Failed to delete persona","error")})},fe=async(J,Ce,rn,Ue)=>J().then(()=>{Ce(),m(rn,"success")},()=>{m(Ue,"error")}),Ge=(J,Ce)=>{if(!n)return;const rn=J==="type"?String(Ce):z,Ue=J==="runtime"?String(Ce):J==="type"?String(Ce)==="script"?"genaiscript":w==="genaiscript"?"claude-code":w:w,qn=J==="model"?String(Ce):E,$n=J==="maxTurns"?Number(Ce):R,In=J==="systemPrompt"?String(Ce):T,Kn=J==="script"?String(Ce):B;fe(()=>c(n.id,J==="name"?String(Ce):g,J==="description"?String(Ce):_,In,Ue,qn,$n,rn,Kn),()=>{if(J==="type"){const xn=String(Ce)==="script"?"script":"agent";H(xn),k(Ue)}J==="runtime"&&k(String(Ce)),J==="name"&&b(String(Ce)),J==="description"&&S(String(Ce)),J==="systemPrompt"&&C(String(Ce)),J==="model"&&A(String(Ce)),J==="maxTurns"&&N(Number(Ce)),J==="script"&&K(String(Ce))},"Persona updated","Failed to update persona").catch(()=>{})},Kt=J=>{ce(J)},te=()=>{n&&f(n.id).then(()=>{m("Set as app default","success")},()=>{m("Failed to set app default","error")})};return r.jsxs(r.Fragment,{children:[oe?r.jsxs("div",{className:pt.form,children:[r.jsx("h3",{children:"Edit Persona"}),r.jsx("p",{children:"Loading persona..."})]}):a?r.jsxs("form",{onSubmit:Kt,className:pt.form,children:[r.jsx("h3",{children:"Create Persona"}),r.jsxs("div",{className:pt.typeToggle,"data-testid":"persona-type-toggle",children:[r.jsxs("label",{children:[r.jsx("input",{type:"radio",name:"personaType",value:"agent",checked:z==="agent",onChange:()=>Q("agent")}),"Agent"]}),r.jsxs("label",{children:[r.jsx("input",{type:"radio",name:"personaType",value:"script",checked:z==="script",onChange:()=>Q("script")}),"Script"]})]}),r.jsxs("label",{children:["Name",r.jsx("input",{type:"text",value:g,onChange:J=>b(J.target.value),placeholder:z==="script"?"e.g. Nightly Report":"e.g. Frontend Engineer",required:!0,"data-testid":"persona-detail-name"})]}),r.jsxs("label",{children:["Description",r.jsx("input",{type:"text",value:_,onChange:J=>S(J.target.value),placeholder:"Brief description...","data-testid":"persona-detail-description"})]}),r.jsxs("label",{children:["Runtime",r.jsx("select",{value:w,onChange:J=>k(J.target.value),"data-testid":"persona-runtime-select",children:(z==="script"?V0:U0).map(J=>r.jsx("option",{value:J.value,children:J.label},J.value))})]}),z==="agent"&&r.jsxs(r.Fragment,{children:[r.jsxs("label",{children:["Model",r.jsx("input",{type:"text",value:E,onChange:J=>A(J.target.value),placeholder:"e.g. sonnet","data-testid":"persona-detail-model"})]}),r.jsxs("label",{children:["Max Turns",r.jsx("input",{type:"number",value:R,onChange:J=>N(parseInt(J.target.value,10)||0),min:0,"data-testid":"persona-detail-max-turns"})]}),r.jsxs("label",{children:["System Prompt",r.jsx("textarea",{value:T,onChange:J=>C(J.target.value),placeholder:"You are a senior frontend engineer...",rows:10,required:!0,"data-testid":"persona-detail-prompt"})]})]}),z==="script"&&r.jsxs(r.Fragment,{children:[r.jsxs("label",{children:["Model ",r.jsx("span",{className:pt.optional,children:"(optional)"}),r.jsx("input",{type:"text",value:E,onChange:J=>A(J.target.value),placeholder:"e.g. sonnet (leave empty for script-only)","data-testid":"persona-detail-model"})]}),r.jsxs("label",{children:["System Prompt",r.jsx("textarea",{value:T,onChange:J=>C(J.target.value),placeholder:"Context for the script...",rows:4,required:!0,"data-testid":"persona-detail-prompt"})]}),r.jsxs("label",{children:["Script",r.jsx("textarea",{value:B,onChange:J=>K(J.target.value),placeholder:`script({ model: "openai:gpt-4o" });
106
+
107
+ const grackle = await host.mcpServer({
108
+ id: "grackle",
109
+ url: env.vars.GRACKLE_MCP_URL,
110
+ });
111
+
112
+ $\`Summarize the current tasks.\`;`,rows:20,className:pt.scriptEditor,required:!0,"data-testid":"persona-script-editor"})]})]}),z==="agent"&&r.jsxs("div",{children:[r.jsx("label",{children:"Allowed MCP Tools"}),r.jsx(z0,{selectedTools:W,onChange:se})]}),r.jsxs("div",{className:pt.formActions,children:[r.jsx(ka,{type:"submit",variant:"primary",size:"md",disabled:!De,"data-testid":"persona-detail-save",children:"Create"}),r.jsx(ka,{type:"button",variant:"outline",size:"md",onClick:p,"data-testid":"persona-detail-cancel",children:"Cancel"})]})]}):n?r.jsxs("div",{className:pt.form,children:[r.jsx("h3",{children:"Edit Persona"}),r.jsxs("div",{className:pt.formActions,children:[r.jsx(ka,{type:"button",variant:"outline",size:"md",onClick:p,"data-testid":"persona-detail-cancel",children:"Back to Personas"}),Se&&r.jsx(ka,{type:"button",variant:"ghost",size:"md",onClick:te,"data-testid":"persona-detail-set-default",children:"Set as App Default"}),we&&r.jsx("span",{className:pt.defaultBadge,children:"App Default"}),r.jsx(ka,{type:"button",variant:"danger",size:"md",onClick:()=>re(!0),"data-testid":"persona-detail-delete",children:"Delete"})]}),r.jsxs("div",{className:pt.editableSection,children:[r.jsxs("label",{children:["Name",r.jsx($t,{value:g,onSave:J=>{Ge("name",J)},validate:J=>Oe(J,"Name"),fieldId:"persona-name",activeFieldId:$,onActivate:ae,ariaLabel:"Persona name","data-testid":"persona-detail-name"})]}),r.jsxs("label",{children:["Description",r.jsx($t,{value:_,onSave:J=>{Ge("description",J)},fieldId:"persona-description",activeFieldId:$,onActivate:ae,placeholder:"Brief description...",ariaLabel:"Persona description","data-testid":"persona-detail-description"})]}),r.jsxs("label",{children:["Type",r.jsx(vc,{value:z,onSave:J=>{Ge("type",J)},options:[{value:"agent",label:"Agent"},{value:"script",label:"Script"}],fieldId:"persona-type",activeFieldId:$,onActivate:ae,ariaLabel:"Persona type","data-testid":"persona-type-toggle"})]}),r.jsxs("label",{children:["Runtime",r.jsx(vc,{value:w,onSave:J=>{Ge("runtime",J)},options:z==="script"?V0:U0,fieldId:"persona-runtime",activeFieldId:$,onActivate:ae,ariaLabel:"Persona runtime","data-testid":"persona-runtime"})]}),r.jsxs("label",{children:["Model",z==="script"?" (optional)":"",r.jsx($t,{value:E,onSave:J=>{Ge("model",J)},validate:z==="agent"?J=>Oe(J,"Model"):void 0,fieldId:"persona-model",activeFieldId:$,onActivate:ae,placeholder:z==="script"?"e.g. sonnet (leave empty for script-only)":"e.g. sonnet",ariaLabel:"Persona model","data-testid":"persona-detail-model"})]}),r.jsxs("label",{children:["Max Turns",r.jsx($t,{value:String(R),onSave:J=>{Ge("maxTurns",parseInt(J,10)||0)},validate:J=>/^\d+$/.test(J.trim())?void 0:"Max Turns must be a non-negative integer",fieldId:"persona-max-turns",activeFieldId:$,onActivate:ae,placeholder:II,ariaLabel:"Persona max turns","data-testid":"persona-detail-max-turns"})]}),r.jsxs("label",{children:["System Prompt",r.jsx(qf,{value:T,onSave:J=>{Ge("systemPrompt",J)},validate:J=>Oe(J,"System Prompt"),fieldId:"persona-system-prompt",activeFieldId:$,onActivate:ae,placeholder:z==="script"?"Context for the script...":"You are a senior frontend engineer...",ariaLabel:"Persona system prompt","data-testid":"persona-detail-prompt"})]}),z==="script"&&r.jsxs("label",{children:["Script",r.jsx(qf,{value:B,onSave:J=>{Ge("script",J)},validate:J=>Oe(J,"Script"),fieldId:"persona-script",activeFieldId:$,onActivate:ae,placeholder:`script({ model: "openai:gpt-4o" });
113
+
114
+ const grackle = await host.mcpServer({
115
+ id: "grackle",
116
+ url: env.vars.GRACKLE_MCP_URL,
117
+ });
118
+
119
+ $\`Summarize the current tasks.\`;`,ariaLabel:"Persona script","data-testid":"persona-script-editor"})]}),z==="agent"&&r.jsxs("div",{children:[r.jsx("label",{children:"Allowed MCP Tools"}),r.jsx(z0,{selectedTools:W,onChange:J=>{se(J);const Ce=J.length===0?["__clear__"]:J;fe(()=>c(n.id,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,Ce),()=>{},"MCP tools updated","Failed to update MCP tools").catch(()=>{})}})]})]}),!Se&&!we&&r.jsx("p",{style:{fontSize:"var(--font-size-xs)",color:"var(--text-tertiary)",marginTop:"var(--space-xs)"},children:"Only agent personas with a runtime and model can be set as app default."})]}):null,r.jsx(Ps,{isOpen:ne,title:"Delete Persona?",description:`"${n==null?void 0:n.name}" will be permanently removed.`,confirmLabel:"Delete",onConfirm:me,onCancel:()=>re(!1)})]})}function UI(){const{themeId:n,resolvedThemeId:a,setTheme:i,preferSystem:l,setPreferSystem:c}=kb();return r.jsxs("section",{className:de.section,children:[r.jsx("h3",{className:de.sectionTitle,children:"Appearance"}),r.jsx("p",{className:de.sectionDescription,children:"Choose how Grackle looks across the app."}),r.jsx("div",{className:de.themeOptions,children:xc.filter(u=>!u.hidden).map(u=>{const f=!!(u.variantLightId&&u.variantDarkId),p=f?n===u.id||n===u.variantLightId||n===u.variantDarkId:n===u.id,m=f&&a===u.variantLightId;return r.jsxs("button",{type:"button",className:`${de.themeOption} ${p?de.themeOptionSelected:""}`,"aria-pressed":p,onClick:()=>i(u.id),children:[r.jsxs("span",{className:de.themeOptionHeader,children:[r.jsxs("span",{children:[r.jsx("span",{className:de.themeOptionLabel,children:u.label}),r.jsx("span",{className:de.themeOptionDesc,children:u.description})]}),f&&r.jsxs("span",{className:de.variantToggle,children:[r.jsx("span",{role:"button",tabIndex:0,className:`${de.variantButton} ${p&&m?de.variantActive:""}`,onClick:v=>{v.stopPropagation(),c(!1),i(u.variantLightId)},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),v.stopPropagation(),c(!1),i(u.variantLightId))},"aria-label":"Light variant","aria-pressed":p&&m,children:"☼"}),r.jsx("span",{role:"button",tabIndex:0,className:`${de.variantButton} ${p&&!m?de.variantActive:""}`,onClick:v=>{v.stopPropagation(),c(!1),i(u.variantDarkId)},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),v.stopPropagation(),c(!1),i(u.variantDarkId))},"aria-label":"Dark variant","aria-pressed":p&&!m,children:"☾"})]})]}),u.swatches&&r.jsx("span",{className:de.themeSwatches,children:u.swatches.map((v,g)=>r.jsx("span",{className:de.themeSwatch,style:{background:v}},g))})]},u.id)})}),r.jsxs("label",{className:de.systemToggle,children:[r.jsx("input",{type:"checkbox",checked:l,onChange:u=>c(u.target.checked)}),r.jsx("span",{children:"Match system light/dark preference"})]}),r.jsx("p",{className:de.systemToggleHint,children:"Automatically switches between light and dark variants when available."}),r.jsxs("p",{className:de.themeActive,children:["Active theme: ",r.jsx("strong",{children:a})]})]})}function VI(){return r.jsx(UI,{})}function HI({connected:n,environments:a,sessions:i}){const l=a.filter(f=>f.status==="connected").length,c=a.length,u=i.filter(f=>["running","idle"].includes(f.status)).length;return r.jsxs("section",{className:de.section,"data-testid":"about-panel",children:[r.jsx("h3",{className:de.sectionTitle,children:"About"}),r.jsx("p",{className:de.sectionDescription,children:"Connection status and application information."}),r.jsxs("div",{className:de.aboutGrid,children:[r.jsxs("div",{className:de.aboutItem,children:[r.jsx("span",{className:de.aboutLabel,children:"Connection"}),r.jsxs("span",{className:de.aboutValue,children:[r.jsx("span",{className:`${de.aboutDot} ${n?de.aboutDotConnected:de.aboutDotDisconnected}`}),n?"Connected":"Disconnected"]})]}),r.jsxs("div",{className:de.aboutItem,children:[r.jsx("span",{className:de.aboutLabel,children:"Environments"}),r.jsxs("span",{className:de.aboutValue,children:[l,"/",c," connected"]})]}),r.jsxs("div",{className:de.aboutItem,children:[r.jsx("span",{className:de.aboutLabel,children:"Active Sessions"}),r.jsx("span",{className:de.aboutValue,children:u})]}),r.jsxs("div",{className:de.aboutItem,children:[r.jsx("span",{className:de.aboutLabel,children:"Version"}),r.jsx("span",{className:de.aboutValue,children:"0.81.0"})]})]})]})}function PI({currentVersion:n,latestVersion:a,updateAvailable:i,isDocker:l}){if(!i)return r.jsx(r.Fragment,{});const c=l?"docker pull ghcr.io/nick-pape/grackle:latest && docker restart grackle":`npm install -g @grackle-ai/cli@${a}`;return r.jsx("div",{"data-testid":"update-banner",children:r.jsxs(MD,{variant:"info",dismissible:!0,children:[r.jsxs("strong",{children:["Grackle v",a]})," is available (you have v",n,")."," ","Run: ",r.jsx("code",{children:c})]})})}function GI(){const[n,a]=y.useState(void 0);return y.useEffect(()=>{let i=!1;return Te.getVersionStatus({}).then(l=>{i||a({currentVersion:l.currentVersion,latestVersion:l.latestVersion,updateAvailable:l.updateAvailable,isDocker:l.isDocker})},()=>{}),()=>{i=!0}},[]),n}function qI(){const{connected:n,environments:a,sessions:i}=ut(),l=GI();return r.jsxs(r.Fragment,{children:[l&&r.jsx(PI,{currentVersion:l.currentVersion,latestVersion:l.latestVersion,updateAvailable:l.updateAvailable,isDocker:l.isDocker}),r.jsx(HI,{connected:n,environments:a,sessions:i})]})}const $I="_group_1iprv_1",KI="_groupTitle_1iprv_8",YI="_shortcutList_1iprv_17",FI="_shortcutRow_1iprv_23",ZI="_keys_1iprv_36",XI="_kbd_1iprv_43",QI="_description_1iprv_60",Os={group:$I,groupTitle:KI,shortcutList:YI,shortcutRow:FI,keys:ZI,kbd:XI,description:QI},WI=[{title:"Global",shortcuts:[{keys:["?"],description:"Open keyboard shortcuts reference"},{keys:["N"],description:"Create a new task"},{keys:["Escape"],description:"Close dialog or cancel editing"}]},{title:"Task Page",shortcuts:[{keys:["1"],description:"Switch to Overview tab"},{keys:["2"],description:"Switch to Stream tab"},{keys:["3"],description:"Switch to Findings tab"}]},{title:"Workspace Page",shortcuts:[{keys:["1"],description:"Switch to Graph view"},{keys:["2"],description:"Switch to Board view"},{keys:["3"],description:"Switch to Tasks view"}]},{title:"Navigation Lists",shortcuts:[{keys:["←"],description:"Previous tab (horizontal nav)"},{keys:["→"],description:"Next tab (horizontal nav)"},{keys:["↑"],description:"Previous item (vertical nav)"},{keys:["↓"],description:"Next item (vertical nav)"},{keys:["J"],description:"Next item (alias for arrow down/right)"},{keys:["K"],description:"Previous item (alias for arrow up/left)"},{keys:["Home"],description:"Jump to first item"},{keys:["End"],description:"Jump to last item"}]},{title:"Editing",shortcuts:[{keys:["Enter"],description:"Activate / save inline edit"},{keys:["Space"],description:"Activate button or start editing"},{keys:["Escape"],description:"Cancel edit and discard changes"}]},{title:"Chat",shortcuts:[{keys:["Enter"],description:"Send message (when input is focused)"}]}];function JI(){return r.jsxs("section",{className:de.section,"data-testid":"keyboard-shortcuts-panel",children:[r.jsx("h3",{className:de.sectionTitle,children:"Keyboard Shortcuts"}),r.jsx("p",{className:de.sectionDescription,children:"Keyboard shortcuts for navigating and interacting with Grackle. Global shortcuts are suppressed while typing in text fields."}),WI.map(n=>r.jsxs("div",{className:Os.group,children:[r.jsx("h4",{className:Os.groupTitle,children:n.title}),r.jsx("div",{className:Os.shortcutList,children:n.shortcuts.map(a=>r.jsxs("div",{className:Os.shortcutRow,children:[r.jsx("span",{className:Os.keys,children:a.keys.map(i=>r.jsx("kbd",{className:Os.kbd,children:i},i))}),r.jsx("span",{className:Os.description,children:a.description})]},a.description))})]},n.title))]})}function e8(){return r.jsx(JI,{})}const P0=Ks();function t8(){const n=bt();return Ca({key:"?"},()=>{n(ej)}),Ca({key:"n"},()=>{n(P0)}),Ca({key:"N"},()=>{n(P0)}),r.jsx(r.Fragment,{})}const n8="_wizard_1260s_1",a8="_container_1260s_10",s8="_stepContent_1260s_19",i8="_logoArea_1260s_28",o8="_logoImage_1260s_32",l8="_heading_1260s_41",r8="_tagline_1260s_49",c8="_subtitle_1260s_56",u8="_featureList_1260s_64",d8="_runtimeGrid_1260s_89",f8="_runtimeCard_1260s_101",h8="_runtimeName_1260s_133",p8="_runtimeDescription_1260s_139",m8="_buttonRow_1260s_144",v8="_primaryButton_1260s_151",g8="_ghostButton_1260s_185",y8="_dots_1260s_213",b8="_dot_1260s_213",st={wizard:n8,container:a8,stepContent:s8,logoArea:i8,logoImage:o8,heading:l8,tagline:r8,subtitle:c8,featureList:u8,runtimeGrid:d8,runtimeCard:f8,runtimeName:h8,runtimeDescription:p8,buttonRow:m8,primaryButton:v8,ghostButton:g8,dots:y8,dot:b8};function _8({onNext:n}){return r.jsxs("div",{className:st.stepContent,"data-testid":"setup-welcome",children:[r.jsx("div",{className:st.logoArea,children:r.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:st.logoImage})}),r.jsx("h1",{className:st.heading,children:"Welcome to Grackle"}),r.jsx("p",{className:st.tagline,children:"Multi-agent orchestration for software teams"}),r.jsx("button",{type:"button",className:st.primaryButton,onClick:n,"data-testid":"setup-get-started",children:"Get Started"})]})}function x8({onNext:n,onBack:a}){return r.jsxs("div",{className:st.stepContent,"data-testid":"setup-about",children:[r.jsx("h2",{className:st.heading,children:"What is Grackle?"}),r.jsxs("ul",{className:st.featureList,children:[r.jsx("li",{children:"Run Claude, Copilot, and Codex agents side by side"}),r.jsx("li",{children:"Provision and control dev environments — SSH, Codespaces, or local"}),r.jsx("li",{children:"Organize work into workspaces with agent-executable tasks"}),r.jsx("li",{children:"Customize agent behavior with personas, tools, and MCP servers"}),r.jsx("li",{children:"Live-stream agent sessions with full terminal replay"})]}),r.jsxs("div",{className:st.buttonRow,children:[r.jsx("button",{type:"button",className:st.ghostButton,onClick:a,children:"Back"}),r.jsx("button",{type:"button",className:st.primaryButton,onClick:n,"data-testid":"setup-about-next",children:"Next"})]})]})}const S8=[{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 T8({currentRuntime:n,onFinish:a,onBack:i,finishDisabled:l}){const[c,u]=y.useState(n||"claude-code");return y.useEffect(()=>{n&&u(n)},[n]),r.jsxs("div",{className:st.stepContent,"data-testid":"setup-runtime",children:[r.jsx("h2",{className:st.heading,children:"Choose Your Runtime"}),r.jsx("p",{className:st.subtitle,children:"Select the primary agent runtime for your workspace. You can change this later."}),r.jsx("div",{className:st.runtimeGrid,children:S8.map(f=>r.jsxs("button",{type:"button",className:st.runtimeCard,"data-selected":c===f.id,"aria-pressed":c===f.id,"data-testid":`runtime-card-${f.id}`,onClick:()=>u(f.id),children:[r.jsx("span",{className:st.runtimeName,children:f.name}),r.jsx("span",{className:st.runtimeDescription,children:f.description})]},f.id))}),r.jsxs("div",{className:st.buttonRow,children:[r.jsx("button",{type:"button",className:st.ghostButton,onClick:i,children:"Back"}),r.jsx("button",{type:"button",className:st.primaryButton,onClick:()=>a(c),disabled:l,"data-testid":"setup-finish",children:"Finish"})]})]})}const k8=3,G0={"claude-code":"sonnet",copilot:"gpt-4o",codex:"o3",goose:""};function j8(){const{personas:n,updatePersona:a,completeOnboarding:i,onboardingCompleted:l}=ut(),c=bt(),[u,f]=y.useState(0),p=n.find(v=>v.id==="claude-code"),m=y.useCallback(v=>{if(p&&v!==p.runtime){const b=G0[v]??"sonnet";a(p.id,void 0,void 0,void 0,v,b).catch(()=>{})}const g=n.find(b=>b.id===Pg);if(g&&v!==g.runtime){const b=G0[v]??"sonnet";a(Pg,void 0,void 0,void 0,v,b).catch(()=>{})}i(),c("/",{replace:!0})},[p,n,a,i,c]);return l===!0?r.jsx(Gn,{to:"/",replace:!0}):r.jsx("div",{className:st.wizard,"data-testid":"setup-wizard",children:r.jsxs("div",{className:st.container,children:[r.jsx(na,{mode:"wait",children:r.jsxs(Et.div,{initial:{opacity:0,x:40},animate:{opacity:1,x:0},exit:{opacity:0,x:-40},transition:{duration:.2,ease:"easeInOut"},children:[u===0&&r.jsx(_8,{onNext:()=>f(1)}),u===1&&r.jsx(x8,{onNext:()=>f(2),onBack:()=>f(0)}),u===2&&r.jsx(T8,{currentRuntime:(p==null?void 0:p.runtime)??"claude-code",onFinish:m,onBack:()=>f(1),finishDisabled:!p})]},u)}),r.jsx("div",{className:st.dots,children:Array.from({length:k8},(v,g)=>r.jsx("span",{className:st.dot,"data-active":g===u},g))})]})})}const w8="_root_zndgp_1",C8="_body_zndgp_7",N8="_main_zndgp_19",E8="_sidebarWrapper_zndgp_26",A8="_overlay_zndgp_51",al={root:w8,body:C8,main:N8,sidebarWrapper:E8,overlay:A8},D8=y.lazy(()=>uT(()=>import("./KnowledgePage-M1FUjnXJ.js"),__vite__mapDeps([0,1,2,3,4])).then(n=>({default:n.KnowledgePage}))),_x=typeof window<"u"&&new URLSearchParams(window.location.search).has("mock");function R8(){const{connected:n,environments:a,sessions:i,tasks:l}=ut(),c=Bt(),f=Cb()!==void 0,[p,m]=y.useState(!1),v=y.useCallback(()=>m(g=>!g),[]);return y.useEffect(()=>{m(!1)},[c.pathname]),y.useEffect(()=>{if(!p)return;const g=b=>{b.key==="Escape"&&m(!1)};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[p]),r.jsxs(r.Fragment,{children:[r.jsx(Jj,{connected:n,environments:a,sessions:i,onToggleSidebar:f?v:void 0,sidebarOpen:p}),r.jsx(ow,{}),r.jsxs("div",{className:al.body,children:[f&&r.jsx("div",{className:al.sidebarWrapper,"data-sidebar-open":p,children:r.jsx(pw,{})}),f&&p&&r.jsx("div",{className:al.overlay,"data-testid":"drawer-overlay",onClick:()=>m(!1)}),r.jsxs("div",{className:al.main,children:[r.jsx($s,{}),r.jsx(uD,{sessions:i,tasks:l,environments:a})]})]}),r.jsx(TD,{}),r.jsx(t8,{})]})}function M8(){const{lastSpawnedId:n,environments:a,tasks:i,connected:l,onboardingCompleted:c}=ut(),{showToast:u}=Aa();SM(a,u),wM(i,u);const f=bt(),p=Bt();return y.useEffect(()=>{n&&!p.pathname.includes("/tasks/")&&f(hb(n),{replace:!0})},[n,f,p.pathname]),l&&c===!1?r.jsx(Gn,{to:"/setup",replace:!0}):r.jsx(lw,{children:r.jsxs("div",{className:al.root,children:[_x&&r.jsx(JD,{}),r.jsx(R8,{})]})})}function yf(){const{workspaceId:n}=us(),{workspaces:a}=ut(),i=Bt(),l=a.find(m=>m.id===n);if(!(l!=null&&l.environmentId))return a.length===0?void 0:r.jsx(Gn,{to:"/environments",replace:!0});const c=encodeURIComponent(n),u=`/workspaces/${c}`,f=i.pathname.startsWith(u)?i.pathname.slice(u.length):"",p=`/environments/${encodeURIComponent(l.environmentId)}/workspaces/${c}${f}${i.search}${i.hash}`;return r.jsx(Gn,{to:p,replace:!0})}function O8(){return r.jsxs(mk,{children:[r.jsx(ke,{path:"setup",element:r.jsx(j8,{})}),r.jsxs(ke,{element:r.jsx(M8,{}),children:[r.jsx(ke,{index:!0,element:r.jsx(JO,{})}),r.jsx(ke,{path:"chat",element:r.jsx(E5,{})}),r.jsx(ke,{path:"sessions/new",element:r.jsx(I5,{})}),r.jsx(ke,{path:"sessions/:sessionId",element:r.jsx(V5,{})}),r.jsx(ke,{element:r.jsx(nD,{}),children:r.jsx(ke,{path:"knowledge",element:r.jsx(y.Suspense,{fallback:r.jsx(hx,{}),children:r.jsx(D8,{})})})}),r.jsxs(ke,{element:r.jsx(JA,{}),children:[r.jsx(ke,{path:"tasks",element:r.jsx(QO,{})}),r.jsx(ke,{path:"tasks/new",element:r.jsx(B0,{})}),r.jsx(ke,{path:"tasks/:taskId",element:r.jsx(is,{})}),r.jsx(ke,{path:"tasks/:taskId/edit",element:r.jsx(is,{})}),r.jsx(ke,{path:"tasks/:taskId/stream",element:r.jsx(is,{})}),r.jsx(ke,{path:"tasks/:taskId/findings",element:r.jsx(is,{})})]}),r.jsxs(ke,{element:r.jsx(eD,{}),children:[r.jsx(ke,{path:"workspaces",element:r.jsx(Gn,{to:"/environments",replace:!0})}),r.jsx(ke,{path:"workspaces/new",element:r.jsx(PB,{})}),r.jsx(ke,{path:"workspaces/:workspaceId",element:r.jsx(yf,{})}),r.jsx(ke,{path:"workspaces/:workspaceId/tasks/:taskId",element:r.jsx(yf,{})}),r.jsx(ke,{path:"workspaces/:workspaceId/tasks/:taskId/*",element:r.jsx(yf,{})}),r.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId",element:r.jsx(oB,{})}),r.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/new",element:r.jsx(B0,{})}),r.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId",element:r.jsx(is,{})}),r.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit",element:r.jsx(is,{})}),r.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream",element:r.jsx(is,{})}),r.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings",element:r.jsx(is,{})}),r.jsxs(ke,{path:"environments",element:r.jsx(L4,{}),children:[r.jsx(ke,{index:!0,element:r.jsx(WO,{})}),r.jsx(ke,{path:"new",element:r.jsx(D4,{})}),r.jsx(ke,{path:":environmentId",element:r.jsx(uL,{})}),r.jsx(ke,{path:":environmentId/edit",element:r.jsx(R4,{})})]})]}),r.jsx(ke,{element:r.jsx(tD,{}),children:r.jsxs(ke,{path:"settings",element:r.jsx(hL,{}),children:[r.jsx(ke,{index:!0,element:r.jsx(Gn,{to:"credentials",replace:!0})}),r.jsx(ke,{path:"environments",element:r.jsx(Gn,{to:"/environments",replace:!0})}),r.jsx(ke,{path:"credentials",element:r.jsx(eI,{})}),r.jsx(ke,{path:"tokens",element:r.jsx(Gn,{to:"../credentials",replace:!0})}),r.jsx(ke,{path:"personas",element:r.jsx(_I,{})}),r.jsx(ke,{path:"personas/new",element:r.jsx(H0,{})}),r.jsx(ke,{path:"personas/:personaId",element:r.jsx(H0,{})}),r.jsx(ke,{path:"appearance",element:r.jsx(VI,{})}),r.jsx(ke,{path:"shortcuts",element:r.jsx(e8,{})}),r.jsx(ke,{path:"about",element:r.jsx(qI,{})})]})}),r.jsx(ke,{path:"*",element:r.jsx(Gn,{to:"/",replace:!0})})]})]})}const B8=1e4;function L8(){const{onboardingCompleted:n}=ut(),[a,i]=y.useState(!1);y.useEffect(()=>{if(n!==void 0)return;const c=setTimeout(()=>i(!0),B8);return()=>clearTimeout(c)},[n]);const l=n===void 0&&!a;return r.jsx(na,{mode:"wait",children:l?r.jsx(Et.div,{initial:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:r.jsx(hx,{})},"splash"):r.jsx(Et.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.25},style:{minHeight:"100vh"},children:r.jsx(Vk,{basename:"/".replace(/\/$/,""),children:r.jsx(O8,{})})},"app")})}function I8(){const n=_x?Ij:Nj;return r.jsx(Gj,{children:r.jsx(Uj,{children:r.jsx(n,{children:r.jsx(L8,{})})})})}lT.createRoot(document.getElementById("root")).render(r.jsx(y.StrictMode,{children:r.jsx(I8,{})}));export{fs as B,gb as K,ut as a,hb as s,ta as t,bt as u};