@grackle-ai/web 0.52.4 → 0.53.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import{r as R1,a as b,j as c,v as B1,b as O1,t as Ir,i as I1,f as L1,M as qf,c as Yf}from"./markdown-gcy1Jmzi.js";import{r as z1,d as Vv,H as Hv,P as Gv,i as U1,B as V1,a as H1,C as G1,M as P1}from"./dagview-EHk2VaeR.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))l(r);new MutationObserver(r=>{for(const d of r)if(d.type==="childList")for(const u of d.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&l(u)}).observe(document,{childList:!0,subtree:!0});function i(r){const d={};return r.integrity&&(d.integrity=r.integrity),r.referrerPolicy&&(d.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?d.credentials="include":r.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function l(r){if(r.ep)return;r.ep=!0;const d=i(r);fetch(r.href,d)}})();var Ld={exports:{}},qo={},zd={exports:{}},Ud={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* scheduler.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Pv;function $1(){return Pv||(Pv=1,(function(n){function a(H,M){var J=H.length;H.push(M);e:for(;0<J;){var le=J-1>>>1,Y=H[le];if(0<r(Y,M))H[le]=M,H[J]=Y,J=le;else break e}}function i(H){return H.length===0?null:H[0]}function l(H){if(H.length===0)return null;var M=H[0],J=H.pop();if(J!==M){H[0]=J;e:for(var le=0,Y=H.length,pe=Y>>>1;le<pe;){var De=2*(le+1)-1,se=H[De],je=De+1,pt=H[je];if(0>r(se,J))je<Y&&0>r(pt,se)?(H[le]=pt,H[je]=J,le=je):(H[le]=se,H[De]=J,le=De);else if(je<Y&&0>r(pt,J))H[le]=pt,H[je]=J,le=je;else break e}}return M}function r(H,M){var J=H.sortIndex-M.sortIndex;return J!==0?J:H.id-M.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var u=Date,p=u.now();n.unstable_now=function(){return u.now()-p}}var m=[],g=[],y=1,v=null,x=3,S=!1,C=!1,w=!1,E=!1,k=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function V(H){for(var M=i(g);M!==null;){if(M.callback===null)l(g);else if(M.startTime<=H)l(g),M.sortIndex=M.expirationTime,a(m,M);else break;M=i(g)}}function I(H){if(w=!1,V(H),!C)if(i(m)!==null)C=!0,F||(F=!0,te());else{var M=i(g);M!==null&&ie(I,M.startTime-H)}}var F=!1,R=-1,B=5,G=-1;function ee(){return E?!0:!(n.unstable_now()-G<B)}function ae(){if(E=!1,F){var H=n.unstable_now();G=H;var M=!0;try{e:{C=!1,w&&(w=!1,A(R),R=-1),S=!0;var J=x;try{t:{for(V(H),v=i(m);v!==null&&!(v.expirationTime>H&&ee());){var le=v.callback;if(typeof le=="function"){v.callback=null,x=v.priorityLevel;var Y=le(v.expirationTime<=H);if(H=n.unstable_now(),typeof Y=="function"){v.callback=Y,V(H),M=!0;break t}v===i(m)&&l(m),V(H)}else l(m);v=i(m)}if(v!==null)M=!0;else{var pe=i(g);pe!==null&&ie(I,pe.startTime-H),M=!1}}break e}finally{v=null,x=J,S=!1}M=void 0}}finally{M?te():F=!1}}}var te;if(typeof j=="function")te=function(){j(ae)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,Q=fe.port2;fe.port1.onmessage=ae,te=function(){Q.postMessage(null)}}else te=function(){k(ae,0)};function ie(H,M){R=k(function(){H(n.unstable_now())},M)}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(H){H.callback=null},n.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<H?Math.floor(1e3/H):5},n.unstable_getCurrentPriorityLevel=function(){return x},n.unstable_next=function(H){switch(x){case 1:case 2:case 3:var M=3;break;default:M=x}var J=x;x=M;try{return H()}finally{x=J}},n.unstable_requestPaint=function(){E=!0},n.unstable_runWithPriority=function(H,M){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var J=x;x=H;try{return M()}finally{x=J}},n.unstable_scheduleCallback=function(H,M,J){var le=n.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?le+J:le):J=le,H){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=J+Y,H={id:y++,callback:M,priorityLevel:H,startTime:J,expirationTime:Y,sortIndex:-1},J>le?(H.sortIndex=J,a(g,H),i(m)===null&&H===i(g)&&(w?(A(R),R=-1):w=!0,ie(I,J-le))):(H.sortIndex=Y,a(m,H),C||S||(C=!0,F||(F=!0,te()))),H},n.unstable_shouldYield=ee,n.unstable_wrapCallback=function(H){var M=x;return function(){var J=x;x=M;try{return H.apply(this,arguments)}finally{x=J}}}})(Ud)),Ud}var $v;function F1(){return $v||($v=1,zd.exports=$1()),zd.exports}/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-dom-client.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Fv;function q1(){if(Fv)return qo;Fv=1;var n=F1(),a=R1(),i=z1();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 r(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function u(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(d(e)!==e)throw Error(l(188))}function g(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(l(188));return t!==e?null:e}for(var s=e,o=t;;){var f=s.return;if(f===null)break;var h=f.alternate;if(h===null){if(o=f.return,o!==null){s=o;continue}break}if(f.child===h.child){for(h=f.child;h;){if(h===s)return m(f),e;if(h===o)return m(f),t;h=h.sibling}throw Error(l(188))}if(s.return!==o.return)s=f,o=h;else{for(var _=!1,T=f.child;T;){if(T===s){_=!0,s=f,o=h;break}if(T===o){_=!0,o=f,s=h;break}T=T.sibling}if(!_){for(T=h.child;T;){if(T===s){_=!0,s=h,o=f;break}if(T===o){_=!0,o=h,s=f;break}T=T.sibling}if(!_)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 y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var v=Object.assign,x=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),j=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),ee=Symbol.for("react.memo_cache_sentinel"),ae=Symbol.iterator;function te(e){return e===null||typeof e!="object"?null:(e=ae&&e[ae]||e["@@iterator"],typeof e=="function"?e:null)}var fe=Symbol.for("react.client.reference");function Q(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===fe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case k:return"Profiler";case E:return"StrictMode";case I:return"Suspense";case F:return"SuspenseList";case G:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case j:return e.displayName||"Context";case A:return(e._context.displayName||"Context")+".Consumer";case V:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case R:return t=e.displayName||null,t!==null?t:Q(e.type)||"Memo";case B:t=e._payload,e=e._init;try{return Q(e(t))}catch{}}return null}var ie=Array.isArray,H=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J={pending:!1,data:null,method:null,action:null},le=[],Y=-1;function pe(e){return{current:e}}function De(e){0>Y||(e.current=le[Y],le[Y]=null,Y--)}function se(e,t){Y++,le[Y]=e.current,e.current=t}var je=pe(null),pt=pe(null),Ct=pe(null),un=pe(null);function Jt(e,t){switch(se(Ct,t),se(pt,e),se(je,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?cv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=cv(t),e=uv(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}De(je),se(je,e)}function W(){De(je),De(pt),De(Ct)}function Ce(e){e.memoizedState!==null&&se(un,e);var t=je.current,s=uv(t,e.type);t!==s&&(se(pt,e),se(je,s))}function me(e){pt.current===e&&(De(je),De(pt)),un.current===e&&(De(un),Go._currentValue=J)}var Oe,wt;function Et(e){if(Oe===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);Oe=t&&t[1]||"",wt=-1<s.stack.indexOf(`
|
|
18
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
19
|
-
`+Oe+e+wt}var Pt=!1;function en(e,t){if(!e||Pt)return"";Pt=!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($){var P=$}Reflect.construct(e,[],X)}else{try{X.call()}catch($){P=$}e.call(X.prototype)}}else{try{throw Error()}catch($){P=$}(X=e())&&typeof X.catch=="function"&&X.catch(function(){})}}catch($){if($&&P&&typeof $.stack=="string")return[$.stack,P.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=o.DetermineComponentFrameRoot(),_=h[0],T=h[1];if(_&&T){var N=_.split(`
|
|
20
|
-
`),U=T.split(`
|
|
21
|
-
`);for(f=o=0;o<N.length&&!N[o].includes("DetermineComponentFrameRoot");)o++;for(;f<U.length&&!U[f].includes("DetermineComponentFrameRoot");)f++;if(o===N.length||f===U.length)for(o=N.length-1,f=U.length-1;1<=o&&0<=f&&N[o]!==U[f];)f--;for(;1<=o&&0<=f;o--,f--)if(N[o]!==U[f]){if(o!==1||f!==1)do if(o--,f--,0>f||N[o]!==U[f]){var q=`
|
|
22
|
-
`+N[o].replace(" at new "," at ");return e.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",e.displayName)),q}while(1<=o&&0<=f);break}}}finally{Pt=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?Et(s):""}function Me(e,t){switch(e.tag){case 26:case 27:case 5:return Et(e.type);case 16:return Et("Lazy");case 13:return e.child!==t&&t!==null?Et("Suspense Fallback"):Et("Suspense");case 19:return Et("SuspenseList");case 0:case 15:return en(e.type,!1);case 11:return en(e.type.render,!1);case 1:return en(e.type,!0);case 31:return Et("Activity");default:return""}}function Ve(e){try{var t="",s=null;do t+=Me(e,s),s=e,e=e.return;while(e);return t}catch(o){return`
|
|
23
|
-
Error generating stack: `+o.message+`
|
|
24
|
-
`+o.stack}}var an=Object.prototype.hasOwnProperty,Qn=n.unstable_scheduleCallback,dn=n.unstable_cancelCallback,ys=n.unstable_shouldYield,Z=n.unstable_requestPaint,ne=n.unstable_now,ue=n.unstable_getCurrentPriorityLevel,ke=n.unstable_ImmediatePriority,ye=n.unstable_UserBlockingPriority,He=n.unstable_NormalPriority,we=n.unstable_LowPriority,mt=n.unstable_IdlePriority,Qe=n.log,Lt=n.unstable_setDisableYieldValue,ct=null,Pe=null;function bt(e){if(typeof Qe=="function"&&Lt(e),Pe&&typeof Pe.setStrictMode=="function")try{Pe.setStrictMode(ct,e)}catch{}}var Ge=Math.clz32?Math.clz32:zt,za=Math.log,sn=Math.LN2;function zt(e){return e>>>=0,e===0?32:31-(za(e)/sn|0)|0}var Ut=256,Ua=262144,da=4194304;function Wn(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 ot(e,t,s){var o=e.pendingLanes;if(o===0)return 0;var f=0,h=e.suspendedLanes,_=e.pingedLanes;e=e.warmLanes;var T=o&134217727;return T!==0?(o=T&~h,o!==0?f=Wn(o):(_&=T,_!==0?f=Wn(_):s||(s=T&~e,s!==0&&(f=Wn(s))))):(T=o&~h,T!==0?f=Wn(T):_!==0?f=Wn(_):s||(s=o&~e,s!==0&&(f=Wn(s)))),f===0?0:t!==0&&t!==f&&(t&h)===0&&(h=f&-f,s=t&-t,h>=s||h===32&&(s&4194048)!==0)?t:f}function Te(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Vt(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 re(){var e=da;return da<<=1,(da&62914560)===0&&(da=4194304),e}function Ne(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function fn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function to(e,t,s,o,f,h){var _=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 T=e.entanglements,N=e.expirationTimes,U=e.hiddenUpdates;for(s=_&~s;0<s;){var q=31-Ge(s),X=1<<q;T[q]=0,N[q]=-1;var P=U[q];if(P!==null)for(U[q]=null,q=0;q<P.length;q++){var $=P[q];$!==null&&($.lane&=-536870913)}s&=~X}o!==0&&Fh(e,o,0),h!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=h&~(_&~t))}function Fh(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var o=31-Ge(t);e.entangledLanes|=t,e.entanglements[o]=e.entanglements[o]|1073741824|s&261930}function qh(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var o=31-Ge(s),f=1<<o;f&t|e[o]&t&&(e[o]|=t),s&=~f}}function Yh(e,t){var s=t&-t;return s=(s&42)!==0?1:wc(s),(s&(e.suspendedLanes|t))!==0?0:s}function wc(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ec(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Kh(){var e=M.p;return e!==0?e:(e=window.event,e===void 0?32:Rv(e.type))}function Zh(e,t){var s=M.p;try{return M.p=e,t()}finally{M.p=s}}var Va=Math.random().toString(36).slice(2),Yt="__reactFiber$"+Va,hn="__reactProps$"+Va,Zs="__reactContainer$"+Va,Ac="__reactEvents$"+Va,Sx="__reactListeners$"+Va,Tx="__reactHandles$"+Va,Xh="__reactResources$"+Va,no="__reactMarker$"+Va;function Nc(e){delete e[Yt],delete e[hn],delete e[Ac],delete e[Sx],delete e[Tx]}function Xs(e){var t=e[Yt];if(t)return t;for(var s=e.parentNode;s;){if(t=s[Zs]||s[Yt]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=vv(e);e!==null;){if(s=e[Yt])return s;e=vv(e)}return t}e=s,s=e.parentNode}return null}function Qs(e){if(e=e[Yt]||e[Zs]){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 Ws(e){var t=e[Xh];return t||(t=e[Xh]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function $t(e){e[no]=!0}var Qh=new Set,Wh={};function bs(e,t){Js(e,t),Js(e+"Capture",t)}function Js(e,t){for(Wh[e]=t,e=0;e<t.length;e++)Qh.add(t[e])}var kx=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]*$"),Jh={},ep={};function Cx(e){return an.call(ep,e)?!0:an.call(Jh,e)?!1:kx.test(e)?ep[e]=!0:(Jh[e]=!0,!1)}function kl(e,t,s){if(Cx(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 fa(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 Mn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function tp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function wx(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 f=o.get,h=o.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return f.call(this)},set:function(_){s=""+_,h.call(this,_)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return s},setValue:function(_){s=""+_},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function jc(e){if(!e._valueTracker){var t=tp(e)?"checked":"value";e._valueTracker=wx(e,t,""+e[t])}}function np(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),o="";return e&&(o=tp(e)?e.checked?"true":"false":e.value),e=o,e!==s?(t.setValue(e),!0):!1}function wl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Ex=/[\n"\\]/g;function Rn(e){return e.replace(Ex,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Dc(e,t,s,o,f,h,_,T){e.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.type=_:e.removeAttribute("type"),t!=null?_==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Mn(t)):e.value!==""+Mn(t)&&(e.value=""+Mn(t)):_!=="submit"&&_!=="reset"||e.removeAttribute("value"),t!=null?Mc(e,_,Mn(t)):s!=null?Mc(e,_,Mn(s)):o!=null&&e.removeAttribute("value"),f==null&&h!=null&&(e.defaultChecked=!!h),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?e.name=""+Mn(T):e.removeAttribute("name")}function ap(e,t,s,o,f,h,_,T){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)){jc(e);return}s=s!=null?""+Mn(s):"",t=t!=null?""+Mn(t):s,T||t===e.value||(e.value=t),e.defaultValue=t}o=o??f,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=T?e.checked:!!o,e.defaultChecked=!!o,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(e.name=_),jc(e)}function Mc(e,t,s){t==="number"&&wl(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function ei(e,t,s,o){if(e=e.options,t){t={};for(var f=0;f<s.length;f++)t["$"+s[f]]=!0;for(s=0;s<e.length;s++)f=t.hasOwnProperty("$"+e[s].value),e[s].selected!==f&&(e[s].selected=f),f&&o&&(e[s].defaultSelected=!0)}else{for(s=""+Mn(s),t=null,f=0;f<e.length;f++){if(e[f].value===s){e[f].selected=!0,o&&(e[f].defaultSelected=!0);return}t!==null||e[f].disabled||(t=e[f])}t!==null&&(t.selected=!0)}}function sp(e,t,s){if(t!=null&&(t=""+Mn(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+Mn(s):""}function ip(e,t,s,o){if(t==null){if(o!=null){if(s!=null)throw Error(l(92));if(ie(o)){if(1<o.length)throw Error(l(93));o=o[0]}s=o}s==null&&(s=""),t=s}s=Mn(t),e.defaultValue=s,o=e.textContent,o===s&&o!==""&&o!==null&&(e.value=o),jc(e)}function ti(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var Ax=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 op(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||Ax.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function lp(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 f in t)o=t[f],t.hasOwnProperty(f)&&s[f]!==o&&op(e,f,o)}else for(var h in t)t.hasOwnProperty(h)&&op(e,h,t[h])}function Rc(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 Nx=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"]]),jx=/^[\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 jx.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ha(){}var Bc=null;function Oc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ni=null,ai=null;function rp(e){var t=Qs(e);if(t&&(e=t.stateNode)){var s=e[hn]||null;e:switch(e=t.stateNode,t.type){case"input":if(Dc(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Rn(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var o=s[t];if(o!==e&&o.form===e.form){var f=o[hn]||null;if(!f)throw Error(l(90));Dc(o,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(t=0;t<s.length;t++)o=s[t],o.form===e.form&&np(o)}break e;case"textarea":sp(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&ei(e,!!s.multiple,t,!1)}}}var Ic=!1;function cp(e,t,s){if(Ic)return e(t,s);Ic=!0;try{var o=e(t);return o}finally{if(Ic=!1,(ni!==null||ai!==null)&&(pr(),ni&&(t=ni,e=ai,ai=ni=null,rp(t),e)))for(t=0;t<e.length;t++)rp(e[t])}}function so(e,t){var s=e.stateNode;if(s===null)return null;var o=s[hn]||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 pa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Lc=!1;if(pa)try{var io={};Object.defineProperty(io,"passive",{get:function(){Lc=!0}}),window.addEventListener("test",io,io),window.removeEventListener("test",io,io)}catch{Lc=!1}var Ha=null,zc=null,Al=null;function up(){if(Al)return Al;var e,t=zc,s=t.length,o,f="value"in Ha?Ha.value:Ha.textContent,h=f.length;for(e=0;e<s&&t[e]===f[e];e++);var _=s-e;for(o=1;o<=_&&t[s-o]===f[h-o];o++);return Al=f.slice(e,1<o?1-o:void 0)}function Nl(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 jl(){return!0}function dp(){return!1}function pn(e){function t(s,o,f,h,_){this._reactName=s,this._targetInst=f,this.type=o,this.nativeEvent=h,this.target=_,this.currentTarget=null;for(var T in e)e.hasOwnProperty(T)&&(s=e[T],this[T]=s?s(h):h[T]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?jl:dp,this.isPropagationStopped=dp,this}return v(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=jl)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=jl)},persist:function(){},isPersistent:jl}),t}var _s={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Dl=pn(_s),oo=v({},_s,{view:0,detail:0}),Dx=pn(oo),Uc,Vc,lo,Ml=v({},oo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gc,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"?(Uc=e.screenX-lo.screenX,Vc=e.screenY-lo.screenY):Vc=Uc=0,lo=e),Uc)},movementY:function(e){return"movementY"in e?e.movementY:Vc}}),fp=pn(Ml),Mx=v({},Ml,{dataTransfer:0}),Rx=pn(Mx),Bx=v({},oo,{relatedTarget:0}),Hc=pn(Bx),Ox=v({},_s,{animationName:0,elapsedTime:0,pseudoElement:0}),Ix=pn(Ox),Lx=v({},_s,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),zx=pn(Lx),Ux=v({},_s,{data:0}),hp=pn(Ux),Vx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Hx={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 Px(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Gx[e])?!!t[e]:!1}function Gc(){return Px}var $x=v({},oo,{key:function(e){if(e.key){var t=Vx[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Nl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Hx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gc,charCode:function(e){return e.type==="keypress"?Nl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Nl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Fx=pn($x),qx=v({},Ml,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),pp=pn(qx),Yx=v({},oo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gc}),Kx=pn(Yx),Zx=v({},_s,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xx=pn(Zx),Qx=v({},Ml,{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}),Wx=pn(Qx),Jx=v({},_s,{newState:0,oldState:0}),eS=pn(Jx),tS=[9,13,27,32],Pc=pa&&"CompositionEvent"in window,ro=null;pa&&"documentMode"in document&&(ro=document.documentMode);var nS=pa&&"TextEvent"in window&&!ro,mp=pa&&(!Pc||ro&&8<ro&&11>=ro),gp=" ",vp=!1;function yp(e,t){switch(e){case"keyup":return tS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var si=!1;function aS(e,t){switch(e){case"compositionend":return bp(t);case"keypress":return t.which!==32?null:(vp=!0,gp);case"textInput":return e=t.data,e===gp&&vp?null:e;default:return null}}function sS(e,t){if(si)return e==="compositionend"||!Pc&&yp(e,t)?(e=up(),Al=zc=Ha=null,si=!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 mp&&t.locale!=="ko"?null:t.data;default:return null}}var iS={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function _p(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!iS[e.type]:t==="textarea"}function xp(e,t,s,o){ni?ai?ai.push(o):ai=[o]:ni=o,t=xr(t,"onChange"),0<t.length&&(s=new Dl("onChange","change",null,s,o),e.push({event:s,listeners:t}))}var co=null,uo=null;function oS(e){av(e,0)}function Rl(e){var t=ao(e);if(np(t))return e}function Sp(e,t){if(e==="change")return t}var Tp=!1;if(pa){var $c;if(pa){var Fc="oninput"in document;if(!Fc){var kp=document.createElement("div");kp.setAttribute("oninput","return;"),Fc=typeof kp.oninput=="function"}$c=Fc}else $c=!1;Tp=$c&&(!document.documentMode||9<document.documentMode)}function Cp(){co&&(co.detachEvent("onpropertychange",wp),uo=co=null)}function wp(e){if(e.propertyName==="value"&&Rl(uo)){var t=[];xp(t,uo,e,Oc(e)),cp(oS,t)}}function lS(e,t,s){e==="focusin"?(Cp(),co=t,uo=s,co.attachEvent("onpropertychange",wp)):e==="focusout"&&Cp()}function rS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Rl(uo)}function cS(e,t){if(e==="click")return Rl(t)}function uS(e,t){if(e==="input"||e==="change")return Rl(t)}function dS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var xn=typeof Object.is=="function"?Object.is:dS;function fo(e,t){if(xn(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 f=s[o];if(!an.call(t,f)||!xn(e[f],t[f]))return!1}return!0}function Ep(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ap(e,t){var s=Ep(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=Ep(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 jp(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=wl(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=wl(e.document)}return t}function qc(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 fS=pa&&"documentMode"in document&&11>=document.documentMode,ii=null,Yc=null,ho=null,Kc=!1;function Dp(e,t,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Kc||ii==null||ii!==wl(o)||(o=ii,"selectionStart"in o&&qc(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=xr(Yc,"onSelect"),0<o.length&&(t=new Dl("onSelect","select",null,t,s),e.push({event:t,listeners:o}),t.target=ii)))}function xs(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var oi={animationend:xs("Animation","AnimationEnd"),animationiteration:xs("Animation","AnimationIteration"),animationstart:xs("Animation","AnimationStart"),transitionrun:xs("Transition","TransitionRun"),transitionstart:xs("Transition","TransitionStart"),transitioncancel:xs("Transition","TransitionCancel"),transitionend:xs("Transition","TransitionEnd")},Zc={},Mp={};pa&&(Mp=document.createElement("div").style,"AnimationEvent"in window||(delete oi.animationend.animation,delete oi.animationiteration.animation,delete oi.animationstart.animation),"TransitionEvent"in window||delete oi.transitionend.transition);function Ss(e){if(Zc[e])return Zc[e];if(!oi[e])return e;var t=oi[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in Mp)return Zc[e]=t[s];return e}var Rp=Ss("animationend"),Bp=Ss("animationiteration"),Op=Ss("animationstart"),hS=Ss("transitionrun"),pS=Ss("transitionstart"),mS=Ss("transitioncancel"),Ip=Ss("transitionend"),Lp=new Map,Xc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Xc.push("scrollEnd");function qn(e,t){Lp.set(e,t),bs(t,[e])}var Bl=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)},Bn=[],li=0,Qc=0;function Ol(){for(var e=li,t=Qc=li=0;t<e;){var s=Bn[t];Bn[t++]=null;var o=Bn[t];Bn[t++]=null;var f=Bn[t];Bn[t++]=null;var h=Bn[t];if(Bn[t++]=null,o!==null&&f!==null){var _=o.pending;_===null?f.next=f:(f.next=_.next,_.next=f),o.pending=f}h!==0&&zp(s,f,h)}}function Il(e,t,s,o){Bn[li++]=e,Bn[li++]=t,Bn[li++]=s,Bn[li++]=o,Qc|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function Wc(e,t,s,o){return Il(e,t,s,o),Ll(e)}function Ts(e,t){return Il(e,null,null,t),Ll(e)}function zp(e,t,s){e.lanes|=s;var o=e.alternate;o!==null&&(o.lanes|=s);for(var f=!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||(f=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,f&&t!==null&&(f=31-Ge(s),e=h.hiddenUpdates,o=e[f],o===null?e[f]=[t]:o.push(t),t.lane=s|536870912),h):null}function Ll(e){if(50<Oo)throw Oo=0,ld=null,Error(l(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ri={};function gS(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 Sn(e,t,s,o){return new gS(e,t,s,o)}function Jc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ma(e,t){var s=e.alternate;return s===null?(s=Sn(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 Up(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 zl(e,t,s,o,f,h){var _=0;if(o=e,typeof e=="function")Jc(e)&&(_=1);else if(typeof e=="string")_=x1(e,s,je.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case G:return e=Sn(31,s,t,f),e.elementType=G,e.lanes=h,e;case w:return ks(s.children,f,h,t);case E:_=8,f|=24;break;case k:return e=Sn(12,s,t,f|2),e.elementType=k,e.lanes=h,e;case I:return e=Sn(13,s,t,f),e.elementType=I,e.lanes=h,e;case F:return e=Sn(19,s,t,f),e.elementType=F,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case j:_=10;break e;case A:_=9;break e;case V:_=11;break e;case R:_=14;break e;case B:_=16,o=null;break e}_=29,s=Error(l(130,e===null?"null":typeof e,"")),o=null}return t=Sn(_,s,t,f),t.elementType=e,t.type=o,t.lanes=h,t}function ks(e,t,s,o){return e=Sn(7,e,o,t),e.lanes=s,e}function eu(e,t,s){return e=Sn(6,e,null,t),e.lanes=s,e}function Vp(e){var t=Sn(18,null,null,0);return t.stateNode=e,t}function tu(e,t,s){return t=Sn(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Hp=new WeakMap;function On(e,t){if(typeof e=="object"&&e!==null){var s=Hp.get(e);return s!==void 0?s:(t={value:e,source:t,stack:Ve(t)},Hp.set(e,t),t)}return{value:e,source:t,stack:Ve(t)}}var ci=[],ui=0,Ul=null,po=0,In=[],Ln=0,Ga=null,Jn=1,ea="";function ga(e,t){ci[ui++]=po,ci[ui++]=Ul,Ul=e,po=t}function Gp(e,t,s){In[Ln++]=Jn,In[Ln++]=ea,In[Ln++]=Ga,Ga=e;var o=Jn;e=ea;var f=32-Ge(o)-1;o&=~(1<<f),s+=1;var h=32-Ge(t)+f;if(30<h){var _=f-f%5;h=(o&(1<<_)-1).toString(32),o>>=_,f-=_,Jn=1<<32-Ge(t)+f|s<<f|o,ea=h+e}else Jn=1<<h|s<<f|o,ea=e}function nu(e){e.return!==null&&(ga(e,1),Gp(e,1,0))}function au(e){for(;e===Ul;)Ul=ci[--ui],ci[ui]=null,po=ci[--ui],ci[ui]=null;for(;e===Ga;)Ga=In[--Ln],In[Ln]=null,ea=In[--Ln],In[Ln]=null,Jn=In[--Ln],In[Ln]=null}function Pp(e,t){In[Ln++]=Jn,In[Ln++]=ea,In[Ln++]=Ga,Jn=t.id,ea=t.overflow,Ga=e}var Kt=null,ut=null,ze=!1,Pa=null,zn=!1,su=Error(l(519));function $a(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw mo(On(t,e)),su}function $p(e){var t=e.stateNode,s=e.type,o=e.memoizedProps;switch(t[Yt]=e,t[hn]=o,s){case"dialog":Be("cancel",t),Be("close",t);break;case"iframe":case"object":case"embed":Be("load",t);break;case"video":case"audio":for(s=0;s<Lo.length;s++)Be(Lo[s],t);break;case"source":Be("error",t);break;case"img":case"image":case"link":Be("error",t),Be("load",t);break;case"details":Be("toggle",t);break;case"input":Be("invalid",t),ap(t,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Be("invalid",t);break;case"textarea":Be("invalid",t),ip(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||lv(t.textContent,s)?(o.popover!=null&&(Be("beforetoggle",t),Be("toggle",t)),o.onScroll!=null&&Be("scroll",t),o.onScrollEnd!=null&&Be("scrollend",t),o.onClick!=null&&(t.onclick=ha),t=!0):t=!1,t||$a(e,!0)}function Fp(e){for(Kt=e.return;Kt;)switch(Kt.tag){case 5:case 31:case 13:zn=!1;return;case 27:case 3:zn=!0;return;default:Kt=Kt.return}}function di(e){if(e!==Kt)return!1;if(!ze)return Fp(e),ze=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||Sd(e.type,e.memoizedProps)),s=!s),s&&ut&&$a(e),Fp(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));ut=gv(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));ut=gv(e)}else t===27?(t=ut,ss(e.type)?(e=Ed,Ed=null,ut=e):ut=t):ut=Kt?Vn(e.stateNode.nextSibling):null;return!0}function Cs(){ut=Kt=null,ze=!1}function iu(){var e=Pa;return e!==null&&(yn===null?yn=e:yn.push.apply(yn,e),Pa=null),e}function mo(e){Pa===null?Pa=[e]:Pa.push(e)}var ou=pe(null),ws=null,va=null;function Fa(e,t,s){se(ou,t._currentValue),t._currentValue=s}function ya(e){e._currentValue=ou.current,De(ou)}function lu(e,t,s){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===s)break;e=e.return}}function ru(e,t,s,o){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var h=f.dependencies;if(h!==null){var _=f.child;h=h.firstContext;e:for(;h!==null;){var T=h;h=f;for(var N=0;N<t.length;N++)if(T.context===t[N]){h.lanes|=s,T=h.alternate,T!==null&&(T.lanes|=s),lu(h.return,s,e),o||(_=null);break e}h=T.next}}else if(f.tag===18){if(_=f.return,_===null)throw Error(l(341));_.lanes|=s,h=_.alternate,h!==null&&(h.lanes|=s),lu(_,s,e),_=null}else _=f.child;if(_!==null)_.return=f;else for(_=f;_!==null;){if(_===e){_=null;break}if(f=_.sibling,f!==null){f.return=_.return,_=f;break}_=_.return}f=_}}function fi(e,t,s,o){e=null;for(var f=t,h=!1;f!==null;){if(!h){if((f.flags&524288)!==0)h=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var _=f.alternate;if(_===null)throw Error(l(387));if(_=_.memoizedProps,_!==null){var T=f.type;xn(f.pendingProps.value,_.value)||(e!==null?e.push(T):e=[T])}}else if(f===un.current){if(_=f.alternate,_===null)throw Error(l(387));_.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(Go):e=[Go])}f=f.return}e!==null&&ru(t,e,s,o),t.flags|=262144}function Vl(e){for(e=e.firstContext;e!==null;){if(!xn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Es(e){ws=e,va=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Zt(e){return qp(ws,e)}function Hl(e,t){return ws===null&&Es(e),qp(e,t)}function qp(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},va===null){if(e===null)throw Error(l(308));va=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else va=va.next=t;return s}var vS=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()})}},yS=n.unstable_scheduleCallback,bS=n.unstable_NormalPriority,Mt={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function cu(){return{controller:new vS,data:new Map,refCount:0}}function go(e){e.refCount--,e.refCount===0&&yS(bS,function(){e.controller.abort()})}var vo=null,uu=0,hi=0,pi=null;function _S(e,t){if(vo===null){var s=vo=[];uu=0,hi=hd(),pi={status:"pending",value:void 0,then:function(o){s.push(o)}}}return uu++,t.then(Yp,Yp),t}function Yp(){if(--uu===0&&vo!==null){pi!==null&&(pi.status="fulfilled");var e=vo;vo=null,hi=0,pi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function xS(e,t){var s=[],o={status:"pending",value:null,reason:null,then:function(f){s.push(f)}};return e.then(function(){o.status="fulfilled",o.value=t;for(var f=0;f<s.length;f++)(0,s[f])(t)},function(f){for(o.status="rejected",o.reason=f,f=0;f<s.length;f++)(0,s[f])(void 0)}),o}var Kp=H.S;H.S=function(e,t){Dg=ne(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&_S(e,t),Kp!==null&&Kp(e,t)};var As=pe(null);function du(){var e=As.current;return e!==null?e:lt.pooledCache}function Gl(e,t){t===null?se(As,As.current):se(As,t.pool)}function Zp(){var e=du();return e===null?null:{parent:Mt._currentValue,pool:e}}var mi=Error(l(460)),fu=Error(l(474)),Pl=Error(l(542)),$l={then:function(){}};function Xp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Qp(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(ha,ha),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Jp(e),e;default:if(typeof t.status=="string")t.then(ha,ha);else{if(e=lt,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=t,e.status="pending",e.then(function(o){if(t.status==="pending"){var f=t;f.status="fulfilled",f.value=o}},function(o){if(t.status==="pending"){var f=t;f.status="rejected",f.reason=o}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Jp(e),e}throw js=t,mi}}function Ns(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(js=s,mi):s}}var js=null;function Wp(){if(js===null)throw Error(l(459));var e=js;return js=null,e}function Jp(e){if(e===mi||e===Pl)throw Error(l(483))}var gi=null,yo=0;function Fl(e){var t=yo;return yo+=1,gi===null&&(gi=[]),Qp(gi,e,t)}function bo(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ql(e,t){throw t.$$typeof===x?Error(l(525)):(e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function em(e){function t(O,D){if(e){var z=O.deletions;z===null?(O.deletions=[D],O.flags|=16):z.push(D)}}function s(O,D){if(!e)return null;for(;D!==null;)t(O,D),D=D.sibling;return null}function o(O){for(var D=new Map;O!==null;)O.key!==null?D.set(O.key,O):D.set(O.index,O),O=O.sibling;return D}function f(O,D){return O=ma(O,D),O.index=0,O.sibling=null,O}function h(O,D,z){return O.index=z,e?(z=O.alternate,z!==null?(z=z.index,z<D?(O.flags|=67108866,D):z):(O.flags|=67108866,D)):(O.flags|=1048576,D)}function _(O){return e&&O.alternate===null&&(O.flags|=67108866),O}function T(O,D,z,K){return D===null||D.tag!==6?(D=eu(z,O.mode,K),D.return=O,D):(D=f(D,z),D.return=O,D)}function N(O,D,z,K){var ge=z.type;return ge===w?q(O,D,z.props.children,K,z.key):D!==null&&(D.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===B&&Ns(ge)===D.type)?(D=f(D,z.props),bo(D,z),D.return=O,D):(D=zl(z.type,z.key,z.props,null,O.mode,K),bo(D,z),D.return=O,D)}function U(O,D,z,K){return D===null||D.tag!==4||D.stateNode.containerInfo!==z.containerInfo||D.stateNode.implementation!==z.implementation?(D=tu(z,O.mode,K),D.return=O,D):(D=f(D,z.children||[]),D.return=O,D)}function q(O,D,z,K,ge){return D===null||D.tag!==7?(D=ks(z,O.mode,K,ge),D.return=O,D):(D=f(D,z),D.return=O,D)}function X(O,D,z){if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return D=eu(""+D,O.mode,z),D.return=O,D;if(typeof D=="object"&&D!==null){switch(D.$$typeof){case S:return z=zl(D.type,D.key,D.props,null,O.mode,z),bo(z,D),z.return=O,z;case C:return D=tu(D,O.mode,z),D.return=O,D;case B:return D=Ns(D),X(O,D,z)}if(ie(D)||te(D))return D=ks(D,O.mode,z,null),D.return=O,D;if(typeof D.then=="function")return X(O,Fl(D),z);if(D.$$typeof===j)return X(O,Hl(O,D),z);ql(O,D)}return null}function P(O,D,z,K){var ge=D!==null?D.key:null;if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return ge!==null?null:T(O,D,""+z,K);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case S:return z.key===ge?N(O,D,z,K):null;case C:return z.key===ge?U(O,D,z,K):null;case B:return z=Ns(z),P(O,D,z,K)}if(ie(z)||te(z))return ge!==null?null:q(O,D,z,K,null);if(typeof z.then=="function")return P(O,D,Fl(z),K);if(z.$$typeof===j)return P(O,D,Hl(O,z),K);ql(O,z)}return null}function $(O,D,z,K,ge){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return O=O.get(z)||null,T(D,O,""+K,ge);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case S:return O=O.get(K.key===null?z:K.key)||null,N(D,O,K,ge);case C:return O=O.get(K.key===null?z:K.key)||null,U(D,O,K,ge);case B:return K=Ns(K),$(O,D,z,K,ge)}if(ie(K)||te(K))return O=O.get(z)||null,q(D,O,K,ge,null);if(typeof K.then=="function")return $(O,D,z,Fl(K),ge);if(K.$$typeof===j)return $(O,D,z,Hl(D,K),ge);ql(D,K)}return null}function ce(O,D,z,K){for(var ge=null,$e=null,he=D,Ae=D=0,Le=null;he!==null&&Ae<z.length;Ae++){he.index>Ae?(Le=he,he=null):Le=he.sibling;var Fe=P(O,he,z[Ae],K);if(Fe===null){he===null&&(he=Le);break}e&&he&&Fe.alternate===null&&t(O,he),D=h(Fe,D,Ae),$e===null?ge=Fe:$e.sibling=Fe,$e=Fe,he=Le}if(Ae===z.length)return s(O,he),ze&&ga(O,Ae),ge;if(he===null){for(;Ae<z.length;Ae++)he=X(O,z[Ae],K),he!==null&&(D=h(he,D,Ae),$e===null?ge=he:$e.sibling=he,$e=he);return ze&&ga(O,Ae),ge}for(he=o(he);Ae<z.length;Ae++)Le=$(he,O,Ae,z[Ae],K),Le!==null&&(e&&Le.alternate!==null&&he.delete(Le.key===null?Ae:Le.key),D=h(Le,D,Ae),$e===null?ge=Le:$e.sibling=Le,$e=Le);return e&&he.forEach(function(cs){return t(O,cs)}),ze&&ga(O,Ae),ge}function be(O,D,z,K){if(z==null)throw Error(l(151));for(var ge=null,$e=null,he=D,Ae=D=0,Le=null,Fe=z.next();he!==null&&!Fe.done;Ae++,Fe=z.next()){he.index>Ae?(Le=he,he=null):Le=he.sibling;var cs=P(O,he,Fe.value,K);if(cs===null){he===null&&(he=Le);break}e&&he&&cs.alternate===null&&t(O,he),D=h(cs,D,Ae),$e===null?ge=cs:$e.sibling=cs,$e=cs,he=Le}if(Fe.done)return s(O,he),ze&&ga(O,Ae),ge;if(he===null){for(;!Fe.done;Ae++,Fe=z.next())Fe=X(O,Fe.value,K),Fe!==null&&(D=h(Fe,D,Ae),$e===null?ge=Fe:$e.sibling=Fe,$e=Fe);return ze&&ga(O,Ae),ge}for(he=o(he);!Fe.done;Ae++,Fe=z.next())Fe=$(he,O,Ae,Fe.value,K),Fe!==null&&(e&&Fe.alternate!==null&&he.delete(Fe.key===null?Ae:Fe.key),D=h(Fe,D,Ae),$e===null?ge=Fe:$e.sibling=Fe,$e=Fe);return e&&he.forEach(function(M1){return t(O,M1)}),ze&&ga(O,Ae),ge}function it(O,D,z,K){if(typeof z=="object"&&z!==null&&z.type===w&&z.key===null&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case S:e:{for(var ge=z.key;D!==null;){if(D.key===ge){if(ge=z.type,ge===w){if(D.tag===7){s(O,D.sibling),K=f(D,z.props.children),K.return=O,O=K;break e}}else if(D.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===B&&Ns(ge)===D.type){s(O,D.sibling),K=f(D,z.props),bo(K,z),K.return=O,O=K;break e}s(O,D);break}else t(O,D);D=D.sibling}z.type===w?(K=ks(z.props.children,O.mode,K,z.key),K.return=O,O=K):(K=zl(z.type,z.key,z.props,null,O.mode,K),bo(K,z),K.return=O,O=K)}return _(O);case C:e:{for(ge=z.key;D!==null;){if(D.key===ge)if(D.tag===4&&D.stateNode.containerInfo===z.containerInfo&&D.stateNode.implementation===z.implementation){s(O,D.sibling),K=f(D,z.children||[]),K.return=O,O=K;break e}else{s(O,D);break}else t(O,D);D=D.sibling}K=tu(z,O.mode,K),K.return=O,O=K}return _(O);case B:return z=Ns(z),it(O,D,z,K)}if(ie(z))return ce(O,D,z,K);if(te(z)){if(ge=te(z),typeof ge!="function")throw Error(l(150));return z=ge.call(z),be(O,D,z,K)}if(typeof z.then=="function")return it(O,D,Fl(z),K);if(z.$$typeof===j)return it(O,D,Hl(O,z),K);ql(O,z)}return typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint"?(z=""+z,D!==null&&D.tag===6?(s(O,D.sibling),K=f(D,z),K.return=O,O=K):(s(O,D),K=eu(z,O.mode,K),K.return=O,O=K),_(O)):s(O,D)}return function(O,D,z,K){try{yo=0;var ge=it(O,D,z,K);return gi=null,ge}catch(he){if(he===mi||he===Pl)throw he;var $e=Sn(29,he,null,O.mode);return $e.lanes=K,$e.return=O,$e}finally{}}}var Ds=em(!0),tm=em(!1),qa=!1;function hu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function pu(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 Ya(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ka(e,t,s){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Ze&2)!==0){var f=o.pending;return f===null?t.next=t:(t.next=f.next,f.next=t),o.pending=t,t=Ll(e),zp(e,null,s),t}return Il(e,o,t,s),Ll(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,qh(e,s)}}function mu(e,t){var s=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,s===o)){var f=null,h=null;if(s=s.firstBaseUpdate,s!==null){do{var _={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};h===null?f=h=_:h=h.next=_,s=s.next}while(s!==null);h===null?f=h=t:h=h.next=t}else f=h=t;s={baseState:o.baseState,firstBaseUpdate:f,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 gu=!1;function xo(){if(gu){var e=pi;if(e!==null)throw e}}function So(e,t,s,o){gu=!1;var f=e.updateQueue;qa=!1;var h=f.firstBaseUpdate,_=f.lastBaseUpdate,T=f.shared.pending;if(T!==null){f.shared.pending=null;var N=T,U=N.next;N.next=null,_===null?h=U:_.next=U,_=N;var q=e.alternate;q!==null&&(q=q.updateQueue,T=q.lastBaseUpdate,T!==_&&(T===null?q.firstBaseUpdate=U:T.next=U,q.lastBaseUpdate=N))}if(h!==null){var X=f.baseState;_=0,q=U=N=null,T=h;do{var P=T.lane&-536870913,$=P!==T.lane;if($?(Ie&P)===P:(o&P)===P){P!==0&&P===hi&&(gu=!0),q!==null&&(q=q.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var ce=e,be=T;P=t;var it=s;switch(be.tag){case 1:if(ce=be.payload,typeof ce=="function"){X=ce.call(it,X,P);break e}X=ce;break e;case 3:ce.flags=ce.flags&-65537|128;case 0:if(ce=be.payload,P=typeof ce=="function"?ce.call(it,X,P):ce,P==null)break e;X=v({},X,P);break e;case 2:qa=!0}}P=T.callback,P!==null&&(e.flags|=64,$&&(e.flags|=8192),$=f.callbacks,$===null?f.callbacks=[P]:$.push(P))}else $={lane:P,tag:T.tag,payload:T.payload,callback:T.callback,next:null},q===null?(U=q=$,N=X):q=q.next=$,_|=P;if(T=T.next,T===null){if(T=f.shared.pending,T===null)break;$=T,T=$.next,$.next=null,f.lastBaseUpdate=$,f.shared.pending=null}}while(!0);q===null&&(N=X),f.baseState=N,f.firstBaseUpdate=U,f.lastBaseUpdate=q,h===null&&(f.shared.lanes=0),Ja|=_,e.lanes=_,e.memoizedState=X}}function nm(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function am(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)nm(s[e],t)}var vi=pe(null),Yl=pe(0);function sm(e,t){e=Ea,se(Yl,e),se(vi,t),Ea=e|t.baseLanes}function vu(){se(Yl,Ea),se(vi,vi.current)}function yu(){Ea=Yl.current,De(vi),De(Yl)}var Tn=pe(null),Un=null;function Za(e){var t=e.alternate;se(At,At.current&1),se(Tn,e),Un===null&&(t===null||vi.current!==null||t.memoizedState!==null)&&(Un=e)}function bu(e){se(At,At.current),se(Tn,e),Un===null&&(Un=e)}function im(e){e.tag===22?(se(At,At.current),se(Tn,e),Un===null&&(Un=e)):Xa()}function Xa(){se(At,At.current),se(Tn,Tn.current)}function kn(e){De(Tn),Un===e&&(Un=null),De(At)}var At=pe(0);function Kl(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Cd(s)||wd(s)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ba=0,Ee=null,at=null,Rt=null,Zl=!1,yi=!1,Ms=!1,Xl=0,To=0,bi=null,SS=0;function xt(){throw Error(l(321))}function _u(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!xn(e[s],t[s]))return!1;return!0}function xu(e,t,s,o,f,h){return ba=h,Ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,H.H=e===null||e.memoizedState===null?Gm:Iu,Ms=!1,h=s(o,f),Ms=!1,yi&&(h=lm(t,s,o,f)),om(e),h}function om(e){H.H=wo;var t=at!==null&&at.next!==null;if(ba=0,Rt=at=Ee=null,Zl=!1,To=0,bi=null,t)throw Error(l(300));e===null||Bt||(e=e.dependencies,e!==null&&Vl(e)&&(Bt=!0))}function lm(e,t,s,o){Ee=e;var f=0;do{if(yi&&(bi=null),To=0,yi=!1,25<=f)throw Error(l(301));if(f+=1,Rt=at=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}H.H=Pm,h=t(s,o)}while(yi);return h}function TS(){var e=H.H,t=e.useState()[0];return t=typeof t.then=="function"?ko(t):t,e=e.useState()[0],(at!==null?at.memoizedState:null)!==e&&(Ee.flags|=1024),t}function Su(){var e=Xl!==0;return Xl=0,e}function Tu(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function ku(e){if(Zl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Zl=!1}ba=0,Rt=at=Ee=null,yi=!1,To=Xl=0,bi=null}function on(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rt===null?Ee.memoizedState=Rt=e:Rt=Rt.next=e,Rt}function Nt(){if(at===null){var e=Ee.alternate;e=e!==null?e.memoizedState:null}else e=at.next;var t=Rt===null?Ee.memoizedState:Rt.next;if(t!==null)Rt=t,at=e;else{if(e===null)throw Ee.alternate===null?Error(l(467)):Error(l(310));at=e,e={memoizedState:at.memoizedState,baseState:at.baseState,baseQueue:at.baseQueue,queue:at.queue,next:null},Rt===null?Ee.memoizedState=Rt=e:Rt=Rt.next=e}return Rt}function Ql(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ko(e){var t=To;return To+=1,bi===null&&(bi=[]),e=Qp(bi,e,t),t=Ee,(Rt===null?t.memoizedState:Rt.next)===null&&(t=t.alternate,H.H=t===null||t.memoizedState===null?Gm:Iu),e}function Wl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ko(e);if(e.$$typeof===j)return Zt(e)}throw Error(l(438,String(e)))}function Cu(e){var t=null,s=Ee.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var o=Ee.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(t={data:o.data.map(function(f){return f.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=Ql(),Ee.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]=ee;return t.index++,s}function _a(e,t){return typeof t=="function"?t(e):t}function Jl(e){var t=Nt();return wu(t,at,e)}function wu(e,t,s){var o=e.queue;if(o===null)throw Error(l(311));o.lastRenderedReducer=s;var f=e.baseQueue,h=o.pending;if(h!==null){if(f!==null){var _=f.next;f.next=h.next,h.next=_}t.baseQueue=f=h,o.pending=null}if(h=e.baseState,f===null)e.memoizedState=h;else{t=f.next;var T=_=null,N=null,U=t,q=!1;do{var X=U.lane&-536870913;if(X!==U.lane?(Ie&X)===X:(ba&X)===X){var P=U.revertLane;if(P===0)N!==null&&(N=N.next={lane:0,revertLane:0,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null}),X===hi&&(q=!0);else if((ba&P)===P){U=U.next,P===hi&&(q=!0);continue}else X={lane:0,revertLane:U.revertLane,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},N===null?(T=N=X,_=h):N=N.next=X,Ee.lanes|=P,Ja|=P;X=U.action,Ms&&s(h,X),h=U.hasEagerState?U.eagerState:s(h,X)}else P={lane:X,revertLane:U.revertLane,gesture:U.gesture,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},N===null?(T=N=P,_=h):N=N.next=P,Ee.lanes|=X,Ja|=X;U=U.next}while(U!==null&&U!==t);if(N===null?_=h:N.next=T,!xn(h,e.memoizedState)&&(Bt=!0,q&&(s=pi,s!==null)))throw s;e.memoizedState=h,e.baseState=_,e.baseQueue=N,o.lastRenderedState=h}return f===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function Eu(e){var t=Nt(),s=t.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=e;var o=s.dispatch,f=s.pending,h=t.memoizedState;if(f!==null){s.pending=null;var _=f=f.next;do h=e(h,_.action),_=_.next;while(_!==f);xn(h,t.memoizedState)||(Bt=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),s.lastRenderedState=h}return[h,o]}function rm(e,t,s){var o=Ee,f=Nt(),h=ze;if(h){if(s===void 0)throw Error(l(407));s=s()}else s=t();var _=!xn((at||f).memoizedState,s);if(_&&(f.memoizedState=s,Bt=!0),f=f.queue,ju(dm.bind(null,o,f,e),[e]),f.getSnapshot!==t||_||Rt!==null&&Rt.memoizedState.tag&1){if(o.flags|=2048,_i(9,{destroy:void 0},um.bind(null,o,f,s,t),null),lt===null)throw Error(l(349));h||(ba&127)!==0||cm(o,t,s)}return s}function cm(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=Ee.updateQueue,t===null?(t=Ql(),Ee.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function um(e,t,s,o){t.value=s,t.getSnapshot=o,fm(t)&&hm(e)}function dm(e,t,s){return s(function(){fm(t)&&hm(e)})}function fm(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!xn(e,s)}catch{return!0}}function hm(e){var t=Ts(e,2);t!==null&&bn(t,e,2)}function Au(e){var t=on();if(typeof e=="function"){var s=e;if(e=s(),Ms){bt(!0);try{s()}finally{bt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_a,lastRenderedState:e},t}function pm(e,t,s,o){return e.baseState=s,wu(e,at,typeof o=="function"?o:_a)}function kS(e,t,s,o,f){if(nr(e))throw Error(l(485));if(e=t.action,e!==null){var h={payload:f,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){h.listeners.push(_)}};H.T!==null?s(!0):h.isTransition=!1,o(h),s=t.pending,s===null?(h.next=t.pending=h,mm(t,h)):(h.next=s.next,t.pending=s.next=h)}}function mm(e,t){var s=t.action,o=t.payload,f=e.state;if(t.isTransition){var h=H.T,_={};H.T=_;try{var T=s(f,o),N=H.S;N!==null&&N(_,T),gm(e,t,T)}catch(U){Nu(e,t,U)}finally{h!==null&&_.types!==null&&(h.types=_.types),H.T=h}}else try{h=s(f,o),gm(e,t,h)}catch(U){Nu(e,t,U)}}function gm(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(o){vm(e,t,o)},function(o){return Nu(e,t,o)}):vm(e,t,s)}function vm(e,t,s){t.status="fulfilled",t.value=s,ym(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,mm(e,s)))}function Nu(e,t,s){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do t.status="rejected",t.reason=s,ym(t),t=t.next;while(t!==o)}e.action=null}function ym(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function bm(e,t){return t}function _m(e,t){if(ze){var s=lt.formState;if(s!==null){e:{var o=Ee;if(ze){if(ut){t:{for(var f=ut,h=zn;f.nodeType!==8;){if(!h){f=null;break t}if(f=Vn(f.nextSibling),f===null){f=null;break t}}h=f.data,f=h==="F!"||h==="F"?f:null}if(f){ut=Vn(f.nextSibling),o=f.data==="F!";break e}}$a(o)}o=!1}o&&(t=s[0])}}return s=on(),s.memoizedState=s.baseState=t,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bm,lastRenderedState:t},s.queue=o,s=Um.bind(null,Ee,o),o.dispatch=s,o=Au(!1),h=Ou.bind(null,Ee,!1,o.queue),o=on(),f={state:t,dispatch:null,action:e,pending:null},o.queue=f,s=kS.bind(null,Ee,f,h,s),f.dispatch=s,o.memoizedState=e,[t,s,!1]}function xm(e){var t=Nt();return Sm(t,at,e)}function Sm(e,t,s){if(t=wu(e,t,bm)[0],e=Jl(_a)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var o=ko(t)}catch(_){throw _===mi?Pl:_}else o=t;t=Nt();var f=t.queue,h=f.dispatch;return s!==t.memoizedState&&(Ee.flags|=2048,_i(9,{destroy:void 0},CS.bind(null,f,s),null)),[o,h,e]}function CS(e,t){e.action=t}function Tm(e){var t=Nt(),s=at;if(s!==null)return Sm(t,s,e);Nt(),t=t.memoizedState,s=Nt();var o=s.queue.dispatch;return s.memoizedState=e,[t,o,!1]}function _i(e,t,s,o){return e={tag:e,create:s,deps:o,inst:t,next:null},t=Ee.updateQueue,t===null&&(t=Ql(),Ee.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 km(){return Nt().memoizedState}function er(e,t,s,o){var f=on();Ee.flags|=e,f.memoizedState=_i(1|t,{destroy:void 0},s,o===void 0?null:o)}function tr(e,t,s,o){var f=Nt();o=o===void 0?null:o;var h=f.memoizedState.inst;at!==null&&o!==null&&_u(o,at.memoizedState.deps)?f.memoizedState=_i(t,h,s,o):(Ee.flags|=e,f.memoizedState=_i(1|t,h,s,o))}function Cm(e,t){er(8390656,8,e,t)}function ju(e,t){tr(2048,8,e,t)}function wS(e){Ee.flags|=4;var t=Ee.updateQueue;if(t===null)t=Ql(),Ee.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function wm(e){var t=Nt().memoizedState;return wS({ref:t,nextImpl:e}),function(){if((Ze&2)!==0)throw Error(l(440));return t.impl.apply(void 0,arguments)}}function Em(e,t){return tr(4,2,e,t)}function Am(e,t){return tr(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 jm(e,t,s){s=s!=null?s.concat([e]):null,tr(4,4,Nm.bind(null,t,e),s)}function Du(){}function Dm(e,t){var s=Nt();t=t===void 0?null:t;var o=s.memoizedState;return t!==null&&_u(t,o[1])?o[0]:(s.memoizedState=[e,t],e)}function Mm(e,t){var s=Nt();t=t===void 0?null:t;var o=s.memoizedState;if(t!==null&&_u(t,o[1]))return o[0];if(o=e(),Ms){bt(!0);try{e()}finally{bt(!1)}}return s.memoizedState=[o,t],o}function Mu(e,t,s){return s===void 0||(ba&1073741824)!==0&&(Ie&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=Rg(),Ee.lanes|=e,Ja|=e,s)}function Rm(e,t,s,o){return xn(s,t)?s:vi.current!==null?(e=Mu(e,s,o),xn(e,t)||(Bt=!0),e):(ba&42)===0||(ba&1073741824)!==0&&(Ie&261930)===0?(Bt=!0,e.memoizedState=s):(e=Rg(),Ee.lanes|=e,Ja|=e,t)}function Bm(e,t,s,o,f){var h=M.p;M.p=h!==0&&8>h?h:8;var _=H.T,T={};H.T=T,Ou(e,!1,t,s);try{var N=f(),U=H.S;if(U!==null&&U(T,N),N!==null&&typeof N=="object"&&typeof N.then=="function"){var q=xS(N,o);Co(e,t,q,En(e))}else Co(e,t,o,En(e))}catch(X){Co(e,t,{then:function(){},status:"rejected",reason:X},En())}finally{M.p=h,_!==null&&T.types!==null&&(_.types=T.types),H.T=_}}function ES(){}function Ru(e,t,s,o){if(e.tag!==5)throw Error(l(476));var f=Om(e).queue;Bm(e,f,t,J,s===null?ES:function(){return Im(e),s(o)})}function Om(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_a,lastRenderedState:J},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_a,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Im(e){var t=Om(e);t.next===null&&(t=e.alternate.memoizedState),Co(e,t.next.queue,{},En())}function Bu(){return Zt(Go)}function Lm(){return Nt().memoizedState}function zm(){return Nt().memoizedState}function AS(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=En();e=Ya(s);var o=Ka(t,e,s);o!==null&&(bn(o,t,s),_o(o,t,s)),t={cache:cu()},e.payload=t;return}t=t.return}}function NS(e,t,s){var o=En();s={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},nr(e)?Vm(t,s):(s=Wc(e,t,s,o),s!==null&&(bn(s,e,o),Hm(s,t,o)))}function Um(e,t,s){var o=En();Co(e,t,s,o)}function Co(e,t,s,o){var f={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(nr(e))Vm(t,f);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var _=t.lastRenderedState,T=h(_,s);if(f.hasEagerState=!0,f.eagerState=T,xn(T,_))return Il(e,t,f,0),lt===null&&Ol(),!1}catch{}finally{}if(s=Wc(e,t,f,o),s!==null)return bn(s,e,o),Hm(s,t,o),!0}return!1}function Ou(e,t,s,o){if(o={lane:2,revertLane:hd(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},nr(e)){if(t)throw Error(l(479))}else t=Wc(e,s,o,2),t!==null&&bn(t,e,2)}function nr(e){var t=e.alternate;return e===Ee||t!==null&&t===Ee}function Vm(e,t){yi=Zl=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function Hm(e,t,s){if((s&4194048)!==0){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,qh(e,s)}}var wo={readContext:Zt,use:Wl,useCallback:xt,useContext:xt,useEffect:xt,useImperativeHandle:xt,useLayoutEffect:xt,useInsertionEffect:xt,useMemo:xt,useReducer:xt,useRef:xt,useState:xt,useDebugValue:xt,useDeferredValue:xt,useTransition:xt,useSyncExternalStore:xt,useId:xt,useHostTransitionStatus:xt,useFormState:xt,useActionState:xt,useOptimistic:xt,useMemoCache:xt,useCacheRefresh:xt};wo.useEffectEvent=xt;var Gm={readContext:Zt,use:Wl,useCallback:function(e,t){return on().memoizedState=[e,t===void 0?null:t],e},useContext:Zt,useEffect:Cm,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,er(4194308,4,Nm.bind(null,t,e),s)},useLayoutEffect:function(e,t){return er(4194308,4,e,t)},useInsertionEffect:function(e,t){er(4,2,e,t)},useMemo:function(e,t){var s=on();t=t===void 0?null:t;var o=e();if(Ms){bt(!0);try{e()}finally{bt(!1)}}return s.memoizedState=[o,t],o},useReducer:function(e,t,s){var o=on();if(s!==void 0){var f=s(t);if(Ms){bt(!0);try{s(t)}finally{bt(!1)}}}else f=t;return o.memoizedState=o.baseState=f,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:f},o.queue=e,e=e.dispatch=NS.bind(null,Ee,e),[o.memoizedState,e]},useRef:function(e){var t=on();return e={current:e},t.memoizedState=e},useState:function(e){e=Au(e);var t=e.queue,s=Um.bind(null,Ee,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:Du,useDeferredValue:function(e,t){var s=on();return Mu(s,e,t)},useTransition:function(){var e=Au(!1);return e=Bm.bind(null,Ee,e.queue,!0,!1),on().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var o=Ee,f=on();if(ze){if(s===void 0)throw Error(l(407));s=s()}else{if(s=t(),lt===null)throw Error(l(349));(Ie&127)!==0||cm(o,t,s)}f.memoizedState=s;var h={value:s,getSnapshot:t};return f.queue=h,Cm(dm.bind(null,o,h,e),[e]),o.flags|=2048,_i(9,{destroy:void 0},um.bind(null,o,h,s,t),null),s},useId:function(){var e=on(),t=lt.identifierPrefix;if(ze){var s=ea,o=Jn;s=(o&~(1<<32-Ge(o)-1)).toString(32)+s,t="_"+t+"R_"+s,s=Xl++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=SS++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Bu,useFormState:_m,useActionState:_m,useOptimistic:function(e){var t=on();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Ou.bind(null,Ee,!0,s),s.dispatch=t,[e,t]},useMemoCache:Cu,useCacheRefresh:function(){return on().memoizedState=AS.bind(null,Ee)},useEffectEvent:function(e){var t=on(),s={impl:e};return t.memoizedState=s,function(){if((Ze&2)!==0)throw Error(l(440));return s.impl.apply(void 0,arguments)}}},Iu={readContext:Zt,use:Wl,useCallback:Dm,useContext:Zt,useEffect:ju,useImperativeHandle:jm,useInsertionEffect:Em,useLayoutEffect:Am,useMemo:Mm,useReducer:Jl,useRef:km,useState:function(){return Jl(_a)},useDebugValue:Du,useDeferredValue:function(e,t){var s=Nt();return Rm(s,at.memoizedState,e,t)},useTransition:function(){var e=Jl(_a)[0],t=Nt().memoizedState;return[typeof e=="boolean"?e:ko(e),t]},useSyncExternalStore:rm,useId:Lm,useHostTransitionStatus:Bu,useFormState:xm,useActionState:xm,useOptimistic:function(e,t){var s=Nt();return pm(s,at,e,t)},useMemoCache:Cu,useCacheRefresh:zm};Iu.useEffectEvent=wm;var Pm={readContext:Zt,use:Wl,useCallback:Dm,useContext:Zt,useEffect:ju,useImperativeHandle:jm,useInsertionEffect:Em,useLayoutEffect:Am,useMemo:Mm,useReducer:Eu,useRef:km,useState:function(){return Eu(_a)},useDebugValue:Du,useDeferredValue:function(e,t){var s=Nt();return at===null?Mu(s,e,t):Rm(s,at.memoizedState,e,t)},useTransition:function(){var e=Eu(_a)[0],t=Nt().memoizedState;return[typeof e=="boolean"?e:ko(e),t]},useSyncExternalStore:rm,useId:Lm,useHostTransitionStatus:Bu,useFormState:Tm,useActionState:Tm,useOptimistic:function(e,t){var s=Nt();return at!==null?pm(s,at,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:Cu,useCacheRefresh:zm};Pm.useEffectEvent=wm;function Lu(e,t,s,o){t=e.memoizedState,s=s(o,t),s=s==null?t:v({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var zu={enqueueSetState:function(e,t,s){e=e._reactInternals;var o=En(),f=Ya(o);f.payload=t,s!=null&&(f.callback=s),t=Ka(e,f,o),t!==null&&(bn(t,e,o),_o(t,e,o))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var o=En(),f=Ya(o);f.tag=1,f.payload=t,s!=null&&(f.callback=s),t=Ka(e,f,o),t!==null&&(bn(t,e,o),_o(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=En(),o=Ya(s);o.tag=2,t!=null&&(o.callback=t),t=Ka(e,o,s),t!==null&&(bn(t,e,s),_o(t,e,s))}};function $m(e,t,s,o,f,h,_){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,h,_):t.prototype&&t.prototype.isPureReactComponent?!fo(s,o)||!fo(f,h):!0}function Fm(e,t,s,o){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,o),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,o),t.state!==e&&zu.enqueueReplaceState(t,t.state,null)}function Rs(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=v({},s));for(var f in e)s[f]===void 0&&(s[f]=e[f])}return s}function qm(e){Bl(e)}function Ym(e){console.error(e)}function Km(e){Bl(e)}function ar(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(o){setTimeout(function(){throw o})}}function Zm(e,t,s){try{var o=e.onCaughtError;o(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Uu(e,t,s){return s=Ya(s),s.tag=3,s.payload={element:null},s.callback=function(){ar(e,t)},s}function Xm(e){return e=Ya(e),e.tag=3,e}function Qm(e,t,s,o){var f=s.type.getDerivedStateFromError;if(typeof f=="function"){var h=o.value;e.payload=function(){return f(h)},e.callback=function(){Zm(t,s,o)}}var _=s.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(e.callback=function(){Zm(t,s,o),typeof f!="function"&&(es===null?es=new Set([this]):es.add(this));var T=o.stack;this.componentDidCatch(o.value,{componentStack:T!==null?T:""})})}function jS(e,t,s,o,f){if(s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(t=s.alternate,t!==null&&fi(t,s,f,!0),s=Tn.current,s!==null){switch(s.tag){case 31:case 13:return Un===null?mr():s.alternate===null&&St===0&&(St=3),s.flags&=-257,s.flags|=65536,s.lanes=f,o===$l?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([o]):t.add(o),ud(e,o,f)),!1;case 22:return s.flags|=65536,o===$l?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([o])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([o]):s.add(o)),ud(e,o,f)),!1}throw Error(l(435,s.tag))}return ud(e,o,f),mr(),!1}if(ze)return t=Tn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=f,o!==su&&(e=Error(l(422),{cause:o}),mo(On(e,s)))):(o!==su&&(t=Error(l(423),{cause:o}),mo(On(t,s))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,o=On(o,s),f=Uu(e.stateNode,o,f),mu(e,f),St!==4&&(St=2)),!1;var h=Error(l(520),{cause:o});if(h=On(h,s),Bo===null?Bo=[h]:Bo.push(h),St!==4&&(St=2),t===null)return!0;o=On(o,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=f&-f,s.lanes|=e,e=Uu(s.stateNode,o,e),mu(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"&&(es===null||!es.has(h))))return s.flags|=65536,f&=-f,s.lanes|=f,f=Xm(f),Qm(f,e,s,o),mu(s,f),!1}s=s.return}while(s!==null);return!1}var Vu=Error(l(461)),Bt=!1;function Xt(e,t,s,o){t.child=e===null?tm(t,null,s,o):Ds(t,e.child,s,o)}function Wm(e,t,s,o,f){s=s.render;var h=t.ref;if("ref"in o){var _={};for(var T in o)T!=="ref"&&(_[T]=o[T])}else _=o;return Es(t),o=xu(e,t,s,_,h,f),T=Su(),e!==null&&!Bt?(Tu(e,t,f),xa(e,t,f)):(ze&&T&&nu(t),t.flags|=1,Xt(e,t,o,f),t.child)}function Jm(e,t,s,o,f){if(e===null){var h=s.type;return typeof h=="function"&&!Jc(h)&&h.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=h,eg(e,t,h,o,f)):(e=zl(s.type,null,o,t,t.mode,f),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!Ku(e,f)){var _=h.memoizedProps;if(s=s.compare,s=s!==null?s:fo,s(_,o)&&e.ref===t.ref)return xa(e,t,f)}return t.flags|=1,e=ma(h,o),e.ref=t.ref,e.return=t,t.child=e}function eg(e,t,s,o,f){if(e!==null){var h=e.memoizedProps;if(fo(h,o)&&e.ref===t.ref)if(Bt=!1,t.pendingProps=o=h,Ku(e,f))(e.flags&131072)!==0&&(Bt=!0);else return t.lanes=e.lanes,xa(e,t,f)}return Hu(e,t,s,o,f)}function tg(e,t,s,o){var f=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,f=0;o!==null;)f=f|o.lanes|o.childLanes,o=o.sibling;o=f&~h}else o=0,t.child=null;return ng(e,t,h,s,o)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Gl(t,h!==null?h.cachePool:null),h!==null?sm(t,h):vu(),im(t);else return o=t.lanes=536870912,ng(e,t,h!==null?h.baseLanes|s:s,s,o)}else h!==null?(Gl(t,h.cachePool),sm(t,h),Xa(),t.memoizedState=null):(e!==null&&Gl(t,null),vu(),Xa());return Xt(e,t,f,s),t.child}function Eo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ng(e,t,s,o,f){var h=du();return h=h===null?null:{parent:Mt._currentValue,pool:h},t.memoizedState={baseLanes:s,cachePool:h},e!==null&&Gl(t,null),vu(),im(t),e!==null&&fi(e,t,o,!0),t.childLanes=f,null}function sr(e,t){return t=or({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ag(e,t,s){return Ds(t,e.child,null,s),e=sr(t,t.pendingProps),e.flags|=2,kn(t),t.memoizedState=null,e}function DS(e,t,s){var o=t.pendingProps,f=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ze){if(o.mode==="hidden")return e=sr(t,o),t.lanes=536870912,Eo(null,e);if(bu(t),(e=ut)?(e=mv(e,zn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ga!==null?{id:Jn,overflow:ea}:null,retryLane:536870912,hydrationErrors:null},s=Vp(e),s.return=t,t.child=s,Kt=t,ut=null)):e=null,e===null)throw $a(t);return t.lanes=536870912,null}return sr(t,o)}var h=e.memoizedState;if(h!==null){var _=h.dehydrated;if(bu(t),f)if(t.flags&256)t.flags&=-257,t=ag(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(l(558));else if(Bt||fi(e,t,s,!1),f=(s&e.childLanes)!==0,Bt||f){if(o=lt,o!==null&&(_=Yh(o,s),_!==0&&_!==h.retryLane))throw h.retryLane=_,Ts(e,_),bn(o,e,_),Vu;mr(),t=ag(e,t,s)}else e=h.treeContext,ut=Vn(_.nextSibling),Kt=t,ze=!0,Pa=null,zn=!1,e!==null&&Pp(t,e),t=sr(t,o),t.flags|=4096;return t}return e=ma(e.child,{mode:o.mode,children:o.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ir(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(l(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function Hu(e,t,s,o,f){return Es(t),s=xu(e,t,s,o,void 0,f),o=Su(),e!==null&&!Bt?(Tu(e,t,f),xa(e,t,f)):(ze&&o&&nu(t),t.flags|=1,Xt(e,t,s,f),t.child)}function sg(e,t,s,o,f,h){return Es(t),t.updateQueue=null,s=lm(t,o,s,f),om(e),o=Su(),e!==null&&!Bt?(Tu(e,t,h),xa(e,t,h)):(ze&&o&&nu(t),t.flags|=1,Xt(e,t,s,h),t.child)}function ig(e,t,s,o,f){if(Es(t),t.stateNode===null){var h=ri,_=s.contextType;typeof _=="object"&&_!==null&&(h=Zt(_)),h=new s(o,h),t.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=zu,t.stateNode=h,h._reactInternals=t,h=t.stateNode,h.props=o,h.state=t.memoizedState,h.refs={},hu(t),_=s.contextType,h.context=typeof _=="object"&&_!==null?Zt(_):ri,h.state=t.memoizedState,_=s.getDerivedStateFromProps,typeof _=="function"&&(Lu(t,s,_,o),h.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(_=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),_!==h.state&&zu.enqueueReplaceState(h,h.state,null),So(t,o,h,f),xo(),h.state=t.memoizedState),typeof h.componentDidMount=="function"&&(t.flags|=4194308),o=!0}else if(e===null){h=t.stateNode;var T=t.memoizedProps,N=Rs(s,T);h.props=N;var U=h.context,q=s.contextType;_=ri,typeof q=="object"&&q!==null&&(_=Zt(q));var X=s.getDerivedStateFromProps;q=typeof X=="function"||typeof h.getSnapshotBeforeUpdate=="function",T=t.pendingProps!==T,q||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(T||U!==_)&&Fm(t,h,o,_),qa=!1;var P=t.memoizedState;h.state=P,So(t,o,h,f),xo(),U=t.memoizedState,T||P!==U||qa?(typeof X=="function"&&(Lu(t,s,X,o),U=t.memoizedState),(N=qa||$m(t,s,N,o,P,U,_))?(q||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=o,t.memoizedState=U),h.props=o,h.state=U,h.context=_,o=N):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{h=t.stateNode,pu(e,t),_=t.memoizedProps,q=Rs(s,_),h.props=q,X=t.pendingProps,P=h.context,U=s.contextType,N=ri,typeof U=="object"&&U!==null&&(N=Zt(U)),T=s.getDerivedStateFromProps,(U=typeof T=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(_!==X||P!==N)&&Fm(t,h,o,N),qa=!1,P=t.memoizedState,h.state=P,So(t,o,h,f),xo();var $=t.memoizedState;_!==X||P!==$||qa||e!==null&&e.dependencies!==null&&Vl(e.dependencies)?(typeof T=="function"&&(Lu(t,s,T,o),$=t.memoizedState),(q=qa||$m(t,s,q,o,P,$,N)||e!==null&&e.dependencies!==null&&Vl(e.dependencies))?(U||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(o,$,N),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(o,$,N)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||_===e.memoizedProps&&P===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&P===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=$),h.props=o,h.state=$,h.context=N,o=q):(typeof h.componentDidUpdate!="function"||_===e.memoizedProps&&P===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&P===e.memoizedState||(t.flags|=1024),o=!1)}return h=o,ir(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=Ds(t,e.child,null,f),t.child=Ds(t,null,s,f)):Xt(e,t,s,f),t.memoizedState=h.state,e=t.child):e=xa(e,t,f),e}function og(e,t,s,o){return Cs(),t.flags|=256,Xt(e,t,s,o),t.child}var Gu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Pu(e){return{baseLanes:e,cachePool:Zp()}}function $u(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=wn),e}function lg(e,t,s){var o=t.pendingProps,f=!1,h=(t.flags&128)!==0,_;if((_=h)||(_=e!==null&&e.memoizedState===null?!1:(At.current&2)!==0),_&&(f=!0,t.flags&=-129),_=(t.flags&32)!==0,t.flags&=-33,e===null){if(ze){if(f?Za(t):Xa(),(e=ut)?(e=mv(e,zn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ga!==null?{id:Jn,overflow:ea}:null,retryLane:536870912,hydrationErrors:null},s=Vp(e),s.return=t,t.child=s,Kt=t,ut=null)):e=null,e===null)throw $a(t);return wd(e)?t.lanes=32:t.lanes=536870912,null}var T=o.children;return o=o.fallback,f?(Xa(),f=t.mode,T=or({mode:"hidden",children:T},f),o=ks(o,f,s,null),T.return=t,o.return=t,T.sibling=o,t.child=T,o=t.child,o.memoizedState=Pu(s),o.childLanes=$u(e,_,s),t.memoizedState=Gu,Eo(null,o)):(Za(t),Fu(t,T))}var N=e.memoizedState;if(N!==null&&(T=N.dehydrated,T!==null)){if(h)t.flags&256?(Za(t),t.flags&=-257,t=qu(e,t,s)):t.memoizedState!==null?(Xa(),t.child=e.child,t.flags|=128,t=null):(Xa(),T=o.fallback,f=t.mode,o=or({mode:"visible",children:o.children},f),T=ks(T,f,s,null),T.flags|=2,o.return=t,T.return=t,o.sibling=T,t.child=o,Ds(t,e.child,null,s),o=t.child,o.memoizedState=Pu(s),o.childLanes=$u(e,_,s),t.memoizedState=Gu,t=Eo(null,o));else if(Za(t),wd(T)){if(_=T.nextSibling&&T.nextSibling.dataset,_)var U=_.dgst;_=U,o=Error(l(419)),o.stack="",o.digest=_,mo({value:o,source:null,stack:null}),t=qu(e,t,s)}else if(Bt||fi(e,t,s,!1),_=(s&e.childLanes)!==0,Bt||_){if(_=lt,_!==null&&(o=Yh(_,s),o!==0&&o!==N.retryLane))throw N.retryLane=o,Ts(e,o),bn(_,e,o),Vu;Cd(T)||mr(),t=qu(e,t,s)}else Cd(T)?(t.flags|=192,t.child=e.child,t=null):(e=N.treeContext,ut=Vn(T.nextSibling),Kt=t,ze=!0,Pa=null,zn=!1,e!==null&&Pp(t,e),t=Fu(t,o.children),t.flags|=4096);return t}return f?(Xa(),T=o.fallback,f=t.mode,N=e.child,U=N.sibling,o=ma(N,{mode:"hidden",children:o.children}),o.subtreeFlags=N.subtreeFlags&65011712,U!==null?T=ma(U,T):(T=ks(T,f,s,null),T.flags|=2),T.return=t,o.return=t,o.sibling=T,t.child=o,Eo(null,o),o=t.child,T=e.child.memoizedState,T===null?T=Pu(s):(f=T.cachePool,f!==null?(N=Mt._currentValue,f=f.parent!==N?{parent:N,pool:N}:f):f=Zp(),T={baseLanes:T.baseLanes|s,cachePool:f}),o.memoizedState=T,o.childLanes=$u(e,_,s),t.memoizedState=Gu,Eo(e.child,o)):(Za(t),s=e.child,e=s.sibling,s=ma(s,{mode:"visible",children:o.children}),s.return=t,s.sibling=null,e!==null&&(_=t.deletions,_===null?(t.deletions=[e],t.flags|=16):_.push(e)),t.child=s,t.memoizedState=null,s)}function Fu(e,t){return t=or({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function or(e,t){return e=Sn(22,e,null,t),e.lanes=0,e}function qu(e,t,s){return Ds(t,e.child,null,s),e=Fu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function rg(e,t,s){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),lu(e.return,t,s)}function Yu(e,t,s,o,f,h){var _=e.memoizedState;_===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:o,tail:s,tailMode:f,treeForkCount:h}:(_.isBackwards=t,_.rendering=null,_.renderingStartTime=0,_.last=o,_.tail=s,_.tailMode=f,_.treeForkCount=h)}function cg(e,t,s){var o=t.pendingProps,f=o.revealOrder,h=o.tail;o=o.children;var _=At.current,T=(_&2)!==0;if(T?(_=_&1|2,t.flags|=128):_&=1,se(At,_),Xt(e,t,o,s),o=ze?po:0,!T&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&rg(e,s,t);else if(e.tag===19)rg(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(f){case"forwards":for(s=t.child,f=null;s!==null;)e=s.alternate,e!==null&&Kl(e)===null&&(f=s),s=s.sibling;s=f,s===null?(f=t.child,t.child=null):(f=s.sibling,s.sibling=null),Yu(t,!1,f,s,h,o);break;case"backwards":case"unstable_legacy-backwards":for(s=null,f=t.child,t.child=null;f!==null;){if(e=f.alternate,e!==null&&Kl(e)===null){t.child=f;break}e=f.sibling,f.sibling=s,s=f,f=e}Yu(t,!0,s,null,h,o);break;case"together":Yu(t,!1,null,null,void 0,o);break;default:t.memoizedState=null}return t.child}function xa(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),Ja|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(fi(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=ma(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=ma(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function Ku(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Vl(e)))}function MS(e,t,s){switch(t.tag){case 3:Jt(t,t.stateNode.containerInfo),Fa(t,Mt,e.memoizedState.cache),Cs();break;case 27:case 5:Ce(t);break;case 4:Jt(t,t.stateNode.containerInfo);break;case 10:Fa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,bu(t),null;break;case 13:var o=t.memoizedState;if(o!==null)return o.dehydrated!==null?(Za(t),t.flags|=128,null):(s&t.child.childLanes)!==0?lg(e,t,s):(Za(t),e=xa(e,t,s),e!==null?e.sibling:null);Za(t);break;case 19:var f=(e.flags&128)!==0;if(o=(s&t.childLanes)!==0,o||(fi(e,t,s,!1),o=(s&t.childLanes)!==0),f){if(o)return cg(e,t,s);t.flags|=128}if(f=t.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),se(At,At.current),o)break;return null;case 22:return t.lanes=0,tg(e,t,s,t.pendingProps);case 24:Fa(t,Mt,e.memoizedState.cache)}return xa(e,t,s)}function ug(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)Bt=!0;else{if(!Ku(e,s)&&(t.flags&128)===0)return Bt=!1,MS(e,t,s);Bt=(e.flags&131072)!==0}else Bt=!1,ze&&(t.flags&1048576)!==0&&Gp(t,po,t.index);switch(t.lanes=0,t.tag){case 16:e:{var o=t.pendingProps;if(e=Ns(t.elementType),t.type=e,typeof e=="function")Jc(e)?(o=Rs(e,o),t.tag=1,t=ig(null,t,e,o,s)):(t.tag=0,t=Hu(null,t,e,o,s));else{if(e!=null){var f=e.$$typeof;if(f===V){t.tag=11,t=Wm(null,t,e,o,s);break e}else if(f===R){t.tag=14,t=Jm(null,t,e,o,s);break e}}throw t=Q(e)||e,Error(l(306,t,""))}}return t;case 0:return Hu(e,t,t.type,t.pendingProps,s);case 1:return o=t.type,f=Rs(o,t.pendingProps),ig(e,t,o,f,s);case 3:e:{if(Jt(t,t.stateNode.containerInfo),e===null)throw Error(l(387));o=t.pendingProps;var h=t.memoizedState;f=h.element,pu(e,t),So(t,o,null,s);var _=t.memoizedState;if(o=_.cache,Fa(t,Mt,o),o!==h.cache&&ru(t,[Mt],s,!0),xo(),o=_.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:_.cache},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){t=og(e,t,o,s);break e}else if(o!==f){f=On(Error(l(424)),t),mo(f),t=og(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(ut=Vn(e.firstChild),Kt=t,ze=!0,Pa=null,zn=!0,s=tm(t,null,o,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Cs(),o===f){t=xa(e,t,s);break e}Xt(e,t,o,s)}t=t.child}return t;case 26:return ir(e,t),e===null?(s=xv(t.type,null,t.pendingProps,null))?t.memoizedState=s:ze||(s=t.type,e=t.pendingProps,o=Sr(Ct.current).createElement(s),o[Yt]=t,o[hn]=e,Qt(o,s,e),$t(o),t.stateNode=o):t.memoizedState=xv(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ce(t),e===null&&ze&&(o=t.stateNode=yv(t.type,t.pendingProps,Ct.current),Kt=t,zn=!0,f=ut,ss(t.type)?(Ed=f,ut=Vn(o.firstChild)):ut=f),Xt(e,t,t.pendingProps.children,s),ir(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ze&&((f=o=ut)&&(o=r1(o,t.type,t.pendingProps,zn),o!==null?(t.stateNode=o,Kt=t,ut=Vn(o.firstChild),zn=!1,f=!0):f=!1),f||$a(t)),Ce(t),f=t.type,h=t.pendingProps,_=e!==null?e.memoizedProps:null,o=h.children,Sd(f,h)?o=null:_!==null&&Sd(f,_)&&(t.flags|=32),t.memoizedState!==null&&(f=xu(e,t,TS,null,null,s),Go._currentValue=f),ir(e,t),Xt(e,t,o,s),t.child;case 6:return e===null&&ze&&((e=s=ut)&&(s=c1(s,t.pendingProps,zn),s!==null?(t.stateNode=s,Kt=t,ut=null,e=!0):e=!1),e||$a(t)),null;case 13:return lg(e,t,s);case 4:return Jt(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=Ds(t,null,o,s):Xt(e,t,o,s),t.child;case 11:return Wm(e,t,t.type,t.pendingProps,s);case 7:return Xt(e,t,t.pendingProps,s),t.child;case 8:return Xt(e,t,t.pendingProps.children,s),t.child;case 12:return Xt(e,t,t.pendingProps.children,s),t.child;case 10:return o=t.pendingProps,Fa(t,t.type,o.value),Xt(e,t,o.children,s),t.child;case 9:return f=t.type._context,o=t.pendingProps.children,Es(t),f=Zt(f),o=o(f),t.flags|=1,Xt(e,t,o,s),t.child;case 14:return Jm(e,t,t.type,t.pendingProps,s);case 15:return eg(e,t,t.type,t.pendingProps,s);case 19:return cg(e,t,s);case 31:return DS(e,t,s);case 22:return tg(e,t,s,t.pendingProps);case 24:return Es(t),o=Zt(Mt),e===null?(f=du(),f===null&&(f=lt,h=cu(),f.pooledCache=h,h.refCount++,h!==null&&(f.pooledCacheLanes|=s),f=h),t.memoizedState={parent:o,cache:f},hu(t),Fa(t,Mt,f)):((e.lanes&s)!==0&&(pu(e,t),So(t,null,null,s),xo()),f=e.memoizedState,h=t.memoizedState,f.parent!==o?(f={parent:o,cache:o},t.memoizedState=f,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=f),Fa(t,Mt,o)):(o=h.cache,Fa(t,Mt,o),o!==f.cache&&ru(t,[Mt],s,!0))),Xt(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function Sa(e){e.flags|=4}function Zu(e,t,s,o,f){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(f&335544128)===f)if(e.stateNode.complete)e.flags|=8192;else if(Lg())e.flags|=8192;else throw js=$l,fu}else e.flags&=-16777217}function dg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!wv(t))if(Lg())e.flags|=8192;else throw js=$l,fu}function lr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?re():536870912,e.lanes|=t,ki|=t)}function Ao(e,t){if(!ze)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function dt(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,o=0;if(t)for(var f=e.child;f!==null;)s|=f.lanes|f.childLanes,o|=f.subtreeFlags&65011712,o|=f.flags&65011712,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)s|=f.lanes|f.childLanes,o|=f.subtreeFlags,o|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=o,e.childLanes=s,t}function RS(e,t,s){var o=t.pendingProps;switch(au(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dt(t),null;case 1:return dt(t),null;case 3:return s=t.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),ya(Mt),W(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(di(t)?Sa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,iu())),dt(t),null;case 26:var f=t.type,h=t.memoizedState;return e===null?(Sa(t),h!==null?(dt(t),dg(t,h)):(dt(t),Zu(t,f,null,o,s))):h?h!==e.memoizedState?(Sa(t),dt(t),dg(t,h)):(dt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==o&&Sa(t),dt(t),Zu(t,f,e,o,s)),null;case 27:if(me(t),s=Ct.current,f=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&Sa(t);else{if(!o){if(t.stateNode===null)throw Error(l(166));return dt(t),null}e=je.current,di(t)?$p(t):(e=yv(f,o,s),t.stateNode=e,Sa(t))}return dt(t),null;case 5:if(me(t),f=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&Sa(t);else{if(!o){if(t.stateNode===null)throw Error(l(166));return dt(t),null}if(h=je.current,di(t))$p(t);else{var _=Sr(Ct.current);switch(h){case 1:h=_.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:h=_.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":h=_.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":h=_.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":h=_.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?_.createElement("select",{is:o.is}):_.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?_.createElement(f,{is:o.is}):_.createElement(f)}}h[Yt]=t,h[hn]=o;e:for(_=t.child;_!==null;){if(_.tag===5||_.tag===6)h.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===t)break e;for(;_.sibling===null;){if(_.return===null||_.return===t)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}t.stateNode=h;e:switch(Qt(h,f,o),f){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&Sa(t)}}return dt(t),Zu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==o&&Sa(t);else{if(typeof o!="string"&&t.stateNode===null)throw Error(l(166));if(e=Ct.current,di(t)){if(e=t.stateNode,s=t.memoizedProps,o=null,f=Kt,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}e[Yt]=t,e=!!(e.nodeValue===s||o!==null&&o.suppressHydrationWarning===!0||lv(e.nodeValue,s)),e||$a(t,!0)}else e=Sr(e).createTextNode(o),e[Yt]=t,t.stateNode=e}return dt(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(o=di(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[Yt]=t}else Cs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;dt(t),e=!1}else s=iu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(kn(t),t):(kn(t),null);if((t.flags&128)!==0)throw Error(l(558))}return dt(t),null;case 13:if(o=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=di(t),o!==null&&o.dehydrated!==null){if(e===null){if(!f)throw Error(l(318));if(f=t.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(l(317));f[Yt]=t}else Cs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;dt(t),f=!1}else f=iu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return t.flags&256?(kn(t),t):(kn(t),null)}return kn(t),(t.flags&128)!==0?(t.lanes=s,t):(s=o!==null,e=e!==null&&e.memoizedState!==null,s&&(o=t.child,f=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(f=o.alternate.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==f&&(o.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),lr(t,t.updateQueue),dt(t),null);case 4:return W(),e===null&&vd(t.stateNode.containerInfo),dt(t),null;case 10:return ya(t.type),dt(t),null;case 19:if(De(At),o=t.memoizedState,o===null)return dt(t),null;if(f=(t.flags&128)!==0,h=o.rendering,h===null)if(f)Ao(o,!1);else{if(St!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=Kl(e),h!==null){for(t.flags|=128,Ao(o,!1),e=h.updateQueue,t.updateQueue=e,lr(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)Up(s,e),s=s.sibling;return se(At,At.current&1|2),ze&&ga(t,o.treeForkCount),t.child}e=e.sibling}o.tail!==null&&ne()>fr&&(t.flags|=128,f=!0,Ao(o,!1),t.lanes=4194304)}else{if(!f)if(e=Kl(h),e!==null){if(t.flags|=128,f=!0,e=e.updateQueue,t.updateQueue=e,lr(t,e),Ao(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!ze)return dt(t),null}else 2*ne()-o.renderingStartTime>fr&&s!==536870912&&(t.flags|=128,f=!0,Ao(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=ne(),e.sibling=null,s=At.current,se(At,f?s&1|2:s&1),ze&&ga(t,o.treeForkCount),e):(dt(t),null);case 22:case 23:return kn(t),yu(),o=t.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(t.flags|=8192):o&&(t.flags|=8192),o?(s&536870912)!==0&&(t.flags&128)===0&&(dt(t),t.subtreeFlags&6&&(t.flags|=8192)):dt(t),s=t.updateQueue,s!==null&&lr(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&&De(As),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),ya(Mt),dt(t),null;case 25:return null;case 30:return null}throw Error(l(156,t.tag))}function BS(e,t){switch(au(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ya(Mt),W(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return me(t),null;case 31:if(t.memoizedState!==null){if(kn(t),t.alternate===null)throw Error(l(340));Cs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(kn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));Cs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return De(At),null;case 4:return W(),null;case 10:return ya(t.type),null;case 22:case 23:return kn(t),yu(),e!==null&&De(As),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ya(Mt),null;case 25:return null;default:return null}}function fg(e,t){switch(au(t),t.tag){case 3:ya(Mt),W();break;case 26:case 27:case 5:me(t);break;case 4:W();break;case 31:t.memoizedState!==null&&kn(t);break;case 13:kn(t);break;case 19:De(At);break;case 10:ya(t.type);break;case 22:case 23:kn(t),yu(),e!==null&&De(As);break;case 24:ya(Mt)}}function No(e,t){try{var s=t.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var f=o.next;s=f;do{if((s.tag&e)===e){o=void 0;var h=s.create,_=s.inst;o=h(),_.destroy=o}s=s.next}while(s!==f)}}catch(T){tt(t,t.return,T)}}function Qa(e,t,s){try{var o=t.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var h=f.next;o=h;do{if((o.tag&e)===e){var _=o.inst,T=_.destroy;if(T!==void 0){_.destroy=void 0,f=t;var N=s,U=T;try{U()}catch(q){tt(f,N,q)}}}o=o.next}while(o!==h)}}catch(q){tt(t,t.return,q)}}function hg(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{am(t,s)}catch(o){tt(e,e.return,o)}}}function pg(e,t,s){s.props=Rs(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(o){tt(e,t,o)}}function jo(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(f){tt(e,t,f)}}function ta(e,t){var s=e.ref,o=e.refCleanup;if(s!==null)if(typeof o=="function")try{o()}catch(f){tt(e,t,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(f){tt(e,t,f)}else s.current=null}function mg(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(f){tt(e,e.return,f)}}function Xu(e,t,s){try{var o=e.stateNode;n1(o,e.type,s,t),o[hn]=t}catch(f){tt(e,e.return,f)}}function gg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ss(e.type)||e.tag===4}function Qu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gg(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&&ss(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Wu(e,t,s){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(e),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=ha));else if(o!==4&&(o===27&&ss(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(Wu(e,t,s),e=e.sibling;e!==null;)Wu(e,t,s),e=e.sibling}function rr(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&&ss(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(rr(e,t,s),e=e.sibling;e!==null;)rr(e,t,s),e=e.sibling}function vg(e){var t=e.stateNode,s=e.memoizedProps;try{for(var o=e.type,f=t.attributes;f.length;)t.removeAttributeNode(f[0]);Qt(t,o,s),t[Yt]=e,t[hn]=s}catch(h){tt(e,e.return,h)}}var Ta=!1,Ot=!1,Ju=!1,yg=typeof WeakSet=="function"?WeakSet:Set,Ft=null;function OS(e,t){if(e=e.containerInfo,_d=Nr,e=jp(e),qc(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 f=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{s.nodeType,h.nodeType}catch{s=null;break e}var _=0,T=-1,N=-1,U=0,q=0,X=e,P=null;t:for(;;){for(var $;X!==s||f!==0&&X.nodeType!==3||(T=_+f),X!==h||o!==0&&X.nodeType!==3||(N=_+o),X.nodeType===3&&(_+=X.nodeValue.length),($=X.firstChild)!==null;)P=X,X=$;for(;;){if(X===e)break t;if(P===s&&++U===f&&(T=_),P===h&&++q===o&&(N=_),($=X.nextSibling)!==null)break;X=P,P=X.parentNode}X=$}s=T===-1||N===-1?null:{start:T,end:N}}else s=null}s=s||{start:0,end:0}}else s=null;for(xd={focusedElem:e,selectionRange:s},Nr=!1,Ft=t;Ft!==null;)if(t=Ft,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ft=e;else for(;Ft!==null;){switch(t=Ft,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++)f=e[s],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,s=t,f=h.memoizedProps,h=h.memoizedState,o=s.stateNode;try{var ce=Rs(s.type,f);e=o.getSnapshotBeforeUpdate(ce,h),o.__reactInternalSnapshotBeforeUpdate=e}catch(be){tt(s,s.return,be)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)kd(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":kd(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(l(163))}if(e=t.sibling,e!==null){e.return=t.return,Ft=e;break}Ft=t.return}}function bg(e,t,s){var o=s.flags;switch(s.tag){case 0:case 11:case 15:Ca(e,s),o&4&&No(5,s);break;case 1:if(Ca(e,s),o&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(_){tt(s,s.return,_)}else{var f=Rs(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(f,t,e.__reactInternalSnapshotBeforeUpdate)}catch(_){tt(s,s.return,_)}}o&64&&hg(s),o&512&&jo(s,s.return);break;case 3:if(Ca(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{am(e,t)}catch(_){tt(s,s.return,_)}}break;case 27:t===null&&o&4&&vg(s);case 26:case 5:Ca(e,s),t===null&&o&4&&mg(s),o&512&&jo(s,s.return);break;case 12:Ca(e,s);break;case 31:Ca(e,s),o&4&&Sg(e,s);break;case 13:Ca(e,s),o&4&&Tg(e,s),o&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=$S.bind(null,s),u1(e,s))));break;case 22:if(o=s.memoizedState!==null||Ta,!o){t=t!==null&&t.memoizedState!==null||Ot,f=Ta;var h=Ot;Ta=o,(Ot=t)&&!h?wa(e,s,(s.subtreeFlags&8772)!==0):Ca(e,s),Ta=f,Ot=h}break;case 30:break;default:Ca(e,s)}}function _g(e){var t=e.alternate;t!==null&&(e.alternate=null,_g(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Nc(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 gt=null,mn=!1;function ka(e,t,s){for(s=s.child;s!==null;)xg(e,t,s),s=s.sibling}function xg(e,t,s){if(Pe&&typeof Pe.onCommitFiberUnmount=="function")try{Pe.onCommitFiberUnmount(ct,s)}catch{}switch(s.tag){case 26:Ot||ta(s,t),ka(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Ot||ta(s,t);var o=gt,f=mn;ss(s.type)&&(gt=s.stateNode,mn=!1),ka(e,t,s),Uo(s.stateNode),gt=o,mn=f;break;case 5:Ot||ta(s,t);case 6:if(o=gt,f=mn,gt=null,ka(e,t,s),gt=o,mn=f,gt!==null)if(mn)try{(gt.nodeType===9?gt.body:gt.nodeName==="HTML"?gt.ownerDocument.body:gt).removeChild(s.stateNode)}catch(h){tt(s,t,h)}else try{gt.removeChild(s.stateNode)}catch(h){tt(s,t,h)}break;case 18:gt!==null&&(mn?(e=gt,hv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Mi(e)):hv(gt,s.stateNode));break;case 4:o=gt,f=mn,gt=s.stateNode.containerInfo,mn=!0,ka(e,t,s),gt=o,mn=f;break;case 0:case 11:case 14:case 15:Qa(2,s,t),Ot||Qa(4,s,t),ka(e,t,s);break;case 1:Ot||(ta(s,t),o=s.stateNode,typeof o.componentWillUnmount=="function"&&pg(s,t,o)),ka(e,t,s);break;case 21:ka(e,t,s);break;case 22:Ot=(o=Ot)||s.memoizedState!==null,ka(e,t,s),Ot=o;break;default:ka(e,t,s)}}function Sg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Mi(e)}catch(s){tt(t,t.return,s)}}}function Tg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Mi(e)}catch(s){tt(t,t.return,s)}}function IS(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new yg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new yg),t;default:throw Error(l(435,e.tag))}}function cr(e,t){var s=IS(e);t.forEach(function(o){if(!s.has(o)){s.add(o);var f=FS.bind(null,e,o);o.then(f,f)}})}function gn(e,t){var s=t.deletions;if(s!==null)for(var o=0;o<s.length;o++){var f=s[o],h=e,_=t,T=_;e:for(;T!==null;){switch(T.tag){case 27:if(ss(T.type)){gt=T.stateNode,mn=!1;break e}break;case 5:gt=T.stateNode,mn=!1;break e;case 3:case 4:gt=T.stateNode.containerInfo,mn=!0;break e}T=T.return}if(gt===null)throw Error(l(160));xg(h,_,f),gt=null,mn=!1,h=f.alternate,h!==null&&(h.return=null),f.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)kg(t,e),t=t.sibling}var Yn=null;function kg(e,t){var s=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:gn(t,e),vn(e),o&4&&(Qa(3,e,e.return),No(3,e),Qa(5,e,e.return));break;case 1:gn(t,e),vn(e),o&512&&(Ot||s===null||ta(s,s.return)),o&64&&Ta&&(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 f=Yn;if(gn(t,e),vn(e),o&512&&(Ot||s===null||ta(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,f=f.ownerDocument||f;t:switch(o){case"title":h=f.getElementsByTagName("title")[0],(!h||h[no]||h[Yt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=f.createElement(o),f.head.insertBefore(h,f.querySelector("head > title"))),Qt(h,o,s),h[Yt]=e,$t(h),o=h;break e;case"link":var _=kv("link","href",f).get(o+(s.href||""));if(_){for(var T=0;T<_.length;T++)if(h=_[T],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)){_.splice(T,1);break t}}h=f.createElement(o),Qt(h,o,s),f.head.appendChild(h);break;case"meta":if(_=kv("meta","content",f).get(o+(s.content||""))){for(T=0;T<_.length;T++)if(h=_[T],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)){_.splice(T,1);break t}}h=f.createElement(o),Qt(h,o,s),f.head.appendChild(h);break;default:throw Error(l(468,o))}h[Yt]=e,$t(h),o=h}e.stateNode=o}else Cv(f,e.type,e.stateNode);else e.stateNode=Tv(f,o,e.memoizedProps);else h!==o?(h===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):h.count--,o===null?Cv(f,e.type,e.stateNode):Tv(f,o,e.memoizedProps)):o===null&&e.stateNode!==null&&Xu(e,e.memoizedProps,s.memoizedProps)}break;case 27:gn(t,e),vn(e),o&512&&(Ot||s===null||ta(s,s.return)),s!==null&&o&4&&Xu(e,e.memoizedProps,s.memoizedProps);break;case 5:if(gn(t,e),vn(e),o&512&&(Ot||s===null||ta(s,s.return)),e.flags&32){f=e.stateNode;try{ti(f,"")}catch(ce){tt(e,e.return,ce)}}o&4&&e.stateNode!=null&&(f=e.memoizedProps,Xu(e,f,s!==null?s.memoizedProps:f)),o&1024&&(Ju=!0);break;case 6:if(gn(t,e),vn(e),o&4){if(e.stateNode===null)throw Error(l(162));o=e.memoizedProps,s=e.stateNode;try{s.nodeValue=o}catch(ce){tt(e,e.return,ce)}}break;case 3:if(Cr=null,f=Yn,Yn=Tr(t.containerInfo),gn(t,e),Yn=f,vn(e),o&4&&s!==null&&s.memoizedState.isDehydrated)try{Mi(t.containerInfo)}catch(ce){tt(e,e.return,ce)}Ju&&(Ju=!1,Cg(e));break;case 4:o=Yn,Yn=Tr(e.stateNode.containerInfo),gn(t,e),vn(e),Yn=o;break;case 12:gn(t,e),vn(e);break;case 31:gn(t,e),vn(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,cr(e,o)));break;case 13:gn(t,e),vn(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(dr=ne()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,cr(e,o)));break;case 22:f=e.memoizedState!==null;var N=s!==null&&s.memoizedState!==null,U=Ta,q=Ot;if(Ta=U||f,Ot=q||N,gn(t,e),Ot=q,Ta=U,vn(e),o&8192)e:for(t=e.stateNode,t._visibility=f?t._visibility&-2:t._visibility|1,f&&(s===null||N||Ta||Ot||Bs(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){N=s=t;try{if(h=N.stateNode,f)_=h.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{T=N.stateNode;var X=N.memoizedProps.style,P=X!=null&&X.hasOwnProperty("display")?X.display:null;T.style.display=P==null||typeof P=="boolean"?"":(""+P).trim()}}catch(ce){tt(N,N.return,ce)}}}else if(t.tag===6){if(s===null){N=t;try{N.stateNode.nodeValue=f?"":N.memoizedProps}catch(ce){tt(N,N.return,ce)}}}else if(t.tag===18){if(s===null){N=t;try{var $=N.stateNode;f?pv($,!0):pv(N.stateNode,!1)}catch(ce){tt(N,N.return,ce)}}}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,cr(e,s))));break;case 19:gn(t,e),vn(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,cr(e,o)));break;case 30:break;case 21:break;default:gn(t,e),vn(e)}}function vn(e){var t=e.flags;if(t&2){try{for(var s,o=e.return;o!==null;){if(gg(o)){s=o;break}o=o.return}if(s==null)throw Error(l(160));switch(s.tag){case 27:var f=s.stateNode,h=Qu(e);rr(e,h,f);break;case 5:var _=s.stateNode;s.flags&32&&(ti(_,""),s.flags&=-33);var T=Qu(e);rr(e,T,_);break;case 3:case 4:var N=s.stateNode.containerInfo,U=Qu(e);Wu(e,U,N);break;default:throw Error(l(161))}}catch(q){tt(e,e.return,q)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Cg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Cg(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ca(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)bg(e,t.alternate,t),t=t.sibling}function Bs(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),Bs(t);break;case 1:ta(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&pg(t,t.return,s),Bs(t);break;case 27:Uo(t.stateNode);case 26:case 5:ta(t,t.return),Bs(t);break;case 22:t.memoizedState===null&&Bs(t);break;case 30:Bs(t);break;default:Bs(t)}e=e.sibling}}function wa(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var o=t.alternate,f=e,h=t,_=h.flags;switch(h.tag){case 0:case 11:case 15:wa(f,h,s),No(4,h);break;case 1:if(wa(f,h,s),o=h,f=o.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(U){tt(o,o.return,U)}if(o=h,f=o.updateQueue,f!==null){var T=o.stateNode;try{var N=f.shared.hiddenCallbacks;if(N!==null)for(f.shared.hiddenCallbacks=null,f=0;f<N.length;f++)nm(N[f],T)}catch(U){tt(o,o.return,U)}}s&&_&64&&hg(h),jo(h,h.return);break;case 27:vg(h);case 26:case 5:wa(f,h,s),s&&o===null&&_&4&&mg(h),jo(h,h.return);break;case 12:wa(f,h,s);break;case 31:wa(f,h,s),s&&_&4&&Sg(f,h);break;case 13:wa(f,h,s),s&&_&4&&Tg(f,h);break;case 22:h.memoizedState===null&&wa(f,h,s),jo(h,h.return);break;case 30:break;default:wa(f,h,s)}t=t.sibling}}function ed(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&go(s))}function td(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&go(e))}function Kn(e,t,s,o){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)wg(e,t,s,o),t=t.sibling}function wg(e,t,s,o){var f=t.flags;switch(t.tag){case 0:case 11:case 15:Kn(e,t,s,o),f&2048&&No(9,t);break;case 1:Kn(e,t,s,o);break;case 3:Kn(e,t,s,o),f&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&go(e)));break;case 12:if(f&2048){Kn(e,t,s,o),e=t.stateNode;try{var h=t.memoizedProps,_=h.id,T=h.onPostCommit;typeof T=="function"&&T(_,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(N){tt(t,t.return,N)}}else Kn(e,t,s,o);break;case 31:Kn(e,t,s,o);break;case 13:Kn(e,t,s,o);break;case 23:break;case 22:h=t.stateNode,_=t.alternate,t.memoizedState!==null?h._visibility&2?Kn(e,t,s,o):Do(e,t):h._visibility&2?Kn(e,t,s,o):(h._visibility|=2,xi(e,t,s,o,(t.subtreeFlags&10256)!==0||!1)),f&2048&&ed(_,t);break;case 24:Kn(e,t,s,o),f&2048&&td(t.alternate,t);break;default:Kn(e,t,s,o)}}function xi(e,t,s,o,f){for(f=f&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var h=e,_=t,T=s,N=o,U=_.flags;switch(_.tag){case 0:case 11:case 15:xi(h,_,T,N,f),No(8,_);break;case 23:break;case 22:var q=_.stateNode;_.memoizedState!==null?q._visibility&2?xi(h,_,T,N,f):Do(h,_):(q._visibility|=2,xi(h,_,T,N,f)),f&&U&2048&&ed(_.alternate,_);break;case 24:xi(h,_,T,N,f),f&&U&2048&&td(_.alternate,_);break;default:xi(h,_,T,N,f)}t=t.sibling}}function Do(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,o=t,f=o.flags;switch(o.tag){case 22:Do(s,o),f&2048&&ed(o.alternate,o);break;case 24:Do(s,o),f&2048&&td(o.alternate,o);break;default:Do(s,o)}t=t.sibling}}var Mo=8192;function Si(e,t,s){if(e.subtreeFlags&Mo)for(e=e.child;e!==null;)Eg(e,t,s),e=e.sibling}function Eg(e,t,s){switch(e.tag){case 26:Si(e,t,s),e.flags&Mo&&e.memoizedState!==null&&S1(s,Yn,e.memoizedState,e.memoizedProps);break;case 5:Si(e,t,s);break;case 3:case 4:var o=Yn;Yn=Tr(e.stateNode.containerInfo),Si(e,t,s),Yn=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=Mo,Mo=16777216,Si(e,t,s),Mo=o):Si(e,t,s));break;default:Si(e,t,s)}}function Ag(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 Ro(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];Ft=o,jg(o,e)}Ag(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ng(e),e=e.sibling}function Ng(e){switch(e.tag){case 0:case 11:case 15:Ro(e),e.flags&2048&&Qa(9,e,e.return);break;case 3:Ro(e);break;case 12:Ro(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ur(e)):Ro(e);break;default:Ro(e)}}function ur(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];Ft=o,jg(o,e)}Ag(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Qa(8,t,t.return),ur(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,ur(t));break;default:ur(t)}e=e.sibling}}function jg(e,t){for(;Ft!==null;){var s=Ft;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:go(s.memoizedState.cache)}if(o=s.child,o!==null)o.return=s,Ft=o;else e:for(s=e;Ft!==null;){o=Ft;var f=o.sibling,h=o.return;if(_g(o),o===s){Ft=null;break e}if(f!==null){f.return=h,Ft=f;break e}Ft=h}}}var LS={getCacheForType:function(e){var t=Zt(Mt),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Zt(Mt).controller.signal}},zS=typeof WeakMap=="function"?WeakMap:Map,Ze=0,lt=null,Re=null,Ie=0,et=0,Cn=null,Wa=!1,Ti=!1,nd=!1,Ea=0,St=0,Ja=0,Os=0,ad=0,wn=0,ki=0,Bo=null,yn=null,sd=!1,dr=0,Dg=0,fr=1/0,hr=null,es=null,Ht=0,ts=null,Ci=null,Aa=0,id=0,od=null,Mg=null,Oo=0,ld=null;function En(){return(Ze&2)!==0&&Ie!==0?Ie&-Ie:H.T!==null?hd():Kh()}function Rg(){if(wn===0)if((Ie&536870912)===0||ze){var e=Ua;Ua<<=1,(Ua&3932160)===0&&(Ua=262144),wn=e}else wn=536870912;return e=Tn.current,e!==null&&(e.flags|=32),wn}function bn(e,t,s){(e===lt&&(et===2||et===9)||e.cancelPendingCommit!==null)&&(wi(e,0),ns(e,Ie,wn,!1)),fn(e,s),((Ze&2)===0||e!==lt)&&(e===lt&&((Ze&2)===0&&(Os|=s),St===4&&ns(e,Ie,wn,!1)),na(e))}function Bg(e,t,s){if((Ze&6)!==0)throw Error(l(327));var o=!s&&(t&127)===0&&(t&e.expiredLanes)===0||Te(e,t),f=o?HS(e,t):cd(e,t,!0),h=o;do{if(f===0){Ti&&!o&&ns(e,t,0,!1);break}else{if(s=e.current.alternate,h&&!US(s)){f=cd(e,t,!1),h=!1;continue}if(f===2){if(h=t,e.errorRecoveryDisabledLanes&h)var _=0;else _=e.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){t=_;e:{var T=e;f=Bo;var N=T.current.memoizedState.isDehydrated;if(N&&(wi(T,_).flags|=256),_=cd(T,_,!1),_!==2){if(nd&&!N){T.errorRecoveryDisabledLanes|=h,Os|=h,f=4;break e}h=yn,yn=f,h!==null&&(yn===null?yn=h:yn.push.apply(yn,h))}f=_}if(h=!1,f!==2)continue}}if(f===1){wi(e,0),ns(e,t,0,!0);break}e:{switch(o=e,h=f,h){case 0:case 1:throw Error(l(345));case 4:if((t&4194048)!==t)break;case 6:ns(o,t,wn,!Wa);break e;case 2:yn=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(f=dr+300-ne(),10<f)){if(ns(o,t,wn,!Wa),ot(o,0,!0)!==0)break e;Aa=t,o.timeoutHandle=dv(Og.bind(null,o,s,yn,hr,sd,t,wn,Os,ki,Wa,h,"Throttled",-0,0),f);break e}Og(o,s,yn,hr,sd,t,wn,Os,ki,Wa,h,null,-0,0)}}break}while(!0);na(e)}function Og(e,t,s,o,f,h,_,T,N,U,q,X,P,$){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:ha},Eg(t,h,X);var ce=(h&62914560)===h?dr-ne():(h&4194048)===h?Dg-ne():0;if(ce=T1(X,ce),ce!==null){Aa=h,e.cancelPendingCommit=ce(Pg.bind(null,e,t,h,s,o,f,_,T,N,q,X,null,P,$)),ns(e,h,_,!U);return}}Pg(e,t,h,s,o,f,_,T,N)}function US(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 f=s[o],h=f.getSnapshot;f=f.value;try{if(!xn(h(),f))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 ns(e,t,s,o){t&=~ad,t&=~Os,e.suspendedLanes|=t,e.pingedLanes&=~t,o&&(e.warmLanes|=t),o=e.expirationTimes;for(var f=t;0<f;){var h=31-Ge(f),_=1<<h;o[h]=-1,f&=~_}s!==0&&Fh(e,s,t)}function pr(){return(Ze&6)===0?(Io(0),!1):!0}function rd(){if(Re!==null){if(et===0)var e=Re.return;else e=Re,va=ws=null,ku(e),gi=null,yo=0,e=Re;for(;e!==null;)fg(e.alternate,e),e=e.return;Re=null}}function wi(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,i1(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),Aa=0,rd(),lt=e,Re=s=ma(e.current,null),Ie=t,et=0,Cn=null,Wa=!1,Ti=Te(e,t),nd=!1,ki=wn=ad=Os=Ja=St=0,yn=Bo=null,sd=!1,(t&8)!==0&&(t|=t&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=t;0<o;){var f=31-Ge(o),h=1<<f;t|=e[f],o&=~h}return Ea=t,Ol(),s}function Ig(e,t){Ee=null,H.H=wo,t===mi||t===Pl?(t=Wp(),et=3):t===fu?(t=Wp(),et=4):et=t===Vu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Cn=t,Re===null&&(St=1,ar(e,On(t,e.current)))}function Lg(){var e=Tn.current;return e===null?!0:(Ie&4194048)===Ie?Un===null:(Ie&62914560)===Ie||(Ie&536870912)!==0?e===Un:!1}function zg(){var e=H.H;return H.H=wo,e===null?wo:e}function Ug(){var e=H.A;return H.A=LS,e}function mr(){St=4,Wa||(Ie&4194048)!==Ie&&Tn.current!==null||(Ti=!0),(Ja&134217727)===0&&(Os&134217727)===0||lt===null||ns(lt,Ie,wn,!1)}function cd(e,t,s){var o=Ze;Ze|=2;var f=zg(),h=Ug();(lt!==e||Ie!==t)&&(hr=null,wi(e,t)),t=!1;var _=St;e:do try{if(et!==0&&Re!==null){var T=Re,N=Cn;switch(et){case 8:rd(),_=6;break e;case 3:case 2:case 9:case 6:Tn.current===null&&(t=!0);var U=et;if(et=0,Cn=null,Ei(e,T,N,U),s&&Ti){_=0;break e}break;default:U=et,et=0,Cn=null,Ei(e,T,N,U)}}VS(),_=St;break}catch(q){Ig(e,q)}while(!0);return t&&e.shellSuspendCounter++,va=ws=null,Ze=o,H.H=f,H.A=h,Re===null&&(lt=null,Ie=0,Ol()),_}function VS(){for(;Re!==null;)Vg(Re)}function HS(e,t){var s=Ze;Ze|=2;var o=zg(),f=Ug();lt!==e||Ie!==t?(hr=null,fr=ne()+500,wi(e,t)):Ti=Te(e,t);e:do try{if(et!==0&&Re!==null){t=Re;var h=Cn;t:switch(et){case 1:et=0,Cn=null,Ei(e,t,h,1);break;case 2:case 9:if(Xp(h)){et=0,Cn=null,Hg(t);break}t=function(){et!==2&&et!==9||lt!==e||(et=7),na(e)},h.then(t,t);break e;case 3:et=7;break e;case 4:et=5;break e;case 7:Xp(h)?(et=0,Cn=null,Hg(t)):(et=0,Cn=null,Ei(e,t,h,7));break;case 5:var _=null;switch(Re.tag){case 26:_=Re.memoizedState;case 5:case 27:var T=Re;if(_?wv(_):T.stateNode.complete){et=0,Cn=null;var N=T.sibling;if(N!==null)Re=N;else{var U=T.return;U!==null?(Re=U,gr(U)):Re=null}break t}}et=0,Cn=null,Ei(e,t,h,5);break;case 6:et=0,Cn=null,Ei(e,t,h,6);break;case 8:rd(),St=6;break e;default:throw Error(l(462))}}GS();break}catch(q){Ig(e,q)}while(!0);return va=ws=null,H.H=o,H.A=f,Ze=s,Re!==null?0:(lt=null,Ie=0,Ol(),St)}function GS(){for(;Re!==null&&!ys();)Vg(Re)}function Vg(e){var t=ug(e.alternate,e,Ea);e.memoizedProps=e.pendingProps,t===null?gr(e):Re=t}function Hg(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=sg(s,t,t.pendingProps,t.type,void 0,Ie);break;case 11:t=sg(s,t,t.pendingProps,t.type.render,t.ref,Ie);break;case 5:ku(t);default:fg(s,t),t=Re=Up(t,Ea),t=ug(s,t,Ea)}e.memoizedProps=e.pendingProps,t===null?gr(e):Re=t}function Ei(e,t,s,o){va=ws=null,ku(t),gi=null,yo=0;var f=t.return;try{if(jS(e,f,t,s,Ie)){St=1,ar(e,On(s,e.current)),Re=null;return}}catch(h){if(f!==null)throw Re=f,h;St=1,ar(e,On(s,e.current)),Re=null;return}t.flags&32768?(ze||o===1?e=!0:Ti||(Ie&536870912)!==0?e=!1:(Wa=e=!0,(o===2||o===9||o===3||o===6)&&(o=Tn.current,o!==null&&o.tag===13&&(o.flags|=16384))),Gg(t,e)):gr(t)}function gr(e){var t=e;do{if((t.flags&32768)!==0){Gg(t,Wa);return}e=t.return;var s=RS(t.alternate,t,Ea);if(s!==null){Re=s;return}if(t=t.sibling,t!==null){Re=t;return}Re=t=e}while(t!==null);St===0&&(St=5)}function Gg(e,t){do{var s=BS(e.alternate,e);if(s!==null){s.flags&=32767,Re=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){Re=e;return}Re=e=s}while(e!==null);St=6,Re=null}function Pg(e,t,s,o,f,h,_,T,N){e.cancelPendingCommit=null;do vr();while(Ht!==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|=Qc,to(e,s,h,_,T,N),e===lt&&(Re=lt=null,Ie=0),Ci=t,ts=e,Aa=s,id=h,od=f,Mg=o,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,qS(He,function(){return Kg(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||o){o=H.T,H.T=null,f=M.p,M.p=2,_=Ze,Ze|=4;try{OS(e,t,s)}finally{Ze=_,M.p=f,H.T=o}}Ht=1,$g(),Fg(),qg()}}function $g(){if(Ht===1){Ht=0;var e=ts,t=Ci,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=H.T,H.T=null;var o=M.p;M.p=2;var f=Ze;Ze|=4;try{kg(t,e);var h=xd,_=jp(e.containerInfo),T=h.focusedElem,N=h.selectionRange;if(_!==T&&T&&T.ownerDocument&&Np(T.ownerDocument.documentElement,T)){if(N!==null&&qc(T)){var U=N.start,q=N.end;if(q===void 0&&(q=U),"selectionStart"in T)T.selectionStart=U,T.selectionEnd=Math.min(q,T.value.length);else{var X=T.ownerDocument||document,P=X&&X.defaultView||window;if(P.getSelection){var $=P.getSelection(),ce=T.textContent.length,be=Math.min(N.start,ce),it=N.end===void 0?be:Math.min(N.end,ce);!$.extend&&be>it&&(_=it,it=be,be=_);var O=Ap(T,be),D=Ap(T,it);if(O&&D&&($.rangeCount!==1||$.anchorNode!==O.node||$.anchorOffset!==O.offset||$.focusNode!==D.node||$.focusOffset!==D.offset)){var z=X.createRange();z.setStart(O.node,O.offset),$.removeAllRanges(),be>it?($.addRange(z),$.extend(D.node,D.offset)):(z.setEnd(D.node,D.offset),$.addRange(z))}}}}for(X=[],$=T;$=$.parentNode;)$.nodeType===1&&X.push({element:$,left:$.scrollLeft,top:$.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<X.length;T++){var K=X[T];K.element.scrollLeft=K.left,K.element.scrollTop=K.top}}Nr=!!_d,xd=_d=null}finally{Ze=f,M.p=o,H.T=s}}e.current=t,Ht=2}}function Fg(){if(Ht===2){Ht=0;var e=ts,t=Ci,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=H.T,H.T=null;var o=M.p;M.p=2;var f=Ze;Ze|=4;try{bg(e,t.alternate,t)}finally{Ze=f,M.p=o,H.T=s}}Ht=3}}function qg(){if(Ht===4||Ht===3){Ht=0,Z();var e=ts,t=Ci,s=Aa,o=Mg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ht=5:(Ht=0,Ci=ts=null,Yg(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(es=null),Ec(s),t=t.stateNode,Pe&&typeof Pe.onCommitFiberRoot=="function")try{Pe.onCommitFiberRoot(ct,t,void 0,(t.current.flags&128)===128)}catch{}if(o!==null){t=H.T,f=M.p,M.p=2,H.T=null;try{for(var h=e.onRecoverableError,_=0;_<o.length;_++){var T=o[_];h(T.value,{componentStack:T.stack})}}finally{H.T=t,M.p=f}}(Aa&3)!==0&&vr(),na(e),f=e.pendingLanes,(s&261930)!==0&&(f&42)!==0?e===ld?Oo++:(Oo=0,ld=e):Oo=0,Io(0)}}function Yg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,go(t)))}function vr(){return $g(),Fg(),qg(),Kg()}function Kg(){if(Ht!==5)return!1;var e=ts,t=id;id=0;var s=Ec(Aa),o=H.T,f=M.p;try{M.p=32>s?32:s,H.T=null,s=od,od=null;var h=ts,_=Aa;if(Ht=0,Ci=ts=null,Aa=0,(Ze&6)!==0)throw Error(l(331));var T=Ze;if(Ze|=4,Ng(h.current),wg(h,h.current,_,s),Ze=T,Io(0,!1),Pe&&typeof Pe.onPostCommitFiberRoot=="function")try{Pe.onPostCommitFiberRoot(ct,h)}catch{}return!0}finally{M.p=f,H.T=o,Yg(e,t)}}function Zg(e,t,s){t=On(s,t),t=Uu(e.stateNode,t,2),e=Ka(e,t,2),e!==null&&(fn(e,2),na(e))}function tt(e,t,s){if(e.tag===3)Zg(e,e,s);else for(;t!==null;){if(t.tag===3){Zg(t,e,s);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(es===null||!es.has(o))){e=On(s,e),s=Xm(2),o=Ka(t,s,2),o!==null&&(Qm(s,o,t,e),fn(o,2),na(o));break}}t=t.return}}function ud(e,t,s){var o=e.pingCache;if(o===null){o=e.pingCache=new zS;var f=new Set;o.set(t,f)}else f=o.get(t),f===void 0&&(f=new Set,o.set(t,f));f.has(s)||(nd=!0,f.add(s),e=PS.bind(null,e,t,s),t.then(e,e))}function PS(e,t,s){var o=e.pingCache;o!==null&&o.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,lt===e&&(Ie&s)===s&&(St===4||St===3&&(Ie&62914560)===Ie&&300>ne()-dr?(Ze&2)===0&&wi(e,0):ad|=s,ki===Ie&&(ki=0)),na(e)}function Xg(e,t){t===0&&(t=re()),e=Ts(e,t),e!==null&&(fn(e,t),na(e))}function $S(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Xg(e,s)}function FS(e,t){var s=0;switch(e.tag){case 31:case 13:var o=e.stateNode,f=e.memoizedState;f!==null&&(s=f.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),Xg(e,s)}function qS(e,t){return Qn(e,t)}var yr=null,Ai=null,dd=!1,br=!1,fd=!1,as=0;function na(e){e!==Ai&&e.next===null&&(Ai===null?yr=Ai=e:Ai=Ai.next=e),br=!0,dd||(dd=!0,KS())}function Io(e,t){if(!fd&&br){fd=!0;do for(var s=!1,o=yr;o!==null;){if(e!==0){var f=o.pendingLanes;if(f===0)var h=0;else{var _=o.suspendedLanes,T=o.pingedLanes;h=(1<<31-Ge(42|e)+1)-1,h&=f&~(_&~T),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(s=!0,ev(o,h))}else h=Ie,h=ot(o,o===lt?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||Te(o,h)||(s=!0,ev(o,h));o=o.next}while(s);fd=!1}}function YS(){Qg()}function Qg(){br=dd=!1;var e=0;as!==0&&s1()&&(e=as);for(var t=ne(),s=null,o=yr;o!==null;){var f=o.next,h=Wg(o,t);h===0?(o.next=null,s===null?yr=f:s.next=f,f===null&&(Ai=s)):(s=o,(e!==0||(h&3)!==0)&&(br=!0)),o=f}Ht!==0&&Ht!==5||Io(e),as!==0&&(as=0)}function Wg(e,t){for(var s=e.suspendedLanes,o=e.pingedLanes,f=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var _=31-Ge(h),T=1<<_,N=f[_];N===-1?((T&s)===0||(T&o)!==0)&&(f[_]=Vt(T,t)):N<=t&&(e.expiredLanes|=T),h&=~T}if(t=lt,s=Ie,s=ot(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,s===0||e===t&&(et===2||et===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&dn(o),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Te(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(o!==null&&dn(o),Ec(s)){case 2:case 8:s=ye;break;case 32:s=He;break;case 268435456:s=mt;break;default:s=He}return o=Jg.bind(null,e),s=Qn(s,o),e.callbackPriority=t,e.callbackNode=s,t}return o!==null&&o!==null&&dn(o),e.callbackPriority=2,e.callbackNode=null,2}function Jg(e,t){if(Ht!==0&&Ht!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(vr()&&e.callbackNode!==s)return null;var o=Ie;return o=ot(e,e===lt?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(Bg(e,o,t),Wg(e,ne()),e.callbackNode!=null&&e.callbackNode===s?Jg.bind(null,e):null)}function ev(e,t){if(vr())return null;Bg(e,t,!0)}function KS(){o1(function(){(Ze&6)!==0?Qn(ke,YS):Qg()})}function hd(){if(as===0){var e=hi;e===0&&(e=Ut,Ut<<=1,(Ut&261888)===0&&(Ut=256)),as=e}return as}function tv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:El(""+e)}function nv(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 ZS(e,t,s,o,f){if(t==="submit"&&s&&s.stateNode===f){var h=tv((f[hn]||null).action),_=o.submitter;_&&(t=(t=_[hn]||null)?tv(t.formAction):_.getAttribute("formAction"),t!==null&&(h=t,_=null));var T=new Dl("action","action",null,o,f);e.push({event:T,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(as!==0){var N=_?nv(f,_):new FormData(f);Ru(s,{pending:!0,data:N,method:f.method,action:h},null,N)}}else typeof h=="function"&&(T.preventDefault(),N=_?nv(f,_):new FormData(f),Ru(s,{pending:!0,data:N,method:f.method,action:h},h,N))},currentTarget:f}]})}}for(var pd=0;pd<Xc.length;pd++){var md=Xc[pd],XS=md.toLowerCase(),QS=md[0].toUpperCase()+md.slice(1);qn(XS,"on"+QS)}qn(Rp,"onAnimationEnd"),qn(Bp,"onAnimationIteration"),qn(Op,"onAnimationStart"),qn("dblclick","onDoubleClick"),qn("focusin","onFocus"),qn("focusout","onBlur"),qn(hS,"onTransitionRun"),qn(pS,"onTransitionStart"),qn(mS,"onTransitionCancel"),qn(Ip,"onTransitionEnd"),Js("onMouseEnter",["mouseout","mouseover"]),Js("onMouseLeave",["mouseout","mouseover"]),Js("onPointerEnter",["pointerout","pointerover"]),Js("onPointerLeave",["pointerout","pointerover"]),bs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),bs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),bs("onBeforeInput",["compositionend","keypress","textInput","paste"]),bs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),bs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),bs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Lo="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(" "),WS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Lo));function av(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var o=e[s],f=o.event;o=o.listeners;e:{var h=void 0;if(t)for(var _=o.length-1;0<=_;_--){var T=o[_],N=T.instance,U=T.currentTarget;if(T=T.listener,N!==h&&f.isPropagationStopped())break e;h=T,f.currentTarget=U;try{h(f)}catch(q){Bl(q)}f.currentTarget=null,h=N}else for(_=0;_<o.length;_++){if(T=o[_],N=T.instance,U=T.currentTarget,T=T.listener,N!==h&&f.isPropagationStopped())break e;h=T,f.currentTarget=U;try{h(f)}catch(q){Bl(q)}f.currentTarget=null,h=N}}}}function Be(e,t){var s=t[Ac];s===void 0&&(s=t[Ac]=new Set);var o=e+"__bubble";s.has(o)||(sv(t,e,2,!1),s.add(o))}function gd(e,t,s){var o=0;t&&(o|=4),sv(s,e,o,t)}var _r="_reactListening"+Math.random().toString(36).slice(2);function vd(e){if(!e[_r]){e[_r]=!0,Qh.forEach(function(s){s!=="selectionchange"&&(WS.has(s)||gd(s,!1,e),gd(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[_r]||(t[_r]=!0,gd("selectionchange",!1,t))}}function sv(e,t,s,o){switch(Rv(t)){case 2:var f=w1;break;case 8:f=E1;break;default:f=Md}s=f.bind(null,t,s,e),f=void 0,!Lc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(f=!0),o?f!==void 0?e.addEventListener(t,s,{capture:!0,passive:f}):e.addEventListener(t,s,!0):f!==void 0?e.addEventListener(t,s,{passive:f}):e.addEventListener(t,s,!1)}function yd(e,t,s,o,f){var h=o;if((t&1)===0&&(t&2)===0&&o!==null)e:for(;;){if(o===null)return;var _=o.tag;if(_===3||_===4){var T=o.stateNode.containerInfo;if(T===f)break;if(_===4)for(_=o.return;_!==null;){var N=_.tag;if((N===3||N===4)&&_.stateNode.containerInfo===f)return;_=_.return}for(;T!==null;){if(_=Xs(T),_===null)return;if(N=_.tag,N===5||N===6||N===26||N===27){o=h=_;continue e}T=T.parentNode}}o=o.return}cp(function(){var U=h,q=Oc(s),X=[];e:{var P=Lp.get(e);if(P!==void 0){var $=Dl,ce=e;switch(e){case"keypress":if(Nl(s)===0)break e;case"keydown":case"keyup":$=Fx;break;case"focusin":ce="focus",$=Hc;break;case"focusout":ce="blur",$=Hc;break;case"beforeblur":case"afterblur":$=Hc;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":$=fp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":$=Rx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":$=Kx;break;case Rp:case Bp:case Op:$=Ix;break;case Ip:$=Xx;break;case"scroll":case"scrollend":$=Dx;break;case"wheel":$=Wx;break;case"copy":case"cut":case"paste":$=zx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":$=pp;break;case"toggle":case"beforetoggle":$=eS}var be=(t&4)!==0,it=!be&&(e==="scroll"||e==="scrollend"),O=be?P!==null?P+"Capture":null:P;be=[];for(var D=U,z;D!==null;){var K=D;if(z=K.stateNode,K=K.tag,K!==5&&K!==26&&K!==27||z===null||O===null||(K=so(D,O),K!=null&&be.push(zo(D,K,z))),it)break;D=D.return}0<be.length&&(P=new $(P,ce,null,s,q),X.push({event:P,listeners:be}))}}if((t&7)===0){e:{if(P=e==="mouseover"||e==="pointerover",$=e==="mouseout"||e==="pointerout",P&&s!==Bc&&(ce=s.relatedTarget||s.fromElement)&&(Xs(ce)||ce[Zs]))break e;if(($||P)&&(P=q.window===q?q:(P=q.ownerDocument)?P.defaultView||P.parentWindow:window,$?(ce=s.relatedTarget||s.toElement,$=U,ce=ce?Xs(ce):null,ce!==null&&(it=d(ce),be=ce.tag,ce!==it||be!==5&&be!==27&&be!==6)&&(ce=null)):($=null,ce=U),$!==ce)){if(be=fp,K="onMouseLeave",O="onMouseEnter",D="mouse",(e==="pointerout"||e==="pointerover")&&(be=pp,K="onPointerLeave",O="onPointerEnter",D="pointer"),it=$==null?P:ao($),z=ce==null?P:ao(ce),P=new be(K,D+"leave",$,s,q),P.target=it,P.relatedTarget=z,K=null,Xs(q)===U&&(be=new be(O,D+"enter",ce,s,q),be.target=z,be.relatedTarget=it,K=be),it=K,$&&ce)t:{for(be=JS,O=$,D=ce,z=0,K=O;K;K=be(K))z++;K=0;for(var ge=D;ge;ge=be(ge))K++;for(;0<z-K;)O=be(O),z--;for(;0<K-z;)D=be(D),K--;for(;z--;){if(O===D||D!==null&&O===D.alternate){be=O;break t}O=be(O),D=be(D)}be=null}else be=null;$!==null&&iv(X,P,$,be,!1),ce!==null&&it!==null&&iv(X,it,ce,be,!0)}}e:{if(P=U?ao(U):window,$=P.nodeName&&P.nodeName.toLowerCase(),$==="select"||$==="input"&&P.type==="file")var $e=Sp;else if(_p(P))if(Tp)$e=uS;else{$e=rS;var he=lS}else $=P.nodeName,!$||$.toLowerCase()!=="input"||P.type!=="checkbox"&&P.type!=="radio"?U&&Rc(U.elementType)&&($e=Sp):$e=cS;if($e&&($e=$e(e,U))){xp(X,$e,s,q);break e}he&&he(e,P,U),e==="focusout"&&U&&P.type==="number"&&U.memoizedProps.value!=null&&Mc(P,"number",P.value)}switch(he=U?ao(U):window,e){case"focusin":(_p(he)||he.contentEditable==="true")&&(ii=he,Yc=U,ho=null);break;case"focusout":ho=Yc=ii=null;break;case"mousedown":Kc=!0;break;case"contextmenu":case"mouseup":case"dragend":Kc=!1,Dp(X,s,q);break;case"selectionchange":if(fS)break;case"keydown":case"keyup":Dp(X,s,q)}var Ae;if(Pc)e:{switch(e){case"compositionstart":var Le="onCompositionStart";break e;case"compositionend":Le="onCompositionEnd";break e;case"compositionupdate":Le="onCompositionUpdate";break e}Le=void 0}else si?yp(e,s)&&(Le="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Le="onCompositionStart");Le&&(mp&&s.locale!=="ko"&&(si||Le!=="onCompositionStart"?Le==="onCompositionEnd"&&si&&(Ae=up()):(Ha=q,zc="value"in Ha?Ha.value:Ha.textContent,si=!0)),he=xr(U,Le),0<he.length&&(Le=new hp(Le,e,null,s,q),X.push({event:Le,listeners:he}),Ae?Le.data=Ae:(Ae=bp(s),Ae!==null&&(Le.data=Ae)))),(Ae=nS?aS(e,s):sS(e,s))&&(Le=xr(U,"onBeforeInput"),0<Le.length&&(he=new hp("onBeforeInput","beforeinput",null,s,q),X.push({event:he,listeners:Le}),he.data=Ae)),ZS(X,e,U,s,q)}av(X,t)})}function zo(e,t,s){return{instance:e,listener:t,currentTarget:s}}function xr(e,t){for(var s=t+"Capture",o=[];e!==null;){var f=e,h=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||h===null||(f=so(e,s),f!=null&&o.unshift(zo(e,f,h)),f=so(e,t),f!=null&&o.push(zo(e,f,h))),e.tag===3)return o;e=e.return}return[]}function JS(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function iv(e,t,s,o,f){for(var h=t._reactName,_=[];s!==null&&s!==o;){var T=s,N=T.alternate,U=T.stateNode;if(T=T.tag,N!==null&&N===o)break;T!==5&&T!==26&&T!==27||U===null||(N=U,f?(U=so(s,h),U!=null&&_.unshift(zo(s,U,N))):f||(U=so(s,h),U!=null&&_.push(zo(s,U,N)))),s=s.return}_.length!==0&&e.push({event:t,listeners:_})}var e1=/\r\n?/g,t1=/\u0000|\uFFFD/g;function ov(e){return(typeof e=="string"?e:""+e).replace(e1,`
|
|
25
|
-
`).replace(t1,"")}function lv(e,t){return t=ov(t),ov(e)===t}function st(e,t,s,o,f,h){switch(s){case"children":typeof o=="string"?t==="body"||t==="textarea"&&o===""||ti(e,o):(typeof o=="number"||typeof o=="bigint")&&t!=="body"&&ti(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":lp(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"&&st(e,t,"name",f.name,f,null),st(e,t,"formEncType",f.formEncType,f,null),st(e,t,"formMethod",f.formMethod,f,null),st(e,t,"formTarget",f.formTarget,f,null)):(st(e,t,"encType",f.encType,f,null),st(e,t,"method",f.method,f,null),st(e,t,"target",f.target,f,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=ha);break;case"onScroll":o!=null&&Be("scroll",e);break;case"onScrollEnd":o!=null&&Be("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(f.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":Be("beforetoggle",e),Be("toggle",e),kl(e,"popover",o);break;case"xlinkActuate":fa(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":fa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":fa(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":fa(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":fa(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":fa(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":fa(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":fa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":fa(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":kl(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=Nx.get(s)||s,kl(e,s,o))}}function bd(e,t,s,o,f,h){switch(s){case"style":lp(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(f.children!=null)throw Error(l(60));e.innerHTML=s}}break;case"children":typeof o=="string"?ti(e,o):(typeof o=="number"||typeof o=="bigint")&&ti(e,""+o);break;case"onScroll":o!=null&&Be("scroll",e);break;case"onScrollEnd":o!=null&&Be("scrollend",e);break;case"onClick":o!=null&&(e.onclick=ha);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Wh.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(f=s.endsWith("Capture"),t=s.slice(2,f?s.length-7:void 0),h=e[hn]||null,h=h!=null?h[s]:null,typeof h=="function"&&e.removeEventListener(t,h,f),typeof o=="function")){typeof h!="function"&&h!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,o,f);break e}s in e?e[s]=o:o===!0?e.setAttribute(s,""):kl(e,s,o)}}}function Qt(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Be("error",e),Be("load",e);var o=!1,f=!1,h;for(h in s)if(s.hasOwnProperty(h)){var _=s[h];if(_!=null)switch(h){case"src":o=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:st(e,t,h,_,s,null)}}f&&st(e,t,"srcSet",s.srcSet,s,null),o&&st(e,t,"src",s.src,s,null);return;case"input":Be("invalid",e);var T=h=_=f=null,N=null,U=null;for(o in s)if(s.hasOwnProperty(o)){var q=s[o];if(q!=null)switch(o){case"name":f=q;break;case"type":_=q;break;case"checked":N=q;break;case"defaultChecked":U=q;break;case"value":h=q;break;case"defaultValue":T=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(l(137,t));break;default:st(e,t,o,q,s,null)}}ap(e,h,T,N,U,_,f,!1);return;case"select":Be("invalid",e),o=_=h=null;for(f in s)if(s.hasOwnProperty(f)&&(T=s[f],T!=null))switch(f){case"value":h=T;break;case"defaultValue":_=T;break;case"multiple":o=T;default:st(e,t,f,T,s,null)}t=h,s=_,e.multiple=!!o,t!=null?ei(e,!!o,t,!1):s!=null&&ei(e,!!o,s,!0);return;case"textarea":Be("invalid",e),h=f=o=null;for(_ in s)if(s.hasOwnProperty(_)&&(T=s[_],T!=null))switch(_){case"value":o=T;break;case"defaultValue":f=T;break;case"children":h=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(l(91));break;default:st(e,t,_,T,s,null)}ip(e,o,f,h);return;case"option":for(N in s)if(s.hasOwnProperty(N)&&(o=s[N],o!=null))switch(N){case"selected":e.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:st(e,t,N,o,s,null)}return;case"dialog":Be("beforetoggle",e),Be("toggle",e),Be("cancel",e),Be("close",e);break;case"iframe":case"object":Be("load",e);break;case"video":case"audio":for(o=0;o<Lo.length;o++)Be(Lo[o],e);break;case"image":Be("error",e),Be("load",e);break;case"details":Be("toggle",e);break;case"embed":case"source":case"link":Be("error",e),Be("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(U in s)if(s.hasOwnProperty(U)&&(o=s[U],o!=null))switch(U){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:st(e,t,U,o,s,null)}return;default:if(Rc(t)){for(q in s)s.hasOwnProperty(q)&&(o=s[q],o!==void 0&&bd(e,t,q,o,s,void 0));return}}for(T in s)s.hasOwnProperty(T)&&(o=s[T],o!=null&&st(e,t,T,o,s,null))}function n1(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 f=null,h=null,_=null,T=null,N=null,U=null,q=null;for($ in s){var X=s[$];if(s.hasOwnProperty($)&&X!=null)switch($){case"checked":break;case"value":break;case"defaultValue":N=X;default:o.hasOwnProperty($)||st(e,t,$,null,o,X)}}for(var P in o){var $=o[P];if(X=s[P],o.hasOwnProperty(P)&&($!=null||X!=null))switch(P){case"type":h=$;break;case"name":f=$;break;case"checked":U=$;break;case"defaultChecked":q=$;break;case"value":_=$;break;case"defaultValue":T=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(l(137,t));break;default:$!==X&&st(e,t,P,$,o,X)}}Dc(e,_,T,N,U,q,h,f);return;case"select":$=_=T=P=null;for(h in s)if(N=s[h],s.hasOwnProperty(h)&&N!=null)switch(h){case"value":break;case"multiple":$=N;default:o.hasOwnProperty(h)||st(e,t,h,null,o,N)}for(f in o)if(h=o[f],N=s[f],o.hasOwnProperty(f)&&(h!=null||N!=null))switch(f){case"value":P=h;break;case"defaultValue":T=h;break;case"multiple":_=h;default:h!==N&&st(e,t,f,h,o,N)}t=T,s=_,o=$,P!=null?ei(e,!!s,P,!1):!!o!=!!s&&(t!=null?ei(e,!!s,t,!0):ei(e,!!s,s?[]:"",!1));return;case"textarea":$=P=null;for(T in s)if(f=s[T],s.hasOwnProperty(T)&&f!=null&&!o.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:st(e,t,T,null,o,f)}for(_ in o)if(f=o[_],h=s[_],o.hasOwnProperty(_)&&(f!=null||h!=null))switch(_){case"value":P=f;break;case"defaultValue":$=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(l(91));break;default:f!==h&&st(e,t,_,f,o,h)}sp(e,P,$);return;case"option":for(var ce in s)if(P=s[ce],s.hasOwnProperty(ce)&&P!=null&&!o.hasOwnProperty(ce))switch(ce){case"selected":e.selected=!1;break;default:st(e,t,ce,null,o,P)}for(N in o)if(P=o[N],$=s[N],o.hasOwnProperty(N)&&P!==$&&(P!=null||$!=null))switch(N){case"selected":e.selected=P&&typeof P!="function"&&typeof P!="symbol";break;default:st(e,t,N,P,o,$)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var be in s)P=s[be],s.hasOwnProperty(be)&&P!=null&&!o.hasOwnProperty(be)&&st(e,t,be,null,o,P);for(U in o)if(P=o[U],$=s[U],o.hasOwnProperty(U)&&P!==$&&(P!=null||$!=null))switch(U){case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(l(137,t));break;default:st(e,t,U,P,o,$)}return;default:if(Rc(t)){for(var it in s)P=s[it],s.hasOwnProperty(it)&&P!==void 0&&!o.hasOwnProperty(it)&&bd(e,t,it,void 0,o,P);for(q in o)P=o[q],$=s[q],!o.hasOwnProperty(q)||P===$||P===void 0&&$===void 0||bd(e,t,q,P,o,$);return}}for(var O in s)P=s[O],s.hasOwnProperty(O)&&P!=null&&!o.hasOwnProperty(O)&&st(e,t,O,null,o,P);for(X in o)P=o[X],$=s[X],!o.hasOwnProperty(X)||P===$||P==null&&$==null||st(e,t,X,P,o,$)}function rv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function a1(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),o=0;o<s.length;o++){var f=s[o],h=f.transferSize,_=f.initiatorType,T=f.duration;if(h&&T&&rv(_)){for(_=0,T=f.responseEnd,o+=1;o<s.length;o++){var N=s[o],U=N.startTime;if(U>T)break;var q=N.transferSize,X=N.initiatorType;q&&rv(X)&&(N=N.responseEnd,_+=q*(N<T?1:(T-U)/(N-U)))}if(--o,t+=8*(h+_)/(f.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 _d=null,xd=null;function Sr(e){return e.nodeType===9?e:e.ownerDocument}function cv(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 uv(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 Sd(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Td=null;function s1(){var e=window.event;return e&&e.type==="popstate"?e===Td?!1:(Td=e,!0):(Td=null,!1)}var dv=typeof setTimeout=="function"?setTimeout:void 0,i1=typeof clearTimeout=="function"?clearTimeout:void 0,fv=typeof Promise=="function"?Promise:void 0,o1=typeof queueMicrotask=="function"?queueMicrotask:typeof fv<"u"?function(e){return fv.resolve(null).then(e).catch(l1)}:dv;function l1(e){setTimeout(function(){throw e})}function ss(e){return e==="head"}function hv(e,t){var s=t,o=0;do{var f=s.nextSibling;if(e.removeChild(s),f&&f.nodeType===8)if(s=f.data,s==="/$"||s==="/&"){if(o===0){e.removeChild(f),Mi(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 _=h.nextSibling,T=h.nodeName;h[no]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&h.rel.toLowerCase()==="stylesheet"||s.removeChild(h),h=_}}else s==="body"&&Uo(e.ownerDocument.body);s=f}while(s);Mi(t)}function pv(e,t){var s=e;e=0;do{var o=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),o&&o.nodeType===8)if(s=o.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=o}while(s)}function kd(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":kd(s),Nc(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function r1(e,t,s,o){for(;e.nodeType===1;){var f=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!==f.rel||e.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||e.getAttribute("title")!==(f.title==null?null:f.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(f.src==null?null:f.src)||e.getAttribute("type")!==(f.type==null?null:f.type)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var h=f.name==null?null:""+f.name;if(f.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=Vn(e.nextSibling),e===null)break}return null}function c1(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=Vn(e.nextSibling),e===null))return null;return e}function mv(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Vn(e.nextSibling),e===null))return null;return e}function Cd(e){return e.data==="$?"||e.data==="$~"}function wd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function u1(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 Vn(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 Ed=null;function gv(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return Vn(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function vv(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 yv(e,t,s){switch(t=Sr(s),e){case"html":if(e=t.documentElement,!e)throw Error(l(452));return e;case"head":if(e=t.head,!e)throw Error(l(453));return e;case"body":if(e=t.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function Uo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Nc(e)}var Hn=new Map,bv=new Set;function Tr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Na=M.d;M.d={f:d1,r:f1,D:h1,C:p1,L:m1,m:g1,X:y1,S:v1,M:b1};function d1(){var e=Na.f(),t=pr();return e||t}function f1(e){var t=Qs(e);t!==null&&t.tag===5&&t.type==="form"?Im(t):Na.r(e)}var Ni=typeof document>"u"?null:document;function _v(e,t,s){var o=Ni;if(o&&typeof t=="string"&&t){var f=Rn(t);f='link[rel="'+e+'"][href="'+f+'"]',typeof s=="string"&&(f+='[crossorigin="'+s+'"]'),bv.has(f)||(bv.add(f),e={rel:e,crossOrigin:s,href:t},o.querySelector(f)===null&&(t=o.createElement("link"),Qt(t,"link",e),$t(t),o.head.appendChild(t)))}}function h1(e){Na.D(e),_v("dns-prefetch",e,null)}function p1(e,t){Na.C(e,t),_v("preconnect",e,t)}function m1(e,t,s){Na.L(e,t,s);var o=Ni;if(o&&e&&t){var f='link[rel="preload"][as="'+Rn(t)+'"]';t==="image"&&s&&s.imageSrcSet?(f+='[imagesrcset="'+Rn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(f+='[imagesizes="'+Rn(s.imageSizes)+'"]')):f+='[href="'+Rn(e)+'"]';var h=f;switch(t){case"style":h=ji(e);break;case"script":h=Di(e)}Hn.has(h)||(e=v({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),Hn.set(h,e),o.querySelector(f)!==null||t==="style"&&o.querySelector(Vo(h))||t==="script"&&o.querySelector(Ho(h))||(t=o.createElement("link"),Qt(t,"link",e),$t(t),o.head.appendChild(t)))}}function g1(e,t){Na.m(e,t);var s=Ni;if(s&&e){var o=t&&typeof t.as=="string"?t.as:"script",f='link[rel="modulepreload"][as="'+Rn(o)+'"][href="'+Rn(e)+'"]',h=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Di(e)}if(!Hn.has(h)&&(e=v({rel:"modulepreload",href:e},t),Hn.set(h,e),s.querySelector(f)===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"),Qt(o,"link",e),$t(o),s.head.appendChild(o)}}}function v1(e,t,s){Na.S(e,t,s);var o=Ni;if(o&&e){var f=Ws(o).hoistableStyles,h=ji(e);t=t||"default";var _=f.get(h);if(!_){var T={loading:0,preload:null};if(_=o.querySelector(Vo(h)))T.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},s),(s=Hn.get(h))&&Ad(e,s);var N=_=o.createElement("link");$t(N),Qt(N,"link",e),N._p=new Promise(function(U,q){N.onload=U,N.onerror=q}),N.addEventListener("load",function(){T.loading|=1}),N.addEventListener("error",function(){T.loading|=2}),T.loading|=4,kr(_,t,o)}_={type:"stylesheet",instance:_,count:1,state:T},f.set(h,_)}}}function y1(e,t){Na.X(e,t);var s=Ni;if(s&&e){var o=Ws(s).hoistableScripts,f=Di(e),h=o.get(f);h||(h=s.querySelector(Ho(f)),h||(e=v({src:e,async:!0},t),(t=Hn.get(f))&&Nd(e,t),h=s.createElement("script"),$t(h),Qt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function b1(e,t){Na.M(e,t);var s=Ni;if(s&&e){var o=Ws(s).hoistableScripts,f=Di(e),h=o.get(f);h||(h=s.querySelector(Ho(f)),h||(e=v({src:e,async:!0,type:"module"},t),(t=Hn.get(f))&&Nd(e,t),h=s.createElement("script"),$t(h),Qt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function xv(e,t,s,o){var f=(f=Ct.current)?Tr(f):null;if(!f)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=ji(s.href),s=Ws(f).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=ji(s.href);var h=Ws(f).hoistableStyles,_=h.get(e);if(_||(f=f.ownerDocument||f,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,_),(h=f.querySelector(Vo(e)))&&!h._p&&(_.instance=h,_.state.loading=5),Hn.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},Hn.set(e,s),h||_1(f,e,s,_.state))),t&&o===null)throw Error(l(528,""));return _}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=Di(s),s=Ws(f).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 ji(e){return'href="'+Rn(e)+'"'}function Vo(e){return'link[rel="stylesheet"]['+e+"]"}function Sv(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function _1(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}),Qt(t,"link",s),$t(t),e.head.appendChild(t))}function Di(e){return'[src="'+Rn(e)+'"]'}function Ho(e){return"script[async]"+e}function Tv(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var o=e.querySelector('style[data-href~="'+Rn(s.href)+'"]');if(o)return t.instance=o,$t(o),o;var f=v({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),$t(o),Qt(o,"style",f),kr(o,s.precedence,e),t.instance=o;case"stylesheet":f=ji(s.href);var h=e.querySelector(Vo(f));if(h)return t.state.loading|=4,t.instance=h,$t(h),h;o=Sv(s),(f=Hn.get(f))&&Ad(o,f),h=(e.ownerDocument||e).createElement("link"),$t(h);var _=h;return _._p=new Promise(function(T,N){_.onload=T,_.onerror=N}),Qt(h,"link",o),t.state.loading|=4,kr(h,s.precedence,e),t.instance=h;case"script":return h=Di(s.src),(f=e.querySelector(Ho(h)))?(t.instance=f,$t(f),f):(o=s,(f=Hn.get(h))&&(o=v({},s),Nd(o,f)),e=e.ownerDocument||e,f=e.createElement("script"),$t(f),Qt(f,"link",o),e.head.appendChild(f),t.instance=f);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,kr(o,s.precedence,e));return t.instance}function kr(e,t,s){for(var o=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=o.length?o[o.length-1]:null,h=f,_=0;_<o.length;_++){var T=o[_];if(T.dataset.precedence===t)h=T;else if(h!==f)break}h?h.parentNode.insertBefore(e,h.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function Ad(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Nd(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 kv(e,t,s){if(Cr===null){var o=new Map,f=Cr=new Map;f.set(s,o)}else f=Cr,o=f.get(s),o||(o=new Map,f.set(s,o));if(o.has(e))return o;for(o.set(e,null),s=s.getElementsByTagName(e),f=0;f<s.length;f++){var h=s[f];if(!(h[no]||h[Yt]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var _=h.getAttribute(t)||"";_=e+_;var T=o.get(_);T?T.push(h):o.set(_,[h])}}return o}function Cv(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function x1(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 wv(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function S1(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 f=ji(o.href),h=t.querySelector(Vo(f));if(h){t=h._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=wr.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=h,$t(h);return}h=t.ownerDocument||t,o=Sv(o),(f=Hn.get(f))&&Ad(o,f),h=h.createElement("link"),$t(h);var _=h;_._p=new Promise(function(T,N){_.onload=T,_.onerror=N}),Qt(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=wr.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var jd=0;function T1(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&&jd===0&&(jd=62500*a1());var f=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>jd?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function wr(){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(k1,e),Er=null,wr.call(e))}function k1(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 f=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<f.length;h++){var _=f[h];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(s.set(_.dataset.precedence,_),o=_)}o&&s.set(null,o)}f=t.instance,_=f.getAttribute("data-precedence"),h=s.get(_)||o,h===o&&s.set(null,f),s.set(_,f),this.count++,o=wr.bind(this),f.addEventListener("load",o),f.addEventListener("error",o),h?h.parentNode.insertBefore(f,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(f,e.firstChild)),t.state.loading|=4}}var Go={$$typeof:j,Provider:null,Consumer:null,_currentValue:J,_currentValue2:J,_threadCount:0};function C1(e,t,s,o,f,h,_,T,N){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=Ne(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ne(0),this.hiddenUpdates=Ne(null),this.identifierPrefix=o,this.onUncaughtError=f,this.onCaughtError=h,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=N,this.incompleteTransitions=new Map}function Ev(e,t,s,o,f,h,_,T,N,U,q,X){return e=new C1(e,t,s,_,N,U,q,X,T),t=1,h===!0&&(t|=24),h=Sn(3,null,null,t),e.current=h,h.stateNode=e,t=cu(),t.refCount++,e.pooledCache=t,t.refCount++,h.memoizedState={element:o,isDehydrated:s,cache:t},hu(h),e}function Av(e){return e?(e=ri,e):ri}function Nv(e,t,s,o,f,h){f=Av(f),o.context===null?o.context=f:o.pendingContext=f,o=Ya(t),o.payload={element:s},h=h===void 0?null:h,h!==null&&(o.callback=h),s=Ka(e,o,t),s!==null&&(bn(s,e,t),_o(s,e,t))}function jv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Dd(e,t){jv(e,t),(e=e.alternate)&&jv(e,t)}function Dv(e){if(e.tag===13||e.tag===31){var t=Ts(e,67108864);t!==null&&bn(t,e,67108864),Dd(e,67108864)}}function Mv(e){if(e.tag===13||e.tag===31){var t=En();t=wc(t);var s=Ts(e,t);s!==null&&bn(s,e,t),Dd(e,t)}}var Nr=!0;function w1(e,t,s,o){var f=H.T;H.T=null;var h=M.p;try{M.p=2,Md(e,t,s,o)}finally{M.p=h,H.T=f}}function E1(e,t,s,o){var f=H.T;H.T=null;var h=M.p;try{M.p=8,Md(e,t,s,o)}finally{M.p=h,H.T=f}}function Md(e,t,s,o){if(Nr){var f=Rd(o);if(f===null)yd(e,t,o,jr,s),Bv(e,o);else if(N1(f,e,t,s,o))o.stopPropagation();else if(Bv(e,o),t&4&&-1<A1.indexOf(e)){for(;f!==null;){var h=Qs(f);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var _=Wn(h.pendingLanes);if(_!==0){var T=h;for(T.pendingLanes|=2,T.entangledLanes|=2;_;){var N=1<<31-Ge(_);T.entanglements[1]|=N,_&=~N}na(h),(Ze&6)===0&&(fr=ne()+500,Io(0))}}break;case 31:case 13:T=Ts(h,2),T!==null&&bn(T,h,2),pr(),Dd(h,2)}if(h=Rd(o),h===null&&yd(e,t,o,jr,s),h===f)break;f=h}f!==null&&o.stopPropagation()}else yd(e,t,o,null,s)}}function Rd(e){return e=Oc(e),Bd(e)}var jr=null;function Bd(e){if(jr=null,e=Xs(e),e!==null){var t=d(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=u(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 jr=e,null}function Rv(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(ue()){case ke:return 2;case ye:return 8;case He:case we:return 32;case mt:return 268435456;default:return 32}default:return 32}}var Od=!1,is=null,os=null,ls=null,Po=new Map,$o=new Map,rs=[],A1="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 Bv(e,t){switch(e){case"focusin":case"focusout":is=null;break;case"dragenter":case"dragleave":os=null;break;case"mouseover":case"mouseout":ls=null;break;case"pointerover":case"pointerout":Po.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":$o.delete(t.pointerId)}}function Fo(e,t,s,o,f,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:s,eventSystemFlags:o,nativeEvent:h,targetContainers:[f]},t!==null&&(t=Qs(t),t!==null&&Dv(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,f!==null&&t.indexOf(f)===-1&&t.push(f),e)}function N1(e,t,s,o,f){switch(t){case"focusin":return is=Fo(is,e,t,s,o,f),!0;case"dragenter":return os=Fo(os,e,t,s,o,f),!0;case"mouseover":return ls=Fo(ls,e,t,s,o,f),!0;case"pointerover":var h=f.pointerId;return Po.set(h,Fo(Po.get(h)||null,e,t,s,o,f)),!0;case"gotpointercapture":return h=f.pointerId,$o.set(h,Fo($o.get(h)||null,e,t,s,o,f)),!0}return!1}function Ov(e){var t=Xs(e.target);if(t!==null){var s=d(t);if(s!==null){if(t=s.tag,t===13){if(t=u(s),t!==null){e.blockedOn=t,Zh(e.priority,function(){Mv(s)});return}}else if(t===31){if(t=p(s),t!==null){e.blockedOn=t,Zh(e.priority,function(){Mv(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 Dr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Rd(e.nativeEvent);if(s===null){s=e.nativeEvent;var o=new s.constructor(s.type,s);Bc=o,s.target.dispatchEvent(o),Bc=null}else return t=Qs(s),t!==null&&Dv(t),e.blockedOn=s,!1;t.shift()}return!0}function Iv(e,t,s){Dr(e)&&s.delete(t)}function j1(){Od=!1,is!==null&&Dr(is)&&(is=null),os!==null&&Dr(os)&&(os=null),ls!==null&&Dr(ls)&&(ls=null),Po.forEach(Iv),$o.forEach(Iv)}function Mr(e,t){e.blockedOn===t&&(e.blockedOn=null,Od||(Od=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,j1)))}var Rr=null;function Lv(e){Rr!==e&&(Rr=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Rr===e&&(Rr=null);for(var t=0;t<e.length;t+=3){var s=e[t],o=e[t+1],f=e[t+2];if(typeof o!="function"){if(Bd(o||s)===null)continue;break}var h=Qs(s);h!==null&&(e.splice(t,3),t-=3,Ru(h,{pending:!0,data:f,method:s.method,action:o},o,f))}}))}function Mi(e){function t(N){return Mr(N,e)}is!==null&&Mr(is,e),os!==null&&Mr(os,e),ls!==null&&Mr(ls,e),Po.forEach(t),$o.forEach(t);for(var s=0;s<rs.length;s++){var o=rs[s];o.blockedOn===e&&(o.blockedOn=null)}for(;0<rs.length&&(s=rs[0],s.blockedOn===null);)Ov(s),s.blockedOn===null&&rs.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(o=0;o<s.length;o+=3){var f=s[o],h=s[o+1],_=f[hn]||null;if(typeof h=="function")_||Lv(s);else if(_){var T=null;if(h&&h.hasAttribute("formAction")){if(f=h,_=h[hn]||null)T=_.formAction;else if(Bd(f)!==null)continue}else T=_.action;typeof T=="function"?s[o+1]=T:(s.splice(o,3),o-=3),Lv(s)}}}function zv(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(_){return f=_})},focusReset:"manual",scroll:"manual"})}function t(){f!==null&&(f(),f=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,f=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),f!==null&&(f(),f=null)}}}function Id(e){this._internalRoot=e}Br.prototype.render=Id.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));var s=t.current,o=En();Nv(s,o,e,t,null,null)},Br.prototype.unmount=Id.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Nv(e.current,2,null,e,null,null),pr(),t[Zs]=null}};function Br(e){this._internalRoot=e}Br.prototype.unstable_scheduleHydration=function(e){if(e){var t=Kh();e={blockedOn:null,target:e,priority:t};for(var s=0;s<rs.length&&t!==0&&t<rs[s].priority;s++);rs.splice(s,0,e),s===0&&Ov(e)}};var Uv=a.version;if(Uv!=="19.2.4")throw Error(l(527,Uv,"19.2.4"));M.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=g(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var D1={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Or=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Or.isDisabled&&Or.supportsFiber)try{ct=Or.inject(D1),Pe=Or}catch{}}return qo.createRoot=function(e,t){if(!r(e))throw Error(l(299));var s=!1,o="",f=qm,h=Ym,_=Km;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onUncaughtError!==void 0&&(f=t.onUncaughtError),t.onCaughtError!==void 0&&(h=t.onCaughtError),t.onRecoverableError!==void 0&&(_=t.onRecoverableError)),t=Ev(e,1,!1,null,null,s,o,null,f,h,_,zv),e[Zs]=t.current,vd(e),new Id(t)},qo.hydrateRoot=function(e,t,s){if(!r(e))throw Error(l(299));var o=!1,f="",h=qm,_=Ym,T=Km,N=null;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(f=s.identifierPrefix),s.onUncaughtError!==void 0&&(h=s.onUncaughtError),s.onCaughtError!==void 0&&(_=s.onCaughtError),s.onRecoverableError!==void 0&&(T=s.onRecoverableError),s.formState!==void 0&&(N=s.formState)),t=Ev(e,1,!0,t,s??null,o,f,N,h,_,T,zv),t.context=Av(null),s=t.current,o=En(),o=wc(o),f=Ya(o),f.callback=null,Ka(s,f,o),s=o,t.current.lanes=s,fn(t,s),na(t),e[Zs]=t.current,vd(e),new Br(t)},qo.version="19.2.4",qo}var qv;function Y1(){if(qv)return Ld.exports;qv=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(),Ld.exports=q1(),Ld.exports}var K1=Y1();function rn(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function cl(n,a){return console.warn(`[ws] Malformed "${n}" message: ${a}`),!1}function Z1(n){return rn(n)&&typeof n.id=="string"&&typeof n.type=="string"&&typeof n.timestamp=="string"&&rn(n.payload)}function X1(n){return rn(n)&&typeof n.id=="string"&&typeof n.displayName=="string"&&typeof n.adapterType=="string"&&typeof n.status=="string"&&typeof n.bootstrapped=="boolean"}function Yv(n){return rn(n)&&typeof n.id=="string"&&typeof n.environmentId=="string"&&typeof n.runtime=="string"&&typeof n.status=="string"&&typeof n.prompt=="string"&&typeof n.startedAt=="string"&&(n.endedAt===void 0||typeof n.endedAt=="string")&&(n.error===void 0||typeof n.error=="string")}function Kv(n){return rn(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")}function Q1(n){return rn(n)&&typeof n.id=="string"&&typeof n.name=="string"&&typeof n.description=="string"&&typeof n.repoUrl=="string"&&typeof n.environmentId=="string"&&typeof n.status=="string"&&typeof n.worktreeBasePath=="string"&&typeof n.useWorktrees=="boolean"&&(n.defaultPersonaId===void 0||typeof n.defaultPersonaId=="string")&&typeof n.createdAt=="string"&&typeof n.updatedAt=="string"}function W1(n){return rn(n)&&typeof n.id=="string"&&(typeof n.workspaceId=="string"||n.workspaceId===void 0)&&typeof n.title=="string"&&typeof n.status=="string"&&typeof n.branch=="string"&&typeof n.sortOrder=="number"&&typeof n.depth=="number"&&(n.defaultPersonaId===void 0||typeof n.defaultPersonaId=="string")&&Array.isArray(n.dependsOn)&&Array.isArray(n.childTaskIds)}function J1(n){return rn(n)&&typeof n.id=="string"&&typeof n.workspaceId=="string"&&typeof n.taskId=="string"&&typeof n.sessionId=="string"&&typeof n.category=="string"&&typeof n.title=="string"&&typeof n.content=="string"&&Array.isArray(n.tags)&&typeof n.createdAt=="string"}function eT(n){return rn(n)&&typeof n.name=="string"&&typeof n.tokenType=="string"&&typeof n.envVar=="string"&&typeof n.filePath=="string"&&typeof n.expiresAt=="string"}const tT=new Set(["off","subscription","api_key"]),Vd=new Set(["off","on"]);function Zv(n){return rn(n)&&tT.has(n.claude)&&Vd.has(n.github)&&Vd.has(n.copilot)&&Vd.has(n.codex)}function nT(n){return rn(n)&&typeof n.name=="string"&&typeof n.repository=="string"&&typeof n.state=="string"&&typeof n.gitStatus=="string"}function aT(n){return rn(n)&&typeof n.id=="string"&&typeof n.name=="string"&&typeof n.description=="string"&&typeof n.systemPrompt=="string"&&typeof n.toolConfig=="string"&&typeof n.runtime=="string"&&typeof n.model=="string"&&typeof n.maxTurns=="number"&&typeof n.mcpServers=="string"&&typeof n.createdAt=="string"&&typeof n.updatedAt=="string"&&typeof n.type=="string"&&typeof n.script=="string"}function oa(n,a,i,l){return Array.isArray(n)?n.filter((r,d)=>a(r)?!0:(cl(i,`item at index ${d} in "${l}" has unexpected shape`),!1)):(cl(i,`expected "${l}" to be an array, got ${typeof n}`),[])}function sT(n){let a;try{a=JSON.parse(n)}catch{console.warn("[ws] Failed to parse WebSocket message as JSON");return}if(!rn(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:rn(a.payload)?a.payload:{}}:{type:a.type,payload:rn(a.payload)?a.payload:void 0}}function iT(n){switch(n){case"waiting_input":return"idle";case"killed":return"interrupted";default:return n}}const oT=3e3,Ri=5e3,lT=4001;/**
|
|
26
|
-
* react-router v7.13.1
|
|
27
|
-
*
|
|
28
|
-
* Copyright (c) Remix Software Inc.
|
|
29
|
-
*
|
|
30
|
-
* This source code is licensed under the MIT license found in the
|
|
31
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
32
|
-
*
|
|
33
|
-
* @license MIT
|
|
34
|
-
*/var Xv="popstate";function Qv(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function rT(n={}){function a(l,r){var g;let d=(g=r.state)==null?void 0:g.masked,{pathname:u,search:p,hash:m}=d||l.location;return pf("",{pathname:u,search:p,hash:m},r.state&&r.state.usr||null,r.state&&r.state.key||"default",d?{pathname:l.location.pathname,search:l.location.search,hash:l.location.hash}:void 0)}function i(l,r){return typeof r=="string"?r:ul(r)}return uT(a,i,null,n)}function ft(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function $n(n,a){if(!n){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function cT(){return Math.random().toString(36).substring(2,10)}function Wv(n,a){return{usr:n.state,key:n.key,idx:a,masked:n.unstable_mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function pf(n,a,i=null,l,r){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof a=="string"?Zi(a):a,state:i,key:a&&a.key||l||cT(),unstable_mask:r}}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 uT(n,a,i,l={}){let{window:r=document.defaultView,v5Compat:d=!1}=l,u=r.history,p="POP",m=null,g=y();g==null&&(g=0,u.replaceState({...u.state,idx:g},""));function y(){return(u.state||{idx:null}).idx}function v(){p="POP";let E=y(),k=E==null?null:E-g;g=E,m&&m({action:p,location:w.location,delta:k})}function x(E,k){p="PUSH";let A=Qv(E)?E:pf(w.location,E,k);g=y()+1;let j=Wv(A,g),V=w.createHref(A.unstable_mask||A);try{u.pushState(j,"",V)}catch(I){if(I instanceof DOMException&&I.name==="DataCloneError")throw I;r.location.assign(V)}d&&m&&m({action:p,location:w.location,delta:1})}function S(E,k){p="REPLACE";let A=Qv(E)?E:pf(w.location,E,k);g=y();let j=Wv(A,g),V=w.createHref(A.unstable_mask||A);u.replaceState(j,"",V),d&&m&&m({action:p,location:w.location,delta:0})}function C(E){return dT(E)}let w={get action(){return p},get location(){return n(r,u)},listen(E){if(m)throw new Error("A history only accepts one active listener");return r.addEventListener(Xv,v),m=E,()=>{r.removeEventListener(Xv,v),m=null}},createHref(E){return a(r,E)},createURL:C,encodeLocation(E){let k=C(E);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:x,replace:S,go(E){return u.go(E)}};return w}function dT(n,a=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),ft(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 Y0(n,a,i="/"){return fT(n,a,i,!1)}function fT(n,a,i,l){let r=typeof a=="string"?Zi(a):a,d=Ba(r.pathname||"/",i);if(d==null)return null;let u=K0(n);hT(u);let p=null;for(let m=0;p==null&&m<u.length;++m){let g=X0(d);p=ST(u[m],g,l)}return p}function K0(n,a=[],i=[],l="",r=!1){let d=(u,p,m=r,g)=>{let y={relativePath:g===void 0?u.path||"":g,caseSensitive:u.caseSensitive===!0,childrenIndex:p,route:u};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(l)&&m)return;ft(y.relativePath.startsWith(l),`Absolute route path "${y.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(l.length)}let v=la([l,y.relativePath]),x=i.concat(y);u.children&&u.children.length>0&&(ft(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),K0(u.children,a,x,v,m)),!(u.path==null&&!u.index)&&a.push({path:v,score:_T(v,u.index),routesMeta:x})};return n.forEach((u,p)=>{var m;if(u.path===""||!((m=u.path)!=null&&m.includes("?")))d(u,p);else for(let g of Z0(u.path))d(u,p,!0,g)}),a}function Z0(n){let a=n.split("/");if(a.length===0)return[];let[i,...l]=a,r=i.endsWith("?"),d=i.replace(/\?$/,"");if(l.length===0)return r?[d,""]:[d];let u=Z0(l.join("/")),p=[];return p.push(...u.map(m=>m===""?d:[d,m].join("/"))),r&&p.push(...u),p.map(m=>n.startsWith("/")&&m===""?"/":m)}function hT(n){n.sort((a,i)=>a.score!==i.score?i.score-a.score:xT(a.routesMeta.map(l=>l.childrenIndex),i.routesMeta.map(l=>l.childrenIndex)))}var pT=/^:[\w-]+$/,mT=3,gT=2,vT=1,yT=10,bT=-2,Jv=n=>n==="*";function _T(n,a){let i=n.split("/"),l=i.length;return i.some(Jv)&&(l+=bT),a&&(l+=gT),i.filter(r=>!Jv(r)).reduce((r,d)=>r+(pT.test(d)?mT:d===""?vT:yT),l)}function xT(n,a){return n.length===a.length&&n.slice(0,-1).every((l,r)=>l===a[r])?n[n.length-1]-a[a.length-1]:0}function ST(n,a,i=!1){let{routesMeta:l}=n,r={},d="/",u=[];for(let p=0;p<l.length;++p){let m=l[p],g=p===l.length-1,y=d==="/"?a:a.slice(d.length)||"/",v=dl({path:m.relativePath,caseSensitive:m.caseSensitive,end:g},y),x=m.route;if(!v&&g&&i&&!l[l.length-1].route.index&&(v=dl({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},y)),!v)return null;Object.assign(r,v.params),u.push({params:r,pathname:la([d,v.pathname]),pathnameBase:ET(la([d,v.pathnameBase])),route:x}),v.pathnameBase!=="/"&&(d=la([d,v.pathnameBase]))}return u}function dl(n,a){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[i,l]=TT(n.path,n.caseSensitive,n.end),r=a.match(i);if(!r)return null;let d=r[0],u=d.replace(/(.)\/+$/,"$1"),p=r.slice(1);return{params:l.reduce((g,{paramName:y,isOptional:v},x)=>{if(y==="*"){let C=p[x]||"";u=d.slice(0,d.length-C.length).replace(/(.)\/+$/,"$1")}const S=p[x];return v&&!S?g[y]=void 0:g[y]=(S||"").replace(/%2F/g,"/"),g},{}),pathname:d,pathnameBase:u,pattern:n}}function TT(n,a=!1,i=!0){$n(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=[],r="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,p,m,g,y)=>{if(l.push({paramName:p,isOptional:m!=null}),m){let v=y.charAt(g+u.length);return v&&v!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(l.push({paramName:"*"}),r+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?r+="\\/*$":n!==""&&n!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,a?void 0:"i"),l]}function X0(n){try{return n.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return $n(!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 Ba(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 kT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function CT(n,a="/"){let{pathname:i,search:l="",hash:r=""}=typeof n=="string"?Zi(n):n,d;return i?(i=i.replace(/\/\/+/g,"/"),i.startsWith("/")?d=ey(i.substring(1),"/"):d=ey(i,a)):d=a,{pathname:d,search:AT(l),hash:NT(r)}}function ey(n,a){let i=a.replace(/\/+$/,"").split("/");return n.split("/").forEach(r=>{r===".."?i.length>1&&i.pop():r!=="."&&i.push(r)}),i.length>1?i.join("/"):"/"}function Hd(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 wT(n){return n.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function Kf(n){let a=wT(n);return a.map((i,l)=>l===a.length-1?i.pathname:i.pathnameBase)}function fc(n,a,i,l=!1){let r;typeof n=="string"?r=Zi(n):(r={...n},ft(!r.pathname||!r.pathname.includes("?"),Hd("?","pathname","search",r)),ft(!r.pathname||!r.pathname.includes("#"),Hd("#","pathname","hash",r)),ft(!r.search||!r.search.includes("#"),Hd("#","search","hash",r)));let d=n===""||r.pathname==="",u=d?"/":r.pathname,p;if(u==null)p=i;else{let v=a.length-1;if(!l&&u.startsWith("..")){let x=u.split("/");for(;x[0]==="..";)x.shift(),v-=1;r.pathname=x.join("/")}p=v>=0?a[v]:"/"}let m=CT(r,p),g=u&&u!=="/"&&u.endsWith("/"),y=(d||u===".")&&i.endsWith("/");return!m.pathname.endsWith("/")&&(g||y)&&(m.pathname+="/"),m}var la=n=>n.join("/").replace(/\/\/+/g,"/"),ET=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),AT=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,NT=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,jT=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 DT(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function MT(n){return n.map(a=>a.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Q0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function W0(n,a){let i=n;if(typeof i!="string"||!kT.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let l=i,r=!1;if(Q0)try{let d=new URL(window.location.href),u=i.startsWith("//")?new URL(d.protocol+i):new URL(i),p=Ba(u.pathname,a);u.origin===d.origin&&p!=null?i=p+u.search+u.hash:r=!0}catch{$n(!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:r,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var J0=["POST","PUT","PATCH","DELETE"];new Set(J0);var RT=["GET",...J0];new Set(RT);var Xi=b.createContext(null);Xi.displayName="DataRouter";var hc=b.createContext(null);hc.displayName="DataRouterState";var BT=b.createContext(!1),eb=b.createContext({isTransitioning:!1});eb.displayName="ViewTransition";var OT=b.createContext(new Map);OT.displayName="Fetchers";var IT=b.createContext(null);IT.displayName="Await";var Dn=b.createContext(null);Dn.displayName="Navigation";var vl=b.createContext(null);vl.displayName="Location";var Fn=b.createContext({outlet:null,matches:[],isDataRoute:!1});Fn.displayName="Route";var Zf=b.createContext(null);Zf.displayName="RouteError";var tb="REACT_ROUTER_ERROR",LT="REDIRECT",zT="ROUTE_ERROR_RESPONSE";function UT(n){if(n.startsWith(`${tb}:${LT}:{`))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 VT(n){if(n.startsWith(`${tb}:${zT}:{`))try{let a=JSON.parse(n.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new jT(a.status,a.statusText,a.data)}catch{}}function HT(n,{relative:a}={}){ft(Ys(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:l}=b.useContext(Dn),{hash:r,pathname:d,search:u}=yl(n,{relative:a}),p=d;return i!=="/"&&(p=d==="/"?i:la([i,d])),l.createHref({pathname:p,search:u,hash:r})}function Ys(){return b.useContext(vl)!=null}function qt(){return ft(Ys(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(vl).location}function jt(n){ft(Ys(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:a}=qt();return b.useMemo(()=>dl(n,X0(a)),[a,n])}var nb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ab(n){b.useContext(Dn).static||b.useLayoutEffect(n)}function pc(){let{isDataRoute:n}=b.useContext(Fn);return n?nk():GT()}function GT(){ft(Ys(),"useNavigate() may be used only in the context of a <Router> component.");let n=b.useContext(Xi),{basename:a,navigator:i}=b.useContext(Dn),{matches:l}=b.useContext(Fn),{pathname:r}=qt(),d=JSON.stringify(Kf(l)),u=b.useRef(!1);return ab(()=>{u.current=!0}),b.useCallback((m,g={})=>{if($n(u.current,nb),!u.current)return;if(typeof m=="number"){i.go(m);return}let y=fc(m,JSON.parse(d),r,g.relative==="path");n==null&&a!=="/"&&(y.pathname=y.pathname==="/"?a:la([a,y.pathname])),(g.replace?i.replace:i.push)(y,g.state,g)},[a,i,d,r,n])}var PT=b.createContext(null);function $T(n){let a=b.useContext(Fn).outlet;return b.useMemo(()=>a&&b.createElement(PT.Provider,{value:n},a),[a,n])}function mc(){let{matches:n}=b.useContext(Fn),a=n[n.length-1];return a?a.params:{}}function yl(n,{relative:a}={}){let{matches:i}=b.useContext(Fn),{pathname:l}=qt(),r=JSON.stringify(Kf(i));return b.useMemo(()=>fc(n,JSON.parse(r),l,a==="path"),[n,r,l,a])}function FT(n,a){return sb(n,a)}function sb(n,a,i){var E;ft(Ys(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=b.useContext(Dn),{matches:r}=b.useContext(Fn),d=r[r.length-1],u=d?d.params:{},p=d?d.pathname:"/",m=d?d.pathnameBase:"/",g=d&&d.route;{let k=g&&g.path||"";ob(p,!g||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.
|
|
35
|
-
|
|
36
|
-
Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let y=qt(),v;if(a){let k=typeof a=="string"?Zi(a):a;ft(m==="/"||((E=k.pathname)==null?void 0:E.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.`),v=k}else v=y;let x=v.pathname||"/",S=x;if(m!=="/"){let k=m.replace(/^\//,"").split("/");S="/"+x.replace(/^\//,"").split("/").slice(k.length).join("/")}let C=Y0(n,{pathname:S});$n(g||C!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),$n(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.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 w=XT(C&&C.map(k=>Object.assign({},k,{params:Object.assign({},u,k.params),pathname:la([m,l.encodeLocation?l.encodeLocation(k.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?m:la([m,l.encodeLocation?l.encodeLocation(k.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),r,i);return a&&w?b.createElement(vl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...v},navigationType:"POP"}},w):w}function qT(){let n=tk(),a=DT(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)",r={padding:"0.5rem",backgroundColor:l},d={padding:"2px 4px",backgroundColor:l},u=null;return console.error("Error handled by React Router default ErrorBoundary:",n),u=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:d},"ErrorBoundary")," or"," ",b.createElement("code",{style:d},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},a),i?b.createElement("pre",{style:r},i):null,u)}var YT=b.createElement(qT,null),ib=class extends b.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=VT(n.digest);i&&(n=i)}let a=n!==void 0?b.createElement(Fn.Provider,{value:this.props.routeContext},b.createElement(Zf.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?b.createElement(KT,{error:n},a):a}};ib.contextType=BT;var Gd=new WeakMap;function KT({children:n,error:a}){let{basename:i}=b.useContext(Dn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let l=UT(a.digest);if(l){let r=Gd.get(a);if(r)throw r;let d=W0(l.location,i);if(Q0&&!Gd.get(a))if(d.isExternal||l.reloadDocument)window.location.href=d.absoluteURL||d.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(d.to,{replace:l.replace}));throw Gd.set(a,u),u}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d.absoluteURL||d.to}`})}}return n}function ZT({routeContext:n,match:a,children:i}){let l=b.useContext(Xi);return l&&l.static&&l.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=a.route.id),b.createElement(Fn.Provider,{value:n},i)}function XT(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 r=n,d=l==null?void 0:l.errors;if(d!=null){let y=r.findIndex(v=>v.route.id&&(d==null?void 0:d[v.route.id])!==void 0);ft(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),r=r.slice(0,Math.min(r.length,y+1))}let u=!1,p=-1;if(i&&l){u=l.renderFallback;for(let y=0;y<r.length;y++){let v=r[y];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(p=y),v.route.id){let{loaderData:x,errors:S}=l,C=v.route.loader&&!x.hasOwnProperty(v.route.id)&&(!S||S[v.route.id]===void 0);if(v.route.lazy||C){i.isStatic&&(u=!0),p>=0?r=r.slice(0,p+1):r=[r[0]];break}}}}let m=i==null?void 0:i.onError,g=l&&m?(y,v)=>{var x,S;m(y,{location:l.location,params:((S=(x=l.matches)==null?void 0:x[0])==null?void 0:S.params)??{},unstable_pattern:MT(l.matches),errorInfo:v})}:void 0;return r.reduceRight((y,v,x)=>{let S,C=!1,w=null,E=null;l&&(S=d&&v.route.id?d[v.route.id]:void 0,w=v.route.errorElement||YT,u&&(p<0&&x===0?(ob("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,E=null):p===x&&(C=!0,E=v.route.hydrateFallbackElement||null)));let k=a.concat(r.slice(0,x+1)),A=()=>{let j;return S?j=w:C?j=E:v.route.Component?j=b.createElement(v.route.Component,null):v.route.element?j=v.route.element:j=y,b.createElement(ZT,{match:v,routeContext:{outlet:y,matches:k,isDataRoute:l!=null},children:j})};return l&&(v.route.ErrorBoundary||v.route.errorElement||x===0)?b.createElement(ib,{location:l.location,revalidation:l.revalidation,component:w,error:S,children:A(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:g}):A()},null)}function Xf(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function QT(n){let a=b.useContext(Xi);return ft(a,Xf(n)),a}function WT(n){let a=b.useContext(hc);return ft(a,Xf(n)),a}function JT(n){let a=b.useContext(Fn);return ft(a,Xf(n)),a}function Qf(n){let a=JT(n),i=a.matches[a.matches.length-1];return ft(i.route.id,`${n} can only be used on routes that contain a unique "id"`),i.route.id}function ek(){return Qf("useRouteId")}function tk(){var l;let n=b.useContext(Zf),a=WT("useRouteError"),i=Qf("useRouteError");return n!==void 0?n:(l=a.errors)==null?void 0:l[i]}function nk(){let{router:n}=QT("useNavigate"),a=Qf("useNavigate"),i=b.useRef(!1);return ab(()=>{i.current=!0}),b.useCallback(async(r,d={})=>{$n(i.current,nb),i.current&&(typeof r=="number"?await n.navigate(r):await n.navigate(r,{fromRouteId:a,...d}))},[n,a])}var ty={};function ob(n,a,i){!a&&!ty[n]&&(ty[n]=!0,$n(!1,i))}b.memo(ak);function ak({routes:n,future:a,state:i,isStatic:l,onError:r}){return sb(n,void 0,{state:i,isStatic:l,onError:r})}function al({to:n,replace:a,state:i,relative:l}){ft(Ys(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=b.useContext(Dn);$n(!r,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:d}=b.useContext(Fn),{pathname:u}=qt(),p=pc(),m=fc(n,Kf(d),u,l==="path"),g=JSON.stringify(m);return b.useEffect(()=>{p(JSON.parse(g),{replace:a,state:i,relative:l})},[p,g,l,a,i]),null}function lb(n){return $T(n.context)}function nt(n){ft(!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 sk({basename:n="/",children:a=null,location:i,navigationType:l="POP",navigator:r,static:d=!1,unstable_useTransitions:u}){ft(!Ys(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=n.replace(/^\/*/,"/"),m=b.useMemo(()=>({basename:p,navigator:r,static:d,unstable_useTransitions:u,future:{}}),[p,r,d,u]);typeof i=="string"&&(i=Zi(i));let{pathname:g="/",search:y="",hash:v="",state:x=null,key:S="default",unstable_mask:C}=i,w=b.useMemo(()=>{let E=Ba(g,p);return E==null?null:{location:{pathname:E,search:y,hash:v,state:x,key:S,unstable_mask:C},navigationType:l}},[p,g,y,v,x,S,l,C]);return $n(w!=null,`<Router basename="${p}"> is not able to match the URL "${g}${y}${v}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:b.createElement(Dn.Provider,{value:m},b.createElement(vl.Provider,{children:a,value:w}))}function ik({children:n,location:a}){return FT(mf(n),a)}function mf(n,a=[]){let i=[];return b.Children.forEach(n,(l,r)=>{if(!b.isValidElement(l))return;let d=[...a,r];if(l.type===b.Fragment){i.push.apply(i,mf(l.props.children,d));return}ft(l.type===nt,`[${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>`),ft(!l.props.index||!l.props.children,"An index route cannot have child routes.");let u={id:l.props.id||d.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,middleware:l.props.middleware,loader:l.props.loader,action:l.props.action,hydrateFallbackElement:l.props.hydrateFallbackElement,HydrateFallback:l.props.HydrateFallback,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.hasErrorBoundary===!0||l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(u.children=mf(l.props.children,d)),i.push(u)}),i}var Yr="get",Kr="application/x-www-form-urlencoded";function gc(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function ok(n){return gc(n)&&n.tagName.toLowerCase()==="button"}function lk(n){return gc(n)&&n.tagName.toLowerCase()==="form"}function rk(n){return gc(n)&&n.tagName.toLowerCase()==="input"}function ck(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function uk(n,a){return n.button===0&&(!a||a==="_self")&&!ck(n)}function gf(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((a,i)=>{let l=n[i];return a.concat(Array.isArray(l)?l.map(r=>[i,r]):[[i,l]])},[]))}function dk(n,a){let i=gf(n);return a&&a.forEach((l,r)=>{i.has(r)||a.getAll(r).forEach(d=>{i.append(r,d)})}),i}var Lr=null;function fk(){if(Lr===null)try{new FormData(document.createElement("form"),0),Lr=!1}catch{Lr=!0}return Lr}var hk=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Pd(n){return n!=null&&!hk.has(n)?($n(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Kr}"`),null):n}function pk(n,a){let i,l,r,d,u;if(lk(n)){let p=n.getAttribute("action");l=p?Ba(p,a):null,i=n.getAttribute("method")||Yr,r=Pd(n.getAttribute("enctype"))||Kr,d=new FormData(n)}else if(ok(n)||rk(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?Ba(m,a):null,i=n.getAttribute("formmethod")||p.getAttribute("method")||Yr,r=Pd(n.getAttribute("formenctype"))||Pd(p.getAttribute("enctype"))||Kr,d=new FormData(p,n),!fk()){let{name:g,type:y,value:v}=n;if(y==="image"){let x=g?`${g}.`:"";d.append(`${x}x`,"0"),d.append(`${x}y`,"0")}else g&&d.append(g,v)}}else{if(gc(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=Yr,l=null,r=Kr,u=n}return d&&r==="text/plain"&&(u=d,d=void 0),{action:l,method:i.toLowerCase(),encType:r,formData:d,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Wf(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function mk(n,a,i,l){let r=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return i?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${l}`:r.pathname=`${r.pathname}.${l}`:r.pathname==="/"?r.pathname=`_root.${l}`:a&&Ba(r.pathname,a)==="/"?r.pathname=`${a.replace(/\/$/,"")}/_root.${l}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${l}`,r}async function gk(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 vk(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 yk(n,a,i){let l=await Promise.all(n.map(async r=>{let d=a.routes[r.route.id];if(d){let u=await gk(d,i);return u.links?u.links():[]}return[]}));return Sk(l.flat(1).filter(vk).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function ny(n,a,i,l,r,d){let u=(m,g)=>i[g]?m.route.id!==i[g].route.id:!0,p=(m,g)=>{var y;return i[g].pathname!==m.pathname||((y=i[g].route.path)==null?void 0:y.endsWith("*"))&&i[g].params["*"]!==m.params["*"]};return d==="assets"?a.filter((m,g)=>u(m,g)||p(m,g)):d==="data"?a.filter((m,g)=>{var v;let y=l.routes[m.route.id];if(!y||!y.hasLoader)return!1;if(u(m,g)||p(m,g))return!0;if(m.route.shouldRevalidate){let x=m.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:((v=i[0])==null?void 0:v.params)||{},nextUrl:new URL(n,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function bk(n,a,{includeHydrateFallback:i}={}){return _k(n.map(l=>{let r=a.routes[l.route.id];if(!r)return[];let d=[r.module];return r.clientActionModule&&(d=d.concat(r.clientActionModule)),r.clientLoaderModule&&(d=d.concat(r.clientLoaderModule)),i&&r.hydrateFallbackModule&&(d=d.concat(r.hydrateFallbackModule)),r.imports&&(d=d.concat(r.imports)),d}).flat(1))}function _k(n){return[...new Set(n)]}function xk(n){let a={},i=Object.keys(n).sort();for(let l of i)a[l]=n[l];return a}function Sk(n,a){let i=new Set;return new Set(a),n.reduce((l,r)=>{let d=JSON.stringify(xk(r));return i.has(d)||(i.add(d),l.push({key:d,link:r})),l},[])}function rb(){let n=b.useContext(Xi);return Wf(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function Tk(){let n=b.useContext(hc);return Wf(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Jf=b.createContext(void 0);Jf.displayName="FrameworkContext";function cb(){let n=b.useContext(Jf);return Wf(n,"You must render this element inside a <HydratedRouter> element"),n}function kk(n,a){let i=b.useContext(Jf),[l,r]=b.useState(!1),[d,u]=b.useState(!1),{onFocus:p,onBlur:m,onMouseEnter:g,onMouseLeave:y,onTouchStart:v}=a,x=b.useRef(null);b.useEffect(()=>{if(n==="render"&&u(!0),n==="viewport"){let w=k=>{k.forEach(A=>{u(A.isIntersecting)})},E=new IntersectionObserver(w,{threshold:.5});return x.current&&E.observe(x.current),()=>{E.disconnect()}}},[n]),b.useEffect(()=>{if(l){let w=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(w)}}},[l]);let S=()=>{r(!0)},C=()=>{r(!1),u(!1)};return i?n!=="intent"?[d,x,{}]:[d,x,{onFocus:Yo(p,S),onBlur:Yo(m,C),onMouseEnter:Yo(g,S),onMouseLeave:Yo(y,C),onTouchStart:Yo(v,S)}]:[!1,x,{}]}function Yo(n,a){return i=>{n&&n(i),i.defaultPrevented||a(i)}}function Ck({page:n,...a}){let{router:i}=rb(),l=b.useMemo(()=>Y0(i.routes,n,i.basename),[i.routes,n,i.basename]);return l?b.createElement(Ek,{page:n,matches:l,...a}):null}function wk(n){let{manifest:a,routeModules:i}=cb(),[l,r]=b.useState([]);return b.useEffect(()=>{let d=!1;return yk(n,a,i).then(u=>{d||r(u)}),()=>{d=!0}},[n,a,i]),l}function Ek({page:n,matches:a,...i}){let l=qt(),{future:r,manifest:d,routeModules:u}=cb(),{basename:p}=rb(),{loaderData:m,matches:g}=Tk(),y=b.useMemo(()=>ny(n,a,g,d,l,"data"),[n,a,g,d,l]),v=b.useMemo(()=>ny(n,a,g,d,l,"assets"),[n,a,g,d,l]),x=b.useMemo(()=>{if(n===l.pathname+l.search+l.hash)return[];let w=new Set,E=!1;if(a.forEach(A=>{var V;let j=d.routes[A.route.id];!j||!j.hasLoader||(!y.some(I=>I.route.id===A.route.id)&&A.route.id in m&&((V=u[A.route.id])!=null&&V.shouldRevalidate)||j.hasClientLoader?E=!0:w.add(A.route.id))}),w.size===0)return[];let k=mk(n,p,r.unstable_trailingSlashAwareDataRequests,"data");return E&&w.size>0&&k.searchParams.set("_routes",a.filter(A=>w.has(A.route.id)).map(A=>A.route.id).join(",")),[k.pathname+k.search]},[p,r.unstable_trailingSlashAwareDataRequests,m,l,d,y,a,n,u]),S=b.useMemo(()=>bk(v,d),[v,d]),C=wk(v);return b.createElement(b.Fragment,null,x.map(w=>b.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...i})),S.map(w=>b.createElement("link",{key:w,rel:"modulepreload",href:w,...i})),C.map(({key:w,link:E})=>b.createElement("link",{key:w,nonce:i.nonce,...E,crossOrigin:E.crossOrigin??i.crossOrigin})))}function Ak(...n){return a=>{n.forEach(i=>{typeof i=="function"?i(a):i!=null&&(i.current=a)})}}var Nk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Nk&&(window.__reactRouterVersion="7.13.1")}catch{}function jk({basename:n,children:a,unstable_useTransitions:i,window:l}){let r=b.useRef();r.current==null&&(r.current=rT({window:l,v5Compat:!0}));let d=r.current,[u,p]=b.useState({action:d.action,location:d.location}),m=b.useCallback(g=>{i===!1?p(g):b.startTransition(()=>p(g))},[i]);return b.useLayoutEffect(()=>d.listen(m),[d,m]),b.createElement(sk,{basename:n,children:a,location:u.location,navigationType:u.action,navigator:d,unstable_useTransitions:i})}var ub=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,eh=b.forwardRef(function({onClick:a,discover:i="render",prefetch:l="none",relative:r,reloadDocument:d,replace:u,unstable_mask:p,state:m,target:g,to:y,preventScrollReset:v,viewTransition:x,unstable_defaultShouldRevalidate:S,...C},w){let{basename:E,navigator:k,unstable_useTransitions:A}=b.useContext(Dn),j=typeof y=="string"&&ub.test(y),V=W0(y,E);y=V.to;let I=HT(y,{relative:r}),F=qt(),R=null;if(p){let ie=fc(p,[],F.unstable_mask?F.unstable_mask.pathname:"/",!0);E!=="/"&&(ie.pathname=ie.pathname==="/"?E:la([E,ie.pathname])),R=k.createHref(ie)}let[B,G,ee]=kk(l,C),ae=Bk(y,{replace:u,unstable_mask:p,state:m,target:g,preventScrollReset:v,relative:r,viewTransition:x,unstable_defaultShouldRevalidate:S,unstable_useTransitions:A});function te(ie){a&&a(ie),ie.defaultPrevented||ae(ie)}let fe=!(V.isExternal||d),Q=b.createElement("a",{...C,...ee,href:(fe?R:void 0)||V.absoluteURL||I,onClick:fe?te:a,ref:Ak(w,G),target:g,"data-discover":!j&&i==="render"?"true":void 0});return B&&!j?b.createElement(b.Fragment,null,Q,b.createElement(Ck,{page:I})):Q});eh.displayName="Link";var Dk=b.forwardRef(function({"aria-current":a="page",caseSensitive:i=!1,className:l="",end:r=!1,style:d,to:u,viewTransition:p,children:m,...g},y){let v=yl(u,{relative:g.relative}),x=qt(),S=b.useContext(hc),{navigator:C,basename:w}=b.useContext(Dn),E=S!=null&&Uk(v)&&p===!0,k=C.encodeLocation?C.encodeLocation(v).pathname:v.pathname,A=x.pathname,j=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;i||(A=A.toLowerCase(),j=j?j.toLowerCase():null,k=k.toLowerCase()),j&&w&&(j=Ba(j,w)||j);const V=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let I=A===k||!r&&A.startsWith(k)&&A.charAt(V)==="/",F=j!=null&&(j===k||!r&&j.startsWith(k)&&j.charAt(k.length)==="/"),R={isActive:I,isPending:F,isTransitioning:E},B=I?a:void 0,G;typeof l=="function"?G=l(R):G=[l,I?"active":null,F?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let ee=typeof d=="function"?d(R):d;return b.createElement(eh,{...g,"aria-current":B,className:G,ref:y,style:ee,to:u,viewTransition:p},typeof m=="function"?m(R):m)});Dk.displayName="NavLink";var Mk=b.forwardRef(({discover:n="render",fetcherKey:a,navigate:i,reloadDocument:l,replace:r,state:d,method:u=Yr,action:p,onSubmit:m,relative:g,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:x,...S},C)=>{let{unstable_useTransitions:w}=b.useContext(Dn),E=Lk(),k=zk(p,{relative:g}),A=u.toLowerCase()==="get"?"get":"post",j=typeof p=="string"&&ub.test(p),V=I=>{if(m&&m(I),I.defaultPrevented)return;I.preventDefault();let F=I.nativeEvent.submitter,R=(F==null?void 0:F.getAttribute("formmethod"))||u,B=()=>E(F||I.currentTarget,{fetcherKey:a,method:R,navigate:i,replace:r,state:d,relative:g,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:x});w&&i!==!1?b.startTransition(()=>B()):B()};return b.createElement("form",{ref:C,method:A,action:k,onSubmit:l?m:V,...S,"data-discover":!j&&n==="render"?"true":void 0})});Mk.displayName="Form";function Rk(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function db(n){let a=b.useContext(Xi);return ft(a,Rk(n)),a}function Bk(n,{target:a,replace:i,unstable_mask:l,state:r,preventScrollReset:d,relative:u,viewTransition:p,unstable_defaultShouldRevalidate:m,unstable_useTransitions:g}={}){let y=pc(),v=qt(),x=yl(n,{relative:u});return b.useCallback(S=>{if(uk(S,a)){S.preventDefault();let C=i!==void 0?i:ul(v)===ul(x),w=()=>y(n,{replace:C,unstable_mask:l,state:r,preventScrollReset:d,relative:u,viewTransition:p,unstable_defaultShouldRevalidate:m});g?b.startTransition(()=>w()):w()}},[v,y,x,i,l,r,a,n,d,u,p,m,g])}function th(n){$n(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=b.useRef(gf(n)),i=b.useRef(!1),l=qt(),r=b.useMemo(()=>dk(l.search,i.current?null:a.current),[l.search]),d=pc(),u=b.useCallback((p,m)=>{const g=gf(typeof p=="function"?p(new URLSearchParams(r)):p);i.current=!0,d("?"+g,m)},[d,r]);return[r,u]}var Ok=0,Ik=()=>`__${String(++Ok)}__`;function Lk(){let{router:n}=db("useSubmit"),{basename:a}=b.useContext(Dn),i=ek(),l=n.fetch,r=n.navigate;return b.useCallback(async(d,u={})=>{let{action:p,method:m,encType:g,formData:y,body:v}=pk(d,a);if(u.navigate===!1){let x=u.fetcherKey||Ik();await l(x,i,u.action||p,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:v,formMethod:u.method||m,formEncType:u.encType||g,flushSync:u.flushSync})}else await r(u.action||p,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:v,formMethod:u.method||m,formEncType:u.encType||g,replace:u.replace,state:u.state,fromRouteId:i,flushSync:u.flushSync,viewTransition:u.viewTransition})},[l,r,a,i])}function zk(n,{relative:a}={}){let{basename:i}=b.useContext(Dn),l=b.useContext(Fn);ft(l,"useFormAction must be used inside a RouteContext");let[r]=l.matches.slice(-1),d={...yl(n||".",{relative:a})},u=qt();if(n==null){d.search=u.search;let p=new URLSearchParams(d.search),m=p.getAll("index");if(m.some(y=>y==="")){p.delete("index"),m.filter(v=>v).forEach(v=>p.append("index",v));let y=p.toString();d.search=y?`?${y}`:""}}return(!n||n===".")&&r.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(d.pathname=d.pathname==="/"?i:la([i,d.pathname])),ul(d)}function Uk(n,{relative:a}={}){let i=b.useContext(eb);ft(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:l}=db("useViewTransitionState"),r=yl(n,{relative:a});if(!i.isTransitioning)return!1;let d=Ba(i.currentLocation.pathname,l)||i.currentLocation.pathname,u=Ba(i.nextLocation.pathname,l)||i.nextLocation.pathname;return dl(r.pathname,u)!=null||dl(r.pathname,d)!=null}function cn(){const n=pc();return b.useCallback((a,i)=>{typeof a=="number"?n(a):n(a,i)},[n])}function nh(n){return`/sessions/${encodeURIComponent(n)}`}function $i(n){return`/workspaces/${encodeURIComponent(n)}`}function Xn(n,a,i){const l=encodeURIComponent(n),r=i?`/workspaces/${encodeURIComponent(i)}/tasks/${l}`:`/tasks/${l}`;return a?`${r}/${a}`:r}function Vk(n,a){return a?`/workspaces/${encodeURIComponent(a)}/tasks/${encodeURIComponent(n)}/edit`:`/tasks/${encodeURIComponent(n)}/edit`}function Oa(n,a){const i=new URLSearchParams;n&&i.set("workspace",n),a&&i.set("parent",a);const l=i.toString();return l?`/tasks/new?${l}`:"/tasks/new"}function fb(n){return`/sessions/new?${new URLSearchParams({env:n}).toString()}`}const ay="/environments/new",Pi="/settings",Hk="/settings/environments",Gk="/pair",Pk="/chat",qs="/",$k="/tasks",Fk="/workspaces";function qk(n,a){const i=typeof window<"u"?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`:"ws://localhost:3000",l=b.useRef(void 0),[r,d]=b.useState(!1),u=b.useRef(a.onMessage);u.current=a.onMessage;const p=b.useRef(a.onConnect);p.current=a.onConnect;const m=b.useRef(a.onDisconnect);m.current=a.onDisconnect;const g=b.useCallback(y=>{var v;((v=l.current)==null?void 0:v.readyState)===WebSocket.OPEN&&l.current.send(JSON.stringify(y))},[]);return b.useEffect(()=>{let y,v;function x(){y=new WebSocket(i),l.current=y,y.onopen=()=>{d(!0),p.current(g)},y.onmessage=S=>{if(typeof S.data!="string"){console.warn("[ws] Received non-string WebSocket message; ignoring");return}const C=sT(S.data);C&&u.current(C)},y.onclose=S=>{var C;if(d(!1),l.current=void 0,(C=m.current)==null||C.call(m),clearTimeout(v),S.code===lT){window.location.href=Gk;return}v=setTimeout(x,oT)},y.onerror=()=>{y.close()}}return x(),()=>{clearTimeout(v),y==null||y.close()}},[i,g]),{connected:r,send:g}}const Yk=5e3;function Kk(n){const[a,i]=b.useState([]),[l,r]=b.useState({}),d=b.useCallback(v=>{switch(v.type){case"environment.added":return!0;case"environment.removed":{const x=v.payload.environmentId;return x&&(i(S=>S.filter(C=>C.id!==x)),r(S=>{const C={...S};return delete C[x],C})),n({type:"list_sessions"}),!0}case"environment.changed":return n({type:"list_environments"}),!0;case"environment.provision_progress":{const x=v.payload;if(typeof x.environmentId!="string"||typeof x.stage!="string"||typeof x.message!="string"||typeof x.progress!="number")return cl("environment.provision_progress","invalid payload"),!0;if(r(S=>({...S,[x.environmentId]:{stage:x.stage,message:x.message,progress:x.progress}})),x.stage==="ready"){const S=x.environmentId;setTimeout(()=>{r(C=>{const w={...C};return delete w[S],w})},Yk)}return!0}default:return!1}},[n]),u=b.useCallback(v=>{var x;switch(v.type){case"environments":return i(oa((x=v.payload)==null?void 0:x.environments,X1,"environments","environments")),!0;default:return!1}},[]),p=b.useCallback((v,x,S)=>{n({type:"add_environment",payload:{displayName:v,adapterType:x,adapterConfig:S||{}}})},[n]),m=b.useCallback(v=>{n({type:"provision_environment",payload:{environmentId:v}})},[n]),g=b.useCallback(v=>{n({type:"stop_environment",payload:{environmentId:v}})},[n]),y=b.useCallback(v=>{n({type:"remove_environment",payload:{environmentId:v}})},[n]);return{environments:a,provisionStatus:l,addEnvironment:p,provisionEnvironment:m,stopEnvironment:g,removeEnvironment:y,handleMessage:u,handleEvent:d}}const $d=new Set(["pending","running","idle"]),Zk=new Set(["completed","failed","interrupted"]),sy=["pending","running","idle"];function Xk(n){const[a,i]=b.useState([]),[l,r]=b.useState([]),[d,u]=b.useState(0),[p,m]=b.useState(void 0),[g,y]=b.useState({}),v=b.useCallback(A=>{var j,V,I,F,R;switch(A.type){case"sessions":return i(B=>{var ae;const G=oa((ae=A.payload)==null?void 0:ae.sessions,Yv,"sessions","sessions"),ee=new Map(B.map(te=>[te.id,te.status]));return G.map(te=>{const fe=ee.get(te.id);return!fe||fe===te.status?te:Zk.has(fe)&&$d.has(te.status)?{...te,status:fe}:$d.has(fe)&&$d.has(te.status)&&sy.indexOf(fe)>sy.indexOf(te.status)?{...te,status:fe}:te})}),!0;case"session_event":{if(!Kv(A.payload))return cl("session_event","payload is not a valid SessionEvent"),!0;const B=A.payload;let G=0;if(r(ee=>{const ae=[...ee,B];return ae.length>Ri?(G=ae.length-Ri,ae.slice(-Ri)):ae}),G>0&&u(ee=>ee+G),B.eventType==="status"){const ee=iT(B.content);i(ae=>ae.some(fe=>fe.id===B.sessionId)?ae.map(fe=>fe.id===B.sessionId?{...fe,status:ee}:fe):[...ae,{id:B.sessionId,environmentId:"",runtime:"",status:ee,prompt:"",startedAt:B.timestamp}])}return!0}case"session_events":{const B=oa((j=A.payload)==null?void 0:j.events,Kv,"session_events","events"),G=(V=A.payload)==null?void 0:V.sessionId;if(typeof G!="string")return cl("session_events","missing or non-string sessionId"),!0;if(B.length>0){let ee=0;r(ae=>{const te=new Set;for(const ie of ae)ie.sessionId===G&&te.add(`${ie.timestamp}|${ie.eventType}`);const fe=B.filter(ie=>!te.has(`${ie.timestamp}|${ie.eventType}`)),Q=[...ae,...fe].sort((ie,H)=>ie.sessionId!==H.sessionId?0:ie.timestamp.localeCompare(H.timestamp));return Q.length>Ri?(ee=Q.length-Ri,Q.slice(-Ri)):Q}),ee>0&&u(ae=>ae+ee)}return!0}case"spawned":{const B=(I=A.payload)==null?void 0:I.sessionId;return typeof B=="string"&&B&&m(B),n({type:"list_sessions"}),!0}case"task_sessions":{const B=(F=A.payload)==null?void 0:F.taskId;if(typeof B!="string"||!B)return!0;const G=oa((R=A.payload)==null?void 0:R.sessions,Yv,"task_sessions","sessions");return y(ee=>({...ee,[B]:G})),!0}default:return!1}},[n]),x=b.useCallback((A,j,V,I)=>{n({type:"spawn",payload:{environmentId:A,prompt:j,personaId:V||"",worktreeBasePath:I||""}})},[n]),S=b.useCallback((A,j)=>{n({type:"send_input",payload:{sessionId:A,text:j}})},[n]),C=b.useCallback(A=>{n({type:"kill",payload:{sessionId:A}})},[n]),w=b.useCallback(A=>{n({type:"get_session_events",payload:{sessionId:A}})},[n]),E=b.useCallback(()=>{r([]),u(0)},[]),k=b.useCallback(A=>{n({type:"get_task_sessions",payload:{taskId:A}})},[n]);return{sessions:a,events:l,eventsDropped:d,lastSpawnedId:p,taskSessions:g,spawn:x,sendInput:S,kill:C,loadSessionEvents:w,clearEvents:E,loadTaskSessions:k,handleMessage:v}}function Qk(n){const[a,i]=b.useState([]),[l,r]=b.useState(!1),d=b.useCallback(v=>{switch(v.type){case"workspace.created":return r(!1),n({type:"list_workspaces"}),!0;case"workspace.archived":case"workspace.updated":return n({type:"list_workspaces"}),!0;default:return!1}},[n]),u=b.useCallback(v=>{var x;switch(v.type){case"workspaces":return i(oa((x=v.payload)==null?void 0:x.workspaces,Q1,"workspaces","workspaces")),!0;default:return!1}},[]),p=b.useCallback(()=>{r(!1)},[]),m=b.useCallback((v,x,S,C,w)=>{r(!0),n({type:"create_workspace",payload:{name:v,description:x||"",repoUrl:S||"",environmentId:C||"",defaultPersonaId:w||""}})},[n]),g=b.useCallback(v=>{n({type:"archive_workspace",payload:{workspaceId:v}})},[n]),y=b.useCallback((v,x)=>{n({type:"update_workspace",payload:{workspaceId:v,...x}})},[n]);return{workspaces:a,workspaceCreating:l,createWorkspace:m,archiveWorkspace:g,updateWorkspace:y,handleMessage:u,handleEvent:d,onDisconnect:p}}const Wk=15e3;function Jk(n){const[a,i]=b.useState([]),[l,r]=b.useState(void 0),d=b.useRef(new Map),u=b.useCallback(A=>{const j=A.payload;switch(A.type){case"task.created":{const V=typeof j.requestId=="string"?j.requestId:"";if(V){const F=d.current.get(V);F&&(clearTimeout(F.timer),d.current.delete(V),F.onSuccess())}const I=typeof j.workspaceId=="string"?j.workspaceId:"";return I&&n({type:"list_tasks",payload:{workspaceId:I}}),!0}case"task.started":{const V=typeof j.taskId=="string"?j.taskId:"",I=typeof j.sessionId=="string"?j.sessionId:"",F=typeof j.workspaceId=="string"?j.workspaceId:"";return r(R=>V&&R===V?void 0:R),I&&(n({type:"list_sessions"}),V&&i(R=>R.map(B=>B.id===V?{...B,latestSessionId:I}:B))),F?n({type:"list_tasks",payload:{workspaceId:F}}):V&&i(R=>{const B=R.find(G=>G.id===V);return B!=null&&B.workspaceId?n({type:"list_tasks",payload:{workspaceId:B.workspaceId}}):n({type:"list_tasks",payload:{}}),R}),!0}case"task.completed":case"task.deleted":case"task.updated":{const V=typeof j.workspaceId=="string"?j.workspaceId:"",I=typeof j.taskId=="string"?j.taskId:"";return V?n({type:"list_tasks",payload:{workspaceId:V}}):I&&i(F=>{const R=F.find(B=>B.id===I);return R!=null&&R.workspaceId?n({type:"list_tasks",payload:{workspaceId:R.workspaceId}}):n({type:"list_tasks",payload:{}}),F}),!0}default:return!1}},[n]),p=b.useCallback(A=>{var j,V,I,F;switch(A.type){case"tasks":{const R=oa((j=A.payload)==null?void 0:j.tasks,W1,"tasks","tasks"),B=typeof((V=A.payload)==null?void 0:V.workspaceId)=="string"&&A.payload.workspaceId?A.payload.workspaceId:"";return B?(i(G=>[...G.filter(ee=>ee.workspaceId!==B),...R]),!0):(i(G=>{const ee=new Set(R.map(ae=>ae.id));return[...G.filter(ae=>!ee.has(ae.id)),...R]}),!0)}case"create_task_error":{const R=typeof((I=A.payload)==null?void 0:I.requestId)=="string"?A.payload.requestId:"",B=typeof((F=A.payload)==null?void 0:F.message)=="string"?A.payload.message:"Failed to create task";if(R){const G=d.current.get(R);G?(clearTimeout(G.timer),d.current.delete(R),G.onError(B)):console.error("[useTasks] create_task_error with unknown requestId:",B)}else console.error("[useTasks] create_task_error:",B);return!0}default:return!1}},[]),m=b.useCallback(()=>{r(void 0);for(const[,A]of d.current)clearTimeout(A.timer),A.onError("Disconnected");d.current.clear()},[]),g=b.useCallback(A=>{n({type:"list_tasks",payload:{workspaceId:A}})},[n]),y=b.useCallback(()=>{n({type:"list_tasks",payload:{}})},[n]),v=b.useCallback((A,j,V,I,F,R,B,G,ee)=>{const ae={workspaceId:A,title:j,description:V||"",dependsOn:I||[],parentTaskId:F||"",defaultPersonaId:R||"",canDecompose:B||!1};if(G||ee){const te=crypto.randomUUID();ae.requestId=te;const fe=ee??(()=>{}),Q=setTimeout(()=>{d.current.delete(te)&&fe("Request timed out")},Wk);d.current.set(te,{onSuccess:G??(()=>{}),onError:fe,timer:Q})}n({type:"create_task",payload:ae})},[n]),x=b.useCallback((A,j,V,I)=>{r(A),n({type:"start_task",payload:{taskId:A,personaId:j||"",environmentId:V||"",notes:I||""}})},[n]),S=b.useCallback(A=>{n({type:"stop_task",payload:{taskId:A}})},[n]),C=b.useCallback(A=>{n({type:"complete_task",payload:{taskId:A}})},[n]),w=b.useCallback(A=>{n({type:"resume_task",payload:{taskId:A}})},[n]),E=b.useCallback((A,j,V,I,F)=>{const R={taskId:A,title:j,description:V,dependsOn:I};F!==void 0&&(R.defaultPersonaId=F),n({type:"update_task",payload:R})},[n]),k=b.useCallback(A=>{n({type:"delete_task",payload:{taskId:A}})},[n]);return{tasks:a,taskStartingId:l,loadTasks:g,loadAllTasks:y,createTask:v,startTask:x,stopTask:S,completeTask:C,resumeTask:w,updateTask:E,deleteTask:k,handleMessage:p,handleEvent:u,onDisconnect:m}}function eC(n){const[a,i]=b.useState([]),l=b.useCallback(p=>{if(p.type==="finding.posted"){const m=typeof p.payload.workspaceId=="string"?p.payload.workspaceId:"";return m&&n({type:"list_findings",payload:{workspaceId:m}}),!0}return!1},[n]),r=b.useCallback(p=>{var m;switch(p.type){case"findings":return i(oa((m=p.payload)==null?void 0:m.findings,J1,"findings","findings")),!0;default:return!1}},[]),d=b.useCallback(p=>{n({type:"list_findings",payload:{workspaceId:p}})},[n]),u=b.useCallback((p,m,g,y,v)=>{n({type:"post_finding",payload:{workspaceId:p,title:m,content:g,category:y||"general",tags:v||[]}})},[n]);return{findings:a,loadFindings:d,postFinding:u,handleMessage:r,handleEvent:l}}function tC(n){const[a,i]=b.useState([]),l=b.useCallback(m=>m.type==="token.changed"?(n({type:"list_tokens"}),!0):!1,[n]),r=b.useCallback(m=>{var g;switch(m.type){case"tokens":return i(oa((g=m.payload)==null?void 0:g.tokens,eT,"tokens","tokens")),!0;default:return!1}},[]),d=b.useCallback(()=>{n({type:"list_tokens"})},[n]),u=b.useCallback((m,g,y,v,x)=>{n({type:"set_token",payload:{name:m,value:g,tokenType:y,envVar:v,filePath:x}})},[n]),p=b.useCallback(m=>{n({type:"delete_token",payload:{name:m}})},[n]);return{tokens:a,loadTokens:d,setToken:u,deleteToken:p,handleMessage:r,handleEvent:l}}function nC(n){const[a,i]=b.useState({claude:"off",github:"off",copilot:"off",codex:"off"}),l=b.useCallback(u=>u.type==="credential.providers_changed"?(Zv(u.payload)&&i(u.payload),!0):!1,[]),r=b.useCallback(u=>{switch(u.type){case"credential_providers":return Zv(u.payload)&&i(u.payload),!0;default:return!1}},[]),d=b.useCallback(u=>{n({type:"set_credential_providers",payload:u})},[n]);return{credentialProviders:a,updateCredentialProviders:d,handleMessage:r,handleEvent:l}}function aC(n,a){const[i,l]=b.useState([]),[r,d]=b.useState(""),[u,p]=b.useState(""),[m,g]=b.useState(!1),y=b.useCallback(S=>{var C,w,E;switch(S.type){case"codespaces_list":{const k=oa((C=S.payload)==null?void 0:C.codespaces,nT,"codespaces_list","codespaces"),A=typeof((w=S.payload)==null?void 0:w.error)=="string"?S.payload.error:"";return l(k),p(A),!0}case"codespace_created":return g(!1),n({type:"list_codespaces"}),!0;case"codespace_create_error":{g(!1);const k=typeof((E=S.payload)==null?void 0:E.message)=="string"?S.payload.message:"Failed to create codespace";return d(k),!0}default:return!1}},[n]),v=b.useCallback(()=>{n({type:"list_codespaces"})},[n]),x=b.useCallback((S,C)=>{if(!a){d("Not connected to server. Please try again once the connection is restored.");return}g(!0),d("");const w={repo:S};C&&(w.machine=C),n({type:"create_codespace",payload:w})},[n,a]);return{codespaces:i,codespaceError:r,codespaceListError:u,codespaceCreating:m,listCodespaces:v,createCodespace:x,handleMessage:y}}function sC(n){const[a,i]=b.useState([]),l=b.useCallback(m=>{switch(m.type){case"persona.created":case"persona.updated":case"persona.deleted":return n({type:"list_personas"}),!0;default:return!1}},[n]),r=b.useCallback(m=>{var g;switch(m.type){case"personas":{const y=oa((g=m.payload)==null?void 0:g.personas,aT,"personas","personas");return i(y),!0}default:return!1}},[]),d=b.useCallback((m,g,y,v,x,S,C,w)=>{n({type:"create_persona",payload:{name:m,description:g,systemPrompt:y,runtime:v||"",model:x||"",maxTurns:S||0,type:C||"agent",script:w||""}})},[n]),u=b.useCallback((m,g,y,v,x,S,C,w,E)=>{const k={personaId:m};g!==void 0&&(k.name=g),y!==void 0&&(k.description=y),v!==void 0&&(k.systemPrompt=v),x!==void 0&&(k.runtime=x),S!==void 0&&(k.model=S),C!==void 0&&(k.maxTurns=C),w!==void 0&&(k.type=w),E!==void 0&&(k.script=E),n({type:"update_persona",payload:k})},[n]),p=b.useCallback(m=>{n({type:"delete_persona",payload:{personaId:m}})},[n]);return{personas:a,createPersona:d,updatePersona:u,deletePersona:p,handleMessage:r,handleEvent:l}}function iC(n){const[a,i]=b.useState(""),[l,r]=b.useState(void 0),{connected:d,send:u}=qk(n,{onMessage:I,onConnect:F,onDisconnect:R}),p=Kk(u),m=Xk(u),g=Qk(u),y=Jk(u),v=eC(u),x=tC(u),S=nC(u),C=aC(u,d),w=sC(u),E="default_persona_id",k="onboarding_completed",A=b.useCallback(G=>{i(G),u({type:"set_setting",payload:{key:E,value:G}})},[u]),j=b.useCallback(()=>{r(!0),u({type:"set_setting",payload:{key:k,value:"true"}})},[u]);function V(G){const ee=G.payload.key,ae=G.payload.value;if(G.type==="setting.changed"){ee===E&&i(ae??""),ee===k&&r(ae==="true");return}p.handleEvent(G)||g.handleEvent(G)||y.handleEvent(G)||v.handleEvent(G)||x.handleEvent(G)||S.handleEvent(G)||w.handleEvent(G)}function I(G){var ee,ae,te;if(Z1(G)){V(G);return}if(G.type==="setting"){const fe=(ee=G.payload)==null?void 0:ee.key,Q=(ae=G.payload)==null?void 0:ae.value;fe===E&&i(Q??""),fe===k&&r(Q==="true");return}if(!p.handleMessage(G)&&!m.handleMessage(G)&&!g.handleMessage(G)&&!y.handleMessage(G)&&!v.handleMessage(G)&&!x.handleMessage(G)&&!S.handleMessage(G)&&!C.handleMessage(G)&&!w.handleMessage(G)&&G.type==="error"){console.error("[ws]",(te=G.payload)==null?void 0:te.message);return}}function F(G){G({type:"list_environments"}),G({type:"list_sessions"}),G({type:"list_workspaces"}),G({type:"list_tokens"}),G({type:"get_credential_providers"}),G({type:"list_personas"}),G({type:"get_setting",payload:{key:E}}),G({type:"get_setting",payload:{key:k}}),G({type:"list_tasks",payload:{}}),G({type:"subscribe_all"})}function R(){g.onDisconnect(),y.onDisconnect()}const B=b.useCallback(()=>{u({type:"list_environments"}),u({type:"list_sessions"}),u({type:"list_workspaces"}),u({type:"list_tokens"})},[u]);return{connected:d,environments:p.environments,sessions:m.sessions,events:m.events,eventsDropped:m.eventsDropped,lastSpawnedId:m.lastSpawnedId,workspaces:g.workspaces,tasks:y.tasks,findings:v.findings,tokens:x.tokens,spawn:m.spawn,sendInput:m.sendInput,kill:m.kill,refresh:B,loadSessionEvents:m.loadSessionEvents,clearEvents:m.clearEvents,createWorkspace:g.createWorkspace,archiveWorkspace:g.archiveWorkspace,updateWorkspace:g.updateWorkspace,loadTasks:y.loadTasks,loadAllTasks:y.loadAllTasks,createTask:y.createTask,startTask:y.startTask,stopTask:y.stopTask,completeTask:y.completeTask,resumeTask:y.resumeTask,updateTask:y.updateTask,deleteTask:y.deleteTask,loadFindings:v.loadFindings,postFinding:v.postFinding,addEnvironment:p.addEnvironment,loadTokens:x.loadTokens,setToken:x.setToken,deleteToken:x.deleteToken,credentialProviders:S.credentialProviders,updateCredentialProviders:S.updateCredentialProviders,provisionStatus:p.provisionStatus,provisionEnvironment:p.provisionEnvironment,stopEnvironment:p.stopEnvironment,removeEnvironment:p.removeEnvironment,codespaces:C.codespaces,codespaceError:C.codespaceError,codespaceListError:C.codespaceListError,codespaceCreating:C.codespaceCreating,listCodespaces:C.listCodespaces,createCodespace:C.createCodespace,workspaceCreating:g.workspaceCreating,taskStartingId:y.taskStartingId,personas:w.personas,createPersona:w.createPersona,updatePersona:w.updatePersona,deletePersona:w.deletePersona,taskSessions:m.taskSessions,loadTaskSessions:m.loadTaskSessions,appDefaultPersonaId:a,setAppDefaultPersonaId:A,onboardingCompleted:l,completeOnboarding:j}}const ah=b.createContext(void 0);function oC({children:n}){const a=iC();return c.jsx(ah.Provider,{value:a,children:n})}function kt(){const n=b.useContext(ah);if(!n)throw new Error("useGrackle must be used within GrackleProvider");return n}const lC=[{id:"env-local-01",displayName:"Local Dev",adapterType:"local",status:"connected",bootstrapped:!0},{id:"env-docker-01",displayName:"Docker Sandbox",adapterType:"docker",status:"connected",bootstrapped:!0},{id:"env-cs-01",displayName:"GitHub Codespace",adapterType:"codespace",status:"connected",bootstrapped:!0},{id:"env-remote-01",displayName:"Staging (SSH)",adapterType:"ssh",status:"disconnected",bootstrapped:!1}],rC=[{id:"sess-001-prev",environmentId:"env-local-01",runtime:"claude-code",status:"failed",prompt:"Implement auth middleware",startedAt:"2026-02-26T14:00:00Z",endedAt:"2026-02-26T15:12:00Z",error:"Context window exceeded before completing implementation"},{id:"sess-001",environmentId:"env-local-01",runtime:"node",status:"running",prompt:"Refactor the authentication middleware to use JWT tokens",startedAt:"2026-02-27T08:15:00Z"},{id:"sess-002",environmentId:"env-docker-01",runtime:"python",status:"completed",prompt:"Write unit tests for the user registration endpoint",startedAt:"2026-02-27T07:30:00Z"},{id:"sess-003",environmentId:"env-local-01",runtime:"node",status:"failed",prompt:"Migrate database schema to add audit_log table",startedAt:"2026-02-26T22:45:00Z"},{id:"sess-004",environmentId:"env-docker-01",runtime:"python",status:"running",prompt:"Implement rate limiting for the public API",startedAt:"2026-02-27T09:00:00Z"}],cC=[{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:
|
|
37
|
-
- src/middleware/auth.ts
|
|
38
|
-
- src/routes/login.ts
|
|
39
|
-
- 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:
|
|
40
|
-
\`\`\`typescript
|
|
41
|
-
import jwt from "jsonwebtoken";
|
|
42
|
-
import type { Request, Response, NextFunction } from "express";
|
|
43
|
-
|
|
44
|
-
const JWT_SECRET = process.env.JWT_SECRET || "change-me";
|
|
45
|
-
|
|
46
|
-
export function verifyToken(req: Request, res: Response, next: NextFunction): void {
|
|
47
|
-
const header = req.headers.authorization;
|
|
48
|
-
if (!header?.startsWith("Bearer ")) {
|
|
49
|
-
res.status(401).json({ error: "Missing token" });
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
try {
|
|
53
|
-
const decoded = jwt.verify(header.slice(7), JWT_SECRET);
|
|
54
|
-
req.user = decoded;
|
|
55
|
-
next();
|
|
56
|
-
} catch {
|
|
57
|
-
res.status(403).json({ error: "Invalid token" });
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
\`\`\``},{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"}],uC=[{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",worktreeBasePath:"",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",worktreeBasePath:"",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",worktreeBasePath:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2025-11-20T09:00:00Z",updatedAt:"2025-11-20T09:00:00Z"}],dC=[{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:""},{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:""},{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:""},{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:""},{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:""},{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:""},{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:""},{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:""},{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:""},{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:""},{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:""},{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:""},{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:""},{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:""},{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:""},{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:""},{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:""}],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"}],fC=[{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:""}],hC=[{id:"persona-arch",name:"Software Architect",description:"Designs system architecture, defines interfaces, and decomposes large features into implementable tasks.",systemPrompt:"You are a senior software architect. Focus on clean interfaces, separation of concerns, and scalable patterns. When decomposing work, create concrete subtasks with clear acceptance criteria.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:50,mcpServers:"[]",createdAt:"2026-02-20T10:00:00Z",updatedAt:"2026-02-20T10:00:00Z",type:"agent",script:""},{id:"persona-fe",name:"Frontend Engineer",description:"React specialist — builds UI components, writes CSS, implements routing, and creates Playwright tests.",systemPrompt:"You are a frontend engineer specializing in React, TypeScript, and modern CSS. Follow component composition patterns, use semantic HTML, and write accessible markup.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit","Bash"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:100,mcpServers:"[]",createdAt:"2026-02-20T10:05:00Z",updatedAt:"2026-02-20T10:05:00Z",type:"agent",script:""},{id:"persona-reviewer",name:"Code Reviewer",description:"Reviews diffs for correctness, security, and style. Posts findings for issues discovered.",systemPrompt:"You are a meticulous code reviewer. Check for security vulnerabilities, performance issues, and style consistency. Post findings for anything noteworthy.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:30,mcpServers:"[]",createdAt:"2026-02-20T10:10:00Z",updatedAt:"2026-02-20T10:10:00Z",type:"agent",script:""},{id:"persona-tester",name:"QA Engineer",description:"Writes comprehensive test suites — unit tests, integration tests, and E2E Playwright specs.",systemPrompt:"You are a QA engineer focused on test coverage. Write tests that cover happy paths, edge cases, error scenarios, and accessibility. Use Playwright for E2E tests.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit","Bash"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:80,mcpServers:"[]",createdAt:"2026-02-20T10:15:00Z",updatedAt:"2026-02-20T10:15:00Z",type:"agent",script:""}],pC={"task-001b":[{id:"sess-001-prev",environmentId:"env-local-01",runtime:"claude-code",status:"failed",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 Gt(n){return new Date(Date.now()+n).toISOString()}const oy=[{label:"API Refactor",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Gt(0),content:"running"}},{delayMs:800,event:{eventType:"output",timestamp:Gt(800),content:"Analyzing current API structure in src/routes/..."}},{delayMs:1600,event:{eventType:"output",timestamp:Gt(1600),content:`Found 5 endpoints that need refactoring:
|
|
61
|
-
- GET /api/users
|
|
62
|
-
- POST /api/users
|
|
63
|
-
- GET /api/users/:id
|
|
64
|
-
- PUT /api/users/:id
|
|
65
|
-
- DELETE /api/users/:id`}},{delayMs:2800,event:{eventType:"output",timestamp:Gt(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:Gt(4e3),content:"Running test suite... 22 tests passed, 3 updated, 0 failed."}},{delayMs:5e3,event:{eventType:"status",timestamp:Gt(5e3),content:"completed"}}]},{label:"Database Migration",pauseForInput:!0,pauseAfterStep:3,steps:[{delayMs:0,event:{eventType:"status",timestamp:Gt(0),content:"running"}},{delayMs:600,event:{eventType:"output",timestamp:Gt(600),content:"Scanning current schema for migration targets..."}},{delayMs:1400,event:{eventType:"output",timestamp:Gt(1400),content:`Found tables to modify:
|
|
66
|
-
- users (add column: last_login_at)
|
|
67
|
-
- sessions (add index on expires_at)
|
|
68
|
-
- audit_log (new table)`}},{delayMs:2200,event:{eventType:"output",timestamp:Gt(2200),content:`⚠ This migration will add a NOT NULL column to the users table.
|
|
69
|
-
The table has 50,000+ rows — this may lock the table briefly.
|
|
70
|
-
|
|
71
|
-
Please confirm to proceed.`}}],resumeSteps:[{delayMs:500,event:{eventType:"output",timestamp:Gt(0),content:"Proceeding with migration..."}},{delayMs:1500,event:{eventType:"output",timestamp:Gt(1e3),content:`Migration 001_add_last_login.sql applied successfully.
|
|
72
|
-
Migration 002_sessions_index.sql applied successfully.
|
|
73
|
-
Migration 003_audit_log.sql applied successfully.`}},{delayMs:2500,event:{eventType:"output",timestamp:Gt(2e3),content:"All 3 migrations applied. Running verification queries... OK."}},{delayMs:3200,event:{eventType:"status",timestamp:Gt(2700),content:"completed"}}]},{label:"Test Writer",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Gt(0),content:"running"}},{delayMs:700,event:{eventType:"output",timestamp:Gt(700),content:"Generating test scaffolding for src/services/billing.ts..."}},{delayMs:1800,event:{eventType:"output",timestamp:Gt(1800),content:`Writing test cases:
|
|
74
|
-
- should calculate monthly total
|
|
75
|
-
- should apply discount codes
|
|
76
|
-
- should handle currency conversion
|
|
77
|
-
- should reject expired cards`}},{delayMs:2800,event:{eventType:"output",timestamp:Gt(2800),content:`Error: Cannot resolve import 'src/services/stripe-client.ts' — module not found.
|
|
78
|
-
The billing service depends on a Stripe client that doesn't exist in this environment.`}},{delayMs:3500,event:{eventType:"status",timestamp:Gt(3500),content:"failed"}}]}],ly=400;function mC({children:n}){const[a,i]=b.useState(rC),[l,r]=b.useState(cC),[d,u]=b.useState(void 0),[p,m]=b.useState(uC),[g,y]=b.useState(dC),[v,x]=b.useState(iy),[S,C]=b.useState(fC),[w,E]=b.useState({claude:"off",github:"off",copilot:"off",codex:"off"}),[k,A]=b.useState(hC),[j]=b.useState(pC),[V,I]=b.useState(""),F=b.useRef(0),R=b.useRef(0),B=b.useRef(new Set),G=b.useRef(new Map),ee=b.useRef(g);ee.current=g;const ae=b.useRef(new Map),te=b.useRef(new Map),fe=b.useCallback(Z=>(F.current+=1,`mock-${Z}-${String(F.current).padStart(3,"0")}`),[]),Q=b.useCallback(()=>{const Z=oy[R.current%oy.length];return R.current+=1,Z},[]),ie=b.useCallback((Z,ne,ue)=>{const ke=setTimeout(()=>{var ye;B.current.delete(ke),ue&&((ye=G.current.get(ue))==null||ye.delete(ke)),Z()},ne);B.current.add(ke),ue&&(G.current.has(ue)||G.current.set(ue,new Set),G.current.get(ue).add(ke))},[]),H=b.useCallback(Z=>{const ne=G.current.get(Z);ne&&(ne.forEach(ue=>{clearTimeout(ue),B.current.delete(ue)}),G.current.delete(Z))},[]),M=b.useCallback((Z,ne)=>{i(ue=>ue.map(ke=>ke.id===Z?{...ke,status:ne}:ke))},[]),J=b.useCallback(Z=>{r(ne=>[...ne,Z])},[]),le=b.useCallback((Z,ne,ue)=>{ne.forEach((ke,ye)=>{ie(()=>{const He={sessionId:Z,...ke.event,timestamp:new Date().toISOString()};J(He),ke.event.eventType==="status"&&M(Z,ke.event.content),ye===ne.length-1&&ue&&ue()},ke.delayMs,Z)})},[ie,J,M]),Y=b.useCallback((Z,ne,ue,ke)=>{console.log("[MockGrackle] spawn",{environmentId:Z,prompt:ne,runtime:ke});const ye=fe("sess"),He={id:ye,environmentId:Z,runtime:ke||"claude-code",status:"running",prompt:ne,startedAt:new Date().toISOString()};i(mt=>[...mt,He]),u(ye);const we=Q();if(console.log(`[MockGrackle] Playing scenario: ${we.label}`),we.pauseForInput){const mt=we.pauseAfterStep??we.steps.length-1,Qe=we.steps.slice(0,mt+1),Lt=Qe.length>0?Qe[Qe.length-1].delayMs:0;le(ye,Qe),ie(()=>{M(ye,"idle"),J({sessionId:ye,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},Lt+ly,ye),we.resumeSteps&&ae.current.set(ye,we.resumeSteps)}else le(ye,we.steps)},[fe,Q,le,ie,M,J]),pe=b.useCallback(Z=>{console.log("[MockGrackle] kill",Z),H(Z),ae.current.delete(Z),M(Z,"interrupted"),J({sessionId:Z,eventType:"status",timestamp:new Date().toISOString(),content:"interrupted"}),y(ne=>ne.map(ue=>ue.latestSessionId===Z&&ue.status==="working"?{...ue,status:"not_started"}:ue))},[H,M,J]),De=b.useCallback(()=>{console.log("[MockGrackle] refresh")},[]),se=b.useCallback(Z=>{console.log("[MockGrackle] loadSessionEvents",Z)},[]),je=b.useCallback(()=>{console.log("[MockGrackle] clearEvents"),r([])},[]),pt=b.useCallback((Z,ne,ue,ke,ye)=>{console.log("[MockGrackle] createWorkspace",{name:Z,description:ne});const He={id:fe("proj"),name:Z,description:ne||"",repoUrl:ue||"",environmentId:ke||"",status:"active",worktreeBasePath:"",useWorktrees:!0,defaultPersonaId:ye||"",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};m(we=>[...we,He])},[fe]),Ct=b.useCallback(Z=>{console.log("[MockGrackle] archiveWorkspace",Z),m(ne=>ne.map(ue=>ue.id===Z?{...ue,status:"archived"}:ue))},[]),un=b.useCallback(Z=>{console.log("[MockGrackle] loadTasks",Z)},[]),Jt=b.useCallback((Z,ne,ue,ke,ye,He,we,mt,Qe)=>{console.log("[MockGrackle] createTask",{workspaceId:Z,title:ne,parentTaskId:ye}),y(Lt=>{const Pe=Lt.filter(sn=>sn.workspaceId===Z).reduce((sn,zt)=>Math.max(sn,zt.sortOrder),0),bt=ye?Lt.find(sn=>sn.id===ye):void 0;if(ye&&!bt)return console.warn("[MockGrackle] Parent task not found:",ye),Lt;if(bt&&!bt.canDecompose)return console.warn("[MockGrackle] Parent task does not have decomposition rights:",ye),Lt;const Ge=bt?bt.depth+1:0,za={id:fe("task"),workspaceId:Z,title:ne,description:ue||"",status:"not_started",branch:"",latestSessionId:"",dependsOn:ke||[],reviewNotes:void 0,sortOrder:Pe+1,createdAt:new Date().toISOString(),parentTaskId:ye||"",depth:Ge,childTaskIds:[],canDecompose:we??!ye,defaultPersonaId:He||""};return[...Lt,za]}),mt&&mt()},[fe]),W=b.useCallback((Z,ne,ue,ke)=>{var Lt;console.log("[MockGrackle] startTask",{taskId:Z});const ye=ee.current.find(ct=>ct.id===Z),He=(ye==null?void 0:ye.title)??"",we=fe("sess"),mt={id:we,environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:He||Z,startedAt:new Date().toISOString()};i(ct=>[...ct,mt]),y(ct=>ct.map(Pe=>Pe.id===Z?{...Pe,status:"working",latestSessionId:we,branch:`mock/${Z.slice(0,8)}`}:Pe));const Qe=Q();if(console.log(`[MockGrackle] Playing task scenario: ${Qe.label}`),Qe.pauseForInput){const ct=Qe.pauseAfterStep??Qe.steps.length-1,Pe=Qe.steps.slice(0,ct+1),bt=Pe.length>0?Pe[Pe.length-1].delayMs:0;if(le(we,Pe),ie(()=>{M(we,"idle"),J({sessionId:we,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},bt+ly,we),Qe.resumeSteps){const Ge=[...Qe.resumeSteps];ae.current.set(we,Ge);const za=Ge.reduce((sn,zt)=>Math.max(sn,zt.delayMs),0);te.current.set(we,{taskId:Z,delayAfterResume:za+200})}}else{const ct=Qe.steps.length>0?Qe.steps[Qe.steps.length-1].delayMs:0;le(we,Qe.steps);const Pe=(Lt=Qe.steps[Qe.steps.length-1])==null?void 0:Lt.event.content;ie(()=>{Pe==="completed"?y(bt=>bt.map(Ge=>Ge.id===Z&&Ge.status==="working"?{...Ge,status:"paused"}:Ge)):Pe==="failed"&&y(bt=>bt.map(Ge=>Ge.id===Z&&Ge.status==="working"?{...Ge,status:"failed"}:Ge))},ct+100,we)}},[fe,Q,le,ie,M,J]),Ce=b.useCallback((Z,ne)=>{console.log("[MockGrackle] sendInput",{sessionId:Z,text:ne}),J({sessionId:Z,eventType:"output",timestamp:new Date().toISOString(),content:`User input: ${ne}`}),M(Z,"running"),J({sessionId:Z,eventType:"status",timestamp:new Date().toISOString(),content:"running"});const ue=ae.current.get(Z);if(ue)ae.current.delete(Z),le(Z,ue);else{const ye=[{delayMs:500,event:{eventType:"output",timestamp:new Date().toISOString(),content:"I received your input, continuing..."}},{delayMs:1500,event:{eventType:"status",timestamp:new Date().toISOString(),content:"completed"}}];le(Z,ye)}const ke=te.current.get(Z);ke&&(te.current.delete(Z),ie(()=>{y(ye=>ye.map(He=>He.id===ke.taskId&&He.status==="working"?{...He,status:"paused"}:He))},ke.delayAfterResume,Z))},[J,M,le,ie]),me=b.useCallback(Z=>{console.log("[MockGrackle] completeTask",Z),y(ne=>ne.map(ue=>ue.id===Z?{...ue,status:"complete"}:ue))},[]),Oe=b.useCallback(Z=>{console.log("[MockGrackle] resumeTask",Z)},[]),wt=b.useCallback((Z,ne,ue,ke,ye)=>{console.log("[MockGrackle] updateTask",{taskId:Z,title:ne}),y(He=>He.map(we=>we.id===Z?{...we,title:ne.trim()||we.title,description:ue,dependsOn:ke,...ye!==void 0?{defaultPersonaId:ye}:{}}:we))},[]),Et=b.useCallback(Z=>{console.log("[MockGrackle] deleteTask",Z),y(ne=>ne.filter(ue=>ue.id!==Z))},[]),Pt=b.useCallback(Z=>{console.log("[MockGrackle] loadFindings",Z),x(iy.filter(ne=>ne.workspaceId===Z))},[]),en=b.useCallback((Z,ne,ue,ke,ye)=>{console.log("[MockGrackle] postFinding",{workspaceId:Z,title:ne});const He={id:fe("find"),workspaceId:Z,taskId:"",sessionId:"",category:ke||"general",title:ne,content:ue,tags:ye||[],createdAt:new Date().toISOString()};x(we=>[...we,He])},[fe]),Me=b.useCallback((Z,ne,ue)=>{console.log("[MockGrackle] addEnvironment",{displayName:Z,adapterType:ne,adapterConfig:ue})},[]),Ve=b.useCallback(()=>{console.log("[MockGrackle] loadTokens")},[]),an=b.useCallback((Z,ne,ue,ke,ye)=>{console.log("[MockGrackle] setToken",{name:Z,tokenType:ue}),C(He=>[...He.filter(mt=>mt.name!==Z),{name:Z,tokenType:ue,envVar:ke,filePath:ye,expiresAt:""}])},[]),Qn=b.useCallback(Z=>{console.log("[MockGrackle] deleteToken",Z),C(ne=>ne.filter(ue=>ue.name!==Z))},[]),dn=b.useCallback(Z=>{console.log("[MockGrackle] updateCredentialProviders",Z),E(Z)},[]);b.useEffect(()=>()=>{B.current.forEach(clearTimeout),B.current.clear()},[]);const ys=b.useMemo(()=>({connected:!0,environments:lC,sessions:a,events:l,eventsDropped:0,lastSpawnedId:d,workspaces:p,tasks:g,findings:v,tokens:S,credentialProviders:w,spawn:Y,sendInput:Ce,kill:pe,refresh:De,loadSessionEvents:se,clearEvents:je,createWorkspace:pt,archiveWorkspace:Ct,updateWorkspace:(Z,ne)=>{console.log("[MockGrackle] updateWorkspace",{workspaceId:Z,...ne}),m(ue=>ue.map(ke=>ke.id!==Z?ke:{...ke,...ne.name!==void 0?{name:ne.name}:{},...ne.description!==void 0?{description:ne.description}:{},...ne.repoUrl!==void 0?{repoUrl:ne.repoUrl}:{},...ne.environmentId!==void 0?{environmentId:ne.environmentId}:{},...ne.worktreeBasePath!==void 0?{worktreeBasePath:ne.worktreeBasePath}:{},...ne.useWorktrees!==void 0?{useWorktrees:ne.useWorktrees}:{},...ne.defaultPersonaId!==void 0?{defaultPersonaId:ne.defaultPersonaId}:{},updatedAt:new Date().toISOString()}))},loadTasks:un,loadAllTasks:()=>{console.log("[MockGrackle] loadAllTasks")},createTask:Jt,startTask:W,stopTask:Z=>{console.log("[MockGrackle] stopTask",{taskId:Z}),me(Z)},completeTask:me,resumeTask:Oe,updateTask:wt,deleteTask:Et,loadFindings:Pt,postFinding:en,addEnvironment:Me,loadTokens:Ve,setToken:an,deleteToken:Qn,updateCredentialProviders:dn,provisionStatus:{},provisionEnvironment:()=>{},stopEnvironment:()=>{},removeEnvironment:()=>{},codespaces:[],codespaceError:"",codespaceListError:"",codespaceCreating:!1,listCodespaces:()=>{},createCodespace:()=>{},workspaceCreating:!1,taskStartingId:void 0,personas:k,createPersona:(Z,ne,ue,ke,ye,He,we,mt)=>{console.log("[MockGrackle] createPersona",{name:Z});const Qe={id:`mock-persona-${Date.now()}`,name:Z,description:ne,systemPrompt:ue,toolConfig:"{}",runtime:ke??"claude-code",model:ye||"",maxTurns:He||0,mcpServers:"[]",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),type:we||"agent",script:mt||""};A(Lt=>[...Lt,Qe])},updatePersona:(Z,ne,ue,ke,ye,He,we,mt,Qe)=>{console.log("[MockGrackle] updatePersona",{personaId:Z,name:ne}),A(Lt=>Lt.map(ct=>ct.id!==Z?ct:{...ct,...ne!==void 0?{name:ne}:{},...ue!==void 0?{description:ue}:{},...ke!==void 0?{systemPrompt:ke}:{},...ye!==void 0?{runtime:ye}:{},...He!==void 0?{model:He}:{},...we!==void 0?{maxTurns:we}:{},...mt!==void 0?{type:mt}:{},...Qe!==void 0?{script:Qe}:{},updatedAt:new Date().toISOString()}))},deletePersona:Z=>{console.log("[MockGrackle] deletePersona",Z),A(ne=>ne.filter(ue=>ue.id!==Z))},taskSessions:j,loadTaskSessions:Z=>{console.log("[MockGrackle] loadTaskSessions",Z)},appDefaultPersonaId:V,setAppDefaultPersonaId:Z=>{console.log("[MockGrackle] setAppDefaultPersonaId",Z),I(Z)},onboardingCompleted:!0,completeOnboarding:()=>{console.log("[MockGrackle] completeOnboarding")}}),[a,l,d,p,g,v,S,w,k,j,V,Y,Ce,pe,De,se,je,pt,Ct,un,Jt,W,me,Oe,wt,Et,Pt,en,Me,Ve,an,Qn,dn]);return c.jsx(ah.Provider,{value:ys,children:n})}const hb=b.createContext(void 0),gC=4e3;function vC({children:n}){const[a,i]=b.useState([]),l=b.useRef(0),r=b.useCallback(u=>{i(p=>p.filter(m=>m.id!==u))},[]),d=b.useCallback((u,p="info",m=gC)=>{const g=`toast-${++l.current}`;i(y=>[...y,{id:g,message:u,variant:p,duration:m}])},[]);return c.jsx(hb.Provider,{value:{toasts:a,showToast:d,dismissToast:r},children:n})}function bl(){const n=b.useContext(hb);if(!n)throw new Error("useToast must be used within ToastProvider");return n}const vc=[{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"]}],pb=new Set(vc.map(n=>n.id)),ry="grackle";function vf(n){return vc.find(a=>a.id===n)}const yf="grackle-theme",mb="grackle-prefer-system",gb="(prefers-color-scheme: dark)";let Wo=[],Zr;function Fd(){Zr=void 0;for(const n of Wo)n()}function bf(){return typeof window>"u"?!1:window.matchMedia(gb).matches}function sl(){if(typeof localStorage>"u")return ry;try{const n=localStorage.getItem(yf);if(n!==null&&pb.has(n))return n}catch{}return ry}function Jr(){if(typeof localStorage>"u")return!1;try{return localStorage.getItem(mb)==="true"}catch{return!1}}function _f(n){return vc.find(a=>a.variantLightId===n||a.variantDarkId===n)}function vb(n,a){const i=vf(n);if(i!=null&&i.variantDarkId)return a&&i.variantLightId?bf()?i.variantDarkId:i.variantLightId:i.variantDarkId;if(i!=null&&i.hidden&&a){const l=_f(n);if(l!=null&&l.variantLightId&&l.variantDarkId)return bf()?l.variantDarkId:l.variantLightId}return n}function Ii(n,a,i=!1){i&&document.documentElement.classList.add("no-transitions"),document.documentElement.dataset.theme=vb(n,a),i&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove("no-transitions")}))}typeof document<"u"&&Ii(sl(),Jr());function yC(){return Zr===void 0&&(Zr={themeId:sl(),systemDark:bf(),preferSystem:Jr()}),Zr}function bC(n){return Wo=[...Wo,n],()=>{Wo=Wo.filter(a=>a!==n)}}function _C(){const n=b.useSyncExternalStore(bC,yC),{themeId:a,preferSystem:i}=n,l=vb(a,i),r=b.useCallback(u=>{if(pb.has(u)){try{localStorage.setItem(yf,u)}catch{}Ii(u,Jr(),!0),Fd()}},[]),d=b.useCallback(u=>{try{localStorage.setItem(mb,u?"true":"false")}catch{}if(u){const p=sl(),m=vf(p);if(m!=null&&m.hidden){const g=_f(p);if(g)try{localStorage.setItem(yf,g.id)}catch{}}}Ii(sl(),u,!0),Fd()},[]);return b.useEffect(()=>{Ii(a,i)},[a,i]),b.useEffect(()=>{if(typeof window>"u")return;const u=window.matchMedia(gb),p=()=>{const m=sl(),g=Jr();if(g){const y=vf(m);if(y!=null&&y.variantDarkId&&y.variantLightId&&Ii(m,g),y!=null&&y.hidden){const v=_f(m);v!=null&&v.variantDarkId&&v.variantLightId&&Ii(m,g)}}Fd()};return u.addEventListener("change",p),()=>{u.removeEventListener("change",p)}},[]),{themeId:a,setTheme:r,resolvedThemeId:l,preferSystem:i,setPreferSystem:d}}const yb=b.createContext(void 0);function xC({children:n}){const a=_C();return c.jsx(yb.Provider,{value:a,children:n})}function bb(){const n=b.useContext(yb);if(!n)throw new Error("useThemeContext must be used within ThemeProvider");return n}const SC="_container_1mq5u_1",TC="_hamburger_1mq5u_33",kC="_brand_1mq5u_49",CC="_brandLogo_1mq5u_68",wC="_info_1mq5u_75",EC="_connectionLabel_1mq5u_90",AC="_connectionDot_1mq5u_103",NC="_connected_1mq5u_106",jC="_disconnected_1mq5u_110",ja={container:SC,hamburger:TC,brand:kC,brandLogo:CC,info:wC,connectionLabel:EC,connectionDot:AC,connected:NC,disconnected:jC};function DC({onToggleSidebar:n,sidebarOpen:a}){const{connected:i,environments:l,sessions:r}=kt(),d=cn(),u=l.length,p=l.filter(g=>g.status==="connected").length,m=r.filter(g=>["running","idle"].includes(g.status)).length;return c.jsxs("div",{className:ja.container,children:[n&&c.jsx("button",{type:"button",className:ja.hamburger,onClick:n,"aria-label":"Toggle sidebar","aria-expanded":a,children:"☰"}),c.jsxs("button",{type:"button",className:ja.brand,onClick:()=>d(qs),title:"Home",children:[c.jsx("img",{src:"/icon-192x192.png",alt:"",className:ja.brandLogo,"aria-hidden":"true","data-testid":"statusbar-logo"}),"Grackle"]}),c.jsxs("div",{className:ja.info,children:[c.jsxs("span",{"aria-label":i?"Connected":"Disconnected",children:[c.jsx("span",{className:`${ja.connectionDot} ${i?ja.connected:ja.disconnected}`,"aria-hidden":"true",children:"●"})," ",c.jsx("span",{className:ja.connectionLabel,"aria-hidden":"true",children:i?"Connected":"Disconnected"})]}),c.jsxs("span",{children:[p,"/",u," env",u!==1?"s":""]}),c.jsxs("span",{children:[m," active"]})]})]})}const MC="_nav_13gkc_1",RC="_tab_13gkc_35",BC="_tabIcon_13gkc_68",OC="_tabLabel_13gkc_79",IC="_tabActive_13gkc_84",Ko={nav:MC,tab:RC,tabIcon:BC,tabLabel:OC,tabActive:IC},Is=[{view:"dashboard",label:"Dashboard",icon:"🏠",route:qs,testId:"sidebar-tab-dashboard"},{view:"chat",label:"Chat",icon:"💬",route:Pk,testId:"sidebar-tab-chat"},{view:"tasks",label:"Tasks",icon:"📋",route:$k,testId:"sidebar-tab-tasks"},{view:"workspaces",label:"Workspaces",icon:"📁",route:Fk,testId:"sidebar-tab-workspaces"},{view:"settings",label:"Settings",icon:"⚙️",route:Hk,testId:"sidebar-tab-settings"}];function _b(n){return n===qs||n==="/"?"dashboard":n.startsWith("/chat")||n.startsWith("/sessions")?"chat":n.startsWith("/workspaces")?"workspaces":n.startsWith(Pi)||n.startsWith("/environments")?"settings":"tasks"}function LC(){const n=qt(),a=cn(),i=b.useRef(null),l=_b(n.pathname),r=b.useCallback(u=>{a(u.route)},[a]),d=b.useCallback(u=>{var v,x;const p=(v=i.current)==null?void 0:v.querySelectorAll('[role="tab"]');if(!p)return;const m=Array.from(p).findIndex(S=>S===document.activeElement),g=m>=0?m:Is.findIndex(S=>S.view===l);let y=g;if(u.key==="ArrowRight")u.preventDefault(),y=(g+1)%Is.length;else if(u.key==="ArrowLeft")u.preventDefault(),y=(g-1+Is.length)%Is.length;else if(u.key==="Home")u.preventDefault(),y=0;else if(u.key==="End")u.preventDefault(),y=Is.length-1;else return;a(Is[y].route),(x=p[y])==null||x.focus()},[l,a]);return c.jsx("nav",{className:Ko.nav,ref:i,role:"tablist","aria-orientation":"horizontal","aria-label":"App navigation",onKeyDown:d,"data-testid":"sidebar-nav",children:Is.map(u=>{const p=u.view===l;return c.jsxs("button",{role:"tab",type:"button","aria-selected":p,tabIndex:p?0:-1,className:`${Ko.tab} ${p?Ko.tabActive:""}`,onClick:()=>r(u),"data-testid":u.testId,title:u.label,"aria-label":u.label,children:[c.jsx("span",{className:Ko.tabIcon,"aria-hidden":"true",children:u.icon}),c.jsx("span",{className:Ko.tabLabel,children:u.label})]},u.view)})})}const sh=b.createContext({});function ih(n){const a=b.useRef(null);return a.current===null&&(a.current=n()),a.current}const yc=b.createContext(null),oh=b.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"});class zC extends b.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 UC({children:n,isPresent:a}){const i=b.useId(),l=b.useRef(null),r=b.useRef({width:0,height:0,top:0,left:0}),{nonce:d}=b.useContext(oh);return b.useInsertionEffect(()=>{const{width:u,height:p,top:m,left:g}=r.current;if(a||!l.current||!u||!p)return;l.current.dataset.motionPopId=i;const y=document.createElement("style");return d&&(y.nonce=d),document.head.appendChild(y),y.sheet&&y.sheet.insertRule(`
|
|
79
|
-
[data-motion-pop-id="${i}"] {
|
|
80
|
-
position: absolute !important;
|
|
81
|
-
width: ${u}px !important;
|
|
82
|
-
height: ${p}px !important;
|
|
83
|
-
top: ${m}px !important;
|
|
84
|
-
left: ${g}px !important;
|
|
85
|
-
}
|
|
86
|
-
`),()=>{document.head.removeChild(y)}},[a]),c.jsx(zC,{isPresent:a,childRef:l,sizeRef:r,children:b.cloneElement(n,{ref:l})})}const VC=({children:n,initial:a,isPresent:i,onExitComplete:l,custom:r,presenceAffectsLayout:d,mode:u})=>{const p=ih(HC),m=b.useId(),g=b.useCallback(v=>{p.set(v,!0);for(const x of p.values())if(!x)return;l&&l()},[p,l]),y=b.useMemo(()=>({id:m,initial:a,isPresent:i,custom:r,onExitComplete:g,register:v=>(p.set(v,!1),()=>p.delete(v))}),d?[Math.random(),g]:[i,g]);return b.useMemo(()=>{p.forEach((v,x)=>p.set(x,!1))},[i]),b.useEffect(()=>{!i&&!p.size&&l&&l()},[i]),u==="popLayout"&&(n=c.jsx(UC,{isPresent:i,children:n})),c.jsx(yc.Provider,{value:y,children:n})};function HC(){return new Map}function xb(n=!0){const a=b.useContext(yc);if(a===null)return[!0,null];const{isPresent:i,onExitComplete:l,register:r}=a,d=b.useId();b.useEffect(()=>{n&&r(d)},[n]);const u=b.useCallback(()=>n&&l&&l(d),[d,l,n]);return!i&&l?[!1,u]:[!0]}const zr=n=>n.key||"";function cy(n){const a=[];return b.Children.forEach(n,i=>{b.isValidElement(i)&&a.push(i)}),a}const lh=typeof window<"u",Sb=lh?b.useLayoutEffect:b.useEffect,_n=({children:n,custom:a,initial:i=!0,onExitComplete:l,presenceAffectsLayout:r=!0,mode:d="sync",propagate:u=!1})=>{const[p,m]=xb(u),g=b.useMemo(()=>cy(n),[n]),y=u&&!p?[]:g.map(zr),v=b.useRef(!0),x=b.useRef(g),S=ih(()=>new Map),[C,w]=b.useState(g),[E,k]=b.useState(g);Sb(()=>{v.current=!1,x.current=g;for(let V=0;V<E.length;V++){const I=zr(E[V]);y.includes(I)?S.delete(I):S.get(I)!==!0&&S.set(I,!1)}},[E,y.length,y.join("-")]);const A=[];if(g!==C){let V=[...g];for(let I=0;I<E.length;I++){const F=E[I],R=zr(F);y.includes(R)||(V.splice(I,0,F),A.push(F))}d==="wait"&&A.length&&(V=A),k(cy(V)),w(g);return}const{forceRender:j}=b.useContext(sh);return c.jsx(c.Fragment,{children:E.map(V=>{const I=zr(V),F=u&&!p?!1:g===E||y.includes(I),R=()=>{if(S.has(I))S.set(I,!0);else return;let B=!0;S.forEach(G=>{G||(B=!1)}),B&&(j==null||j(),k(x.current),u&&(m==null||m()),l&&l())};return c.jsx(VC,{isPresent:F,initial:!v.current||i?void 0:!1,custom:F?void 0:a,presenceAffectsLayout:r,mode:d,onExitComplete:F?void 0:R,children:V},I)})})},Nn=n=>n;let Tb=Nn;const GC={useManualTiming:!1};function PC(n){let a=new Set,i=new Set,l=!1,r=!1;const d=new WeakSet;let u={delta:0,timestamp:0,isProcessing:!1};function p(g){d.has(g)&&(m.schedule(g),n()),g(u)}const m={schedule:(g,y=!1,v=!1)=>{const S=v&&l?a:i;return y&&d.add(g),S.has(g)||S.add(g),g},cancel:g=>{i.delete(g),d.delete(g)},process:g=>{if(u=g,l){r=!0;return}l=!0,[a,i]=[i,a],a.forEach(p),a.clear(),l=!1,r&&(r=!1,m.process(g))}};return m}const Ur=["read","resolveKeyframes","update","preRender","render","postRender"],$C=40;function kb(n,a){let i=!1,l=!0;const r={delta:0,timestamp:0,isProcessing:!1},d=()=>i=!0,u=Ur.reduce((k,A)=>(k[A]=PC(d),k),{}),{read:p,resolveKeyframes:m,update:g,preRender:y,render:v,postRender:x}=u,S=()=>{const k=performance.now();i=!1,r.delta=l?1e3/60:Math.max(Math.min(k-r.timestamp,$C),1),r.timestamp=k,r.isProcessing=!0,p.process(r),m.process(r),g.process(r),y.process(r),v.process(r),x.process(r),r.isProcessing=!1,i&&a&&(l=!1,n(S))},C=()=>{i=!0,l=!0,r.isProcessing||n(S)};return{schedule:Ur.reduce((k,A)=>{const j=u[A];return k[A]=(V,I=!1,F=!1)=>(i||C(),j.schedule(V,I,F)),k},{}),cancel:k=>{for(let A=0;A<Ur.length;A++)u[Ur[A]].cancel(k)},state:r,steps:u}}const{schedule:ht,cancel:ps,state:Wt,steps:qd}=kb(typeof requestAnimationFrame<"u"?requestAnimationFrame:Nn,!0),Cb=b.createContext({strict:!1}),uy={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Fi={};for(const n in uy)Fi[n]={isEnabled:a=>uy[n].some(i=>!!a[i])};function FC(n){for(const a in n)Fi[a]={...Fi[a],...n[a]}}const qC=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 ec(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||qC.has(n)}let wb=n=>!ec(n);function YC(n){n&&(wb=a=>a.startsWith("on")?!ec(a):n(a))}try{YC(require("@emotion/is-prop-valid").default)}catch{}function KC(n,a,i){const l={};for(const r in n)r==="values"&&typeof n.values=="object"||(wb(r)||i===!0&&ec(r)||!a&&!ec(r)||n.draggable&&r.startsWith("onDrag"))&&(l[r]=n[r]);return l}function ZC(n){if(typeof Proxy>"u")return n;const a=new Map,i=(...l)=>n(...l);return new Proxy(i,{get:(l,r)=>r==="create"?n:(a.has(r)||a.set(r,n(r)),a.get(r))})}const bc=b.createContext({});function fl(n){return typeof n=="string"||Array.isArray(n)}function _c(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}const rh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ch=["initial",...rh];function xc(n){return _c(n.animate)||ch.some(a=>fl(n[a]))}function Eb(n){return!!(xc(n)||n.variants)}function XC(n,a){if(xc(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 QC(n){const{initial:a,animate:i}=XC(n,b.useContext(bc));return b.useMemo(()=>({initial:a,animate:i}),[dy(a),dy(i)])}function dy(n){return Array.isArray(n)?n.join(" "):n}const WC=Symbol.for("motionComponentSymbol");function Li(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function JC(n,a,i){return b.useCallback(l=>{l&&n.onMount&&n.onMount(l),a&&(l?a.mount(l):a.unmount()),i&&(typeof i=="function"?i(l):Li(i)&&(i.current=l))},[a])}const uh=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ew="framerAppearId",Ab="data-"+uh(ew),{schedule:dh}=kb(queueMicrotask,!1),Nb=b.createContext({});function tw(n,a,i,l,r){var d,u;const{visualElement:p}=b.useContext(bc),m=b.useContext(Cb),g=b.useContext(yc),y=b.useContext(oh).reducedMotion,v=b.useRef(null);l=l||m.renderer,!v.current&&l&&(v.current=l(n,{visualState:a,parent:p,props:i,presenceContext:g,blockInitialAnimation:g?g.initial===!1:!1,reducedMotionConfig:y}));const x=v.current,S=b.useContext(Nb);x&&!x.projection&&r&&(x.type==="html"||x.type==="svg")&&nw(v.current,i,r,S);const C=b.useRef(!1);b.useInsertionEffect(()=>{x&&C.current&&x.update(i,g)});const w=i[Ab],E=b.useRef(!!w&&!(!((d=window.MotionHandoffIsComplete)===null||d===void 0)&&d.call(window,w))&&((u=window.MotionHasOptimisedAnimation)===null||u===void 0?void 0:u.call(window,w)));return Sb(()=>{x&&(C.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),dh.render(x.render),E.current&&x.animationState&&x.animationState.animateChanges())}),b.useEffect(()=>{x&&(!E.current&&x.animationState&&x.animationState.animateChanges(),E.current&&(queueMicrotask(()=>{var k;(k=window.MotionHandoffMarkAsComplete)===null||k===void 0||k.call(window,w)}),E.current=!1))}),x}function nw(n,a,i,l){const{layoutId:r,layout:d,drag:u,dragConstraints:p,layoutScroll:m,layoutRoot:g}=a;n.projection=new i(n.latestValues,a["data-framer-portal-id"]?void 0:jb(n.parent)),n.projection.setOptions({layoutId:r,layout:d,alwaysMeasureLayout:!!u||p&&Li(p),visualElement:n,animationType:typeof d=="string"?d:"both",initialPromotionConfig:l,layoutScroll:m,layoutRoot:g})}function jb(n){if(n)return n.options.allowProjection!==!1?n.projection:jb(n.parent)}function aw({preloadedFeatures:n,createVisualElement:a,useRender:i,useVisualState:l,Component:r}){var d,u;n&&FC(n);function p(g,y){let v;const x={...b.useContext(oh),...g,layoutId:sw(g)},{isStatic:S}=x,C=QC(g),w=l(g,S);if(!S&&lh){iw();const E=ow(x);v=E.MeasureLayout,C.visualElement=tw(r,w,x,a,E.ProjectionNode)}return c.jsxs(bc.Provider,{value:C,children:[v&&C.visualElement?c.jsx(v,{visualElement:C.visualElement,...x}):null,i(r,g,JC(w,C.visualElement,y),w,S,C.visualElement)]})}p.displayName=`motion.${typeof r=="string"?r:`create(${(u=(d=r.displayName)!==null&&d!==void 0?d:r.name)!==null&&u!==void 0?u:""})`}`;const m=b.forwardRef(p);return m[WC]=r,m}function sw({layoutId:n}){const a=b.useContext(sh).id;return a&&n!==void 0?a+"-"+n:n}function iw(n,a){b.useContext(Cb).strict}function ow(n){const{drag:a,layout:i}=Fi;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 lw=["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 fh(n){return typeof n!="string"||n.includes("-")?!1:!!(lw.indexOf(n)>-1||/[A-Z]/u.test(n))}function fy(n){const a=[{},{}];return n==null||n.values.forEach((i,l)=>{a[0][l]=i.get(),a[1][l]=i.getVelocity()}),a}function hh(n,a,i,l){if(typeof a=="function"){const[r,d]=fy(l);a=a(i!==void 0?i:n.custom,r,d)}if(typeof a=="string"&&(a=n.variants&&n.variants[a]),typeof a=="function"){const[r,d]=fy(l);a=a(i!==void 0?i:n.custom,r,d)}return a}const xf=n=>Array.isArray(n),rw=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),cw=n=>xf(n)?n[n.length-1]||0:n,nn=n=>!!(n&&n.getVelocity);function Xr(n){const a=nn(n)?n.get():n;return rw(a)?a.toValue():a}function uw({scrapeMotionValuesFromProps:n,createRenderState:a,onUpdate:i},l,r,d){const u={latestValues:dw(l,r,d,n),renderState:a()};return i&&(u.onMount=p=>i({props:l,current:p,...u}),u.onUpdate=p=>i(p)),u}const Db=n=>(a,i)=>{const l=b.useContext(bc),r=b.useContext(yc),d=()=>uw(n,a,l,r);return i?d():ih(d)};function dw(n,a,i,l){const r={},d=l(n,{});for(const x in d)r[x]=Xr(d[x]);let{initial:u,animate:p}=n;const m=xc(n),g=Eb(n);a&&g&&!m&&n.inherit!==!1&&(u===void 0&&(u=a.initial),p===void 0&&(p=a.animate));let y=i?i.initial===!1:!1;y=y||u===!1;const v=y?p:u;if(v&&typeof v!="boolean"&&!_c(v)){const x=Array.isArray(v)?v:[v];for(let S=0;S<x.length;S++){const C=hh(n,x[S]);if(C){const{transitionEnd:w,transition:E,...k}=C;for(const A in k){let j=k[A];if(Array.isArray(j)){const V=y?j.length-1:0;j=j[V]}j!==null&&(r[A]=j)}for(const A in w)r[A]=w[A]}}}return r}const Qi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ks=new Set(Qi),Mb=n=>a=>typeof a=="string"&&a.startsWith(n),Rb=Mb("--"),fw=Mb("var(--"),ph=n=>fw(n)?hw.test(n.split("/*")[0].trim()):!1,hw=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Bb=(n,a)=>a&&typeof n=="number"?a.transform(n):n,Ia=(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=>Ia(0,1,n)},Vr={...Wi,default:1},_l=n=>({test:a=>typeof a=="string"&&a.endsWith(n)&&a.split(" ").length===1,parse:parseFloat,transform:a=>`${a}${n}`}),us=_l("deg"),ra=_l("%"),_e=_l("px"),pw=_l("vh"),mw=_l("vw"),hy={...ra,parse:n=>ra.parse(n)/100,transform:n=>ra.transform(n*100)},gw={borderWidth:_e,borderTopWidth:_e,borderRightWidth:_e,borderBottomWidth:_e,borderLeftWidth:_e,borderRadius:_e,radius:_e,borderTopLeftRadius:_e,borderTopRightRadius:_e,borderBottomRightRadius:_e,borderBottomLeftRadius:_e,width:_e,maxWidth:_e,height:_e,maxHeight:_e,top:_e,right:_e,bottom:_e,left:_e,padding:_e,paddingTop:_e,paddingRight:_e,paddingBottom:_e,paddingLeft:_e,margin:_e,marginTop:_e,marginRight:_e,marginBottom:_e,marginLeft:_e,backgroundPositionX:_e,backgroundPositionY:_e},vw={rotate:us,rotateX:us,rotateY:us,rotateZ:us,scale:Vr,scaleX:Vr,scaleY:Vr,scaleZ:Vr,skew:us,skewX:us,skewY:us,distance:_e,translateX:_e,translateY:_e,translateZ:_e,x:_e,y:_e,z:_e,perspective:_e,transformPerspective:_e,opacity:hl,originX:hy,originY:hy,originZ:_e},py={...Wi,transform:Math.round},mh={...gw,...vw,zIndex:py,size:_e,fillOpacity:hl,strokeOpacity:hl,numOctaves:py},yw={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},bw=Qi.length;function _w(n,a,i){let l="",r=!0;for(let d=0;d<bw;d++){const u=Qi[d],p=n[u];if(p===void 0)continue;let m=!0;if(typeof p=="number"?m=p===(u.startsWith("scale")?1:0):m=parseFloat(p)===0,!m||i){const g=Bb(p,mh[u]);if(!m){r=!1;const y=yw[u]||u;l+=`${y}(${g}) `}i&&(a[u]=g)}}return l=l.trim(),i?l=i(a,r?"":l):r&&(l="none"),l}function gh(n,a,i){const{style:l,vars:r,transformOrigin:d}=n;let u=!1,p=!1;for(const m in a){const g=a[m];if(Ks.has(m)){u=!0;continue}else if(Rb(m)){r[m]=g;continue}else{const y=Bb(g,mh[m]);m.startsWith("origin")?(p=!0,d[m]=y):l[m]=y}}if(a.transform||(u||i?l.transform=_w(a,n.transform,i):l.transform&&(l.transform="none")),p){const{originX:m="50%",originY:g="50%",originZ:y=0}=d;l.transformOrigin=`${m} ${g} ${y}`}}const xw={offset:"stroke-dashoffset",array:"stroke-dasharray"},Sw={offset:"strokeDashoffset",array:"strokeDasharray"};function Tw(n,a,i=1,l=0,r=!0){n.pathLength=1;const d=r?xw:Sw;n[d.offset]=_e.transform(-l);const u=_e.transform(a),p=_e.transform(i);n[d.array]=`${u} ${p}`}function my(n,a,i){return typeof n=="string"?n:_e.transform(a+i*n)}function kw(n,a,i){const l=my(a,n.x,n.width),r=my(i,n.y,n.height);return`${l} ${r}`}function vh(n,{attrX:a,attrY:i,attrScale:l,originX:r,originY:d,pathLength:u,pathSpacing:p=1,pathOffset:m=0,...g},y,v){if(gh(n,g,v),y){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:x,style:S,dimensions:C}=n;x.transform&&(C&&(S.transform=x.transform),delete x.transform),C&&(r!==void 0||d!==void 0||S.transform)&&(S.transformOrigin=kw(C,r!==void 0?r:.5,d!==void 0?d:.5)),a!==void 0&&(x.x=a),i!==void 0&&(x.y=i),l!==void 0&&(x.scale=l),u!==void 0&&Tw(x,u,p,m,!1)}const yh=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Ob=()=>({...yh(),attrs:{}}),bh=n=>typeof n=="string"&&n.toLowerCase()==="svg";function Ib(n,{style:a,vars:i},l,r){Object.assign(n.style,a,r&&r.getProjectionStyles(l));for(const d in i)n.style.setProperty(d,i[d])}const Lb=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 zb(n,a,i,l){Ib(n,a,void 0,l);for(const r in a.attrs)n.setAttribute(Lb.has(r)?r:uh(r),a.attrs[r])}const tc={};function Cw(n){Object.assign(tc,n)}function Ub(n,{layout:a,layoutId:i}){return Ks.has(n)||n.startsWith("origin")||(a||i!==void 0)&&(!!tc[n]||n==="opacity")}function _h(n,a,i){var l;const{style:r}=n,d={};for(const u in r)(nn(r[u])||a.style&&nn(a.style[u])||Ub(u,n)||((l=i==null?void 0:i.getValue(u))===null||l===void 0?void 0:l.liveStyle)!==void 0)&&(d[u]=r[u]);return d}function Vb(n,a,i){const l=_h(n,a,i);for(const r in n)if(nn(n[r])||nn(a[r])){const d=Qi.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;l[d]=n[r]}return l}function ww(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"],Ew={useVisualState:Db({scrapeMotionValuesFromProps:Vb,createRenderState:Ob,onUpdate:({props:n,prevProps:a,current:i,renderState:l,latestValues:r})=>{if(!i)return;let d=!!n.drag;if(!d){for(const p in r)if(Ks.has(p)){d=!0;break}}if(!d)return;let u=!a;if(a)for(let p=0;p<gy.length;p++){const m=gy[p];n[m]!==a[m]&&(u=!0)}u&&ht.read(()=>{ww(i,l),ht.render(()=>{vh(l,r,bh(i.tagName),n.transformTemplate),zb(i,l)})})}})},Aw={useVisualState:Db({scrapeMotionValuesFromProps:_h,createRenderState:yh})};function Hb(n,a,i){for(const l in a)!nn(a[l])&&!Ub(l,i)&&(n[l]=a[l])}function Nw({transformTemplate:n},a){return b.useMemo(()=>{const i=yh();return gh(i,a,n),Object.assign({},i.vars,i.style)},[a])}function jw(n,a){const i=n.style||{},l={};return Hb(l,i,n),Object.assign(l,Nw(n,a)),l}function Dw(n,a){const i={},l=jw(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 Mw(n,a,i,l){const r=b.useMemo(()=>{const d=Ob();return vh(d,a,bh(l),n.transformTemplate),{...d.attrs,style:{...d.style}}},[a]);if(n.style){const d={};Hb(d,n.style,n),r.style={...d,...r.style}}return r}function Rw(n=!1){return(i,l,r,{latestValues:d},u)=>{const m=(fh(i)?Mw:Dw)(l,d,u,i),g=KC(l,typeof i=="string",n),y=i!==b.Fragment?{...g,...m,ref:r}:{},{children:v}=l,x=b.useMemo(()=>nn(v)?v.get():v,[v]);return b.createElement(i,{...y,children:x})}}function Bw(n,a){return function(l,{forwardMotionProps:r}={forwardMotionProps:!1}){const u={...fh(l)?Ew:Aw,preloadedFeatures:n,useRender:Rw(r),createVisualElement:a,Component:l};return aw(u)}}function Gb(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 Sc(n,a,i){const l=n.getProps();return hh(l,a,i!==void 0?i:l.custom,n)}function xh(n,a){return n?n[a]||n.default||n:void 0}const Pb=new Set(["width","height","top","left","right","bottom",...Qi]);let Qr;function Ow(){Qr=void 0}const ca={now:()=>(Qr===void 0&&ca.set(Wt.isProcessing||GC.useManualTiming?Wt.timestamp:performance.now()),Qr),set:n=>{Qr=n,queueMicrotask(Ow)}};function Sh(n,a){n.indexOf(a)===-1&&n.push(a)}function Th(n,a){const i=n.indexOf(a);i>-1&&n.splice(i,1)}class kh{constructor(){this.subscriptions=[]}add(a){return Sh(this.subscriptions,a),()=>Th(this.subscriptions,a)}notify(a,i,l){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](a,i,l);else for(let d=0;d<r;d++){const u=this.subscriptions[d];u&&u(a,i,l)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function $b(n,a){return a?n*(1e3/a):0}const vy=30,Iw=n=>!isNaN(parseFloat(n));class Lw{constructor(a,i={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(l,r=!0)=>{const d=ca.now();this.updatedAt!==d&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(l),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&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=ca.now(),this.canTrackVelocity===null&&a!==void 0&&(this.canTrackVelocity=Iw(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 kh);const l=this.events[a].add(i);return a==="change"?()=>{l(),ht.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=ca.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||a-this.updatedAt>vy)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,vy);return $b(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 Lw(n,a)}function zw(n,a,i){n.hasValue(a)?n.getValue(a).set(i):n.addValue(a,pl(i))}function Uw(n,a){const i=Sc(n,a);let{transitionEnd:l={},transition:r={},...d}=i||{};d={...d,...l};for(const u in d){const p=cw(d[u]);zw(n,u,p)}}function Vw(n){return!!(nn(n)&&n.add)}function Sf(n,a){const i=n.getValue("willChange");if(Vw(i))return i.add(a)}function Fb(n){return n.props[Ab]}function Ch(n){let a;return()=>(a===void 0&&(a=n()),a)}const Hw=Ch(()=>window.ScrollTimeline!==void 0);class Gw{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(r=>{if(Hw()&&r.attachTimeline)return r.attachTimeline(a);if(typeof i=="function")return i(r)});return()=>{l.forEach((r,d)=>{r&&r(),this.animations[d].stop()})}}get time(){return this.getAll("time")}set time(a){this.setAll("time",a)}get speed(){return this.getAll("speed")}set speed(a){this.setAll("speed",a)}get startTime(){return this.getAll("startTime")}get duration(){let a=0;for(let i=0;i<this.animations.length;i++)a=Math.max(a,this.animations[i].duration);return a}runAll(a){this.animations.forEach(i=>i[a]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Pw extends Gw{then(a,i){return Promise.all(this.animations).then(a).catch(i)}}const Ma=n=>n*1e3,Ra=n=>n/1e3;function wh(n){return typeof n=="function"}function yy(n,a){n.timeline=a,n.onfinish=null}const Eh=n=>Array.isArray(n)&&typeof n[0]=="number",$w={linearEasing:void 0};function Fw(n,a){const i=Ch(n);return()=>{var l;return(l=$w[a])!==null&&l!==void 0?l:i()}}const nc=Fw(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),qi=(n,a,i)=>{const l=a-n;return l===0?1:(i-n)/l},qb=(n,a,i=10)=>{let l="";const r=Math.max(Math.round(a/i),2);for(let d=0;d<r;d++)l+=n(qi(0,r-1,d))+", ";return`linear(${l.substring(0,l.length-2)})`};function Yb(n){return!!(typeof n=="function"&&nc()||!n||typeof n=="string"&&(n in Tf||nc())||Eh(n)||Array.isArray(n)&&n.every(Yb))}const Jo=([n,a,i,l])=>`cubic-bezier(${n}, ${a}, ${i}, ${l})`,Tf={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Jo([0,.65,.55,1]),circOut:Jo([.55,0,1,.45]),backIn:Jo([.31,.01,.66,-.59]),backOut:Jo([.33,1.53,.69,.99])};function Kb(n,a){if(n)return typeof n=="function"&&nc()?qb(n,a):Eh(n)?Jo(n):Array.isArray(n)?n.map(i=>Kb(i,a)||Tf.easeOut):Tf[n]}const Zb=(n,a,i)=>(((1-3*i+3*a)*n+(3*i-6*a))*n+3*a)*n,qw=1e-7,Yw=12;function Kw(n,a,i,l,r){let d,u,p=0;do u=a+(i-a)/2,d=Zb(u,l,r)-n,d>0?i=u:a=u;while(Math.abs(d)>qw&&++p<Yw);return u}function xl(n,a,i,l){if(n===a&&i===l)return Nn;const r=d=>Kw(d,0,1,n,i);return d=>d===0||d===1?d:Zb(r(d),a,l)}const Xb=n=>a=>a<=.5?n(2*a)/2:(2-n(2*(1-a)))/2,Qb=n=>a=>1-n(1-a),Wb=xl(.33,1.53,.69,.99),Ah=Qb(Wb),Jb=Xb(Ah),e_=n=>(n*=2)<1?.5*Ah(n):.5*(2-Math.pow(2,-10*(n-1))),Nh=n=>1-Math.sin(Math.acos(n)),t_=Qb(Nh),n_=Xb(Nh),a_=n=>/^0[^.\s]+$/u.test(n);function Zw(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||a_(n):!0}const il=n=>Math.round(n*1e5)/1e5,jh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Xw(n){return n==null}const Qw=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Dh=(n,a)=>i=>!!(typeof i=="string"&&Qw.test(i)&&i.startsWith(n)||a&&!Xw(i)&&Object.prototype.hasOwnProperty.call(i,a)),s_=(n,a,i)=>l=>{if(typeof l!="string")return l;const[r,d,u,p]=l.match(jh);return{[n]:parseFloat(r),[a]:parseFloat(d),[i]:parseFloat(u),alpha:p!==void 0?parseFloat(p):1}},Ww=n=>Ia(0,255,n),Yd={...Wi,transform:n=>Math.round(Ww(n))},Ps={test:Dh("rgb","red"),parse:s_("red","green","blue"),transform:({red:n,green:a,blue:i,alpha:l=1})=>"rgba("+Yd.transform(n)+", "+Yd.transform(a)+", "+Yd.transform(i)+", "+il(hl.transform(l))+")"};function Jw(n){let a="",i="",l="",r="";return n.length>5?(a=n.substring(1,3),i=n.substring(3,5),l=n.substring(5,7),r=n.substring(7,9)):(a=n.substring(1,2),i=n.substring(2,3),l=n.substring(3,4),r=n.substring(4,5),a+=a,i+=i,l+=l,r+=r),{red:parseInt(a,16),green:parseInt(i,16),blue:parseInt(l,16),alpha:r?parseInt(r,16)/255:1}}const kf={test:Dh("#"),parse:Jw,transform:Ps.transform},zi={test:Dh("hsl","hue"),parse:s_("hue","saturation","lightness"),transform:({hue:n,saturation:a,lightness:i,alpha:l=1})=>"hsla("+Math.round(n)+", "+ra.transform(il(a))+", "+ra.transform(il(i))+", "+il(hl.transform(l))+")"},tn={test:n=>Ps.test(n)||kf.test(n)||zi.test(n),parse:n=>Ps.test(n)?Ps.parse(n):zi.test(n)?zi.parse(n):kf.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?Ps.transform(n):zi.transform(n)},eE=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function tE(n){var a,i;return isNaN(n)&&typeof n=="string"&&(((a=n.match(jh))===null||a===void 0?void 0:a.length)||0)+(((i=n.match(eE))===null||i===void 0?void 0:i.length)||0)>0}const i_="number",o_="color",nE="var",aE="var(",by="${}",sE=/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:[]},r=[];let d=0;const p=a.replace(sE,m=>(tn.test(m)?(l.color.push(d),r.push(o_),i.push(tn.parse(m))):m.startsWith(aE)?(l.var.push(d),r.push(nE),i.push(m)):(l.number.push(d),r.push(i_),i.push(parseFloat(m))),++d,by)).split(by);return{values:i,split:p,indexes:l,types:r}}function l_(n){return ml(n).values}function r_(n){const{split:a,types:i}=ml(n),l=a.length;return r=>{let d="";for(let u=0;u<l;u++)if(d+=a[u],r[u]!==void 0){const p=i[u];p===i_?d+=il(r[u]):p===o_?d+=tn.transform(r[u]):d+=r[u]}return d}}const iE=n=>typeof n=="number"?0:n;function oE(n){const a=l_(n);return r_(n)(a.map(iE))}const ms={test:tE,parse:l_,createTransformer:r_,getAnimatableNone:oE},lE=new Set(["brightness","contrast","saturate","opacity"]);function rE(n){const[a,i]=n.slice(0,-1).split("(");if(a==="drop-shadow")return n;const[l]=i.match(jh)||[];if(!l)return n;const r=i.replace(l,"");let d=lE.has(a)?1:0;return l!==i&&(d*=100),a+"("+d+r+")"}const cE=/\b([a-z-]*)\(.*?\)/gu,Cf={...ms,getAnimatableNone:n=>{const a=n.match(cE);return a?a.map(rE).join(" "):n}},uE={...mh,color:tn,backgroundColor:tn,outlineColor:tn,fill:tn,stroke:tn,borderColor:tn,borderTopColor:tn,borderRightColor:tn,borderBottomColor:tn,borderLeftColor:tn,filter:Cf,WebkitFilter:Cf},Mh=n=>uE[n];function c_(n,a){let i=Mh(n);return i!==Cf&&(i=ms),i.getAnimatableNone?i.getAnimatableNone(a):void 0}const dE=new Set(["auto","none","0"]);function fE(n,a,i){let l=0,r;for(;l<n.length&&!r;){const d=n[l];typeof d=="string"&&!dE.has(d)&&ml(d).values.length&&(r=n[l]),l++}if(r&&i)for(const d of a)n[d]=c_(i,r)}const _y=n=>n===Wi||n===_e,xy=(n,a)=>parseFloat(n.split(", ")[a]),Sy=(n,a)=>(i,{transform:l})=>{if(l==="none"||!l)return 0;const r=l.match(/^matrix3d\((.+)\)$/u);if(r)return xy(r[1],a);{const d=l.match(/^matrix\((.+)\)$/u);return d?xy(d[1],n):0}},hE=new Set(["x","y","z"]),pE=Qi.filter(n=>!hE.has(n));function mE(n){const a=[];return pE.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:Sy(4,13),y:Sy(5,14)};Yi.translateX=Yi.x;Yi.translateY=Yi.y;const Fs=new Set;let wf=!1,Ef=!1;function u_(){if(Ef){const n=Array.from(Fs).filter(l=>l.needsMeasurement),a=new Set(n.map(l=>l.element)),i=new Map;a.forEach(l=>{const r=mE(l);r.length&&(i.set(l,r),l.render())}),n.forEach(l=>l.measureInitialState()),a.forEach(l=>{l.render();const r=i.get(l);r&&r.forEach(([d,u])=>{var p;(p=l.getValue(d))===null||p===void 0||p.set(u)})}),n.forEach(l=>l.measureEndState()),n.forEach(l=>{l.suspendedScrollY!==void 0&&window.scrollTo(0,l.suspendedScrollY)})}Ef=!1,wf=!1,Fs.forEach(n=>n.complete()),Fs.clear()}function d_(){Fs.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(Ef=!0)})}function gE(){d_(),u_()}class Rh{constructor(a,i,l,r,d,u=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...a],this.onComplete=i,this.name=l,this.motionValue=r,this.element=d,this.isAsync=u}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Fs.add(this),wf||(wf=!0,ht.read(d_),ht.resolveKeyframes(u_))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:a,name:i,element:l,motionValue:r}=this;for(let d=0;d<a.length;d++)if(a[d]===null)if(d===0){const u=r==null?void 0:r.get(),p=a[a.length-1];if(u!==void 0)a[0]=u;else if(l&&i){const m=l.readValue(i,p);m!=null&&(a[0]=m)}a[0]===void 0&&(a[0]=p),r&&u===void 0&&r.set(a[0])}else a[d]=a[d-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Fs.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Fs.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const f_=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),vE=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function yE(n){const a=vE.exec(n);if(!a)return[,];const[,i,l,r]=a;return[`--${i??l}`,r]}function h_(n,a,i=1){const[l,r]=yE(n);if(!l)return;const d=window.getComputedStyle(a).getPropertyValue(l);if(d){const u=d.trim();return f_(u)?parseFloat(u):u}return ph(r)?h_(r,a,i+1):r}const p_=n=>a=>a.test(n),bE={test:n=>n==="auto",parse:n=>n},m_=[Wi,_e,ra,us,mw,pw,bE],Ty=n=>m_.find(p_(n));class g_ extends Rh{constructor(a,i,l,r,d){super(a,i,l,r,d,!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 g=a[m];if(typeof g=="string"&&(g=g.trim(),ph(g))){const y=h_(g,i.current);y!==void 0&&(a[m]=y),m===a.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!Pb.has(l)||a.length!==2)return;const[r,d]=a,u=Ty(r),p=Ty(d);if(u!==p)if(_y(u)&&_y(p))for(let m=0;m<a.length;m++){const g=a[m];typeof g=="string"&&(a[m]=parseFloat(g))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:a,name:i}=this,l=[];for(let r=0;r<a.length;r++)Zw(a[r])&&l.push(r);l.length&&fE(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 r=i[i.length-1];r!==void 0&&a.getValue(l,r).jump(r,!1)}measureEndState(){var a;const{element:i,name:l,unresolvedKeyframes:r}=this;if(!i||!i.current)return;const d=i.getValue(l);d&&d.jump(this.measuredOrigin,!1);const u=r.length-1,p=r[u];r[u]=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,g])=>{i.getValue(m).set(g)}),this.resolveNoneKeyframes()}}const ky=(n,a)=>a==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(ms.test(n)||n==="0")&&!n.startsWith("url("));function _E(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 xE(n,a,i,l){const r=n[0];if(r===null)return!1;if(a==="display"||a==="visibility")return!0;const d=n[n.length-1],u=ky(r,a),p=ky(d,a);return!u||!p?!1:_E(n)||(i==="spring"||wh(i))&&l}const SE=n=>n!==null;function Tc(n,{repeat:a,repeatType:i="loop"},l){const r=n.filter(SE),d=a&&i!=="loop"&&a%2===1?0:r.length-1;return!d||l===void 0?r[d]:l}const TE=40;class v_{constructor({autoplay:a=!0,delay:i=0,type:l="keyframes",repeat:r=0,repeatDelay:d=0,repeatType:u="loop",...p}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=ca.now(),this.options={autoplay:a,delay:i,type:l,repeat:r,repeatDelay:d,repeatType:u,...p},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>TE?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&gE(),this._resolved}onKeyframesResolved(a,i){this.resolvedAt=ca.now(),this.hasAttemptedResolve=!0;const{name:l,type:r,velocity:d,delay:u,onComplete:p,onUpdate:m,isGenerator:g}=this.options;if(!g&&!xE(a,l,r,d))if(u)this.options.duration=0;else{m&&m(Tc(a,this.options,i)),p&&p(),this.resolveFinishedPromise();return}const y=this.initPlayback(a,i);y!==!1&&(this._resolved={keyframes:a,finalKeyframe:i,...y},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 Af=2e4;function y_(n){let a=0;const i=50;let l=n.next(a);for(;!l.done&&a<Af;)a+=i,l=n.next(a);return a>=Af?1/0:a}const _t=(n,a,i)=>n+(a-n)*i;function Kd(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 kE({hue:n,saturation:a,lightness:i,alpha:l}){n/=360,a/=100,i/=100;let r=0,d=0,u=0;if(!a)r=d=u=i;else{const p=i<.5?i*(1+a):i+a-i*a,m=2*i-p;r=Kd(m,p,n+1/3),d=Kd(m,p,n),u=Kd(m,p,n-1/3)}return{red:Math.round(r*255),green:Math.round(d*255),blue:Math.round(u*255),alpha:l}}function ac(n,a){return i=>i>0?a:n}const Zd=(n,a,i)=>{const l=n*n,r=i*(a*a-l)+l;return r<0?0:Math.sqrt(r)},CE=[kf,Ps,zi],wE=n=>CE.find(a=>a.test(n));function Cy(n){const a=wE(n);if(!a)return!1;let i=a.parse(n);return a===zi&&(i=kE(i)),i}const wy=(n,a)=>{const i=Cy(n),l=Cy(a);if(!i||!l)return ac(n,a);const r={...i};return d=>(r.red=Zd(i.red,l.red,d),r.green=Zd(i.green,l.green,d),r.blue=Zd(i.blue,l.blue,d),r.alpha=_t(i.alpha,l.alpha,d),Ps.transform(r))},EE=(n,a)=>i=>a(n(i)),Sl=(...n)=>n.reduce(EE),Nf=new Set(["none","hidden"]);function AE(n,a){return Nf.has(n)?i=>i<=0?n:a:i=>i>=1?a:n}function NE(n,a){return i=>_t(n,a,i)}function Bh(n){return typeof n=="number"?NE:typeof n=="string"?ph(n)?ac:tn.test(n)?wy:ME:Array.isArray(n)?b_:typeof n=="object"?tn.test(n)?wy:jE:ac}function b_(n,a){const i=[...n],l=i.length,r=n.map((d,u)=>Bh(d)(d,a[u]));return d=>{for(let u=0;u<l;u++)i[u]=r[u](d);return i}}function jE(n,a){const i={...n,...a},l={};for(const r in i)n[r]!==void 0&&a[r]!==void 0&&(l[r]=Bh(n[r])(n[r],a[r]));return r=>{for(const d in l)i[d]=l[d](r);return i}}function DE(n,a){var i;const l=[],r={color:0,var:0,number:0};for(let d=0;d<a.values.length;d++){const u=a.types[d],p=n.indexes[u][r[u]],m=(i=n.values[p])!==null&&i!==void 0?i:0;l[d]=m,r[u]++}return l}const ME=(n,a)=>{const i=ms.createTransformer(a),l=ml(n),r=ml(a);return l.indexes.var.length===r.indexes.var.length&&l.indexes.color.length===r.indexes.color.length&&l.indexes.number.length>=r.indexes.number.length?Nf.has(n)&&!r.values.length||Nf.has(a)&&!l.values.length?AE(n,a):Sl(b_(DE(l,r),r.values),i):ac(n,a)};function __(n,a,i){return typeof n=="number"&&typeof a=="number"&&typeof i=="number"?_t(n,a,i):Bh(n)(n,a)}const RE=5;function x_(n,a,i){const l=Math.max(a-RE,0);return $b(i-n(l),a-l)}const Tt={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},Xd=.001;function BE({duration:n=Tt.duration,bounce:a=Tt.bounce,velocity:i=Tt.velocity,mass:l=Tt.mass}){let r,d,u=1-a;u=Ia(Tt.minDamping,Tt.maxDamping,u),n=Ia(Tt.minDuration,Tt.maxDuration,Ra(n)),u<1?(r=g=>{const y=g*u,v=y*n,x=y-i,S=jf(g,u),C=Math.exp(-v);return Xd-x/S*C},d=g=>{const v=g*u*n,x=v*i+i,S=Math.pow(u,2)*Math.pow(g,2)*n,C=Math.exp(-v),w=jf(Math.pow(g,2),u);return(-r(g)+Xd>0?-1:1)*((x-S)*C)/w}):(r=g=>{const y=Math.exp(-g*n),v=(g-i)*n+1;return-Xd+y*v},d=g=>{const y=Math.exp(-g*n),v=(i-g)*(n*n);return y*v});const p=5/n,m=IE(r,d,p);if(n=Ma(n),isNaN(m))return{stiffness:Tt.stiffness,damping:Tt.damping,duration:n};{const g=Math.pow(m,2)*l;return{stiffness:g,damping:u*2*Math.sqrt(l*g),duration:n}}}const OE=12;function IE(n,a,i){let l=i;for(let r=1;r<OE;r++)l=l-n(l)/a(l);return l}function jf(n,a){return n*Math.sqrt(1-a*a)}const LE=["duration","bounce"],zE=["stiffness","damping","mass"];function Ey(n,a){return a.some(i=>n[i]!==void 0)}function UE(n){let a={velocity:Tt.velocity,stiffness:Tt.stiffness,damping:Tt.damping,mass:Tt.mass,isResolvedFromDuration:!1,...n};if(!Ey(n,zE)&&Ey(n,LE))if(n.visualDuration){const i=n.visualDuration,l=2*Math.PI/(i*1.2),r=l*l,d=2*Ia(.05,1,1-(n.bounce||0))*Math.sqrt(r);a={...a,mass:Tt.mass,stiffness:r,damping:d}}else{const i=BE(n);a={...a,...i,mass:Tt.mass},a.isResolvedFromDuration=!0}return a}function S_(n=Tt.visualDuration,a=Tt.bounce){const i=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:a}:n;let{restSpeed:l,restDelta:r}=i;const d=i.keyframes[0],u=i.keyframes[i.keyframes.length-1],p={done:!1,value:d},{stiffness:m,damping:g,mass:y,duration:v,velocity:x,isResolvedFromDuration:S}=UE({...i,velocity:-Ra(i.velocity||0)}),C=x||0,w=g/(2*Math.sqrt(m*y)),E=u-d,k=Ra(Math.sqrt(m/y)),A=Math.abs(E)<5;l||(l=A?Tt.restSpeed.granular:Tt.restSpeed.default),r||(r=A?Tt.restDelta.granular:Tt.restDelta.default);let j;if(w<1){const I=jf(k,w);j=F=>{const R=Math.exp(-w*k*F);return u-R*((C+w*k*E)/I*Math.sin(I*F)+E*Math.cos(I*F))}}else if(w===1)j=I=>u-Math.exp(-k*I)*(E+(C+k*E)*I);else{const I=k*Math.sqrt(w*w-1);j=F=>{const R=Math.exp(-w*k*F),B=Math.min(I*F,300);return u-R*((C+w*k*E)*Math.sinh(B)+I*E*Math.cosh(B))/I}}const V={calculatedDuration:S&&v||null,next:I=>{const F=j(I);if(S)p.done=I>=v;else{let R=0;w<1&&(R=I===0?Ma(C):x_(j,I,F));const B=Math.abs(R)<=l,G=Math.abs(u-F)<=r;p.done=B&&G}return p.value=p.done?u:F,p},toString:()=>{const I=Math.min(y_(V),Af),F=qb(R=>V.next(I*R).value,I,30);return I+"ms "+F}};return V}function Ay({keyframes:n,velocity:a=0,power:i=.8,timeConstant:l=325,bounceDamping:r=10,bounceStiffness:d=500,modifyTarget:u,min:p,max:m,restDelta:g=.5,restSpeed:y}){const v=n[0],x={done:!1,value:v},S=B=>p!==void 0&&B<p||m!==void 0&&B>m,C=B=>p===void 0?m:m===void 0||Math.abs(p-B)<Math.abs(m-B)?p:m;let w=i*a;const E=v+w,k=u===void 0?E:u(E);k!==E&&(w=k-v);const A=B=>-w*Math.exp(-B/l),j=B=>k+A(B),V=B=>{const G=A(B),ee=j(B);x.done=Math.abs(G)<=g,x.value=x.done?k:ee};let I,F;const R=B=>{S(x.value)&&(I=B,F=S_({keyframes:[x.value,C(x.value)],velocity:x_(j,B,x.value),damping:r,stiffness:d,restDelta:g,restSpeed:y}))};return R(0),{calculatedDuration:null,next:B=>{let G=!1;return!F&&I===void 0&&(G=!0,V(B),R(B)),I!==void 0&&B>=I?F.next(B-I):(!G&&V(B),x)}}}const VE=xl(.42,0,1,1),HE=xl(0,0,.58,1),T_=xl(.42,0,.58,1),GE=n=>Array.isArray(n)&&typeof n[0]!="number",PE={linear:Nn,easeIn:VE,easeInOut:T_,easeOut:HE,circIn:Nh,circInOut:n_,circOut:t_,backIn:Ah,backInOut:Jb,backOut:Wb,anticipate:e_},Ny=n=>{if(Eh(n)){Tb(n.length===4);const[a,i,l,r]=n;return xl(a,i,l,r)}else if(typeof n=="string")return PE[n];return n};function $E(n,a,i){const l=[],r=i||__,d=n.length-1;for(let u=0;u<d;u++){let p=r(n[u],n[u+1]);if(a){const m=Array.isArray(a)?a[u]||Nn:a;p=Sl(m,p)}l.push(p)}return l}function FE(n,a,{clamp:i=!0,ease:l,mixer:r}={}){const d=n.length;if(Tb(d===a.length),d===1)return()=>a[0];if(d===2&&a[0]===a[1])return()=>a[1];const u=n[0]===n[1];n[0]>n[d-1]&&(n=[...n].reverse(),a=[...a].reverse());const p=$E(a,l,r),m=p.length,g=y=>{if(u&&y<n[0])return a[0];let v=0;if(m>1)for(;v<n.length-2&&!(y<n[v+1]);v++);const x=qi(n[v],n[v+1],y);return p[v](x)};return i?y=>g(Ia(n[0],n[d-1],y)):g}function qE(n,a){const i=n[n.length-1];for(let l=1;l<=a;l++){const r=qi(0,a,l);n.push(_t(i,1,r))}}function YE(n){const a=[0];return qE(a,n.length-1),a}function KE(n,a){return n.map(i=>i*a)}function ZE(n,a){return n.map(()=>a||T_).splice(0,n.length-1)}function sc({duration:n=300,keyframes:a,times:i,ease:l="easeInOut"}){const r=GE(l)?l.map(Ny):Ny(l),d={done:!1,value:a[0]},u=KE(i&&i.length===a.length?i:YE(a),n),p=FE(u,a,{ease:Array.isArray(r)?r:ZE(a,r)});return{calculatedDuration:n,next:m=>(d.value=p(m),d.done=m>=n,d)}}const XE=n=>{const a=({timestamp:i})=>n(i);return{start:()=>ht.update(a,!0),stop:()=>ps(a),now:()=>Wt.isProcessing?Wt.timestamp:ca.now()}},QE={decay:Ay,inertia:Ay,tween:sc,keyframes:sc,spring:S_},WE=n=>n/100;class Oh extends v_{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:r,keyframes:d}=this.options,u=(r==null?void 0:r.KeyframeResolver)||Rh,p=(m,g)=>this.onKeyframesResolved(m,g);this.resolver=new u(d,p,i,l,r),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:r=0,repeatType:d,velocity:u=0}=this.options,p=wh(i)?i:QE[i]||sc;let m,g;p!==sc&&typeof a[0]!="number"&&(m=Sl(WE,__(a[0],a[1])),a=[0,100]);const y=p({...this.options,keyframes:a});d==="mirror"&&(g=p({...this.options,keyframes:[...a].reverse(),velocity:-u})),y.calculatedDuration===null&&(y.calculatedDuration=y_(y));const{calculatedDuration:v}=y,x=v+r,S=x*(l+1)-r;return{generator:y,mirroredGenerator:g,mapPercentToKeyframes:m,calculatedDuration:v,resolvedDuration:x,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:r,generator:d,mirroredGenerator:u,mapPercentToKeyframes:p,keyframes:m,calculatedDuration:g,totalDuration:y,resolvedDuration:v}=l;if(this.startTime===null)return d.next(0);const{delay:x,repeat:S,repeatType:C,repeatDelay:w,onUpdate:E}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,a):this.speed<0&&(this.startTime=Math.min(a-y/this.speed,this.startTime)),i?this.currentTime=a:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(a-this.startTime)*this.speed;const k=this.currentTime-x*(this.speed>=0?1:-1),A=this.speed>=0?k<0:k>y;this.currentTime=Math.max(k,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=y);let j=this.currentTime,V=d;if(S){const B=Math.min(this.currentTime,y)/v;let G=Math.floor(B),ee=B%1;!ee&&B>=1&&(ee=1),ee===1&&G--,G=Math.min(G,S+1),!!(G%2)&&(C==="reverse"?(ee=1-ee,w&&(ee-=w/v)):C==="mirror"&&(V=u)),j=Ia(0,1,ee)*v}const I=A?{done:!1,value:m[0]}:V.next(j);p&&(I.value=p(I.value));let{done:F}=I;!A&&g!==null&&(F=this.speed>=0?this.currentTime>=y:this.currentTime<=0);const R=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&F);return R&&r!==void 0&&(I.value=Tc(m,this.options,r)),E&&E(I.value),R&&this.finish(),I}get duration(){const{resolved:a}=this;return a?Ra(a.calculatedDuration):0}get time(){return Ra(this.currentTime)}set time(a){a=Ma(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=Ra(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:a=XE,onPlay:i,startTime:l}=this.options;this.driver||(this.driver=a(d=>this.tick(d))),i&&i();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):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 JE=new Set(["opacity","clipPath","filter","transform"]);function eA(n,a,i,{delay:l=0,duration:r=300,repeat:d=0,repeatType:u="loop",ease:p="easeInOut",times:m}={}){const g={[a]:i};m&&(g.offset=m);const y=Kb(p,r);return Array.isArray(y)&&(g.easing=y),n.animate(g,{delay:l,duration:r,easing:Array.isArray(y)?"linear":y,fill:"both",iterations:d+1,direction:u==="reverse"?"alternate":"normal"})}const tA=Ch(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),ic=10,nA=2e4;function aA(n){return wh(n.type)||n.type==="spring"||!Yb(n.ease)}function sA(n,a){const i=new Oh({...a,keyframes:n,repeat:0,delay:0,isGenerator:!0});let l={done:!1,value:n[0]};const r=[];let d=0;for(;!l.done&&d<nA;)l=i.sample(d),r.push(l.value),d+=ic;return{times:void 0,keyframes:r,duration:d-ic,ease:"linear"}}const k_={anticipate:e_,backInOut:Jb,circInOut:n_};function iA(n){return n in k_}class jy extends v_{constructor(a){super(a);const{name:i,motionValue:l,element:r,keyframes:d}=this.options;this.resolver=new g_(d,(u,p)=>this.onKeyframesResolved(u,p),i,l,r),this.resolver.scheduleResolve()}initPlayback(a,i){let{duration:l=300,times:r,ease:d,type:u,motionValue:p,name:m,startTime:g}=this.options;if(!p.owner||!p.owner.current)return!1;if(typeof d=="string"&&nc()&&iA(d)&&(d=k_[d]),aA(this.options)){const{onComplete:v,onUpdate:x,motionValue:S,element:C,...w}=this.options,E=sA(a,w);a=E.keyframes,a.length===1&&(a[1]=a[0]),l=E.duration,r=E.times,d=E.ease,u="keyframes"}const y=eA(p.owner.current,m,a,{...this.options,duration:l,times:r,ease:d});return y.startTime=g??this.calcStartTime(),this.pendingTimeline?(yy(y,this.pendingTimeline),this.pendingTimeline=void 0):y.onfinish=()=>{const{onComplete:v}=this.options;p.set(Tc(a,this.options,i)),v&&v(),this.cancel(),this.resolveFinishedPromise()},{animation:y,duration:l,times:r,type:u,ease:d,keyframes:a}}get duration(){const{resolved:a}=this;if(!a)return 0;const{duration:i}=a;return Ra(i)}get time(){const{resolved:a}=this;if(!a)return 0;const{animation:i}=a;return Ra(i.currentTime||0)}set time(a){const{resolved:i}=this;if(!i)return;const{animation:l}=i;l.currentTime=Ma(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 Nn;const{animation:l}=i;yy(l,a)}return Nn}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:r,type:d,ease:u,times:p}=a;if(i.playState==="idle"||i.playState==="finished")return;if(this.time){const{motionValue:g,onUpdate:y,onComplete:v,element:x,...S}=this.options,C=new Oh({...S,keyframes:l,duration:r,type:d,ease:u,times:p,isGenerator:!0}),w=Ma(this.time);g.setWithVelocity(C.sample(w-ic).value,C.sample(w).value,ic)}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:r,repeatType:d,damping:u,type:p}=a;if(!i||!i.owner||!(i.owner.current instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:g}=i.owner.getProps();return tA()&&l&&JE.has(l)&&!m&&!g&&!r&&d!=="mirror"&&u!==0&&p!=="inertia"}}const oA={type:"spring",stiffness:500,damping:25,restSpeed:10},lA=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),rA={type:"keyframes",duration:.8},cA={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},uA=(n,{keyframes:a})=>a.length>2?rA:Ks.has(n)?n.startsWith("scale")?lA(a[1]):oA:cA;function dA({when:n,delay:a,delayChildren:i,staggerChildren:l,staggerDirection:r,repeat:d,repeatType:u,repeatDelay:p,from:m,elapsed:g,...y}){return!!Object.keys(y).length}const Ih=(n,a,i,l={},r,d)=>u=>{const p=xh(l,n)||{},m=p.delay||l.delay||0;let{elapsed:g=0}=l;g=g-Ma(m);let y={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:a.getVelocity(),...p,delay:-g,onUpdate:x=>{a.set(x),p.onUpdate&&p.onUpdate(x)},onComplete:()=>{u(),p.onComplete&&p.onComplete()},name:n,motionValue:a,element:d?void 0:r};dA(p)||(y={...y,...uA(n,y)}),y.duration&&(y.duration=Ma(y.duration)),y.repeatDelay&&(y.repeatDelay=Ma(y.repeatDelay)),y.from!==void 0&&(y.keyframes[0]=y.from);let v=!1;if((y.type===!1||y.duration===0&&!y.repeatDelay)&&(y.duration=0,y.delay===0&&(v=!0)),v&&!d&&a.get()!==void 0){const x=Tc(y.keyframes,p);if(x!==void 0)return ht.update(()=>{y.onUpdate(x),y.onComplete()}),new Pw([])}return!d&&jy.supports(y)?new jy(y):new Oh(y)};function fA({protectedKeys:n,needsAnimating:a},i){const l=n.hasOwnProperty(i)&&a[i]!==!0;return a[i]=!1,l}function C_(n,a,{delay:i=0,transitionOverride:l,type:r}={}){var d;let{transition:u=n.getDefaultTransition(),transitionEnd:p,...m}=a;l&&(u=l);const g=[],y=r&&n.animationState&&n.animationState.getState()[r];for(const v in m){const x=n.getValue(v,(d=n.latestValues[v])!==null&&d!==void 0?d:null),S=m[v];if(S===void 0||y&&fA(y,v))continue;const C={delay:i,...xh(u||{},v)};let w=!1;if(window.MotionHandoffAnimation){const k=Fb(n);if(k){const A=window.MotionHandoffAnimation(k,v,ht);A!==null&&(C.startTime=A,w=!0)}}Sf(n,v),x.start(Ih(v,x,S,n.shouldReduceMotion&&Pb.has(v)?{type:!1}:C,n,w));const E=x.animation;E&&g.push(E)}return p&&Promise.all(g).then(()=>{ht.update(()=>{p&&Uw(n,p)})}),g}function Df(n,a,i={}){var l;const r=Sc(n,a,i.type==="exit"?(l=n.presenceContext)===null||l===void 0?void 0:l.custom:void 0);let{transition:d=n.getDefaultTransition()||{}}=r||{};i.transitionOverride&&(d=i.transitionOverride);const u=r?()=>Promise.all(C_(n,r,i)):()=>Promise.resolve(),p=n.variantChildren&&n.variantChildren.size?(g=0)=>{const{delayChildren:y=0,staggerChildren:v,staggerDirection:x}=d;return hA(n,a,y+g,v,x,i)}:()=>Promise.resolve(),{when:m}=d;if(m){const[g,y]=m==="beforeChildren"?[u,p]:[p,u];return g().then(()=>y())}else return Promise.all([u(),p(i.delay)])}function hA(n,a,i=0,l=0,r=1,d){const u=[],p=(n.variantChildren.size-1)*l,m=r===1?(g=0)=>g*l:(g=0)=>p-g*l;return Array.from(n.variantChildren).sort(pA).forEach((g,y)=>{g.notify("AnimationStart",a),u.push(Df(g,a,{...d,delay:i+m(y)}).then(()=>g.notify("AnimationComplete",a)))}),Promise.all(u)}function pA(n,a){return n.sortNodePosition(a)}function mA(n,a,i={}){n.notify("AnimationStart",a);let l;if(Array.isArray(a)){const r=a.map(d=>Df(n,d,i));l=Promise.all(r)}else if(typeof a=="string")l=Df(n,a,i);else{const r=typeof a=="function"?Sc(n,a,i.custom):a;l=Promise.all(C_(n,r,i))}return l.then(()=>{n.notify("AnimationComplete",a)})}const gA=ch.length;function w_(n){if(!n)return;if(!n.isControllingVariants){const i=n.parent?w_(n.parent)||{}:{};return n.props.initial!==void 0&&(i.initial=n.props.initial),i}const a={};for(let i=0;i<gA;i++){const l=ch[i],r=n.props[l];(fl(r)||r===!1)&&(a[l]=r)}return a}const vA=[...rh].reverse(),yA=rh.length;function bA(n){return a=>Promise.all(a.map(({animation:i,options:l})=>mA(n,i,l)))}function _A(n){let a=bA(n),i=Dy(),l=!0;const r=m=>(g,y)=>{var v;const x=Sc(n,y,m==="exit"?(v=n.presenceContext)===null||v===void 0?void 0:v.custom:void 0);if(x){const{transition:S,transitionEnd:C,...w}=x;g={...g,...w,...C}}return g};function d(m){a=m(n)}function u(m){const{props:g}=n,y=w_(n.parent)||{},v=[],x=new Set;let S={},C=1/0;for(let E=0;E<yA;E++){const k=vA[E],A=i[k],j=g[k]!==void 0?g[k]:y[k],V=fl(j),I=k===m?A.isActive:null;I===!1&&(C=E);let F=j===y[k]&&j!==g[k]&&V;if(F&&l&&n.manuallyAnimateOnMount&&(F=!1),A.protectedKeys={...S},!A.isActive&&I===null||!j&&!A.prevProp||_c(j)||typeof j=="boolean")continue;const R=xA(A.prevProp,j);let B=R||k===m&&A.isActive&&!F&&V||E>C&&V,G=!1;const ee=Array.isArray(j)?j:[j];let ae=ee.reduce(r(k),{});I===!1&&(ae={});const{prevResolvedValues:te={}}=A,fe={...te,...ae},Q=M=>{B=!0,x.has(M)&&(G=!0,x.delete(M)),A.needsAnimating[M]=!0;const J=n.getValue(M);J&&(J.liveStyle=!1)};for(const M in fe){const J=ae[M],le=te[M];if(S.hasOwnProperty(M))continue;let Y=!1;xf(J)&&xf(le)?Y=!Gb(J,le):Y=J!==le,Y?J!=null?Q(M):x.add(M):J!==void 0&&x.has(M)?Q(M):A.protectedKeys[M]=!0}A.prevProp=j,A.prevResolvedValues=ae,A.isActive&&(S={...S,...ae}),l&&n.blockInitialAnimation&&(B=!1),B&&(!(F&&R)||G)&&v.push(...ee.map(M=>({animation:M,options:{type:k}})))}if(x.size){const E={};x.forEach(k=>{const A=n.getBaseTarget(k),j=n.getValue(k);j&&(j.liveStyle=!0),E[k]=A??null}),v.push({animation:E})}let w=!!v.length;return l&&(g.initial===!1||g.initial===g.animate)&&!n.manuallyAnimateOnMount&&(w=!1),l=!1,w?a(v):Promise.resolve()}function p(m,g){var y;if(i[m].isActive===g)return Promise.resolve();(y=n.variantChildren)===null||y===void 0||y.forEach(x=>{var S;return(S=x.animationState)===null||S===void 0?void 0:S.setActive(m,g)}),i[m].isActive=g;const v=u(m);for(const x in i)i[x].protectedKeys={};return v}return{animateChanges:u,setActive:p,setAnimateFunction:d,getState:()=>i,reset:()=>{i=Dy(),l=!0}}}function xA(n,a){return typeof a=="string"?a!==n:Array.isArray(a)?!Gb(a,n):!1}function Ls(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Dy(){return{animate:Ls(!0),whileInView:Ls(),whileHover:Ls(),whileTap:Ls(),whileDrag:Ls(),whileFocus:Ls(),exit:Ls()}}class gs{constructor(a){this.isMounted=!1,this.node=a}update(){}}class SA extends gs{constructor(a){super(a),a.animationState||(a.animationState=_A(a))}updateAnimationControlsSubscription(){const{animate:a}=this.node.getProps();_c(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 TA=0;class kA extends gs{constructor(){super(...arguments),this.id=TA++}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 r=this.node.animationState.setActive("exit",!a);i&&!a&&r.then(()=>i(this.id))}mount(){const{register:a}=this.node.presenceContext||{};a&&(this.unmount=a(this.id))}unmount(){}}const CA={animation:{Feature:SA},exit:{Feature:kA}},Zn={x:!1,y:!1};function E_(){return Zn.x||Zn.y}function wA(n){return n==="x"||n==="y"?Zn[n]?null:(Zn[n]=!0,()=>{Zn[n]=!1}):Zn.x||Zn.y?null:(Zn.x=Zn.y=!0,()=>{Zn.x=Zn.y=!1})}const Lh=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1;function gl(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 EA=n=>a=>Lh(a)&&n(a,Tl(a));function ol(n,a,i,l){return gl(n,a,EA(i),l)}const My=(n,a)=>Math.abs(n-a);function AA(n,a){const i=My(n.x,a.x),l=My(n.y,a.y);return Math.sqrt(i**2+l**2)}class A_{constructor(a,i,{transformPagePoint:l,contextWindow:r,dragSnapToOrigin:d=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Wd(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,S=AA(v.offset,{x:0,y:0})>=3;if(!x&&!S)return;const{point:C}=v,{timestamp:w}=Wt;this.history.push({...C,timestamp:w});const{onStart:E,onMove:k}=this.handlers;x||(E&&E(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,v)},this.handlePointerMove=(v,x)=>{this.lastMoveEvent=v,this.lastMoveEventInfo=Qd(x,this.transformPagePoint),ht.update(this.updatePoint,!0)},this.handlePointerUp=(v,x)=>{this.end();const{onEnd:S,onSessionEnd:C,resumeAnimation:w}=this.handlers;if(this.dragSnapToOrigin&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const E=Wd(v.type==="pointercancel"?this.lastMoveEventInfo:Qd(x,this.transformPagePoint),this.history);this.startEvent&&S&&S(v,E),C&&C(v,E)},!Lh(a))return;this.dragSnapToOrigin=d,this.handlers=i,this.transformPagePoint=l,this.contextWindow=r||window;const u=Tl(a),p=Qd(u,this.transformPagePoint),{point:m}=p,{timestamp:g}=Wt;this.history=[{...m,timestamp:g}];const{onSessionStart:y}=i;y&&y(a,Wd(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(),ps(this.updatePoint)}}function Qd(n,a){return a?{point:a(n.point)}:n}function Ry(n,a){return{x:n.x-a.x,y:n.y-a.y}}function Wd({point:n},a){return{point:n,delta:Ry(n,N_(a)),offset:Ry(n,NA(a)),velocity:jA(a,.1)}}function NA(n){return n[0]}function N_(n){return n[n.length-1]}function jA(n,a){if(n.length<2)return{x:0,y:0};let i=n.length-1,l=null;const r=N_(n);for(;i>=0&&(l=n[i],!(r.timestamp-l.timestamp>Ma(a)));)i--;if(!l)return{x:0,y:0};const d=Ra(r.timestamp-l.timestamp);if(d===0)return{x:0,y:0};const u={x:(r.x-l.x)/d,y:(r.y-l.y)/d};return u.x===1/0&&(u.x=0),u.y===1/0&&(u.y=0),u}const j_=1e-4,DA=1-j_,MA=1+j_,D_=.01,RA=0-D_,BA=0+D_;function jn(n){return n.max-n.min}function OA(n,a,i){return Math.abs(n-a)<=i}function By(n,a,i,l=.5){n.origin=l,n.originPoint=_t(a.min,a.max,n.origin),n.scale=jn(i)/jn(a),n.translate=_t(i.min,i.max,n.origin)-n.originPoint,(n.scale>=DA&&n.scale<=MA||isNaN(n.scale))&&(n.scale=1),(n.translate>=RA&&n.translate<=BA||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 Oy(n,a,i){n.min=i.min+a.min,n.max=n.min+jn(a)}function IA(n,a,i){Oy(n.x,a.x,i.x),Oy(n.y,a.y,i.y)}function Iy(n,a,i){n.min=a.min-i.min,n.max=n.min+jn(a)}function rl(n,a,i){Iy(n.x,a.x,i.x),Iy(n.y,a.y,i.y)}function LA(n,{min:a,max:i},l){return a!==void 0&&n<a?n=l?_t(a,n,l.min):Math.max(n,a):i!==void 0&&n>i&&(n=l?_t(i,n,l.max):Math.min(n,i)),n}function Ly(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 zA(n,{top:a,left:i,bottom:l,right:r}){return{x:Ly(n.x,i,r),y:Ly(n.y,a,l)}}function zy(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 UA(n,a){return{x:zy(n.x,a.x),y:zy(n.y,a.y)}}function VA(n,a){let i=.5;const l=jn(n),r=jn(a);return r>l?i=qi(a.min,a.max-l,n.min):l>r&&(i=qi(n.min,n.max-r,a.min)),Ia(0,1,i)}function HA(n,a){const i={};return a.min!==void 0&&(i.min=a.min-n.min),a.max!==void 0&&(i.max=a.max-n.min),i}const Mf=.35;function GA(n=Mf){return n===!1?n=0:n===!0&&(n=Mf),{x:Uy(n,"left","right"),y:Uy(n,"top","bottom")}}function Uy(n,a,i){return{min:Vy(n,a),max:Vy(n,i)}}function Vy(n,a){return typeof n=="number"?n:n[a]||0}const Hy=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ui=()=>({x:Hy(),y:Hy()}),Gy=()=>({min:0,max:0}),Dt=()=>({x:Gy(),y:Gy()});function Pn(n){return[n("x"),n("y")]}function M_({top:n,left:a,right:i,bottom:l}){return{x:{min:a,max:i},y:{min:n,max:l}}}function PA({x:n,y:a}){return{top:a.min,right:n.max,bottom:a.max,left:n.min}}function $A(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 Jd(n){return n===void 0||n===1}function Rf({scale:n,scaleX:a,scaleY:i}){return!Jd(n)||!Jd(a)||!Jd(i)}function Vs(n){return Rf(n)||R_(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function R_(n){return Py(n.x)||Py(n.y)}function Py(n){return n&&n!=="0%"}function oc(n,a,i){const l=n-i,r=a*l;return i+r}function $y(n,a,i,l,r){return r!==void 0&&(n=oc(n,r,l)),oc(n,i,l)+a}function Bf(n,a=0,i=1,l,r){n.min=$y(n.min,a,i,l,r),n.max=$y(n.max,a,i,l,r)}function B_(n,{x:a,y:i}){Bf(n.x,a.translate,a.scale,a.originPoint),Bf(n.y,i.translate,i.scale,i.originPoint)}const Fy=.999999999999,qy=1.0000000000001;function FA(n,a,i,l=!1){const r=i.length;if(!r)return;a.x=a.y=1;let d,u;for(let p=0;p<r;p++){d=i[p],u=d.projectionDelta;const{visualElement:m}=d.options;m&&m.props.style&&m.props.style.display==="contents"||(l&&d.options.layoutScroll&&d.scroll&&d!==d.root&&Hi(n,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),u&&(a.x*=u.x.scale,a.y*=u.y.scale,B_(n,u)),l&&Vs(d.latestValues)&&Hi(n,d.latestValues))}a.x<qy&&a.x>Fy&&(a.x=1),a.y<qy&&a.y>Fy&&(a.y=1)}function Vi(n,a){n.min=n.min+a,n.max=n.max+a}function Yy(n,a,i,l,r=.5){const d=_t(n.min,n.max,r);Bf(n,a,i,d,l)}function Hi(n,a){Yy(n.x,a.x,a.scaleX,a.scale,a.originX),Yy(n.y,a.y,a.scaleY,a.scale,a.originY)}function O_(n,a){return M_($A(n.getBoundingClientRect(),a))}function qA(n,a,i){const l=O_(n,i),{scroll:r}=a;return r&&(Vi(l.x,r.offset.x),Vi(l.y,r.offset.y)),l}const I_=({current:n})=>n?n.ownerDocument.defaultView:null,YA=new WeakMap;class KA{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=Dt(),this.visualElement=a}start(a,{snapToCursor:i=!1}={}){const{presenceContext:l}=this.visualElement;if(l&&l.isPresent===!1)return;const r=y=>{const{dragSnapToOrigin:v}=this.getProps();v?this.pauseAnimation():this.stopAnimation(),i&&this.snapToCursor(Tl(y).point)},d=(y,v)=>{const{drag:x,dragPropagation:S,onDragStart:C}=this.getProps();if(x&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=wA(x),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Pn(E=>{let k=this.getAxisMotionValue(E).get()||0;if(ra.test(k)){const{projection:A}=this.visualElement;if(A&&A.layout){const j=A.layout.layoutBox[E];j&&(k=jn(j)*(parseFloat(k)/100))}}this.originPoint[E]=k}),C&&ht.postRender(()=>C(y,v)),Sf(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},u=(y,v)=>{const{dragPropagation:x,dragDirectionLock:S,onDirectionLock:C,onDrag:w}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:E}=v;if(S&&this.currentDirection===null){this.currentDirection=ZA(E),this.currentDirection!==null&&C&&C(this.currentDirection);return}this.updateAxis("x",v.point,E),this.updateAxis("y",v.point,E),this.visualElement.render(),w&&w(y,v)},p=(y,v)=>this.stop(y,v),m=()=>Pn(y=>{var v;return this.getAnimationState(y)==="paused"&&((v=this.getAxisMotionValue(y).animation)===null||v===void 0?void 0:v.play())}),{dragSnapToOrigin:g}=this.getProps();this.panSession=new A_(a,{onSessionStart:r,onStart:d,onMove:u,onSessionEnd:p,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,contextWindow:I_(this.visualElement)})}stop(a,i){const l=this.isDragging;if(this.cancel(),!l)return;const{velocity:r}=i;this.startAnimation(r);const{onDragEnd:d}=this.getProps();d&&ht.postRender(()=>d(a,i))}cancel(){this.isDragging=!1;const{projection:a,animationState:i}=this.visualElement;a&&(a.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:l}=this.getProps();!l&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}updateAxis(a,i,l){const{drag:r}=this.getProps();if(!l||!Hr(a,r,this.currentDirection))return;const d=this.getAxisMotionValue(a);let u=this.originPoint[a]+l[a];this.constraints&&this.constraints[a]&&(u=LA(u,this.constraints[a],this.elastic[a])),d.set(u)}resolveConstraints(){var a;const{dragConstraints:i,dragElastic:l}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)===null||a===void 0?void 0:a.layout,d=this.constraints;i&&Li(i)?this.constraints||(this.constraints=this.resolveRefConstraints()):i&&r?this.constraints=zA(r.layoutBox,i):this.constraints=!1,this.elastic=GA(l),d!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Pn(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=HA(r.layoutBox[u],this.constraints[u]))})}resolveRefConstraints(){const{dragConstraints:a,onMeasureDragConstraints:i}=this.getProps();if(!a||!Li(a))return!1;const l=a.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const d=qA(l,r.root,this.visualElement.getTransformPagePoint());let u=UA(r.layout.layoutBox,d);if(i){const p=i(PA(u));this.hasMutatedConstraints=!!p,p&&(u=M_(p))}return u}startAnimation(a){const{drag:i,dragMomentum:l,dragElastic:r,dragTransition:d,dragSnapToOrigin:u,onDragTransitionEnd:p}=this.getProps(),m=this.constraints||{},g=Pn(y=>{if(!Hr(y,i,this.currentDirection))return;let v=m&&m[y]||{};u&&(v={min:0,max:0});const x=r?200:1e6,S=r?40:1e7,C={type:"inertia",velocity:l?a[y]:0,bounceStiffness:x,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...d,...v};return this.startAxisValueAnimation(y,C)});return Promise.all(g).then(p)}startAxisValueAnimation(a,i){const l=this.getAxisMotionValue(a);return Sf(this.visualElement,a),l.start(Ih(a,l,0,i,this.visualElement,!1))}stopAnimation(){Pn(a=>this.getAxisMotionValue(a).stop())}pauseAnimation(){Pn(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(),r=l[i];return r||this.visualElement.getValue(a,(l.initial?l.initial[a]:void 0)||0)}snapToCursor(a){Pn(i=>{const{drag:l}=this.getProps();if(!Hr(i,l,this.currentDirection))return;const{projection:r}=this.visualElement,d=this.getAxisMotionValue(i);if(r&&r.layout){const{min:u,max:p}=r.layout.layoutBox[i];d.set(a[i]-_t(u,p,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:a,dragConstraints:i}=this.getProps(),{projection:l}=this.visualElement;if(!Li(i)||!l||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Pn(u=>{const p=this.getAxisMotionValue(u);if(p&&this.constraints!==!1){const m=p.get();r[u]=VA({min:m,max:m},this.constraints[u])}});const{transformTemplate:d}=this.visualElement.getProps();this.visualElement.current.style.transform=d?d({},""):"none",l.root&&l.root.updateScroll(),l.updateLayout(),this.resolveConstraints(),Pn(u=>{if(!Hr(u,a,null))return;const p=this.getAxisMotionValue(u),{min:m,max:g}=this.constraints[u];p.set(_t(m,g,r[u]))})}addListeners(){if(!this.visualElement.current)return;YA.set(this.visualElement,this);const a=this.visualElement.current,i=ol(a,"pointerdown",m=>{const{drag:g,dragListener:y=!0}=this.getProps();g&&y&&this.start(m)}),l=()=>{const{dragConstraints:m}=this.getProps();Li(m)&&m.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,d=r.addEventListener("measure",l);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),ht.read(l);const u=gl(window,"resize",()=>this.scalePositionWithinConstraints()),p=r.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:g})=>{this.isDragging&&g&&(Pn(y=>{const v=this.getAxisMotionValue(y);v&&(this.originPoint[y]+=m[y].translate,v.set(v.get()+m[y].translate))}),this.visualElement.render())}));return()=>{u(),i(),d(),p&&p()}}getProps(){const a=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:l=!1,dragPropagation:r=!1,dragConstraints:d=!1,dragElastic:u=Mf,dragMomentum:p=!0}=a;return{...a,drag:i,dragDirectionLock:l,dragPropagation:r,dragConstraints:d,dragElastic:u,dragMomentum:p}}}function Hr(n,a,i){return(a===!0||a===n)&&(i===null||i===n)}function ZA(n,a=10){let i=null;return Math.abs(n.y)>a?i="y":Math.abs(n.x)>a&&(i="x"),i}class XA extends gs{constructor(a){super(a),this.removeGroupControls=Nn,this.removeListeners=Nn,this.controls=new KA(a)}mount(){const{dragControls:a}=this.node.getProps();a&&(this.removeGroupControls=a.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Nn}unmount(){this.removeGroupControls(),this.removeListeners()}}const Ky=n=>(a,i)=>{n&&ht.postRender(()=>n(a,i))};class QA extends gs{constructor(){super(...arguments),this.removePointerDownListener=Nn}onPointerDown(a){this.session=new A_(a,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:I_(this.node)})}createPanHandlers(){const{onPanSessionStart:a,onPanStart:i,onPan:l,onPanEnd:r}=this.node.getProps();return{onSessionStart:Ky(a),onStart:Ky(i),onMove:l,onEnd:(d,u)=>{delete this.session,r&&ht.postRender(()=>r(d,u))}}}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 Wr={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Zy(n,a){return a.max===a.min?0:n/(a.max-a.min)*100}const Zo={correct:(n,a)=>{if(!a.target)return n;if(typeof n=="string")if(_e.test(n))n=parseFloat(n);else return n;const i=Zy(n,a.target.x),l=Zy(n,a.target.y);return`${i}% ${l}%`}},WA={correct:(n,{treeScale:a,projectionDelta:i})=>{const l=n,r=ms.parse(n);if(r.length>5)return l;const d=ms.createTransformer(n),u=typeof r[0]!="number"?1:0,p=i.x.scale*a.x,m=i.y.scale*a.y;r[0+u]/=p,r[1+u]/=m;const g=_t(p,m,.5);return typeof r[2+u]=="number"&&(r[2+u]/=g),typeof r[3+u]=="number"&&(r[3+u]/=g),d(r)}};class JA extends b.Component{componentDidMount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:l,layoutId:r}=this.props,{projection:d}=a;Cw(eN),d&&(i.group&&i.group.add(d),l&&l.register&&r&&l.register(d),d.root.didUpdate(),d.addEventListener("animationComplete",()=>{this.safeToRemove()}),d.setOptions({...d.options,onExitComplete:()=>this.safeToRemove()})),Wr.hasEverUpdated=!0}getSnapshotBeforeUpdate(a){const{layoutDependency:i,visualElement:l,drag:r,isPresent:d}=this.props,u=l.projection;return u&&(u.isPresent=d,r||a.layoutDependency!==i||i===void 0?u.willUpdate():this.safeToRemove(),a.isPresent!==d&&(d?u.promote():u.relegate()||ht.postRender(()=>{const p=u.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:a}=this.props.visualElement;a&&(a.root.didUpdate(),dh.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:l}=this.props,{projection:r}=a;r&&(r.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(r),l&&l.deregister&&l.deregister(r))}safeToRemove(){const{safeToRemove:a}=this.props;a&&a()}render(){return null}}function L_(n){const[a,i]=xb(),l=b.useContext(sh);return c.jsx(JA,{...n,layoutGroup:l,switchLayoutGroup:b.useContext(Nb),isPresent:a,safeToRemove:i})}const eN={borderRadius:{...Zo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Zo,borderTopRightRadius:Zo,borderBottomLeftRadius:Zo,borderBottomRightRadius:Zo,boxShadow:WA};function tN(n,a,i){const l=nn(n)?n:pl(n);return l.start(Ih("",l,a,i)),l.animation}function nN(n){return n instanceof SVGElement&&n.tagName!=="svg"}const aN=(n,a)=>n.depth-a.depth;class sN{constructor(){this.children=[],this.isDirty=!1}add(a){Sh(this.children,a),this.isDirty=!0}remove(a){Th(this.children,a),this.isDirty=!0}forEach(a){this.isDirty&&this.children.sort(aN),this.isDirty=!1,this.children.forEach(a)}}function iN(n,a){const i=ca.now(),l=({timestamp:r})=>{const d=r-i;d>=a&&(ps(l),n(d-a))};return ht.read(l,!0),()=>ps(l)}const z_=["TopLeft","TopRight","BottomLeft","BottomRight"],oN=z_.length,Xy=n=>typeof n=="string"?parseFloat(n):n,Qy=n=>typeof n=="number"||_e.test(n);function lN(n,a,i,l,r,d){r?(n.opacity=_t(0,i.opacity!==void 0?i.opacity:1,rN(l)),n.opacityExit=_t(a.opacity!==void 0?a.opacity:1,0,cN(l))):d&&(n.opacity=_t(a.opacity!==void 0?a.opacity:1,i.opacity!==void 0?i.opacity:1,l));for(let u=0;u<oN;u++){const p=`border${z_[u]}Radius`;let m=Wy(a,p),g=Wy(i,p);if(m===void 0&&g===void 0)continue;m||(m=0),g||(g=0),m===0||g===0||Qy(m)===Qy(g)?(n[p]=Math.max(_t(Xy(m),Xy(g),l),0),(ra.test(g)||ra.test(m))&&(n[p]+="%")):n[p]=g}(a.rotate||i.rotate)&&(n.rotate=_t(a.rotate||0,i.rotate||0,l))}function Wy(n,a){return n[a]!==void 0?n[a]:n.borderRadius}const rN=U_(0,.5,t_),cN=U_(.5,.95,Nn);function U_(n,a,i){return l=>l<n?0:l>a?1:i(qi(n,a,l))}function Jy(n,a){n.min=a.min,n.max=a.max}function Gn(n,a){Jy(n.x,a.x),Jy(n.y,a.y)}function e0(n,a){n.translate=a.translate,n.scale=a.scale,n.originPoint=a.originPoint,n.origin=a.origin}function t0(n,a,i,l,r){return n-=a,n=oc(n,1/i,l),r!==void 0&&(n=oc(n,1/r,l)),n}function uN(n,a=0,i=1,l=.5,r,d=n,u=n){if(ra.test(a)&&(a=parseFloat(a),a=_t(u.min,u.max,a/100)-u.min),typeof a!="number")return;let p=_t(d.min,d.max,l);n===d&&(p-=a),n.min=t0(n.min,a,i,p,r),n.max=t0(n.max,a,i,p,r)}function n0(n,a,[i,l,r],d,u){uN(n,a[i],a[l],a[r],a.scale,d,u)}const dN=["x","scaleX","originX"],fN=["y","scaleY","originY"];function a0(n,a,i,l){n0(n.x,a,dN,i?i.x:void 0,l?l.x:void 0),n0(n.y,a,fN,i?i.y:void 0,l?l.y:void 0)}function s0(n){return n.translate===0&&n.scale===1}function V_(n){return s0(n.x)&&s0(n.y)}function i0(n,a){return n.min===a.min&&n.max===a.max}function hN(n,a){return i0(n.x,a.x)&&i0(n.y,a.y)}function o0(n,a){return Math.round(n.min)===Math.round(a.min)&&Math.round(n.max)===Math.round(a.max)}function H_(n,a){return o0(n.x,a.x)&&o0(n.y,a.y)}function l0(n){return jn(n.x)/jn(n.y)}function r0(n,a){return n.translate===a.translate&&n.scale===a.scale&&n.originPoint===a.originPoint}class pN{constructor(){this.members=[]}add(a){Sh(this.members,a),a.scheduleRender()}remove(a){if(Th(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(r=>a===r);if(i===0)return!1;let l;for(let r=i;r>=0;r--){const d=this.members[r];if(d.isPresent!==!1){l=d;break}}return l?(this.promote(l),!0):!1}promote(a,i){const l=this.lead;if(a!==l&&(this.prevLead=l,this.lead=a,a.show(),l)){l.instance&&l.scheduleRender(),a.scheduleRender(),a.resumeFrom=l,i&&(a.resumeFrom.preserveOpacity=!0),l.snapshot&&(a.snapshot=l.snapshot,a.snapshot.latestValues=l.animationValues||l.latestValues),a.root&&a.root.isUpdating&&(a.isLayoutDirty=!0);const{crossfade:r}=a.options;r===!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 mN(n,a,i){let l="";const r=n.x.translate/a.x,d=n.y.translate/a.y,u=(i==null?void 0:i.z)||0;if((r||d||u)&&(l=`translate3d(${r}px, ${d}px, ${u}px) `),(a.x!==1||a.y!==1)&&(l+=`scale(${1/a.x}, ${1/a.y}) `),i){const{transformPerspective:g,rotate:y,rotateX:v,rotateY:x,skewX:S,skewY:C}=i;g&&(l=`perspective(${g}px) ${l}`),y&&(l+=`rotate(${y}deg) `),v&&(l+=`rotateX(${v}deg) `),x&&(l+=`rotateY(${x}deg) `),S&&(l+=`skewX(${S}deg) `),C&&(l+=`skewY(${C}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 Hs={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},el=typeof window<"u"&&window.MotionDebug!==void 0,ef=["","X","Y","Z"],gN={visibility:"hidden"},c0=1e3;let vN=0;function tf(n,a,i,l){const{latestValues:r}=a;r[n]&&(i[n]=r[n],a.setStaticValue(n,0),l&&(l[n]=0))}function G_(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:a}=n.options;if(!a)return;const i=Fb(a);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:r,layoutId:d}=n.options;window.MotionCancelOptimisedAnimation(i,"transform",ht,!(r||d))}const{parent:l}=n;l&&!l.hasCheckedOptimisedAppear&&G_(l)}function P_({attachResizeListener:n,defaultParent:a,measureScroll:i,checkIsScrollRoot:l,resetTransform:r}){return class{constructor(u={},p=a==null?void 0:a()){this.id=vN++,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,el&&(Hs.totalNodes=Hs.resolvedTargetDeltas=Hs.recalculatedProjection=0),this.nodes.forEach(_N),this.nodes.forEach(CN),this.nodes.forEach(wN),this.nodes.forEach(xN),el&&window.MotionDebug.record(Hs)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=u,this.root=p?p.root||p:this,this.path=p?[...p.path,p]:[],this.parent=p,this.depth=p?p.depth+1:0;for(let m=0;m<this.path.length;m++)this.path[m].shouldResetTransform=!0;this.root===this&&(this.nodes=new sN)}addEventListener(u,p){return this.eventHandlers.has(u)||this.eventHandlers.set(u,new kh),this.eventHandlers.get(u).add(p)}notifyListeners(u,...p){const m=this.eventHandlers.get(u);m&&m.notify(...p)}hasListeners(u){return this.eventHandlers.has(u)}mount(u,p=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=nN(u),this.instance=u;const{layoutId:m,layout:g,visualElement:y}=this.options;if(y&&!y.current&&y.mount(u),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),p&&(g||m)&&(this.isLayoutDirty=!0),n){let v;const x=()=>this.root.updateBlockedByResize=!1;n(u,()=>{this.root.updateBlockedByResize=!0,v&&v(),v=iN(x,250),Wr.hasAnimatedSinceResize&&(Wr.hasAnimatedSinceResize=!1,this.nodes.forEach(d0))})}m&&this.root.registerSharedNode(m,this),this.options.animate!==!1&&y&&(m||g)&&this.addEventListener("didUpdate",({delta:v,hasLayoutChanged:x,hasRelativeTargetChanged:S,layout:C})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=this.options.transition||y.getDefaultTransition()||DN,{onLayoutAnimationStart:E,onLayoutAnimationComplete:k}=y.getProps(),A=!this.targetLayout||!H_(this.targetLayout,C)||S,j=!x&&S;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||j||x&&(A||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(v,j);const V={...xh(w,"layout"),onPlay:E,onComplete:k};(y.shouldReduceMotion||this.options.layoutRoot)&&(V.delay=0,V.type=!1),this.startAnimation(V)}else x||d0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=C})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const u=this.getStack();u&&u.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,ps(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(EN),this.animationId++)}getTransformTemplate(){const{visualElement:u}=this.options;return u&&u.getProps().transformTemplate}willUpdate(u=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&G_(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let y=0;y<this.path.length;y++){const v=this.path[y];v.shouldResetTransform=!0,v.updateScroll("snapshot"),v.options.layoutRoot&&v.willUpdate(!1)}const{layoutId:p,layout:m}=this.options;if(p===void 0&&!m)return;const g=this.getTransformTemplate();this.prevTransformTemplateValue=g?g(this.latestValues,""):void 0,this.updateSnapshot(),u&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(u0);return}this.isUpdating||this.nodes.forEach(TN),this.isUpdating=!1,this.nodes.forEach(kN),this.nodes.forEach(yN),this.nodes.forEach(bN),this.clearAllSnapshots();const p=ca.now();Wt.delta=Ia(0,1e3/60,p-Wt.timestamp),Wt.timestamp=p,Wt.isProcessing=!0,qd.update.process(Wt),qd.preRender.process(Wt),qd.render.process(Wt),Wt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,dh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(SN),this.sharedNodes.forEach(AN)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ht.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ht.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let m=0;m<this.path.length;m++)this.path[m].updateScroll();const u=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Dt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:p}=this.options;p&&p.notify("LayoutMeasure",this.layout.layoutBox,u?u.layoutBox:void 0)}updateScroll(u="measure"){let p=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===u&&(p=!1),p){const m=l(this.instance);this.scroll={animationId:this.root.animationId,phase:u,isRoot:m,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!r)return;const u=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,p=this.projectionDelta&&!V_(this.projectionDelta),m=this.getTransformTemplate(),g=m?m(this.latestValues,""):void 0,y=g!==this.prevTransformTemplateValue;u&&(p||Vs(this.latestValues)||y)&&(r(this.instance,g),this.shouldResetTransform=!1,this.scheduleRender())}measure(u=!0){const p=this.measurePageBox();let m=this.removeElementScroll(p);return u&&(m=this.removeTransform(m)),MN(m),{animationId:this.root.animationId,measuredBox:p,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:p}=this.options;if(!p)return Dt();const m=p.measureViewportBox();if(!(((u=this.scroll)===null||u===void 0?void 0:u.wasRoot)||this.path.some(RN))){const{scroll:y}=this.root;y&&(Vi(m.x,y.offset.x),Vi(m.y,y.offset.y))}return m}removeElementScroll(u){var p;const m=Dt();if(Gn(m,u),!((p=this.scroll)===null||p===void 0)&&p.wasRoot)return m;for(let g=0;g<this.path.length;g++){const y=this.path[g],{scroll:v,options:x}=y;y!==this.root&&v&&x.layoutScroll&&(v.wasRoot&&Gn(m,u),Vi(m.x,v.offset.x),Vi(m.y,v.offset.y))}return m}applyTransform(u,p=!1){const m=Dt();Gn(m,u);for(let g=0;g<this.path.length;g++){const y=this.path[g];!p&&y.options.layoutScroll&&y.scroll&&y!==y.root&&Hi(m,{x:-y.scroll.offset.x,y:-y.scroll.offset.y}),Vs(y.latestValues)&&Hi(m,y.latestValues)}return Vs(this.latestValues)&&Hi(m,this.latestValues),m}removeTransform(u){const p=Dt();Gn(p,u);for(let m=0;m<this.path.length;m++){const g=this.path[m];if(!g.instance||!Vs(g.latestValues))continue;Rf(g.latestValues)&&g.updateSnapshot();const y=Dt(),v=g.measurePageBox();Gn(y,v),a0(p,g.latestValues,g.snapshot?g.snapshot.layoutBox:void 0,y)}return Vs(this.latestValues)&&a0(p,this.latestValues),p}setTargetDelta(u){this.targetDelta=u,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(u){this.options={...this.options,...u,crossfade:u.crossfade!==void 0?u.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Wt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(u=!1){var p;const m=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=m.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=m.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=m.isSharedProjectionDirty);const g=!!this.resumingFrom||this!==m;if(!(u||g&&this.isSharedProjectionDirty||this.isProjectionDirty||!((p=this.parent)===null||p===void 0)&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:v,layoutId:x}=this.options;if(!(!this.layout||!(v||x))){if(this.resolvedRelativeTargetAt=Wt.timestamp,!this.targetDelta&&!this.relativeTarget){const S=this.getClosestProjectingParent();S&&S.layout&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Dt(),this.relativeTargetOrigin=Dt(),rl(this.relativeTargetOrigin,this.layout.layoutBox,S.layout.layoutBox),Gn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Dt(),this.targetWithTransforms=Dt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),IA(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Gn(this.target,this.layout.layoutBox),B_(this.target,this.targetDelta)):Gn(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=Dt(),this.relativeTargetOrigin=Dt(),rl(this.relativeTargetOrigin,this.target,S.target),Gn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}el&&Hs.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Rf(this.parent.latestValues)||R_(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var u;const p=this.getLead(),m=!!this.resumingFrom||this!==p;let g=!0;if((this.isProjectionDirty||!((u=this.parent)===null||u===void 0)&&u.isProjectionDirty)&&(g=!1),m&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(g=!1),this.resolvedRelativeTargetAt===Wt.timestamp&&(g=!1),g)return;const{layout:y,layoutId:v}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(y||v))return;Gn(this.layoutCorrected,this.layout.layoutBox);const x=this.treeScale.x,S=this.treeScale.y;FA(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=Dt());const{target:C}=p;if(!C){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(e0(this.prevProjectionDelta.x,this.projectionDelta.x),e0(this.prevProjectionDelta.y,this.projectionDelta.y)),ll(this.projectionDelta,this.layoutCorrected,C,this.latestValues),(this.treeScale.x!==x||this.treeScale.y!==S||!r0(this.projectionDelta.x,this.prevProjectionDelta.x)||!r0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",C)),el&&Hs.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(u=!0){var p;if((p=this.options.visualElement)===null||p===void 0||p.scheduleRender(),u){const m=this.getStack();m&&m.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ui(),this.projectionDelta=Ui(),this.projectionDeltaWithTransform=Ui()}setAnimationOrigin(u,p=!1){const m=this.snapshot,g=m?m.latestValues:{},y={...this.latestValues},v=Ui();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const x=Dt(),S=m?m.source:void 0,C=this.layout?this.layout.source:void 0,w=S!==C,E=this.getStack(),k=!E||E.members.length<=1,A=!!(w&&!k&&this.options.crossfade===!0&&!this.path.some(jN));this.animationProgress=0;let j;this.mixTargetDelta=V=>{const I=V/1e3;f0(v.x,u.x,I),f0(v.y,u.y,I),this.setTargetDelta(v),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(rl(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox),NN(this.relativeTarget,this.relativeTargetOrigin,x,I),j&&hN(this.relativeTarget,j)&&(this.isProjectionDirty=!1),j||(j=Dt()),Gn(j,this.relativeTarget)),w&&(this.animationValues=y,lN(y,g,this.latestValues,I,A,k)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=I},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(u){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(ps(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ht.update(()=>{Wr.hasAnimatedSinceResize=!0,this.currentAnimation=tN(0,c0,{...u,onUpdate:p=>{this.mixTargetDelta(p),u.onUpdate&&u.onUpdate(p)},onComplete:()=>{u.onComplete&&u.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const u=this.getStack();u&&u.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(c0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const u=this.getLead();let{targetWithTransforms:p,target:m,layout:g,latestValues:y}=u;if(!(!p||!m||!g)){if(this!==u&&this.layout&&g&&$_(this.options.animationType,this.layout.layoutBox,g.layoutBox)){m=this.target||Dt();const v=jn(this.layout.layoutBox.x);m.x.min=u.target.x.min,m.x.max=m.x.min+v;const x=jn(this.layout.layoutBox.y);m.y.min=u.target.y.min,m.y.max=m.y.min+x}Gn(p,m),Hi(p,y),ll(this.projectionDeltaWithTransform,this.layoutCorrected,p,y)}}registerSharedNode(u,p){this.sharedNodes.has(u)||this.sharedNodes.set(u,new pN),this.sharedNodes.get(u).add(p);const g=p.options.initialPromotionConfig;p.promote({transition:g?g.transition:void 0,preserveFollowOpacity:g&&g.shouldPreserveFollowOpacity?g.shouldPreserveFollowOpacity(p):void 0})}isLead(){const u=this.getStack();return u?u.lead===this:!0}getLead(){var u;const{layoutId:p}=this.options;return p?((u=this.getStack())===null||u===void 0?void 0:u.lead)||this:this}getPrevLead(){var u;const{layoutId:p}=this.options;return p?(u=this.getStack())===null||u===void 0?void 0:u.prevLead:void 0}getStack(){const{layoutId:u}=this.options;if(u)return this.root.sharedNodes.get(u)}promote({needsReset:u,transition:p,preserveFollowOpacity:m}={}){const g=this.getStack();g&&g.promote(this,m),u&&(this.projectionDelta=void 0,this.needsReset=!0),p&&this.setOptions({transition:p})}relegate(){const u=this.getStack();return u?u.relegate(this):!1}resetSkewAndRotation(){const{visualElement:u}=this.options;if(!u)return;let p=!1;const{latestValues:m}=u;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(p=!0),!p)return;const g={};m.z&&tf("z",u,g,this.animationValues);for(let y=0;y<ef.length;y++)tf(`rotate${ef[y]}`,u,g,this.animationValues),tf(`skew${ef[y]}`,u,g,this.animationValues);u.render();for(const y in g)u.setStaticValue(y,g[y]),this.animationValues&&(this.animationValues[y]=g[y]);u.scheduleRender()}getProjectionStyles(u){var p,m;if(!this.instance||this.isSVG)return;if(!this.isVisible)return gN;const g={visibility:""},y=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,g.opacity="",g.pointerEvents=Xr(u==null?void 0:u.pointerEvents)||"",g.transform=y?y(this.latestValues,""):"none",g;const v=this.getLead();if(!this.projectionDelta||!this.layout||!v.target){const w={};return this.options.layoutId&&(w.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,w.pointerEvents=Xr(u==null?void 0:u.pointerEvents)||""),this.hasProjected&&!Vs(this.latestValues)&&(w.transform=y?y({},""):"none",this.hasProjected=!1),w}const x=v.animationValues||v.latestValues;this.applyTransformsToTarget(),g.transform=mN(this.projectionDeltaWithTransform,this.treeScale,x),y&&(g.transform=y(x,g.transform));const{x:S,y:C}=this.projectionDelta;g.transformOrigin=`${S.origin*100}% ${C.origin*100}% 0`,v.animationValues?g.opacity=v===this?(m=(p=x.opacity)!==null&&p!==void 0?p:this.latestValues.opacity)!==null&&m!==void 0?m:1:this.preserveOpacity?this.latestValues.opacity:x.opacityExit:g.opacity=v===this?x.opacity!==void 0?x.opacity:"":x.opacityExit!==void 0?x.opacityExit:0;for(const w in tc){if(x[w]===void 0)continue;const{correct:E,applyTo:k}=tc[w],A=g.transform==="none"?x[w]:E(x[w],v);if(k){const j=k.length;for(let V=0;V<j;V++)g[k[V]]=A}else g[w]=A}return this.options.layoutId&&(g.pointerEvents=v===this?Xr(u==null?void 0:u.pointerEvents)||"":"none"),g}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(u=>{var p;return(p=u.currentAnimation)===null||p===void 0?void 0:p.stop()}),this.root.nodes.forEach(u0),this.root.sharedNodes.clear()}}}function yN(n){n.updateLayout()}function bN(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:r}=n.layout,{animationType:d}=n.options,u=i.source!==n.layout.source;d==="size"?Pn(v=>{const x=u?i.measuredBox[v]:i.layoutBox[v],S=jn(x);x.min=l[v].min,x.max=x.min+S}):$_(d,i.layoutBox,l)&&Pn(v=>{const x=u?i.measuredBox[v]:i.layoutBox[v],S=jn(l[v]);x.max=x.min+S,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[v].max=n.relativeTarget[v].min+S)});const p=Ui();ll(p,l,i.layoutBox);const m=Ui();u?ll(m,n.applyTransform(r,!0),i.measuredBox):ll(m,l,i.layoutBox);const g=!V_(p);let y=!1;if(!n.resumeFrom){const v=n.getClosestProjectingParent();if(v&&!v.resumeFrom){const{snapshot:x,layout:S}=v;if(x&&S){const C=Dt();rl(C,i.layoutBox,x.layoutBox);const w=Dt();rl(w,l,S.layoutBox),H_(C,w)||(y=!0),v.options.layoutRoot&&(n.relativeTarget=w,n.relativeTargetOrigin=C,n.relativeParent=v)}}}n.notifyListeners("didUpdate",{layout:l,snapshot:i,delta:m,layoutDelta:p,hasLayoutChanged:g,hasRelativeTargetChanged:y})}else if(n.isLead()){const{onExitComplete:l}=n.options;l&&l()}n.options.transition=void 0}function _N(n){el&&Hs.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 xN(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function SN(n){n.clearSnapshot()}function u0(n){n.clearMeasurements()}function TN(n){n.isLayoutDirty=!1}function kN(n){const{visualElement:a}=n.options;a&&a.getProps().onBeforeLayoutMeasure&&a.notify("BeforeLayoutMeasure"),n.resetTransform()}function d0(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function CN(n){n.resolveTargetDelta()}function wN(n){n.calcProjection()}function EN(n){n.resetSkewAndRotation()}function AN(n){n.removeLeadSnapshot()}function f0(n,a,i){n.translate=_t(a.translate,0,i),n.scale=_t(a.scale,1,i),n.origin=a.origin,n.originPoint=a.originPoint}function h0(n,a,i,l){n.min=_t(a.min,i.min,l),n.max=_t(a.max,i.max,l)}function NN(n,a,i,l){h0(n.x,a.x,i.x,l),h0(n.y,a.y,i.y,l)}function jN(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const DN={duration:.45,ease:[.4,0,.1,1]},p0=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),m0=p0("applewebkit/")&&!p0("chrome/")?Math.round:Nn;function g0(n){n.min=m0(n.min),n.max=m0(n.max)}function MN(n){g0(n.x),g0(n.y)}function $_(n,a,i){return n==="position"||n==="preserve-aspect"&&!OA(l0(a),l0(i),.2)}function RN(n){var a;return n!==n.root&&((a=n.scroll)===null||a===void 0?void 0:a.wasRoot)}const BN=P_({attachResizeListener:(n,a)=>gl(n,"resize",a),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),nf={current:void 0},F_=P_({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!nf.current){const n=new BN({});n.mount(window),n.setOptions({layoutScroll:!0}),nf.current=n}return nf.current},resetTransform:(n,a)=>{n.style.transform=a!==void 0?a:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),ON={pan:{Feature:QA},drag:{Feature:XA,ProjectionNode:F_,MeasureLayout:L_}};function IN(n,a,i){var l;if(n instanceof Element)return[n];if(typeof n=="string"){let r=document;const d=(l=void 0)!==null&&l!==void 0?l:r.querySelectorAll(n);return d?Array.from(d):[]}return Array.from(n)}function q_(n,a){const i=IN(n),l=new AbortController,r={passive:!0,...a,signal:l.signal};return[i,r,()=>l.abort()]}function v0(n){return a=>{a.pointerType==="touch"||E_()||n(a)}}function LN(n,a,i={}){const[l,r,d]=q_(n,i),u=v0(p=>{const{target:m}=p,g=a(p);if(typeof g!="function"||!m)return;const y=v0(v=>{g(v),m.removeEventListener("pointerleave",y)});m.addEventListener("pointerleave",y,r)});return l.forEach(p=>{p.addEventListener("pointerenter",u,r)}),d}function y0(n,a,i){const{props:l}=n;n.animationState&&l.whileHover&&n.animationState.setActive("whileHover",i==="Start");const r="onHover"+i,d=l[r];d&&ht.postRender(()=>d(a,Tl(a)))}class zN extends gs{mount(){const{current:a}=this.node;a&&(this.unmount=LN(a,i=>(y0(this.node,i,"Start"),l=>y0(this.node,l,"End"))))}unmount(){}}class UN extends gs{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(gl(this.node.current,"focus",()=>this.onFocus()),gl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const Y_=(n,a)=>a?n===a?!0:Y_(n,a.parentElement):!1,VN=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function HN(n){return VN.has(n.tagName)||n.tabIndex!==-1}const tl=new WeakSet;function b0(n){return a=>{a.key==="Enter"&&n(a)}}function af(n,a){n.dispatchEvent(new PointerEvent("pointer"+a,{isPrimary:!0,bubbles:!0}))}const GN=(n,a)=>{const i=n.currentTarget;if(!i)return;const l=b0(()=>{if(tl.has(i))return;af(i,"down");const r=b0(()=>{af(i,"up")}),d=()=>af(i,"cancel");i.addEventListener("keyup",r,a),i.addEventListener("blur",d,a)});i.addEventListener("keydown",l,a),i.addEventListener("blur",()=>i.removeEventListener("keydown",l),a)};function _0(n){return Lh(n)&&!E_()}function PN(n,a,i={}){const[l,r,d]=q_(n,i),u=p=>{const m=p.currentTarget;if(!_0(p)||tl.has(m))return;tl.add(m);const g=a(p),y=(S,C)=>{window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",x),!(!_0(S)||!tl.has(m))&&(tl.delete(m),typeof g=="function"&&g(S,{success:C}))},v=S=>{y(S,i.useGlobalTarget||Y_(m,S.target))},x=S=>{y(S,!1)};window.addEventListener("pointerup",v,r),window.addEventListener("pointercancel",x,r)};return l.forEach(p=>{!HN(p)&&p.getAttribute("tabindex")===null&&(p.tabIndex=0),(i.useGlobalTarget?window:p).addEventListener("pointerdown",u,r),p.addEventListener("focus",g=>GN(g,r),r)}),d}function x0(n,a,i){const{props:l}=n;n.animationState&&l.whileTap&&n.animationState.setActive("whileTap",i==="Start");const r="onTap"+(i==="End"?"":i),d=l[r];d&&ht.postRender(()=>d(a,Tl(a)))}class $N extends gs{mount(){const{current:a}=this.node;a&&(this.unmount=PN(a,i=>(x0(this.node,i,"Start"),(l,{success:r})=>x0(this.node,l,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Of=new WeakMap,sf=new WeakMap,FN=n=>{const a=Of.get(n.target);a&&a(n)},qN=n=>{n.forEach(FN)};function YN({root:n,...a}){const i=n||document;sf.has(i)||sf.set(i,{});const l=sf.get(i),r=JSON.stringify(a);return l[r]||(l[r]=new IntersectionObserver(qN,{root:n,...a})),l[r]}function KN(n,a,i){const l=YN(a);return Of.set(n,i),l.observe(n),()=>{Of.delete(n),l.unobserve(n)}}const ZN={some:0,all:1};class XN extends gs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:a={}}=this.node.getProps(),{root:i,margin:l,amount:r="some",once:d}=a,u={root:i?i.current:void 0,rootMargin:l,threshold:typeof r=="number"?r:ZN[r]},p=m=>{const{isIntersecting:g}=m;if(this.isInView===g||(this.isInView=g,d&&!g&&this.hasEnteredView))return;g&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",g);const{onViewportEnter:y,onViewportLeave:v}=this.node.getProps(),x=g?y:v;x&&x(m)};return KN(this.node.current,u,p)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:a,prevProps:i}=this.node;["amount","margin","root"].some(QN(a,i))&&this.startObserver()}unmount(){}}function QN({viewport:n={}},{viewport:a={}}={}){return i=>n[i]!==a[i]}const WN={inView:{Feature:XN},tap:{Feature:$N},focus:{Feature:UN},hover:{Feature:zN}},JN={layout:{ProjectionNode:F_,MeasureLayout:L_}},lc={current:null},zh={current:!1};function K_(){if(zh.current=!0,!!lh)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),a=()=>lc.current=n.matches;n.addListener(a),a()}else lc.current=!1}const e2=[...m_,tn,ms],t2=n=>e2.find(p_(n)),S0=new WeakMap;function n2(n,a,i){for(const l in a){const r=a[l],d=i[l];if(nn(r))n.addValue(l,r);else if(nn(d))n.addValue(l,pl(r,{owner:n}));else if(d!==r)if(n.hasValue(l)){const u=n.getValue(l);u.liveStyle===!0?u.jump(r):u.hasAnimated||u.set(r)}else{const u=n.getStaticValue(l);n.addValue(l,pl(u!==void 0?u:r,{owner:n}))}}for(const l in i)a[l]===void 0&&n.removeValue(l);return a}const T0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class a2{scrapeMotionValuesFromProps(a,i,l){return{}}constructor({parent:a,props:i,presenceContext:l,reducedMotionConfig:r,blockInitialAnimation:d,visualState:u},p={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=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=ca.now();this.renderScheduledAt<S&&(this.renderScheduledAt=S,ht.render(this.render,!1,!0))};const{latestValues:m,renderState:g,onUpdate:y}=u;this.onUpdate=y,this.latestValues=m,this.baseTarget={...m},this.initialValues=i.initial?{...m}:{},this.renderState=g,this.parent=a,this.props=i,this.presenceContext=l,this.depth=a?a.depth+1:0,this.reducedMotionConfig=r,this.options=p,this.blockInitialAnimation=!!d,this.isControllingVariants=xc(i),this.isVariantNode=Eb(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(a&&a.current);const{willChange:v,...x}=this.scrapeMotionValuesFromProps(i,{},this);for(const S in x){const C=x[S];m[S]!==void 0&&nn(C)&&C.set(m[S],!1)}}mount(a){this.current=a,S0.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)),zh.current||K_(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:lc.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){S0.delete(this.current),this.projection&&this.projection.unmount(),ps(this.notifyUpdate),ps(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=Ks.has(a),r=i.on("change",p=>{this.latestValues[a]=p,this.props.onUpdate&&ht.preRender(this.notifyUpdate),l&&this.projection&&(this.projection.isTransformDirty=!0)}),d=i.on("renderRequest",this.scheduleRender);let u;window.MotionCheckAppearSync&&(u=window.MotionCheckAppearSync(this,a,i)),this.valueSubscriptions.set(a,()=>{r(),d(),u&&u(),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 Fi){const i=Fi[a];if(!i)continue;const{isEnabled:l,Feature:r}=i;if(!this.features[a]&&r&&l(this.props)&&(this.features[a]=new r(this)),this.features[a]){const d=this.features[a];d.isMounted?d.update():(d.mount(),d.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Dt()}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<T0.length;l++){const r=T0[l];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const d="on"+r,u=a[d];u&&(this.propEventSubscriptions[r]=this.on(r,u))}this.prevMotionValues=n2(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 r=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 r!=null&&(typeof r=="string"&&(f_(r)||a_(r))?r=parseFloat(r):!t2(r)&&ms.test(i)&&(r=c_(a,i)),this.setBaseTarget(a,nn(r)?r.get():r)),nn(r)?r.get():r}setBaseTarget(a,i){this.baseTarget[a]=i}getBaseTarget(a){var i;const{initial:l}=this.props;let r;if(typeof l=="string"||typeof l=="object"){const u=hh(this.props,l,(i=this.presenceContext)===null||i===void 0?void 0:i.custom);u&&(r=u[a])}if(l&&r!==void 0)return r;const d=this.getBaseTargetFromProps(this.props,a);return d!==void 0&&!nn(d)?d:this.initialValues[a]!==void 0&&r===void 0?void 0:this.baseTarget[a]}on(a,i){return this.events[a]||(this.events[a]=new kh),this.events[a].add(i)}notify(a,...i){this.events[a]&&this.events[a].notify(...i)}}class Z_ extends a2{constructor(){super(...arguments),this.KeyframeResolver=g_}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;nn(a)&&(this.childSubscription=a.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}function s2(n){return window.getComputedStyle(n)}class i2 extends Z_{constructor(){super(...arguments),this.type="html",this.renderInstance=Ib}readValueFromInstance(a,i){if(Ks.has(i)){const l=Mh(i);return l&&l.default||0}else{const l=s2(a),r=(Rb(i)?l.getPropertyValue(i):l[i])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(a,{transformPagePoint:i}){return O_(a,i)}build(a,i,l){gh(a,i,l.transformTemplate)}scrapeMotionValuesFromProps(a,i,l){return _h(a,i,l)}}class o2 extends Z_{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Dt}getBaseTargetFromProps(a,i){return a[i]}readValueFromInstance(a,i){if(Ks.has(i)){const l=Mh(i);return l&&l.default||0}return i=Lb.has(i)?i:uh(i),a.getAttribute(i)}scrapeMotionValuesFromProps(a,i,l){return Vb(a,i,l)}build(a,i,l){vh(a,i,this.isSVGTag,l.transformTemplate)}renderInstance(a,i,l,r){zb(a,i,l,r)}mount(a){this.isSVGTag=bh(a.tagName),super.mount(a)}}const l2=(n,a)=>fh(n)?new o2(a):new i2(a,{allowProjection:n!==b.Fragment}),r2=Bw({...CA,...WN,...ON,...JN},l2),yt=ZC(r2);function c2(){!zh.current&&K_();const[n]=b.useState(lc.current);return n}var vt;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.TEXT=1]="TEXT",n[n.TOOL_USE=2]="TOOL_USE",n[n.TOOL_RESULT=3]="TOOL_RESULT",n[n.ERROR=4]="ERROR",n[n.STATUS=5]="STATUS",n[n.SYSTEM=6]="SYSTEM",n[n.FINDING=7]="FINDING",n[n.SUBTASK_CREATE=8]="SUBTASK_CREATE",n[n.USER_INPUT=9]="USER_INPUT",n[n.SIGNAL=10]="SIGNAL"})(vt||(vt={}));var It;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.NOT_STARTED=1]="NOT_STARTED",n[n.WORKING=3]="WORKING",n[n.PAUSED=4]="PAUSED",n[n.COMPLETE=5]="COMPLETE",n[n.FAILED=6]="FAILED"})(It||(It={}));var ds;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.ACTIVE=1]="ACTIVE",n[n.ARCHIVED=2]="ARCHIVED"})(ds||(ds={}));var fs;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.OPEN=1]="OPEN",n[n.CLOSED=2]="CLOSED"})(fs||(fs={}));var sa;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.OFF=1]="OFF",n[n.SUBSCRIPTION=2]="SUBSCRIPTION",n[n.API_KEY=3]="API_KEY"})(sa||(sa={}));var hs;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.OFF=1]="OFF",n[n.ON=2]="ON"})(hs||(hs={}));const X_=8,k0="system",$s="system";Object.assign(Object.create(null),{"":vt.UNSPECIFIED,text:vt.TEXT,tool_use:vt.TOOL_USE,tool_result:vt.TOOL_RESULT,error:vt.ERROR,status:vt.STATUS,system:vt.SYSTEM,finding:vt.FINDING,subtask_create:vt.SUBTASK_CREATE,user_input:vt.USER_INPUT,signal:vt.SIGNAL});vt.UNSPECIFIED+"",vt.TEXT+"",vt.TOOL_USE+"",vt.TOOL_RESULT+"",vt.ERROR+"",vt.STATUS+"",vt.SYSTEM+"",vt.FINDING+"",vt.SUBTASK_CREATE+"",vt.USER_INPUT+"",vt.SIGNAL+"";Object.assign(Object.create(null),{"":It.UNSPECIFIED,not_started:It.NOT_STARTED,working:It.WORKING,paused:It.PAUSED,complete:It.COMPLETE,failed:It.FAILED,pending:It.NOT_STARTED,assigned:It.NOT_STARTED,in_progress:It.WORKING,waiting_input:It.PAUSED,review:It.PAUSED,done:It.COMPLETE});It.UNSPECIFIED+"",It.NOT_STARTED+"",It.WORKING+"",It.PAUSED+"",It.COMPLETE+"",It.FAILED+"";Object.assign(Object.create(null),{"":ds.UNSPECIFIED,active:ds.ACTIVE,archived:ds.ARCHIVED});ds.UNSPECIFIED+"",ds.ACTIVE+"",ds.ARCHIVED+"";Object.assign(Object.create(null),{"":fs.UNSPECIFIED,open:fs.OPEN,closed:fs.CLOSED});fs.UNSPECIFIED+"",fs.OPEN+"",fs.CLOSED+"";Object.assign(Object.create(null),{"":sa.UNSPECIFIED,off:sa.OFF,subscription:sa.SUBSCRIPTION,api_key:sa.API_KEY});sa.UNSPECIFIED+"",sa.OFF+"",sa.SUBSCRIPTION+"",sa.API_KEY+"";Object.assign(Object.create(null),{"":hs.UNSPECIFIED,off:hs.OFF,on:hs.ON});hs.UNSPECIFIED+"",hs.OFF+"",hs.ON+"";function La(n){return Array.isArray?Array.isArray(n):J_(n)==="[object Array]"}function u2(n){if(typeof n=="string")return n;let a=n+"";return a=="0"&&1/n==-1/0?"-0":a}function d2(n){return n==null?"":u2(n)}function ia(n){return typeof n=="string"}function Q_(n){return typeof n=="number"}function f2(n){return n===!0||n===!1||h2(n)&&J_(n)=="[object Boolean]"}function W_(n){return typeof n=="object"}function h2(n){return W_(n)&&n!==null}function An(n){return n!=null}function of(n){return!n.trim().length}function J_(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}const p2="Incorrect 'index' type",m2=n=>`Invalid value for key ${n}`,g2=n=>`Pattern length exceeds max of ${n}.`,v2=n=>`Missing ${n} property in key`,y2=n=>`Property 'weight' in key '${n}' must be a positive integer`,C0=Object.prototype.hasOwnProperty;class b2{constructor(a){this._keys=[],this._keyMap={};let i=0;a.forEach(l=>{let r=ex(l);this._keys.push(r),this._keyMap[r.id]=r,i+=r.weight}),this._keys.forEach(l=>{l.weight/=i})}get(a){return this._keyMap[a]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function ex(n){let a=null,i=null,l=null,r=1,d=null;if(ia(n)||La(n))l=n,a=w0(n),i=If(n);else{if(!C0.call(n,"name"))throw new Error(v2("name"));const u=n.name;if(l=u,C0.call(n,"weight")&&(r=n.weight,r<=0))throw new Error(y2(u));a=w0(u),i=If(u),d=n.getFn}return{path:a,id:i,weight:r,src:l,getFn:d}}function w0(n){return La(n)?n:n.split(".")}function If(n){return La(n)?n.join("."):n}function _2(n,a){let i=[],l=!1;const r=(d,u,p)=>{if(An(d))if(!u[p])i.push(d);else{let m=u[p];const g=d[m];if(!An(g))return;if(p===u.length-1&&(ia(g)||Q_(g)||f2(g)))i.push(d2(g));else if(La(g)){l=!0;for(let y=0,v=g.length;y<v;y+=1)r(g[y],u,p+1)}else u.length&&r(g,u,p+1)}};return r(n,ia(a)?a.split("."):a,0),l?i:i[0]}const x2={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},S2={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(n,a)=>n.score===a.score?n.idx<a.idx?-1:1:n.score<a.score?-1:1},T2={location:0,threshold:.6,distance:100},k2={useExtendedSearch:!1,getFn:_2,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var Se={...S2,...x2,...T2,...k2};const C2=/[^ ]+/g;function w2(n=1,a=3){const i=new Map,l=Math.pow(10,a);return{get(r){const d=r.match(C2).length;if(i.has(d))return i.get(d);const u=1/Math.pow(d,.5*n),p=parseFloat(Math.round(u*l)/l);return i.set(d,p),p},clear(){i.clear()}}}class Uh{constructor({getFn:a=Se.getFn,fieldNormWeight:i=Se.fieldNormWeight}={}){this.norm=w2(i,3),this.getFn=a,this.isCreated=!1,this.setIndexRecords()}setSources(a=[]){this.docs=a}setIndexRecords(a=[]){this.records=a}setKeys(a=[]){this.keys=a,this._keysMap={},a.forEach((i,l)=>{this._keysMap[i.id]=l})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,ia(this.docs[0])?this.docs.forEach((a,i)=>{this._addString(a,i)}):this.docs.forEach((a,i)=>{this._addObject(a,i)}),this.norm.clear())}add(a){const i=this.size();ia(a)?this._addString(a,i):this._addObject(a,i)}removeAt(a){this.records.splice(a,1);for(let i=a,l=this.size();i<l;i+=1)this.records[i].i-=1}getValueForItemAtKeyId(a,i){return a[this._keysMap[i]]}size(){return this.records.length}_addString(a,i){if(!An(a)||of(a))return;let l={v:a,i,n:this.norm.get(a)};this.records.push(l)}_addObject(a,i){let l={i,$:{}};this.keys.forEach((r,d)=>{let u=r.getFn?r.getFn(a):this.getFn(a,r.path);if(An(u)){if(La(u)){let p=[];const m=[{nestedArrIndex:-1,value:u}];for(;m.length;){const{nestedArrIndex:g,value:y}=m.pop();if(An(y))if(ia(y)&&!of(y)){let v={v:y,i:g,n:this.norm.get(y)};p.push(v)}else La(y)&&y.forEach((v,x)=>{m.push({nestedArrIndex:x,value:v})})}l.$[d]=p}else if(ia(u)&&!of(u)){let p={v:u,n:this.norm.get(u)};l.$[d]=p}}}),this.records.push(l)}toJSON(){return{keys:this.keys,records:this.records}}}function tx(n,a,{getFn:i=Se.getFn,fieldNormWeight:l=Se.fieldNormWeight}={}){const r=new Uh({getFn:i,fieldNormWeight:l});return r.setKeys(n.map(ex)),r.setSources(a),r.create(),r}function E2(n,{getFn:a=Se.getFn,fieldNormWeight:i=Se.fieldNormWeight}={}){const{keys:l,records:r}=n,d=new Uh({getFn:a,fieldNormWeight:i});return d.setKeys(l),d.setIndexRecords(r),d}function Gr(n,{errors:a=0,currentLocation:i=0,expectedLocation:l=0,distance:r=Se.distance,ignoreLocation:d=Se.ignoreLocation}={}){const u=a/n.length;if(d)return u;const p=Math.abs(l-i);return r?u+p/r:p?1:u}function A2(n=[],a=Se.minMatchCharLength){let i=[],l=-1,r=-1,d=0;for(let u=n.length;d<u;d+=1){let p=n[d];p&&l===-1?l=d:!p&&l!==-1&&(r=d-1,r-l+1>=a&&i.push([l,r]),l=-1)}return n[d-1]&&d-l>=a&&i.push([l,d-1]),i}const Gs=32;function N2(n,a,i,{location:l=Se.location,distance:r=Se.distance,threshold:d=Se.threshold,findAllMatches:u=Se.findAllMatches,minMatchCharLength:p=Se.minMatchCharLength,includeMatches:m=Se.includeMatches,ignoreLocation:g=Se.ignoreLocation}={}){if(a.length>Gs)throw new Error(g2(Gs));const y=a.length,v=n.length,x=Math.max(0,Math.min(l,v));let S=d,C=x;const w=p>1||m,E=w?Array(v):[];let k;for(;(k=n.indexOf(a,C))>-1;){let R=Gr(a,{currentLocation:k,expectedLocation:x,distance:r,ignoreLocation:g});if(S=Math.min(R,S),C=k+y,w){let B=0;for(;B<y;)E[k+B]=1,B+=1}}C=-1;let A=[],j=1,V=y+v;const I=1<<y-1;for(let R=0;R<y;R+=1){let B=0,G=V;for(;B<G;)Gr(a,{errors:R,currentLocation:x+G,expectedLocation:x,distance:r,ignoreLocation:g})<=S?B=G:V=G,G=Math.floor((V-B)/2+B);V=G;let ee=Math.max(1,x-G+1),ae=u?v:Math.min(x+G,v)+y,te=Array(ae+2);te[ae+1]=(1<<R)-1;for(let Q=ae;Q>=ee;Q-=1){let ie=Q-1,H=i[n.charAt(ie)];if(w&&(E[ie]=+!!H),te[Q]=(te[Q+1]<<1|1)&H,R&&(te[Q]|=(A[Q+1]|A[Q])<<1|1|A[Q+1]),te[Q]&I&&(j=Gr(a,{errors:R,currentLocation:ie,expectedLocation:x,distance:r,ignoreLocation:g}),j<=S)){if(S=j,C=ie,C<=x)break;ee=Math.max(1,2*x-C)}}if(Gr(a,{errors:R+1,currentLocation:x,expectedLocation:x,distance:r,ignoreLocation:g})>S)break;A=te}const F={isMatch:C>=0,score:Math.max(.001,j)};if(w){const R=A2(E,p);R.length?m&&(F.indices=R):F.isMatch=!1}return F}function j2(n){let a={};for(let i=0,l=n.length;i<l;i+=1){const r=n.charAt(i);a[r]=(a[r]||0)|1<<l-i-1}return a}const rc=String.prototype.normalize?(n=>n.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(n=>n);class nx{constructor(a,{location:i=Se.location,threshold:l=Se.threshold,distance:r=Se.distance,includeMatches:d=Se.includeMatches,findAllMatches:u=Se.findAllMatches,minMatchCharLength:p=Se.minMatchCharLength,isCaseSensitive:m=Se.isCaseSensitive,ignoreDiacritics:g=Se.ignoreDiacritics,ignoreLocation:y=Se.ignoreLocation}={}){if(this.options={location:i,threshold:l,distance:r,includeMatches:d,findAllMatches:u,minMatchCharLength:p,isCaseSensitive:m,ignoreDiacritics:g,ignoreLocation:y},a=m?a:a.toLowerCase(),a=g?rc(a):a,this.pattern=a,this.chunks=[],!this.pattern.length)return;const v=(S,C)=>{this.chunks.push({pattern:S,alphabet:j2(S),startIndex:C})},x=this.pattern.length;if(x>Gs){let S=0;const C=x%Gs,w=x-C;for(;S<w;)v(this.pattern.substr(S,Gs),S),S+=Gs;if(C){const E=x-Gs;v(this.pattern.substr(E),E)}}else v(this.pattern,0)}searchIn(a){const{isCaseSensitive:i,ignoreDiacritics:l,includeMatches:r}=this.options;if(a=i?a:a.toLowerCase(),a=l?rc(a):a,this.pattern===a){let w={isMatch:!0,score:0};return r&&(w.indices=[[0,a.length-1]]),w}const{location:d,distance:u,threshold:p,findAllMatches:m,minMatchCharLength:g,ignoreLocation:y}=this.options;let v=[],x=0,S=!1;this.chunks.forEach(({pattern:w,alphabet:E,startIndex:k})=>{const{isMatch:A,score:j,indices:V}=N2(a,w,E,{location:d+k,distance:u,threshold:p,findAllMatches:m,minMatchCharLength:g,includeMatches:r,ignoreLocation:y});A&&(S=!0),x+=j,A&&V&&(v=[...v,...V])});let C={isMatch:S,score:S?x/this.chunks.length:1};return S&&r&&(C.indices=v),C}}class vs{constructor(a){this.pattern=a}static isMultiMatch(a){return E0(a,this.multiRegex)}static isSingleMatch(a){return E0(a,this.singleRegex)}search(){}}function E0(n,a){const i=n.match(a);return i?i[1]:null}class D2 extends vs{constructor(a){super(a)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(a){const i=a===this.pattern;return{isMatch:i,score:i?0:1,indices:[0,this.pattern.length-1]}}}class M2 extends vs{constructor(a){super(a)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(a){const l=a.indexOf(this.pattern)===-1;return{isMatch:l,score:l?0:1,indices:[0,a.length-1]}}}class R2 extends vs{constructor(a){super(a)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(a){const i=a.startsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,this.pattern.length-1]}}}class B2 extends vs{constructor(a){super(a)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(a){const i=!a.startsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,a.length-1]}}}class O2 extends vs{constructor(a){super(a)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(a){const i=a.endsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[a.length-this.pattern.length,a.length-1]}}}class I2 extends vs{constructor(a){super(a)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(a){const i=!a.endsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,a.length-1]}}}class ax extends vs{constructor(a,{location:i=Se.location,threshold:l=Se.threshold,distance:r=Se.distance,includeMatches:d=Se.includeMatches,findAllMatches:u=Se.findAllMatches,minMatchCharLength:p=Se.minMatchCharLength,isCaseSensitive:m=Se.isCaseSensitive,ignoreDiacritics:g=Se.ignoreDiacritics,ignoreLocation:y=Se.ignoreLocation}={}){super(a),this._bitapSearch=new nx(a,{location:i,threshold:l,distance:r,includeMatches:d,findAllMatches:u,minMatchCharLength:p,isCaseSensitive:m,ignoreDiacritics:g,ignoreLocation:y})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(a){return this._bitapSearch.searchIn(a)}}class sx extends vs{constructor(a){super(a)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(a){let i=0,l;const r=[],d=this.pattern.length;for(;(l=a.indexOf(this.pattern,i))>-1;)i=l+d,r.push([l,i-1]);const u=!!r.length;return{isMatch:u,score:u?0:1,indices:r}}}const Lf=[D2,sx,R2,B2,I2,O2,M2,ax],A0=Lf.length,L2=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,z2="|";function U2(n,a={}){return n.split(z2).map(i=>{let l=i.trim().split(L2).filter(d=>d&&!!d.trim()),r=[];for(let d=0,u=l.length;d<u;d+=1){const p=l[d];let m=!1,g=-1;for(;!m&&++g<A0;){const y=Lf[g];let v=y.isMultiMatch(p);v&&(r.push(new y(v,a)),m=!0)}if(!m)for(g=-1;++g<A0;){const y=Lf[g];let v=y.isSingleMatch(p);if(v){r.push(new y(v,a));break}}}return r})}const V2=new Set([ax.type,sx.type]);class H2{constructor(a,{isCaseSensitive:i=Se.isCaseSensitive,ignoreDiacritics:l=Se.ignoreDiacritics,includeMatches:r=Se.includeMatches,minMatchCharLength:d=Se.minMatchCharLength,ignoreLocation:u=Se.ignoreLocation,findAllMatches:p=Se.findAllMatches,location:m=Se.location,threshold:g=Se.threshold,distance:y=Se.distance}={}){this.query=null,this.options={isCaseSensitive:i,ignoreDiacritics:l,includeMatches:r,minMatchCharLength:d,findAllMatches:p,ignoreLocation:u,location:m,threshold:g,distance:y},a=i?a:a.toLowerCase(),a=l?rc(a):a,this.pattern=a,this.query=U2(this.pattern,this.options)}static condition(a,i){return i.useExtendedSearch}searchIn(a){const i=this.query;if(!i)return{isMatch:!1,score:1};const{includeMatches:l,isCaseSensitive:r,ignoreDiacritics:d}=this.options;a=r?a:a.toLowerCase(),a=d?rc(a):a;let u=0,p=[],m=0;for(let g=0,y=i.length;g<y;g+=1){const v=i[g];p.length=0,u=0;for(let x=0,S=v.length;x<S;x+=1){const C=v[x],{isMatch:w,indices:E,score:k}=C.search(a);if(w){if(u+=1,m+=k,l){const A=C.constructor.type;V2.has(A)?p=[...p,...E]:p.push(E)}}else{m=0,u=0,p.length=0;break}}if(u){let x={isMatch:!0,score:m/u};return l&&(x.indices=p),x}}return{isMatch:!1,score:1}}}const zf=[];function G2(...n){zf.push(...n)}function Uf(n,a){for(let i=0,l=zf.length;i<l;i+=1){let r=zf[i];if(r.condition(n,a))return new r(n,a)}return new nx(n,a)}const cc={AND:"$and",OR:"$or"},Vf={PATH:"$path",PATTERN:"$val"},Hf=n=>!!(n[cc.AND]||n[cc.OR]),P2=n=>!!n[Vf.PATH],$2=n=>!La(n)&&W_(n)&&!Hf(n),N0=n=>({[cc.AND]:Object.keys(n).map(a=>({[a]:n[a]}))});function ix(n,a,{auto:i=!0}={}){const l=r=>{let d=Object.keys(r);const u=P2(r);if(!u&&d.length>1&&!Hf(r))return l(N0(r));if($2(r)){const m=u?r[Vf.PATH]:d[0],g=u?r[Vf.PATTERN]:r[m];if(!ia(g))throw new Error(m2(m));const y={keyId:If(m),pattern:g};return i&&(y.searcher=Uf(g,a)),y}let p={children:[],operator:d[0]};return d.forEach(m=>{const g=r[m];La(g)&&g.forEach(y=>{p.children.push(l(y))})}),p};return Hf(n)||(n=N0(n)),l(n)}function F2(n,{ignoreFieldNorm:a=Se.ignoreFieldNorm}){n.forEach(i=>{let l=1;i.matches.forEach(({key:r,norm:d,score:u})=>{const p=r?r.weight:null;l*=Math.pow(u===0&&p?Number.EPSILON:u,(p||1)*(a?1:d))}),i.score=l})}function q2(n,a){const i=n.matches;a.matches=[],An(i)&&i.forEach(l=>{if(!An(l.indices)||!l.indices.length)return;const{indices:r,value:d}=l;let u={indices:r,value:d};l.key&&(u.key=l.key.src),l.idx>-1&&(u.refIndex=l.idx),a.matches.push(u)})}function Y2(n,a){a.score=n.score}function K2(n,a,{includeMatches:i=Se.includeMatches,includeScore:l=Se.includeScore}={}){const r=[];return i&&r.push(q2),l&&r.push(Y2),n.map(d=>{const{idx:u}=d,p={item:a[u],refIndex:u};return r.length&&r.forEach(m=>{m(d,p)}),p})}class Ji{constructor(a,i={},l){this.options={...Se,...i},this.options.useExtendedSearch,this._keyStore=new b2(this.options.keys),this.setCollection(a,l)}setCollection(a,i){if(this._docs=a,i&&!(i instanceof Uh))throw new Error(p2);this._myIndex=i||tx(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(a){An(a)&&(this._docs.push(a),this._myIndex.add(a))}remove(a=()=>!1){const i=[];for(let l=0,r=this._docs.length;l<r;l+=1){const d=this._docs[l];a(d,l)&&(this.removeAt(l),l-=1,r-=1,i.push(d))}return i}removeAt(a){this._docs.splice(a,1),this._myIndex.removeAt(a)}getIndex(){return this._myIndex}search(a,{limit:i=-1}={}){const{includeMatches:l,includeScore:r,shouldSort:d,sortFn:u,ignoreFieldNorm:p}=this.options;let m=ia(a)?ia(this._docs[0])?this._searchStringList(a):this._searchObjectList(a):this._searchLogical(a);return F2(m,{ignoreFieldNorm:p}),d&&m.sort(u),Q_(i)&&i>-1&&(m=m.slice(0,i)),K2(m,this._docs,{includeMatches:l,includeScore:r})}_searchStringList(a){const i=Uf(a,this.options),{records:l}=this._myIndex,r=[];return l.forEach(({v:d,i:u,n:p})=>{if(!An(d))return;const{isMatch:m,score:g,indices:y}=i.searchIn(d);m&&r.push({item:d,idx:u,matches:[{score:g,value:d,norm:p,indices:y}]})}),r}_searchLogical(a){const i=ix(a,this.options),l=(p,m,g)=>{if(!p.children){const{keyId:v,searcher:x}=p,S=this._findMatches({key:this._keyStore.get(v),value:this._myIndex.getValueForItemAtKeyId(m,v),searcher:x});return S&&S.length?[{idx:g,item:m,matches:S}]:[]}const y=[];for(let v=0,x=p.children.length;v<x;v+=1){const S=p.children[v],C=l(S,m,g);if(C.length)y.push(...C);else if(p.operator===cc.AND)return[]}return y},r=this._myIndex.records,d={},u=[];return r.forEach(({$:p,i:m})=>{if(An(p)){let g=l(i,p,m);g.length&&(d[m]||(d[m]={idx:m,item:p,matches:[]},u.push(d[m])),g.forEach(({matches:y})=>{d[m].matches.push(...y)}))}}),u}_searchObjectList(a){const i=Uf(a,this.options),{keys:l,records:r}=this._myIndex,d=[];return r.forEach(({$:u,i:p})=>{if(!An(u))return;let m=[];l.forEach((g,y)=>{m.push(...this._findMatches({key:g,value:u[y],searcher:i}))}),m.length&&d.push({idx:p,item:u,matches:m})}),d}_findMatches({key:a,value:i,searcher:l}){if(!An(i))return[];let r=[];if(La(i))i.forEach(({v:d,i:u,n:p})=>{if(!An(d))return;const{isMatch:m,score:g,indices:y}=l.searchIn(d);m&&r.push({score:g,key:a,value:d,idx:u,norm:p,indices:y})});else{const{v:d,n:u}=i,{isMatch:p,score:m,indices:g}=l.searchIn(d);p&&r.push({score:m,key:a,value:d,norm:u,indices:g})}return r}}Ji.version="7.1.0";Ji.createIndex=tx;Ji.parseIndex=E2;Ji.config=Se;Ji.parseQuery=ix;G2(H2);function Gf(n,a,i,l){if(!a.trim())return[];const r=.3;return new Ji(n,{keys:i,threshold:r,ignoreLocation:!0,includeScore:!0,includeMatches:!0,minMatchCharLength:2}).search(a).map(m=>({item:m.item,score:m.score??1,matches:(m.matches??[]).map(g=>({key:g.key??"",indices:g.indices}))}))}const Pf={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 ua(n){return n==="blocked"?Pf.blocked:Pf[Vh(n)]}const Z2={not_started:"statusPending",working:"statusInProgress",paused:"statusWaitingInput",complete:"statusDone",failed:"statusFailed"};function X2(n){return Z2[Vh(n)]??"statusPending"}const Q2=["working","paused","failed","not_started","blocked","complete"],j0=["not_started","working","paused","complete","failed"],W2={pending:"not_started",assigned:"not_started",in_progress:"working",waiting_input:"paused",review:"paused",done:"complete"};function Vh(n){return n in Pf&&n!=="blocked"?n:W2[n]??"not_started"}const J2={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 ej(n){if(n.length===0)return[];const a=[...n].sort((l,r)=>l[0]-r[0]),i=[[a[0][0],a[0][1]]];for(let l=1;l<a.length;l++){const r=i[i.length-1],[d,u]=a[l];d<=r[1]+1?r[1]=Math.max(r[1],u):i.push([d,u])}return i}function kc({text:n,indices:a,highlightClass:i}){if(!a||a.length===0)return c.jsx(c.Fragment,{children:n});const l=ej(a),r=[];let d=0;for(const[u,p]of l)u>d&&r.push(c.jsx("span",{children:n.slice(d,u)},`p${d}`)),r.push(c.jsx("mark",{className:i,children:n.slice(u,p+1)},`m${u}`)),d=p+1;return d<n.length&&r.push(c.jsx("span",{children:n.slice(d)},`p${d}`)),c.jsx(c.Fragment,{children:r})}function ox(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((r,d)=>r.sortOrder-d.sortOrder);return i.sort((l,r)=>l.sortOrder-r.sortOrder)}function lx(n,a){const i=new Map;for(const d of n){const p=d.dependsOn.length>0&&d.dependsOn.some(g=>a.get(g)!=="complete")?"blocked":d.status,m=i.get(p);m?m.push(d):i.set(p,[d])}const l=[],r=new Set;for(const d of Q2){r.add(d);const u=i.get(d);if(u&&u.length>0){u.sort((m,g)=>m.sortOrder-g.sortOrder);const p=ua(d);l.push({status:d,label:p.label,style:p,tasks:u})}}for(const[d,u]of i)if(!r.has(d)&&u.length>0){u.sort((m,g)=>m.sortOrder-g.sortOrder);const p=ua(d);l.push({status:d,label:p.label,style:p,tasks:u})}return l}const tj="_container_z4i38_1",nj="_header_z4i38_5",aj="_headerActions_z4i38_17",sj="_searchInput_z4i38_23",ij="_searchHighlight_z4i38_56",oj="_groupToggle_z4i38_62",lj="_groupToggleActive_z4i38_89",rj="_addButton_z4i38_93",cj="_taskRow_z4i38_120",uj="_selected_z4i38_140",dj="_expandArrow_z4i38_150",fj="_expanded_z4i38_157",hj="_leafSpacer_z4i38_161",pj="_taskStatusIcon_z4i38_166",mj="_taskTitle_z4i38_170",gj="_workspaceBadge_z4i38_177",vj="_childCountBadge_z4i38_195",yj="_dependencyBadge_z4i38_208",bj="_blockedBadge_z4i38_220",_j="_addChildButton_z4i38_225",xj="_emptyState_z4i38_268",Sj="_statusGroupHeader_z4i38_275",Tj="_statusGroupIcon_z4i38_294",kj="_statusGroupLabel_z4i38_298",Cj="_statusGroupCount_z4i38_303",Ue={container:tj,header:nj,headerActions:aj,searchInput:sj,searchHighlight:ij,groupToggle:oj,groupToggleActive:lj,addButton:rj,taskRow:cj,selected:uj,expandArrow:dj,expanded:fj,leafSpacer:hj,taskStatusIcon:pj,taskTitle:mj,workspaceBadge:gj,childCountBadge:vj,dependencyBadge:yj,blockedBadge:bj,addChildButton:_j,emptyState:xj,statusGroupHeader:Sj,statusGroupIcon:Tj,statusGroupLabel:kj,statusGroupCount:Cj},wj=[{name:"title",weight:2},{name:"description",weight:1}],rx=16,Ej=16,cx="grackle-task-group-by-status";function D0(){try{return localStorage.getItem(cx)==="true"}catch{return!1}}function Aj(n){try{localStorage.setItem(cx,String(n))}catch{}}function Nj({group:n,isExpanded:a,onToggle:i,selectedTaskId:l,navigate:r,titleHighlights:d,workspaceNames:u}){return c.jsxs("div",{"data-testid":`status-group-${n.status}`,children:[c.jsxs("div",{className:Ue.statusGroupHeader,role:"button",tabIndex:0,"aria-expanded":a,onClick:i,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),i())},children:[c.jsx("span",{className:`${Ue.expandArrow} ${a?Ue.expanded:""}`,children:"▸"}),c.jsx("span",{className:Ue.statusGroupIcon,style:{color:n.style.color},children:n.style.icon}),c.jsx("span",{className:Ue.statusGroupLabel,children:n.label}),c.jsx("span",{className:Ue.statusGroupCount,children:n.tasks.length})]}),c.jsx(_n,{children:a&&c.jsx(yt.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=ua(p.status),g=l===p.id,y=p.parentTaskId||!p.workspaceId?void 0:u.get(p.workspaceId);return c.jsxs("div",{onClick:()=>r(Xn(p.id)),className:`${Ue.taskRow} ${g?Ue.selected:""}`,style:{"--task-indent":`${rx}px`},"data-task-id":p.id,children:[c.jsx("span",{className:Ue.leafSpacer}),c.jsx("span",{className:Ue.taskStatusIcon,style:{color:m.color},children:m.icon}),c.jsx("span",{className:Ue.taskTitle,title:p.title,children:c.jsx(kc,{text:p.title,indices:d.get(p.id),highlightClass:Ue.searchHighlight})}),y&&c.jsx("span",{className:Ue.workspaceBadge,title:y,children:y})]},p.id)})})})]})}function ux({node:n,depth:a,expandedTasks:i,toggleTask:l,selectedTaskId:r,navigate:d,taskStatusById:u,titleHighlights:p,workspaceNames:m}){const g=ua(n.status),y=n.dependsOn.length>0&&n.dependsOn.some(k=>u.get(k)!=="complete"),v=i.has(n.id),x=n.children.length>0,S=r===n.id,C=rx+a*Ej,E=a===0&&!n.parentTaskId&&n.workspaceId?m.get(n.workspaceId):void 0;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{onClick:()=>d(Xn(n.id)),className:`${Ue.taskRow} ${S?Ue.selected:""}`,style:{"--task-indent":`${C}px`},"data-task-id":n.id,children:[x&&c.jsx("span",{className:`${Ue.expandArrow} ${v?Ue.expanded:""}`,role:"button",tabIndex:0,"aria-label":v?"Collapse task":"Expand task",onClick:k=>{k.stopPropagation(),l(n.id)},onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),k.stopPropagation(),l(n.id))},children:"▸"}),!x&&c.jsx("span",{className:Ue.leafSpacer}),c.jsx("span",{className:Ue.taskStatusIcon,style:{color:g.color},children:g.icon}),c.jsx("span",{className:Ue.taskTitle,title:n.title,children:c.jsx(kc,{text:n.title,indices:p.get(n.id),highlightClass:Ue.searchHighlight})}),E&&c.jsx("span",{className:Ue.workspaceBadge,title:E,children:E}),x&&c.jsxs("span",{className:Ue.childCountBadge,children:[n.children.filter(k=>k.status==="complete").length,"/",n.children.length]}),n.dependsOn.length>0&&c.jsx("span",{className:`${Ue.dependencyBadge} ${y?Ue.blockedBadge:""}`,title:`Depends on: ${n.dependsOn.join(", ")}`,children:y?"blocked":"dep"}),a<X_&&c.jsx("button",{onClick:k=>{k.stopPropagation(),d(Oa(n.workspaceId,n.id))},title:"Add child task","aria-label":"Add child task",className:Ue.addChildButton,children:"+"})]}),c.jsx(_n,{children:x&&v&&c.jsx(yt.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=>c.jsx(ux,{node:k,depth:a+1,expandedTasks:i,toggleTask:l,selectedTaskId:r,navigate:d,taskStatusById:u,titleHighlights:p,workspaceNames:m},k.id))})})]})}function jj(){const{workspaces:n,tasks:a}=kt(),i=cn(),[l,r]=b.useState(new Set),[d,u]=b.useState(new Set),[p,m]=b.useState(D0),[g,y]=b.useState(D0),[v,x]=b.useState(new Map),S=jt("/tasks/:taskId/*"),C=(S==null?void 0:S.params.taskId)!=="new"?S==null?void 0:S.params.taskId:void 0,w=b.useMemo(()=>new Map(a.map(Q=>[Q.id,Q.status])),[a]),E=b.useMemo(()=>new Map(n.map(Q=>[Q.id,Q.name])),[n]),k=()=>{const Q=!p;Aj(Q),m(Q),Q&&(y(!0),x(new Map))},A=Q=>{x(ie=>{const H=new Map(ie),M=H.has(Q)?H.get(Q):g;return H.set(Q,!M),H})},j=Q=>v.has(Q)?v.get(Q):g,V=Q=>{r(ie=>{const H=new Set(ie);return H.has(Q)?(H.delete(Q),u(M=>new Set(M).add(Q))):(H.add(Q),u(M=>{const J=new Set(M);return J.delete(Q),J})),H})};b.useEffect(()=>{const Q=new Set(a.filter(ie=>ie.parentTaskId).map(ie=>ie.parentTaskId));Q.size>0&&r(ie=>{const H=new Set(ie);for(const M of Q)d.has(M)||H.add(M);return H})},[a,d]);const[I,F]=b.useState(""),{directMatchTaskIds:R,treeMatchTaskIds:B,titleHighlights:G}=b.useMemo(()=>{if(!I.trim())return{directMatchTaskIds:null,treeMatchTaskIds:null,titleHighlights:new Map};const Q=Gf(a,I,wj),ie=new Set(Q.map(le=>le.item.id)),H=new Map;for(const le of Q){const Y=le.matches.find(pe=>pe.key==="title");Y&&H.set(le.item.id,Y.indices)}const M=new Set(ie),J=new Map(a.map(le=>[le.id,le]));for(const le of[...ie]){let Y=J.get(le);for(;Y!=null&&Y.parentTaskId;)M.add(Y.parentTaskId),Y=J.get(Y.parentTaskId)}return{directMatchTaskIds:ie,treeMatchTaskIds:M,titleHighlights:H}},[I,a]),ee=R!==null,ae=ee?p?R:B:null,te=ae?a.filter(Q=>ae.has(Q.id)):a,fe=p?[]:ox(te);return c.jsxs("div",{className:Ue.container,children:[c.jsxs("div",{className:Ue.header,children:[c.jsx("span",{children:"Tasks"}),c.jsxs("div",{className:Ue.headerActions,children:[c.jsx("button",{className:`${Ue.groupToggle} ${p?Ue.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:"≡"}),c.jsx("button",{className:Ue.addButton,onClick:()=>i(Oa()),"aria-label":"New task",title:"New task","data-testid":"new-task-button",children:"+"})]})]}),a.length>0&&c.jsx("input",{type:"text",value:I,onChange:Q=>F(Q.target.value),placeholder:"Filter...","aria-label":"Filter tasks",className:Ue.searchInput,"data-testid":"sidebar-search"}),p?lx(te,w).map(Q=>c.jsx(Nj,{group:Q,isExpanded:j(Q.status),onToggle:()=>A(Q.status),selectedTaskId:C,navigate:i,titleHighlights:G,workspaceNames:E},Q.status)):fe.map(Q=>c.jsx(ux,{node:Q,depth:0,expandedTasks:l,toggleTask:V,selectedTaskId:C,navigate:i,taskStatusById:w,titleHighlights:G,workspaceNames:E},Q.id)),te.length===0&&!ee&&c.jsx("div",{className:Ue.emptyState,children:"No tasks yet. Click + to create one."}),te.length===0&&ee&&c.jsx("div",{className:Ue.emptyState,children:"No matching tasks"})]})}const Dj="_breadcrumbs_17or2_1",Mj="_list_17or2_11",Rj="_item_17or2_21",Bj="_separator_17or2_28",Oj="_link_17or2_34",Ij="_current_17or2_57",Bi={breadcrumbs:Dj,list:Mj,item:Rj,separator:Bj,link:Oj,current:Ij},Lj="›";function eo({segments:n}){return c.jsx("nav",{className:Bi.breadcrumbs,"aria-label":"Breadcrumb","data-testid":"breadcrumbs",children:c.jsx("ol",{className:Bi.list,children:n.map((a,i)=>{const l=i===n.length-1;return c.jsxs("li",{className:Bi.item,children:[i>0&&c.jsx("span",{className:Bi.separator,"aria-hidden":"true",children:Lj}),a.url&&!l?c.jsx(eh,{className:Bi.link,to:a.url,title:a.label,children:a.label}):c.jsx("span",{className:Bi.current,"aria-current":"page",title:a.label,children:a.label})]},i)})})})}function $f(){$f=function(r,d){return new i(r,void 0,d)};var n=RegExp.prototype,a=new WeakMap;function i(r,d,u){var p=new RegExp(r,d);return a.set(p,u||a.get(r)),uc(p,i.prototype)}function l(r,d){var u=a.get(d);return Object.keys(u).reduce(function(p,m){var g=u[m];if(typeof g=="number")p[m]=r[g];else{for(var y=0;r[g[y]]===void 0&&y+1<g.length;)y++;p[m]=r[g[y]]}return p},Object.create(null))}return(function(r,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(d&&d.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),d&&uc(r,d)})(i,RegExp),i.prototype.exec=function(r){var d=n.exec.call(this,r);if(d){d.groups=l(d,this);var u=d.indices;u&&(u.groups=l(u,this))}return d},i.prototype[Symbol.replace]=function(r,d){if(typeof d=="string"){var u=a.get(this);return n[Symbol.replace].call(this,r,d.replace(/\$<([^>]+)>/g,function(m,g){var y=u[g];return"$"+(Array.isArray(y)?y.join("$"):y)}))}if(typeof d=="function"){var p=this;return n[Symbol.replace].call(this,r,function(){var m=arguments;return typeof m[m.length-1]!="object"&&(m=[].slice.call(m)).push(l(m,p)),d.apply(this,m)})}return n[Symbol.replace].call(this,r,d)},$f.apply(this,arguments)}function uc(n,a){return uc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,l){return i.__proto__=l,i},uc(n,a)}function M0(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 lf(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(r,d){if(r){if(typeof r=="string")return M0(r,d);var u=Object.prototype.toString.call(r).slice(8,-1);return u==="Object"&&r.constructor&&(u=r.constructor.name),u==="Map"||u==="Set"?Array.from(r):u==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u)?M0(r,d):void 0}})(n))||a){i&&(n=i);var l=0;return function(){return l>=n.length?{done:!0}:{done:!1,value:n[l++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
87
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var zj=(function(n){return function(a){return a===void 0&&(a={}),(function(l,r){if(r&&!l.registered(r))throw new Error('The default language "'+r+'" is not registered with refractor.')})(n,a.defaultLanguage),function(l){B1(l,"element",i)};function i(l,r,d){var u,p;if(d&&d.tagName==="pre"&&l.tagName==="code"){var m=(l==null||(u=l.data)==null?void 0:u.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 g,y,v=(function(I){for(var F,R=lf(I.properties.className);!(F=R()).done;){var B=F.value;if(B.slice(0,9)==="language-")return B.slice(9).toLowerCase()}return null})(l);if(!v&&a.defaultLanguage&&l.properties.className.push("language-"+(v=a.defaultLanguage)),l.properties.className.push("code-highlight"),v)try{var x,S;S=(x=v)!=null&&x.includes("diff-")?v.split("-")[1]:v,g=n.highlight(Ir(l),S),d.properties.className=(d.properties.className||[]).concat("language-"+S)}catch(I){if(!a.ignoreMissing||!/Unknown language/.test(I.message))throw I;g=l}else g=l;g.children=(y=1,function I(F){return F.reduce(function(R,B){if(B.type==="text"){var G=B.value,ee=(G.match(/\n/g)||"").length;if(ee===0)B.position={start:{line:y,column:1},end:{line:y,column:1}},R.push(B);else for(var ae,te=G.split(`
|
|
88
|
-
`),fe=lf(te.entries());!(ae=fe()).done;){var Q=ae.value,ie=Q[0],H=Q[1];R.push({type:"text",value:ie===te.length-1?H:H+`
|
|
89
|
-
`,position:{start:{line:y+ie,column:1},end:{line:y+ie,column:1}}})}return y+=ee,R}if(Object.prototype.hasOwnProperty.call(B,"children")){var M=y;return B.children=I(B.children),R.push(B),B.position={start:{line:M,column:1},end:{line:y,column:1}},R}return R.push(B),R},[])})(g.children),g.position=g.children.length>0?{start:{line:g.children[0].position.start.line,column:0},end:{line:g.children[g.children.length-1].position.end.line,column:0}}:{start:{line:0,column:0},end:{line:0,column:0}};for(var C,w=(function(I){var F=/{([\d,-]+)}/,R=I.split(",").map(function(ee){return ee.trim()}).join();if(F.test(R)){var B=F.exec(R)[1],G=I1(B);return function(ee){return G.includes(ee+1)}}return function(){return!1}})(m),E=(function(I){var F=$f(/showLineNumbers=(\d+)/i,{lines:1});if(F.test(I)){var R=F.exec(I);return Number(R.groups.lines)}return 1})(m),k=(function(I){for(var F=new Array(I),R=0;R<I;R++)F[R]={type:"element",tagName:"span",properties:{className:[]},children:[]};return F})(g.position.end.line),A=["showlinenumbers=false",'showlinenumbers="false"',"showlinenumbers={false}"],j=function(){var I,F,R=C.value,B=R[0],G=R[1];G.properties.className=["code-line"];var ee=L1(g,function(ae){return ae.position.start.line<=B+1&&ae.position.end.line>=B+1});G.children=ee.children,(m.toLowerCase().includes("showLineNumbers".toLowerCase())||a.showLineNumbers===!0||typeof a.showLineNumbers=="object"&&a.showLineNumbers.includes(v))&&!A.some(function(ae){return m.toLowerCase().includes(ae)})&&(G.properties.line=[(B+E).toString()],G.properties.className.push("line-number")),w(B)&&G.properties.className.push("highlight-line"),(v==="diff"||(I=v)!=null&&I.includes("diff-"))&&Ir(G).substring(0,1)==="-"?G.properties.className.push("deleted"):(v==="diff"||(F=v)!=null&&F.includes("diff-"))&&Ir(G).substring(0,1)==="+"&&G.properties.className.push("inserted")},V=lf(k.entries());!(C=V()).done;)j();k.length>0&&Ir(k[k.length-1]).trim()===""&&k.pop(),l.children=k}}}})(O1);const Uj="_systemContextEvent_5vmgk_1",Vj="_systemContextHeader_5vmgk_7",Hj="_systemContextBadge_5vmgk_28",Gj="_systemContextToggle_5vmgk_37",Pj="_systemContextPre_5vmgk_43",$j="_systemContextEllipsis_5vmgk_54",Fj="_systemEvent_5vmgk_58",qj="_systemTimestamp_5vmgk_65",Yj="_textEvent_5vmgk_69",Kj="_toolUseEvent_5vmgk_155",Zj="_toolUseHeader_5vmgk_175",Xj="_toolUsePrefix_5vmgk_182",Qj="_toolUseName_5vmgk_187",Wj="_toolUseArgs_5vmgk_192",Jj="_toolResultEvent_5vmgk_203",eD="_toolResultHeader_5vmgk_208",tD="_toolResultIndicatorOk_5vmgk_232",nD="_toolResultIndicatorError_5vmgk_239",aD="_toolResultLabel_5vmgk_246",sD="_toolResultToggle_5vmgk_250",iD="_toolResultCommand_5vmgk_256",oD="_toolResultEllipsis_5vmgk_266",lD="_toolResultPre_5vmgk_270",rD="_errorEvent_5vmgk_291",cD="_statusEvent_5vmgk_299",uD="_userInputEvent_5vmgk_308",dD="_userInputContent_5vmgk_314",fD="_signalEvent_5vmgk_331",hD="_signalBadge_5vmgk_342",pD="_signalContent_5vmgk_351",mD="_defaultEvent_5vmgk_356",Ke={systemContextEvent:Uj,systemContextHeader:Vj,systemContextBadge:Hj,systemContextToggle:Gj,systemContextPre:Pj,systemContextEllipsis:$j,systemEvent:Fj,systemTimestamp:qj,textEvent:Yj,toolUseEvent:Kj,toolUseHeader:Zj,toolUsePrefix:Xj,toolUseName:Qj,toolUseArgs:Wj,toolResultEvent:Jj,toolResultHeader:eD,toolResultIndicatorOk:tD,toolResultIndicatorError:nD,toolResultLabel:aD,toolResultToggle:sD,toolResultCommand:iD,toolResultEllipsis:oD,toolResultPre:lD,errorEvent:rD,statusEvent:cD,userInputEvent:uD,userInputContent:dD,signalEvent:fD,signalBadge:hD,signalContent:pD,defaultEvent:mD},R0=3;function gD({content:n}){const[a,i]=b.useState(!1),l=n.split(`
|
|
90
|
-
`),r=l.length>R0,d=a?n:l.slice(0,R0).join(`
|
|
91
|
-
`);return c.jsxs("div",{className:Ke.systemContextEvent,"data-testid":"system-context-event",children:[c.jsxs("button",{type:"button",className:Ke.systemContextHeader,onClick:()=>{i(u=>!u)},"aria-expanded":a,children:[c.jsx("span",{className:Ke.systemContextBadge,children:"SYSTEM PROMPT"}),r&&c.jsx("span",{className:Ke.systemContextToggle,"aria-hidden":"true",children:a?"▾":"▸"})]}),c.jsxs("pre",{className:Ke.systemContextPre,children:[d,!a&&r&&c.jsx("span",{className:Ke.systemContextEllipsis,children:"…"})]})]})}function vD({time:n,content:a}){return c.jsxs("div",{className:Ke.systemEvent,children:[c.jsxs("span",{className:Ke.systemTimestamp,children:["[",n,"]"]})," ",a]})}function yD({content:n}){return c.jsx("div",{className:Ke.textEvent,children:c.jsx(qf,{remarkPlugins:[Yf],rehypePlugins:[zj],children:n})})}function bD({content:n}){let a="",i=n;try{const l=JSON.parse(n);a=l.tool||"",i=JSON.stringify(l.args,null,2)}catch{}return c.jsxs("div",{className:Ke.toolUseEvent,children:[c.jsxs("div",{className:Ke.toolUseHeader,children:[c.jsx("span",{className:Ke.toolUsePrefix,children:">"}),a?c.jsx("span",{className:Ke.toolUseName,children:a}):null]}),c.jsx("pre",{className:Ke.toolUseArgs,children:i})]})}const B0=5;function _D(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 xD({content:n,raw:a,toolUseCtx:i}){const[l,r]=b.useState(!1);let d=!1;if(a)try{d=JSON.parse(a).is_error===!0}catch{}const u=n.split(`
|
|
92
|
-
`),p=u.length>B0,m=l?n:u.slice(0,B0).join(`
|
|
93
|
-
`),y=((i==null?void 0:i.tool)??"")||(d?"Tool error":"Tool output"),v=i?_D(i.tool,i.args):"",x=c.jsxs(c.Fragment,{children:[c.jsx("span",{className:d?Ke.toolResultIndicatorError:Ke.toolResultIndicatorOk,"aria-label":d?"error":"success","data-testid":d?"tool-result-indicator-error":"tool-result-indicator-ok",children:d?"✗":"✓"}),c.jsx("span",{className:Ke.toolResultLabel,"data-testid":"tool-result-label",children:y}),p&&c.jsx("span",{className:Ke.toolResultToggle,"aria-hidden":"true",children:l?"▾":"▸"})]});return c.jsxs("div",{className:Ke.toolResultEvent,"data-testid":"tool-result",children:[p?c.jsx("button",{className:Ke.toolResultHeader,"data-testid":"tool-result-header",onClick:()=>{r(S=>!S)},"aria-expanded":l,children:x}):c.jsx("div",{className:Ke.toolResultHeader,"data-testid":"tool-result-header",children:x}),v&&c.jsx("div",{className:Ke.toolResultCommand,children:v}),c.jsxs("pre",{className:Ke.toolResultPre,"data-testid":"tool-result-content",children:[m,!l&&p&&c.jsx("span",{className:Ke.toolResultEllipsis,children:"…"})]})]})}function SD({content:n}){return c.jsxs("div",{className:Ke.errorEvent,children:["Error: ",n]})}function TD({content:n}){return c.jsxs("div",{className:Ke.statusEvent,children:["--- ",n," ---"]})}function kD({content:n}){return c.jsx("div",{className:Ke.userInputEvent,children:c.jsx("span",{className:Ke.userInputContent,children:n})})}function CD({content:n}){return c.jsxs("div",{className:Ke.signalEvent,"data-testid":"signal-event",children:[c.jsx("span",{className:Ke.signalBadge,children:"SIGNAL"}),c.jsx("span",{className:Ke.signalContent,children:n})]})}function wD({content:n}){return c.jsx("div",{className:Ke.defaultEvent,children:n})}function ED({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 c.jsx(gD,{content:n.content})}catch{}return c.jsx(vD,{time:i,content:n.content})}case"text":case"output":return c.jsx(yD,{content:n.content});case"tool_use":return c.jsx(bD,{content:n.content});case"tool_result":return c.jsx(xD,{content:n.content,raw:n.raw,toolUseCtx:a});case"error":return c.jsx(SD,{content:n.content});case"status":return c.jsx(TD,{content:n.content});case"user_input":return c.jsx(kD,{content:n.content});case"signal":return c.jsx(CD,{content:n.content});default:return c.jsx(wD,{content:n.content})}}const AD="_overlay_cmicx_1",ND="_dialog_cmicx_11",jD="_title_cmicx_30",DD="_description_cmicx_38",MD="_actions_cmicx_45",RD="_cancelButton_cmicx_52",BD="_confirmButton_cmicx_79",zs={overlay:AD,dialog:ND,title:jD,description:DD,actions:MD,cancelButton:RD,confirmButton:BD};function Cc({isOpen:n,title:a,description:i,confirmLabel:l="Delete",onConfirm:r,onCancel:d}){const u=b.useId(),p=b.useId();return c.jsx(_n,{children:n&&c.jsx(yt.div,{className:zs.overlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},onClick:d,onKeyDown:m=>{m.key==="Escape"&&d()},role:"dialog","aria-modal":"true","aria-labelledby":u,"aria-describedby":i?p:void 0,children:c.jsxs(yt.div,{className:zs.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:[c.jsx("h3",{id:u,className:zs.title,children:a}),i&&c.jsx("p",{id:p,className:zs.description,children:i}),c.jsxs("div",{className:zs.actions,children:[c.jsx("button",{type:"button",className:zs.cancelButton,onClick:d,autoFocus:!0,children:"Cancel"}),c.jsx("button",{type:"button",className:zs.confirmButton,onClick:r,children:l})]})]})})})}const OD="_spinner_1uyt1_1",ID="_spin_1uyt1_1",LD="_sm_1uyt1_14",zD="_md_1uyt1_20",UD="_lg_1uyt1_26",VD="_xl_1uyt1_32",O0={spinner:OD,spin:ID,sm:LD,md:zD,lg:UD,xl:VD};function dc({size:n="md",className:a,label:i="Loading",liveRegion:l=!1}){return c.jsx("span",{className:`${O0.spinner} ${O0[n]} ${a??""}`,role:l?"status":void 0,"aria-label":i,"aria-hidden":l?void 0:!0})}const HD="_splash_1bn1g_1",GD="_logo_1bn1g_11",I0={splash:HD,logo:GD};function PD(){return c.jsxs("div",{className:I0.splash,"data-testid":"splash-screen",children:[c.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:I0.logo}),c.jsx(dc,{size:"xl",label:"Loading Grackle",liveRegion:!0})]})}const $D="_container_wg6d2_1",FD="_homeRow_wg6d2_5",qD="_selected_wg6d2_30",YD="_homeIcon_wg6d2_36",KD="_header_wg6d2_41",ZD="_searchInput_wg6d2_53",XD="_searchHighlight_wg6d2_86",QD="_addButton_wg6d2_92",WD="_createForm_wg6d2_119",JD="_createInput_wg6d2_125",eM="_createButton_wg6d2_156",tM="_creatingHint_wg6d2_197",nM="_workspaceRow_wg6d2_206",aM="_expandArrow_wg6d2_229",sM="_expanded_wg6d2_236",iM="_workspaceName_wg6d2_240",oM="_taskCount_wg6d2_244",lM="_newTaskButton_wg6d2_250",rM="_taskRow_wg6d2_277",cM="_taskStatusIcon_wg6d2_307",uM="_taskTitle_wg6d2_311",dM="_dependencyBadge_wg6d2_318",fM="_blockedBadge_wg6d2_330",hM="_leafSpacer_wg6d2_335",pM="_childCountBadge_wg6d2_340",mM="_addChildButton_wg6d2_353",gM="_emptyCta_wg6d2_402",vM="_ctaDescription_wg6d2_415",yM="_ctaButton_wg6d2_421",bM="_emptyTaskCta_wg6d2_456",_M="_headerActions_wg6d2_461",xM="_groupToggle_wg6d2_467",SM="_groupToggleActive_wg6d2_494",TM="_statusGroupHeader_wg6d2_498",kM="_statusGroupIcon_wg6d2_517",CM="_statusGroupLabel_wg6d2_521",wM="_statusGroupCount_wg6d2_526",EM="_createTaskLink_wg6d2_539",xe={container:$D,homeRow:FD,selected:qD,homeIcon:YD,header:KD,searchInput:ZD,searchHighlight:XD,addButton:QD,createForm:WD,createInput:JD,createButton:eM,creatingHint:tM,workspaceRow:nM,expandArrow:aM,expanded:sM,workspaceName:iM,taskCount:oM,newTaskButton:lM,taskRow:rM,taskStatusIcon:cM,taskTitle:uM,dependencyBadge:dM,blockedBadge:fM,leafSpacer:hM,childCountBadge:pM,addChildButton:mM,emptyCta:gM,ctaDescription:vM,ctaButton:yM,emptyTaskCta:bM,headerActions:_M,groupToggle:xM,groupToggleActive:SM,statusGroupHeader:TM,statusGroupIcon:kM,statusGroupLabel:CM,statusGroupCount:wM,createTaskLink:EM},AM=[{name:"name",weight:2},{name:"description",weight:1}],NM=[{name:"title",weight:2},{name:"description",weight:1}],dx=34,jM=16,fx="grackle-group-by-status";function L0(){try{return localStorage.getItem(fx)==="true"}catch{return!1}}function DM(n){try{localStorage.setItem(fx,String(n))}catch{}}function MM({group:n,isExpanded:a,onToggle:i,selectedTaskId:l,navigate:r,workspaceId:d,titleHighlights:u}){return c.jsxs("div",{"data-testid":`status-group-${n.status}`,children:[c.jsxs("div",{className:xe.statusGroupHeader,role:"button",tabIndex:0,"aria-expanded":a,onClick:i,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),i())},children:[c.jsx("span",{className:`${xe.expandArrow} ${a?xe.expanded:""}`,children:"▸"}),c.jsx("span",{className:xe.statusGroupIcon,style:{color:n.style.color},children:n.style.icon}),c.jsx("span",{className:xe.statusGroupLabel,children:n.label}),c.jsx("span",{className:xe.statusGroupCount,children:n.tasks.length})]}),c.jsx(_n,{children:a&&c.jsx(yt.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=ua(p.status),g=l===p.id;return c.jsxs("div",{onClick:()=>r(Xn(p.id,void 0,d)),className:`${xe.taskRow} ${g?xe.selected:""}`,style:{"--task-indent":`${dx}px`},"data-task-id":p.id,children:[c.jsx("span",{className:xe.leafSpacer}),c.jsx("span",{className:xe.taskStatusIcon,style:{color:m.color},children:m.icon}),c.jsx("span",{className:xe.taskTitle,title:p.title,children:c.jsx(kc,{text:p.title,indices:u.get(p.id),highlightClass:xe.searchHighlight})})]},p.id)})})})]})}function hx({node:n,depth:a,expandedTasks:i,toggleTask:l,selectedTaskId:r,navigate:d,workspaceId:u,taskStatusById:p,titleHighlights:m}){const g=ua(n.status),y=n.dependsOn.length>0&&n.dependsOn.some(w=>p.get(w)!=="complete"),v=i.has(n.id),x=n.children.length>0,S=r===n.id,C=dx+a*jM;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{onClick:()=>d(Xn(n.id,void 0,u)),className:`${xe.taskRow} ${S?xe.selected:""}`,style:{"--task-indent":`${C}px`},"data-task-id":n.id,children:[x&&c.jsx("span",{className:`${xe.expandArrow} ${v?xe.expanded:""}`,role:"button",tabIndex:0,"aria-label":v?"Collapse task":"Expand task",onClick:w=>{w.stopPropagation(),l(n.id)},onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),w.stopPropagation(),l(n.id))},children:"▸"}),!x&&c.jsx("span",{className:xe.leafSpacer}),c.jsx("span",{className:xe.taskStatusIcon,style:{color:g.color},children:g.icon}),c.jsx("span",{className:xe.taskTitle,title:n.title,children:c.jsx(kc,{text:n.title,indices:m.get(n.id),highlightClass:xe.searchHighlight})}),x&&c.jsxs("span",{className:xe.childCountBadge,children:[n.children.filter(w=>w.status==="complete").length,"/",n.children.length]}),n.dependsOn.length>0&&c.jsx("span",{className:`${xe.dependencyBadge} ${y?xe.blockedBadge:""}`,title:`Depends on: ${n.dependsOn.join(", ")}`,children:y?"blocked":"dep"}),a<X_&&c.jsx("button",{onClick:w=>{w.stopPropagation(),d(Oa(u,n.id))},title:"Add child task","aria-label":"Add child task",className:xe.addChildButton,children:"+"})]}),c.jsx(_n,{children:x&&v&&c.jsx(yt.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(w=>c.jsx(hx,{node:w,depth:a+1,expandedTasks:i,toggleTask:l,selectedTaskId:r,navigate:d,workspaceId:u,taskStatusById:p,titleHighlights:m},w.id))})})]})}function RM(){const{workspaces:n,tasks:a,environments:i,loadTasks:l,createWorkspace:r,workspaceCreating:d}=kt(),u=cn(),m=qt().pathname===qs,[g,y]=b.useState(new Set),[v,x]=b.useState(new Set),[S,C]=b.useState(new Set),[w,E]=b.useState(!1),[k,A]=b.useState(""),[j,V]=b.useState(L0),[I,F]=b.useState(L0),[R,B]=b.useState(new Map),G=()=>{const W=!j;DM(W),V(W),W&&(F(!0),B(new Map))},ee=(W,Ce)=>{const me=`${W}:${Ce}`;B(Oe=>{const wt=new Map(Oe),Et=wt.has(me)?wt.get(me):I;return wt.set(me,!Et),wt})},ae=(W,Ce)=>{const me=`${W}:${Ce}`;return R.has(me)?R.get(me):I},te=jt("/tasks/:taskId/*"),fe=jt("/workspaces/:workspaceId"),Q=(te==null?void 0:te.params.taskId)!=="new"?te==null?void 0:te.params.taskId:void 0,ie=fe==null?void 0:fe.params.workspaceId,H=b.useRef(g);H.current=g;const M=b.useMemo(()=>new Map(a.map(W=>[W.id,W.status])),[a]),J=W=>{y(Ce=>{const me=new Set(Ce);return me.has(W)?me.delete(W):(me.add(W),l(W)),me})},le=W=>{x(Ce=>{const me=new Set(Ce);return me.has(W)?(me.delete(W),C(Oe=>new Set(Oe).add(W))):(me.add(W),C(Oe=>{const wt=new Set(Oe);return wt.delete(W),wt})),me})};b.useEffect(()=>{const W=new Set(a.filter(Ce=>Ce.parentTaskId).map(Ce=>Ce.parentTaskId));W.size>0&&x(Ce=>{const me=new Set(Ce);for(const Oe of W)S.has(Oe)||me.add(Oe);return me})},[a,S]),b.useEffect(()=>{ie&&!H.current.has(ie)&&(y(W=>new Set(W).add(ie)),l(ie))},[ie,l]);const Y=()=>{!k.trim()||d||i.length===0||(r(k.trim(),void 0,void 0,i[0].id),A(""),E(!1))},[pe,De]=b.useState(""),{directMatchTaskIds:se,treeMatchTaskIds:je,visibleWorkspaceIds:pt,matchedWorkspaceIds:Ct,titleHighlights:un}=b.useMemo(()=>{if(!pe.trim())return{directMatchTaskIds:null,treeMatchTaskIds:null,visibleWorkspaceIds:null,matchedWorkspaceIds:null,titleHighlights:new Map};const W=Gf(n,pe,AM),Ce=Gf(a,pe,NM),me=new Set(W.map(Me=>Me.item.id)),Oe=new Set(Ce.map(Me=>Me.item.id)),wt=new Map;for(const Me of Ce){const Ve=Me.matches.find(an=>an.key==="title");Ve&&wt.set(Me.item.id,Ve.indices)}const Et=new Set(me);for(const Me of Ce)Me.item.workspaceId&&Et.add(Me.item.workspaceId);const Pt=new Set(Oe),en=new Map(a.map(Me=>[Me.id,Me]));for(const Me of[...Oe]){let Ve=en.get(Me);for(;Ve!=null&&Ve.parentTaskId;)Pt.add(Ve.parentTaskId),Ve=en.get(Ve.parentTaskId)}return{directMatchTaskIds:Oe,treeMatchTaskIds:Pt,visibleWorkspaceIds:Et,matchedWorkspaceIds:me,titleHighlights:wt}},[pe,n,a]),Jt=b.useRef(new Set);return b.useEffect(()=>{if(pe.trim())for(const W of n)!g.has(W.id)&&!Jt.current.has(W.id)&&(Jt.current.add(W.id),l(W.id))},[pe,n,g,l]),c.jsxs("div",{className:xe.container,children:[c.jsxs("div",{className:xe.header,children:[c.jsx("span",{children:"Workspaces"}),c.jsxs("div",{className:xe.headerActions,children:[c.jsx("button",{className:`${xe.groupToggle} ${j?xe.groupToggleActive:""}`,onClick:G,"aria-label":j?"Switch to tree view":"Group tasks by status","aria-pressed":j,title:j?"Switch to tree view":"Group tasks by status","data-testid":"group-by-status-toggle",children:"≡"}),c.jsx("button",{className:xe.addButton,onClick:()=>E(!w),"aria-label":"Create workspace",title:"Create workspace",children:"+"})]})]}),c.jsxs("button",{type:"button",className:`${xe.homeRow} ${m?xe.selected:""}`,onClick:()=>u(qs),"data-testid":"sidebar-home","aria-current":m?"page":void 0,children:[c.jsx("span",{className:xe.homeIcon,"aria-hidden":"true",children:"⌂"}),c.jsx("span",{children:"Home"})]}),n.length>0&&c.jsx("input",{type:"text",value:pe,onChange:W=>De(W.target.value),placeholder:"Filter...","aria-label":"Filter workspaces and tasks",className:xe.searchInput,"data-testid":"sidebar-search"}),w&&c.jsxs("div",{className:xe.createForm,children:[c.jsx("input",{type:"text",value:k,onChange:W=>A(W.target.value),onKeyDown:W=>W.key==="Enter"&&Y(),placeholder:"Workspace name...",autoFocus:!0,disabled:d,className:xe.createInput}),c.jsx("button",{onClick:Y,className:xe.createButton,disabled:d,children:d?c.jsx(dc,{size:"sm",label:"Creating workspace"}):"OK"})]}),d&&c.jsxs("div",{className:xe.creatingHint,children:[c.jsx(dc,{size:"sm",label:"Creating workspace"}),"Creating workspace…"]}),n.length===0&&!w&&c.jsxs("div",{className:xe.emptyCta,children:[c.jsx("button",{className:xe.ctaButton,onClick:()=>E(!0),children:"Create Workspace"}),c.jsx("div",{className:xe.ctaDescription,children:"Organize your work into workspaces"})]}),n.map(W=>{if(pt&&!pt.has(W.id))return null;const Ce=se!==null,me=g.has(W.id)||Ce,Oe=a.filter(Ve=>Ve.workspaceId===W.id),wt=(Ct==null?void 0:Ct.has(W.id))??!1,Et=Ce&&!wt?j?se:je:null,Pt=Et?Oe.filter(Ve=>Et.has(Ve.id)):Oe,en=ie===W.id,Me=me&&!j?ox(Pt):[];return c.jsxs("div",{children:[c.jsxs("div",{onClick:()=>{en?J(W.id):(me||J(W.id),u($i(W.id)))},className:`${xe.workspaceRow} ${en?xe.selected:""}`,"data-testid":"workspace-row",children:[c.jsx("span",{className:`${xe.expandArrow} ${me?xe.expanded:""}`,children:"▸"}),c.jsx("span",{className:xe.workspaceName,title:W.name,children:W.name}),c.jsx("span",{className:xe.taskCount,children:Oe.length>0&&`${Oe.filter(Ve=>Ve.status==="complete").length}/${Oe.length}`}),c.jsx("button",{onClick:Ve=>{Ve.stopPropagation(),u(Oa(W.id))},title:"New task",className:xe.newTaskButton,children:"+"})]}),c.jsx(_n,{children:me&&c.jsxs(yt.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeInOut"},style:{overflow:"hidden"},children:[j?lx(Pt,M).map(Ve=>c.jsx(MM,{group:Ve,isExpanded:ae(W.id,Ve.status),onToggle:()=>ee(W.id,Ve.status),selectedTaskId:Q,navigate:u,workspaceId:W.id,titleHighlights:un},Ve.status)):Me.map(Ve=>c.jsx(hx,{node:Ve,depth:0,expandedTasks:v,toggleTask:le,selectedTaskId:Q,navigate:u,workspaceId:W.id,taskStatusById:M,titleHighlights:un},Ve.id)),Pt.length===0&&c.jsx("div",{className:xe.emptyTaskCta,children:c.jsx("button",{className:xe.createTaskLink,onClick:()=>u(Oa(W.id)),children:"+ Create Task"})})]})})]},W.id)})]})}const BM="_nav_1bhou_1",OM="_tab_1bhou_24",IM="_tabIcon_1bhou_62",LM="_tabActive_1bhou_68",Pr={nav:BM,tab:OM,tabIcon:IM,tabActive:LM},Da=[{path:"environments",label:"Environments",icon:"🖥️"},{path:"credentials",label:"Credentials",icon:"🔑"},{path:"personas",label:"Personas",icon:"👤"},{path:"appearance",label:"Appearance",icon:"🎨"},{path:"about",label:"About",icon:"ℹ️"}];function zM(){var u;const n=qt(),a=cn(),i=b.useRef(null),l=((u=Da.find(p=>n.pathname===`${Pi}/${p.path}`))==null?void 0:u.path)??Da[0].path,r=b.useCallback(p=>{a(`${Pi}/${p}`)},[a]),d=b.useCallback(p=>{var S,C;const m=(S=i.current)==null?void 0:S.querySelectorAll('[role="tab"]');if(!m)return;const g=Array.from(m).findIndex(w=>w===document.activeElement),y=g>=0?g:Da.findIndex(w=>w.path===l);let v=y;if(p.key==="ArrowDown")p.preventDefault(),v=(y+1)%Da.length;else if(p.key==="ArrowUp")p.preventDefault(),v=(y-1+Da.length)%Da.length;else if(p.key==="Home")p.preventDefault(),v=0;else if(p.key==="End")p.preventDefault(),v=Da.length-1;else return;const x=Da[v].path;a(`${Pi}/${x}`),(C=m[v])==null||C.focus()},[l,a]);return c.jsx("nav",{className:Pr.nav,ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Settings",onKeyDown:d,children:Da.map(p=>{const m=p.path===l;return c.jsxs("button",{role:"tab",type:"button","aria-selected":m,tabIndex:m?0:-1,className:`${Pr.tab} ${m?Pr.tabActive:""}`,onClick:()=>r(p.path),children:[c.jsx("span",{className:Pr.tabIcon,"aria-hidden":"true",children:p.icon}),p.label]},p.path)})})}const UM="_container_pi6ii_1",VM="_content_pi6ii_66",z0={container:UM,content:VM},HM=320,px=220,mx=600,gx="grackle-sidebar-width";function GM(){try{const n=localStorage.getItem(gx);if(n!==null){const a=Number(n);if(Number.isFinite(a)&&a>=px&&a<=mx)return a}}catch{}return HM}function PM(n){try{localStorage.setItem(gx,String(n))}catch{}}function $M(){const[n]=b.useState(GM),a=b.useRef(null),i=qt(),l=_b(i.pathname);return b.useEffect(()=>{const r=a.current;if(!r)return;const d=new ResizeObserver(u=>{for(const p of u){const m=p.borderBoxSize[0];if(m){const g=Math.round(m.inlineSize);g>=px&&g<=mx&&PM(g)}}});return d.observe(r),()=>{d.disconnect()}},[]),c.jsx("div",{className:z0.container,ref:a,"data-testid":"sidebar",style:{width:n},children:c.jsxs("div",{className:z0.content,children:[l==="tasks"&&c.jsx(jj,{}),l==="workspaces"&&c.jsx(RM,{}),l==="settings"&&c.jsx(zM,{})]})})}const FM="_bar_8ghh5_1",qM="_barColumn_8ghh5_32",YM="_barRow_8ghh5_63",KM="_input_8ghh5_74",ZM="_inputSmall_8ghh5_109",XM="_select_8ghh5_178",QM="_btnPrimary_8ghh5_214",WM="_btnDanger_8ghh5_245",JM="_btnGhost_8ghh5_284",eR="_badge_8ghh5_312",tR="_statusText_8ghh5_322",nR="_statusCompleted_8ghh5_327",aR="_statusFailed_8ghh5_331",sR="_statusBlocked_8ghh5_335",iR="_hintText_8ghh5_340",oR="_creatingHint_8ghh5_345",lR="_errorHint_8ghh5_353",rR="_disconnectHint_8ghh5_359",oe={bar:FM,barColumn:qM,barRow:YM,input:KM,inputSmall:ZM,select:XM,btnPrimary:QM,btnDanger:WM,btnGhost:JM,badge:eR,statusText:tR,statusCompleted:nR,statusFailed:aR,statusBlocked:sR,hintText:iR,creatingHint:oR,errorHint:lR,disconnectHint:rR};function rf(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 cf({environmentId:n,onReconnect:a}){return c.jsxs(c.Fragment,{children:[c.jsx("span",{className:oe.disconnectHint,"data-testid":"env-disconnect-hint",children:"Environment unavailable"}),c.jsx("button",{type:"button",onClick:()=>a(n),className:oe.btnGhost,"data-testid":"reconnect-btn",title:"Reconnect the environment to resume messaging",children:"Reconnect"})]})}function cR(){const{spawn:n,sendInput:a,kill:i,sessions:l,tasks:r,environments:d,personas:u,addEnvironment:p,provisionEnvironment:m,startTask:g,taskSessions:y,codespaces:v,codespaceError:x,codespaceListError:S,codespaceCreating:C,listCodespaces:w,createCodespace:E}=kt(),{showToast:k}=bl(),A=cn(),[j]=th(),V=jt("/sessions/:sessionId"),I=jt("/tasks/:taskId"),F=jt("/tasks/:taskId/stream"),R=jt("/tasks/:taskId/findings"),B=jt("/tasks/:taskId/edit"),G=jt("/workspaces/:workspaceId/tasks/:taskId"),ee=jt("/workspaces/:workspaceId/tasks/:taskId/stream"),ae=jt("/workspaces/:workspaceId/tasks/:taskId/findings"),te=jt("/workspaces/:workspaceId/tasks/:taskId/edit"),fe=jt("/sessions/new"),Q=jt("/environments/new"),ie=jt("/workspaces/:workspaceId"),H=jt("/tasks/new"),M=jt("/chat"),J=jt("/"),le=jt("/settings/*"),Y=V==null?void 0:V.params.sessionId,pe=(I==null?void 0:I.params.taskId)??(F==null?void 0:F.params.taskId)??(R==null?void 0:R.params.taskId)??(G==null?void 0:G.params.taskId)??(ee==null?void 0:ee.params.taskId)??(ae==null?void 0:ae.params.taskId)??(te==null?void 0:te.params.taskId),De=!!M,se=!!fe,je=!!Q,pt=!!ie&&!G&&!ee&&!ae&&!te,Ct=!!H,un=!!B||!!te,Jt=!!J&&!se&&!je&&!pt&&!Ct,W=!!le,Ce=se?j.get("env")??"":"",[me,Oe]=b.useState(""),[wt,Et]=b.useState(""),[Pt,en]=b.useState(""),[Me,Ve]=b.useState("local"),[an,Qn]=b.useState(""),[dn,ys]=b.useState(""),[Z,ne]=b.useState(""),[ue,ke]=b.useState(""),[ye,He]=b.useState(""),[we,mt]=b.useState(""),[Qe,Lt]=b.useState(""),[ct,Pe]=b.useState(""),[bt,Ge]=b.useState(""),[za,sn]=b.useState("pick"),zt=Y?l.find(ot=>ot.id===Y):void 0,Ut=pe?r.find(ot=>ot.id===pe):void 0,Ua=(Ut==null?void 0:Ut.latestSessionId)||void 0,da=Ua?l.find(ot=>ot.id===Ua):void 0,Wn=Ut?Ut.dependsOn.some(ot=>{const Te=r.find(Vt=>Vt.id===ot);return Te&&Te.status!=="complete"}):!1;if(De){const ot=r.find(Ne=>Ne.id===$s),Te=ot!=null&&ot.latestSessionId?l.find(Ne=>Ne.id===ot.latestSessionId)??(y[$s]??[]).find(Ne=>Ne.id===ot.latestSessionId):void 0,Vt=d.find(Ne=>Ne.adapterType==="local"&&Ne.status==="connected");if(!Vt)return c.jsx("div",{className:oe.bar,children:c.jsx("span",{className:oe.hintText,children:"Add a local environment to start chatting"})});if((Te==null?void 0:Te.status)==="running")return c.jsxs("div",{className:oe.bar,children:[c.jsx("input",{type:"text",disabled:!0,placeholder:"Agent is working...",className:oe.input}),c.jsx("button",{onClick:()=>i(Te.id),className:oe.btnDanger,title:"Stop session",children:"Stop"})]});if((Te==null?void 0:Te.status)==="idle"){const Ne=rf(Te.environmentId,d),fn=to=>{to.preventDefault(),!(!me.trim()||Ne)&&(a(Te.id,me),Oe(""))};return c.jsxs("form",{onSubmit:fn,className:oe.bar,children:[Ne&&Te.environmentId&&c.jsx(cf,{environmentId:Te.environmentId,onReconnect:m}),c.jsx("input",{type:"text",value:me,onChange:to=>Oe(to.target.value),placeholder:"Type a message...",autoFocus:!Ne,disabled:Ne,className:oe.input}),c.jsx("span",{title:Ne?"Environment is unavailable — reconnect first":void 0,children:c.jsx("button",{type:"submit",disabled:!me.trim()||Ne,className:oe.btnPrimary,children:"Send"})}),c.jsx("button",{type:"button",onClick:()=>i(Te.id),className:oe.btnDanger,title:"Stop session",children:"Stop"})]})}const re=Ne=>{Ne.preventDefault(),me.trim()&&(g($s,void 0,Vt.id,me),Oe(""))};return c.jsxs("form",{onSubmit:re,className:oe.bar,children:[c.jsx("input",{type:"text",value:me,onChange:Ne=>Oe(Ne.target.value),placeholder:"Type a message...",autoFocus:!0,className:oe.input}),c.jsx("button",{type:"submit",disabled:!me.trim(),className:oe.btnPrimary,children:"Send"})]})}if(Jt||W)return c.jsx(c.Fragment,{});if(un||Ct)return c.jsx(c.Fragment,{});if(je){const ot=re=>{if(!re.trim())return!0;const Ne=Number(re);return Number.isInteger(Ne)&&Ne>=1&&Ne<=65535},Te=()=>!(!Pt.trim()||Me==="ssh"&&!an.trim()||Me==="codespace"&&!we.trim()||(Me==="local"||Me==="ssh")&&!ot(dn)),Vt=()=>{if(!Te())return;const re={};if(Me==="local"){if(an.trim()&&(re.host=an.trim()),dn.trim()){const Ne=Number(dn);Number.isInteger(Ne)&&(re.port=Ne)}}else if(Me==="ssh"){if(re.host=an.trim(),Z.trim()&&(re.user=Z.trim()),dn.trim()){const Ne=Number(dn);Number.isInteger(Ne)&&(re.sshPort=Ne)}Qe.trim()&&(re.identityFile=Qe.trim())}else Me==="docker"?(ue.trim()&&(re.image=ue.trim()),ye.trim()&&(re.repo=ye.trim())):Me==="codespace"&&(re.codespaceName=we.trim());p(Pt.trim(),Me,re),k("Environment added successfully","success"),en(""),Ve("local"),Qn(""),ys(""),ne(""),ke(""),He(""),mt(""),Lt(""),Pe(""),Ge(""),sn("pick"),A(Pi,{replace:!0})};return c.jsxs("div",{className:oe.barColumn,children:[c.jsxs("div",{className:oe.barRow,children:[c.jsx("span",{className:oe.badge,children:"new env"}),c.jsx("input",{type:"text",value:Pt,onChange:re=>en(re.target.value),placeholder:"Environment name...",autoFocus:!0,className:oe.input}),c.jsxs("select",{value:Me,onChange:re=>{Ve(re.target.value),re.target.value==="codespace"&&(w(),sn("pick"),mt(""))},className:oe.select,children:[c.jsx("option",{value:"local",children:"local"}),c.jsx("option",{value:"ssh",children:"ssh"}),c.jsx("option",{value:"docker",children:"docker"}),c.jsx("option",{value:"codespace",children:"codespace"})]}),c.jsx("button",{onClick:Vt,disabled:!Te(),className:oe.btnPrimary,children:"Add"})]}),c.jsxs("div",{className:oe.barRow,children:[Me==="local"&&c.jsxs(c.Fragment,{children:[c.jsx("input",{type:"text",value:an,onChange:re=>Qn(re.target.value),placeholder:"Host (optional)...",className:oe.inputSmall}),c.jsx("input",{type:"number",min:1,max:65535,value:dn,onChange:re=>ys(re.target.value),placeholder:"Port (optional)...",className:oe.inputSmall})]}),Me==="ssh"&&c.jsxs(c.Fragment,{children:[c.jsx("input",{type:"text",value:an,onChange:re=>Qn(re.target.value),placeholder:"Host (required)...",className:oe.inputSmall}),c.jsx("input",{type:"text",value:Z,onChange:re=>ne(re.target.value),placeholder:"User (optional)...",className:oe.inputSmall}),c.jsx("input",{type:"number",min:1,max:65535,value:dn,onChange:re=>ys(re.target.value),placeholder:"SSH port (optional)...",className:oe.inputSmall}),c.jsx("input",{type:"text",value:Qe,onChange:re=>Lt(re.target.value),placeholder:"Identity file (optional)...",className:oe.inputSmall})]}),Me==="docker"&&c.jsxs(c.Fragment,{children:[c.jsx("input",{type:"text",value:ue,onChange:re=>ke(re.target.value),placeholder:"Image (optional)...",className:oe.inputSmall}),c.jsx("input",{type:"text",value:ye,onChange:re=>He(re.target.value),placeholder:"Repo (optional)...",className:oe.inputSmall})]}),Me==="codespace"&&za==="pick"&&c.jsxs(c.Fragment,{children:[!S&&c.jsxs("select",{value:we,onChange:re=>{re.target.value==="__create__"?(sn("create"),mt("")):(mt(re.target.value),re.target.value&&!Pt.trim()&&en(re.target.value))},disabled:C,className:oe.select,children:[c.jsx("option",{value:"",children:"Select a codespace..."}),v.map(re=>c.jsxs("option",{value:re.name,children:[re.name," (",re.repository,") — ",re.state]},re.name)),c.jsx("option",{value:"__create__",children:"Create new from repo..."})]}),C&&c.jsx("span",{className:oe.creatingHint,children:"Creating codespace..."}),S&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:oe.errorHint,children:S}),c.jsx("input",{type:"text",value:we,onChange:re=>mt(re.target.value),placeholder:"Or enter codespace name manually...",className:oe.inputSmall})]}),x&&!S&&c.jsx("span",{className:oe.errorHint,children:x})]}),Me==="codespace"&&za==="create"&&c.jsxs(c.Fragment,{children:[c.jsx("input",{type:"text",value:ct,onChange:re=>Pe(re.target.value),placeholder:"owner/repo",className:oe.inputSmall}),c.jsx("input",{type:"text",value:bt,onChange:re=>Ge(re.target.value),placeholder:"Machine type (optional)...",className:oe.inputSmall}),c.jsx("button",{onClick:()=>{ct.trim()&&(E(ct.trim(),bt.trim()||void 0),sn("pick"),Pe(""),Ge(""))},disabled:!ct.trim(),className:oe.btnPrimary,children:"Create"}),c.jsx("button",{onClick:()=>{sn("pick"),Pe(""),Ge("")},className:oe.btnGhost,children:"Cancel"})]})]})]})}if(pt)return c.jsx("div",{className:oe.bar,children:c.jsx("span",{className:oe.hintText,children:"Select a task or click + to create one"})});if(pe&&Ut){if(Ut.status==="not_started"){const ot=Wn?Ut.dependsOn.map(Te=>r.find(Vt=>Vt.id===Te)).filter(Te=>Te&&Te.status!=="complete").map(Te=>Te.title):[];return c.jsx("div",{className:oe.bar,children:Wn?c.jsxs("span",{className:oe.statusBlocked,children:["Blocked by: ",ot.join(", ")]}):c.jsx("span",{className:oe.hintText,children:"Use the buttons above to start or manage this task"})})}if(Ut.status==="working"||Ut.status==="paused"){if((da==null?void 0:da.status)==="idle"){const Te=da.environmentId,Vt=rf(Te,d),re=Ne=>{Ne.preventDefault();const fn=Ut.latestSessionId||Ua;!me.trim()||!fn||Vt||(a(fn,me),Oe(""))};return c.jsxs("form",{onSubmit:re,className:oe.bar,children:[Vt&&Te&&c.jsx(cf,{environmentId:Te,onReconnect:m}),c.jsx("input",{type:"text",value:me,onChange:Ne=>Oe(Ne.target.value),placeholder:"Type a message...",autoFocus:!Vt,disabled:Vt,className:oe.input}),c.jsx("span",{title:Vt?"Environment is unavailable — reconnect first":void 0,children:c.jsx("button",{type:"submit",disabled:!me.trim()||Vt,className:oe.btnPrimary,children:"Send"})})]})}return c.jsx("div",{className:oe.bar,children:c.jsx("input",{type:"text",disabled:!0,placeholder:"Agent is working...",className:oe.input})})}if(Ut.status==="complete")return c.jsxs("div",{className:oe.bar,children:[c.jsx("span",{className:`${oe.statusText} ${oe.statusCompleted}`,children:"Task completed"}),c.jsx("button",{onClick:()=>A(Oa(Ut.workspaceId)),className:oe.btnPrimary,children:"+ New Task"})]});if(Ut.status==="failed")return c.jsx("div",{className:oe.bar,children:c.jsx("span",{className:`${oe.statusText} ${oe.statusFailed}`,children:"Task failed"})})}if(se){const ot=Te=>{Te.preventDefault(),!(!me.trim()||!Ce)&&(n(Ce,me,wt),k("Session started","success"),Oe(""),Et(""))};return c.jsxs("form",{onSubmit:ot,className:oe.bar,children:[c.jsx("span",{className:oe.badge,children:"new chat"}),c.jsx("input",{type:"text",value:me,onChange:Te=>Oe(Te.target.value),placeholder:"Enter prompt...",autoFocus:!0,className:oe.input}),c.jsxs("select",{value:wt,onChange:Te=>Et(Te.target.value),className:oe.select,children:[c.jsx("option",{value:"",children:"(Default)"}),u.map(Te=>c.jsx("option",{value:Te.id,children:Te.name},Te.id))]}),c.jsx("button",{type:"submit",disabled:!me.trim()||!Ce,className:oe.btnPrimary,children:"Go"})]})}if(Y){const ot=(zt==null?void 0:zt.status)==="running",Te=(zt==null?void 0:zt.status)==="idle",Vt=zt!==void 0&&["completed","failed","interrupted"].includes(zt.status);if(ot)return c.jsxs("div",{className:oe.bar,children:[c.jsx("input",{type:"text",disabled:!0,placeholder:"Agent is working...",className:oe.input}),c.jsx("button",{onClick:()=>i(Y),className:oe.btnDanger,title:"Stop session",children:"Stop"})]});if(Te){const re=rf(zt.environmentId,d),Ne=fn=>{fn.preventDefault(),!(!me.trim()||re)&&(a(Y,me),Oe(""))};return c.jsxs("form",{onSubmit:Ne,className:oe.bar,children:[re&&zt.environmentId&&c.jsx(cf,{environmentId:zt.environmentId,onReconnect:m}),c.jsx("input",{type:"text",value:me,onChange:fn=>Oe(fn.target.value),placeholder:"Type a message...",autoFocus:!re,disabled:re,className:oe.input}),c.jsx("span",{title:re?"Environment is unavailable — reconnect first":void 0,children:c.jsx("button",{type:"submit",disabled:!me.trim()||re,className:oe.btnPrimary,children:"Send"})}),c.jsx("button",{type:"button",onClick:()=>i(Y),className:oe.btnDanger,title:"Stop session",children:"Stop"})]})}if(Vt)return c.jsxs("div",{className:oe.bar,children:[c.jsxs("span",{className:`${oe.statusText} ${oe.hintText}`,children:["Session ",zt.status]}),c.jsx("button",{onClick:()=>A(fb(zt.environmentId)),className:oe.btnPrimary,children:"+ New Chat"})]})}return c.jsx("div",{className:oe.bar,children:c.jsx("span",{className:oe.hintText,children:"Loading..."})})}const uR="_toast_da8ll_1",dR="_success_da8ll_18",fR="_icon_da8ll_22",hR="_error_da8ll_25",pR="_warning_da8ll_32",mR="_info_da8ll_38",gR="_message_da8ll_53",vR="_close_da8ll_60",Xo={toast:uR,success:dR,icon:fR,error:hR,warning:pR,info:mR,message:gR,close:vR},yR={success:"✓",error:"✕",warning:"⚠",info:"ℹ"};function bR({toast:n,onDismiss:a}){return b.useEffect(()=>{const i=setTimeout(()=>a(n.id),n.duration);return()=>clearTimeout(i)},[n.id,n.duration,a]),c.jsxs(yt.div,{className:`${Xo.toast} ${Xo[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:[c.jsx("span",{className:Xo.icon,"aria-hidden":"true",children:yR[n.variant]}),c.jsx("span",{className:Xo.message,children:n.message}),c.jsx("button",{type:"button",className:Xo.close,onClick:()=>a(n.id),"aria-label":"Dismiss notification",children:"×"})]})}const _R="_container_qqse2_1",xR={container:_R};function SR(){const{toasts:n,dismissToast:a}=bl();return c.jsx("div",{className:xR.container,"data-testid":"toast-container",children:c.jsx(_n,{children:n.map(i=>c.jsx(bR,{toast:i,onDismiss:a},i.id))})})}function TR(n,a){const i=b.useRef(null);b.useEffect(()=>{const l=i.current;if(i.current=n,l===null)return;const r=new Map;for(const u of l)r.set(u.id,u);const d=new Set;for(const u of n){d.add(u.id);const p=r.get(u.id);if(p&&p.status!==u.status&&u.status!=="sleeping"){if(u.status==="connecting"){a("Provisioning environment…","info");continue}u.status==="connected"?a("Environment connected","success"):u.status==="error"?a("Environment provision failed","error"):u.status==="disconnected"&&(p.status==="connected"?a("Environment disconnected","warning"):a("Environment stopped","info"))}}for(const u of l)d.has(u.id)||a("Environment removed","info")},[n,a])}function kR(n,a,i){const l=n.filter(m=>m.status==="running"||m.status==="idle"||m.status==="waiting").length,r=vx(a),d=a.filter(m=>Ff(m,r)).length,u=a.filter(m=>m.status==="paused"||m.status==="failed"||Ff(m,r)).length,p=i.filter(m=>m.status==="disconnected"||m.status==="error").length;return{activeSessions:l,blockedTasks:d,attentionTasks:u,unhealthyEnvironments:p}}function vx(n){const a=new Map;for(const i of n)a.set(i.id,i.status);return a}function Ff(n,a){return n.dependsOn.some(i=>a.get(i)!=="complete")}function CR(n,a){var u;const i=new Map;for(const p of a)i.set(p.id,p);const l=vx(n),r=[];for(const p of n){const m=p.workspaceId?((u=i.get(p.workspaceId))==null?void 0:u.name)??"Unknown":"Unknown";p.status==="failed"?r.push({task:p,reason:"failed",workspaceName:m}):Ff(p,l)?r.push({task:p,reason:"blocked",workspaceName:m}):p.status==="paused"&&r.push({task:p,reason:"paused",workspaceName:m})}const d={failed:0,blocked:1,paused:2};return r.sort((p,m)=>(d[p.reason]??3)-(d[m.reason]??3)),r}function wR(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 r;return{session:l,environmentName:((r=i.get(l.environmentId))==null?void 0:r.displayName)??"Unknown"}})}function ER(n,a,i){const l=new Map;for(const r of a){if(!r.workspaceId)continue;let d=l.get(r.workspaceId);d||(d={totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0},l.set(r.workspaceId,d)),d.totalTasks+=1,r.status==="complete"?d.completedTasks+=1:r.status==="working"?d.workingTasks+=1:r.status==="failed"&&(d.failedTasks+=1)}return n.map(r=>{const d=l.get(r.id)??{totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0};return{workspace:r,totalTasks:d.totalTasks,completedTasks:d.completedTasks,workingTasks:d.workingTasks,failedTasks:d.failedTasks}})}const AR="_dashboard_1avpn_1",NR="_kpiStrip_1avpn_11",jR="_kpiCard_1avpn_23",DR="_kpiValue_1avpn_68",MR="_kpiLabel_1avpn_76",RR="_bodyGrid_1avpn_84",BR="_section_1avpn_96",OR="_sectionHeader_1avpn_109",IR="_sectionIcon_1avpn_118",LR="_sectionTitle_1avpn_123",zR="_sectionCount_1avpn_131",UR="_sectionBody_1avpn_138",VR="_emptyHint_1avpn_143",HR="_sessionRow_1avpn_150",GR="_sessionPrompt_1avpn_177",PR="_sessionEnv_1avpn_186",$R="_sessionRuntime_1avpn_192",FR="_sessionStatus_1avpn_198",qR="_statusDot_1avpn_207",YR="_attentionRow_1avpn_229",KR="_attentionTitle_1avpn_255",ZR="_attentionMeta_1avpn_263",XR="_reasonBadge_1avpn_270",QR="_bottomGrid_1avpn_297",WR="_envRow_1avpn_308",JR="_envName_1avpn_319",e3="_envStatusBadge_1avpn_329",t3="_workspaceRow_1avpn_365",n3="_workspaceTop_1avpn_391",a3="_workspaceName_1avpn_397",s3="_workspaceCounts_1avpn_403",i3="_progressBar_1avpn_411",o3="_progressFill_1avpn_418",ve={dashboard:AR,kpiStrip:NR,kpiCard:jR,kpiValue:DR,kpiLabel:MR,bodyGrid:RR,section:BR,sectionHeader:OR,sectionIcon:IR,sectionTitle:LR,sectionCount:zR,sectionBody:UR,emptyHint:VR,sessionRow:HR,sessionPrompt:GR,sessionEnv:PR,sessionRuntime:$R,sessionStatus:FR,statusDot:qR,attentionRow:YR,attentionTitle:KR,attentionMeta:ZR,reasonBadge:XR,bottomGrid:QR,envRow:WR,envName:JR,envStatusBadge:e3,workspaceRow:t3,workspaceTop:n3,workspaceName:a3,workspaceCounts:s3,progressBar:i3,progressFill:o3},l3={hidden:{opacity:0,y:12},visible:n=>({opacity:1,y:0,transition:{delay:n*.06,duration:.3,ease:"easeOut"}})},$r={hidden:{opacity:0,y:16},visible:n=>({opacity:1,y:0,transition:{delay:.15+n*.08,duration:.35,ease:"easeOut"}})};function r3(n,a,i,l){const r=[`${n} of ${a} tasks completed`];return i>0&&r.push(`${i} in progress`),l>0&&r.push(`${l} failed`),r.join(", ")}function Fr({value:n,label:a,accent:i,index:l,testId:r}){return c.jsxs(yt.div,{className:ve.kpiCard,"data-accent":i,"data-testid":r,variants:l3,initial:"hidden",animate:"visible",custom:l,children:[c.jsx("span",{className:ve.kpiValue,children:n}),c.jsx("span",{className:ve.kpiLabel,children:a})]})}function c3(){const{workspaces:n,tasks:a,sessions:i,environments:l,loadTasks:r}=kt(),d=cn(),u=b.useRef(new Set);b.useEffect(()=>{for(const v of n)u.current.has(v.id)||(u.current.add(v.id),r(v.id))},[n,r]);const p=b.useMemo(()=>kR(i,a,l),[i,a,l]),m=b.useMemo(()=>wR(i,l),[i,l]),g=b.useMemo(()=>CR(a,n),[a,n]),y=b.useMemo(()=>ER(n,a),[n,a,l]);return c.jsxs("div",{className:ve.dashboard,"data-testid":"dashboard",children:[c.jsxs("div",{className:ve.kpiStrip,"data-testid":"dashboard-kpi-strip",children:[c.jsx(Fr,{value:p.activeSessions,label:"Active Sessions",accent:"green",index:0,testId:"kpi-active-sessions"}),c.jsx(Fr,{value:p.blockedTasks,label:"Blocked Tasks",accent:"yellow",index:1,testId:"kpi-blocked-tasks"}),c.jsx(Fr,{value:p.attentionTasks,label:"Needs Attention",accent:"red",index:2,testId:"kpi-attention-tasks"}),c.jsx(Fr,{value:p.unhealthyEnvironments,label:"Unhealthy Envs",accent:"blue",index:3,testId:"kpi-unhealthy-envs"})]}),c.jsxs("div",{className:ve.bodyGrid,children:[c.jsxs(yt.div,{className:ve.section,variants:$r,initial:"hidden",animate:"visible",custom:0,"data-testid":"dashboard-active-sessions",children:[c.jsxs("div",{className:ve.sectionHeader,children:[c.jsx("span",{className:ve.sectionIcon,"aria-hidden":"true",children:"●"}),c.jsx("span",{className:ve.sectionTitle,children:"Active Sessions"}),c.jsx("span",{className:ve.sectionCount,children:m.length})]}),c.jsx("div",{className:ve.sectionBody,children:m.length===0?c.jsx("div",{className:ve.emptyHint,children:"No active sessions"}):m.map(({session:v,environmentName:x})=>c.jsxs("button",{type:"button",className:ve.sessionRow,onClick:()=>d(nh(v.id)),"data-testid":"session-row",children:[c.jsx("span",{className:ve.sessionPrompt,title:v.prompt,children:v.prompt||"—"}),c.jsx("span",{className:ve.sessionEnv,children:x}),c.jsx("span",{className:ve.sessionRuntime,children:v.runtime}),c.jsxs("span",{className:ve.sessionStatus,children:[c.jsx("span",{className:ve.statusDot,"data-status":v.status}),v.status]})]},v.id))})]}),c.jsxs(yt.div,{className:ve.section,variants:$r,initial:"hidden",animate:"visible",custom:1,"data-testid":"dashboard-needs-attention",children:[c.jsxs("div",{className:ve.sectionHeader,children:[c.jsx("span",{className:ve.sectionIcon,"aria-hidden":"true",children:"⚑"}),c.jsx("span",{className:ve.sectionTitle,children:"Needs Attention"}),c.jsx("span",{className:ve.sectionCount,children:g.length})]}),c.jsx("div",{className:ve.sectionBody,children:g.length===0?c.jsx("div",{className:ve.emptyHint,children:"All clear"}):g.map(({task:v,reason:x,workspaceName:S})=>c.jsxs("button",{type:"button",className:ve.attentionRow,onClick:()=>d(Xn(v.id)),"data-testid":"attention-row",children:[c.jsxs("div",{className:ve.attentionTitle,children:[c.jsx("span",{className:ve.reasonBadge,"data-reason":x,children:x}),v.title]}),c.jsx("div",{className:ve.attentionMeta,children:c.jsx("span",{children:S})})]},v.id))})]})]}),c.jsxs("div",{className:ve.bottomGrid,children:[c.jsxs(yt.div,{className:ve.section,variants:$r,initial:"hidden",animate:"visible",custom:2,"data-testid":"dashboard-env-health",children:[c.jsxs("div",{className:ve.sectionHeader,children:[c.jsx("span",{className:ve.sectionIcon,"aria-hidden":"true",children:"◈"}),c.jsx("span",{className:ve.sectionTitle,children:"Environment Health"}),c.jsx("span",{className:ve.sectionCount,children:l.length})]}),c.jsx("div",{className:ve.sectionBody,children:l.length===0?c.jsx("div",{className:ve.emptyHint,children:"No environments configured"}):l.map(v=>c.jsxs("div",{className:ve.envRow,"data-testid":"dashboard-env-row",children:[c.jsx("span",{className:ve.envName,children:v.displayName}),c.jsx("span",{className:ve.envStatusBadge,"data-status":v.status,children:v.status})]},v.id))})]}),c.jsxs(yt.div,{className:ve.section,variants:$r,initial:"hidden",animate:"visible",custom:3,"data-testid":"dashboard-workspace-snapshot",children:[c.jsxs("div",{className:ve.sectionHeader,children:[c.jsx("span",{className:ve.sectionIcon,"aria-hidden":"true",children:"▦"}),c.jsx("span",{className:ve.sectionTitle,children:"Workspaces"}),c.jsx("span",{className:ve.sectionCount,children:n.length})]}),c.jsx("div",{className:ve.sectionBody,children:y.length===0?c.jsx("div",{className:ve.emptyHint,children:"No workspaces yet"}):y.map(({workspace:v,totalTasks:x,completedTasks:S,workingTasks:C,failedTasks:w})=>{const E=x>0?Math.round(S/x*100):0;return c.jsxs("button",{type:"button",className:ve.workspaceRow,onClick:()=>d($i(v.id)),"data-testid":"workspace-row",children:[c.jsxs("div",{className:ve.workspaceTop,children:[c.jsx("span",{className:ve.workspaceName,children:v.name}),c.jsxs("span",{className:ve.workspaceCounts,"aria-label":r3(S,x,C,w),children:[S,"/",x,C>0&&c.jsxs("span",{style:{color:"var(--accent-green)"},"aria-hidden":"true",children:["▸",C]}),w>0&&c.jsxs("span",{style:{color:"var(--accent-red)"},"aria-hidden":"true",children:["✗",w]})]})]}),x>0&&c.jsx("div",{className:ve.progressBar,children:c.jsx("div",{className:ve.progressFill,style:{width:`${E}%`}})})]},v.id)})})]})]})]})}const u3="_panelContainer_aei9x_1",d3="_emptyState_aei9x_8",f3="_fadeIn_aei9x_1",h3="_workspaceSummary_aei9x_17",p3="_workspaceSummaryTitle_aei9x_28",m3="_workspaceSummarySubtitle_aei9x_32",g3="_header_aei9x_36",v3="_headerInfo_aei9x_69",y3="_killButton_aei9x_75",b3="_headerTitle_aei9x_104",_3="_headerActions_aei9x_119",x3="_taskStatusBadge_aei9x_126",S3="_taskBranch_aei9x_135",T3="_taskBlockedBadge_aei9x_141",k3="_btnPrimary_aei9x_149",C3="_btnDanger_aei9x_180",w3="_btnGhost_aei9x_219",E3="_rejectInput_aei9x_245",A3="_tabBar_aei9x_275",N3="_tab_aei9x_275",j3="_active_aei9x_301",D3="_eventScroll_aei9x_306",M3="_tabContent_aei9x_312",R3="_noContext_aei9x_317",B3="_overviewContent_aei9x_323",O3="_overviewDashboard_aei9x_332",I3="_overviewHero_aei9x_338",L3="_statusBadge_aei9x_345",z3="_statusPending_aei9x_357",U3="_statusAssigned_aei9x_362",V3="_statusInProgress_aei9x_367",H3="_statusReview_aei9x_372",G3="_statusDone_aei9x_377",P3="_statusFailed_aei9x_382",$3="_statusWaitingInput_aei9x_387",F3="_overviewBranchPill_aei9x_392",q3="_branchLink_aei9x_407",Y3="_overviewSection_aei9x_418",K3="_overviewLabel_aei9x_424",Z3="_overviewValue_aei9x_431",X3="_overviewMuted_aei9x_436",Q3="_overviewMarkdown_aei9x_442",W3="_envRow_aei9x_511",J3="_envDot_aei9x_517",eB="_envDotGreen_aei9x_524",tB="_envDotYellow_aei9x_528",nB="_envDotRed_aei9x_532",aB="_envDotGray_aei9x_536",sB="_depList_aei9x_540",iB="_depItem_aei9x_546",oB="_depBlocked_aei9x_553",lB="_depDone_aei9x_557",rB="_timeline_aei9x_561",cB="_timelineRow_aei9x_567",uB="_timelineKey_aei9x_574",dB="_timelineValue_aei9x_580",fB="_timelineDelta_aei9x_584",hB="_reviewNotes_aei9x_595",pB="_overviewDescription_aei9x_606",mB="_waitingMessage_aei9x_612",gB="_errorMessage_aei9x_616",vB="_eventOverflowWarning_aei9x_620",yB="_attemptSelector_aei9x_634",bB="_attemptLabel_aei9x_650",_B="_attemptButton_aei9x_654",xB="_attemptActive_aei9x_671",SB="_attemptStatus_aei9x_677",TB="_emptyCta_aei9x_683",kB="_ctaTitle_aei9x_695",CB="_ctaDescription_aei9x_701",wB="_ctaButton_aei9x_708",EB="_ctaCreateForm_aei9x_743",AB="_ctaCreateInput_aei9x_749",NB="_ctaCreateOk_aei9x_780",jB="_ctaLink_aei9x_815",DB="_workspaceHeader_aei9x_829",MB="_workspaceName_aei9x_854",RB="_workspaceMeta_aei9x_867",BB="_metaRow_aei9x_875",OB="_metaLabel_aei9x_888",IB="_metaValue_aei9x_903",LB="_archiveButton_aei9x_913",zB="_repoLink_aei9x_943",UB="_metaToggle_aei9x_953",VB="_metaToggleArrow_aei9x_974",HB="_metaToggleArrowOpen_aei9x_979",GB="_progressBarContainer_aei9x_983",PB="_progressBar_aei9x_983",$B="_progressFill_aei9x_999",FB="_progressLabel_aei9x_1006",qB="_metaTimestamps_aei9x_1013",YB="_metaTimestamp_aei9x_1013",L={panelContainer:u3,emptyState:d3,fadeIn:f3,workspaceSummary:h3,workspaceSummaryTitle:p3,workspaceSummarySubtitle:m3,header:g3,headerInfo:v3,killButton:y3,headerTitle:b3,headerActions:_3,taskStatusBadge:x3,taskBranch:S3,taskBlockedBadge:T3,btnPrimary:k3,btnDanger:C3,btnGhost:w3,rejectInput:E3,tabBar:A3,tab:N3,active:j3,eventScroll:D3,tabContent:M3,noContext:R3,overviewContent:B3,overviewDashboard:O3,overviewHero:I3,statusBadge:L3,statusPending:z3,statusAssigned:U3,statusInProgress:V3,statusReview:H3,statusDone:G3,statusFailed:P3,statusWaitingInput:$3,overviewBranchPill:F3,branchLink:q3,overviewSection:Y3,overviewLabel:K3,overviewValue:Z3,overviewMuted:X3,overviewMarkdown:Q3,envRow:W3,envDot:J3,envDotGreen:eB,envDotYellow:tB,envDotRed:nB,envDotGray:aB,depList:sB,depItem:iB,depBlocked:oB,depDone:lB,timeline:rB,timelineRow:cB,timelineKey:uB,timelineValue:dB,timelineDelta:fB,reviewNotes:hB,overviewDescription:pB,waitingMessage:mB,errorMessage:gB,eventOverflowWarning:vB,attemptSelector:yB,attemptLabel:bB,attemptButton:_B,attemptActive:xB,attemptStatus:SB,emptyCta:TB,ctaTitle:kB,ctaDescription:CB,ctaButton:wB,ctaCreateForm:EB,ctaCreateInput:AB,ctaCreateOk:NB,ctaLink:jB,workspaceHeader:DB,workspaceName:MB,workspaceMeta:RB,metaRow:BB,metaLabel:OB,metaValue:IB,archiveButton:LB,repoLink:zB,metaToggle:UB,metaToggleArrow:VB,metaToggleArrowOpen:HB,progressBarContainer:GB,progressBar:PB,progressFill:$B,progressLabel:FB,metaTimestamps:qB,metaTimestamp:YB};function KB(){return c.jsx("div",{className:L.emptyState,children:"Select a task or click + to create one"})}function ZB(){return c.jsx("div",{className:L.emptyState,children:"Select a workspace or click + to create one"})}function XB(){const{workspaces:n,environments:a,createWorkspace:i,workspaceCreating:l}=kt(),[r,d]=b.useState(!1),[u,p]=b.useState(""),m=a.length>0,g=()=>{!u.trim()||l||!m||i(u.trim(),void 0,void 0,a[0].id)};return n.length>0?c.jsx(c3,{}):c.jsxs("div",{className:L.emptyCta,"data-testid":"welcome-cta",children:[c.jsx("div",{className:L.ctaTitle,children:"Welcome to Grackle"}),c.jsx("div",{className:L.ctaDescription,children:"Organize your work into workspaces and let agents tackle the tasks."}),r?c.jsxs("div",{className:L.ctaCreateForm,children:[c.jsx("input",{type:"text",value:u,onChange:y=>p(y.target.value),onKeyDown:y=>{y.key==="Enter"?g():y.key==="Escape"&&(d(!1),p(""))},placeholder:"Workspace name...","aria-label":"Workspace name",autoFocus:!0,disabled:l,className:L.ctaCreateInput,"data-testid":"welcome-create-input"}),c.jsx("button",{onClick:g,className:L.ctaCreateOk,disabled:l,"aria-label":l?"Creating workspace":void 0,"data-testid":"welcome-create-ok",children:l?c.jsx(dc,{size:"sm",label:"Creating workspace"}):"OK"})]}):c.jsx("button",{className:L.ctaButton,onClick:()=>d(!0),disabled:l||!m,"data-testid":"welcome-create-button",children:"Create Your First Workspace"}),!m&&c.jsx("div",{className:L.ctaDescription,children:"Add an environment first via Settings before creating a workspace."})]})}const yx=50;function QB(n,a,i,l,r=yx){return l?n<r:a-n-i<r}function WB(n,a){const i=a-n;return i>0?i:0}function JB({scrollRef:n,contentLength:a,isReversed:i}){const[l,r]=b.useState(!0),d=b.useRef(0),u=b.useRef(!1),p=b.useRef(0);b.useEffect(()=>{const g=n.current;if(!g)return;let y=!0;const v=()=>{p.current||(p.current=requestAnimationFrame(()=>{p.current=0;const x=QB(g.scrollTop,g.scrollHeight,g.clientHeight,i,yx);x!==y&&(y=x,r(x))}))};return g.addEventListener("scroll",v,{passive:!0}),()=>{g.removeEventListener("scroll",v),p.current&&(cancelAnimationFrame(p.current),p.current=0)}},[n,i]),b.useLayoutEffect(()=>{const g=n.current;!g||u.current||(u.current=!0,i?g.scrollTop=0:g.scrollTop=g.scrollHeight,r(!0))},[n,i]),b.useLayoutEffect(()=>{const g=n.current;if(g){if(i&&!l){const y=WB(d.current,g.scrollHeight);y>0&&(g.scrollTop+=y)}l&&(i?g.scrollTo({top:0,behavior:"smooth"}):g.scrollTo({top:g.scrollHeight,behavior:"smooth"})),d.current=g.scrollHeight}},[a,l,i,n]);const m=b.useCallback(()=>{const g=n.current;if(!g)return;const y=i?0:g.scrollHeight;g.scrollTo({top:y,behavior:"smooth"}),r(!0)},[n,i]);return{isAtAnchor:l,scrollToAnchor:m}}const eO="_wrapper_p24zt_1",tO="_scrollContainer_p24zt_9",nO="_toolbar_p24zt_15",aO="_directionToggle_p24zt_22",sO="_scrollToAnchor_p24zt_60",iO="_scrollToAnchorBottom_p24zt_84",oO="_scrollToAnchorTop_p24zt_88",Us={wrapper:eO,scrollContainer:tO,toolbar:nO,directionToggle:aO,scrollToAnchor:sO,scrollToAnchorBottom:iO,scrollToAnchorTop:oO},bx="grackle-stream-direction";function lO(){try{return localStorage.getItem(bx)==="reversed"}catch{return!1}}function rO({eventsDropped:n}){return n<=0?c.jsx(c.Fragment,{}):c.jsxs("div",{className:L.eventOverflowWarning,role:"alert",children:["⚠"," ",n.toLocaleString()," older event",n===1?"":"s"," were dropped — only the most recent 5,000 are shown. Full history is available in the session log."]})}function Hh({events:n,eventsDropped:a,emptyState:i}){const l=b.useRef(null),[r,d]=b.useState(lO),u=c2(),p=b.useMemo(()=>r?[...n].reverse():n,[n,r]),{isAtAnchor:m,scrollToAnchor:g}=JB({scrollRef:l,contentLength:n.length,isReversed:r}),y=()=>{const S=!r;d(S);try{localStorage.setItem(bx,S?"reversed":"default")}catch{}},v=u?0:.2,x=r?-8:8;return c.jsxs("div",{className:Us.wrapper,children:[c.jsx("div",{className:Us.toolbar,children:c.jsx("button",{className:Us.directionToggle,onClick:y,title:r?"Showing newest first":"Showing oldest first","aria-label":r?"Switch to newest at bottom":"Switch to newest at top","data-testid":"direction-toggle",children:r?"↓":"↑"})}),c.jsxs("div",{ref:l,className:Us.scrollContainer,"data-testid":"event-stream-scroll",children:[n.length===0&&i,c.jsx(rO,{eventsDropped:a}),c.jsx(_n,{initial:!1,children:p.map((S,C)=>{const w=r?n.length-1-C:C;return c.jsx(yt.div,{initial:{opacity:0,y:x},animate:{opacity:1,y:0},transition:{duration:v,ease:"easeOut"},children:c.jsx(ED,{event:S,toolUseCtx:S.toolUseCtx})},`${S.sessionId}-${S.timestamp}-${w}`)})})]}),c.jsx(_n,{children:!m&&c.jsxs(yt.button,{className:`${Us.scrollToAnchor} ${r?Us.scrollToAnchorTop:Us.scrollToAnchorBottom}`,onClick:g,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:[r?"↑":"↓"," New events"]})})]})}function Gh(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 Ph(n){const a=new Map;for(const d of n)if(d.raw)try{a.set(d,JSON.parse(d.raw))}catch{}const i=new Map;for(const d of n){if(d.eventType!=="tool_use")continue;const u=a.get(d);if(!(!u||typeof u.id!="string"))try{const p=JSON.parse(d.content);i.set(u.id,{tool:p.tool,args:p.args})}catch{}}const l=new Set;return n.map(d=>{if(d.eventType!=="tool_result")return d;const u=a.get(d);if(!u||typeof u.tool_use_id!="string")return d;const p=i.get(u.tool_use_id);return p?(l.add(u.tool_use_id),{...d,toolUseCtx:p}):d}).filter(d=>{if(d.eventType!=="tool_use")return!0;const u=a.get(d);return u&&typeof u.id=="string"?!l.has(u.id):!0})}const cO="_panelContainer_pz4cr_1",uO="_emptyState_pz4cr_8",dO="_emptyTitle_pz4cr_20",fO="_emptyDescription_pz4cr_26",hO="_emptyHint_pz4cr_32",nl={panelContainer:cO,emptyState:uO,emptyTitle:dO,emptyDescription:fO,emptyHint:hO};function pO({hasLocalEnvironment:n}){return c.jsxs("div",{className:nl.emptyState,"data-testid":"chat-empty-state",children:[c.jsx("div",{className:nl.emptyTitle,children:"Welcome to Grackle"}),c.jsx("div",{className:nl.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&&c.jsx("div",{className:nl.emptyHint,children:"Go to Settings → Environments to add one."})]})}function mO(){const{tasks:n,sessions:a,events:i,eventsDropped:l,environments:r,loadTaskSessions:d,loadSessionEvents:u,taskSessions:p}=kt(),m=b.useRef(void 0),g=n.find(S=>S.id===$s),y=g!=null&&g.latestSessionId?a.find(S=>S.id===g.latestSessionId)??(p[$s]??[]).find(S=>S.id===g.latestSessionId):void 0;b.useEffect(()=>{d($s)},[d]),b.useEffect(()=>{g!=null&&g.latestSessionId&&d($s)},[g==null?void 0:g.latestSessionId,d]),b.useEffect(()=>{y&&y.id!==m.current&&(m.current=y.id,u(y.id))},[y==null?void 0:y.id,u]);const v=b.useMemo(()=>{if(!y)return[];const S=i.filter(C=>C.sessionId===y.id);return Ph(Gh(S))},[i,y==null?void 0:y.id]),x=r.find(S=>S.adapterType==="local"&&S.status==="connected");return c.jsx("div",{className:nl.panelContainer,"data-testid":"chat-page",children:c.jsx(Hh,{events:v,eventsDropped:l,emptyState:c.jsx(pO,{hasLocalEnvironment:!!x})})})}function gO(n,a){const i=[];let l=n;const r=new Set;for(;l&&a.has(l)&&!r.has(l);){r.add(l);const d=a.get(l);i.unshift(d),l=d.parentTaskId||void 0}return i}const Ki={label:"Home",url:qs};function vO(n){return n?[Ki,{label:"Settings",url:Pi},{label:n,url:void 0}]:[Ki,{label:"Settings",url:void 0}]}function yO(){return[Ki,{label:"New Environment",url:void 0}]}function bO(){return[Ki,{label:"New Chat",url:void 0}]}function _O(n){return[Ki,{label:`Session ${n.slice(0,8)}`,url:void 0}]}function xO(n,a,i){const l=gO(n,i),r=i.get(n),d=r==null?void 0:r.workspaceId,u=d?a.find(g=>g.id===d):void 0,p=[Ki];u&&p.push({label:u.name,url:$i(u.id)});for(let g=0;g<l.length-1;g++)p.push({label:l[g].title,url:Xn(l[g].id)});const m=l[l.length-1];return p.push({label:(m==null?void 0:m.title)??n,url:void 0}),p}function SO(){const n=bO();return c.jsxs("div",{className:L.panelContainer,children:[c.jsx(eo,{segments:n}),c.jsx("div",{className:L.emptyState,children:"Enter a prompt below to start a new session"})]})}function TO({sessionId:n,session:a,isActive:i,onKill:l}){return c.jsxs("div",{className:L.header,children:[c.jsxs("span",{children:["Session: ",n.slice(0,8),a&&` | ${a.runtime} | ${a.status}`]}),c.jsxs("span",{className:L.headerInfo,children:[a&&c.jsx("span",{children:a.prompt.length>60?a.prompt.slice(0,60)+"...":a.prompt}),i&&c.jsx("button",{onClick:()=>l(n),title:"Stop session",className:L.killButton,children:"×"})]})]})}function kO({session:n}){const a=n&&["completed","failed","interrupted"].includes(n.status),i=a?`Session ${n.status} with no events recorded.`:"Waiting for events...";return c.jsx("div",{className:a?L.errorMessage:L.waitingMessage,children:i})}function CO(){const{sessionId:n}=mc(),{events:a,eventsDropped:i,sessions:l,kill:r,loadSessionEvents:d}=kt(),u=b.useRef(void 0),p=_O(n),m=l.find(v=>v.id===n)??void 0,g=b.useMemo(()=>{const v=n?a.filter(x=>x.sessionId===n):[];return Ph(Gh(v))},[a,n]);if(b.useEffect(()=>{n&&n!==u.current&&(u.current=n,d(n))},[n,d]),!n)return c.jsx("div",{className:L.emptyState,children:"No session selected"});const y=(m==null?void 0:m.status)==="running"||(m==null?void 0:m.status)==="idle";return c.jsxs("div",{className:L.panelContainer,children:[c.jsx(eo,{segments:p}),c.jsx(TO,{sessionId:n,session:m,isActive:y,onKill:r}),c.jsx(Hh,{events:g,eventsDropped:i,emptyState:c.jsx(kO,{session:m})})]})}const U0=220,V0=70,wO=40,EO=60,AO="hierarchy",NO="dependency";function jO(n){return b.useMemo(()=>{if(n.length===0)return{nodes:[],edges:[]};const a=new Vv.graphlib.Graph({multigraph:!0});a.setDefaultEdgeLabel(()=>({})),a.setGraph({rankdir:"TB",nodesep:wO,ranksep:EO});const i=new Map(n.map(u=>[u.id,u])),l=new Map;for(const u of n)if(u.parentTaskId&&i.has(u.parentTaskId)){const p=l.get(u.parentTaskId)||[];p.push(u),l.set(u.parentTaskId,p)}for(const u of n)a.setNode(u.id,{width:U0,height:V0});const r=[];for(const u of n){if(u.parentTaskId&&i.has(u.parentTaskId)){const p=`hierarchy-${u.parentTaskId}-${u.id}`;a.setEdge(u.parentTaskId,u.id,{},p),r.push({id:p,source:u.parentTaskId,target:u.id,type:"smoothstep",data:{edgeType:AO},style:{stroke:"var(--accent-green)",strokeWidth:2},animated:!1})}for(const p of u.dependsOn)if(i.has(p)){const m=`dependency-${p}-${u.id}`;a.setEdge(p,u.id,{},m),r.push({id:m,source:p,target:u.id,type:"smoothstep",data:{edgeType:NO},style:{stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeDasharray:"6 3"},animated:!1})}}return Vv.layout(a),{nodes:n.map(u=>{const p=a.node(u.id),m=l.get(u.id)||[];return{id:u.id,type:"task",position:{x:p.x-U0/2,y:p.y-V0/2},data:{task:u,childCount:m.length,doneChildCount:m.filter(g=>g.status==="complete").length,hasDependencies:u.dependsOn.length>0}}}),edges:r}},[n])}const DO="_dagContainer_js4w6_1",MO="_taskNode_js4w6_26",RO="_taskNodeBorder_js4w6_54",BO="_taskNodeContent_js4w6_60",OO="_taskNodeHeader_js4w6_70",IO="_taskNodeIcon_js4w6_77",LO="_taskNodeTitle_js4w6_82",zO="_taskNodeBadges_js4w6_90",UO="_childBadge_js4w6_95",VO="_depBadge_js4w6_107",HO="_handle_js4w6_119",GO="_emptyCta_js4w6_126",PO="_ctaDescription_js4w6_137",$O="_ctaButton_js4w6_144",ln={dagContainer:DO,taskNode:MO,taskNodeBorder:RO,taskNodeContent:BO,taskNodeHeader:OO,taskNodeIcon:IO,taskNodeTitle:LO,taskNodeBadges:zO,childBadge:UO,depBadge:VO,handle:HO,emptyCta:GO,ctaDescription:PO,ctaButton:$O};function FO({data:n}){const{task:a,childCount:i,doneChildCount:l,hasDependencies:r}=n,d=ua(a.status);return c.jsxs("div",{className:ln.taskNode,"data-task-id":a.id,"data-task-title":a.title,children:[c.jsx(Hv,{type:"target",position:Gv.Top,className:ln.handle}),c.jsx("div",{className:ln.taskNodeBorder,style:{backgroundColor:d.color}}),c.jsxs("div",{className:ln.taskNodeContent,children:[c.jsxs("div",{className:ln.taskNodeHeader,children:[c.jsx("span",{className:ln.taskNodeIcon,style:{color:d.color},children:d.icon}),c.jsx("span",{className:ln.taskNodeTitle,children:a.title})]}),c.jsxs("div",{className:ln.taskNodeBadges,children:[i>0&&c.jsxs("span",{className:ln.childBadge,children:[l,"/",i]}),r&&c.jsx("span",{className:ln.depBadge,children:"dep"})]})]}),c.jsx(Hv,{type:"source",position:Gv.Bottom,className:ln.handle})]})}const qO=J2,YO={task:FO};function KO({workspaceId:n}){const{tasks:a}=kt(),i=cn(),{resolvedThemeId:l}=bb(),r=b.useMemo(()=>a.filter(y=>y.workspaceId===n),[a,n]),{nodes:d,edges:u}=jO(r),p=b.useMemo(()=>{const y=getComputedStyle(document.documentElement),v={};for(const[x,S]of Object.entries(qO))v[x]=y.getPropertyValue(S).trim()||"#6b7a8d";return v},[l]),m=b.useCallback((y,v)=>{i(Xn(v.id,void 0,n))},[i,n]),g=b.useCallback(y=>{const v=y.data;return p[v.task.status]||p.pending},[p]);return r.length===0?c.jsxs("div",{className:ln.emptyCta,children:[c.jsx("button",{className:ln.ctaButton,onClick:()=>i(Oa(n)),children:"Create Task"}),c.jsx("div",{className:ln.ctaDescription,children:"Create tasks to see the dependency graph"})]}):c.jsx("div",{className:ln.dagContainer,children:c.jsxs(U1,{nodes:d,edges:u,nodeTypes:YO,onNodeClick:m,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,children:[c.jsx(V1,{variant:H1.Dots,gap:24,size:1,color:"var(--text-disabled)"}),c.jsx(G1,{showInteractive:!1}),c.jsx(P1,{nodeColor:g,maskColor:"var(--bg-overlay)",style:{background:"var(--bg-inset)"}})]})})}function ZO({tasks:n,taskStatusById:a,sessionStatusByTaskId:i}){const l=new Map;for(const d of n)if(d.parentTaskId){const u=l.get(d.parentTaskId);u?u.push(d):l.set(d.parentTaskId,[d])}const r=new Map(j0.map(d=>[d,[]]));for(const d of n){const u=Vh(d.status),p=d.dependsOn.length>0&&d.dependsOn.some(C=>a.get(C)!=="complete"),m=l.get(d.id)??[],g=m.length,y=m.filter(C=>C.status==="complete").length;let v;if(u==="paused"&&i){const C=i.get(d.id);C==="idle"?v="Needs input":C==="completed"&&(v="Ready to complete")}const x={task:d,isBlocked:p,childCount:g,doneChildCount:y,pausedSubBadge:v},S=r.get(u);S?S.push(x):r.get("not_started").push(x)}for(const d of r.values())d.sort((u,p)=>u.task.sortOrder-p.task.sortOrder);return j0.map(d=>{const u=ua(d);return{status:d,label:u.label,style:u,tasks:r.get(d)??[]}})}const XO="_boardContainer_1c4y1_1",QO="_column_1c4y1_17",WO="_columnHeader_1c4y1_34",JO="_columnIcon_1c4y1_47",e6="_columnLabel_1c4y1_52",t6="_columnCount_1c4y1_57",n6="_cardList_1c4y1_67",a6="_emptyPlaceholder_1c4y1_76",s6="_card_1c4y1_67",i6="_cardHeader_1c4y1_107",o6="_cardStatusIcon_1c4y1_113",l6="_cardTitle_1c4y1_119",r6="_cardBadges_1c4y1_127",c6="_badge_1c4y1_134",u6="_blockedBadge_1c4y1_146",d6="_childBadge_1c4y1_151",f6="_depBadge_1c4y1_155",h6="_parentBadge_1c4y1_159",p6="_pausedSubBadge_1c4y1_166",m6="_personaBadge_1c4y1_170",g6="_envBadge_1c4y1_174",v6="_emptyCta_1c4y1_178",y6="_ctaButton_1c4y1_188",b6="_ctaDescription_1c4y1_204",Je={boardContainer:XO,column:QO,columnHeader:WO,columnIcon:JO,columnLabel:e6,columnCount:t6,cardList:n6,emptyPlaceholder:a6,card:s6,cardHeader:i6,cardStatusIcon:o6,cardTitle:l6,cardBadges:r6,badge:c6,blockedBadge:u6,childBadge:d6,depBadge:f6,parentBadge:h6,pausedSubBadge:p6,personaBadge:m6,envBadge:g6,emptyCta:v6,ctaButton:y6,ctaDescription:b6};function _6({workspaceId:n}){const{tasks:a,sessions:i,personas:l,environments:r}=kt(),d=cn(),u=b.useMemo(()=>a.filter(v=>v.workspaceId===n),[a,n]),p=b.useMemo(()=>new Map(a.map(v=>[v.id,v.status])),[a]),m=b.useMemo(()=>new Map(u.map(v=>[v.id,v])),[u]),g=b.useMemo(()=>{const v=new Map(i.map(k=>[k.id,k])),x=new Map(l.map(k=>[k.id,k])),S=new Map(r.map(k=>[k.id,k])),C=new Map,w=new Map,E=new Map;for(const k of u)if(k.latestSessionId){const A=v.get(k.latestSessionId);if(A){if(C.set(k.id,A.status),A.personaId){const j=x.get(A.personaId);j&&w.set(k.id,j.name)}if(A.environmentId){const j=S.get(A.environmentId);j&&E.set(k.id,j.displayName)}}}return{sessionStatusByTaskId:C,personaNameByTaskId:w,environmentNameByTaskId:E}},[u,i,l,r]),y=b.useMemo(()=>ZO({tasks:u,taskStatusById:p,sessionStatusByTaskId:g.sessionStatusByTaskId}),[u,p,g]);return u.length===0?c.jsxs("div",{className:Je.emptyCta,"data-testid":"board-empty-cta",children:[c.jsx("button",{className:Je.ctaButton,onClick:()=>d(Oa(n)),children:"Create Task"}),c.jsx("div",{className:Je.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}):c.jsx("div",{className:Je.boardContainer,"data-testid":"board-container",children:y.map(v=>c.jsxs("section",{className:Je.column,"data-testid":`board-column-${v.status}`,"aria-label":`${v.label}, ${v.tasks.length} ${v.tasks.length===1?"task":"tasks"}`,children:[c.jsxs("div",{className:Je.columnHeader,children:[c.jsx("span",{className:Je.columnIcon,style:{color:v.style.color},children:v.style.icon}),c.jsx("span",{className:Je.columnLabel,children:v.label}),c.jsx("span",{className:Je.columnCount,"data-testid":`board-count-${v.status}`,children:v.tasks.length})]}),c.jsx("div",{className:Je.cardList,children:v.tasks.length===0?c.jsx("div",{className:Je.emptyPlaceholder,children:"No tasks"}):c.jsx(_n,{mode:"popLayout",children:v.tasks.map(x=>c.jsx(yt.div,{layout:!0,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},children:c.jsx(x6,{boardTask:x,tasksById:m,personaName:g.personaNameByTaskId.get(x.task.id),envName:g.environmentNameByTaskId.get(x.task.id),onClick:()=>d(Xn(x.task.id,void 0,n))})},x.task.id))})})]},v.status))})}function x6({boardTask:n,tasksById:a,personaName:i,envName:l,onClick:r}){const{task:d,isBlocked:u,childCount:p,doneChildCount:m,pausedSubBadge:g}=n,y=ua(d.status),v=d.parentTaskId?a.get(d.parentTaskId):void 0;return c.jsxs("div",{className:Je.card,tabIndex:0,role:"button","data-testid":`board-card-${d.id}`,onClick:r,onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),r())},children:[c.jsxs("div",{className:Je.cardHeader,children:[c.jsx("span",{className:Je.cardStatusIcon,style:{color:y.color},children:y.icon}),c.jsx("span",{className:Je.cardTitle,children:d.title})]}),c.jsxs("div",{className:Je.cardBadges,children:[v&&c.jsx("span",{className:`${Je.badge} ${Je.parentBadge}`,title:v.title,children:v.title}),p>0&&c.jsxs("span",{className:`${Je.badge} ${Je.childBadge}`,children:[m,"/",p]}),u&&c.jsx("span",{className:`${Je.badge} ${Je.blockedBadge}`,children:"blocked"}),d.dependsOn.length>0&&!u&&c.jsx("span",{className:`${Je.badge} ${Je.depBadge}`,children:"dep"}),g&&c.jsx("span",{className:`${Je.badge} ${Je.pausedSubBadge}`,children:g}),i&&c.jsx("span",{className:`${Je.badge} ${Je.personaBadge}`,children:i}),l&&c.jsx("span",{className:`${Je.badge} ${Je.envBadge}`,children:l})]})]})}function $h(n){const{value:a,onSave:i,validate:l,fieldId:r,activeFieldId:d,onActivate:u,enterToSave:p=!0,trimOnSave:m=!0}=n,[g,y]=b.useState(""),[v,x]=b.useState(""),S=b.useRef(!1),C=d===r,w=b.useCallback(R=>{y(R),x("")},[]),E=b.useCallback(()=>{x("")},[]),k=b.useCallback(()=>{S.current=!1,u==null||u(null),y(""),x("")},[u]),A=b.useCallback(()=>{const R=m?g.trim():g;if(l){const G=l(g);if(G){x(G);return}}const B=m?a.trim():a;if(R===B){k();return}i(R),k()},[g,a,m,l,i,k]),j=b.useCallback(()=>{S.current=!0,u==null||u(r),y(a),x("")},[r,a,u]),V=b.useCallback(R=>{if(S.current){S.current=!1;return}R.relatedTarget instanceof HTMLElement&&R.relatedTarget.dataset.editAction===r||A()},[r,A]),I=b.useCallback(R=>{R.key==="Escape"?k():R.key==="Enter"&&p&&A()},[k,p,A]),F=(()=>{if(!C)return!1;const R=m?a.trim():a;return(m?g.trim():g)!==R})();return b.useEffect(()=>{!C&&(g!==""||v!=="")&&(y(""),x(""))},[C,g,v]),{isEditing:C,draft:g,error:v,isDirty:F,startEdit:j,cancelEdit:k,save:A,setDraft:w,clearError:E,handleBlur:V,handleKeyDown:I,ignoreInitialBlurRef:S}}const S6="_editFieldWrapper_yuzty_1",T6="_editInput_yuzty_10",k6="_editTextarea_yuzty_42",C6="_editSelect_yuzty_78",w6="_editError_yuzty_111",E6="_editInputInvalid_yuzty_118",A6="_editHint_yuzty_123",N6="_unsavedDot_yuzty_132",j6="_metaValueClickable_yuzty_140",D6="_editButton_yuzty_159",M6="_metaPlaceholder_yuzty_175",R6="_worktreeToggle_yuzty_180",Ye={editFieldWrapper:S6,editInput:T6,editTextarea:k6,editSelect:C6,editError:w6,editInputInvalid:E6,editHint:A6,unsavedDot:N6,metaValueClickable:j6,editButton:D6,metaPlaceholder:M6,worktreeToggle:R6};function uf(n){const{value:a,onSave:i,validate:l,mode:r="edit",fieldId:d="text",activeFieldId:u,onActivate:p,onChange:m,renderDisplay:g,placeholder:y,maxLength:v,ariaLabel:x,"data-testid":S}=n,C=b.useRef(null),w=$h({value:a,onSave:i,validate:l,fieldId:d,activeFieldId:u,onActivate:p,enterToSave:!0,trimOnSave:!0});if(b.useEffect(()=>{if(w.isEditing){const k=window.setTimeout(()=>{var A;(A=C.current)==null||A.focus()},0);return()=>window.clearTimeout(k)}},[w.isEditing]),r==="create"){const k=j=>{m==null||m(j.target.value)},A=l==null?void 0:l(a);return c.jsxs("div",{className:Ye.editFieldWrapper,children:[c.jsx("input",{className:`${Ye.editInput} ${A?Ye.editInputInvalid:""}`,value:a,onChange:k,maxLength:v,placeholder:y,"aria-label":x,"data-testid":S?`${S}-input`:void 0}),A&&c.jsx("span",{className:Ye.editError,"data-testid":"edit-error",children:A})]})}if(w.isEditing)return c.jsxs("div",{className:Ye.editFieldWrapper,children:[c.jsx("input",{ref:C,className:`${Ye.editInput} ${w.error?Ye.editInputInvalid:""}`,value:w.draft,onChange:k=>w.setDraft(k.target.value),onBlur:w.handleBlur,onKeyDown:w.handleKeyDown,maxLength:v,placeholder:y,"aria-label":x,"data-testid":S?`${S}-input`:void 0}),w.isDirty&&c.jsx("span",{className:Ye.unsavedDot,title:"Unsaved changes"}),w.error&&c.jsx("span",{className:Ye.editError,"data-testid":"edit-error",children:w.error}),c.jsx("span",{className:Ye.editHint,children:"Enter to save · Esc to cancel"})]});const E=g==null?void 0:g(a);return c.jsxs("span",{role:"button",tabIndex:0,className:Ye.metaValueClickable,onClick:()=>w.startEdit(),onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),w.startEdit())},title:"Click to edit","aria-label":x,"data-testid":S?`${S}-button`:void 0,children:[E!==void 0?E:a?c.jsx("span",{children:a}):c.jsx("span",{className:Ye.metaPlaceholder,children:y||"None"}),c.jsx("span",{className:Ye.editButton,"aria-hidden":"true",children:"✏️"})]})}function B6(n){const{value:a,onSave:i,validate:l,mode:r="edit",fieldId:d="textarea",activeFieldId:u,onActivate:p,onChange:m,renderDisplay:g,placeholder:y,ariaLabel:v,"data-testid":x}=n,S=b.useRef(null),C=$h({value:a,onSave:i,validate:l,fieldId:d,activeFieldId:u,onActivate:p,enterToSave:!1,trimOnSave:!1});if(b.useEffect(()=>{if(C.isEditing){const E=window.setTimeout(()=>{var k;(k=S.current)==null||k.focus()},0);return()=>window.clearTimeout(E)}},[C.isEditing]),r==="create"){const E=A=>{m==null||m(A.target.value)},k=l==null?void 0:l(a);return c.jsxs("div",{className:Ye.editFieldWrapper,children:[c.jsx("textarea",{className:`${Ye.editTextarea} ${k?Ye.editInputInvalid:""}`,value:a,onChange:E,placeholder:y,"aria-label":v,"data-testid":x?`${x}-input`:void 0}),k&&c.jsx("span",{className:Ye.editError,"data-testid":"edit-error",children:k})]})}if(C.isEditing)return c.jsxs("div",{className:Ye.editFieldWrapper,children:[c.jsx("textarea",{ref:S,className:`${Ye.editTextarea} ${C.error?Ye.editInputInvalid:""}`,value:C.draft,onChange:E=>C.setDraft(E.target.value),onBlur:C.handleBlur,onKeyDown:C.handleKeyDown,title:v,"aria-label":v,"data-testid":x?`${x}-input`:void 0}),C.isDirty&&c.jsx("span",{className:Ye.unsavedDot,title:"Unsaved changes"}),C.error&&c.jsx("span",{className:Ye.editError,"data-testid":"edit-error",children:C.error}),c.jsx("span",{className:Ye.editHint,children:"Tab to save · Esc to cancel"})]});const w=g==null?void 0:g(a);return c.jsxs("span",{role:"button",tabIndex:0,className:Ye.metaValueClickable,onClick:()=>C.startEdit(),onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),C.startEdit())},title:"Click to edit","aria-label":v,"data-testid":x?`${x}-button`:void 0,children:[w!==void 0?w:a?c.jsx("span",{children:a}):c.jsx("span",{className:Ye.metaPlaceholder,children:y||"None"}),c.jsx("span",{className:Ye.editButton,"aria-hidden":"true",children:"✏️"})]})}function _x(n){var j;const{value:a,onSave:i,mode:l="edit",options:r,fieldId:d="select",activeFieldId:u,onActivate:p,onChange:m,renderDisplay:g,placeholder:y,ariaLabel:v,"data-testid":x}=n,S=b.useRef(null),C=$h({value:a,onSave:i,fieldId:d,activeFieldId:u,onActivate:p,enterToSave:!1,trimOnSave:!1});b.useEffect(()=>{if(C.isEditing){const V=window.setTimeout(()=>{var I;(I=S.current)==null||I.focus()},0);return()=>window.clearTimeout(V)}},[C.isEditing]);const w=b.useCallback(V=>{const I=V.target.value;C.ignoreInitialBlurRef.current=!1,I!==a&&i(I),C.cancelEdit()},[a,i,C]),E=b.useCallback(V=>{if(C.ignoreInitialBlurRef.current){C.ignoreInitialBlurRef.current=!1;return}V.relatedTarget instanceof HTMLElement&&V.relatedTarget.dataset.editAction===d||C.cancelEdit()},[d,C]);if(l==="create")return c.jsx("select",{className:Ye.editSelect,value:a,onChange:V=>m==null?void 0:m(V.target.value),"aria-label":v,"data-testid":x?`${x}-select`:void 0,children:r.map(V=>c.jsx("option",{value:V.value,children:V.label},V.value))});if(C.isEditing)return c.jsx("select",{ref:S,className:Ye.editSelect,value:C.draft,onChange:w,onBlur:E,title:v,"aria-label":v,"data-testid":x?`${x}-select`:void 0,children:r.map(V=>c.jsx("option",{value:V.value,children:V.label},V.value))});const k=g==null?void 0:g(a),A=(j=r.find(V=>V.value===a))==null?void 0:j.label;return c.jsxs("button",{type:"button",className:Ye.metaValueClickable,onClick:()=>C.startEdit(),title:"Click to change","aria-label":v,"data-testid":x?`${x}-button`:void 0,children:[k!==void 0?k:A?c.jsx("span",{children:A}):c.jsx("span",{className:Ye.metaPlaceholder,children:y||"None"}),c.jsx("span",{className:Ye.editButton,"aria-hidden":"true",children:"✏️"})]})}function O6(n){const{checked:a,onChange:i,label:l,ariaLabel:r,"data-testid":d}=n;return c.jsxs("label",{className:Ye.worktreeToggle,"data-testid":d,children:[c.jsx("input",{type:"checkbox",checked:a,onChange:u=>i(u.target.checked),"aria-label":r}),c.jsx("span",{children:l})]})}const I6="_envRow_1e1r5_1",L6="_envDot_1e1r5_7",z6="_envDotGreen_1e1r5_14",U6="_envDotYellow_1e1r5_18",V6="_envDotRed_1e1r5_22",H6="_envDotGray_1e1r5_26",Gi={envRow:I6,envDot:L6,envDotGreen:z6,envDotYellow:U6,envDotRed:V6,envDotGray:H6};function G6(n){const a=n.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?Gi.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?Gi.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?Gi.envDotRed:Gi.envDotGray}function P6(n){const{value:a,onSave:i,environments:l,allowNone:r=!1,fieldId:d="environment",activeFieldId:u,onActivate:p,placeholder:m="No environment",ariaLabel:g="Environment","data-testid":y}=n,v=l.find(C=>C.id===a),x=[...r?[{value:"",label:"None"}]:[],...l.map(C=>({value:C.id,label:C.displayName}))],S=()=>{if(v)return c.jsxs("span",{className:Gi.envRow,children:[c.jsx("span",{className:`${Gi.envDot} ${G6(v.status)}`}),v.displayName]})};return c.jsx(_x,{value:a,onSave:i,options:x,fieldId:d,activeFieldId:u,onActivate:p,renderDisplay:S,placeholder:m,ariaLabel:g,"data-testid":y})}function H0(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 r=Math.floor(l/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const d=Math.floor(r/60);if(d<24)return`${d}h ago`;const u=Math.floor(d/24);return u<30?`${u}d ago`:a.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}const df=100;function $6(){const{workspaceId:n}=mc(),a=cn(),{tasks:i,environments:l,workspaces:r,personas:d,archiveWorkspace:u,updateWorkspace:p}=kt(),[m,g]=b.useState("tasks"),[y,v]=b.useState(!1),[x,S]=b.useState(null),[C,w]=b.useState(!1),E=b.useRef(void 0),k=r.find(R=>R.id===n),A=[{label:"Home",url:qs},{label:(k==null?void 0:k.name)??"Workspace",url:void 0}];b.useEffect(()=>{const R=E.current;E.current=n,!(R===void 0||R===n)&&x!==null&&S(null)},[n,x]);const j=i.filter(R=>R.workspaceId===n),V=j.filter(R=>R.status==="complete").length,I=j.length,F=I>0?Math.round(V/I*100):0;return c.jsxs("div",{className:L.panelContainer,children:[c.jsx(eo,{segments:A}),c.jsxs("div",{className:L.workspaceHeader,children:[c.jsx("span",{className:L.workspaceName,"data-testid":"workspace-name",children:c.jsx(uf,{value:(k==null?void 0:k.name)||"",onSave:R=>{k&&p(k.id,{name:R})},validate:R=>{const B=R.trim();if(!B)return"Name is required";if(B.length>df)return`Max ${df} characters`},maxLength:df,fieldId:"name",activeFieldId:x,onActivate:S,ariaLabel:"Workspace name",renderDisplay:R=>R||n||void 0,"data-testid":"edit-name"})}),c.jsx("button",{className:L.archiveButton,onClick:()=>v(!0),title:"Archive workspace","data-testid":"archive-workspace-button",children:"Archive"})]}),c.jsxs("button",{className:L.metaToggle,onClick:()=>w(!C),"aria-expanded":!C,"aria-controls":"workspace-meta-panel","data-testid":"meta-toggle",children:[c.jsx("span",{className:`${L.metaToggleArrow} ${C?"":L.metaToggleArrowOpen}`,children:"▶"}),"Details"]}),!C&&c.jsxs("div",{className:L.workspaceMeta,"data-testid":"workspace-meta",id:"workspace-meta-panel",children:[c.jsxs("div",{className:L.metaRow,children:[c.jsx("span",{className:L.metaLabel,children:"Description"}),c.jsx("div",{className:L.metaValue,children:c.jsx(B6,{value:(k==null?void 0:k.description)||"",onSave:R=>{k&&p(k.id,{description:R})},fieldId:"description",activeFieldId:x,onActivate:S,renderDisplay:R=>R?c.jsx("span",{className:L.overviewMarkdown,children:c.jsx(qf,{remarkPlugins:[Yf],children:R})}):void 0,placeholder:"No description",ariaLabel:"Workspace description","data-testid":"edit-description"})})]}),c.jsxs("div",{className:L.metaRow,children:[c.jsx("span",{className:L.metaLabel,children:"Repository"}),c.jsx("div",{className:L.metaValue,children:c.jsx(uf,{value:(k==null?void 0:k.repoUrl)||"",onSave:R=>{k&&p(k.id,{repoUrl:R})},validate:R=>{const B=R.trim();if(B&&!/^https?:\/\/.+/.test(B))return"Must be a valid http(s) URL"},fieldId:"repoUrl",activeFieldId:x,onActivate:S,renderDisplay:R=>R&&/^https?:\/\//i.test(R)?c.jsx("a",{className:L.repoLink,href:R,target:"_blank",rel:"noopener noreferrer",onClick:B=>B.stopPropagation(),children:R}):R?c.jsx("span",{children:R}):void 0,placeholder:"No repository",ariaLabel:"Workspace repository URL","data-testid":"edit-repo"})})]}),c.jsxs("div",{className:L.metaRow,children:[c.jsx("span",{className:L.metaLabel,children:"Environment"}),c.jsx("div",{className:L.metaValue,children:c.jsx(P6,{value:(k==null?void 0:k.environmentId)||"",onSave:R=>{k&&R&&p(k.id,{environmentId:R})},environments:l,fieldId:"environmentId",activeFieldId:x,onActivate:S,placeholder:"Select environment",ariaLabel:"Workspace environment","data-testid":"edit-env"})})]}),c.jsxs("div",{className:L.metaRow,children:[c.jsx("span",{className:L.metaLabel,children:"Persona"}),c.jsx("div",{className:L.metaValue,children:c.jsx(_x,{value:(k==null?void 0:k.defaultPersonaId)||"",onSave:R=>{k&&p(k.id,{defaultPersonaId:R})},options:[{value:"",label:"(Inherit)"},...d.map(R=>({value:R.id,label:R.name}))],fieldId:"defaultPersonaId",activeFieldId:x,onActivate:S,renderDisplay:R=>{const B=d.find(G=>G.id===R);if(B)return c.jsx("span",{children:B.name})},placeholder:(k==null?void 0:k.defaultPersonaId)||"(Inherit)",ariaLabel:"Workspace default persona","data-testid":"edit-persona"})})]}),c.jsxs("div",{className:L.metaRow,children:[c.jsx("span",{className:L.metaLabel,children:"Worktrees"}),c.jsx("div",{className:L.metaValue,children:c.jsx(O6,{checked:(k==null?void 0:k.useWorktrees)??!0,onChange:R=>{k&&p(k.id,{useWorktrees:R})},label:"Enable worktree isolation","data-testid":"worktree-toggle"})})]}),c.jsxs("div",{className:L.metaRow,children:[c.jsx("span",{className:L.metaLabel,children:"Working Dir"}),c.jsx("div",{className:L.metaValue,children:c.jsx(uf,{value:(k==null?void 0:k.worktreeBasePath)||"",onSave:R=>{k&&p(k.id,{worktreeBasePath:R})},fieldId:"worktreeBasePath",activeFieldId:x,onActivate:S,placeholder:"Default (server default)",ariaLabel:"Working directory","data-testid":"edit-worktree-base-path"})})]}),k&&c.jsxs("div",{className:L.metaTimestamps,children:[c.jsxs("span",{className:L.metaTimestamp,children:["Created ",H0(k.createdAt)]}),k.updatedAt&&k.updatedAt!==k.createdAt&&c.jsxs("span",{className:L.metaTimestamp,children:["· Updated ",H0(k.updatedAt)]})]})]}),I>0&&c.jsxs("div",{className:L.progressBarContainer,"data-testid":"progress-bar",children:[c.jsx("div",{className:L.progressBar,children:c.jsx("div",{className:L.progressFill,style:{width:`${F}%`}})}),c.jsxs("span",{className:L.progressLabel,children:[V,"/",I]})]}),c.jsxs("div",{className:L.tabBar,role:"tablist","aria-label":"Workspace view",children:[c.jsx("button",{role:"tab","aria-selected":m==="graph",className:`${L.tab} ${m==="graph"?L.active:""}`,onClick:()=>g("graph"),children:"Graph"}),c.jsx("button",{role:"tab","aria-selected":m==="board",className:`${L.tab} ${m==="board"?L.active:""}`,onClick:()=>g("board"),"data-testid":"board-tab",children:"Board"}),c.jsx("button",{role:"tab","aria-selected":m==="tasks",className:`${L.tab} ${m==="tasks"?L.active:""}`,onClick:()=>g("tasks"),children:"Tasks"})]}),m==="tasks"&&I>0&&c.jsxs("div",{className:L.workspaceSummary,children:[c.jsx("span",{className:L.workspaceSummaryTitle,children:`${V}/${I} tasks complete`}),c.jsx("span",{className:L.workspaceSummarySubtitle,children:"Select a task or click + to create one"})]}),m==="tasks"&&I===0&&c.jsxs("div",{className:L.emptyCta,children:[c.jsx("button",{className:L.ctaButton,onClick:()=>a(Oa(n)),children:"Create Task"}),c.jsx("div",{className:L.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}),m==="board"&&c.jsx(_6,{workspaceId:n}),m==="graph"&&c.jsx(KO,{workspaceId:n}),c.jsx(Cc,{isOpen:y,title:"Archive Workspace?",description:"This will hide the workspace from the sidebar. Tasks will not be deleted.",confirmLabel:"Archive",onConfirm:()=>{k&&(u(k.id),a("/",{replace:!0})),v(!1)},onCancel:()=>v(!1)})]})}const F6="_container_cddyd_1",q6="_header_cddyd_8",Y6="_headerTitle_cddyd_35",K6="_badge_cddyd_44",Z6="_headerActions_cddyd_54",X6="_body_cddyd_61",Q6="_formContent_cddyd_73",W6="_section_cddyd_85",J6="_label_cddyd_91",e5="_titleInput_cddyd_98",t5="_descriptionTextarea_cddyd_131",n5="_parentContext_cddyd_167",a5="_parentLabel_cddyd_175",s5="_parentName_cddyd_182",i5="_personaSelect_cddyd_186",o5="_depList_cddyd_220",l5="_depItem_cddyd_226",r5="_depItemSelected_cddyd_248",c5="_noDeps_cddyd_252",u5="_btnPrimary_cddyd_258",d5="_btnGhost_cddyd_289",qe={container:F6,header:q6,headerTitle:Y6,badge:K6,headerActions:Z6,body:X6,formContent:Q6,section:W6,label:J6,titleInput:e5,descriptionTextarea:t5,parentContext:n5,parentLabel:a5,parentName:s5,personaSelect:i5,depList:o5,depItem:l5,depItemSelected:r5,noDeps:c5,btnPrimary:u5,btnGhost:d5};function xx({mode:n,taskId:a,workspaceId:i,parentTaskId:l}){const{tasks:r,workspaces:d,personas:u,createTask:p,updateTask:m}=kt(),{showToast:g}=bl(),y=cn(),v=n==="edit",x=v&&a?r.find(se=>se.id===a):void 0,S=v?(x==null?void 0:x.workspaceId)??"":i??"",[C,w]=b.useState(S),E=S||C,k=!v&&!i,A=v?(x==null?void 0:x.parentTaskId)??"":l??"",j=A?r.find(se=>se.id===A):void 0,[V,I]=b.useState((x==null?void 0:x.title)??""),[F,R]=b.useState((x==null?void 0:x.description)??""),[B,G]=b.useState((x==null?void 0:x.dependsOn)??[]),[ee,ae]=b.useState((x==null?void 0:x.defaultPersonaId)??""),[te,fe]=b.useState((x==null?void 0:x.canDecompose)??!1),[Q,ie]=b.useState(!1),H=b.useRef(!1);b.useEffect(()=>{v&&x&&!H.current&&(H.current=!0,I(x.title),R(x.description),G(x.dependsOn),ae(x.defaultPersonaId),fe(x.canDecompose))},[v,x]);const M=r.filter(se=>se.workspaceId===E&&(!v||se.id!==a)&&se.id!==A),J=V.trim().length>0&&(!v||x!==void 0)&&E.length>0,le=se=>{G(je=>je.includes(se)?je.filter(pt=>pt!==se):[...je,se])},Y=()=>{!J||Q||v&&x===void 0||(v&&a?(m(a,V.trim(),F,B,ee),g("Task updated","success"),y(Xn(a,void 0,E),{replace:!0})):(ie(!0),p(E,V.trim(),F,B.length>0?B:void 0,A||void 0,ee,te,()=>{g("Task created","success"),y(i?$i(i):"/tasks",{replace:!0})},se=>{g(se,"error"),ie(!1)})))},pe=()=>{y(v&&a?Xn(a,void 0,E):i?$i(i):"/tasks")},De=v?"edit task":A?"child task":"new task";return c.jsxs("div",{className:qe.container,children:[c.jsxs("div",{className:qe.header,children:[c.jsxs("div",{className:qe.headerTitle,children:[c.jsx("span",{className:qe.badge,children:De}),j&&c.jsxs("span",{className:qe.parentContext,children:[c.jsx("span",{className:qe.parentLabel,children:"Child of"}),c.jsx("span",{className:qe.parentName,children:j.title})]})]}),c.jsxs("div",{className:qe.headerActions,children:[c.jsx("button",{onClick:Y,disabled:!J||Q,className:qe.btnPrimary,"data-testid":"task-edit-save",children:Q?"Creating…":v?"Save Changes":"Create"}),c.jsx("button",{onClick:pe,className:qe.btnGhost,children:"Cancel"})]})]}),c.jsx("div",{className:qe.body,children:c.jsxs("div",{className:qe.formContent,children:[k&&c.jsxs("div",{className:qe.section,children:[c.jsx("label",{className:qe.label,htmlFor:"task-edit-workspace",children:"Workspace"}),c.jsxs("select",{id:"task-edit-workspace",value:C,onChange:se=>w(se.target.value),className:qe.personaSelect,"data-testid":"task-edit-workspace",children:[c.jsx("option",{value:"",children:"Select a workspace..."}),d.map(se=>c.jsx("option",{value:se.id,children:se.name},se.id))]})]}),c.jsxs("div",{className:qe.section,children:[c.jsx("label",{className:qe.label,htmlFor:"task-edit-title",children:"Title"}),c.jsx("input",{id:"task-edit-title",type:"text",value:V,onChange:se=>I(se.target.value),placeholder:"Task title...",autoFocus:!0,className:qe.titleInput,"data-testid":"task-edit-title",onKeyDown:se=>{se.key==="Enter"&&J&&Y()}})]}),c.jsxs("div",{className:qe.section,children:[c.jsx("label",{className:qe.label,htmlFor:"task-edit-description",children:"Description"}),c.jsx("textarea",{id:"task-edit-description",value:F,onChange:se=>R(se.target.value),placeholder:"Describe the task... (markdown supported)",className:qe.descriptionTextarea,"data-testid":"task-edit-description",rows:8})]}),c.jsxs("div",{className:qe.section,children:[c.jsx("label",{className:qe.label,htmlFor:"task-edit-persona",children:"Default Persona"}),c.jsxs("select",{id:"task-edit-persona",value:ee,onChange:se=>ae(se.target.value),className:qe.personaSelect,"data-testid":"task-edit-persona",children:[c.jsx("option",{value:"",children:"(Inherit)"}),u.map(se=>c.jsx("option",{value:se.id,children:se.name},se.id))]})]}),!v&&c.jsx("div",{className:qe.section,children:c.jsxs("label",{className:qe.depItem,"data-testid":"task-edit-can-decompose",children:[c.jsx("input",{type:"checkbox",checked:te,onChange:se=>fe(se.target.checked)}),"Can spawn subtasks"]})}),c.jsxs("div",{className:qe.section,children:[c.jsx("div",{className:qe.label,children:"Dependencies"}),M.length===0?c.jsx("div",{className:qe.noDeps,children:"No other tasks in this workspace"}):c.jsx("div",{className:qe.depList,children:M.map(se=>{const je=B.includes(se.id);return c.jsxs("label",{className:`${qe.depItem} ${je?qe.depItemSelected:""}`,"data-testid":`dep-option-${se.id}`,children:[c.jsx("input",{type:"checkbox",checked:je,onChange:()=>le(se.id)}),se.title,c.jsxs("span",{style:{opacity:.5,fontSize:"11px",marginLeft:"4px"},children:["(",se.status,")"]})]},se.id)})})]})]})})]})}function f5(){const[n]=th(),a=n.get("workspace")??"",i=n.get("parent")??void 0;return c.jsx(xx,{mode:"new",workspaceId:a,parentTaskId:i})}function G0(){const{taskId:n}=mc();return c.jsx(xx,{mode:"edit",taskId:n})}const h5="_container_1pqxm_1",p5="_emptyState_1pqxm_8",m5="_card_1pqxm_14",g5="_cardHeader_1pqxm_34",v5="_categoryBadge_1pqxm_46",y5="_findingTitle_1pqxm_54",b5="_findingDate_1pqxm_60",_5="_findingContent_1pqxm_72",x5="_tags_1pqxm_78",S5="_tag_1pqxm_78",aa={container:h5,emptyState:p5,card:m5,cardHeader:g5,categoryBadge:v5,findingTitle:y5,findingDate:b5,findingContent:_5,tags:x5,tag:S5};function T5(n){const a=new Date(n),i=new Date,l=i.getTime()-a.getTime(),r=Math.floor(l/1e3),d=Math.floor(r/60),u=Math.floor(d/60),p=Math.floor(u/24);if(r<60)return"just now";if(d<60)return`${d}m ago`;if(u<24)return`${u}h ago`;if(p===1)return"yesterday";if(p<7)return`${p} days ago`;const m=a.getFullYear()===i.getFullYear(),g=a.toLocaleString("en-US",{month:"short"}),y=a.getDate();return m?`${g} ${y}`:`${g} ${y} ${a.getFullYear()}`}const P0={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 k5({workspaceId:n}){const{findings:a}=kt(),i=a.filter(l=>l.workspaceId===n);return i.length===0?c.jsx("div",{className:aa.emptyState,children:"No findings yet. Agents will post discoveries here."}):c.jsx("div",{className:aa.container,children:i.map((l,r)=>{const d=P0[l.category]||P0.general;return c.jsxs(yt.div,{className:aa.card,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:r*.05,duration:.2},children:[c.jsxs("div",{className:aa.cardHeader,children:[c.jsx("span",{className:aa.categoryBadge,style:{background:d.bg,color:d.text},children:l.category}),c.jsx("span",{className:aa.findingTitle,children:l.title}),c.jsx("span",{className:aa.findingDate,title:l.createdAt,children:T5(l.createdAt)})]}),c.jsx("div",{className:aa.findingContent,children:l.content.length>300?l.content.slice(0,300)+"...":l.content}),l.tags.length>0&&c.jsx("div",{className:aa.tags,children:l.tags.map(u=>c.jsx("span",{className:aa.tag,style:{color:d.text,textShadow:`0 0 8px ${d.text}`},children:u},u))})]},l.id)})})}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 ff(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),r=Math.floor(i%6e4/1e3);if(l===0)return`${r}s`;const d=Math.floor(l/60),u=l%60;return d===0?`${l}m ${r}s`:`${d}h ${u}m`}function $0(n){const a=n.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?L.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?L.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?L.envDotRed:L.envDotGray}function C5({status:n}){const a=ua(n),i=X2(n);return c.jsx("span",{className:`${L.statusBadge} ${L[i]??L.statusPending}`,children:a.label})}function w5({task:n,tasksById:a,environments:i,workspaces:l,taskSessions:r,selectedEnvId:d}){const u=r.length>0?r[r.length-1]:void 0,p=(u==null?void 0:u.environmentId)??"",m=p?i.find(x=>x.id===p):void 0,g=l.find(x=>x.id===n.workspaceId),y=i.find(x=>x.id===d),v=n.branch&&(g!=null&&g.repoUrl)?`${g.repoUrl.replace(/\/$/,"")}/tree/${encodeURIComponent(n.branch)}`:void 0;return c.jsxs("div",{className:L.overviewDashboard,children:[c.jsxs("div",{className:L.overviewHero,children:[c.jsx(C5,{status:n.status}),n.branch&&c.jsx("span",{className:L.overviewBranchPill,children:v?c.jsxs("a",{href:v,target:"_blank",rel:"noreferrer noopener",className:L.branchLink,children:["🔗"," ",n.branch]}):c.jsxs("span",{children:["🔗"," ",n.branch]})})]}),typeof n.description=="string"&&n.description&&c.jsxs("div",{className:L.overviewSection,children:[c.jsx("div",{className:L.overviewLabel,children:"Description"}),c.jsx("div",{className:L.overviewMarkdown,children:c.jsx(qf,{remarkPlugins:[Yf],children:n.description})})]}),c.jsxs("div",{className:L.overviewSection,children:[c.jsx("div",{className:L.overviewLabel,children:"Environment"}),p&&m?c.jsxs("div",{className:L.envRow,"data-testid":"task-overview-environment",children:[c.jsx("span",{className:`${L.envDot} ${$0(m.status)}`,title:m.status,"aria-label":`Status: ${m.status}`,role:"img"}),c.jsx("span",{className:L.overviewValue,children:m.displayName})]}):y?c.jsxs("div",{className:L.envRow,"data-testid":"task-overview-environment",children:[c.jsx("span",{className:`${L.envDot} ${$0(y.status)}`,title:y.status,"aria-label":`Status: ${y.status}`,role:"img"}),c.jsx("span",{className:L.overviewValue,children:y.displayName}),c.jsx("span",{className:L.overviewMuted,children:"(workspace default)"})]}):c.jsx("div",{className:L.overviewMuted,children:"Set in workspace settings"})]}),c.jsxs("div",{className:L.overviewSection,children:[c.jsx("div",{className:L.overviewLabel,children:"Dependencies"}),n.dependsOn.length===0?c.jsx("div",{className:L.overviewMuted,children:"None"}):c.jsx("div",{className:L.depList,children:n.dependsOn.map(x=>{const S=a.get(x),C=(S==null?void 0:S.status)==="complete";return c.jsxs("div",{className:`${L.depItem} ${C?L.depDone:L.depBlocked}`,children:[c.jsx("span",{children:C?"✓":"○"}),c.jsx("span",{children:(S==null?void 0:S.title)??x})]},x)})})]}),c.jsxs("div",{className:L.overviewSection,children:[c.jsx("div",{className:L.overviewLabel,children:"Timeline"}),c.jsxs("div",{className:L.timeline,children:[n.createdAt&&c.jsxs("div",{className:L.timelineRow,children:[c.jsx("span",{className:L.timelineKey,children:"Created"}),c.jsx("span",{className:L.timelineValue,children:qr(n.createdAt)})]}),n.assignedAt&&(()=>{const x=ff(n.createdAt,n.assignedAt);return c.jsxs("div",{className:L.timelineRow,children:[c.jsx("span",{className:L.timelineKey,children:"Assigned"}),c.jsx("span",{className:L.timelineValue,children:qr(n.assignedAt)}),x!==void 0&&c.jsx("span",{className:L.timelineDelta,children:x})]})})(),n.startedAt&&(()=>{const x=ff(n.assignedAt??n.createdAt,n.startedAt);return c.jsxs("div",{className:L.timelineRow,children:[c.jsx("span",{className:L.timelineKey,children:"Started"}),c.jsx("span",{className:L.timelineValue,children:qr(n.startedAt)}),x!==void 0&&c.jsx("span",{className:L.timelineDelta,children:x})]})})(),n.completedAt&&(()=>{const x=ff(n.startedAt,n.completedAt);return c.jsxs("div",{className:L.timelineRow,children:[c.jsx("span",{className:L.timelineKey,children:"Completed"}),c.jsx("span",{className:L.timelineValue,children:qr(n.completedAt)}),x!==void 0&&c.jsx("span",{className:L.timelineDelta,children:x})]})})(),!n.createdAt&&!n.assignedAt&&!n.startedAt&&!n.completedAt&&c.jsx("div",{className:L.overviewMuted,children:"No timing data"})]})]}),n.reviewNotes&&c.jsxs("div",{className:L.overviewSection,children:[c.jsx("div",{className:L.overviewLabel,children:"Review Notes"}),c.jsx("div",{className:L.reviewNotes,children:n.reviewNotes})]})]})}function E5({task:n,sessionId:a,isBlocked:i,onStart:l,onResume:r,onStop:d,onPause:u,onDelete:p,onEdit:m}){if(n.status==="not_started")return i?c.jsxs("div",{className:L.headerActions,children:[c.jsx("button",{onClick:m,className:L.btnGhost,children:"Edit"}),c.jsx("button",{onClick:p,className:L.btnDanger,children:"Delete"})]}):c.jsxs("div",{className:L.headerActions,children:[c.jsx("button",{onClick:l,className:L.btnPrimary,children:"Start"}),c.jsx("button",{onClick:m,className:L.btnGhost,children:"Edit"}),c.jsx("button",{onClick:p,className:L.btnDanger,children:"Delete"})]});if(n.status==="working")return c.jsxs("div",{className:L.headerActions,children:[c.jsx("button",{onClick:d,className:L.btnDanger,children:"Stop"}),c.jsx("button",{onClick:u,disabled:!a,className:L.btnGhost,children:"Pause"})]});if(n.status==="paused")return c.jsxs("div",{className:L.headerActions,children:[c.jsx("button",{onClick:d,className:L.btnPrimary,children:"Stop"}),c.jsx("button",{onClick:r,className:L.btnGhost,children:"Resume"}),c.jsx("button",{onClick:p,className:L.btnDanger,children:"Delete"})]});if(n.status==="complete")return c.jsx("div",{className:L.headerActions,children:c.jsx("button",{onClick:p,className:L.btnDanger,children:"Delete"})});if(n.status==="failed")return c.jsxs("div",{className:L.headerActions,children:[c.jsx("button",{onClick:l,className:L.btnPrimary,children:"Retry"}),c.jsx("button",{onClick:p,className:L.btnDanger,children:"Delete"})]})}function A5({taskSessions:n,selectedSessionId:a,onSelect:i}){if(!(n.length<2))return c.jsxs("div",{className:L.attemptSelector,"data-testid":"attempt-selector",children:[c.jsx("span",{className:L.attemptLabel,children:"Attempts:"}),n.map((l,r)=>{const d=l.id===a,u=l.status==="completed"?"✓":l.status==="failed"?"✗":l.status==="running"||l.status==="idle"?"●":"";return c.jsxs("button",{className:`${L.attemptButton} ${d?L.attemptActive:""}`,onClick:()=>i(l.id),title:`Attempt #${r+1} — ${l.status}`,"aria-label":`Attempt #${r+1}, ${l.status}`,"aria-pressed":d,"data-testid":`attempt-${r+1}`,children:["#",r+1,u&&c.jsx("span",{className:L.attemptStatus,children:u})]},l.id)})]})}function Oi(){const{taskId:n,workspaceId:a}=mc(),i=qt(),l=cn(),{events:r,eventsDropped:d,tasks:u,environments:p,loadSessionEvents:m,loadFindings:g,kill:y,startTask:v,stopTask:x,resumeTask:S,deleteTask:C,workspaces:w,taskSessions:E,loadTaskSessions:k}=kt(),A=b.useRef(void 0),j=b.useRef(void 0),V=b.useRef(void 0),I=b.useRef(void 0),F=b.useRef(void 0),R=i.pathname.endsWith("/stream")?"stream":i.pathname.endsWith("/findings")?"findings":"overview",[B,G]=b.useState(R),[ee,ae]=b.useState(!1),[te,fe]=b.useState(void 0),[Q,ie]=b.useState(""),H=b.useRef(R);R!==H.current&&(H.current=R,R!==B&&G(R));const M=u.find(W=>W.id===n),J=(M==null?void 0:M.workspaceId)||void 0,le=w.find(W=>W.id===J);b.useEffect(()=>{if(Q===""){if(le!=null&&le.environmentId)ie(le.environmentId);else if(p.length>0){const W=p.find(Ce=>Ce.status==="connected");ie((W==null?void 0:W.id)??p[0].id)}}},[Q,le==null?void 0:le.environmentId,p]);const Y=M?E[M.id]??[]:[];let pe;te&&Y.some(W=>W.id===te)?pe=te:pe=(M==null?void 0:M.latestSessionId)||void 0;const De=()=>{ae(!0)},se=()=>{M&&(C(M.id),ae(!1),l(M.workspaceId?$i(M.workspaceId):"/",{replace:!0}))};if((M==null?void 0:M.id)!==j.current&&(j.current=M==null?void 0:M.id,te!==void 0&&fe(void 0),Q!==""&&ie("")),b.useEffect(()=>{if(!(M!=null&&M.id))return;const W=M.id!==I.current,Ce=M.latestSessionId!==F.current;(W||Ce)&&(I.current=M.id,F.current=M.latestSessionId,k(M.id))},[M==null?void 0:M.id,M==null?void 0:M.latestSessionId,k]),(M==null?void 0:M.status)!==V.current){const W=V.current===void 0;V.current=M==null?void 0:M.status;const Ce=(M==null?void 0:M.status)==="not_started"?"overview":(M==null?void 0:M.status)==="working"||(M==null?void 0:M.status)==="paused"?"stream":(M==null?void 0:M.status)==="complete"?"findings":void 0;Ce&&Ce!==B&&!(W&&R!=="overview")&&G(Ce)}const je=b.useMemo(()=>new Map(u.map(W=>[W.id,W])),[u]),pt=b.useMemo(()=>{const W=pe?r.filter(Ce=>Ce.sessionId===pe):[];return Ph(Gh(W))},[r,pe]),Ct=M?M.dependsOn.some(W=>{const Ce=je.get(W);return Ce!==void 0&&Ce.status!=="complete"}):!1,un=b.useMemo(()=>xO(n,w,je),[n,w,je]);b.useEffect(()=>{pe&&pe!==A.current&&(A.current=pe,m(pe))},[pe,m]),b.useEffect(()=>{B==="findings"&&J&&g(J)},[B,J,g]);const Jt=W=>{G(W),l(Xn(n,W==="overview"?void 0:W,a))};return c.jsxs("div",{className:L.panelContainer,children:[c.jsx(eo,{segments:un}),c.jsxs("div",{className:L.header,children:[c.jsxs("span",{className:L.headerTitle,children:[c.jsx("span",{"data-testid":"task-title",children:(M==null?void 0:M.title)||n}),M&&c.jsx("span",{className:L.taskStatusBadge,"data-testid":"task-status",children:M.status}),(M==null?void 0:M.branch)&&c.jsx("span",{className:L.taskBranch,children:M.branch}),Ct&&c.jsx("span",{className:L.taskBlockedBadge,children:"blocked"})]}),M&&c.jsx(E5,{task:M,sessionId:pe,isBlocked:Ct,onStart:()=>v(M.id,void 0,Q),onResume:()=>S(M.id),onStop:()=>x(M.id),onPause:()=>pe&&y(pe),onDelete:De,onEdit:()=>l(Vk(M.id,a))})]}),c.jsxs("div",{className:L.tabBar,role:"tablist","aria-label":"Task view",children:[c.jsx("button",{role:"tab","aria-selected":B==="overview",className:`${L.tab} ${B==="overview"?L.active:""}`,onClick:()=>Jt("overview"),children:"Overview"}),c.jsx("button",{role:"tab","aria-selected":B==="stream",className:`${L.tab} ${B==="stream"?L.active:""}`,onClick:()=>Jt("stream"),children:"Stream"}),c.jsx("button",{role:"tab","aria-selected":B==="findings",className:`${L.tab} ${B==="findings"?L.active:""}`,onClick:()=>Jt("findings"),children:"Findings"})]}),c.jsxs(_n,{mode:"wait",children:[B==="overview"&&c.jsx(yt.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:L.overviewContent,"data-testid":"task-overview",children:M?c.jsx(w5,{task:M,tasksById:je,environments:p,workspaces:w,taskSessions:Y,selectedEnvId:Q}):c.jsx("div",{className:L.waitingMessage,children:"No additional details"})},"overview"),B==="stream"&&c.jsxs(yt.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:[c.jsx(A5,{taskSessions:Y,selectedSessionId:pe,onSelect:W=>fe(W)}),c.jsx(Hh,{events:pt,eventsDropped:d,emptyState:!pe&&M?c.jsxs("div",{className:L.emptyCta,children:[c.jsx("button",{className:L.ctaButton,onClick:()=>v(M.id,void 0,Q),children:"Start Task"}),c.jsx("div",{className:L.ctaDescription,children:"Click to begin agent execution"})]}):pe&&pt.length===0?c.jsx("div",{className:L.waitingMessage,children:"Waiting for events..."}):void 0})]},"stream"),B==="findings"&&c.jsx(yt.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:L.tabContent,children:J?c.jsx(k5,{workspaceId:J}):c.jsx("div",{className:L.noContext,children:"Navigate to a task within a workspace to view findings"})},"findings")]}),M&&c.jsx(Cc,{isOpen:ee,title:"Delete Task?",description:`"${M.title}" will be permanently removed.`,onConfirm:se,onCancel:()=>ae(!1)})]})}function N5(){const n=yO();return c.jsxs("div",{className:L.panelContainer,children:[c.jsx(eo,{segments:n}),c.jsx("div",{className:L.emptyState,children:"Configure the new environment below"})]})}const j5="_layout_11u79_1",D5="_content_11u79_8",M5="_tabPanel_11u79_14",hf={layout:j5,content:D5,tabPanel:M5},R5={environments:"Environments",credentials:"Credentials",personas:"Personas",appearance:"Appearance",about:"About"};function B5(){const a=qt().pathname.replace(/^\/settings\/?/,"").split("/")[0],i=R5[a],l=vO(i);return c.jsxs("div",{className:hf.layout,children:[c.jsx(eo,{segments:l}),c.jsx("div",{className:hf.content,children:c.jsx("div",{className:hf.tabPanel,children:c.jsx(lb,{})},a)})]})}const O5="_container_1nk8c_1",I5="_header_1nk8c_5",L5="_headerLabel_1nk8c_12",z5="_addButton_1nk8c_20",U5="_envRow_1nk8c_55",V5="_targeted_1nk8c_69",H5="_expanded_1nk8c_72",G5="_statusDot_1nk8c_76",P5="_pulse_1nk8c_79",$5="_envName_1nk8c_83",F5="_envActions_1nk8c_87",q5="_idleLabel_1nk8c_94",Y5="_newChatButton_1nk8c_99",K5="_envActionsRow_1nk8c_126",Z5="_connectButton_1nk8c_134",X5="_stopButton_1nk8c_160",Q5="_deleteButton_1nk8c_186",W5="_provisionMessage_1nk8c_213",J5="_errorMessage_1nk8c_220",e4="_sessionRow_1nk8c_227",t4="_selected_1nk8c_243",n4="_sessionDot_1nk8c_248",a4="_sessionSummaryRow_1nk8c_252",s4="_sessionExpandArrow_1nk8c_272",i4="_sessionSummaryText_1nk8c_283",o4="_sessionCountBadge_1nk8c_290",l4="_emptyCta_1nk8c_313",r4="_ctaDescription_1nk8c_326",c4="_ctaButton_1nk8c_332",We={container:O5,header:I5,headerLabel:L5,addButton:z5,envRow:U5,targeted:V5,expanded:H5,statusDot:G5,pulse:P5,envName:$5,envActions:F5,idleLabel:q5,newChatButton:Y5,envActionsRow:K5,connectButton:Z5,stopButton:X5,deleteButton:Q5,provisionMessage:W5,errorMessage:J5,sessionRow:e4,selected:t4,sessionDot:n4,sessionSummaryRow:a4,sessionExpandArrow:s4,sessionSummaryText:i4,sessionCountBadge:o4,emptyCta:l4,ctaDescription:r4,ctaButton:c4},u4={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"},d4={running:"running",idle:"awaiting input",failed:"failed",interrupted:"interrupted",completed:"completed"},F0=["running","idle","failed","interrupted","completed"],f4=.2;function h4(n){const a={};for(const d of n)a[d.status]=(a[d.status]||0)+1;const i=F0.filter(d=>a[d]>0).map(d=>`${a[d]} ${d4[d]||d}`),l=new Set(F0),r=Object.keys(a).filter(d=>!l.has(d)).sort().map(d=>`${a[d]} ${d}`);return[...i,...r].join(", ")}function p4({status:n}){const a=n==="running"?"var(--accent-green)":n==="idle"?"var(--accent-yellow)":n==="completed"?"var(--text-secondary)":n==="failed"||n==="interrupted"?"var(--accent-red)":"var(--text-tertiary)";return c.jsx("span",{className:We.sessionDot,style:{color:a},children:"●"})}function m4({env:n,envSessions:a,selectedSessionId:i,isNewChatTarget:l,expanded:r,onToggleExpand:d,sessionsExpanded:u,onToggleSessionsExpand:p,provisionProgress:m,onProvision:g,onStop:y,onRemove:v,navigate:x}){const[S,C]=b.useState(!1),w=u4[n.status]||"var(--text-tertiary)",E=n.status==="connected",k=n.status==="connecting",A=n.status==="disconnected"||n.status==="error";return c.jsxs("div",{children:[c.jsx(Cc,{isOpen:S,title:"Delete Environment?",description:`"${n.displayName||n.id}" will be permanently removed. This destroys the workspace and removes all data.`,onConfirm:()=>{v(n.id),C(!1)},onCancel:()=>C(!1)}),c.jsxs("div",{className:`${We.envRow} ${l?We.targeted:""} ${r?We.expanded:""}`,"data-testid":"env-row",onClick:d,children:[c.jsx("span",{className:`${We.statusDot} ${E?We.pulse:""}`,style:{color:w},children:"●"}),c.jsx("span",{className:We.envName,title:n.displayName||n.id,children:n.displayName||n.id}),c.jsxs("span",{className:We.envActions,children:[a.length===0&&!l&&!r&&c.jsx("span",{className:We.idleLabel,children:"(idle)"}),E&&c.jsx("button",{onClick:j=>{j.stopPropagation(),x(fb(n.id))},title:"New chat",className:We.newChatButton,children:"+"})]})]}),r&&c.jsxs("div",{className:We.envActionsRow,children:[k&&m&&c.jsx("span",{className:We.provisionMessage,children:m.message}),n.status==="error"&&(m==null?void 0:m.stage)==="error"&&c.jsx("span",{className:We.errorMessage,children:m.message}),A&&c.jsx("button",{onClick:j=>{j.stopPropagation(),g(n.id)},className:We.connectButton,children:n.status==="error"?"Retry":"Connect"}),E&&c.jsx("button",{onClick:j=>{j.stopPropagation(),y(n.id)},className:We.stopButton,children:"Stop"}),!k&&c.jsx("button",{onClick:j=>{j.stopPropagation(),C(!0)},className:We.deleteButton,children:"Delete"})]}),a.length>0&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:We.sessionSummaryRow,"data-testid":"session-summary-row",role:"button",tabIndex:0,"aria-expanded":u,"aria-label":u?"Collapse sessions":"Expand sessions",onClick:p,onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),p())},children:[c.jsx("span",{className:`${We.sessionExpandArrow} ${u?We.expanded:""}`,children:"▸"}),c.jsx("span",{className:We.sessionSummaryText,children:h4(a)}),c.jsx("span",{className:We.sessionCountBadge,children:a.length})]}),c.jsx(_n,{children:u&&c.jsx(yt.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:f4,ease:"easeInOut"},style:{overflow:"hidden"},children:a.map(j=>c.jsxs("div",{onClick:V=>{V.stopPropagation(),x(nh(j.id))},className:`${We.sessionRow} ${i===j.id?We.selected:""}`,title:j.prompt,"data-testid":"session-row",children:[c.jsx(p4,{status:j.status})," ",j.prompt.length>24?j.prompt.slice(0,24)+"...":j.prompt]},j.id))})})]})]})}function g4(){const{environments:n,sessions:a,provisionStatus:i,provisionEnvironment:l,stopEnvironment:r,removeEnvironment:d}=kt(),u=cn(),[p,m]=b.useState(null),[g,y]=b.useState(new Set),v=jt("/sessions/:sessionId"),x=jt("/sessions/new"),S=(v==null?void 0:v.params.sessionId)!=="new"?v==null?void 0:v.params.sessionId:void 0,[C]=th(),w=x?C.get("env")??void 0:void 0;return c.jsxs("div",{className:We.container,children:[c.jsxs("div",{className:We.header,children:[c.jsx("span",{className:We.headerLabel,children:"Environments"}),c.jsx("button",{className:We.addButton,onClick:()=>u(ay),title:"Add environment",children:"+ Add Environment"})]}),n.length===0&&c.jsxs("div",{className:We.emptyCta,children:[c.jsx("button",{className:We.ctaButton,onClick:()=>u(ay),children:"Add Environment"}),c.jsx("div",{className:We.ctaDescription,children:"Connect an environment to run agents"})]}),n.map(E=>{const k=a.filter(A=>A.environmentId===E.id);return c.jsx(m4,{env:E,envSessions:k,selectedSessionId:S,isNewChatTarget:w===E.id,expanded:p===E.id,onToggleExpand:()=>m(p===E.id?null:E.id),sessionsExpanded:g.has(E.id),onToggleSessionsExpand:()=>{y(A=>{const j=new Set(A);return j.has(E.id)?j.delete(E.id):j.add(E.id),j})},provisionProgress:i[E.id],onProvision:l,onStop:r,onRemove:d,navigate:u},E.id)})]})}function v4(){return c.jsx(g4,{})}const y4="_section_1ingb_14",b4="_sectionTitle_1ingb_26",_4="_sectionDescription_1ingb_35",x4="_tokenList_1ingb_48",S4="_tokenRow_1ingb_55",T4="_tokenBadge_1ingb_68",k4="_tokenName_1ingb_83",C4="_tokenTarget_1ingb_90",w4="_deleteButton_1ingb_99",E4="_addForm_1ingb_113",A4="_formRow_1ingb_119",N4="_input_1ingb_125",j4="_select_1ingb_155",D4="_addButton_1ingb_187",M4="_emptyStateInfo_1ingb_221",R4="_themeOptions_1ingb_229",B4="_themeOption_1ingb_229",O4="_themeOptionSelected_1ingb_254",I4="_themeOptionHeader_1ingb_259",L4="_themeOptionLabel_1ingb_266",z4="_themeOptionDesc_1ingb_273",U4="_variantToggle_1ingb_279",V4="_variantButton_1ingb_286",H4="_variantActive_1ingb_305",G4="_themeSwatches_1ingb_311",P4="_themeSwatch_1ingb_311",$4="_systemToggle_1ingb_325",F4="_systemToggleHint_1ingb_341",q4="_themeActive_1ingb_348",Y4="_aboutGrid_1ingb_354",K4="_aboutItem_1ingb_360",Z4="_aboutLabel_1ingb_373",X4="_aboutValue_1ingb_379",Q4="_aboutDot_1ingb_387",W4="_aboutDotConnected_1ingb_394",J4="_aboutDotDisconnected_1ingb_398",de={section:y4,sectionTitle:b4,sectionDescription:_4,tokenList:x4,tokenRow:S4,tokenBadge:T4,tokenName:k4,tokenTarget:C4,deleteButton:w4,addForm:E4,formRow:A4,input:N4,select:j4,addButton:D4,emptyStateInfo:M4,themeOptions:R4,themeOption:B4,themeOptionSelected:O4,themeOptionHeader:I4,themeOptionLabel:L4,themeOptionDesc:z4,variantToggle:U4,variantButton:V4,variantActive:H4,themeSwatches:G4,themeSwatch:P4,systemToggle:$4,systemToggleHint:F4,themeActive:q4,aboutGrid:Y4,aboutItem:K4,aboutLabel:Z4,aboutValue:X4,aboutDot:Q4,aboutDotConnected:W4,aboutDotDisconnected:J4},eI=[{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"}]}];function tI(){const{credentialProviders:n,updateCredentialProviders:a}=kt(),i=(l,r)=>{const d={...n};l==="claude"?d.claude=r:d[l]=r,a(d)};return c.jsxs("section",{className:de.section,children:[c.jsx("h3",{className:de.sectionTitle,children:"Credential Providers"}),c.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."}),c.jsx("div",{className:de.tokenList,children:eI.map(l=>c.jsxs("div",{className:de.tokenRow,children:[c.jsx("span",{className:de.tokenName,children:l.label}),c.jsx("span",{className:de.tokenTarget,children:l.description}),c.jsx("select",{className:de.select,value:n[l.key],onChange:r=>i(l.key,r.target.value),children:l.options.map(r=>c.jsx("option",{value:r.value,children:r.label},r.value))})]},l.key))})]})}const nI=[{value:"env_var",label:"Environment Variable"},{value:"file",label:"File"}];function aI(){const{tokens:n,setToken:a,deleteToken:i}=kt(),{showToast:l}=bl(),[r,d]=b.useState(""),[u,p]=b.useState(""),[m,g]=b.useState("env_var"),[y,v]=b.useState(""),[x,S]=b.useState(null),C=k=>{if(k.preventDefault(),!r||!u)return;const A=m==="env_var"?y||r.toUpperCase()+"_TOKEN":"";a(r,u,m,A,m==="file"?y:""),l("Token saved successfully","success"),d(""),p(""),v("")},w=k=>{S(k)},E=()=>{x&&(i(x),l("Token deleted","info")),S(null)};return c.jsxs(c.Fragment,{children:[c.jsx(Cc,{isOpen:x!==null,title:"Delete Token?",description:x?`"${x}" will be permanently removed.`:void 0,onConfirm:E,onCancel:()=>S(null)}),c.jsxs("section",{className:de.section,children:[c.jsx("h3",{className:de.sectionTitle,children:"Tokens"}),c.jsx("p",{className:de.sectionDescription,children:"API tokens are auto-pushed to environments when set or updated. Values are write-only."}),n.length===0?c.jsx("div",{className:de.emptyStateInfo,children:"Add your first API token to enable service integrations."}):c.jsx("div",{className:de.tokenList,children:n.map(k=>c.jsxs("div",{className:de.tokenRow,children:[c.jsx("span",{className:de.tokenBadge,children:k.tokenType}),c.jsx("span",{className:de.tokenName,children:k.name}),c.jsx("span",{className:de.tokenTarget,children:k.tokenType==="env_var"?k.envVar:k.filePath}),c.jsx("button",{className:de.deleteButton,onClick:()=>w(k.name),title:`Delete ${k.name}`,children:"×"})]},k.name))}),c.jsxs("form",{className:de.addForm,onSubmit:C,children:[c.jsxs("div",{className:de.formRow,children:[c.jsx("input",{className:de.input,type:"text",placeholder:"Token name",value:r,onChange:k=>d(k.target.value)}),c.jsx("input",{className:de.input,type:"password",placeholder:"Value",value:u,onChange:k=>p(k.target.value)})]}),c.jsxs("div",{className:de.formRow,children:[c.jsx("select",{className:de.select,value:m,onChange:k=>g(k.target.value),children:nI.map(k=>c.jsx("option",{value:k.value,children:k.label},k.value))}),c.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:y,onChange:k=>v(k.target.value)}),c.jsx("button",{className:de.addButton,type:"submit",children:"Add Token"})]})]})]})]})}function sI(){return c.jsxs(c.Fragment,{children:[c.jsx(tI,{}),c.jsx(aI,{})]})}const iI="_container_xb7ms_1",oI="_header_xb7ms_7",lI="_form_xb7ms_19",rI="_formActions_xb7ms_87",cI="_list_xb7ms_93",uI="_card_xb7ms_99",dI="_active_xb7ms_109",fI="_cardHeader_xb7ms_113",hI="_cardTitle_xb7ms_123",pI="_defaultBadge_xb7ms_129",mI="_cardActions_xb7ms_143",gI="_description_xb7ms_148",vI="_meta_xb7ms_154",yI="_promptDetails_xb7ms_171",bI="_promptText_xb7ms_183",_I="_empty_xb7ms_200",xI="_btnPrimary_xb7ms_206",SI="_btnSecondary_xb7ms_240",TI="_btnSmall_xb7ms_267",kI="_btnDanger_xb7ms_293",CI="_typeToggle_xb7ms_336",wI="_typeBadge_xb7ms_350",EI="_scriptEditor_xb7ms_364",AI="_optional_xb7ms_371",Xe={container:iI,header:oI,form:lI,formActions:rI,list:cI,card:uI,active:dI,cardHeader:fI,cardTitle:hI,defaultBadge:pI,cardActions:mI,description:gI,meta:vI,promptDetails:yI,promptText:bI,empty:_I,btnPrimary:xI,btnSecondary:SI,btnSmall:TI,btnDanger:kI,typeToggle:CI,typeBadge:wI,scriptEditor:EI,optional:AI};function NI(){const{personas:n,createPersona:a,updatePersona:i,deletePersona:l,appDefaultPersonaId:r,setAppDefaultPersonaId:d}=kt(),[u,p]=b.useState(null),[m,g]=b.useState(!1),[y,v]=b.useState(null),[x,S]=b.useState(""),[C,w]=b.useState(""),[E,k]=b.useState(""),[A,j]=b.useState("claude-code"),[V,I]=b.useState("sonnet"),[F,R]=b.useState(0),[B,G]=b.useState("agent"),[ee,ae]=b.useState(""),te=()=>{S(""),w(""),k(""),j("claude-code"),I("sonnet"),R(0),G("agent"),ae("")},fe=()=>{te(),p(null),g(!0)},Q=Y=>{S(Y.name),w(Y.description),k(Y.systemPrompt);const pe=Y.type==="script"?"script":"agent";j(pe==="script"?Y.runtime||"genaiscript":Y.runtime),I(Y.model),R(Y.maxTurns),G(pe),ae(Y.script||""),p(Y),g(!1)},ie=Y=>{G(Y),Y==="script"?j("genaiscript"):A==="genaiscript"&&j("claude-code")},H=Y=>{if(Y.preventDefault(),!!x.trim()){if(B==="script"){if(!ee.trim())return}else if(!E.trim()||!A||!V)return;u?(i(u.id,x,C,E,A,V,F,B,ee),p(null)):(a(x,C,E,A,V,F,B,ee),g(!1)),te()}},M=Y=>{l(Y),v(null),(u==null?void 0:u.id)===Y&&(p(null),te())},J=()=>{p(null),g(!1),te()},le=()=>c.jsxs("form",{onSubmit:H,className:Xe.form,children:[c.jsx("h3",{children:u?"Edit Persona":"Create Persona"}),c.jsxs("div",{className:Xe.typeToggle,"data-testid":"persona-type-toggle",children:[c.jsxs("label",{children:[c.jsx("input",{type:"radio",name:"personaType",value:"agent",checked:B==="agent",onChange:()=>ie("agent")}),"Agent"]}),c.jsxs("label",{children:[c.jsx("input",{type:"radio",name:"personaType",value:"script",checked:B==="script",onChange:()=>ie("script")}),"Script"]})]}),c.jsxs("label",{children:["Name",c.jsx("input",{type:"text",value:x,onChange:Y=>S(Y.target.value),placeholder:B==="script"?"e.g. Nightly Report":"e.g. Frontend Engineer",required:!0})]}),c.jsxs("label",{children:["Description",c.jsx("input",{type:"text",value:C,onChange:Y=>w(Y.target.value),placeholder:"Brief description..."})]}),c.jsxs("label",{children:["Runtime",c.jsx("select",{value:A,onChange:Y=>j(Y.target.value),"data-testid":"persona-runtime-select",children:B==="script"?c.jsx("option",{value:"genaiscript",children:"genaiscript"}):c.jsxs(c.Fragment,{children:[c.jsx("option",{value:"claude-code",children:"claude-code"}),c.jsx("option",{value:"codex",children:"codex"}),c.jsx("option",{value:"copilot",children:"copilot"}),c.jsx("option",{value:"stub",children:"stub"}),c.jsx("option",{value:"claude-code-acp",children:"claude-code-acp (experimental)"}),c.jsx("option",{value:"codex-acp",children:"codex-acp (experimental)"}),c.jsx("option",{value:"copilot-acp",children:"copilot-acp (experimental)"})]})})]}),B==="agent"&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{children:["Model",c.jsx("input",{type:"text",value:V,onChange:Y=>I(Y.target.value),placeholder:"e.g. sonnet"})]}),c.jsxs("label",{children:["Max Turns",c.jsx("input",{type:"number",value:F,onChange:Y=>R(parseInt(Y.target.value,10)||0),min:0})]}),c.jsxs("label",{children:["System Prompt",c.jsx("textarea",{value:E,onChange:Y=>k(Y.target.value),placeholder:"You are a senior frontend engineer...",rows:10,required:!0})]})]}),B==="script"&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{children:["Model ",c.jsx("span",{className:Xe.optional,children:"(optional)"}),c.jsx("input",{type:"text",value:V,onChange:Y=>I(Y.target.value),placeholder:"e.g. sonnet (leave empty for script-only)"})]}),c.jsxs("label",{children:["System Prompt ",c.jsx("span",{className:Xe.optional,children:"(optional)"}),c.jsx("textarea",{value:E,onChange:Y=>k(Y.target.value),placeholder:"Optional context for the script...",rows:4})]}),c.jsxs("label",{children:["Script",c.jsx("textarea",{value:ee,onChange:Y=>ae(Y.target.value),placeholder:`script({ model: "openai:gpt-4o" });
|
|
94
|
-
|
|
95
|
-
const grackle = await host.mcpServer({
|
|
96
|
-
id: "grackle",
|
|
97
|
-
url: env.vars.GRACKLE_MCP_URL,
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
$\`Summarize the current tasks.\`;`,rows:20,className:Xe.scriptEditor,required:!0,"data-testid":"persona-script-editor"})]})]}),c.jsxs("div",{className:Xe.formActions,children:[c.jsx("button",{type:"submit",className:Xe.btnPrimary,children:u?"Save":"Create"}),c.jsx("button",{type:"button",onClick:J,className:Xe.btnSecondary,children:"Cancel"})]})]});return c.jsxs("div",{className:Xe.container,children:[c.jsxs("div",{className:Xe.header,children:[c.jsx("h2",{children:"Personas"}),c.jsx("button",{onClick:fe,className:Xe.btnPrimary,children:"+ New Persona"})]}),(m||u)&&le(),n.length===0&&!m?c.jsx("p",{className:Xe.empty,children:"No personas yet. Create one to get started."}):c.jsx("div",{className:Xe.list,children:n.map(Y=>{const pe=r===Y.id,De=Y.type==="script";return c.jsxs("div",{className:`${Xe.card} ${(u==null?void 0:u.id)===Y.id?Xe.active:""}`,"data-testid":`persona-card-${Y.id}`,children:[c.jsxs("div",{className:Xe.cardHeader,children:[c.jsxs("span",{className:Xe.cardTitle,children:[c.jsx("strong",{children:Y.name}),c.jsx("span",{className:Xe.typeBadge,"data-testid":`persona-type-badge-${Y.id}`,children:De?"Script":"Agent"}),pe&&c.jsx("span",{className:Xe.defaultBadge,"data-testid":`persona-default-badge-${Y.id}`,children:"App Default"})]}),c.jsxs("div",{className:Xe.cardActions,children:[!pe&&c.jsx("button",{onClick:()=>d(Y.id),className:Xe.btnSmall,"data-testid":`persona-set-default-${Y.id}`,title:"Set as app default persona",children:"Set Default"}),c.jsx("button",{onClick:()=>Q(Y),className:Xe.btnSmall,children:"Edit"}),y===Y.id?c.jsxs(c.Fragment,{children:[c.jsx("button",{onClick:()=>M(Y.id),className:Xe.btnDanger,children:"Confirm"}),c.jsx("button",{onClick:()=>v(null),className:Xe.btnSmall,children:"Cancel"})]}):c.jsx("button",{onClick:()=>v(Y.id),className:Xe.btnSmall,children:"Delete"})]})]}),Y.description&&c.jsx("p",{className:Xe.description,children:Y.description}),c.jsxs("div",{className:Xe.meta,children:[Y.runtime&&c.jsxs("span",{children:["Runtime: ",Y.runtime]}),Y.model&&c.jsxs("span",{children:["Model: ",Y.model]}),Y.maxTurns>0&&c.jsxs("span",{children:["Max turns: ",Y.maxTurns]})]}),De?c.jsxs("details",{className:Xe.promptDetails,children:[c.jsx("summary",{children:"Script"}),c.jsx("pre",{className:Xe.promptText,children:Y.script})]}):c.jsxs("details",{className:Xe.promptDetails,children:[c.jsx("summary",{children:"System Prompt"}),c.jsx("pre",{className:Xe.promptText,children:Y.systemPrompt})]})]},Y.id)})})]})}function jI(){return c.jsx(NI,{})}function DI(){const{themeId:n,resolvedThemeId:a,setTheme:i,preferSystem:l,setPreferSystem:r}=bb();return c.jsxs("section",{className:de.section,children:[c.jsx("h3",{className:de.sectionTitle,children:"Appearance"}),c.jsx("p",{className:de.sectionDescription,children:"Choose how Grackle looks across the app."}),c.jsx("div",{className:de.themeOptions,children:vc.filter(d=>!d.hidden).map(d=>{const u=!!(d.variantLightId&&d.variantDarkId),p=u?n===d.id||n===d.variantLightId||n===d.variantDarkId:n===d.id,m=u&&a===d.variantLightId;return c.jsxs("button",{type:"button",className:`${de.themeOption} ${p?de.themeOptionSelected:""}`,"aria-pressed":p,onClick:()=>i(d.id),children:[c.jsxs("span",{className:de.themeOptionHeader,children:[c.jsxs("span",{children:[c.jsx("span",{className:de.themeOptionLabel,children:d.label}),c.jsx("span",{className:de.themeOptionDesc,children:d.description})]}),u&&c.jsxs("span",{className:de.variantToggle,children:[c.jsx("span",{role:"button",tabIndex:0,className:`${de.variantButton} ${p&&m?de.variantActive:""}`,onClick:g=>{g.stopPropagation(),r(!1),i(d.variantLightId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(d.variantLightId))},"aria-label":"Light variant","aria-pressed":p&&m,children:"☼"}),c.jsx("span",{role:"button",tabIndex:0,className:`${de.variantButton} ${p&&!m?de.variantActive:""}`,onClick:g=>{g.stopPropagation(),r(!1),i(d.variantDarkId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(d.variantDarkId))},"aria-label":"Dark variant","aria-pressed":p&&!m,children:"☾"})]})]}),d.swatches&&c.jsx("span",{className:de.themeSwatches,children:d.swatches.map((g,y)=>c.jsx("span",{className:de.themeSwatch,style:{background:g}},y))})]},d.id)})}),c.jsxs("label",{className:de.systemToggle,children:[c.jsx("input",{type:"checkbox",checked:l,onChange:d=>r(d.target.checked)}),c.jsx("span",{children:"Match system light/dark preference"})]}),c.jsx("p",{className:de.systemToggleHint,children:"Automatically switches between light and dark variants when available."}),c.jsxs("p",{className:de.themeActive,children:["Active theme: ",c.jsx("strong",{children:a})]})]})}function MI(){return c.jsx(DI,{})}function RI(){const{connected:n,environments:a,sessions:i}=kt(),l=a.filter(u=>u.status==="connected").length,r=a.length,d=i.filter(u=>["running","idle"].includes(u.status)).length;return c.jsxs("section",{className:de.section,"data-testid":"about-panel",children:[c.jsx("h3",{className:de.sectionTitle,children:"About"}),c.jsx("p",{className:de.sectionDescription,children:"Connection status and application information."}),c.jsxs("div",{className:de.aboutGrid,children:[c.jsxs("div",{className:de.aboutItem,children:[c.jsx("span",{className:de.aboutLabel,children:"Connection"}),c.jsxs("span",{className:de.aboutValue,children:[c.jsx("span",{className:`${de.aboutDot} ${n?de.aboutDotConnected:de.aboutDotDisconnected}`}),n?"Connected":"Disconnected"]})]}),c.jsxs("div",{className:de.aboutItem,children:[c.jsx("span",{className:de.aboutLabel,children:"Environments"}),c.jsxs("span",{className:de.aboutValue,children:[l,"/",r," connected"]})]}),c.jsxs("div",{className:de.aboutItem,children:[c.jsx("span",{className:de.aboutLabel,children:"Active Sessions"}),c.jsx("span",{className:de.aboutValue,children:d})]}),c.jsxs("div",{className:de.aboutItem,children:[c.jsx("span",{className:de.aboutLabel,children:"Version"}),c.jsx("span",{className:de.aboutValue,children:"0.52.3"})]})]})]})}function BI(){return c.jsx(RI,{})}const OI="_wizard_1260s_1",II="_container_1260s_10",LI="_stepContent_1260s_19",zI="_logoArea_1260s_28",UI="_logoImage_1260s_32",VI="_heading_1260s_41",HI="_tagline_1260s_49",GI="_subtitle_1260s_56",PI="_featureList_1260s_64",$I="_runtimeGrid_1260s_89",FI="_runtimeCard_1260s_101",qI="_runtimeName_1260s_133",YI="_runtimeDescription_1260s_139",KI="_buttonRow_1260s_144",ZI="_primaryButton_1260s_151",XI="_ghostButton_1260s_185",QI="_dots_1260s_213",WI="_dot_1260s_213",rt={wizard:OI,container:II,stepContent:LI,logoArea:zI,logoImage:UI,heading:VI,tagline:HI,subtitle:GI,featureList:PI,runtimeGrid:$I,runtimeCard:FI,runtimeName:qI,runtimeDescription:YI,buttonRow:KI,primaryButton:ZI,ghostButton:XI,dots:QI,dot:WI};function JI({onNext:n}){return c.jsxs("div",{className:rt.stepContent,"data-testid":"setup-welcome",children:[c.jsx("div",{className:rt.logoArea,children:c.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:rt.logoImage})}),c.jsx("h1",{className:rt.heading,children:"Welcome to Grackle"}),c.jsx("p",{className:rt.tagline,children:"Multi-agent orchestration for software teams"}),c.jsx("button",{type:"button",className:rt.primaryButton,onClick:n,"data-testid":"setup-get-started",children:"Get Started"})]})}function e8({onNext:n,onBack:a}){return c.jsxs("div",{className:rt.stepContent,"data-testid":"setup-about",children:[c.jsx("h2",{className:rt.heading,children:"What is Grackle?"}),c.jsxs("ul",{className:rt.featureList,children:[c.jsx("li",{children:"Run Claude, Copilot, and Codex agents side by side"}),c.jsx("li",{children:"Provision and control dev environments — SSH, Codespaces, or local"}),c.jsx("li",{children:"Organize work into workspaces with agent-executable tasks"}),c.jsx("li",{children:"Customize agent behavior with personas, tools, and MCP servers"}),c.jsx("li",{children:"Live-stream agent sessions with full terminal replay"})]}),c.jsxs("div",{className:rt.buttonRow,children:[c.jsx("button",{type:"button",className:rt.ghostButton,onClick:a,children:"Back"}),c.jsx("button",{type:"button",className:rt.primaryButton,onClick:n,"data-testid":"setup-about-next",children:"Next"})]})]})}const t8=[{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"}];function n8({currentRuntime:n,onFinish:a,onBack:i,finishDisabled:l}){const[r,d]=b.useState(n||"claude-code");return b.useEffect(()=>{n&&d(n)},[n]),c.jsxs("div",{className:rt.stepContent,"data-testid":"setup-runtime",children:[c.jsx("h2",{className:rt.heading,children:"Choose Your Runtime"}),c.jsx("p",{className:rt.subtitle,children:"Select the primary agent runtime for your workspace. You can change this later."}),c.jsx("div",{className:rt.runtimeGrid,children:t8.map(u=>c.jsxs("button",{type:"button",className:rt.runtimeCard,"data-selected":r===u.id,"aria-pressed":r===u.id,"data-testid":`runtime-card-${u.id}`,onClick:()=>d(u.id),children:[c.jsx("span",{className:rt.runtimeName,children:u.name}),c.jsx("span",{className:rt.runtimeDescription,children:u.description})]},u.id))}),c.jsxs("div",{className:rt.buttonRow,children:[c.jsx("button",{type:"button",className:rt.ghostButton,onClick:i,children:"Back"}),c.jsx("button",{type:"button",className:rt.primaryButton,onClick:()=>a(r),disabled:l,"data-testid":"setup-finish",children:"Finish"})]})]})}const a8=3,q0={"claude-code":"sonnet",copilot:"gpt-4o",codex:"o3"};function s8(){const{personas:n,updatePersona:a,completeOnboarding:i,onboardingCompleted:l}=kt(),r=cn(),[d,u]=b.useState(0),p=n.find(g=>g.id==="claude-code"),m=b.useCallback(g=>{if(p&&g!==p.runtime){const v=q0[g]??"sonnet";a(p.id,void 0,void 0,void 0,g,v)}const y=n.find(v=>v.id===k0);if(y&&g!==y.runtime){const v=q0[g]??"sonnet";a(k0,void 0,void 0,void 0,g,v)}i(),r("/",{replace:!0})},[p,n,a,i,r]);return l===!0?c.jsx(al,{to:"/",replace:!0}):c.jsx("div",{className:rt.wizard,"data-testid":"setup-wizard",children:c.jsxs("div",{className:rt.container,children:[c.jsx(_n,{mode:"wait",children:c.jsxs(yt.div,{initial:{opacity:0,x:40},animate:{opacity:1,x:0},exit:{opacity:0,x:-40},transition:{duration:.2,ease:"easeInOut"},children:[d===0&&c.jsx(JI,{onNext:()=>u(1)}),d===1&&c.jsx(e8,{onNext:()=>u(2),onBack:()=>u(0)}),d===2&&c.jsx(n8,{currentRuntime:(p==null?void 0:p.runtime)??"claude-code",onFinish:m,onBack:()=>u(1),finishDisabled:!p})]},d)}),c.jsx("div",{className:rt.dots,children:Array.from({length:a8},(g,y)=>c.jsx("span",{className:rt.dot,"data-active":y===d},y))})]})})}const i8="_root_zndgp_1",o8="_body_zndgp_7",l8="_main_zndgp_19",r8="_sidebarWrapper_zndgp_26",c8="_overlay_zndgp_51",Qo={root:i8,body:o8,main:l8,sidebarWrapper:r8,overlay:c8},u8=typeof window<"u"&&new URLSearchParams(window.location.search).has("mock");function d8(){const{lastSpawnedId:n,environments:a,connected:i,onboardingCompleted:l}=kt(),{showToast:r}=bl();TR(a,r);const d=cn(),u=qt(),[p,m]=b.useState(!1),g=b.useCallback(()=>m(y=>!y),[]);return b.useEffect(()=>{m(!1)},[u.pathname]),b.useEffect(()=>{if(!p)return;const y=v=>{v.key==="Escape"&&m(!1)};return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[p]),b.useEffect(()=>{n&&!u.pathname.includes("/tasks/")&&d(nh(n),{replace:!0})},[n,d,u.pathname]),i&&l===!1?c.jsx(al,{to:"/setup",replace:!0}):c.jsxs("div",{className:Qo.root,children:[c.jsx(DC,{onToggleSidebar:g,sidebarOpen:p}),c.jsx(LC,{}),c.jsxs("div",{className:Qo.body,children:[c.jsx("div",{className:Qo.sidebarWrapper,"data-sidebar-open":p,children:c.jsx($M,{})}),p&&c.jsx("div",{className:Qo.overlay,"data-testid":"drawer-overlay",onClick:()=>m(!1)}),c.jsxs("div",{className:Qo.main,children:[c.jsx(lb,{}),c.jsx(cR,{})]})]}),c.jsx(SR,{})]})}function f8(){return c.jsxs(ik,{children:[c.jsx(nt,{path:"setup",element:c.jsx(s8,{})}),c.jsxs(nt,{element:c.jsx(d8,{}),children:[c.jsx(nt,{index:!0,element:c.jsx(XB,{})}),c.jsx(nt,{path:"chat",element:c.jsx(mO,{})}),c.jsx(nt,{path:"tasks",element:c.jsx(KB,{})}),c.jsx(nt,{path:"tasks/new",element:c.jsx(f5,{})}),c.jsx(nt,{path:"tasks/:taskId",element:c.jsx(Oi,{})}),c.jsx(nt,{path:"tasks/:taskId/stream",element:c.jsx(Oi,{})}),c.jsx(nt,{path:"tasks/:taskId/findings",element:c.jsx(Oi,{})}),c.jsx(nt,{path:"tasks/:taskId/edit",element:c.jsx(G0,{})}),c.jsx(nt,{path:"workspaces",element:c.jsx(ZB,{})}),c.jsx(nt,{path:"workspaces/:workspaceId",element:c.jsx($6,{})}),c.jsx(nt,{path:"workspaces/:workspaceId/tasks/:taskId",element:c.jsx(Oi,{})}),c.jsx(nt,{path:"workspaces/:workspaceId/tasks/:taskId/stream",element:c.jsx(Oi,{})}),c.jsx(nt,{path:"workspaces/:workspaceId/tasks/:taskId/findings",element:c.jsx(Oi,{})}),c.jsx(nt,{path:"workspaces/:workspaceId/tasks/:taskId/edit",element:c.jsx(G0,{})}),c.jsx(nt,{path:"sessions/new",element:c.jsx(SO,{})}),c.jsx(nt,{path:"sessions/:sessionId",element:c.jsx(CO,{})}),c.jsx(nt,{path:"environments/new",element:c.jsx(N5,{})}),c.jsxs(nt,{path:"settings",element:c.jsx(B5,{}),children:[c.jsx(nt,{index:!0,element:c.jsx(al,{to:"environments",replace:!0})}),c.jsx(nt,{path:"environments",element:c.jsx(v4,{})}),c.jsx(nt,{path:"credentials",element:c.jsx(sI,{})}),c.jsx(nt,{path:"tokens",element:c.jsx(al,{to:"../credentials",replace:!0})}),c.jsx(nt,{path:"personas",element:c.jsx(jI,{})}),c.jsx(nt,{path:"appearance",element:c.jsx(MI,{})}),c.jsx(nt,{path:"about",element:c.jsx(BI,{})})]}),c.jsx(nt,{path:"*",element:c.jsx(al,{to:"/",replace:!0})})]})]})}const h8=1e4;function p8(){const{onboardingCompleted:n}=kt(),[a,i]=b.useState(!1);b.useEffect(()=>{if(n!==void 0)return;const r=setTimeout(()=>i(!0),h8);return()=>clearTimeout(r)},[n]);const l=n===void 0&&!a;return c.jsx(_n,{mode:"wait",children:l?c.jsx(yt.div,{initial:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:c.jsx(PD,{})},"splash"):c.jsx(yt.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.25},style:{minHeight:"100vh"},children:c.jsx(jk,{children:c.jsx(f8,{})})},"app")})}function m8(){const n=u8?mC:oC;return c.jsx(xC,{children:c.jsx(vC,{children:c.jsx(n,{children:c.jsx(p8,{})})})})}K1.createRoot(document.getElementById("root")).render(c.jsx(b.StrictMode,{children:c.jsx(m8,{})}));
|