@grackle-ai/web 0.72.5 → 0.73.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,112 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/KnowledgePage-D37ybuo_.js","assets/markdown-gcy1Jmzi.js","assets/dagview-BA5TtMAQ.js","assets/KnowledgePage-DMqJ4jlP.css"])))=>i.map(i=>d[i]);
2
- import{r as ZS,a as x,j as c,v as XS,b as QS,t as Gr,i as WS,f as JS,M as th,c as nh}from"./markdown-gcy1Jmzi.js";import{r as eT,d as Zv,H as Xv,P as Qv,i as tT,B as nT,a as aT,C as sT,M as iT}from"./dagview-BA5TtMAQ.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"]'))o(r);new MutationObserver(r=>{for(const u of r)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function i(r){const u={};return r.integrity&&(u.integrity=r.integrity),r.referrerPolicy&&(u.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?u.credentials="include":r.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(r){if(r.ep)return;r.ep=!0;const u=i(r);fetch(r.href,u)}})();var Yd={exports:{}},Ko={},Zd={exports:{}},Xd={};/**
3
- * @license React
4
- * scheduler.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */var Wv;function oT(){return Wv||(Wv=1,(function(t){function a(I,Y){var oe=I.length;I.push(Y);e:for(;0<oe;){var G=oe-1>>>1,O=I[G];if(0<r(O,Y))I[G]=Y,I[oe]=O,oe=G;else break e}}function i(I){return I.length===0?null:I[0]}function o(I){if(I.length===0)return null;var Y=I[0],oe=I.pop();if(oe!==Y){I[0]=oe;e:for(var G=0,O=I.length,ie=O>>>1;G<ie;){var xe=2*(G+1)-1,re=I[xe],Ke=xe+1,yt=I[Ke];if(0>r(re,oe))Ke<O&&0>r(yt,re)?(I[G]=yt,I[Ke]=oe,G=Ke):(I[G]=re,I[xe]=oe,G=xe);else if(Ke<O&&0>r(yt,oe))I[G]=yt,I[Ke]=oe,G=Ke;else break e}}return Y}function r(I,Y){var oe=I.sortIndex-Y.sortIndex;return oe!==0?oe:I.id-Y.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var d=Date,p=d.now();t.unstable_now=function(){return d.now()-p}}var m=[],g=[],v=1,y=null,b=3,S=!1,T=!1,E=!1,N=!1,C=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function R(I){for(var Y=i(g);Y!==null;){if(Y.callback===null)o(g);else if(Y.startTime<=I)o(g),Y.sortIndex=Y.expirationTime,a(m,Y);else break;Y=i(g)}}function w(I){if(E=!1,R(I),!T)if(i(m)!==null)T=!0,F||(F=!0,te());else{var Y=i(g);Y!==null&&ne(w,Y.startTime-I)}}var F=!1,H=-1,B=5,q=-1;function X(){return N?!0:!(t.unstable_now()-q<B)}function ae(){if(N=!1,F){var I=t.unstable_now();q=I;var Y=!0;try{e:{T=!1,E&&(E=!1,j(H),H=-1),S=!0;var oe=b;try{t:{for(R(I),y=i(m);y!==null&&!(y.expirationTime>I&&X());){var G=y.callback;if(typeof G=="function"){y.callback=null,b=y.priorityLevel;var O=G(y.expirationTime<=I);if(I=t.unstable_now(),typeof O=="function"){y.callback=O,R(I),Y=!0;break t}y===i(m)&&o(m),R(I)}else o(m);y=i(m)}if(y!==null)Y=!0;else{var ie=i(g);ie!==null&&ne(w,ie.startTime-I),Y=!1}}break e}finally{y=null,b=oe,S=!1}Y=void 0}}finally{Y?te():F=!1}}}var te;if(typeof D=="function")te=function(){D(ae)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,z=ee.port2;ee.port1.onmessage=ae,te=function(){z.postMessage(null)}}else te=function(){C(ae,0)};function ne(I,Y){H=C(function(){I(t.unstable_now())},Y)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(I){I.callback=null},t.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<I?Math.floor(1e3/I):5},t.unstable_getCurrentPriorityLevel=function(){return b},t.unstable_next=function(I){switch(b){case 1:case 2:case 3:var Y=3;break;default:Y=b}var oe=b;b=Y;try{return I()}finally{b=oe}},t.unstable_requestPaint=function(){N=!0},t.unstable_runWithPriority=function(I,Y){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var oe=b;b=I;try{return Y()}finally{b=oe}},t.unstable_scheduleCallback=function(I,Y,oe){var G=t.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?G+oe:G):oe=G,I){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=oe+O,I={id:v++,callback:Y,priorityLevel:I,startTime:oe,expirationTime:O,sortIndex:-1},oe>G?(I.sortIndex=oe,a(g,I),i(m)===null&&I===i(g)&&(E?(j(H),H=-1):E=!0,ne(w,oe-G))):(I.sortIndex=O,a(m,I),T||S||(T=!0,F||(F=!0,te()))),I},t.unstable_shouldYield=X,t.unstable_wrapCallback=function(I){var Y=b;return function(){var oe=b;b=Y;try{return I.apply(this,arguments)}finally{b=oe}}}})(Xd)),Xd}var Jv;function lT(){return Jv||(Jv=1,Zd.exports=oT()),Zd.exports}/**
11
- * @license React
12
- * react-dom-client.production.js
13
- *
14
- * Copyright (c) Meta Platforms, Inc. and affiliates.
15
- *
16
- * This source code is licensed under the MIT license found in the
17
- * LICENSE file in the root directory of this source tree.
18
- */var ey;function rT(){if(ey)return Ko;ey=1;var t=lT(),a=ZS(),i=eT();function o(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var n=e,s=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(s=n.return),e=n.return;while(e)}return n.tag===3?s:null}function d(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function p(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function m(e){if(u(e)!==e)throw Error(o(188))}function g(e){var n=e.alternate;if(!n){if(n=u(e),n===null)throw Error(o(188));return n!==e?null:e}for(var s=e,l=n;;){var f=s.return;if(f===null)break;var h=f.alternate;if(h===null){if(l=f.return,l!==null){s=l;continue}break}if(f.child===h.child){for(h=f.child;h;){if(h===s)return m(f),e;if(h===l)return m(f),n;h=h.sibling}throw Error(o(188))}if(s.return!==l.return)s=f,l=h;else{for(var _=!1,k=f.child;k;){if(k===s){_=!0,s=f,l=h;break}if(k===l){_=!0,l=f,s=h;break}k=k.sibling}if(!_){for(k=h.child;k;){if(k===s){_=!0,s=h,l=f;break}if(k===l){_=!0,l=h,s=f;break}k=k.sibling}if(!_)throw Error(o(189))}}if(s.alternate!==l)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?e:n}function v(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=v(e),n!==null)return n;e=e.sibling}return null}var y=Object.assign,b=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),D=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),X=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 ee=Symbol.for("react.client.reference");function z(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ee?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case C:return"Profiler";case N:return"StrictMode";case w:return"Suspense";case F:return"SuspenseList";case q:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case D:return e.displayName||"Context";case j:return(e._context.displayName||"Context")+".Consumer";case R:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case H:return n=e.displayName||null,n!==null?n:z(e.type)||"Memo";case B:n=e._payload,e=e._init;try{return z(e(n))}catch{}}return null}var ne=Array.isArray,I=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},G=[],O=-1;function ie(e){return{current:e}}function xe(e){0>O||(e.current=G[O],G[O]=null,O--)}function re(e,n){O++,G[O]=e.current,e.current=n}var Ke=ie(null),yt=ie(null),fe=ie(null),Rt=ie(null);function mn(e,n){switch(re(fe,n),re(yt,e),re(Ke,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?yv(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=yv(n),e=bv(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}xe(Ke),re(Ke,e)}function Rn(){xe(Ke),xe(yt),xe(fe)}function Ln(e){e.memoizedState!==null&&re(Rt,e);var n=Ke.current,s=bv(n,e.type);n!==s&&(re(yt,e),re(Ke,s))}function Te(e){yt.current===e&&(xe(Ke),xe(yt)),Rt.current===e&&(xe(Rt),Go._currentValue=oe)}var pt,Hs;function Un(e){if(pt===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);pt=n&&n[1]||"",Hs=-1<s.stack.indexOf(`
19
- at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
20
- `+pt+e+Hs}var Ps=!1;function Gs(e,n){if(!e||Ps)return"";Ps=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(n){var J=function(){throw Error()};if(Object.defineProperty(J.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(J,[])}catch(K){var $=K}Reflect.construct(e,[],J)}else{try{J.call()}catch(K){$=K}e.call(J.prototype)}}else{try{throw Error()}catch(K){$=K}(J=e())&&typeof J.catch=="function"&&J.catch(function(){})}}catch(K){if(K&&$&&typeof K.stack=="string")return[K.stack,$.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=l.DetermineComponentFrameRoot(),_=h[0],k=h[1];if(_&&k){var A=_.split(`
21
- `),P=k.split(`
22
- `);for(f=l=0;l<A.length&&!A[l].includes("DetermineComponentFrameRoot");)l++;for(;f<P.length&&!P[f].includes("DetermineComponentFrameRoot");)f++;if(l===A.length||f===P.length)for(l=A.length-1,f=P.length-1;1<=l&&0<=f&&A[l]!==P[f];)f--;for(;1<=l&&0<=f;l--,f--)if(A[l]!==P[f]){if(l!==1||f!==1)do if(l--,f--,0>f||A[l]!==P[f]){var Z=`
23
- `+A[l].replace(" at new "," at ");return e.displayName&&Z.includes("<anonymous>")&&(Z=Z.replace("<anonymous>",e.displayName)),Z}while(1<=l&&0<=f);break}}}finally{Ps=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?Un(s):""}function Nl(e,n){switch(e.tag){case 26:case 27:case 5:return Un(e.type);case 16:return Un("Lazy");case 13:return e.child!==n&&n!==null?Un("Suspense Fallback"):Un("Suspense");case 19:return Un("SuspenseList");case 0:case 15:return Gs(e.type,!1);case 11:return Gs(e.type.render,!1);case 1:return Gs(e.type,!0);case 31:return Un("Activity");default:return""}}function eo(e){try{var n="",s=null;do n+=Nl(e,s),s=e,e=e.return;while(e);return n}catch(l){return`
24
- Error generating stack: `+l.message+`
25
- `+l.stack}}var $s=Object.prototype.hasOwnProperty,Fs=t.unstable_scheduleCallback,qs=t.unstable_cancelCallback,jl=t.unstable_shouldYield,wl=t.unstable_requestPaint,zt=t.unstable_now,Bc=t.unstable_getCurrentPriorityLevel,W=t.unstable_ImmediatePriority,le=t.unstable_UserBlockingPriority,ce=t.unstable_NormalPriority,_e=t.unstable_LowPriority,ge=t.unstable_IdlePriority,Qe=t.log,Ee=t.unstable_setDisableYieldValue,Je=null,je=null;function nt(e){if(typeof Qe=="function"&&Ee(e),je&&typeof je.setStrictMode=="function")try{je.setStrictMode(Je,e)}catch{}}var Pe=Math.clz32?Math.clz32:Vt,Gt=Math.log,tn=Math.LN2;function Vt(e){return e>>>=0,e===0?32:31-(Gt(e)/tn|0)|0}var ka=256,gn=262144,Ca=4194304;function ls(e){var n=e&42;if(n!==0)return n;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Al(e,n,s){var l=e.pendingLanes;if(l===0)return 0;var f=0,h=e.suspendedLanes,_=e.pingedLanes;e=e.warmLanes;var k=l&134217727;return k!==0?(l=k&~h,l!==0?f=ls(l):(_&=k,_!==0?f=ls(_):s||(s=k&~e,s!==0&&(f=ls(s))))):(k=l&~h,k!==0?f=ls(k):_!==0?f=ls(_):s||(s=l&~e,s!==0&&(f=ls(s)))),f===0?0:n!==0&&n!==f&&(n&h)===0&&(h=f&-f,s=n&-n,h>=s||h===32&&(s&4194048)!==0)?n:f}function to(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function I_(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Jh(){var e=Ca;return Ca<<=1,(Ca&62914560)===0&&(Ca=4194304),e}function Ic(e){for(var n=[],s=0;31>s;s++)n.push(e);return n}function no(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function L_(e,n,s,l,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 k=e.entanglements,A=e.expirationTimes,P=e.hiddenUpdates;for(s=_&~s;0<s;){var Z=31-Pe(s),J=1<<Z;k[Z]=0,A[Z]=-1;var $=P[Z];if($!==null)for(P[Z]=null,Z=0;Z<$.length;Z++){var K=$[Z];K!==null&&(K.lane&=-536870913)}s&=~J}l!==0&&ep(e,l,0),h!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=h&~(_&~n))}function ep(e,n,s){e.pendingLanes|=n,e.suspendedLanes&=~n;var l=31-Pe(n);e.entangledLanes|=n,e.entanglements[l]=e.entanglements[l]|1073741824|s&261930}function tp(e,n){var s=e.entangledLanes|=n;for(e=e.entanglements;s;){var l=31-Pe(s),f=1<<l;f&n|e[l]&n&&(e[l]|=n),s&=~f}}function np(e,n){var s=n&-n;return s=(s&42)!==0?1:Lc(s),(s&(e.suspendedLanes|n))!==0?0:s}function Lc(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 Uc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ap(){var e=Y.p;return e!==0?e:(e=window.event,e===void 0?32:Pv(e.type))}function sp(e,n){var s=Y.p;try{return Y.p=e,n()}finally{Y.p=s}}var Ea=Math.random().toString(36).slice(2),Mt="__reactFiber$"+Ea,Kt="__reactProps$"+Ea,Ks="__reactContainer$"+Ea,zc="__reactEvents$"+Ea,U_="__reactListeners$"+Ea,z_="__reactHandles$"+Ea,ip="__reactResources$"+Ea,ao="__reactMarker$"+Ea;function Vc(e){delete e[Mt],delete e[Kt],delete e[zc],delete e[U_],delete e[z_]}function Ys(e){var n=e[Mt];if(n)return n;for(var s=e.parentNode;s;){if(n=s[Ks]||s[Mt]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(e=Ev(e);e!==null;){if(s=e[Mt])return s;e=Ev(e)}return n}e=s,s=e.parentNode}return null}function Zs(e){if(e=e[Mt]||e[Ks]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function so(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(o(33))}function Xs(e){var n=e[ip];return n||(n=e[ip]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function wt(e){e[ao]=!0}var op=new Set,lp={};function rs(e,n){Qs(e,n),Qs(e+"Capture",n)}function Qs(e,n){for(lp[e]=n,e=0;e<n.length;e++)op.add(n[e])}var V_=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]*$"),rp={},cp={};function H_(e){return $s.call(cp,e)?!0:$s.call(rp,e)?!1:V_.test(e)?cp[e]=!0:(rp[e]=!0,!1)}function Dl(e,n,s){if(H_(n))if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var l=n.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+s)}}function Rl(e,n,s){if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+s)}}function Wn(e,n,s,l){if(l===null)e.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(n,s,""+l)}}function vn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function up(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function P_(e,n,s){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var f=l.get,h=l.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return f.call(this)},set:function(_){s=""+_,h.call(this,_)}}),Object.defineProperty(e,n,{enumerable:l.enumerable}),{getValue:function(){return s},setValue:function(_){s=""+_},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Hc(e){if(!e._valueTracker){var n=up(e)?"checked":"value";e._valueTracker=P_(e,n,""+e[n])}}function dp(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var s=n.getValue(),l="";return e&&(l=up(e)?e.checked?"true":"false":e.value),e=l,e!==s?(n.setValue(e),!0):!1}function Ml(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 G_=/[\n"\\]/g;function yn(e){return e.replace(G_,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Pc(e,n,s,l,f,h,_,k){e.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.type=_:e.removeAttribute("type"),n!=null?_==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+vn(n)):e.value!==""+vn(n)&&(e.value=""+vn(n)):_!=="submit"&&_!=="reset"||e.removeAttribute("value"),n!=null?Gc(e,_,vn(n)):s!=null?Gc(e,_,vn(s)):l!=null&&e.removeAttribute("value"),f==null&&h!=null&&(e.defaultChecked=!!h),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?e.name=""+vn(k):e.removeAttribute("name")}function fp(e,n,s,l,f,h,_,k){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),n!=null||s!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){Hc(e);return}s=s!=null?""+vn(s):"",n=n!=null?""+vn(n):s,k||n===e.value||(e.value=n),e.defaultValue=n}l=l??f,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=k?e.checked:!!l,e.defaultChecked=!!l,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(e.name=_),Hc(e)}function Gc(e,n,s){n==="number"&&Ml(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function Ws(e,n,s,l){if(e=e.options,n){n={};for(var f=0;f<s.length;f++)n["$"+s[f]]=!0;for(s=0;s<e.length;s++)f=n.hasOwnProperty("$"+e[s].value),e[s].selected!==f&&(e[s].selected=f),f&&l&&(e[s].defaultSelected=!0)}else{for(s=""+vn(s),n=null,f=0;f<e.length;f++){if(e[f].value===s){e[f].selected=!0,l&&(e[f].defaultSelected=!0);return}n!==null||e[f].disabled||(n=e[f])}n!==null&&(n.selected=!0)}}function hp(e,n,s){if(n!=null&&(n=""+vn(n),n!==e.value&&(e.value=n),s==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=s!=null?""+vn(s):""}function pp(e,n,s,l){if(n==null){if(l!=null){if(s!=null)throw Error(o(92));if(ne(l)){if(1<l.length)throw Error(o(93));l=l[0]}s=l}s==null&&(s=""),n=s}s=vn(n),e.defaultValue=s,l=e.textContent,l===s&&l!==""&&l!==null&&(e.value=l),Hc(e)}function Js(e,n){if(n){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=n;return}}e.textContent=n}var $_=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 mp(e,n,s){var l=n.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?l?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":l?e.setProperty(n,s):typeof s!="number"||s===0||$_.has(n)?n==="float"?e.cssFloat=s:e[n]=(""+s).trim():e[n]=s+"px"}function gp(e,n,s){if(n!=null&&typeof n!="object")throw Error(o(62));if(e=e.style,s!=null){for(var l in s)!s.hasOwnProperty(l)||n!=null&&n.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var f in n)l=n[f],n.hasOwnProperty(f)&&s[f]!==l&&mp(e,f,l)}else for(var h in n)n.hasOwnProperty(h)&&mp(e,h,n[h])}function $c(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 F_=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"]]),q_=/^[\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 Ol(e){return q_.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Jn(){}var Fc=null;function qc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ei=null,ti=null;function vp(e){var n=Zs(e);if(n&&(e=n.stateNode)){var s=e[Kt]||null;e:switch(e=n.stateNode,n.type){case"input":if(Pc(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),n=s.name,s.type==="radio"&&n!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+yn(""+n)+'"][type="radio"]'),n=0;n<s.length;n++){var l=s[n];if(l!==e&&l.form===e.form){var f=l[Kt]||null;if(!f)throw Error(o(90));Pc(l,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<s.length;n++)l=s[n],l.form===e.form&&dp(l)}break e;case"textarea":hp(e,s.value,s.defaultValue);break e;case"select":n=s.value,n!=null&&Ws(e,!!s.multiple,n,!1)}}}var Kc=!1;function yp(e,n,s){if(Kc)return e(n,s);Kc=!0;try{var l=e(n);return l}finally{if(Kc=!1,(ei!==null||ti!==null)&&(_r(),ei&&(n=ei,e=ti,ti=ei=null,vp(n),e)))for(n=0;n<e.length;n++)vp(e[n])}}function io(e,n){var s=e.stateNode;if(s===null)return null;var l=s[Kt]||null;if(l===null)return null;s=l[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(o(231,n,typeof s));return s}var ea=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Yc=!1;if(ea)try{var oo={};Object.defineProperty(oo,"passive",{get:function(){Yc=!0}}),window.addEventListener("test",oo,oo),window.removeEventListener("test",oo,oo)}catch{Yc=!1}var Na=null,Zc=null,Bl=null;function bp(){if(Bl)return Bl;var e,n=Zc,s=n.length,l,f="value"in Na?Na.value:Na.textContent,h=f.length;for(e=0;e<s&&n[e]===f[e];e++);var _=s-e;for(l=1;l<=_&&n[s-l]===f[h-l];l++);return Bl=f.slice(e,1<l?1-l:void 0)}function Il(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Ll(){return!0}function xp(){return!1}function Yt(e){function n(s,l,f,h,_){this._reactName=s,this._targetInst=f,this.type=l,this.nativeEvent=h,this.target=_,this.currentTarget=null;for(var k in e)e.hasOwnProperty(k)&&(s=e[k],this[k]=s?s(h):h[k]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Ll:xp,this.isPropagationStopped=xp,this}return y(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Ll)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Ll)},persist:function(){},isPersistent:Ll}),n}var cs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ul=Yt(cs),lo=y({},cs,{view:0,detail:0}),K_=Yt(lo),Xc,Qc,ro,zl=y({},lo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Jc,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!==ro&&(ro&&e.type==="mousemove"?(Xc=e.screenX-ro.screenX,Qc=e.screenY-ro.screenY):Qc=Xc=0,ro=e),Xc)},movementY:function(e){return"movementY"in e?e.movementY:Qc}}),_p=Yt(zl),Y_=y({},zl,{dataTransfer:0}),Z_=Yt(Y_),X_=y({},lo,{relatedTarget:0}),Wc=Yt(X_),Q_=y({},cs,{animationName:0,elapsedTime:0,pseudoElement:0}),W_=Yt(Q_),J_=y({},cs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),e1=Yt(J_),t1=y({},cs,{data:0}),Sp=Yt(t1),n1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},a1={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"},s1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function i1(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=s1[e])?!!n[e]:!1}function Jc(){return i1}var o1=y({},lo,{key:function(e){if(e.key){var n=n1[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Il(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?a1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Jc,charCode:function(e){return e.type==="keypress"?Il(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Il(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),l1=Yt(o1),r1=y({},zl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Tp=Yt(r1),c1=y({},lo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Jc}),u1=Yt(c1),d1=y({},cs,{propertyName:0,elapsedTime:0,pseudoElement:0}),f1=Yt(d1),h1=y({},zl,{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}),p1=Yt(h1),m1=y({},cs,{newState:0,oldState:0}),g1=Yt(m1),v1=[9,13,27,32],eu=ea&&"CompositionEvent"in window,co=null;ea&&"documentMode"in document&&(co=document.documentMode);var y1=ea&&"TextEvent"in window&&!co,kp=ea&&(!eu||co&&8<co&&11>=co),Cp=" ",Ep=!1;function Np(e,n){switch(e){case"keyup":return v1.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ni=!1;function b1(e,n){switch(e){case"compositionend":return jp(n);case"keypress":return n.which!==32?null:(Ep=!0,Cp);case"textInput":return e=n.data,e===Cp&&Ep?null:e;default:return null}}function x1(e,n){if(ni)return e==="compositionend"||!eu&&Np(e,n)?(e=bp(),Bl=Zc=Na=null,ni=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return kp&&n.locale!=="ko"?null:n.data;default:return null}}var _1={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 wp(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!_1[e.type]:n==="textarea"}function Ap(e,n,s,l){ei?ti?ti.push(l):ti=[l]:ei=l,n=jr(n,"onChange"),0<n.length&&(s=new Ul("onChange","change",null,s,l),e.push({event:s,listeners:n}))}var uo=null,fo=null;function S1(e){fv(e,0)}function Vl(e){var n=so(e);if(dp(n))return e}function Dp(e,n){if(e==="change")return n}var Rp=!1;if(ea){var tu;if(ea){var nu="oninput"in document;if(!nu){var Mp=document.createElement("div");Mp.setAttribute("oninput","return;"),nu=typeof Mp.oninput=="function"}tu=nu}else tu=!1;Rp=tu&&(!document.documentMode||9<document.documentMode)}function Op(){uo&&(uo.detachEvent("onpropertychange",Bp),fo=uo=null)}function Bp(e){if(e.propertyName==="value"&&Vl(fo)){var n=[];Ap(n,fo,e,qc(e)),yp(S1,n)}}function T1(e,n,s){e==="focusin"?(Op(),uo=n,fo=s,uo.attachEvent("onpropertychange",Bp)):e==="focusout"&&Op()}function k1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Vl(fo)}function C1(e,n){if(e==="click")return Vl(n)}function E1(e,n){if(e==="input"||e==="change")return Vl(n)}function N1(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var nn=typeof Object.is=="function"?Object.is:N1;function ho(e,n){if(nn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var s=Object.keys(e),l=Object.keys(n);if(s.length!==l.length)return!1;for(l=0;l<s.length;l++){var f=s[l];if(!$s.call(n,f)||!nn(e[f],n[f]))return!1}return!0}function Ip(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Lp(e,n){var s=Ip(e);e=0;for(var l;s;){if(s.nodeType===3){if(l=e+s.textContent.length,e<=n&&l>=n)return{node:s,offset:n-e};e=l}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Ip(s)}}function Up(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Up(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function zp(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=Ml(e.document);n instanceof e.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)e=n.contentWindow;else break;n=Ml(e.document)}return n}function au(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var j1=ea&&"documentMode"in document&&11>=document.documentMode,ai=null,su=null,po=null,iu=!1;function Vp(e,n,s){var l=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;iu||ai==null||ai!==Ml(l)||(l=ai,"selectionStart"in l&&au(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),po&&ho(po,l)||(po=l,l=jr(su,"onSelect"),0<l.length&&(n=new Ul("onSelect","select",null,n,s),e.push({event:n,listeners:l}),n.target=ai)))}function us(e,n){var s={};return s[e.toLowerCase()]=n.toLowerCase(),s["Webkit"+e]="webkit"+n,s["Moz"+e]="moz"+n,s}var si={animationend:us("Animation","AnimationEnd"),animationiteration:us("Animation","AnimationIteration"),animationstart:us("Animation","AnimationStart"),transitionrun:us("Transition","TransitionRun"),transitionstart:us("Transition","TransitionStart"),transitioncancel:us("Transition","TransitionCancel"),transitionend:us("Transition","TransitionEnd")},ou={},Hp={};ea&&(Hp=document.createElement("div").style,"AnimationEvent"in window||(delete si.animationend.animation,delete si.animationiteration.animation,delete si.animationstart.animation),"TransitionEvent"in window||delete si.transitionend.transition);function ds(e){if(ou[e])return ou[e];if(!si[e])return e;var n=si[e],s;for(s in n)if(n.hasOwnProperty(s)&&s in Hp)return ou[e]=n[s];return e}var Pp=ds("animationend"),Gp=ds("animationiteration"),$p=ds("animationstart"),w1=ds("transitionrun"),A1=ds("transitionstart"),D1=ds("transitioncancel"),Fp=ds("transitionend"),qp=new Map,lu="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(" ");lu.push("scrollEnd");function Mn(e,n){qp.set(e,n),rs(n,[e])}var Hl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},bn=[],ii=0,ru=0;function Pl(){for(var e=ii,n=ru=ii=0;n<e;){var s=bn[n];bn[n++]=null;var l=bn[n];bn[n++]=null;var f=bn[n];bn[n++]=null;var h=bn[n];if(bn[n++]=null,l!==null&&f!==null){var _=l.pending;_===null?f.next=f:(f.next=_.next,_.next=f),l.pending=f}h!==0&&Kp(s,f,h)}}function Gl(e,n,s,l){bn[ii++]=e,bn[ii++]=n,bn[ii++]=s,bn[ii++]=l,ru|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function cu(e,n,s,l){return Gl(e,n,s,l),$l(e)}function fs(e,n){return Gl(e,null,null,n),$l(e)}function Kp(e,n,s){e.lanes|=s;var l=e.alternate;l!==null&&(l.lanes|=s);for(var f=!1,h=e.return;h!==null;)h.childLanes|=s,l=h.alternate,l!==null&&(l.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&&n!==null&&(f=31-Pe(s),e=h.hiddenUpdates,l=e[f],l===null?e[f]=[n]:l.push(n),n.lane=s|536870912),h):null}function $l(e){if(50<Io)throw Io=0,yd=null,Error(o(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var oi={};function R1(e,n,s,l){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=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function an(e,n,s,l){return new R1(e,n,s,l)}function uu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ta(e,n){var s=e.alternate;return s===null?(s=an(e.tag,n,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=n,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,n=e.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function Yp(e,n){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=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,n=s.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function Fl(e,n,s,l,f,h){var _=0;if(l=e,typeof e=="function")uu(e)&&(_=1);else if(typeof e=="string")_=LS(e,s,Ke.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case q:return e=an(31,s,n,f),e.elementType=q,e.lanes=h,e;case E:return hs(s.children,f,h,n);case N:_=8,f|=24;break;case C:return e=an(12,s,n,f|2),e.elementType=C,e.lanes=h,e;case w:return e=an(13,s,n,f),e.elementType=w,e.lanes=h,e;case F:return e=an(19,s,n,f),e.elementType=F,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case D:_=10;break e;case j:_=9;break e;case R:_=11;break e;case H:_=14;break e;case B:_=16,l=null;break e}_=29,s=Error(o(130,e===null?"null":typeof e,"")),l=null}return n=an(_,s,n,f),n.elementType=e,n.type=l,n.lanes=h,n}function hs(e,n,s,l){return e=an(7,e,l,n),e.lanes=s,e}function du(e,n,s){return e=an(6,e,null,n),e.lanes=s,e}function Zp(e){var n=an(18,null,null,0);return n.stateNode=e,n}function fu(e,n,s){return n=an(4,e.children!==null?e.children:[],e.key,n),n.lanes=s,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Xp=new WeakMap;function xn(e,n){if(typeof e=="object"&&e!==null){var s=Xp.get(e);return s!==void 0?s:(n={value:e,source:n,stack:eo(n)},Xp.set(e,n),n)}return{value:e,source:n,stack:eo(n)}}var li=[],ri=0,ql=null,mo=0,_n=[],Sn=0,ja=null,zn=1,Vn="";function na(e,n){li[ri++]=mo,li[ri++]=ql,ql=e,mo=n}function Qp(e,n,s){_n[Sn++]=zn,_n[Sn++]=Vn,_n[Sn++]=ja,ja=e;var l=zn;e=Vn;var f=32-Pe(l)-1;l&=~(1<<f),s+=1;var h=32-Pe(n)+f;if(30<h){var _=f-f%5;h=(l&(1<<_)-1).toString(32),l>>=_,f-=_,zn=1<<32-Pe(n)+f|s<<f|l,Vn=h+e}else zn=1<<h|s<<f|l,Vn=e}function hu(e){e.return!==null&&(na(e,1),Qp(e,1,0))}function pu(e){for(;e===ql;)ql=li[--ri],li[ri]=null,mo=li[--ri],li[ri]=null;for(;e===ja;)ja=_n[--Sn],_n[Sn]=null,Vn=_n[--Sn],_n[Sn]=null,zn=_n[--Sn],_n[Sn]=null}function Wp(e,n){_n[Sn++]=zn,_n[Sn++]=Vn,_n[Sn++]=ja,zn=n.id,Vn=n.overflow,ja=e}var Ot=null,at=null,Me=!1,wa=null,Tn=!1,mu=Error(o(519));function Aa(e){var n=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw go(xn(n,e)),mu}function Jp(e){var n=e.stateNode,s=e.type,l=e.memoizedProps;switch(n[Mt]=e,n[Kt]=l,s){case"dialog":Ae("cancel",n),Ae("close",n);break;case"iframe":case"object":case"embed":Ae("load",n);break;case"video":case"audio":for(s=0;s<Uo.length;s++)Ae(Uo[s],n);break;case"source":Ae("error",n);break;case"img":case"image":case"link":Ae("error",n),Ae("load",n);break;case"details":Ae("toggle",n);break;case"input":Ae("invalid",n),fp(n,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Ae("invalid",n);break;case"textarea":Ae("invalid",n),pp(n,l.value,l.defaultValue,l.children)}s=l.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||n.textContent===""+s||l.suppressHydrationWarning===!0||gv(n.textContent,s)?(l.popover!=null&&(Ae("beforetoggle",n),Ae("toggle",n)),l.onScroll!=null&&Ae("scroll",n),l.onScrollEnd!=null&&Ae("scrollend",n),l.onClick!=null&&(n.onclick=Jn),n=!0):n=!1,n||Aa(e,!0)}function em(e){for(Ot=e.return;Ot;)switch(Ot.tag){case 5:case 31:case 13:Tn=!1;return;case 27:case 3:Tn=!0;return;default:Ot=Ot.return}}function ci(e){if(e!==Ot)return!1;if(!Me)return em(e),Me=!0,!1;var n=e.tag,s;if((s=n!==3&&n!==27)&&((s=n===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||Md(e.type,e.memoizedProps)),s=!s),s&&at&&Aa(e),em(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));at=Cv(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));at=Cv(e)}else n===27?(n=at,$a(e.type)?(e=Ud,Ud=null,at=e):at=n):at=Ot?Cn(e.stateNode.nextSibling):null;return!0}function ps(){at=Ot=null,Me=!1}function gu(){var e=wa;return e!==null&&(Wt===null?Wt=e:Wt.push.apply(Wt,e),wa=null),e}function go(e){wa===null?wa=[e]:wa.push(e)}var vu=ie(null),ms=null,aa=null;function Da(e,n,s){re(vu,n._currentValue),n._currentValue=s}function sa(e){e._currentValue=vu.current,xe(vu)}function yu(e,n,s){for(;e!==null;){var l=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,l!==null&&(l.childLanes|=n)):l!==null&&(l.childLanes&n)!==n&&(l.childLanes|=n),e===s)break;e=e.return}}function bu(e,n,s,l){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var h=f.dependencies;if(h!==null){var _=f.child;h=h.firstContext;e:for(;h!==null;){var k=h;h=f;for(var A=0;A<n.length;A++)if(k.context===n[A]){h.lanes|=s,k=h.alternate,k!==null&&(k.lanes|=s),yu(h.return,s,e),l||(_=null);break e}h=k.next}}else if(f.tag===18){if(_=f.return,_===null)throw Error(o(341));_.lanes|=s,h=_.alternate,h!==null&&(h.lanes|=s),yu(_,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 ui(e,n,s,l){e=null;for(var f=n,h=!1;f!==null;){if(!h){if((f.flags&524288)!==0)h=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var _=f.alternate;if(_===null)throw Error(o(387));if(_=_.memoizedProps,_!==null){var k=f.type;nn(f.pendingProps.value,_.value)||(e!==null?e.push(k):e=[k])}}else if(f===Rt.current){if(_=f.alternate,_===null)throw Error(o(387));_.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(Go):e=[Go])}f=f.return}e!==null&&bu(n,e,s,l),n.flags|=262144}function Kl(e){for(e=e.firstContext;e!==null;){if(!nn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function gs(e){ms=e,aa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Bt(e){return tm(ms,e)}function Yl(e,n){return ms===null&&gs(e),tm(e,n)}function tm(e,n){var s=n._currentValue;if(n={context:n,memoizedValue:s,next:null},aa===null){if(e===null)throw Error(o(308));aa=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else aa=aa.next=n;return s}var M1=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(s,l){e.push(l)}};this.abort=function(){n.aborted=!0,e.forEach(function(s){return s()})}},O1=t.unstable_scheduleCallback,B1=t.unstable_NormalPriority,bt={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function xu(){return{controller:new M1,data:new Map,refCount:0}}function vo(e){e.refCount--,e.refCount===0&&O1(B1,function(){e.controller.abort()})}var yo=null,_u=0,di=0,fi=null;function I1(e,n){if(yo===null){var s=yo=[];_u=0,di=kd(),fi={status:"pending",value:void 0,then:function(l){s.push(l)}}}return _u++,n.then(nm,nm),n}function nm(){if(--_u===0&&yo!==null){fi!==null&&(fi.status="fulfilled");var e=yo;yo=null,di=0,fi=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function L1(e,n){var s=[],l={status:"pending",value:null,reason:null,then:function(f){s.push(f)}};return e.then(function(){l.status="fulfilled",l.value=n;for(var f=0;f<s.length;f++)(0,s[f])(n)},function(f){for(l.status="rejected",l.reason=f,f=0;f<s.length;f++)(0,s[f])(void 0)}),l}var am=I.S;I.S=function(e,n){Vg=zt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&I1(e,n),am!==null&&am(e,n)};var vs=ie(null);function Su(){var e=vs.current;return e!==null?e:We.pooledCache}function Zl(e,n){n===null?re(vs,vs.current):re(vs,n.pool)}function sm(){var e=Su();return e===null?null:{parent:bt._currentValue,pool:e}}var hi=Error(o(460)),Tu=Error(o(474)),Xl=Error(o(542)),Ql={then:function(){}};function im(e){return e=e.status,e==="fulfilled"||e==="rejected"}function om(e,n,s){switch(s=e[s],s===void 0?e.push(n):s!==n&&(n.then(Jn,Jn),n=s),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,rm(e),e;default:if(typeof n.status=="string")n.then(Jn,Jn);else{if(e=We,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=n,e.status="pending",e.then(function(l){if(n.status==="pending"){var f=n;f.status="fulfilled",f.value=l}},function(l){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=l}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,rm(e),e}throw bs=n,hi}}function ys(e){try{var n=e._init;return n(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(bs=s,hi):s}}var bs=null;function lm(){if(bs===null)throw Error(o(459));var e=bs;return bs=null,e}function rm(e){if(e===hi||e===Xl)throw Error(o(483))}var pi=null,bo=0;function Wl(e){var n=bo;return bo+=1,pi===null&&(pi=[]),om(pi,e,n)}function xo(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Jl(e,n){throw n.$$typeof===b?Error(o(525)):(e=Object.prototype.toString.call(n),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function cm(e){function n(L,M){if(e){var V=L.deletions;V===null?(L.deletions=[M],L.flags|=16):V.push(M)}}function s(L,M){if(!e)return null;for(;M!==null;)n(L,M),M=M.sibling;return null}function l(L){for(var M=new Map;L!==null;)L.key!==null?M.set(L.key,L):M.set(L.index,L),L=L.sibling;return M}function f(L,M){return L=ta(L,M),L.index=0,L.sibling=null,L}function h(L,M,V){return L.index=V,e?(V=L.alternate,V!==null?(V=V.index,V<M?(L.flags|=67108866,M):V):(L.flags|=67108866,M)):(L.flags|=1048576,M)}function _(L){return e&&L.alternate===null&&(L.flags|=67108866),L}function k(L,M,V,Q){return M===null||M.tag!==6?(M=du(V,L.mode,Q),M.return=L,M):(M=f(M,V),M.return=L,M)}function A(L,M,V,Q){var pe=V.type;return pe===E?Z(L,M,V.props.children,Q,V.key):M!==null&&(M.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===B&&ys(pe)===M.type)?(M=f(M,V.props),xo(M,V),M.return=L,M):(M=Fl(V.type,V.key,V.props,null,L.mode,Q),xo(M,V),M.return=L,M)}function P(L,M,V,Q){return M===null||M.tag!==4||M.stateNode.containerInfo!==V.containerInfo||M.stateNode.implementation!==V.implementation?(M=fu(V,L.mode,Q),M.return=L,M):(M=f(M,V.children||[]),M.return=L,M)}function Z(L,M,V,Q,pe){return M===null||M.tag!==7?(M=hs(V,L.mode,Q,pe),M.return=L,M):(M=f(M,V),M.return=L,M)}function J(L,M,V){if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return M=du(""+M,L.mode,V),M.return=L,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case S:return V=Fl(M.type,M.key,M.props,null,L.mode,V),xo(V,M),V.return=L,V;case T:return M=fu(M,L.mode,V),M.return=L,M;case B:return M=ys(M),J(L,M,V)}if(ne(M)||te(M))return M=hs(M,L.mode,V,null),M.return=L,M;if(typeof M.then=="function")return J(L,Wl(M),V);if(M.$$typeof===D)return J(L,Yl(L,M),V);Jl(L,M)}return null}function $(L,M,V,Q){var pe=M!==null?M.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return pe!==null?null:k(L,M,""+V,Q);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case S:return V.key===pe?A(L,M,V,Q):null;case T:return V.key===pe?P(L,M,V,Q):null;case B:return V=ys(V),$(L,M,V,Q)}if(ne(V)||te(V))return pe!==null?null:Z(L,M,V,Q,null);if(typeof V.then=="function")return $(L,M,Wl(V),Q);if(V.$$typeof===D)return $(L,M,Yl(L,V),Q);Jl(L,V)}return null}function K(L,M,V,Q,pe){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return L=L.get(V)||null,k(M,L,""+Q,pe);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case S:return L=L.get(Q.key===null?V:Q.key)||null,A(M,L,Q,pe);case T:return L=L.get(Q.key===null?V:Q.key)||null,P(M,L,Q,pe);case B:return Q=ys(Q),K(L,M,V,Q,pe)}if(ne(Q)||te(Q))return L=L.get(V)||null,Z(M,L,Q,pe,null);if(typeof Q.then=="function")return K(L,M,V,Wl(Q),pe);if(Q.$$typeof===D)return K(L,M,V,Yl(M,Q),pe);Jl(M,Q)}return null}function ue(L,M,V,Q){for(var pe=null,Le=null,he=M,Ce=M=0,Re=null;he!==null&&Ce<V.length;Ce++){he.index>Ce?(Re=he,he=null):Re=he.sibling;var Ue=$(L,he,V[Ce],Q);if(Ue===null){he===null&&(he=Re);break}e&&he&&Ue.alternate===null&&n(L,he),M=h(Ue,M,Ce),Le===null?pe=Ue:Le.sibling=Ue,Le=Ue,he=Re}if(Ce===V.length)return s(L,he),Me&&na(L,Ce),pe;if(he===null){for(;Ce<V.length;Ce++)he=J(L,V[Ce],Q),he!==null&&(M=h(he,M,Ce),Le===null?pe=he:Le.sibling=he,Le=he);return Me&&na(L,Ce),pe}for(he=l(he);Ce<V.length;Ce++)Re=K(he,L,Ce,V[Ce],Q),Re!==null&&(e&&Re.alternate!==null&&he.delete(Re.key===null?Ce:Re.key),M=h(Re,M,Ce),Le===null?pe=Re:Le.sibling=Re,Le=Re);return e&&he.forEach(function(Za){return n(L,Za)}),Me&&na(L,Ce),pe}function ve(L,M,V,Q){if(V==null)throw Error(o(151));for(var pe=null,Le=null,he=M,Ce=M=0,Re=null,Ue=V.next();he!==null&&!Ue.done;Ce++,Ue=V.next()){he.index>Ce?(Re=he,he=null):Re=he.sibling;var Za=$(L,he,Ue.value,Q);if(Za===null){he===null&&(he=Re);break}e&&he&&Za.alternate===null&&n(L,he),M=h(Za,M,Ce),Le===null?pe=Za:Le.sibling=Za,Le=Za,he=Re}if(Ue.done)return s(L,he),Me&&na(L,Ce),pe;if(he===null){for(;!Ue.done;Ce++,Ue=V.next())Ue=J(L,Ue.value,Q),Ue!==null&&(M=h(Ue,M,Ce),Le===null?pe=Ue:Le.sibling=Ue,Le=Ue);return Me&&na(L,Ce),pe}for(he=l(he);!Ue.done;Ce++,Ue=V.next())Ue=K(he,L,Ce,Ue.value,Q),Ue!==null&&(e&&Ue.alternate!==null&&he.delete(Ue.key===null?Ce:Ue.key),M=h(Ue,M,Ce),Le===null?pe=Ue:Le.sibling=Ue,Le=Ue);return e&&he.forEach(function(YS){return n(L,YS)}),Me&&na(L,Ce),pe}function Xe(L,M,V,Q){if(typeof V=="object"&&V!==null&&V.type===E&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case S:e:{for(var pe=V.key;M!==null;){if(M.key===pe){if(pe=V.type,pe===E){if(M.tag===7){s(L,M.sibling),Q=f(M,V.props.children),Q.return=L,L=Q;break e}}else if(M.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===B&&ys(pe)===M.type){s(L,M.sibling),Q=f(M,V.props),xo(Q,V),Q.return=L,L=Q;break e}s(L,M);break}else n(L,M);M=M.sibling}V.type===E?(Q=hs(V.props.children,L.mode,Q,V.key),Q.return=L,L=Q):(Q=Fl(V.type,V.key,V.props,null,L.mode,Q),xo(Q,V),Q.return=L,L=Q)}return _(L);case T:e:{for(pe=V.key;M!==null;){if(M.key===pe)if(M.tag===4&&M.stateNode.containerInfo===V.containerInfo&&M.stateNode.implementation===V.implementation){s(L,M.sibling),Q=f(M,V.children||[]),Q.return=L,L=Q;break e}else{s(L,M);break}else n(L,M);M=M.sibling}Q=fu(V,L.mode,Q),Q.return=L,L=Q}return _(L);case B:return V=ys(V),Xe(L,M,V,Q)}if(ne(V))return ue(L,M,V,Q);if(te(V)){if(pe=te(V),typeof pe!="function")throw Error(o(150));return V=pe.call(V),ve(L,M,V,Q)}if(typeof V.then=="function")return Xe(L,M,Wl(V),Q);if(V.$$typeof===D)return Xe(L,M,Yl(L,V),Q);Jl(L,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,M!==null&&M.tag===6?(s(L,M.sibling),Q=f(M,V),Q.return=L,L=Q):(s(L,M),Q=du(V,L.mode,Q),Q.return=L,L=Q),_(L)):s(L,M)}return function(L,M,V,Q){try{bo=0;var pe=Xe(L,M,V,Q);return pi=null,pe}catch(he){if(he===hi||he===Xl)throw he;var Le=an(29,he,null,L.mode);return Le.lanes=Q,Le.return=L,Le}finally{}}}var xs=cm(!0),um=cm(!1),Ra=!1;function ku(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Cu(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ma(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Oa(e,n,s){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ve&2)!==0){var f=l.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),l.pending=n,n=$l(e),Kp(e,null,s),n}return Gl(e,l,n,s),$l(e)}function _o(e,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194048)!==0)){var l=n.lanes;l&=e.pendingLanes,s|=l,n.lanes=s,tp(e,s)}}function Eu(e,n){var s=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,s===l)){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=n:h=h.next=n}else f=h=n;s={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:l.shared,callbacks:l.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=n:e.next=n,s.lastBaseUpdate=n}var Nu=!1;function So(){if(Nu){var e=fi;if(e!==null)throw e}}function To(e,n,s,l){Nu=!1;var f=e.updateQueue;Ra=!1;var h=f.firstBaseUpdate,_=f.lastBaseUpdate,k=f.shared.pending;if(k!==null){f.shared.pending=null;var A=k,P=A.next;A.next=null,_===null?h=P:_.next=P,_=A;var Z=e.alternate;Z!==null&&(Z=Z.updateQueue,k=Z.lastBaseUpdate,k!==_&&(k===null?Z.firstBaseUpdate=P:k.next=P,Z.lastBaseUpdate=A))}if(h!==null){var J=f.baseState;_=0,Z=P=A=null,k=h;do{var $=k.lane&-536870913,K=$!==k.lane;if(K?(De&$)===$:(l&$)===$){$!==0&&$===di&&(Nu=!0),Z!==null&&(Z=Z.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var ue=e,ve=k;$=n;var Xe=s;switch(ve.tag){case 1:if(ue=ve.payload,typeof ue=="function"){J=ue.call(Xe,J,$);break e}J=ue;break e;case 3:ue.flags=ue.flags&-65537|128;case 0:if(ue=ve.payload,$=typeof ue=="function"?ue.call(Xe,J,$):ue,$==null)break e;J=y({},J,$);break e;case 2:Ra=!0}}$=k.callback,$!==null&&(e.flags|=64,K&&(e.flags|=8192),K=f.callbacks,K===null?f.callbacks=[$]:K.push($))}else K={lane:$,tag:k.tag,payload:k.payload,callback:k.callback,next:null},Z===null?(P=Z=K,A=J):Z=Z.next=K,_|=$;if(k=k.next,k===null){if(k=f.shared.pending,k===null)break;K=k,k=K.next,K.next=null,f.lastBaseUpdate=K,f.shared.pending=null}}while(!0);Z===null&&(A=J),f.baseState=A,f.firstBaseUpdate=P,f.lastBaseUpdate=Z,h===null&&(f.shared.lanes=0),za|=_,e.lanes=_,e.memoizedState=J}}function dm(e,n){if(typeof e!="function")throw Error(o(191,e));e.call(n)}function fm(e,n){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)dm(s[e],n)}var mi=ie(null),er=ie(0);function hm(e,n){e=ha,re(er,e),re(mi,n),ha=e|n.baseLanes}function ju(){re(er,ha),re(mi,mi.current)}function wu(){ha=er.current,xe(mi),xe(er)}var sn=ie(null),kn=null;function Ba(e){var n=e.alternate;re(mt,mt.current&1),re(sn,e),kn===null&&(n===null||mi.current!==null||n.memoizedState!==null)&&(kn=e)}function Au(e){re(mt,mt.current),re(sn,e),kn===null&&(kn=e)}function pm(e){e.tag===22?(re(mt,mt.current),re(sn,e),kn===null&&(kn=e)):Ia()}function Ia(){re(mt,mt.current),re(sn,sn.current)}function on(e){xe(sn),kn===e&&(kn=null),xe(mt)}var mt=ie(0);function tr(e){for(var n=e;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Id(s)||Ld(s)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var ia=0,ke=null,Ye=null,xt=null,nr=!1,gi=!1,_s=!1,ar=0,ko=0,vi=null,U1=0;function dt(){throw Error(o(321))}function Du(e,n){if(n===null)return!1;for(var s=0;s<n.length&&s<e.length;s++)if(!nn(e[s],n[s]))return!1;return!0}function Ru(e,n,s,l,f,h){return ia=h,ke=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,I.H=e===null||e.memoizedState===null?Qm:Ku,_s=!1,h=s(l,f),_s=!1,gi&&(h=gm(n,s,l,f)),mm(e),h}function mm(e){I.H=No;var n=Ye!==null&&Ye.next!==null;if(ia=0,xt=Ye=ke=null,nr=!1,ko=0,vi=null,n)throw Error(o(300));e===null||_t||(e=e.dependencies,e!==null&&Kl(e)&&(_t=!0))}function gm(e,n,s,l){ke=e;var f=0;do{if(gi&&(vi=null),ko=0,gi=!1,25<=f)throw Error(o(301));if(f+=1,xt=Ye=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}I.H=Wm,h=n(s,l)}while(gi);return h}function z1(){var e=I.H,n=e.useState()[0];return n=typeof n.then=="function"?Co(n):n,e=e.useState()[0],(Ye!==null?Ye.memoizedState:null)!==e&&(ke.flags|=1024),n}function Mu(){var e=ar!==0;return ar=0,e}function Ou(e,n,s){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~s}function Bu(e){if(nr){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}nr=!1}ia=0,xt=Ye=ke=null,gi=!1,ko=ar=0,vi=null}function $t(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xt===null?ke.memoizedState=xt=e:xt=xt.next=e,xt}function gt(){if(Ye===null){var e=ke.alternate;e=e!==null?e.memoizedState:null}else e=Ye.next;var n=xt===null?ke.memoizedState:xt.next;if(n!==null)xt=n,Ye=e;else{if(e===null)throw ke.alternate===null?Error(o(467)):Error(o(310));Ye=e,e={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},xt===null?ke.memoizedState=xt=e:xt=xt.next=e}return xt}function sr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Co(e){var n=ko;return ko+=1,vi===null&&(vi=[]),e=om(vi,e,n),n=ke,(xt===null?n.memoizedState:xt.next)===null&&(n=n.alternate,I.H=n===null||n.memoizedState===null?Qm:Ku),e}function ir(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Co(e);if(e.$$typeof===D)return Bt(e)}throw Error(o(438,String(e)))}function Iu(e){var n=null,s=ke.updateQueue;if(s!==null&&(n=s.memoCache),n==null){var l=ke.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(n={data:l.data.map(function(f){return f.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),s===null&&(s=sr(),ke.updateQueue=s),s.memoCache=n,s=n.data[n.index],s===void 0)for(s=n.data[n.index]=Array(e),l=0;l<e;l++)s[l]=X;return n.index++,s}function oa(e,n){return typeof n=="function"?n(e):n}function or(e){var n=gt();return Lu(n,Ye,e)}function Lu(e,n,s){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=s;var f=e.baseQueue,h=l.pending;if(h!==null){if(f!==null){var _=f.next;f.next=h.next,h.next=_}n.baseQueue=f=h,l.pending=null}if(h=e.baseState,f===null)e.memoizedState=h;else{n=f.next;var k=_=null,A=null,P=n,Z=!1;do{var J=P.lane&-536870913;if(J!==P.lane?(De&J)===J:(ia&J)===J){var $=P.revertLane;if($===0)A!==null&&(A=A.next={lane:0,revertLane:0,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null}),J===di&&(Z=!0);else if((ia&$)===$){P=P.next,$===di&&(Z=!0);continue}else J={lane:0,revertLane:P.revertLane,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},A===null?(k=A=J,_=h):A=A.next=J,ke.lanes|=$,za|=$;J=P.action,_s&&s(h,J),h=P.hasEagerState?P.eagerState:s(h,J)}else $={lane:J,revertLane:P.revertLane,gesture:P.gesture,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},A===null?(k=A=$,_=h):A=A.next=$,ke.lanes|=J,za|=J;P=P.next}while(P!==null&&P!==n);if(A===null?_=h:A.next=k,!nn(h,e.memoizedState)&&(_t=!0,Z&&(s=fi,s!==null)))throw s;e.memoizedState=h,e.baseState=_,e.baseQueue=A,l.lastRenderedState=h}return f===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Uu(e){var n=gt(),s=n.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var l=s.dispatch,f=s.pending,h=n.memoizedState;if(f!==null){s.pending=null;var _=f=f.next;do h=e(h,_.action),_=_.next;while(_!==f);nn(h,n.memoizedState)||(_t=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),s.lastRenderedState=h}return[h,l]}function vm(e,n,s){var l=ke,f=gt(),h=Me;if(h){if(s===void 0)throw Error(o(407));s=s()}else s=n();var _=!nn((Ye||f).memoizedState,s);if(_&&(f.memoizedState=s,_t=!0),f=f.queue,Hu(xm.bind(null,l,f,e),[e]),f.getSnapshot!==n||_||xt!==null&&xt.memoizedState.tag&1){if(l.flags|=2048,yi(9,{destroy:void 0},bm.bind(null,l,f,s,n),null),We===null)throw Error(o(349));h||(ia&127)!==0||ym(l,n,s)}return s}function ym(e,n,s){e.flags|=16384,e={getSnapshot:n,value:s},n=ke.updateQueue,n===null?(n=sr(),ke.updateQueue=n,n.stores=[e]):(s=n.stores,s===null?n.stores=[e]:s.push(e))}function bm(e,n,s,l){n.value=s,n.getSnapshot=l,_m(n)&&Sm(e)}function xm(e,n,s){return s(function(){_m(n)&&Sm(e)})}function _m(e){var n=e.getSnapshot;e=e.value;try{var s=n();return!nn(e,s)}catch{return!0}}function Sm(e){var n=fs(e,2);n!==null&&Jt(n,e,2)}function zu(e){var n=$t();if(typeof e=="function"){var s=e;if(e=s(),_s){nt(!0);try{s()}finally{nt(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:e},n}function Tm(e,n,s,l){return e.baseState=s,Lu(e,Ye,typeof l=="function"?l:oa)}function V1(e,n,s,l,f){if(cr(e))throw Error(o(485));if(e=n.action,e!==null){var h={payload:f,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){h.listeners.push(_)}};I.T!==null?s(!0):h.isTransition=!1,l(h),s=n.pending,s===null?(h.next=n.pending=h,km(n,h)):(h.next=s.next,n.pending=s.next=h)}}function km(e,n){var s=n.action,l=n.payload,f=e.state;if(n.isTransition){var h=I.T,_={};I.T=_;try{var k=s(f,l),A=I.S;A!==null&&A(_,k),Cm(e,n,k)}catch(P){Vu(e,n,P)}finally{h!==null&&_.types!==null&&(h.types=_.types),I.T=h}}else try{h=s(f,l),Cm(e,n,h)}catch(P){Vu(e,n,P)}}function Cm(e,n,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(l){Em(e,n,l)},function(l){return Vu(e,n,l)}):Em(e,n,s)}function Em(e,n,s){n.status="fulfilled",n.value=s,Nm(n),e.state=s,n=e.pending,n!==null&&(s=n.next,s===n?e.pending=null:(s=s.next,n.next=s,km(e,s)))}function Vu(e,n,s){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do n.status="rejected",n.reason=s,Nm(n),n=n.next;while(n!==l)}e.action=null}function Nm(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function jm(e,n){return n}function wm(e,n){if(Me){var s=We.formState;if(s!==null){e:{var l=ke;if(Me){if(at){t:{for(var f=at,h=Tn;f.nodeType!==8;){if(!h){f=null;break t}if(f=Cn(f.nextSibling),f===null){f=null;break t}}h=f.data,f=h==="F!"||h==="F"?f:null}if(f){at=Cn(f.nextSibling),l=f.data==="F!";break e}}Aa(l)}l=!1}l&&(n=s[0])}}return s=$t(),s.memoizedState=s.baseState=n,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jm,lastRenderedState:n},s.queue=l,s=Ym.bind(null,ke,l),l.dispatch=s,l=zu(!1),h=qu.bind(null,ke,!1,l.queue),l=$t(),f={state:n,dispatch:null,action:e,pending:null},l.queue=f,s=V1.bind(null,ke,f,h,s),f.dispatch=s,l.memoizedState=e,[n,s,!1]}function Am(e){var n=gt();return Dm(n,Ye,e)}function Dm(e,n,s){if(n=Lu(e,n,jm)[0],e=or(oa)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var l=Co(n)}catch(_){throw _===hi?Xl:_}else l=n;n=gt();var f=n.queue,h=f.dispatch;return s!==n.memoizedState&&(ke.flags|=2048,yi(9,{destroy:void 0},H1.bind(null,f,s),null)),[l,h,e]}function H1(e,n){e.action=n}function Rm(e){var n=gt(),s=Ye;if(s!==null)return Dm(n,s,e);gt(),n=n.memoizedState,s=gt();var l=s.queue.dispatch;return s.memoizedState=e,[n,l,!1]}function yi(e,n,s,l){return e={tag:e,create:s,deps:l,inst:n,next:null},n=ke.updateQueue,n===null&&(n=sr(),ke.updateQueue=n),s=n.lastEffect,s===null?n.lastEffect=e.next=e:(l=s.next,s.next=e,e.next=l,n.lastEffect=e),e}function Mm(){return gt().memoizedState}function lr(e,n,s,l){var f=$t();ke.flags|=e,f.memoizedState=yi(1|n,{destroy:void 0},s,l===void 0?null:l)}function rr(e,n,s,l){var f=gt();l=l===void 0?null:l;var h=f.memoizedState.inst;Ye!==null&&l!==null&&Du(l,Ye.memoizedState.deps)?f.memoizedState=yi(n,h,s,l):(ke.flags|=e,f.memoizedState=yi(1|n,h,s,l))}function Om(e,n){lr(8390656,8,e,n)}function Hu(e,n){rr(2048,8,e,n)}function P1(e){ke.flags|=4;var n=ke.updateQueue;if(n===null)n=sr(),ke.updateQueue=n,n.events=[e];else{var s=n.events;s===null?n.events=[e]:s.push(e)}}function Bm(e){var n=gt().memoizedState;return P1({ref:n,nextImpl:e}),function(){if((Ve&2)!==0)throw Error(o(440));return n.impl.apply(void 0,arguments)}}function Im(e,n){return rr(4,2,e,n)}function Lm(e,n){return rr(4,4,e,n)}function Um(e,n){if(typeof n=="function"){e=e();var s=n(e);return function(){typeof s=="function"?s():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function zm(e,n,s){s=s!=null?s.concat([e]):null,rr(4,4,Um.bind(null,n,e),s)}function Pu(){}function Vm(e,n){var s=gt();n=n===void 0?null:n;var l=s.memoizedState;return n!==null&&Du(n,l[1])?l[0]:(s.memoizedState=[e,n],e)}function Hm(e,n){var s=gt();n=n===void 0?null:n;var l=s.memoizedState;if(n!==null&&Du(n,l[1]))return l[0];if(l=e(),_s){nt(!0);try{e()}finally{nt(!1)}}return s.memoizedState=[l,n],l}function Gu(e,n,s){return s===void 0||(ia&1073741824)!==0&&(De&261930)===0?e.memoizedState=n:(e.memoizedState=s,e=Pg(),ke.lanes|=e,za|=e,s)}function Pm(e,n,s,l){return nn(s,n)?s:mi.current!==null?(e=Gu(e,s,l),nn(e,n)||(_t=!0),e):(ia&42)===0||(ia&1073741824)!==0&&(De&261930)===0?(_t=!0,e.memoizedState=s):(e=Pg(),ke.lanes|=e,za|=e,n)}function Gm(e,n,s,l,f){var h=Y.p;Y.p=h!==0&&8>h?h:8;var _=I.T,k={};I.T=k,qu(e,!1,n,s);try{var A=f(),P=I.S;if(P!==null&&P(k,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var Z=L1(A,l);Eo(e,n,Z,cn(e))}else Eo(e,n,l,cn(e))}catch(J){Eo(e,n,{then:function(){},status:"rejected",reason:J},cn())}finally{Y.p=h,_!==null&&k.types!==null&&(_.types=k.types),I.T=_}}function G1(){}function $u(e,n,s,l){if(e.tag!==5)throw Error(o(476));var f=$m(e).queue;Gm(e,f,n,oe,s===null?G1:function(){return Fm(e),s(l)})}function $m(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:oe},next:null};var s={};return n.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:s},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Fm(e){var n=$m(e);n.next===null&&(n=e.alternate.memoizedState),Eo(e,n.next.queue,{},cn())}function Fu(){return Bt(Go)}function qm(){return gt().memoizedState}function Km(){return gt().memoizedState}function $1(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var s=cn();e=Ma(s);var l=Oa(n,e,s);l!==null&&(Jt(l,n,s),_o(l,n,s)),n={cache:xu()},e.payload=n;return}n=n.return}}function F1(e,n,s){var l=cn();s={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},cr(e)?Zm(n,s):(s=cu(e,n,s,l),s!==null&&(Jt(s,e,l),Xm(s,n,l)))}function Ym(e,n,s){var l=cn();Eo(e,n,s,l)}function Eo(e,n,s,l){var f={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(cr(e))Zm(n,f);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var _=n.lastRenderedState,k=h(_,s);if(f.hasEagerState=!0,f.eagerState=k,nn(k,_))return Gl(e,n,f,0),We===null&&Pl(),!1}catch{}finally{}if(s=cu(e,n,f,l),s!==null)return Jt(s,e,l),Xm(s,n,l),!0}return!1}function qu(e,n,s,l){if(l={lane:2,revertLane:kd(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},cr(e)){if(n)throw Error(o(479))}else n=cu(e,s,l,2),n!==null&&Jt(n,e,2)}function cr(e){var n=e.alternate;return e===ke||n!==null&&n===ke}function Zm(e,n){gi=nr=!0;var s=e.pending;s===null?n.next=n:(n.next=s.next,s.next=n),e.pending=n}function Xm(e,n,s){if((s&4194048)!==0){var l=n.lanes;l&=e.pendingLanes,s|=l,n.lanes=s,tp(e,s)}}var No={readContext:Bt,use:ir,useCallback:dt,useContext:dt,useEffect:dt,useImperativeHandle:dt,useLayoutEffect:dt,useInsertionEffect:dt,useMemo:dt,useReducer:dt,useRef:dt,useState:dt,useDebugValue:dt,useDeferredValue:dt,useTransition:dt,useSyncExternalStore:dt,useId:dt,useHostTransitionStatus:dt,useFormState:dt,useActionState:dt,useOptimistic:dt,useMemoCache:dt,useCacheRefresh:dt};No.useEffectEvent=dt;var Qm={readContext:Bt,use:ir,useCallback:function(e,n){return $t().memoizedState=[e,n===void 0?null:n],e},useContext:Bt,useEffect:Om,useImperativeHandle:function(e,n,s){s=s!=null?s.concat([e]):null,lr(4194308,4,Um.bind(null,n,e),s)},useLayoutEffect:function(e,n){return lr(4194308,4,e,n)},useInsertionEffect:function(e,n){lr(4,2,e,n)},useMemo:function(e,n){var s=$t();n=n===void 0?null:n;var l=e();if(_s){nt(!0);try{e()}finally{nt(!1)}}return s.memoizedState=[l,n],l},useReducer:function(e,n,s){var l=$t();if(s!==void 0){var f=s(n);if(_s){nt(!0);try{s(n)}finally{nt(!1)}}}else f=n;return l.memoizedState=l.baseState=f,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:f},l.queue=e,e=e.dispatch=F1.bind(null,ke,e),[l.memoizedState,e]},useRef:function(e){var n=$t();return e={current:e},n.memoizedState=e},useState:function(e){e=zu(e);var n=e.queue,s=Ym.bind(null,ke,n);return n.dispatch=s,[e.memoizedState,s]},useDebugValue:Pu,useDeferredValue:function(e,n){var s=$t();return Gu(s,e,n)},useTransition:function(){var e=zu(!1);return e=Gm.bind(null,ke,e.queue,!0,!1),$t().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,s){var l=ke,f=$t();if(Me){if(s===void 0)throw Error(o(407));s=s()}else{if(s=n(),We===null)throw Error(o(349));(De&127)!==0||ym(l,n,s)}f.memoizedState=s;var h={value:s,getSnapshot:n};return f.queue=h,Om(xm.bind(null,l,h,e),[e]),l.flags|=2048,yi(9,{destroy:void 0},bm.bind(null,l,h,s,n),null),s},useId:function(){var e=$t(),n=We.identifierPrefix;if(Me){var s=Vn,l=zn;s=(l&~(1<<32-Pe(l)-1)).toString(32)+s,n="_"+n+"R_"+s,s=ar++,0<s&&(n+="H"+s.toString(32)),n+="_"}else s=U1++,n="_"+n+"r_"+s.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Fu,useFormState:wm,useActionState:wm,useOptimistic:function(e){var n=$t();n.memoizedState=n.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=s,n=qu.bind(null,ke,!0,s),s.dispatch=n,[e,n]},useMemoCache:Iu,useCacheRefresh:function(){return $t().memoizedState=$1.bind(null,ke)},useEffectEvent:function(e){var n=$t(),s={impl:e};return n.memoizedState=s,function(){if((Ve&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},Ku={readContext:Bt,use:ir,useCallback:Vm,useContext:Bt,useEffect:Hu,useImperativeHandle:zm,useInsertionEffect:Im,useLayoutEffect:Lm,useMemo:Hm,useReducer:or,useRef:Mm,useState:function(){return or(oa)},useDebugValue:Pu,useDeferredValue:function(e,n){var s=gt();return Pm(s,Ye.memoizedState,e,n)},useTransition:function(){var e=or(oa)[0],n=gt().memoizedState;return[typeof e=="boolean"?e:Co(e),n]},useSyncExternalStore:vm,useId:qm,useHostTransitionStatus:Fu,useFormState:Am,useActionState:Am,useOptimistic:function(e,n){var s=gt();return Tm(s,Ye,e,n)},useMemoCache:Iu,useCacheRefresh:Km};Ku.useEffectEvent=Bm;var Wm={readContext:Bt,use:ir,useCallback:Vm,useContext:Bt,useEffect:Hu,useImperativeHandle:zm,useInsertionEffect:Im,useLayoutEffect:Lm,useMemo:Hm,useReducer:Uu,useRef:Mm,useState:function(){return Uu(oa)},useDebugValue:Pu,useDeferredValue:function(e,n){var s=gt();return Ye===null?Gu(s,e,n):Pm(s,Ye.memoizedState,e,n)},useTransition:function(){var e=Uu(oa)[0],n=gt().memoizedState;return[typeof e=="boolean"?e:Co(e),n]},useSyncExternalStore:vm,useId:qm,useHostTransitionStatus:Fu,useFormState:Rm,useActionState:Rm,useOptimistic:function(e,n){var s=gt();return Ye!==null?Tm(s,Ye,e,n):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:Iu,useCacheRefresh:Km};Wm.useEffectEvent=Bm;function Yu(e,n,s,l){n=e.memoizedState,s=s(l,n),s=s==null?n:y({},n,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Zu={enqueueSetState:function(e,n,s){e=e._reactInternals;var l=cn(),f=Ma(l);f.payload=n,s!=null&&(f.callback=s),n=Oa(e,f,l),n!==null&&(Jt(n,e,l),_o(n,e,l))},enqueueReplaceState:function(e,n,s){e=e._reactInternals;var l=cn(),f=Ma(l);f.tag=1,f.payload=n,s!=null&&(f.callback=s),n=Oa(e,f,l),n!==null&&(Jt(n,e,l),_o(n,e,l))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var s=cn(),l=Ma(s);l.tag=2,n!=null&&(l.callback=n),n=Oa(e,l,s),n!==null&&(Jt(n,e,s),_o(n,e,s))}};function Jm(e,n,s,l,f,h,_){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,h,_):n.prototype&&n.prototype.isPureReactComponent?!ho(s,l)||!ho(f,h):!0}function eg(e,n,s,l){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,l),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,l),n.state!==e&&Zu.enqueueReplaceState(n,n.state,null)}function Ss(e,n){var s=n;if("ref"in n){s={};for(var l in n)l!=="ref"&&(s[l]=n[l])}if(e=e.defaultProps){s===n&&(s=y({},s));for(var f in e)s[f]===void 0&&(s[f]=e[f])}return s}function tg(e){Hl(e)}function ng(e){console.error(e)}function ag(e){Hl(e)}function ur(e,n){try{var s=e.onUncaughtError;s(n.value,{componentStack:n.stack})}catch(l){setTimeout(function(){throw l})}}function sg(e,n,s){try{var l=e.onCaughtError;l(s.value,{componentStack:s.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Xu(e,n,s){return s=Ma(s),s.tag=3,s.payload={element:null},s.callback=function(){ur(e,n)},s}function ig(e){return e=Ma(e),e.tag=3,e}function og(e,n,s,l){var f=s.type.getDerivedStateFromError;if(typeof f=="function"){var h=l.value;e.payload=function(){return f(h)},e.callback=function(){sg(n,s,l)}}var _=s.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(e.callback=function(){sg(n,s,l),typeof f!="function"&&(Va===null?Va=new Set([this]):Va.add(this));var k=l.stack;this.componentDidCatch(l.value,{componentStack:k!==null?k:""})})}function q1(e,n,s,l,f){if(s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(n=s.alternate,n!==null&&ui(n,s,f,!0),s=sn.current,s!==null){switch(s.tag){case 31:case 13:return kn===null?Sr():s.alternate===null&&ft===0&&(ft=3),s.flags&=-257,s.flags|=65536,s.lanes=f,l===Ql?s.flags|=16384:(n=s.updateQueue,n===null?s.updateQueue=new Set([l]):n.add(l),_d(e,l,f)),!1;case 22:return s.flags|=65536,l===Ql?s.flags|=16384:(n=s.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([l])},s.updateQueue=n):(s=n.retryQueue,s===null?n.retryQueue=new Set([l]):s.add(l)),_d(e,l,f)),!1}throw Error(o(435,s.tag))}return _d(e,l,f),Sr(),!1}if(Me)return n=sn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,l!==mu&&(e=Error(o(422),{cause:l}),go(xn(e,s)))):(l!==mu&&(n=Error(o(423),{cause:l}),go(xn(n,s))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,l=xn(l,s),f=Xu(e.stateNode,l,f),Eu(e,f),ft!==4&&(ft=2)),!1;var h=Error(o(520),{cause:l});if(h=xn(h,s),Bo===null?Bo=[h]:Bo.push(h),ft!==4&&(ft=2),n===null)return!0;l=xn(l,s),s=n;do{switch(s.tag){case 3:return s.flags|=65536,e=f&-f,s.lanes|=e,e=Xu(s.stateNode,l,e),Eu(s,e),!1;case 1:if(n=s.type,h=s.stateNode,(s.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Va===null||!Va.has(h))))return s.flags|=65536,f&=-f,s.lanes|=f,f=ig(f),og(f,e,s,l),Eu(s,f),!1}s=s.return}while(s!==null);return!1}var Qu=Error(o(461)),_t=!1;function It(e,n,s,l){n.child=e===null?um(n,null,s,l):xs(n,e.child,s,l)}function lg(e,n,s,l,f){s=s.render;var h=n.ref;if("ref"in l){var _={};for(var k in l)k!=="ref"&&(_[k]=l[k])}else _=l;return gs(n),l=Ru(e,n,s,_,h,f),k=Mu(),e!==null&&!_t?(Ou(e,n,f),la(e,n,f)):(Me&&k&&hu(n),n.flags|=1,It(e,n,l,f),n.child)}function rg(e,n,s,l,f){if(e===null){var h=s.type;return typeof h=="function"&&!uu(h)&&h.defaultProps===void 0&&s.compare===null?(n.tag=15,n.type=h,cg(e,n,h,l,f)):(e=Fl(s.type,null,l,n,n.mode,f),e.ref=n.ref,e.return=n,n.child=e)}if(h=e.child,!id(e,f)){var _=h.memoizedProps;if(s=s.compare,s=s!==null?s:ho,s(_,l)&&e.ref===n.ref)return la(e,n,f)}return n.flags|=1,e=ta(h,l),e.ref=n.ref,e.return=n,n.child=e}function cg(e,n,s,l,f){if(e!==null){var h=e.memoizedProps;if(ho(h,l)&&e.ref===n.ref)if(_t=!1,n.pendingProps=l=h,id(e,f))(e.flags&131072)!==0&&(_t=!0);else return n.lanes=e.lanes,la(e,n,f)}return Wu(e,n,s,l,f)}function ug(e,n,s,l){var f=l.children,h=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((n.flags&128)!==0){if(h=h!==null?h.baseLanes|s:s,e!==null){for(l=n.child=e.child,f=0;l!==null;)f=f|l.lanes|l.childLanes,l=l.sibling;l=f&~h}else l=0,n.child=null;return dg(e,n,h,s,l)}if((s&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Zl(n,h!==null?h.cachePool:null),h!==null?hm(n,h):ju(),pm(n);else return l=n.lanes=536870912,dg(e,n,h!==null?h.baseLanes|s:s,s,l)}else h!==null?(Zl(n,h.cachePool),hm(n,h),Ia(),n.memoizedState=null):(e!==null&&Zl(n,null),ju(),Ia());return It(e,n,f,s),n.child}function jo(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function dg(e,n,s,l,f){var h=Su();return h=h===null?null:{parent:bt._currentValue,pool:h},n.memoizedState={baseLanes:s,cachePool:h},e!==null&&Zl(n,null),ju(),pm(n),e!==null&&ui(e,n,l,!0),n.childLanes=f,null}function dr(e,n){return n=hr({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function fg(e,n,s){return xs(n,e.child,null,s),e=dr(n,n.pendingProps),e.flags|=2,on(n),n.memoizedState=null,e}function K1(e,n,s){var l=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Me){if(l.mode==="hidden")return e=dr(n,l),n.lanes=536870912,jo(null,e);if(Au(n),(e=at)?(e=kv(e,Tn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:ja!==null?{id:zn,overflow:Vn}:null,retryLane:536870912,hydrationErrors:null},s=Zp(e),s.return=n,n.child=s,Ot=n,at=null)):e=null,e===null)throw Aa(n);return n.lanes=536870912,null}return dr(n,l)}var h=e.memoizedState;if(h!==null){var _=h.dehydrated;if(Au(n),f)if(n.flags&256)n.flags&=-257,n=fg(e,n,s);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(o(558));else if(_t||ui(e,n,s,!1),f=(s&e.childLanes)!==0,_t||f){if(l=We,l!==null&&(_=np(l,s),_!==0&&_!==h.retryLane))throw h.retryLane=_,fs(e,_),Jt(l,e,_),Qu;Sr(),n=fg(e,n,s)}else e=h.treeContext,at=Cn(_.nextSibling),Ot=n,Me=!0,wa=null,Tn=!1,e!==null&&Wp(n,e),n=dr(n,l),n.flags|=4096;return n}return e=ta(e.child,{mode:l.mode,children:l.children}),e.ref=n.ref,n.child=e,e.return=n,e}function fr(e,n){var s=n.ref;if(s===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(o(284));(e===null||e.ref!==s)&&(n.flags|=4194816)}}function Wu(e,n,s,l,f){return gs(n),s=Ru(e,n,s,l,void 0,f),l=Mu(),e!==null&&!_t?(Ou(e,n,f),la(e,n,f)):(Me&&l&&hu(n),n.flags|=1,It(e,n,s,f),n.child)}function hg(e,n,s,l,f,h){return gs(n),n.updateQueue=null,s=gm(n,l,s,f),mm(e),l=Mu(),e!==null&&!_t?(Ou(e,n,h),la(e,n,h)):(Me&&l&&hu(n),n.flags|=1,It(e,n,s,h),n.child)}function pg(e,n,s,l,f){if(gs(n),n.stateNode===null){var h=oi,_=s.contextType;typeof _=="object"&&_!==null&&(h=Bt(_)),h=new s(l,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Zu,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=l,h.state=n.memoizedState,h.refs={},ku(n),_=s.contextType,h.context=typeof _=="object"&&_!==null?Bt(_):oi,h.state=n.memoizedState,_=s.getDerivedStateFromProps,typeof _=="function"&&(Yu(n,s,_,l),h.state=n.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),To(n,l,h,f),So(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),l=!0}else if(e===null){h=n.stateNode;var k=n.memoizedProps,A=Ss(s,k);h.props=A;var P=h.context,Z=s.contextType;_=oi,typeof Z=="object"&&Z!==null&&(_=Bt(Z));var J=s.getDerivedStateFromProps;Z=typeof J=="function"||typeof h.getSnapshotBeforeUpdate=="function",k=n.pendingProps!==k,Z||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(k||P!==_)&&eg(n,h,l,_),Ra=!1;var $=n.memoizedState;h.state=$,To(n,l,h,f),So(),P=n.memoizedState,k||$!==P||Ra?(typeof J=="function"&&(Yu(n,s,J,l),P=n.memoizedState),(A=Ra||Jm(n,s,A,l,$,P,_))?(Z||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(n.flags|=4194308)):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=l,n.memoizedState=P),h.props=l,h.state=P,h.context=_,l=A):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),l=!1)}else{h=n.stateNode,Cu(e,n),_=n.memoizedProps,Z=Ss(s,_),h.props=Z,J=n.pendingProps,$=h.context,P=s.contextType,A=oi,typeof P=="object"&&P!==null&&(A=Bt(P)),k=s.getDerivedStateFromProps,(P=typeof k=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(_!==J||$!==A)&&eg(n,h,l,A),Ra=!1,$=n.memoizedState,h.state=$,To(n,l,h,f),So();var K=n.memoizedState;_!==J||$!==K||Ra||e!==null&&e.dependencies!==null&&Kl(e.dependencies)?(typeof k=="function"&&(Yu(n,s,k,l),K=n.memoizedState),(Z=Ra||Jm(n,s,Z,l,$,K,A)||e!==null&&e.dependencies!==null&&Kl(e.dependencies))?(P||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(l,K,A),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(l,K,A)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||_===e.memoizedProps&&$===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&$===e.memoizedState||(n.flags|=1024),n.memoizedProps=l,n.memoizedState=K),h.props=l,h.state=K,h.context=A,l=Z):(typeof h.componentDidUpdate!="function"||_===e.memoizedProps&&$===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&$===e.memoizedState||(n.flags|=1024),l=!1)}return h=l,fr(e,n),l=(n.flags&128)!==0,h||l?(h=n.stateNode,s=l&&typeof s.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,e!==null&&l?(n.child=xs(n,e.child,null,f),n.child=xs(n,null,s,f)):It(e,n,s,f),n.memoizedState=h.state,e=n.child):e=la(e,n,f),e}function mg(e,n,s,l){return ps(),n.flags|=256,It(e,n,s,l),n.child}var Ju={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ed(e){return{baseLanes:e,cachePool:sm()}}function td(e,n,s){return e=e!==null?e.childLanes&~s:0,n&&(e|=rn),e}function gg(e,n,s){var l=n.pendingProps,f=!1,h=(n.flags&128)!==0,_;if((_=h)||(_=e!==null&&e.memoizedState===null?!1:(mt.current&2)!==0),_&&(f=!0,n.flags&=-129),_=(n.flags&32)!==0,n.flags&=-33,e===null){if(Me){if(f?Ba(n):Ia(),(e=at)?(e=kv(e,Tn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:ja!==null?{id:zn,overflow:Vn}:null,retryLane:536870912,hydrationErrors:null},s=Zp(e),s.return=n,n.child=s,Ot=n,at=null)):e=null,e===null)throw Aa(n);return Ld(e)?n.lanes=32:n.lanes=536870912,null}var k=l.children;return l=l.fallback,f?(Ia(),f=n.mode,k=hr({mode:"hidden",children:k},f),l=hs(l,f,s,null),k.return=n,l.return=n,k.sibling=l,n.child=k,l=n.child,l.memoizedState=ed(s),l.childLanes=td(e,_,s),n.memoizedState=Ju,jo(null,l)):(Ba(n),nd(n,k))}var A=e.memoizedState;if(A!==null&&(k=A.dehydrated,k!==null)){if(h)n.flags&256?(Ba(n),n.flags&=-257,n=ad(e,n,s)):n.memoizedState!==null?(Ia(),n.child=e.child,n.flags|=128,n=null):(Ia(),k=l.fallback,f=n.mode,l=hr({mode:"visible",children:l.children},f),k=hs(k,f,s,null),k.flags|=2,l.return=n,k.return=n,l.sibling=k,n.child=l,xs(n,e.child,null,s),l=n.child,l.memoizedState=ed(s),l.childLanes=td(e,_,s),n.memoizedState=Ju,n=jo(null,l));else if(Ba(n),Ld(k)){if(_=k.nextSibling&&k.nextSibling.dataset,_)var P=_.dgst;_=P,l=Error(o(419)),l.stack="",l.digest=_,go({value:l,source:null,stack:null}),n=ad(e,n,s)}else if(_t||ui(e,n,s,!1),_=(s&e.childLanes)!==0,_t||_){if(_=We,_!==null&&(l=np(_,s),l!==0&&l!==A.retryLane))throw A.retryLane=l,fs(e,l),Jt(_,e,l),Qu;Id(k)||Sr(),n=ad(e,n,s)}else Id(k)?(n.flags|=192,n.child=e.child,n=null):(e=A.treeContext,at=Cn(k.nextSibling),Ot=n,Me=!0,wa=null,Tn=!1,e!==null&&Wp(n,e),n=nd(n,l.children),n.flags|=4096);return n}return f?(Ia(),k=l.fallback,f=n.mode,A=e.child,P=A.sibling,l=ta(A,{mode:"hidden",children:l.children}),l.subtreeFlags=A.subtreeFlags&65011712,P!==null?k=ta(P,k):(k=hs(k,f,s,null),k.flags|=2),k.return=n,l.return=n,l.sibling=k,n.child=l,jo(null,l),l=n.child,k=e.child.memoizedState,k===null?k=ed(s):(f=k.cachePool,f!==null?(A=bt._currentValue,f=f.parent!==A?{parent:A,pool:A}:f):f=sm(),k={baseLanes:k.baseLanes|s,cachePool:f}),l.memoizedState=k,l.childLanes=td(e,_,s),n.memoizedState=Ju,jo(e.child,l)):(Ba(n),s=e.child,e=s.sibling,s=ta(s,{mode:"visible",children:l.children}),s.return=n,s.sibling=null,e!==null&&(_=n.deletions,_===null?(n.deletions=[e],n.flags|=16):_.push(e)),n.child=s,n.memoizedState=null,s)}function nd(e,n){return n=hr({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function hr(e,n){return e=an(22,e,null,n),e.lanes=0,e}function ad(e,n,s){return xs(n,e.child,null,s),e=nd(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function vg(e,n,s){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n),yu(e.return,n,s)}function sd(e,n,s,l,f,h){var _=e.memoizedState;_===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:l,tail:s,tailMode:f,treeForkCount:h}:(_.isBackwards=n,_.rendering=null,_.renderingStartTime=0,_.last=l,_.tail=s,_.tailMode=f,_.treeForkCount=h)}function yg(e,n,s){var l=n.pendingProps,f=l.revealOrder,h=l.tail;l=l.children;var _=mt.current,k=(_&2)!==0;if(k?(_=_&1|2,n.flags|=128):_&=1,re(mt,_),It(e,n,l,s),l=Me?mo:0,!k&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&vg(e,s,n);else if(e.tag===19)vg(e,s,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(f){case"forwards":for(s=n.child,f=null;s!==null;)e=s.alternate,e!==null&&tr(e)===null&&(f=s),s=s.sibling;s=f,s===null?(f=n.child,n.child=null):(f=s.sibling,s.sibling=null),sd(n,!1,f,s,h,l);break;case"backwards":case"unstable_legacy-backwards":for(s=null,f=n.child,n.child=null;f!==null;){if(e=f.alternate,e!==null&&tr(e)===null){n.child=f;break}e=f.sibling,f.sibling=s,s=f,f=e}sd(n,!0,s,null,h,l);break;case"together":sd(n,!1,null,null,void 0,l);break;default:n.memoizedState=null}return n.child}function la(e,n,s){if(e!==null&&(n.dependencies=e.dependencies),za|=n.lanes,(s&n.childLanes)===0)if(e!==null){if(ui(e,n,s,!1),(s&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(o(153));if(n.child!==null){for(e=n.child,s=ta(e,e.pendingProps),n.child=s,s.return=n;e.sibling!==null;)e=e.sibling,s=s.sibling=ta(e,e.pendingProps),s.return=n;s.sibling=null}return n.child}function id(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Kl(e)))}function Y1(e,n,s){switch(n.tag){case 3:mn(n,n.stateNode.containerInfo),Da(n,bt,e.memoizedState.cache),ps();break;case 27:case 5:Ln(n);break;case 4:mn(n,n.stateNode.containerInfo);break;case 10:Da(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Au(n),null;break;case 13:var l=n.memoizedState;if(l!==null)return l.dehydrated!==null?(Ba(n),n.flags|=128,null):(s&n.child.childLanes)!==0?gg(e,n,s):(Ba(n),e=la(e,n,s),e!==null?e.sibling:null);Ba(n);break;case 19:var f=(e.flags&128)!==0;if(l=(s&n.childLanes)!==0,l||(ui(e,n,s,!1),l=(s&n.childLanes)!==0),f){if(l)return yg(e,n,s);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),re(mt,mt.current),l)break;return null;case 22:return n.lanes=0,ug(e,n,s,n.pendingProps);case 24:Da(n,bt,e.memoizedState.cache)}return la(e,n,s)}function bg(e,n,s){if(e!==null)if(e.memoizedProps!==n.pendingProps)_t=!0;else{if(!id(e,s)&&(n.flags&128)===0)return _t=!1,Y1(e,n,s);_t=(e.flags&131072)!==0}else _t=!1,Me&&(n.flags&1048576)!==0&&Qp(n,mo,n.index);switch(n.lanes=0,n.tag){case 16:e:{var l=n.pendingProps;if(e=ys(n.elementType),n.type=e,typeof e=="function")uu(e)?(l=Ss(e,l),n.tag=1,n=pg(null,n,e,l,s)):(n.tag=0,n=Wu(null,n,e,l,s));else{if(e!=null){var f=e.$$typeof;if(f===R){n.tag=11,n=lg(null,n,e,l,s);break e}else if(f===H){n.tag=14,n=rg(null,n,e,l,s);break e}}throw n=z(e)||e,Error(o(306,n,""))}}return n;case 0:return Wu(e,n,n.type,n.pendingProps,s);case 1:return l=n.type,f=Ss(l,n.pendingProps),pg(e,n,l,f,s);case 3:e:{if(mn(n,n.stateNode.containerInfo),e===null)throw Error(o(387));l=n.pendingProps;var h=n.memoizedState;f=h.element,Cu(e,n),To(n,l,null,s);var _=n.memoizedState;if(l=_.cache,Da(n,bt,l),l!==h.cache&&bu(n,[bt],s,!0),So(),l=_.element,h.isDehydrated)if(h={element:l,isDehydrated:!1,cache:_.cache},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){n=mg(e,n,l,s);break e}else if(l!==f){f=xn(Error(o(424)),n),go(f),n=mg(e,n,l,s);break e}else{switch(e=n.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(at=Cn(e.firstChild),Ot=n,Me=!0,wa=null,Tn=!0,s=um(n,null,l,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(ps(),l===f){n=la(e,n,s);break e}It(e,n,l,s)}n=n.child}return n;case 26:return fr(e,n),e===null?(s=Av(n.type,null,n.pendingProps,null))?n.memoizedState=s:Me||(s=n.type,e=n.pendingProps,l=wr(fe.current).createElement(s),l[Mt]=n,l[Kt]=e,Lt(l,s,e),wt(l),n.stateNode=l):n.memoizedState=Av(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return Ln(n),e===null&&Me&&(l=n.stateNode=Nv(n.type,n.pendingProps,fe.current),Ot=n,Tn=!0,f=at,$a(n.type)?(Ud=f,at=Cn(l.firstChild)):at=f),It(e,n,n.pendingProps.children,s),fr(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Me&&((f=l=at)&&(l=kS(l,n.type,n.pendingProps,Tn),l!==null?(n.stateNode=l,Ot=n,at=Cn(l.firstChild),Tn=!1,f=!0):f=!1),f||Aa(n)),Ln(n),f=n.type,h=n.pendingProps,_=e!==null?e.memoizedProps:null,l=h.children,Md(f,h)?l=null:_!==null&&Md(f,_)&&(n.flags|=32),n.memoizedState!==null&&(f=Ru(e,n,z1,null,null,s),Go._currentValue=f),fr(e,n),It(e,n,l,s),n.child;case 6:return e===null&&Me&&((e=s=at)&&(s=CS(s,n.pendingProps,Tn),s!==null?(n.stateNode=s,Ot=n,at=null,e=!0):e=!1),e||Aa(n)),null;case 13:return gg(e,n,s);case 4:return mn(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=xs(n,null,l,s):It(e,n,l,s),n.child;case 11:return lg(e,n,n.type,n.pendingProps,s);case 7:return It(e,n,n.pendingProps,s),n.child;case 8:return It(e,n,n.pendingProps.children,s),n.child;case 12:return It(e,n,n.pendingProps.children,s),n.child;case 10:return l=n.pendingProps,Da(n,n.type,l.value),It(e,n,l.children,s),n.child;case 9:return f=n.type._context,l=n.pendingProps.children,gs(n),f=Bt(f),l=l(f),n.flags|=1,It(e,n,l,s),n.child;case 14:return rg(e,n,n.type,n.pendingProps,s);case 15:return cg(e,n,n.type,n.pendingProps,s);case 19:return yg(e,n,s);case 31:return K1(e,n,s);case 22:return ug(e,n,s,n.pendingProps);case 24:return gs(n),l=Bt(bt),e===null?(f=Su(),f===null&&(f=We,h=xu(),f.pooledCache=h,h.refCount++,h!==null&&(f.pooledCacheLanes|=s),f=h),n.memoizedState={parent:l,cache:f},ku(n),Da(n,bt,f)):((e.lanes&s)!==0&&(Cu(e,n),To(n,null,null,s),So()),f=e.memoizedState,h=n.memoizedState,f.parent!==l?(f={parent:l,cache:l},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),Da(n,bt,l)):(l=h.cache,Da(n,bt,l),l!==f.cache&&bu(n,[bt],s,!0))),It(e,n,n.pendingProps.children,s),n.child;case 29:throw n.pendingProps}throw Error(o(156,n.tag))}function ra(e){e.flags|=4}function od(e,n,s,l,f){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(f&335544128)===f)if(e.stateNode.complete)e.flags|=8192;else if(qg())e.flags|=8192;else throw bs=Ql,Tu}else e.flags&=-16777217}function xg(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Bv(n))if(qg())e.flags|=8192;else throw bs=Ql,Tu}function pr(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Jh():536870912,e.lanes|=n,Si|=n)}function wo(e,n){if(!Me)switch(e.tailMode){case"hidden":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function st(e){var n=e.alternate!==null&&e.alternate.child===e.child,s=0,l=0;if(n)for(var f=e.child;f!==null;)s|=f.lanes|f.childLanes,l|=f.subtreeFlags&65011712,l|=f.flags&65011712,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)s|=f.lanes|f.childLanes,l|=f.subtreeFlags,l|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=l,e.childLanes=s,n}function Z1(e,n,s){var l=n.pendingProps;switch(pu(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return st(n),null;case 1:return st(n),null;case 3:return s=n.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),sa(bt),Rn(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ci(n)?ra(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,gu())),st(n),null;case 26:var f=n.type,h=n.memoizedState;return e===null?(ra(n),h!==null?(st(n),xg(n,h)):(st(n),od(n,f,null,l,s))):h?h!==e.memoizedState?(ra(n),st(n),xg(n,h)):(st(n),n.flags&=-16777217):(e=e.memoizedProps,e!==l&&ra(n),st(n),od(n,f,e,l,s)),null;case 27:if(Te(n),s=fe.current,f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==l&&ra(n);else{if(!l){if(n.stateNode===null)throw Error(o(166));return st(n),null}e=Ke.current,ci(n)?Jp(n):(e=Nv(f,l,s),n.stateNode=e,ra(n))}return st(n),null;case 5:if(Te(n),f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==l&&ra(n);else{if(!l){if(n.stateNode===null)throw Error(o(166));return st(n),null}if(h=Ke.current,ci(n))Jp(n);else{var _=wr(fe.current);switch(h){case 1:h=_.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:h=_.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":h=_.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":h=_.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":h=_.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof l.is=="string"?_.createElement("select",{is:l.is}):_.createElement("select"),l.multiple?h.multiple=!0:l.size&&(h.size=l.size);break;default:h=typeof l.is=="string"?_.createElement(f,{is:l.is}):_.createElement(f)}}h[Mt]=n,h[Kt]=l;e:for(_=n.child;_!==null;){if(_.tag===5||_.tag===6)h.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===n)break e;for(;_.sibling===null;){if(_.return===null||_.return===n)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}n.stateNode=h;e:switch(Lt(h,f,l),f){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&ra(n)}}return st(n),od(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,s),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==l&&ra(n);else{if(typeof l!="string"&&n.stateNode===null)throw Error(o(166));if(e=fe.current,ci(n)){if(e=n.stateNode,s=n.memoizedProps,l=null,f=Ot,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}e[Mt]=n,e=!!(e.nodeValue===s||l!==null&&l.suppressHydrationWarning===!0||gv(e.nodeValue,s)),e||Aa(n,!0)}else e=wr(e).createTextNode(l),e[Mt]=n,n.stateNode=e}return st(n),null;case 31:if(s=n.memoizedState,e===null||e.memoizedState!==null){if(l=ci(n),s!==null){if(e===null){if(!l)throw Error(o(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[Mt]=n}else ps(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;st(n),e=!1}else s=gu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return n.flags&256?(on(n),n):(on(n),null);if((n.flags&128)!==0)throw Error(o(558))}return st(n),null;case 13:if(l=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=ci(n),l!==null&&l.dehydrated!==null){if(e===null){if(!f)throw Error(o(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(o(317));f[Mt]=n}else ps(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;st(n),f=!1}else f=gu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(on(n),n):(on(n),null)}return on(n),(n.flags&128)!==0?(n.lanes=s,n):(s=l!==null,e=e!==null&&e.memoizedState!==null,s&&(l=n.child,f=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(f=l.alternate.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==f&&(l.flags|=2048)),s!==e&&s&&(n.child.flags|=8192),pr(n,n.updateQueue),st(n),null);case 4:return Rn(),e===null&&jd(n.stateNode.containerInfo),st(n),null;case 10:return sa(n.type),st(n),null;case 19:if(xe(mt),l=n.memoizedState,l===null)return st(n),null;if(f=(n.flags&128)!==0,h=l.rendering,h===null)if(f)wo(l,!1);else{if(ft!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(h=tr(e),h!==null){for(n.flags|=128,wo(l,!1),e=h.updateQueue,n.updateQueue=e,pr(n,e),n.subtreeFlags=0,e=s,s=n.child;s!==null;)Yp(s,e),s=s.sibling;return re(mt,mt.current&1|2),Me&&na(n,l.treeForkCount),n.child}e=e.sibling}l.tail!==null&&zt()>br&&(n.flags|=128,f=!0,wo(l,!1),n.lanes=4194304)}else{if(!f)if(e=tr(h),e!==null){if(n.flags|=128,f=!0,e=e.updateQueue,n.updateQueue=e,pr(n,e),wo(l,!0),l.tail===null&&l.tailMode==="hidden"&&!h.alternate&&!Me)return st(n),null}else 2*zt()-l.renderingStartTime>br&&s!==536870912&&(n.flags|=128,f=!0,wo(l,!1),n.lanes=4194304);l.isBackwards?(h.sibling=n.child,n.child=h):(e=l.last,e!==null?e.sibling=h:n.child=h,l.last=h)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=zt(),e.sibling=null,s=mt.current,re(mt,f?s&1|2:s&1),Me&&na(n,l.treeForkCount),e):(st(n),null);case 22:case 23:return on(n),wu(),l=n.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(n.flags|=8192):l&&(n.flags|=8192),l?(s&536870912)!==0&&(n.flags&128)===0&&(st(n),n.subtreeFlags&6&&(n.flags|=8192)):st(n),s=n.updateQueue,s!==null&&pr(n,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),l=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),l!==s&&(n.flags|=2048),e!==null&&xe(vs),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),sa(bt),st(n),null;case 25:return null;case 30:return null}throw Error(o(156,n.tag))}function X1(e,n){switch(pu(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return sa(bt),Rn(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return Te(n),null;case 31:if(n.memoizedState!==null){if(on(n),n.alternate===null)throw Error(o(340));ps()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(on(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(o(340));ps()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return xe(mt),null;case 4:return Rn(),null;case 10:return sa(n.type),null;case 22:case 23:return on(n),wu(),e!==null&&xe(vs),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return sa(bt),null;case 25:return null;default:return null}}function _g(e,n){switch(pu(n),n.tag){case 3:sa(bt),Rn();break;case 26:case 27:case 5:Te(n);break;case 4:Rn();break;case 31:n.memoizedState!==null&&on(n);break;case 13:on(n);break;case 19:xe(mt);break;case 10:sa(n.type);break;case 22:case 23:on(n),wu(),e!==null&&xe(vs);break;case 24:sa(bt)}}function Ao(e,n){try{var s=n.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var f=l.next;s=f;do{if((s.tag&e)===e){l=void 0;var h=s.create,_=s.inst;l=h(),_.destroy=l}s=s.next}while(s!==f)}}catch(k){Fe(n,n.return,k)}}function La(e,n,s){try{var l=n.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var h=f.next;l=h;do{if((l.tag&e)===e){var _=l.inst,k=_.destroy;if(k!==void 0){_.destroy=void 0,f=n;var A=s,P=k;try{P()}catch(Z){Fe(f,A,Z)}}}l=l.next}while(l!==h)}}catch(Z){Fe(n,n.return,Z)}}function Sg(e){var n=e.updateQueue;if(n!==null){var s=e.stateNode;try{fm(n,s)}catch(l){Fe(e,e.return,l)}}}function Tg(e,n,s){s.props=Ss(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(l){Fe(e,n,l)}}function Do(e,n){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof s=="function"?e.refCleanup=s(l):s.current=l}}catch(f){Fe(e,n,f)}}function Hn(e,n){var s=e.ref,l=e.refCleanup;if(s!==null)if(typeof l=="function")try{l()}catch(f){Fe(e,n,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(f){Fe(e,n,f)}else s.current=null}function kg(e){var n=e.type,s=e.memoizedProps,l=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":s.autoFocus&&l.focus();break e;case"img":s.src?l.src=s.src:s.srcSet&&(l.srcset=s.srcSet)}}catch(f){Fe(e,e.return,f)}}function ld(e,n,s){try{var l=e.stateNode;yS(l,e.type,s,n),l[Kt]=n}catch(f){Fe(e,e.return,f)}}function Cg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&$a(e.type)||e.tag===4}function rd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Cg(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&&$a(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 cd(e,n,s){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,n):(n=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,n.appendChild(e),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=Jn));else if(l!==4&&(l===27&&$a(e.type)&&(s=e.stateNode,n=null),e=e.child,e!==null))for(cd(e,n,s),e=e.sibling;e!==null;)cd(e,n,s),e=e.sibling}function mr(e,n,s){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?s.insertBefore(e,n):s.appendChild(e);else if(l!==4&&(l===27&&$a(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(mr(e,n,s),e=e.sibling;e!==null;)mr(e,n,s),e=e.sibling}function Eg(e){var n=e.stateNode,s=e.memoizedProps;try{for(var l=e.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);Lt(n,l,s),n[Mt]=e,n[Kt]=s}catch(h){Fe(e,e.return,h)}}var ca=!1,St=!1,ud=!1,Ng=typeof WeakSet=="function"?WeakSet:Set,At=null;function Q1(e,n){if(e=e.containerInfo,Dd=Ir,e=zp(e),au(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var l=s.getSelection&&s.getSelection();if(l&&l.rangeCount!==0){s=l.anchorNode;var f=l.anchorOffset,h=l.focusNode;l=l.focusOffset;try{s.nodeType,h.nodeType}catch{s=null;break e}var _=0,k=-1,A=-1,P=0,Z=0,J=e,$=null;t:for(;;){for(var K;J!==s||f!==0&&J.nodeType!==3||(k=_+f),J!==h||l!==0&&J.nodeType!==3||(A=_+l),J.nodeType===3&&(_+=J.nodeValue.length),(K=J.firstChild)!==null;)$=J,J=K;for(;;){if(J===e)break t;if($===s&&++P===f&&(k=_),$===h&&++Z===l&&(A=_),(K=J.nextSibling)!==null)break;J=$,$=J.parentNode}J=K}s=k===-1||A===-1?null:{start:k,end:A}}else s=null}s=s||{start:0,end:0}}else s=null;for(Rd={focusedElem:e,selectionRange:s},Ir=!1,At=n;At!==null;)if(n=At,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,At=e;else for(;At!==null;){switch(n=At,h=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(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=n,f=h.memoizedProps,h=h.memoizedState,l=s.stateNode;try{var ue=Ss(s.type,f);e=l.getSnapshotBeforeUpdate(ue,h),l.__reactInternalSnapshotBeforeUpdate=e}catch(ve){Fe(s,s.return,ve)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,s=e.nodeType,s===9)Bd(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Bd(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(o(163))}if(e=n.sibling,e!==null){e.return=n.return,At=e;break}At=n.return}}function jg(e,n,s){var l=s.flags;switch(s.tag){case 0:case 11:case 15:da(e,s),l&4&&Ao(5,s);break;case 1:if(da(e,s),l&4)if(e=s.stateNode,n===null)try{e.componentDidMount()}catch(_){Fe(s,s.return,_)}else{var f=Ss(s.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(f,n,e.__reactInternalSnapshotBeforeUpdate)}catch(_){Fe(s,s.return,_)}}l&64&&Sg(s),l&512&&Do(s,s.return);break;case 3:if(da(e,s),l&64&&(e=s.updateQueue,e!==null)){if(n=null,s.child!==null)switch(s.child.tag){case 27:case 5:n=s.child.stateNode;break;case 1:n=s.child.stateNode}try{fm(e,n)}catch(_){Fe(s,s.return,_)}}break;case 27:n===null&&l&4&&Eg(s);case 26:case 5:da(e,s),n===null&&l&4&&kg(s),l&512&&Do(s,s.return);break;case 12:da(e,s);break;case 31:da(e,s),l&4&&Dg(e,s);break;case 13:da(e,s),l&4&&Rg(e,s),l&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=oS.bind(null,s),ES(e,s))));break;case 22:if(l=s.memoizedState!==null||ca,!l){n=n!==null&&n.memoizedState!==null||St,f=ca;var h=St;ca=l,(St=n)&&!h?fa(e,s,(s.subtreeFlags&8772)!==0):da(e,s),ca=f,St=h}break;case 30:break;default:da(e,s)}}function wg(e){var n=e.alternate;n!==null&&(e.alternate=null,wg(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&Vc(n)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var rt=null,Zt=!1;function ua(e,n,s){for(s=s.child;s!==null;)Ag(e,n,s),s=s.sibling}function Ag(e,n,s){if(je&&typeof je.onCommitFiberUnmount=="function")try{je.onCommitFiberUnmount(Je,s)}catch{}switch(s.tag){case 26:St||Hn(s,n),ua(e,n,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:St||Hn(s,n);var l=rt,f=Zt;$a(s.type)&&(rt=s.stateNode,Zt=!1),ua(e,n,s),Vo(s.stateNode),rt=l,Zt=f;break;case 5:St||Hn(s,n);case 6:if(l=rt,f=Zt,rt=null,ua(e,n,s),rt=l,Zt=f,rt!==null)if(Zt)try{(rt.nodeType===9?rt.body:rt.nodeName==="HTML"?rt.ownerDocument.body:rt).removeChild(s.stateNode)}catch(h){Fe(s,n,h)}else try{rt.removeChild(s.stateNode)}catch(h){Fe(s,n,h)}break;case 18:rt!==null&&(Zt?(e=rt,Sv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Ai(e)):Sv(rt,s.stateNode));break;case 4:l=rt,f=Zt,rt=s.stateNode.containerInfo,Zt=!0,ua(e,n,s),rt=l,Zt=f;break;case 0:case 11:case 14:case 15:La(2,s,n),St||La(4,s,n),ua(e,n,s);break;case 1:St||(Hn(s,n),l=s.stateNode,typeof l.componentWillUnmount=="function"&&Tg(s,n,l)),ua(e,n,s);break;case 21:ua(e,n,s);break;case 22:St=(l=St)||s.memoizedState!==null,ua(e,n,s),St=l;break;default:ua(e,n,s)}}function Dg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ai(e)}catch(s){Fe(n,n.return,s)}}}function Rg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ai(e)}catch(s){Fe(n,n.return,s)}}function W1(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new Ng),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new Ng),n;default:throw Error(o(435,e.tag))}}function gr(e,n){var s=W1(e);n.forEach(function(l){if(!s.has(l)){s.add(l);var f=lS.bind(null,e,l);l.then(f,f)}})}function Xt(e,n){var s=n.deletions;if(s!==null)for(var l=0;l<s.length;l++){var f=s[l],h=e,_=n,k=_;e:for(;k!==null;){switch(k.tag){case 27:if($a(k.type)){rt=k.stateNode,Zt=!1;break e}break;case 5:rt=k.stateNode,Zt=!1;break e;case 3:case 4:rt=k.stateNode.containerInfo,Zt=!0;break e}k=k.return}if(rt===null)throw Error(o(160));Ag(h,_,f),rt=null,Zt=!1,h=f.alternate,h!==null&&(h.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Mg(n,e),n=n.sibling}var On=null;function Mg(e,n){var s=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Xt(n,e),Qt(e),l&4&&(La(3,e,e.return),Ao(3,e),La(5,e,e.return));break;case 1:Xt(n,e),Qt(e),l&512&&(St||s===null||Hn(s,s.return)),l&64&&ca&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?l:s.concat(l))));break;case 26:var f=On;if(Xt(n,e),Qt(e),l&512&&(St||s===null||Hn(s,s.return)),l&4){var h=s!==null?s.memoizedState:null;if(l=e.memoizedState,s===null)if(l===null)if(e.stateNode===null){e:{l=e.type,s=e.memoizedProps,f=f.ownerDocument||f;t:switch(l){case"title":h=f.getElementsByTagName("title")[0],(!h||h[ao]||h[Mt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=f.createElement(l),f.head.insertBefore(h,f.querySelector("head > title"))),Lt(h,l,s),h[Mt]=e,wt(h),l=h;break e;case"link":var _=Mv("link","href",f).get(l+(s.href||""));if(_){for(var k=0;k<_.length;k++)if(h=_[k],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(k,1);break t}}h=f.createElement(l),Lt(h,l,s),f.head.appendChild(h);break;case"meta":if(_=Mv("meta","content",f).get(l+(s.content||""))){for(k=0;k<_.length;k++)if(h=_[k],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(k,1);break t}}h=f.createElement(l),Lt(h,l,s),f.head.appendChild(h);break;default:throw Error(o(468,l))}h[Mt]=e,wt(h),l=h}e.stateNode=l}else Ov(f,e.type,e.stateNode);else e.stateNode=Rv(f,l,e.memoizedProps);else h!==l?(h===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):h.count--,l===null?Ov(f,e.type,e.stateNode):Rv(f,l,e.memoizedProps)):l===null&&e.stateNode!==null&&ld(e,e.memoizedProps,s.memoizedProps)}break;case 27:Xt(n,e),Qt(e),l&512&&(St||s===null||Hn(s,s.return)),s!==null&&l&4&&ld(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Xt(n,e),Qt(e),l&512&&(St||s===null||Hn(s,s.return)),e.flags&32){f=e.stateNode;try{Js(f,"")}catch(ue){Fe(e,e.return,ue)}}l&4&&e.stateNode!=null&&(f=e.memoizedProps,ld(e,f,s!==null?s.memoizedProps:f)),l&1024&&(ud=!0);break;case 6:if(Xt(n,e),Qt(e),l&4){if(e.stateNode===null)throw Error(o(162));l=e.memoizedProps,s=e.stateNode;try{s.nodeValue=l}catch(ue){Fe(e,e.return,ue)}}break;case 3:if(Rr=null,f=On,On=Ar(n.containerInfo),Xt(n,e),On=f,Qt(e),l&4&&s!==null&&s.memoizedState.isDehydrated)try{Ai(n.containerInfo)}catch(ue){Fe(e,e.return,ue)}ud&&(ud=!1,Og(e));break;case 4:l=On,On=Ar(e.stateNode.containerInfo),Xt(n,e),Qt(e),On=l;break;case 12:Xt(n,e),Qt(e);break;case 31:Xt(n,e),Qt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,gr(e,l)));break;case 13:Xt(n,e),Qt(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(yr=zt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,gr(e,l)));break;case 22:f=e.memoizedState!==null;var A=s!==null&&s.memoizedState!==null,P=ca,Z=St;if(ca=P||f,St=Z||A,Xt(n,e),St=Z,ca=P,Qt(e),l&8192)e:for(n=e.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(s===null||A||ca||St||Ts(e)),s=null,n=e;;){if(n.tag===5||n.tag===26){if(s===null){A=s=n;try{if(h=A.stateNode,f)_=h.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{k=A.stateNode;var J=A.memoizedProps.style,$=J!=null&&J.hasOwnProperty("display")?J.display:null;k.style.display=$==null||typeof $=="boolean"?"":(""+$).trim()}}catch(ue){Fe(A,A.return,ue)}}}else if(n.tag===6){if(s===null){A=n;try{A.stateNode.nodeValue=f?"":A.memoizedProps}catch(ue){Fe(A,A.return,ue)}}}else if(n.tag===18){if(s===null){A=n;try{var K=A.stateNode;f?Tv(K,!0):Tv(A.stateNode,!1)}catch(ue){Fe(A,A.return,ue)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;s===n&&(s=null),n=n.return}s===n&&(s=null),n.sibling.return=n.return,n=n.sibling}l&4&&(l=e.updateQueue,l!==null&&(s=l.retryQueue,s!==null&&(l.retryQueue=null,gr(e,s))));break;case 19:Xt(n,e),Qt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,gr(e,l)));break;case 30:break;case 21:break;default:Xt(n,e),Qt(e)}}function Qt(e){var n=e.flags;if(n&2){try{for(var s,l=e.return;l!==null;){if(Cg(l)){s=l;break}l=l.return}if(s==null)throw Error(o(160));switch(s.tag){case 27:var f=s.stateNode,h=rd(e);mr(e,h,f);break;case 5:var _=s.stateNode;s.flags&32&&(Js(_,""),s.flags&=-33);var k=rd(e);mr(e,k,_);break;case 3:case 4:var A=s.stateNode.containerInfo,P=rd(e);cd(e,P,A);break;default:throw Error(o(161))}}catch(Z){Fe(e,e.return,Z)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Og(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Og(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function da(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)jg(e,n.alternate,n),n=n.sibling}function Ts(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:La(4,n,n.return),Ts(n);break;case 1:Hn(n,n.return);var s=n.stateNode;typeof s.componentWillUnmount=="function"&&Tg(n,n.return,s),Ts(n);break;case 27:Vo(n.stateNode);case 26:case 5:Hn(n,n.return),Ts(n);break;case 22:n.memoizedState===null&&Ts(n);break;case 30:Ts(n);break;default:Ts(n)}e=e.sibling}}function fa(e,n,s){for(s=s&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var l=n.alternate,f=e,h=n,_=h.flags;switch(h.tag){case 0:case 11:case 15:fa(f,h,s),Ao(4,h);break;case 1:if(fa(f,h,s),l=h,f=l.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(P){Fe(l,l.return,P)}if(l=h,f=l.updateQueue,f!==null){var k=l.stateNode;try{var A=f.shared.hiddenCallbacks;if(A!==null)for(f.shared.hiddenCallbacks=null,f=0;f<A.length;f++)dm(A[f],k)}catch(P){Fe(l,l.return,P)}}s&&_&64&&Sg(h),Do(h,h.return);break;case 27:Eg(h);case 26:case 5:fa(f,h,s),s&&l===null&&_&4&&kg(h),Do(h,h.return);break;case 12:fa(f,h,s);break;case 31:fa(f,h,s),s&&_&4&&Dg(f,h);break;case 13:fa(f,h,s),s&&_&4&&Rg(f,h);break;case 22:h.memoizedState===null&&fa(f,h,s),Do(h,h.return);break;case 30:break;default:fa(f,h,s)}n=n.sibling}}function dd(e,n){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&vo(s))}function fd(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&vo(e))}function Bn(e,n,s,l){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Bg(e,n,s,l),n=n.sibling}function Bg(e,n,s,l){var f=n.flags;switch(n.tag){case 0:case 11:case 15:Bn(e,n,s,l),f&2048&&Ao(9,n);break;case 1:Bn(e,n,s,l);break;case 3:Bn(e,n,s,l),f&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&vo(e)));break;case 12:if(f&2048){Bn(e,n,s,l),e=n.stateNode;try{var h=n.memoizedProps,_=h.id,k=h.onPostCommit;typeof k=="function"&&k(_,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(A){Fe(n,n.return,A)}}else Bn(e,n,s,l);break;case 31:Bn(e,n,s,l);break;case 13:Bn(e,n,s,l);break;case 23:break;case 22:h=n.stateNode,_=n.alternate,n.memoizedState!==null?h._visibility&2?Bn(e,n,s,l):Ro(e,n):h._visibility&2?Bn(e,n,s,l):(h._visibility|=2,bi(e,n,s,l,(n.subtreeFlags&10256)!==0||!1)),f&2048&&dd(_,n);break;case 24:Bn(e,n,s,l),f&2048&&fd(n.alternate,n);break;default:Bn(e,n,s,l)}}function bi(e,n,s,l,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=e,_=n,k=s,A=l,P=_.flags;switch(_.tag){case 0:case 11:case 15:bi(h,_,k,A,f),Ao(8,_);break;case 23:break;case 22:var Z=_.stateNode;_.memoizedState!==null?Z._visibility&2?bi(h,_,k,A,f):Ro(h,_):(Z._visibility|=2,bi(h,_,k,A,f)),f&&P&2048&&dd(_.alternate,_);break;case 24:bi(h,_,k,A,f),f&&P&2048&&fd(_.alternate,_);break;default:bi(h,_,k,A,f)}n=n.sibling}}function Ro(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var s=e,l=n,f=l.flags;switch(l.tag){case 22:Ro(s,l),f&2048&&dd(l.alternate,l);break;case 24:Ro(s,l),f&2048&&fd(l.alternate,l);break;default:Ro(s,l)}n=n.sibling}}var Mo=8192;function xi(e,n,s){if(e.subtreeFlags&Mo)for(e=e.child;e!==null;)Ig(e,n,s),e=e.sibling}function Ig(e,n,s){switch(e.tag){case 26:xi(e,n,s),e.flags&Mo&&e.memoizedState!==null&&US(s,On,e.memoizedState,e.memoizedProps);break;case 5:xi(e,n,s);break;case 3:case 4:var l=On;On=Ar(e.stateNode.containerInfo),xi(e,n,s),On=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Mo,Mo=16777216,xi(e,n,s),Mo=l):xi(e,n,s));break;default:xi(e,n,s)}}function Lg(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function Oo(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var l=n[s];At=l,zg(l,e)}Lg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ug(e),e=e.sibling}function Ug(e){switch(e.tag){case 0:case 11:case 15:Oo(e),e.flags&2048&&La(9,e,e.return);break;case 3:Oo(e);break;case 12:Oo(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,vr(e)):Oo(e);break;default:Oo(e)}}function vr(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var l=n[s];At=l,zg(l,e)}Lg(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:La(8,n,n.return),vr(n);break;case 22:s=n.stateNode,s._visibility&2&&(s._visibility&=-3,vr(n));break;default:vr(n)}e=e.sibling}}function zg(e,n){for(;At!==null;){var s=At;switch(s.tag){case 0:case 11:case 15:La(8,s,n);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var l=s.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:vo(s.memoizedState.cache)}if(l=s.child,l!==null)l.return=s,At=l;else e:for(s=e;At!==null;){l=At;var f=l.sibling,h=l.return;if(wg(l),l===s){At=null;break e}if(f!==null){f.return=h,At=f;break e}At=h}}}var J1={getCacheForType:function(e){var n=Bt(bt),s=n.data.get(e);return s===void 0&&(s=e(),n.data.set(e,s)),s},cacheSignal:function(){return Bt(bt).controller.signal}},eS=typeof WeakMap=="function"?WeakMap:Map,Ve=0,We=null,we=null,De=0,$e=0,ln=null,Ua=!1,_i=!1,hd=!1,ha=0,ft=0,za=0,ks=0,pd=0,rn=0,Si=0,Bo=null,Wt=null,md=!1,yr=0,Vg=0,br=1/0,xr=null,Va=null,Et=0,Ha=null,Ti=null,pa=0,gd=0,vd=null,Hg=null,Io=0,yd=null;function cn(){return(Ve&2)!==0&&De!==0?De&-De:I.T!==null?kd():ap()}function Pg(){if(rn===0)if((De&536870912)===0||Me){var e=gn;gn<<=1,(gn&3932160)===0&&(gn=262144),rn=e}else rn=536870912;return e=sn.current,e!==null&&(e.flags|=32),rn}function Jt(e,n,s){(e===We&&($e===2||$e===9)||e.cancelPendingCommit!==null)&&(ki(e,0),Pa(e,De,rn,!1)),no(e,s),((Ve&2)===0||e!==We)&&(e===We&&((Ve&2)===0&&(ks|=s),ft===4&&Pa(e,De,rn,!1)),Pn(e))}function Gg(e,n,s){if((Ve&6)!==0)throw Error(o(327));var l=!s&&(n&127)===0&&(n&e.expiredLanes)===0||to(e,n),f=l?aS(e,n):xd(e,n,!0),h=l;do{if(f===0){_i&&!l&&Pa(e,n,0,!1);break}else{if(s=e.current.alternate,h&&!tS(s)){f=xd(e,n,!1),h=!1;continue}if(f===2){if(h=n,e.errorRecoveryDisabledLanes&h)var _=0;else _=e.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){n=_;e:{var k=e;f=Bo;var A=k.current.memoizedState.isDehydrated;if(A&&(ki(k,_).flags|=256),_=xd(k,_,!1),_!==2){if(hd&&!A){k.errorRecoveryDisabledLanes|=h,ks|=h,f=4;break e}h=Wt,Wt=f,h!==null&&(Wt===null?Wt=h:Wt.push.apply(Wt,h))}f=_}if(h=!1,f!==2)continue}}if(f===1){ki(e,0),Pa(e,n,0,!0);break}e:{switch(l=e,h=f,h){case 0:case 1:throw Error(o(345));case 4:if((n&4194048)!==n)break;case 6:Pa(l,n,rn,!Ua);break e;case 2:Wt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((n&62914560)===n&&(f=yr+300-zt(),10<f)){if(Pa(l,n,rn,!Ua),Al(l,0,!0)!==0)break e;pa=n,l.timeoutHandle=xv($g.bind(null,l,s,Wt,xr,md,n,rn,ks,Si,Ua,h,"Throttled",-0,0),f);break e}$g(l,s,Wt,xr,md,n,rn,ks,Si,Ua,h,null,-0,0)}}break}while(!0);Pn(e)}function $g(e,n,s,l,f,h,_,k,A,P,Z,J,$,K){if(e.timeoutHandle=-1,J=n.subtreeFlags,J&8192||(J&16785408)===16785408){J={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Jn},Ig(n,h,J);var ue=(h&62914560)===h?yr-zt():(h&4194048)===h?Vg-zt():0;if(ue=zS(J,ue),ue!==null){pa=h,e.cancelPendingCommit=ue(Wg.bind(null,e,n,h,s,l,f,_,k,A,Z,J,null,$,K)),Pa(e,h,_,!P);return}}Wg(e,n,h,s,l,f,_,k,A)}function tS(e){for(var n=e;;){var s=n.tag;if((s===0||s===11||s===15)&&n.flags&16384&&(s=n.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var l=0;l<s.length;l++){var f=s[l],h=f.getSnapshot;f=f.value;try{if(!nn(h(),f))return!1}catch{return!1}}if(s=n.child,n.subtreeFlags&16384&&s!==null)s.return=n,n=s;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Pa(e,n,s,l){n&=~pd,n&=~ks,e.suspendedLanes|=n,e.pingedLanes&=~n,l&&(e.warmLanes|=n),l=e.expirationTimes;for(var f=n;0<f;){var h=31-Pe(f),_=1<<h;l[h]=-1,f&=~_}s!==0&&ep(e,s,n)}function _r(){return(Ve&6)===0?(Lo(0),!1):!0}function bd(){if(we!==null){if($e===0)var e=we.return;else e=we,aa=ms=null,Bu(e),pi=null,bo=0,e=we;for(;e!==null;)_g(e.alternate,e),e=e.return;we=null}}function ki(e,n){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,_S(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),pa=0,bd(),We=e,we=s=ta(e.current,null),De=n,$e=0,ln=null,Ua=!1,_i=to(e,n),hd=!1,Si=rn=pd=ks=za=ft=0,Wt=Bo=null,md=!1,(n&8)!==0&&(n|=n&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=n;0<l;){var f=31-Pe(l),h=1<<f;n|=e[f],l&=~h}return ha=n,Pl(),s}function Fg(e,n){ke=null,I.H=No,n===hi||n===Xl?(n=lm(),$e=3):n===Tu?(n=lm(),$e=4):$e=n===Qu?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,ln=n,we===null&&(ft=1,ur(e,xn(n,e.current)))}function qg(){var e=sn.current;return e===null?!0:(De&4194048)===De?kn===null:(De&62914560)===De||(De&536870912)!==0?e===kn:!1}function Kg(){var e=I.H;return I.H=No,e===null?No:e}function Yg(){var e=I.A;return I.A=J1,e}function Sr(){ft=4,Ua||(De&4194048)!==De&&sn.current!==null||(_i=!0),(za&134217727)===0&&(ks&134217727)===0||We===null||Pa(We,De,rn,!1)}function xd(e,n,s){var l=Ve;Ve|=2;var f=Kg(),h=Yg();(We!==e||De!==n)&&(xr=null,ki(e,n)),n=!1;var _=ft;e:do try{if($e!==0&&we!==null){var k=we,A=ln;switch($e){case 8:bd(),_=6;break e;case 3:case 2:case 9:case 6:sn.current===null&&(n=!0);var P=$e;if($e=0,ln=null,Ci(e,k,A,P),s&&_i){_=0;break e}break;default:P=$e,$e=0,ln=null,Ci(e,k,A,P)}}nS(),_=ft;break}catch(Z){Fg(e,Z)}while(!0);return n&&e.shellSuspendCounter++,aa=ms=null,Ve=l,I.H=f,I.A=h,we===null&&(We=null,De=0,Pl()),_}function nS(){for(;we!==null;)Zg(we)}function aS(e,n){var s=Ve;Ve|=2;var l=Kg(),f=Yg();We!==e||De!==n?(xr=null,br=zt()+500,ki(e,n)):_i=to(e,n);e:do try{if($e!==0&&we!==null){n=we;var h=ln;t:switch($e){case 1:$e=0,ln=null,Ci(e,n,h,1);break;case 2:case 9:if(im(h)){$e=0,ln=null,Xg(n);break}n=function(){$e!==2&&$e!==9||We!==e||($e=7),Pn(e)},h.then(n,n);break e;case 3:$e=7;break e;case 4:$e=5;break e;case 7:im(h)?($e=0,ln=null,Xg(n)):($e=0,ln=null,Ci(e,n,h,7));break;case 5:var _=null;switch(we.tag){case 26:_=we.memoizedState;case 5:case 27:var k=we;if(_?Bv(_):k.stateNode.complete){$e=0,ln=null;var A=k.sibling;if(A!==null)we=A;else{var P=k.return;P!==null?(we=P,Tr(P)):we=null}break t}}$e=0,ln=null,Ci(e,n,h,5);break;case 6:$e=0,ln=null,Ci(e,n,h,6);break;case 8:bd(),ft=6;break e;default:throw Error(o(462))}}sS();break}catch(Z){Fg(e,Z)}while(!0);return aa=ms=null,I.H=l,I.A=f,Ve=s,we!==null?0:(We=null,De=0,Pl(),ft)}function sS(){for(;we!==null&&!jl();)Zg(we)}function Zg(e){var n=bg(e.alternate,e,ha);e.memoizedProps=e.pendingProps,n===null?Tr(e):we=n}function Xg(e){var n=e,s=n.alternate;switch(n.tag){case 15:case 0:n=hg(s,n,n.pendingProps,n.type,void 0,De);break;case 11:n=hg(s,n,n.pendingProps,n.type.render,n.ref,De);break;case 5:Bu(n);default:_g(s,n),n=we=Yp(n,ha),n=bg(s,n,ha)}e.memoizedProps=e.pendingProps,n===null?Tr(e):we=n}function Ci(e,n,s,l){aa=ms=null,Bu(n),pi=null,bo=0;var f=n.return;try{if(q1(e,f,n,s,De)){ft=1,ur(e,xn(s,e.current)),we=null;return}}catch(h){if(f!==null)throw we=f,h;ft=1,ur(e,xn(s,e.current)),we=null;return}n.flags&32768?(Me||l===1?e=!0:_i||(De&536870912)!==0?e=!1:(Ua=e=!0,(l===2||l===9||l===3||l===6)&&(l=sn.current,l!==null&&l.tag===13&&(l.flags|=16384))),Qg(n,e)):Tr(n)}function Tr(e){var n=e;do{if((n.flags&32768)!==0){Qg(n,Ua);return}e=n.return;var s=Z1(n.alternate,n,ha);if(s!==null){we=s;return}if(n=n.sibling,n!==null){we=n;return}we=n=e}while(n!==null);ft===0&&(ft=5)}function Qg(e,n){do{var s=X1(e.alternate,e);if(s!==null){s.flags&=32767,we=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!n&&(e=e.sibling,e!==null)){we=e;return}we=e=s}while(e!==null);ft=6,we=null}function Wg(e,n,s,l,f,h,_,k,A){e.cancelPendingCommit=null;do kr();while(Et!==0);if((Ve&6)!==0)throw Error(o(327));if(n!==null){if(n===e.current)throw Error(o(177));if(h=n.lanes|n.childLanes,h|=ru,L_(e,s,h,_,k,A),e===We&&(we=We=null,De=0),Ti=n,Ha=e,pa=s,gd=h,vd=f,Hg=l,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,rS(ce,function(){return av(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||l){l=I.T,I.T=null,f=Y.p,Y.p=2,_=Ve,Ve|=4;try{Q1(e,n,s)}finally{Ve=_,Y.p=f,I.T=l}}Et=1,Jg(),ev(),tv()}}function Jg(){if(Et===1){Et=0;var e=Ha,n=Ti,s=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||s){s=I.T,I.T=null;var l=Y.p;Y.p=2;var f=Ve;Ve|=4;try{Mg(n,e);var h=Rd,_=zp(e.containerInfo),k=h.focusedElem,A=h.selectionRange;if(_!==k&&k&&k.ownerDocument&&Up(k.ownerDocument.documentElement,k)){if(A!==null&&au(k)){var P=A.start,Z=A.end;if(Z===void 0&&(Z=P),"selectionStart"in k)k.selectionStart=P,k.selectionEnd=Math.min(Z,k.value.length);else{var J=k.ownerDocument||document,$=J&&J.defaultView||window;if($.getSelection){var K=$.getSelection(),ue=k.textContent.length,ve=Math.min(A.start,ue),Xe=A.end===void 0?ve:Math.min(A.end,ue);!K.extend&&ve>Xe&&(_=Xe,Xe=ve,ve=_);var L=Lp(k,ve),M=Lp(k,Xe);if(L&&M&&(K.rangeCount!==1||K.anchorNode!==L.node||K.anchorOffset!==L.offset||K.focusNode!==M.node||K.focusOffset!==M.offset)){var V=J.createRange();V.setStart(L.node,L.offset),K.removeAllRanges(),ve>Xe?(K.addRange(V),K.extend(M.node,M.offset)):(V.setEnd(M.node,M.offset),K.addRange(V))}}}}for(J=[],K=k;K=K.parentNode;)K.nodeType===1&&J.push({element:K,left:K.scrollLeft,top:K.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<J.length;k++){var Q=J[k];Q.element.scrollLeft=Q.left,Q.element.scrollTop=Q.top}}Ir=!!Dd,Rd=Dd=null}finally{Ve=f,Y.p=l,I.T=s}}e.current=n,Et=2}}function ev(){if(Et===2){Et=0;var e=Ha,n=Ti,s=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||s){s=I.T,I.T=null;var l=Y.p;Y.p=2;var f=Ve;Ve|=4;try{jg(e,n.alternate,n)}finally{Ve=f,Y.p=l,I.T=s}}Et=3}}function tv(){if(Et===4||Et===3){Et=0,wl();var e=Ha,n=Ti,s=pa,l=Hg;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Et=5:(Et=0,Ti=Ha=null,nv(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(Va=null),Uc(s),n=n.stateNode,je&&typeof je.onCommitFiberRoot=="function")try{je.onCommitFiberRoot(Je,n,void 0,(n.current.flags&128)===128)}catch{}if(l!==null){n=I.T,f=Y.p,Y.p=2,I.T=null;try{for(var h=e.onRecoverableError,_=0;_<l.length;_++){var k=l[_];h(k.value,{componentStack:k.stack})}}finally{I.T=n,Y.p=f}}(pa&3)!==0&&kr(),Pn(e),f=e.pendingLanes,(s&261930)!==0&&(f&42)!==0?e===yd?Io++:(Io=0,yd=e):Io=0,Lo(0)}}function nv(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,vo(n)))}function kr(){return Jg(),ev(),tv(),av()}function av(){if(Et!==5)return!1;var e=Ha,n=gd;gd=0;var s=Uc(pa),l=I.T,f=Y.p;try{Y.p=32>s?32:s,I.T=null,s=vd,vd=null;var h=Ha,_=pa;if(Et=0,Ti=Ha=null,pa=0,(Ve&6)!==0)throw Error(o(331));var k=Ve;if(Ve|=4,Ug(h.current),Bg(h,h.current,_,s),Ve=k,Lo(0,!1),je&&typeof je.onPostCommitFiberRoot=="function")try{je.onPostCommitFiberRoot(Je,h)}catch{}return!0}finally{Y.p=f,I.T=l,nv(e,n)}}function sv(e,n,s){n=xn(s,n),n=Xu(e.stateNode,n,2),e=Oa(e,n,2),e!==null&&(no(e,2),Pn(e))}function Fe(e,n,s){if(e.tag===3)sv(e,e,s);else for(;n!==null;){if(n.tag===3){sv(n,e,s);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Va===null||!Va.has(l))){e=xn(s,e),s=ig(2),l=Oa(n,s,2),l!==null&&(og(s,l,n,e),no(l,2),Pn(l));break}}n=n.return}}function _d(e,n,s){var l=e.pingCache;if(l===null){l=e.pingCache=new eS;var f=new Set;l.set(n,f)}else f=l.get(n),f===void 0&&(f=new Set,l.set(n,f));f.has(s)||(hd=!0,f.add(s),e=iS.bind(null,e,n,s),n.then(e,e))}function iS(e,n,s){var l=e.pingCache;l!==null&&l.delete(n),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,We===e&&(De&s)===s&&(ft===4||ft===3&&(De&62914560)===De&&300>zt()-yr?(Ve&2)===0&&ki(e,0):pd|=s,Si===De&&(Si=0)),Pn(e)}function iv(e,n){n===0&&(n=Jh()),e=fs(e,n),e!==null&&(no(e,n),Pn(e))}function oS(e){var n=e.memoizedState,s=0;n!==null&&(s=n.retryLane),iv(e,s)}function lS(e,n){var s=0;switch(e.tag){case 31:case 13:var l=e.stateNode,f=e.memoizedState;f!==null&&(s=f.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(n),iv(e,s)}function rS(e,n){return Fs(e,n)}var Cr=null,Ei=null,Sd=!1,Er=!1,Td=!1,Ga=0;function Pn(e){e!==Ei&&e.next===null&&(Ei===null?Cr=Ei=e:Ei=Ei.next=e),Er=!0,Sd||(Sd=!0,uS())}function Lo(e,n){if(!Td&&Er){Td=!0;do for(var s=!1,l=Cr;l!==null;){if(e!==0){var f=l.pendingLanes;if(f===0)var h=0;else{var _=l.suspendedLanes,k=l.pingedLanes;h=(1<<31-Pe(42|e)+1)-1,h&=f&~(_&~k),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(s=!0,cv(l,h))}else h=De,h=Al(l,l===We?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(h&3)===0||to(l,h)||(s=!0,cv(l,h));l=l.next}while(s);Td=!1}}function cS(){ov()}function ov(){Er=Sd=!1;var e=0;Ga!==0&&xS()&&(e=Ga);for(var n=zt(),s=null,l=Cr;l!==null;){var f=l.next,h=lv(l,n);h===0?(l.next=null,s===null?Cr=f:s.next=f,f===null&&(Ei=s)):(s=l,(e!==0||(h&3)!==0)&&(Er=!0)),l=f}Et!==0&&Et!==5||Lo(e),Ga!==0&&(Ga=0)}function lv(e,n){for(var s=e.suspendedLanes,l=e.pingedLanes,f=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var _=31-Pe(h),k=1<<_,A=f[_];A===-1?((k&s)===0||(k&l)!==0)&&(f[_]=I_(k,n)):A<=n&&(e.expiredLanes|=k),h&=~k}if(n=We,s=De,s=Al(e,e===n?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,s===0||e===n&&($e===2||$e===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&qs(l),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||to(e,s)){if(n=s&-s,n===e.callbackPriority)return n;switch(l!==null&&qs(l),Uc(s)){case 2:case 8:s=le;break;case 32:s=ce;break;case 268435456:s=ge;break;default:s=ce}return l=rv.bind(null,e),s=Fs(s,l),e.callbackPriority=n,e.callbackNode=s,n}return l!==null&&l!==null&&qs(l),e.callbackPriority=2,e.callbackNode=null,2}function rv(e,n){if(Et!==0&&Et!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(kr()&&e.callbackNode!==s)return null;var l=De;return l=Al(e,e===We?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Gg(e,l,n),lv(e,zt()),e.callbackNode!=null&&e.callbackNode===s?rv.bind(null,e):null)}function cv(e,n){if(kr())return null;Gg(e,n,!0)}function uS(){SS(function(){(Ve&6)!==0?Fs(W,cS):ov()})}function kd(){if(Ga===0){var e=di;e===0&&(e=ka,ka<<=1,(ka&261888)===0&&(ka=256)),Ga=e}return Ga}function uv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ol(""+e)}function dv(e,n){var s=n.ownerDocument.createElement("input");return s.name=n.name,s.value=n.value,e.id&&s.setAttribute("form",e.id),n.parentNode.insertBefore(s,n),e=new FormData(e),s.parentNode.removeChild(s),e}function dS(e,n,s,l,f){if(n==="submit"&&s&&s.stateNode===f){var h=uv((f[Kt]||null).action),_=l.submitter;_&&(n=(n=_[Kt]||null)?uv(n.formAction):_.getAttribute("formAction"),n!==null&&(h=n,_=null));var k=new Ul("action","action",null,l,f);e.push({event:k,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Ga!==0){var A=_?dv(f,_):new FormData(f);$u(s,{pending:!0,data:A,method:f.method,action:h},null,A)}}else typeof h=="function"&&(k.preventDefault(),A=_?dv(f,_):new FormData(f),$u(s,{pending:!0,data:A,method:f.method,action:h},h,A))},currentTarget:f}]})}}for(var Cd=0;Cd<lu.length;Cd++){var Ed=lu[Cd],fS=Ed.toLowerCase(),hS=Ed[0].toUpperCase()+Ed.slice(1);Mn(fS,"on"+hS)}Mn(Pp,"onAnimationEnd"),Mn(Gp,"onAnimationIteration"),Mn($p,"onAnimationStart"),Mn("dblclick","onDoubleClick"),Mn("focusin","onFocus"),Mn("focusout","onBlur"),Mn(w1,"onTransitionRun"),Mn(A1,"onTransitionStart"),Mn(D1,"onTransitionCancel"),Mn(Fp,"onTransitionEnd"),Qs("onMouseEnter",["mouseout","mouseover"]),Qs("onMouseLeave",["mouseout","mouseover"]),Qs("onPointerEnter",["pointerout","pointerover"]),Qs("onPointerLeave",["pointerout","pointerover"]),rs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),rs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),rs("onBeforeInput",["compositionend","keypress","textInput","paste"]),rs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),rs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),rs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Uo="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(" "),pS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Uo));function fv(e,n){n=(n&4)!==0;for(var s=0;s<e.length;s++){var l=e[s],f=l.event;l=l.listeners;e:{var h=void 0;if(n)for(var _=l.length-1;0<=_;_--){var k=l[_],A=k.instance,P=k.currentTarget;if(k=k.listener,A!==h&&f.isPropagationStopped())break e;h=k,f.currentTarget=P;try{h(f)}catch(Z){Hl(Z)}f.currentTarget=null,h=A}else for(_=0;_<l.length;_++){if(k=l[_],A=k.instance,P=k.currentTarget,k=k.listener,A!==h&&f.isPropagationStopped())break e;h=k,f.currentTarget=P;try{h(f)}catch(Z){Hl(Z)}f.currentTarget=null,h=A}}}}function Ae(e,n){var s=n[zc];s===void 0&&(s=n[zc]=new Set);var l=e+"__bubble";s.has(l)||(hv(n,e,2,!1),s.add(l))}function Nd(e,n,s){var l=0;n&&(l|=4),hv(s,e,l,n)}var Nr="_reactListening"+Math.random().toString(36).slice(2);function jd(e){if(!e[Nr]){e[Nr]=!0,op.forEach(function(s){s!=="selectionchange"&&(pS.has(s)||Nd(s,!1,e),Nd(s,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Nr]||(n[Nr]=!0,Nd("selectionchange",!1,n))}}function hv(e,n,s,l){switch(Pv(n)){case 2:var f=PS;break;case 8:f=GS;break;default:f=Gd}s=f.bind(null,n,s,e),f=void 0,!Yc||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),l?f!==void 0?e.addEventListener(n,s,{capture:!0,passive:f}):e.addEventListener(n,s,!0):f!==void 0?e.addEventListener(n,s,{passive:f}):e.addEventListener(n,s,!1)}function wd(e,n,s,l,f){var h=l;if((n&1)===0&&(n&2)===0&&l!==null)e:for(;;){if(l===null)return;var _=l.tag;if(_===3||_===4){var k=l.stateNode.containerInfo;if(k===f)break;if(_===4)for(_=l.return;_!==null;){var A=_.tag;if((A===3||A===4)&&_.stateNode.containerInfo===f)return;_=_.return}for(;k!==null;){if(_=Ys(k),_===null)return;if(A=_.tag,A===5||A===6||A===26||A===27){l=h=_;continue e}k=k.parentNode}}l=l.return}yp(function(){var P=h,Z=qc(s),J=[];e:{var $=qp.get(e);if($!==void 0){var K=Ul,ue=e;switch(e){case"keypress":if(Il(s)===0)break e;case"keydown":case"keyup":K=l1;break;case"focusin":ue="focus",K=Wc;break;case"focusout":ue="blur",K=Wc;break;case"beforeblur":case"afterblur":K=Wc;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":K=_p;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":K=Z_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":K=u1;break;case Pp:case Gp:case $p:K=W_;break;case Fp:K=f1;break;case"scroll":case"scrollend":K=K_;break;case"wheel":K=p1;break;case"copy":case"cut":case"paste":K=e1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":K=Tp;break;case"toggle":case"beforetoggle":K=g1}var ve=(n&4)!==0,Xe=!ve&&(e==="scroll"||e==="scrollend"),L=ve?$!==null?$+"Capture":null:$;ve=[];for(var M=P,V;M!==null;){var Q=M;if(V=Q.stateNode,Q=Q.tag,Q!==5&&Q!==26&&Q!==27||V===null||L===null||(Q=io(M,L),Q!=null&&ve.push(zo(M,Q,V))),Xe)break;M=M.return}0<ve.length&&($=new K($,ue,null,s,Z),J.push({event:$,listeners:ve}))}}if((n&7)===0){e:{if($=e==="mouseover"||e==="pointerover",K=e==="mouseout"||e==="pointerout",$&&s!==Fc&&(ue=s.relatedTarget||s.fromElement)&&(Ys(ue)||ue[Ks]))break e;if((K||$)&&($=Z.window===Z?Z:($=Z.ownerDocument)?$.defaultView||$.parentWindow:window,K?(ue=s.relatedTarget||s.toElement,K=P,ue=ue?Ys(ue):null,ue!==null&&(Xe=u(ue),ve=ue.tag,ue!==Xe||ve!==5&&ve!==27&&ve!==6)&&(ue=null)):(K=null,ue=P),K!==ue)){if(ve=_p,Q="onMouseLeave",L="onMouseEnter",M="mouse",(e==="pointerout"||e==="pointerover")&&(ve=Tp,Q="onPointerLeave",L="onPointerEnter",M="pointer"),Xe=K==null?$:so(K),V=ue==null?$:so(ue),$=new ve(Q,M+"leave",K,s,Z),$.target=Xe,$.relatedTarget=V,Q=null,Ys(Z)===P&&(ve=new ve(L,M+"enter",ue,s,Z),ve.target=V,ve.relatedTarget=Xe,Q=ve),Xe=Q,K&&ue)t:{for(ve=mS,L=K,M=ue,V=0,Q=L;Q;Q=ve(Q))V++;Q=0;for(var pe=M;pe;pe=ve(pe))Q++;for(;0<V-Q;)L=ve(L),V--;for(;0<Q-V;)M=ve(M),Q--;for(;V--;){if(L===M||M!==null&&L===M.alternate){ve=L;break t}L=ve(L),M=ve(M)}ve=null}else ve=null;K!==null&&pv(J,$,K,ve,!1),ue!==null&&Xe!==null&&pv(J,Xe,ue,ve,!0)}}e:{if($=P?so(P):window,K=$.nodeName&&$.nodeName.toLowerCase(),K==="select"||K==="input"&&$.type==="file")var Le=Dp;else if(wp($))if(Rp)Le=E1;else{Le=k1;var he=T1}else K=$.nodeName,!K||K.toLowerCase()!=="input"||$.type!=="checkbox"&&$.type!=="radio"?P&&$c(P.elementType)&&(Le=Dp):Le=C1;if(Le&&(Le=Le(e,P))){Ap(J,Le,s,Z);break e}he&&he(e,$,P),e==="focusout"&&P&&$.type==="number"&&P.memoizedProps.value!=null&&Gc($,"number",$.value)}switch(he=P?so(P):window,e){case"focusin":(wp(he)||he.contentEditable==="true")&&(ai=he,su=P,po=null);break;case"focusout":po=su=ai=null;break;case"mousedown":iu=!0;break;case"contextmenu":case"mouseup":case"dragend":iu=!1,Vp(J,s,Z);break;case"selectionchange":if(j1)break;case"keydown":case"keyup":Vp(J,s,Z)}var Ce;if(eu)e:{switch(e){case"compositionstart":var Re="onCompositionStart";break e;case"compositionend":Re="onCompositionEnd";break e;case"compositionupdate":Re="onCompositionUpdate";break e}Re=void 0}else ni?Np(e,s)&&(Re="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Re="onCompositionStart");Re&&(kp&&s.locale!=="ko"&&(ni||Re!=="onCompositionStart"?Re==="onCompositionEnd"&&ni&&(Ce=bp()):(Na=Z,Zc="value"in Na?Na.value:Na.textContent,ni=!0)),he=jr(P,Re),0<he.length&&(Re=new Sp(Re,e,null,s,Z),J.push({event:Re,listeners:he}),Ce?Re.data=Ce:(Ce=jp(s),Ce!==null&&(Re.data=Ce)))),(Ce=y1?b1(e,s):x1(e,s))&&(Re=jr(P,"onBeforeInput"),0<Re.length&&(he=new Sp("onBeforeInput","beforeinput",null,s,Z),J.push({event:he,listeners:Re}),he.data=Ce)),dS(J,e,P,s,Z)}fv(J,n)})}function zo(e,n,s){return{instance:e,listener:n,currentTarget:s}}function jr(e,n){for(var s=n+"Capture",l=[];e!==null;){var f=e,h=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||h===null||(f=io(e,s),f!=null&&l.unshift(zo(e,f,h)),f=io(e,n),f!=null&&l.push(zo(e,f,h))),e.tag===3)return l;e=e.return}return[]}function mS(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function pv(e,n,s,l,f){for(var h=n._reactName,_=[];s!==null&&s!==l;){var k=s,A=k.alternate,P=k.stateNode;if(k=k.tag,A!==null&&A===l)break;k!==5&&k!==26&&k!==27||P===null||(A=P,f?(P=io(s,h),P!=null&&_.unshift(zo(s,P,A))):f||(P=io(s,h),P!=null&&_.push(zo(s,P,A)))),s=s.return}_.length!==0&&e.push({event:n,listeners:_})}var gS=/\r\n?/g,vS=/\u0000|\uFFFD/g;function mv(e){return(typeof e=="string"?e:""+e).replace(gS,`
26
- `).replace(vS,"")}function gv(e,n){return n=mv(n),mv(e)===n}function Ze(e,n,s,l,f,h){switch(s){case"children":typeof l=="string"?n==="body"||n==="textarea"&&l===""||Js(e,l):(typeof l=="number"||typeof l=="bigint")&&n!=="body"&&Js(e,""+l);break;case"className":Rl(e,"class",l);break;case"tabIndex":Rl(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Rl(e,s,l);break;case"style":gp(e,l,h);break;case"data":if(n!=="object"){Rl(e,"data",l);break}case"src":case"href":if(l===""&&(n!=="a"||s!=="href")){e.removeAttribute(s);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=Ol(""+l),e.setAttribute(s,l);break;case"action":case"formAction":if(typeof l=="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"?(n!=="input"&&Ze(e,n,"name",f.name,f,null),Ze(e,n,"formEncType",f.formEncType,f,null),Ze(e,n,"formMethod",f.formMethod,f,null),Ze(e,n,"formTarget",f.formTarget,f,null)):(Ze(e,n,"encType",f.encType,f,null),Ze(e,n,"method",f.method,f,null),Ze(e,n,"target",f.target,f,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=Ol(""+l),e.setAttribute(s,l);break;case"onClick":l!=null&&(e.onclick=Jn);break;case"onScroll":l!=null&&Ae("scroll",e);break;case"onScrollEnd":l!=null&&Ae("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(s=l.__html,s!=null){if(f.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}s=Ol(""+l),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":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,""+l):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":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":l===!0?e.setAttribute(s,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,l):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(s,l):e.removeAttribute(s);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(s):e.setAttribute(s,l);break;case"popover":Ae("beforetoggle",e),Ae("toggle",e),Dl(e,"popover",l);break;case"xlinkActuate":Wn(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Wn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Wn(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Wn(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Wn(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Wn(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Wn(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Wn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Wn(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Dl(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=F_.get(s)||s,Dl(e,s,l))}}function Ad(e,n,s,l,f,h){switch(s){case"style":gp(e,l,h);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(s=l.__html,s!=null){if(f.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"children":typeof l=="string"?Js(e,l):(typeof l=="number"||typeof l=="bigint")&&Js(e,""+l);break;case"onScroll":l!=null&&Ae("scroll",e);break;case"onScrollEnd":l!=null&&Ae("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Jn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!lp.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(f=s.endsWith("Capture"),n=s.slice(2,f?s.length-7:void 0),h=e[Kt]||null,h=h!=null?h[s]:null,typeof h=="function"&&e.removeEventListener(n,h,f),typeof l=="function")){typeof h!="function"&&h!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(n,l,f);break e}s in e?e[s]=l:l===!0?e.setAttribute(s,""):Dl(e,s,l)}}}function Lt(e,n,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ae("error",e),Ae("load",e);var l=!1,f=!1,h;for(h in s)if(s.hasOwnProperty(h)){var _=s[h];if(_!=null)switch(h){case"src":l=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,n));default:Ze(e,n,h,_,s,null)}}f&&Ze(e,n,"srcSet",s.srcSet,s,null),l&&Ze(e,n,"src",s.src,s,null);return;case"input":Ae("invalid",e);var k=h=_=f=null,A=null,P=null;for(l in s)if(s.hasOwnProperty(l)){var Z=s[l];if(Z!=null)switch(l){case"name":f=Z;break;case"type":_=Z;break;case"checked":A=Z;break;case"defaultChecked":P=Z;break;case"value":h=Z;break;case"defaultValue":k=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(o(137,n));break;default:Ze(e,n,l,Z,s,null)}}fp(e,h,k,A,P,_,f,!1);return;case"select":Ae("invalid",e),l=_=h=null;for(f in s)if(s.hasOwnProperty(f)&&(k=s[f],k!=null))switch(f){case"value":h=k;break;case"defaultValue":_=k;break;case"multiple":l=k;default:Ze(e,n,f,k,s,null)}n=h,s=_,e.multiple=!!l,n!=null?Ws(e,!!l,n,!1):s!=null&&Ws(e,!!l,s,!0);return;case"textarea":Ae("invalid",e),h=f=l=null;for(_ in s)if(s.hasOwnProperty(_)&&(k=s[_],k!=null))switch(_){case"value":l=k;break;case"defaultValue":f=k;break;case"children":h=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(o(91));break;default:Ze(e,n,_,k,s,null)}pp(e,l,f,h);return;case"option":for(A in s)if(s.hasOwnProperty(A)&&(l=s[A],l!=null))switch(A){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Ze(e,n,A,l,s,null)}return;case"dialog":Ae("beforetoggle",e),Ae("toggle",e),Ae("cancel",e),Ae("close",e);break;case"iframe":case"object":Ae("load",e);break;case"video":case"audio":for(l=0;l<Uo.length;l++)Ae(Uo[l],e);break;case"image":Ae("error",e),Ae("load",e);break;case"details":Ae("toggle",e);break;case"embed":case"source":case"link":Ae("error",e),Ae("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(P in s)if(s.hasOwnProperty(P)&&(l=s[P],l!=null))switch(P){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,n));default:Ze(e,n,P,l,s,null)}return;default:if($c(n)){for(Z in s)s.hasOwnProperty(Z)&&(l=s[Z],l!==void 0&&Ad(e,n,Z,l,s,void 0));return}}for(k in s)s.hasOwnProperty(k)&&(l=s[k],l!=null&&Ze(e,n,k,l,s,null))}function yS(e,n,s,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,h=null,_=null,k=null,A=null,P=null,Z=null;for(K in s){var J=s[K];if(s.hasOwnProperty(K)&&J!=null)switch(K){case"checked":break;case"value":break;case"defaultValue":A=J;default:l.hasOwnProperty(K)||Ze(e,n,K,null,l,J)}}for(var $ in l){var K=l[$];if(J=s[$],l.hasOwnProperty($)&&(K!=null||J!=null))switch($){case"type":h=K;break;case"name":f=K;break;case"checked":P=K;break;case"defaultChecked":Z=K;break;case"value":_=K;break;case"defaultValue":k=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(o(137,n));break;default:K!==J&&Ze(e,n,$,K,l,J)}}Pc(e,_,k,A,P,Z,h,f);return;case"select":K=_=k=$=null;for(h in s)if(A=s[h],s.hasOwnProperty(h)&&A!=null)switch(h){case"value":break;case"multiple":K=A;default:l.hasOwnProperty(h)||Ze(e,n,h,null,l,A)}for(f in l)if(h=l[f],A=s[f],l.hasOwnProperty(f)&&(h!=null||A!=null))switch(f){case"value":$=h;break;case"defaultValue":k=h;break;case"multiple":_=h;default:h!==A&&Ze(e,n,f,h,l,A)}n=k,s=_,l=K,$!=null?Ws(e,!!s,$,!1):!!l!=!!s&&(n!=null?Ws(e,!!s,n,!0):Ws(e,!!s,s?[]:"",!1));return;case"textarea":K=$=null;for(k in s)if(f=s[k],s.hasOwnProperty(k)&&f!=null&&!l.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:Ze(e,n,k,null,l,f)}for(_ in l)if(f=l[_],h=s[_],l.hasOwnProperty(_)&&(f!=null||h!=null))switch(_){case"value":$=f;break;case"defaultValue":K=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(o(91));break;default:f!==h&&Ze(e,n,_,f,l,h)}hp(e,$,K);return;case"option":for(var ue in s)if($=s[ue],s.hasOwnProperty(ue)&&$!=null&&!l.hasOwnProperty(ue))switch(ue){case"selected":e.selected=!1;break;default:Ze(e,n,ue,null,l,$)}for(A in l)if($=l[A],K=s[A],l.hasOwnProperty(A)&&$!==K&&($!=null||K!=null))switch(A){case"selected":e.selected=$&&typeof $!="function"&&typeof $!="symbol";break;default:Ze(e,n,A,$,l,K)}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 ve in s)$=s[ve],s.hasOwnProperty(ve)&&$!=null&&!l.hasOwnProperty(ve)&&Ze(e,n,ve,null,l,$);for(P in l)if($=l[P],K=s[P],l.hasOwnProperty(P)&&$!==K&&($!=null||K!=null))switch(P){case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(o(137,n));break;default:Ze(e,n,P,$,l,K)}return;default:if($c(n)){for(var Xe in s)$=s[Xe],s.hasOwnProperty(Xe)&&$!==void 0&&!l.hasOwnProperty(Xe)&&Ad(e,n,Xe,void 0,l,$);for(Z in l)$=l[Z],K=s[Z],!l.hasOwnProperty(Z)||$===K||$===void 0&&K===void 0||Ad(e,n,Z,$,l,K);return}}for(var L in s)$=s[L],s.hasOwnProperty(L)&&$!=null&&!l.hasOwnProperty(L)&&Ze(e,n,L,null,l,$);for(J in l)$=l[J],K=s[J],!l.hasOwnProperty(J)||$===K||$==null&&K==null||Ze(e,n,J,$,l,K)}function vv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function bS(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,s=performance.getEntriesByType("resource"),l=0;l<s.length;l++){var f=s[l],h=f.transferSize,_=f.initiatorType,k=f.duration;if(h&&k&&vv(_)){for(_=0,k=f.responseEnd,l+=1;l<s.length;l++){var A=s[l],P=A.startTime;if(P>k)break;var Z=A.transferSize,J=A.initiatorType;Z&&vv(J)&&(A=A.responseEnd,_+=Z*(A<k?1:(k-P)/(A-P)))}if(--l,n+=8*(h+_)/(f.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Dd=null,Rd=null;function wr(e){return e.nodeType===9?e:e.ownerDocument}function yv(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 bv(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function Md(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Od=null;function xS(){var e=window.event;return e&&e.type==="popstate"?e===Od?!1:(Od=e,!0):(Od=null,!1)}var xv=typeof setTimeout=="function"?setTimeout:void 0,_S=typeof clearTimeout=="function"?clearTimeout:void 0,_v=typeof Promise=="function"?Promise:void 0,SS=typeof queueMicrotask=="function"?queueMicrotask:typeof _v<"u"?function(e){return _v.resolve(null).then(e).catch(TS)}:xv;function TS(e){setTimeout(function(){throw e})}function $a(e){return e==="head"}function Sv(e,n){var s=n,l=0;do{var f=s.nextSibling;if(e.removeChild(s),f&&f.nodeType===8)if(s=f.data,s==="/$"||s==="/&"){if(l===0){e.removeChild(f),Ai(n);return}l--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")l++;else if(s==="html")Vo(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,Vo(s);for(var h=s.firstChild;h;){var _=h.nextSibling,k=h.nodeName;h[ao]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&h.rel.toLowerCase()==="stylesheet"||s.removeChild(h),h=_}}else s==="body"&&Vo(e.ownerDocument.body);s=f}while(s);Ai(n)}function Tv(e,n){var s=e;e=0;do{var l=s.nextSibling;if(s.nodeType===1?n?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(n?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),l&&l.nodeType===8)if(s=l.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=l}while(s)}function Bd(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var s=n;switch(n=n.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Bd(s),Vc(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function kS(e,n,s,l){for(;e.nodeType===1;){var f=s;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[ao])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==f.rel||e.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||e.getAttribute("title")!==(f.title==null?null:f.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(f.src==null?null:f.src)||e.getAttribute("type")!==(f.type==null?null:f.type)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var h=f.name==null?null:""+f.name;if(f.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=Cn(e.nextSibling),e===null)break}return null}function CS(e,n,s){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=Cn(e.nextSibling),e===null))return null;return e}function kv(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Cn(e.nextSibling),e===null))return null;return e}function Id(e){return e.data==="$?"||e.data==="$~"}function Ld(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function ES(e,n){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||s.readyState!=="loading")n();else{var l=function(){n(),s.removeEventListener("DOMContentLoaded",l)};s.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Cn(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var Ud=null;function Cv(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(n===0)return Cn(e.nextSibling);n--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||n++}e=e.nextSibling}return null}function Ev(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(n===0)return e;n--}else s!=="/$"&&s!=="/&"||n++}e=e.previousSibling}return null}function Nv(e,n,s){switch(n=wr(s),e){case"html":if(e=n.documentElement,!e)throw Error(o(452));return e;case"head":if(e=n.head,!e)throw Error(o(453));return e;case"body":if(e=n.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Vo(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Vc(e)}var En=new Map,jv=new Set;function Ar(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ma=Y.d;Y.d={f:NS,r:jS,D:wS,C:AS,L:DS,m:RS,X:OS,S:MS,M:BS};function NS(){var e=ma.f(),n=_r();return e||n}function jS(e){var n=Zs(e);n!==null&&n.tag===5&&n.type==="form"?Fm(n):ma.r(e)}var Ni=typeof document>"u"?null:document;function wv(e,n,s){var l=Ni;if(l&&typeof n=="string"&&n){var f=yn(n);f='link[rel="'+e+'"][href="'+f+'"]',typeof s=="string"&&(f+='[crossorigin="'+s+'"]'),jv.has(f)||(jv.add(f),e={rel:e,crossOrigin:s,href:n},l.querySelector(f)===null&&(n=l.createElement("link"),Lt(n,"link",e),wt(n),l.head.appendChild(n)))}}function wS(e){ma.D(e),wv("dns-prefetch",e,null)}function AS(e,n){ma.C(e,n),wv("preconnect",e,n)}function DS(e,n,s){ma.L(e,n,s);var l=Ni;if(l&&e&&n){var f='link[rel="preload"][as="'+yn(n)+'"]';n==="image"&&s&&s.imageSrcSet?(f+='[imagesrcset="'+yn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(f+='[imagesizes="'+yn(s.imageSizes)+'"]')):f+='[href="'+yn(e)+'"]';var h=f;switch(n){case"style":h=ji(e);break;case"script":h=wi(e)}En.has(h)||(e=y({rel:"preload",href:n==="image"&&s&&s.imageSrcSet?void 0:e,as:n},s),En.set(h,e),l.querySelector(f)!==null||n==="style"&&l.querySelector(Ho(h))||n==="script"&&l.querySelector(Po(h))||(n=l.createElement("link"),Lt(n,"link",e),wt(n),l.head.appendChild(n)))}}function RS(e,n){ma.m(e,n);var s=Ni;if(s&&e){var l=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+yn(l)+'"][href="'+yn(e)+'"]',h=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=wi(e)}if(!En.has(h)&&(e=y({rel:"modulepreload",href:e},n),En.set(h,e),s.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Po(h)))return}l=s.createElement("link"),Lt(l,"link",e),wt(l),s.head.appendChild(l)}}}function MS(e,n,s){ma.S(e,n,s);var l=Ni;if(l&&e){var f=Xs(l).hoistableStyles,h=ji(e);n=n||"default";var _=f.get(h);if(!_){var k={loading:0,preload:null};if(_=l.querySelector(Ho(h)))k.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":n},s),(s=En.get(h))&&zd(e,s);var A=_=l.createElement("link");wt(A),Lt(A,"link",e),A._p=new Promise(function(P,Z){A.onload=P,A.onerror=Z}),A.addEventListener("load",function(){k.loading|=1}),A.addEventListener("error",function(){k.loading|=2}),k.loading|=4,Dr(_,n,l)}_={type:"stylesheet",instance:_,count:1,state:k},f.set(h,_)}}}function OS(e,n){ma.X(e,n);var s=Ni;if(s&&e){var l=Xs(s).hoistableScripts,f=wi(e),h=l.get(f);h||(h=s.querySelector(Po(f)),h||(e=y({src:e,async:!0},n),(n=En.get(f))&&Vd(e,n),h=s.createElement("script"),wt(h),Lt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(f,h))}}function BS(e,n){ma.M(e,n);var s=Ni;if(s&&e){var l=Xs(s).hoistableScripts,f=wi(e),h=l.get(f);h||(h=s.querySelector(Po(f)),h||(e=y({src:e,async:!0,type:"module"},n),(n=En.get(f))&&Vd(e,n),h=s.createElement("script"),wt(h),Lt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(f,h))}}function Av(e,n,s,l){var f=(f=fe.current)?Ar(f):null;if(!f)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(n=ji(s.href),s=Xs(f).hoistableStyles,l=s.get(n),l||(l={type:"style",instance:null,count:0,state:null},s.set(n,l)),l):{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=Xs(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(Ho(e)))&&!h._p&&(_.instance=h,_.state.loading=5),En.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},En.set(e,s),h||IS(f,e,s,_.state))),n&&l===null)throw Error(o(528,""));return _}if(n&&l!==null)throw Error(o(529,""));return null;case"script":return n=s.async,s=s.src,typeof s=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=wi(s),s=Xs(f).hoistableScripts,l=s.get(n),l||(l={type:"script",instance:null,count:0,state:null},s.set(n,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function ji(e){return'href="'+yn(e)+'"'}function Ho(e){return'link[rel="stylesheet"]['+e+"]"}function Dv(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function IS(e,n,s,l){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?l.loading=1:(n=e.createElement("link"),l.preload=n,n.addEventListener("load",function(){return l.loading|=1}),n.addEventListener("error",function(){return l.loading|=2}),Lt(n,"link",s),wt(n),e.head.appendChild(n))}function wi(e){return'[src="'+yn(e)+'"]'}function Po(e){return"script[async]"+e}function Rv(e,n,s){if(n.count++,n.instance===null)switch(n.type){case"style":var l=e.querySelector('style[data-href~="'+yn(s.href)+'"]');if(l)return n.instance=l,wt(l),l;var f=y({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),wt(l),Lt(l,"style",f),Dr(l,s.precedence,e),n.instance=l;case"stylesheet":f=ji(s.href);var h=e.querySelector(Ho(f));if(h)return n.state.loading|=4,n.instance=h,wt(h),h;l=Dv(s),(f=En.get(f))&&zd(l,f),h=(e.ownerDocument||e).createElement("link"),wt(h);var _=h;return _._p=new Promise(function(k,A){_.onload=k,_.onerror=A}),Lt(h,"link",l),n.state.loading|=4,Dr(h,s.precedence,e),n.instance=h;case"script":return h=wi(s.src),(f=e.querySelector(Po(h)))?(n.instance=f,wt(f),f):(l=s,(f=En.get(h))&&(l=y({},s),Vd(l,f)),e=e.ownerDocument||e,f=e.createElement("script"),wt(f),Lt(f,"link",l),e.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(o(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(l=n.instance,n.state.loading|=4,Dr(l,s.precedence,e));return n.instance}function Dr(e,n,s){for(var l=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=l.length?l[l.length-1]:null,h=f,_=0;_<l.length;_++){var k=l[_];if(k.dataset.precedence===n)h=k;else if(h!==f)break}h?h.parentNode.insertBefore(e,h.nextSibling):(n=s.nodeType===9?s.head:s,n.insertBefore(e,n.firstChild))}function zd(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Vd(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Rr=null;function Mv(e,n,s){if(Rr===null){var l=new Map,f=Rr=new Map;f.set(s,l)}else f=Rr,l=f.get(s),l||(l=new Map,f.set(s,l));if(l.has(e))return l;for(l.set(e,null),s=s.getElementsByTagName(e),f=0;f<s.length;f++){var h=s[f];if(!(h[ao]||h[Mt]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var _=h.getAttribute(n)||"";_=e+_;var k=l.get(_);k?k.push(h):l.set(_,[h])}}return l}function Ov(e,n,s){e=e.ownerDocument||e,e.head.insertBefore(s,n==="title"?e.querySelector("head > title"):null)}function LS(e,n,s){if(s===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return e=n.disabled,typeof n.precedence=="string"&&e==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Bv(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function US(e,n,s,l){if(s.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var f=ji(l.href),h=n.querySelector(Ho(f));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Mr.bind(e),n.then(e,e)),s.state.loading|=4,s.instance=h,wt(h);return}h=n.ownerDocument||n,l=Dv(l),(f=En.get(f))&&zd(l,f),h=h.createElement("link"),wt(h);var _=h;_._p=new Promise(function(k,A){_.onload=k,_.onerror=A}),Lt(h,"link",l),s.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,n),(n=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=Mr.bind(e),n.addEventListener("load",s),n.addEventListener("error",s))}}var Hd=0;function zS(e,n){return e.stylesheets&&e.count===0&&Br(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var l=setTimeout(function(){if(e.stylesheets&&Br(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+n);0<e.imgBytes&&Hd===0&&(Hd=62500*bS());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Br(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Hd?50:800)+n);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(f)}}:null}function Mr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Br(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Or=null;function Br(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Or=new Map,n.forEach(VS,e),Or=null,Mr.call(e))}function VS(e,n){if(!(n.state.loading&4)){var s=Or.get(e);if(s)var l=s.get(null);else{s=new Map,Or.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,_),l=_)}l&&s.set(null,l)}f=n.instance,_=f.getAttribute("data-precedence"),h=s.get(_)||l,h===l&&s.set(null,f),s.set(_,f),this.count++,l=Mr.bind(this),f.addEventListener("load",l),f.addEventListener("error",l),h?h.parentNode.insertBefore(f,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(f,e.firstChild)),n.state.loading|=4}}var Go={$$typeof:D,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function HS(e,n,s,l,f,h,_,k,A){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=Ic(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ic(0),this.hiddenUpdates=Ic(null),this.identifierPrefix=l,this.onUncaughtError=f,this.onCaughtError=h,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=A,this.incompleteTransitions=new Map}function Iv(e,n,s,l,f,h,_,k,A,P,Z,J){return e=new HS(e,n,s,_,A,P,Z,J,k),n=1,h===!0&&(n|=24),h=an(3,null,null,n),e.current=h,h.stateNode=e,n=xu(),n.refCount++,e.pooledCache=n,n.refCount++,h.memoizedState={element:l,isDehydrated:s,cache:n},ku(h),e}function Lv(e){return e?(e=oi,e):oi}function Uv(e,n,s,l,f,h){f=Lv(f),l.context===null?l.context=f:l.pendingContext=f,l=Ma(n),l.payload={element:s},h=h===void 0?null:h,h!==null&&(l.callback=h),s=Oa(e,l,n),s!==null&&(Jt(s,e,n),_o(s,e,n))}function zv(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<n?s:n}}function Pd(e,n){zv(e,n),(e=e.alternate)&&zv(e,n)}function Vv(e){if(e.tag===13||e.tag===31){var n=fs(e,67108864);n!==null&&Jt(n,e,67108864),Pd(e,67108864)}}function Hv(e){if(e.tag===13||e.tag===31){var n=cn();n=Lc(n);var s=fs(e,n);s!==null&&Jt(s,e,n),Pd(e,n)}}var Ir=!0;function PS(e,n,s,l){var f=I.T;I.T=null;var h=Y.p;try{Y.p=2,Gd(e,n,s,l)}finally{Y.p=h,I.T=f}}function GS(e,n,s,l){var f=I.T;I.T=null;var h=Y.p;try{Y.p=8,Gd(e,n,s,l)}finally{Y.p=h,I.T=f}}function Gd(e,n,s,l){if(Ir){var f=$d(l);if(f===null)wd(e,n,l,Lr,s),Gv(e,l);else if(FS(f,e,n,s,l))l.stopPropagation();else if(Gv(e,l),n&4&&-1<$S.indexOf(e)){for(;f!==null;){var h=Zs(f);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var _=ls(h.pendingLanes);if(_!==0){var k=h;for(k.pendingLanes|=2,k.entangledLanes|=2;_;){var A=1<<31-Pe(_);k.entanglements[1]|=A,_&=~A}Pn(h),(Ve&6)===0&&(br=zt()+500,Lo(0))}}break;case 31:case 13:k=fs(h,2),k!==null&&Jt(k,h,2),_r(),Pd(h,2)}if(h=$d(l),h===null&&wd(e,n,l,Lr,s),h===f)break;f=h}f!==null&&l.stopPropagation()}else wd(e,n,l,null,s)}}function $d(e){return e=qc(e),Fd(e)}var Lr=null;function Fd(e){if(Lr=null,e=Ys(e),e!==null){var n=u(e);if(n===null)e=null;else{var s=n.tag;if(s===13){if(e=d(n),e!==null)return e;e=null}else if(s===31){if(e=p(n),e!==null)return e;e=null}else if(s===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Lr=e,null}function Pv(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(Bc()){case W:return 2;case le:return 8;case ce:case _e:return 32;case ge:return 268435456;default:return 32}default:return 32}}var qd=!1,Fa=null,qa=null,Ka=null,$o=new Map,Fo=new Map,Ya=[],$S="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 Gv(e,n){switch(e){case"focusin":case"focusout":Fa=null;break;case"dragenter":case"dragleave":qa=null;break;case"mouseover":case"mouseout":Ka=null;break;case"pointerover":case"pointerout":$o.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fo.delete(n.pointerId)}}function qo(e,n,s,l,f,h){return e===null||e.nativeEvent!==h?(e={blockedOn:n,domEventName:s,eventSystemFlags:l,nativeEvent:h,targetContainers:[f]},n!==null&&(n=Zs(n),n!==null&&Vv(n)),e):(e.eventSystemFlags|=l,n=e.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),e)}function FS(e,n,s,l,f){switch(n){case"focusin":return Fa=qo(Fa,e,n,s,l,f),!0;case"dragenter":return qa=qo(qa,e,n,s,l,f),!0;case"mouseover":return Ka=qo(Ka,e,n,s,l,f),!0;case"pointerover":var h=f.pointerId;return $o.set(h,qo($o.get(h)||null,e,n,s,l,f)),!0;case"gotpointercapture":return h=f.pointerId,Fo.set(h,qo(Fo.get(h)||null,e,n,s,l,f)),!0}return!1}function $v(e){var n=Ys(e.target);if(n!==null){var s=u(n);if(s!==null){if(n=s.tag,n===13){if(n=d(s),n!==null){e.blockedOn=n,sp(e.priority,function(){Hv(s)});return}}else if(n===31){if(n=p(s),n!==null){e.blockedOn=n,sp(e.priority,function(){Hv(s)});return}}else if(n===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ur(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var s=$d(e.nativeEvent);if(s===null){s=e.nativeEvent;var l=new s.constructor(s.type,s);Fc=l,s.target.dispatchEvent(l),Fc=null}else return n=Zs(s),n!==null&&Vv(n),e.blockedOn=s,!1;n.shift()}return!0}function Fv(e,n,s){Ur(e)&&s.delete(n)}function qS(){qd=!1,Fa!==null&&Ur(Fa)&&(Fa=null),qa!==null&&Ur(qa)&&(qa=null),Ka!==null&&Ur(Ka)&&(Ka=null),$o.forEach(Fv),Fo.forEach(Fv)}function zr(e,n){e.blockedOn===n&&(e.blockedOn=null,qd||(qd=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,qS)))}var Vr=null;function qv(e){Vr!==e&&(Vr=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Vr===e&&(Vr=null);for(var n=0;n<e.length;n+=3){var s=e[n],l=e[n+1],f=e[n+2];if(typeof l!="function"){if(Fd(l||s)===null)continue;break}var h=Zs(s);h!==null&&(e.splice(n,3),n-=3,$u(h,{pending:!0,data:f,method:s.method,action:l},l,f))}}))}function Ai(e){function n(A){return zr(A,e)}Fa!==null&&zr(Fa,e),qa!==null&&zr(qa,e),Ka!==null&&zr(Ka,e),$o.forEach(n),Fo.forEach(n);for(var s=0;s<Ya.length;s++){var l=Ya[s];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Ya.length&&(s=Ya[0],s.blockedOn===null);)$v(s),s.blockedOn===null&&Ya.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(l=0;l<s.length;l+=3){var f=s[l],h=s[l+1],_=f[Kt]||null;if(typeof h=="function")_||qv(s);else if(_){var k=null;if(h&&h.hasAttribute("formAction")){if(f=h,_=h[Kt]||null)k=_.formAction;else if(Fd(f)!==null)continue}else k=_.action;typeof k=="function"?s[l+1]=k:(s.splice(l,3),l-=3),qv(s)}}}function Kv(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(_){return f=_})},focusReset:"manual",scroll:"manual"})}function n(){f!==null&&(f(),f=null),l||setTimeout(s,20)}function s(){if(!l&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,f=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(s,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function Kd(e){this._internalRoot=e}Hr.prototype.render=Kd.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(o(409));var s=n.current,l=cn();Uv(s,l,e,n,null,null)},Hr.prototype.unmount=Kd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Uv(e.current,2,null,e,null,null),_r(),n[Ks]=null}};function Hr(e){this._internalRoot=e}Hr.prototype.unstable_scheduleHydration=function(e){if(e){var n=ap();e={blockedOn:null,target:e,priority:n};for(var s=0;s<Ya.length&&n!==0&&n<Ya[s].priority;s++);Ya.splice(s,0,e),s===0&&$v(e)}};var Yv=a.version;if(Yv!=="19.2.4")throw Error(o(527,Yv,"19.2.4"));Y.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=g(n),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var KS={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Pr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pr.isDisabled&&Pr.supportsFiber)try{Je=Pr.inject(KS),je=Pr}catch{}}return Ko.createRoot=function(e,n){if(!r(e))throw Error(o(299));var s=!1,l="",f=tg,h=ng,_=ag;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(_=n.onRecoverableError)),n=Iv(e,1,!1,null,null,s,l,null,f,h,_,Kv),e[Ks]=n.current,jd(e),new Kd(n)},Ko.hydrateRoot=function(e,n,s){if(!r(e))throw Error(o(299));var l=!1,f="",h=tg,_=ng,k=ag,A=null;return s!=null&&(s.unstable_strictMode===!0&&(l=!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&&(k=s.onRecoverableError),s.formState!==void 0&&(A=s.formState)),n=Iv(e,1,!0,n,s??null,l,f,A,h,_,k,Kv),n.context=Lv(null),s=n.current,l=cn(),l=Lc(l),f=Ma(l),f.callback=null,Oa(s,f,l),s=l,n.current.lanes=s,no(n,s),Pn(n),e[Ks]=n.current,jd(e),new Hr(n)},Ko.version="19.2.4",Ko}var ty;function cT(){if(ty)return Yd.exports;ty=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(a){console.error(a)}}return t(),Yd.exports=rT(),Yd.exports}var uT=cT();const dT="modulepreload",fT=function(t){return"/"+t},ny={},hT=function(a,i,o){let r=Promise.resolve();if(i&&i.length>0){let d=function(g){return Promise.all(g.map(v=>Promise.resolve(v).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const p=document.querySelector("meta[property=csp-nonce]"),m=(p==null?void 0:p.nonce)||(p==null?void 0:p.getAttribute("nonce"));r=d(i.map(g=>{if(g=fT(g),g in ny)return;ny[g]=!0;const v=g.endsWith(".css"),y=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${y}`))return;const b=document.createElement("link");if(b.rel=v?"stylesheet":dT,v||(b.as="script"),b.crossOrigin="",b.href=g,m&&b.setAttribute("nonce",m),document.head.appendChild(b),v)return new Promise((S,T)=>{b.addEventListener("load",S),b.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${g}`)))})}))}function u(d){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=d,window.dispatchEvent(p),!p.defaultPrevented)throw d}return r.then(d=>{for(const p of d||[])p.status==="rejected"&&u(p.reason);return a().catch(u)})};function qt(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function fl(t,a){return console.warn(`[ws] Malformed "${t}" message: ${a}`),!1}function pT(t){return qt(t)&&typeof t.id=="string"&&typeof t.type=="string"&&typeof t.timestamp=="string"&&qt(t.payload)}function mT(t){return qt(t)&&typeof t.id=="string"&&typeof t.displayName=="string"&&typeof t.adapterType=="string"&&typeof t.status=="string"&&typeof t.bootstrapped=="boolean"&&(typeof t.adapterConfig=="string"||t.adapterConfig===void 0)}function gT(t){return{...t,adapterConfig:t.adapterConfig??"{}"}}function ay(t){return qt(t)&&typeof t.id=="string"&&typeof t.environmentId=="string"&&typeof t.runtime=="string"&&typeof t.status=="string"&&typeof t.prompt=="string"&&typeof t.startedAt=="string"&&(t.endedAt===void 0||typeof t.endedAt=="string")&&(t.error===void 0||typeof t.error=="string")&&(t.endReason===void 0||typeof t.endReason=="string")}function sy(t){return qt(t)&&typeof t.sessionId=="string"&&typeof t.eventType=="string"&&typeof t.timestamp=="string"&&typeof t.content=="string"&&(t.raw===void 0||typeof t.raw=="string")}function vT(t){return qt(t)&&typeof t.id=="string"&&typeof t.name=="string"&&typeof t.description=="string"&&typeof t.repoUrl=="string"&&typeof t.environmentId=="string"&&typeof t.status=="string"&&typeof t.worktreeBasePath=="string"&&typeof t.useWorktrees=="boolean"&&(t.defaultPersonaId===void 0||typeof t.defaultPersonaId=="string")&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string"}function yT(t){return qt(t)&&typeof t.id=="string"&&(typeof t.workspaceId=="string"||t.workspaceId===void 0)&&typeof t.title=="string"&&typeof t.status=="string"&&typeof t.branch=="string"&&typeof t.sortOrder=="number"&&typeof t.depth=="number"&&(t.defaultPersonaId===void 0||typeof t.defaultPersonaId=="string")&&Array.isArray(t.dependsOn)&&Array.isArray(t.childTaskIds)}function bT(t){return qt(t)&&typeof t.id=="string"&&typeof t.workspaceId=="string"&&typeof t.taskId=="string"&&typeof t.sessionId=="string"&&typeof t.category=="string"&&typeof t.title=="string"&&typeof t.content=="string"&&Array.isArray(t.tags)&&typeof t.createdAt=="string"}function xT(t){return qt(t)&&typeof t.name=="string"&&typeof t.tokenType=="string"&&typeof t.envVar=="string"&&typeof t.filePath=="string"&&typeof t.expiresAt=="string"}const _T=new Set(["off","subscription","api_key"]),$r=new Set(["off","on"]);function iy(t){return qt(t)&&_T.has(t.claude)&&$r.has(t.github)&&$r.has(t.copilot)&&$r.has(t.codex)&&$r.has(t.goose)}function ST(t){return qt(t)&&typeof t.name=="string"&&typeof t.repository=="string"&&typeof t.state=="string"&&typeof t.gitStatus=="string"}function TT(t){return qt(t)&&typeof t.id=="string"&&typeof t.name=="string"&&typeof t.description=="string"&&typeof t.systemPrompt=="string"&&typeof t.toolConfig=="string"&&typeof t.runtime=="string"&&typeof t.model=="string"&&typeof t.maxTurns=="number"&&typeof t.mcpServers=="string"&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string"&&typeof t.type=="string"&&typeof t.script=="string"}function Kn(t,a,i,o){return Array.isArray(t)?t.filter((r,u)=>a(r)?!0:(fl(i,`item at index ${u} in "${o}" has unexpected shape`),!1)):(fl(i,`expected "${o}" to be an array, got ${typeof t}`),[])}function kT(t){let a;try{a=JSON.parse(t)}catch{console.warn("[ws] Failed to parse WebSocket message as JSON");return}if(!qt(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:qt(a.payload)?a.payload:{}}:{type:a.type,payload:qt(a.payload)?a.payload:void 0}}function tb(t){switch(t){case"waiting_input":return"idle";case"completed":return"stopped";case"killed":return"stopped";case"failed":return"stopped";default:return t}}function nb(t){switch(t){case"completed":return"completed";case"killed":return"killed";case"failed":return"interrupted";default:return}}const CT=3e3,Di=5e3,ET=4001;/**
27
- * react-router v7.13.1
28
- *
29
- * Copyright (c) Remix Software Inc.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE.md file in the root directory of this source tree.
33
- *
34
- * @license MIT
35
- */var oy="popstate";function ly(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function NT(t={}){function a(o,r){var g;let u=(g=r.state)==null?void 0:g.masked,{pathname:d,search:p,hash:m}=u||o.location;return kf("",{pathname:d,search:p,hash:m},r.state&&r.state.usr||null,r.state&&r.state.key||"default",u?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function i(o,r){return typeof r=="string"?r:hl(r)}return wT(a,i,null,t)}function ot(t,a){if(t===!1||t===null||typeof t>"u")throw new Error(a)}function An(t,a){if(!t){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function jT(){return Math.random().toString(36).substring(2,10)}function ry(t,a){return{usr:t.state,key:t.key,idx:a,masked:t.unstable_mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function kf(t,a,i=null,o,r){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof a=="string"?Yi(a):a,state:i,key:a&&a.key||o||jT(),unstable_mask:r}}function hl({pathname:t="/",search:a="",hash:i=""}){return a&&a!=="?"&&(t+=a.charAt(0)==="?"?a:"?"+a),i&&i!=="#"&&(t+=i.charAt(0)==="#"?i:"#"+i),t}function Yi(t){let a={};if(t){let i=t.indexOf("#");i>=0&&(a.hash=t.substring(i),t=t.substring(0,i));let o=t.indexOf("?");o>=0&&(a.search=t.substring(o),t=t.substring(0,o)),t&&(a.pathname=t)}return a}function wT(t,a,i,o={}){let{window:r=document.defaultView,v5Compat:u=!1}=o,d=r.history,p="POP",m=null,g=v();g==null&&(g=0,d.replaceState({...d.state,idx:g},""));function v(){return(d.state||{idx:null}).idx}function y(){p="POP";let N=v(),C=N==null?null:N-g;g=N,m&&m({action:p,location:E.location,delta:C})}function b(N,C){p="PUSH";let j=ly(N)?N:kf(E.location,N,C);g=v()+1;let D=ry(j,g),R=E.createHref(j.unstable_mask||j);try{d.pushState(D,"",R)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;r.location.assign(R)}u&&m&&m({action:p,location:E.location,delta:1})}function S(N,C){p="REPLACE";let j=ly(N)?N:kf(E.location,N,C);g=v();let D=ry(j,g),R=E.createHref(j.unstable_mask||j);d.replaceState(D,"",R),u&&m&&m({action:p,location:E.location,delta:0})}function T(N){return AT(N)}let E={get action(){return p},get location(){return t(r,d)},listen(N){if(m)throw new Error("A history only accepts one active listener");return r.addEventListener(oy,y),m=N,()=>{r.removeEventListener(oy,y),m=null}},createHref(N){return a(r,N)},createURL:T,encodeLocation(N){let C=T(N);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:b,replace:S,go(N){return d.go(N)}};return E}function AT(t,a=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),ot(i,"No window.location.(origin|href) available to create URL");let o=typeof t=="string"?t:hl(t);return o=o.replace(/ $/,"%20"),!a&&o.startsWith("//")&&(o=i+o),new URL(o,i)}function ab(t,a,i="/"){return DT(t,a,i,!1)}function DT(t,a,i,o){let r=typeof a=="string"?Yi(a):a,u=xa(r.pathname||"/",i);if(u==null)return null;let d=sb(t);RT(d);let p=null;for(let m=0;p==null&&m<d.length;++m){let g=ob(u);p=HT(d[m],g,o)}return p}function sb(t,a=[],i=[],o="",r=!1){let u=(d,p,m=r,g)=>{let v={relativePath:g===void 0?d.path||"":g,caseSensitive:d.caseSensitive===!0,childrenIndex:p,route:d};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(o)&&m)return;ot(v.relativePath.startsWith(o),`Absolute route path "${v.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(o.length)}let y=Yn([o,v.relativePath]),b=i.concat(v);d.children&&d.children.length>0&&(ot(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),sb(d.children,a,b,y,m)),!(d.path==null&&!d.index)&&a.push({path:y,score:zT(y,d.index),routesMeta:b})};return t.forEach((d,p)=>{var m;if(d.path===""||!((m=d.path)!=null&&m.includes("?")))u(d,p);else for(let g of ib(d.path))u(d,p,!0,g)}),a}function ib(t){let a=t.split("/");if(a.length===0)return[];let[i,...o]=a,r=i.endsWith("?"),u=i.replace(/\?$/,"");if(o.length===0)return r?[u,""]:[u];let d=ib(o.join("/")),p=[];return p.push(...d.map(m=>m===""?u:[u,m].join("/"))),r&&p.push(...d),p.map(m=>t.startsWith("/")&&m===""?"/":m)}function RT(t){t.sort((a,i)=>a.score!==i.score?i.score-a.score:VT(a.routesMeta.map(o=>o.childrenIndex),i.routesMeta.map(o=>o.childrenIndex)))}var MT=/^:[\w-]+$/,OT=3,BT=2,IT=1,LT=10,UT=-2,cy=t=>t==="*";function zT(t,a){let i=t.split("/"),o=i.length;return i.some(cy)&&(o+=UT),a&&(o+=BT),i.filter(r=>!cy(r)).reduce((r,u)=>r+(MT.test(u)?OT:u===""?IT:LT),o)}function VT(t,a){return t.length===a.length&&t.slice(0,-1).every((o,r)=>o===a[r])?t[t.length-1]-a[a.length-1]:0}function HT(t,a,i=!1){let{routesMeta:o}=t,r={},u="/",d=[];for(let p=0;p<o.length;++p){let m=o[p],g=p===o.length-1,v=u==="/"?a:a.slice(u.length)||"/",y=pl({path:m.relativePath,caseSensitive:m.caseSensitive,end:g},v),b=m.route;if(!y&&g&&i&&!o[o.length-1].route.index&&(y=pl({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},v)),!y)return null;Object.assign(r,y.params),d.push({params:r,pathname:Yn([u,y.pathname]),pathnameBase:qT(Yn([u,y.pathnameBase])),route:b}),y.pathnameBase!=="/"&&(u=Yn([u,y.pathnameBase]))}return d}function pl(t,a){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[i,o]=PT(t.path,t.caseSensitive,t.end),r=a.match(i);if(!r)return null;let u=r[0],d=u.replace(/(.)\/+$/,"$1"),p=r.slice(1);return{params:o.reduce((g,{paramName:v,isOptional:y},b)=>{if(v==="*"){let T=p[b]||"";d=u.slice(0,u.length-T.length).replace(/(.)\/+$/,"$1")}const S=p[b];return y&&!S?g[v]=void 0:g[v]=(S||"").replace(/%2F/g,"/"),g},{}),pathname:u,pathnameBase:d,pattern:t}}function PT(t,a=!1,i=!0){An(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let o=[],r="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,p,m,g,v)=>{if(o.push({paramName:p,isOptional:m!=null}),m){let y=v.charAt(g+d.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(o.push({paramName:"*"}),r+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?r+="\\/*$":t!==""&&t!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,a?void 0:"i"),o]}function ob(t){try{return t.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return An(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),t}}function xa(t,a){if(a==="/")return t;if(!t.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,o=t.charAt(i);return o&&o!=="/"?null:t.slice(i)||"/"}var GT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function $T(t,a="/"){let{pathname:i,search:o="",hash:r=""}=typeof t=="string"?Yi(t):t,u;return i?(i=i.replace(/\/\/+/g,"/"),i.startsWith("/")?u=uy(i.substring(1),"/"):u=uy(i,a)):u=a,{pathname:u,search:KT(o),hash:YT(r)}}function uy(t,a){let i=a.replace(/\/+$/,"").split("/");return t.split("/").forEach(r=>{r===".."?i.length>1&&i.pop():r!=="."&&i.push(r)}),i.length>1?i.join("/"):"/"}function Qd(t,a,i,o){return`Cannot include a '${t}' character in a manually specified \`to.${a}\` field [${JSON.stringify(o)}]. 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 FT(t){return t.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function ah(t){let a=FT(t);return a.map((i,o)=>o===a.length-1?i.pathname:i.pathnameBase)}function Sc(t,a,i,o=!1){let r;typeof t=="string"?r=Yi(t):(r={...t},ot(!r.pathname||!r.pathname.includes("?"),Qd("?","pathname","search",r)),ot(!r.pathname||!r.pathname.includes("#"),Qd("#","pathname","hash",r)),ot(!r.search||!r.search.includes("#"),Qd("#","search","hash",r)));let u=t===""||r.pathname==="",d=u?"/":r.pathname,p;if(d==null)p=i;else{let y=a.length-1;if(!o&&d.startsWith("..")){let b=d.split("/");for(;b[0]==="..";)b.shift(),y-=1;r.pathname=b.join("/")}p=y>=0?a[y]:"/"}let m=$T(r,p),g=d&&d!=="/"&&d.endsWith("/"),v=(u||d===".")&&i.endsWith("/");return!m.pathname.endsWith("/")&&(g||v)&&(m.pathname+="/"),m}var Yn=t=>t.join("/").replace(/\/\/+/g,"/"),qT=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),KT=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,YT=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,ZT=class{constructor(t,a,i,o=!1){this.status=t,this.statusText=a||"",this.internal=o,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function XT(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function QT(t){return t.map(a=>a.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var lb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function rb(t,a){let i=t;if(typeof i!="string"||!GT.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let o=i,r=!1;if(lb)try{let u=new URL(window.location.href),d=i.startsWith("//")?new URL(u.protocol+i):new URL(i),p=xa(d.pathname,a);d.origin===u.origin&&p!=null?i=p+d.search+d.hash:r=!0}catch{An(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:r,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var cb=["POST","PUT","PATCH","DELETE"];new Set(cb);var WT=["GET",...cb];new Set(WT);var Zi=x.createContext(null);Zi.displayName="DataRouter";var Tc=x.createContext(null);Tc.displayName="DataRouterState";var JT=x.createContext(!1),ub=x.createContext({isTransitioning:!1});ub.displayName="ViewTransition";var ek=x.createContext(new Map);ek.displayName="Fetchers";var tk=x.createContext(null);tk.displayName="Await";var pn=x.createContext(null);pn.displayName="Navigation";var _l=x.createContext(null);_l.displayName="Location";var Dn=x.createContext({outlet:null,matches:[],isDataRoute:!1});Dn.displayName="Route";var sh=x.createContext(null);sh.displayName="RouteError";var db="REACT_ROUTER_ERROR",nk="REDIRECT",ak="ROUTE_ERROR_RESPONSE";function sk(t){if(t.startsWith(`${db}:${nk}:{`))try{let a=JSON.parse(t.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 ik(t){if(t.startsWith(`${db}:${ak}:{`))try{let a=JSON.parse(t.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new ZT(a.status,a.statusText,a.data)}catch{}}function ok(t,{relative:a}={}){ot(Is(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:o}=x.useContext(pn),{hash:r,pathname:u,search:d}=Sl(t,{relative:a}),p=u;return i!=="/"&&(p=u==="/"?i:Yn([i,u])),o.createHref({pathname:p,search:d,hash:r})}function Is(){return x.useContext(_l)!=null}function jt(){return ot(Is(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(_l).location}function Tt(t){ot(Is(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:a}=jt();return x.useMemo(()=>pl(t,ob(a)),[a,t])}var fb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function hb(t){x.useContext(pn).static||x.useLayoutEffect(t)}function kc(){let{isDataRoute:t}=x.useContext(Dn);return t?_k():lk()}function lk(){ot(Is(),"useNavigate() may be used only in the context of a <Router> component.");let t=x.useContext(Zi),{basename:a,navigator:i}=x.useContext(pn),{matches:o}=x.useContext(Dn),{pathname:r}=jt(),u=JSON.stringify(ah(o)),d=x.useRef(!1);return hb(()=>{d.current=!0}),x.useCallback((m,g={})=>{if(An(d.current,fb),!d.current)return;if(typeof m=="number"){i.go(m);return}let v=Sc(m,JSON.parse(u),r,g.relative==="path");t==null&&a!=="/"&&(v.pathname=v.pathname==="/"?a:Yn([a,v.pathname])),(g.replace?i.replace:i.push)(v,g.state,g)},[a,i,u,r,t])}var rk=x.createContext(null);function ck(t){let a=x.useContext(Dn).outlet;return x.useMemo(()=>a&&x.createElement(rk.Provider,{value:t},a),[a,t])}function ss(){let{matches:t}=x.useContext(Dn),a=t[t.length-1];return a?a.params:{}}function Sl(t,{relative:a}={}){let{matches:i}=x.useContext(Dn),{pathname:o}=jt(),r=JSON.stringify(ah(i));return x.useMemo(()=>Sc(t,JSON.parse(r),o,a==="path"),[t,r,o,a])}function uk(t,a){return pb(t,a)}function pb(t,a,i){var N;ot(Is(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=x.useContext(pn),{matches:r}=x.useContext(Dn),u=r[r.length-1],d=u?u.params:{},p=u?u.pathname:"/",m=u?u.pathnameBase:"/",g=u&&u.route;{let C=g&&g.path||"";gb(p,!g||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${C}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
36
-
37
- Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let v=jt(),y;if(a){let C=typeof a=="string"?Yi(a):a;ot(m==="/"||((N=C.pathname)==null?void 0:N.startsWith(m)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${C.pathname}" was given in the \`location\` prop.`),y=C}else y=v;let b=y.pathname||"/",S=b;if(m!=="/"){let C=m.replace(/^\//,"").split("/");S="/"+b.replace(/^\//,"").split("/").slice(C.length).join("/")}let T=ab(t,{pathname:S});An(g||T!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),An(T==null||T[T.length-1].route.element!==void 0||T[T.length-1].route.Component!==void 0||T[T.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.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 E=mk(T&&T.map(C=>Object.assign({},C,{params:Object.assign({},d,C.params),pathname:Yn([m,o.encodeLocation?o.encodeLocation(C.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?m:Yn([m,o.encodeLocation?o.encodeLocation(C.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),r,i);return a&&E?x.createElement(_l.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...y},navigationType:"POP"}},E):E}function dk(){let t=xk(),a=XT(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),i=t instanceof Error?t.stack:null,o="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:o},u={padding:"2px 4px",backgroundColor:o},d=null;return console.error("Error handled by React Router default ErrorBoundary:",t),d=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:u},"ErrorBoundary")," or"," ",x.createElement("code",{style:u},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},a),i?x.createElement("pre",{style:r},i):null,d)}var fk=x.createElement(dk,null),mb=class extends x.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,a){return a.location!==t.location||a.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:a.error,location:a.location,revalidation:t.revalidation||a.revalidation}}componentDidCatch(t,a){this.props.onError?this.props.onError(t,a):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const i=ik(t.digest);i&&(t=i)}let a=t!==void 0?x.createElement(Dn.Provider,{value:this.props.routeContext},x.createElement(sh.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?x.createElement(hk,{error:t},a):a}};mb.contextType=JT;var Wd=new WeakMap;function hk({children:t,error:a}){let{basename:i}=x.useContext(pn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let o=sk(a.digest);if(o){let r=Wd.get(a);if(r)throw r;let u=rb(o.location,i);if(lb&&!Wd.get(a))if(u.isExternal||o.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:o.replace}));throw Wd.set(a,d),d}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return t}function pk({routeContext:t,match:a,children:i}){let o=x.useContext(Zi);return o&&o.static&&o.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=a.route.id),x.createElement(Dn.Provider,{value:t},i)}function mk(t,a=[],i){let o=i==null?void 0:i.state;if(t==null){if(!o)return null;if(o.errors)t=o.matches;else if(a.length===0&&!o.initialized&&o.matches.length>0)t=o.matches;else return null}let r=t,u=o==null?void 0:o.errors;if(u!=null){let v=r.findIndex(y=>y.route.id&&(u==null?void 0:u[y.route.id])!==void 0);ot(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),r=r.slice(0,Math.min(r.length,v+1))}let d=!1,p=-1;if(i&&o){d=o.renderFallback;for(let v=0;v<r.length;v++){let y=r[v];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(p=v),y.route.id){let{loaderData:b,errors:S}=o,T=y.route.loader&&!b.hasOwnProperty(y.route.id)&&(!S||S[y.route.id]===void 0);if(y.route.lazy||T){i.isStatic&&(d=!0),p>=0?r=r.slice(0,p+1):r=[r[0]];break}}}}let m=i==null?void 0:i.onError,g=o&&m?(v,y)=>{var b,S;m(v,{location:o.location,params:((S=(b=o.matches)==null?void 0:b[0])==null?void 0:S.params)??{},unstable_pattern:QT(o.matches),errorInfo:y})}:void 0;return r.reduceRight((v,y,b)=>{let S,T=!1,E=null,N=null;o&&(S=u&&y.route.id?u[y.route.id]:void 0,E=y.route.errorElement||fk,d&&(p<0&&b===0?(gb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),T=!0,N=null):p===b&&(T=!0,N=y.route.hydrateFallbackElement||null)));let C=a.concat(r.slice(0,b+1)),j=()=>{let D;return S?D=E:T?D=N:y.route.Component?D=x.createElement(y.route.Component,null):y.route.element?D=y.route.element:D=v,x.createElement(pk,{match:y,routeContext:{outlet:v,matches:C,isDataRoute:o!=null},children:D})};return o&&(y.route.ErrorBoundary||y.route.errorElement||b===0)?x.createElement(mb,{location:o.location,revalidation:o.revalidation,component:E,error:S,children:j(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:g}):j()},null)}function ih(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function gk(t){let a=x.useContext(Zi);return ot(a,ih(t)),a}function vk(t){let a=x.useContext(Tc);return ot(a,ih(t)),a}function yk(t){let a=x.useContext(Dn);return ot(a,ih(t)),a}function oh(t){let a=yk(t),i=a.matches[a.matches.length-1];return ot(i.route.id,`${t} can only be used on routes that contain a unique "id"`),i.route.id}function bk(){return oh("useRouteId")}function xk(){var o;let t=x.useContext(sh),a=vk("useRouteError"),i=oh("useRouteError");return t!==void 0?t:(o=a.errors)==null?void 0:o[i]}function _k(){let{router:t}=gk("useNavigate"),a=oh("useNavigate"),i=x.useRef(!1);return hb(()=>{i.current=!0}),x.useCallback(async(r,u={})=>{An(i.current,fb),i.current&&(typeof r=="number"?await t.navigate(r):await t.navigate(r,{fromRouteId:a,...u}))},[t,a])}var dy={};function gb(t,a,i){!a&&!dy[t]&&(dy[t]=!0,An(!1,i))}x.memo(Sk);function Sk({routes:t,future:a,state:i,isStatic:o,onError:r}){return pb(t,void 0,{state:i,isStatic:o,onError:r})}function $n({to:t,replace:a,state:i,relative:o}){ot(Is(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=x.useContext(pn);An(!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:u}=x.useContext(Dn),{pathname:d}=jt(),p=kc(),m=Sc(t,ah(u),d,o==="path"),g=JSON.stringify(m);return x.useEffect(()=>{p(JSON.parse(g),{replace:a,state:i,relative:o})},[p,g,o,a,i]),null}function Ls(t){return ck(t.context)}function Se(t){ot(!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 Tk({basename:t="/",children:a=null,location:i,navigationType:o="POP",navigator:r,static:u=!1,unstable_useTransitions:d}){ot(!Is(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=t.replace(/^\/*/,"/"),m=x.useMemo(()=>({basename:p,navigator:r,static:u,unstable_useTransitions:d,future:{}}),[p,r,u,d]);typeof i=="string"&&(i=Yi(i));let{pathname:g="/",search:v="",hash:y="",state:b=null,key:S="default",unstable_mask:T}=i,E=x.useMemo(()=>{let N=xa(g,p);return N==null?null:{location:{pathname:N,search:v,hash:y,state:b,key:S,unstable_mask:T},navigationType:o}},[p,g,v,y,b,S,o,T]);return An(E!=null,`<Router basename="${p}"> is not able to match the URL "${g}${v}${y}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:x.createElement(pn.Provider,{value:m},x.createElement(_l.Provider,{children:a,value:E}))}function kk({children:t,location:a}){return uk(Cf(t),a)}function Cf(t,a=[]){let i=[];return x.Children.forEach(t,(o,r)=>{if(!x.isValidElement(o))return;let u=[...a,r];if(o.type===x.Fragment){i.push.apply(i,Cf(o.props.children,u));return}ot(o.type===Se,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ot(!o.props.index||!o.props.children,"An index route cannot have child routes.");let d={id:o.props.id||u.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(d.children=Cf(o.props.children,u)),i.push(d)}),i}var nc="get",ac="application/x-www-form-urlencoded";function Cc(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function Ck(t){return Cc(t)&&t.tagName.toLowerCase()==="button"}function Ek(t){return Cc(t)&&t.tagName.toLowerCase()==="form"}function Nk(t){return Cc(t)&&t.tagName.toLowerCase()==="input"}function jk(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function wk(t,a){return t.button===0&&(!a||a==="_self")&&!jk(t)}function Ef(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((a,i)=>{let o=t[i];return a.concat(Array.isArray(o)?o.map(r=>[i,r]):[[i,o]])},[]))}function Ak(t,a){let i=Ef(t);return a&&a.forEach((o,r)=>{i.has(r)||a.getAll(r).forEach(u=>{i.append(r,u)})}),i}var Fr=null;function Dk(){if(Fr===null)try{new FormData(document.createElement("form"),0),Fr=!1}catch{Fr=!0}return Fr}var Rk=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Jd(t){return t!=null&&!Rk.has(t)?(An(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ac}"`),null):t}function Mk(t,a){let i,o,r,u,d;if(Ek(t)){let p=t.getAttribute("action");o=p?xa(p,a):null,i=t.getAttribute("method")||nc,r=Jd(t.getAttribute("enctype"))||ac,u=new FormData(t)}else if(Ck(t)||Nk(t)&&(t.type==="submit"||t.type==="image")){let p=t.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=t.getAttribute("formaction")||p.getAttribute("action");if(o=m?xa(m,a):null,i=t.getAttribute("formmethod")||p.getAttribute("method")||nc,r=Jd(t.getAttribute("formenctype"))||Jd(p.getAttribute("enctype"))||ac,u=new FormData(p,t),!Dk()){let{name:g,type:v,value:y}=t;if(v==="image"){let b=g?`${g}.`:"";u.append(`${b}x`,"0"),u.append(`${b}y`,"0")}else g&&u.append(g,y)}}else{if(Cc(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=nc,o=null,r=ac,d=t}return u&&r==="text/plain"&&(d=u,u=void 0),{action:o,method:i.toLowerCase(),encType:r,formData:u,body:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function lh(t,a){if(t===!1||t===null||typeof t>"u")throw new Error(a)}function Ok(t,a,i,o){let r=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return i?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${o}`:r.pathname=`${r.pathname}.${o}`:r.pathname==="/"?r.pathname=`_root.${o}`:a&&xa(r.pathname,a)==="/"?r.pathname=`${a.replace(/\/$/,"")}/_root.${o}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${o}`,r}async function Bk(t,a){if(t.id in a)return a[t.id];try{let i=await import(t.module);return a[t.id]=i,i}catch(i){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ik(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function Lk(t,a,i){let o=await Promise.all(t.map(async r=>{let u=a.routes[r.route.id];if(u){let d=await Bk(u,i);return d.links?d.links():[]}return[]}));return Hk(o.flat(1).filter(Ik).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function fy(t,a,i,o,r,u){let d=(m,g)=>i[g]?m.route.id!==i[g].route.id:!0,p=(m,g)=>{var v;return i[g].pathname!==m.pathname||((v=i[g].route.path)==null?void 0:v.endsWith("*"))&&i[g].params["*"]!==m.params["*"]};return u==="assets"?a.filter((m,g)=>d(m,g)||p(m,g)):u==="data"?a.filter((m,g)=>{var y;let v=o.routes[m.route.id];if(!v||!v.hasLoader)return!1;if(d(m,g)||p(m,g))return!0;if(m.route.shouldRevalidate){let b=m.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:((y=i[0])==null?void 0:y.params)||{},nextUrl:new URL(t,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function Uk(t,a,{includeHydrateFallback:i}={}){return zk(t.map(o=>{let r=a.routes[o.route.id];if(!r)return[];let u=[r.module];return r.clientActionModule&&(u=u.concat(r.clientActionModule)),r.clientLoaderModule&&(u=u.concat(r.clientLoaderModule)),i&&r.hydrateFallbackModule&&(u=u.concat(r.hydrateFallbackModule)),r.imports&&(u=u.concat(r.imports)),u}).flat(1))}function zk(t){return[...new Set(t)]}function Vk(t){let a={},i=Object.keys(t).sort();for(let o of i)a[o]=t[o];return a}function Hk(t,a){let i=new Set;return new Set(a),t.reduce((o,r)=>{let u=JSON.stringify(Vk(r));return i.has(u)||(i.add(u),o.push({key:u,link:r})),o},[])}function vb(){let t=x.useContext(Zi);return lh(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function Pk(){let t=x.useContext(Tc);return lh(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var rh=x.createContext(void 0);rh.displayName="FrameworkContext";function yb(){let t=x.useContext(rh);return lh(t,"You must render this element inside a <HydratedRouter> element"),t}function Gk(t,a){let i=x.useContext(rh),[o,r]=x.useState(!1),[u,d]=x.useState(!1),{onFocus:p,onBlur:m,onMouseEnter:g,onMouseLeave:v,onTouchStart:y}=a,b=x.useRef(null);x.useEffect(()=>{if(t==="render"&&d(!0),t==="viewport"){let E=C=>{C.forEach(j=>{d(j.isIntersecting)})},N=new IntersectionObserver(E,{threshold:.5});return b.current&&N.observe(b.current),()=>{N.disconnect()}}},[t]),x.useEffect(()=>{if(o){let E=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(E)}}},[o]);let S=()=>{r(!0)},T=()=>{r(!1),d(!1)};return i?t!=="intent"?[u,b,{}]:[u,b,{onFocus:Yo(p,S),onBlur:Yo(m,T),onMouseEnter:Yo(g,S),onMouseLeave:Yo(v,T),onTouchStart:Yo(y,S)}]:[!1,b,{}]}function Yo(t,a){return i=>{t&&t(i),i.defaultPrevented||a(i)}}function $k({page:t,...a}){let{router:i}=vb(),o=x.useMemo(()=>ab(i.routes,t,i.basename),[i.routes,t,i.basename]);return o?x.createElement(qk,{page:t,matches:o,...a}):null}function Fk(t){let{manifest:a,routeModules:i}=yb(),[o,r]=x.useState([]);return x.useEffect(()=>{let u=!1;return Lk(t,a,i).then(d=>{u||r(d)}),()=>{u=!0}},[t,a,i]),o}function qk({page:t,matches:a,...i}){let o=jt(),{future:r,manifest:u,routeModules:d}=yb(),{basename:p}=vb(),{loaderData:m,matches:g}=Pk(),v=x.useMemo(()=>fy(t,a,g,u,o,"data"),[t,a,g,u,o]),y=x.useMemo(()=>fy(t,a,g,u,o,"assets"),[t,a,g,u,o]),b=x.useMemo(()=>{if(t===o.pathname+o.search+o.hash)return[];let E=new Set,N=!1;if(a.forEach(j=>{var R;let D=u.routes[j.route.id];!D||!D.hasLoader||(!v.some(w=>w.route.id===j.route.id)&&j.route.id in m&&((R=d[j.route.id])!=null&&R.shouldRevalidate)||D.hasClientLoader?N=!0:E.add(j.route.id))}),E.size===0)return[];let C=Ok(t,p,r.unstable_trailingSlashAwareDataRequests,"data");return N&&E.size>0&&C.searchParams.set("_routes",a.filter(j=>E.has(j.route.id)).map(j=>j.route.id).join(",")),[C.pathname+C.search]},[p,r.unstable_trailingSlashAwareDataRequests,m,o,u,v,a,t,d]),S=x.useMemo(()=>Uk(y,u),[y,u]),T=Fk(y);return x.createElement(x.Fragment,null,b.map(E=>x.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...i})),S.map(E=>x.createElement("link",{key:E,rel:"modulepreload",href:E,...i})),T.map(({key:E,link:N})=>x.createElement("link",{key:E,nonce:i.nonce,...N,crossOrigin:N.crossOrigin??i.crossOrigin})))}function Kk(...t){return a=>{t.forEach(i=>{typeof i=="function"?i(a):i!=null&&(i.current=a)})}}var Yk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Yk&&(window.__reactRouterVersion="7.13.1")}catch{}function Zk({basename:t,children:a,unstable_useTransitions:i,window:o}){let r=x.useRef();r.current==null&&(r.current=NT({window:o,v5Compat:!0}));let u=r.current,[d,p]=x.useState({action:u.action,location:u.location}),m=x.useCallback(g=>{i===!1?p(g):x.startTransition(()=>p(g))},[i]);return x.useLayoutEffect(()=>u.listen(m),[u,m]),x.createElement(Tk,{basename:t,children:a,location:d.location,navigationType:d.action,navigator:u,unstable_useTransitions:i})}var bb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ch=x.forwardRef(function({onClick:a,discover:i="render",prefetch:o="none",relative:r,reloadDocument:u,replace:d,unstable_mask:p,state:m,target:g,to:v,preventScrollReset:y,viewTransition:b,unstable_defaultShouldRevalidate:S,...T},E){let{basename:N,navigator:C,unstable_useTransitions:j}=x.useContext(pn),D=typeof v=="string"&&bb.test(v),R=rb(v,N);v=R.to;let w=ok(v,{relative:r}),F=jt(),H=null;if(p){let ne=Sc(p,[],F.unstable_mask?F.unstable_mask.pathname:"/",!0);N!=="/"&&(ne.pathname=ne.pathname==="/"?N:Yn([N,ne.pathname])),H=C.createHref(ne)}let[B,q,X]=Gk(o,T),ae=Jk(v,{replace:d,unstable_mask:p,state:m,target:g,preventScrollReset:y,relative:r,viewTransition:b,unstable_defaultShouldRevalidate:S,unstable_useTransitions:j});function te(ne){a&&a(ne),ne.defaultPrevented||ae(ne)}let ee=!(R.isExternal||u),z=x.createElement("a",{...T,...X,href:(ee?H:void 0)||R.absoluteURL||w,onClick:ee?te:a,ref:Kk(E,q),target:g,"data-discover":!D&&i==="render"?"true":void 0});return B&&!D?x.createElement(x.Fragment,null,z,x.createElement($k,{page:w})):z});ch.displayName="Link";var Xk=x.forwardRef(function({"aria-current":a="page",caseSensitive:i=!1,className:o="",end:r=!1,style:u,to:d,viewTransition:p,children:m,...g},v){let y=Sl(d,{relative:g.relative}),b=jt(),S=x.useContext(Tc),{navigator:T,basename:E}=x.useContext(pn),N=S!=null&&sC(y)&&p===!0,C=T.encodeLocation?T.encodeLocation(y).pathname:y.pathname,j=b.pathname,D=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;i||(j=j.toLowerCase(),D=D?D.toLowerCase():null,C=C.toLowerCase()),D&&E&&(D=xa(D,E)||D);const R=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let w=j===C||!r&&j.startsWith(C)&&j.charAt(R)==="/",F=D!=null&&(D===C||!r&&D.startsWith(C)&&D.charAt(C.length)==="/"),H={isActive:w,isPending:F,isTransitioning:N},B=w?a:void 0,q;typeof o=="function"?q=o(H):q=[o,w?"active":null,F?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let X=typeof u=="function"?u(H):u;return x.createElement(ch,{...g,"aria-current":B,className:q,ref:v,style:X,to:d,viewTransition:p},typeof m=="function"?m(H):m)});Xk.displayName="NavLink";var Qk=x.forwardRef(({discover:t="render",fetcherKey:a,navigate:i,reloadDocument:o,replace:r,state:u,method:d=nc,action:p,onSubmit:m,relative:g,preventScrollReset:v,viewTransition:y,unstable_defaultShouldRevalidate:b,...S},T)=>{let{unstable_useTransitions:E}=x.useContext(pn),N=nC(),C=aC(p,{relative:g}),j=d.toLowerCase()==="get"?"get":"post",D=typeof p=="string"&&bb.test(p),R=w=>{if(m&&m(w),w.defaultPrevented)return;w.preventDefault();let F=w.nativeEvent.submitter,H=(F==null?void 0:F.getAttribute("formmethod"))||d,B=()=>N(F||w.currentTarget,{fetcherKey:a,method:H,navigate:i,replace:r,state:u,relative:g,preventScrollReset:v,viewTransition:y,unstable_defaultShouldRevalidate:b});E&&i!==!1?x.startTransition(()=>B()):B()};return x.createElement("form",{ref:T,method:j,action:C,onSubmit:o?m:R,...S,"data-discover":!D&&t==="render"?"true":void 0})});Qk.displayName="Form";function Wk(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function xb(t){let a=x.useContext(Zi);return ot(a,Wk(t)),a}function Jk(t,{target:a,replace:i,unstable_mask:o,state:r,preventScrollReset:u,relative:d,viewTransition:p,unstable_defaultShouldRevalidate:m,unstable_useTransitions:g}={}){let v=kc(),y=jt(),b=Sl(t,{relative:d});return x.useCallback(S=>{if(wk(S,a)){S.preventDefault();let T=i!==void 0?i:hl(y)===hl(b),E=()=>v(t,{replace:T,unstable_mask:o,state:r,preventScrollReset:u,relative:d,viewTransition:p,unstable_defaultShouldRevalidate:m});g?x.startTransition(()=>E()):E()}},[y,v,b,i,o,r,a,t,u,d,p,m,g])}function uh(t){An(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=x.useRef(Ef(t)),i=x.useRef(!1),o=jt(),r=x.useMemo(()=>Ak(o.search,i.current?null:a.current),[o.search]),u=kc(),d=x.useCallback((p,m)=>{const g=Ef(typeof p=="function"?p(new URLSearchParams(r)):p);i.current=!0,u("?"+g,m)},[u,r]);return[r,d]}var eC=0,tC=()=>`__${String(++eC)}__`;function nC(){let{router:t}=xb("useSubmit"),{basename:a}=x.useContext(pn),i=bk(),o=t.fetch,r=t.navigate;return x.useCallback(async(u,d={})=>{let{action:p,method:m,encType:g,formData:v,body:y}=Mk(u,a);if(d.navigate===!1){let b=d.fetcherKey||tC();await o(b,i,d.action||p,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:v,body:y,formMethod:d.method||m,formEncType:d.encType||g,flushSync:d.flushSync})}else await r(d.action||p,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:v,body:y,formMethod:d.method||m,formEncType:d.encType||g,replace:d.replace,state:d.state,fromRouteId:i,flushSync:d.flushSync,viewTransition:d.viewTransition})},[o,r,a,i])}function aC(t,{relative:a}={}){let{basename:i}=x.useContext(pn),o=x.useContext(Dn);ot(o,"useFormAction must be used inside a RouteContext");let[r]=o.matches.slice(-1),u={...Sl(t||".",{relative:a})},d=jt();if(t==null){u.search=d.search;let p=new URLSearchParams(u.search),m=p.getAll("index");if(m.some(v=>v==="")){p.delete("index"),m.filter(y=>y).forEach(y=>p.append("index",y));let v=p.toString();u.search=v?`?${v}`:""}}return(!t||t===".")&&r.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(u.pathname=u.pathname==="/"?i:Yn([i,u.pathname])),hl(u)}function sC(t,{relative:a}={}){let i=x.useContext(ub);ot(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=xb("useViewTransitionState"),r=Sl(t,{relative:a});if(!i.isTransitioning)return!1;let u=xa(i.currentLocation.pathname,o)||i.currentLocation.pathname,d=xa(i.nextLocation.pathname,o)||i.nextLocation.pathname;return pl(r.pathname,d)!=null||pl(r.pathname,u)!=null}function Dt(){const t=kc();return x.useCallback((a,i)=>{typeof a=="number"?t(a):t(a,i)},[t])}function _b(t){return`/sessions/${encodeURIComponent(t)}`}function Hi(t,a){return a?`/environments/${encodeURIComponent(a)}/workspaces/${encodeURIComponent(t)}`:`/workspaces/${encodeURIComponent(t)}`}function _a(t,a,i,o){const r=encodeURIComponent(t);let u;return i&&o?u=`/environments/${encodeURIComponent(o)}/workspaces/${encodeURIComponent(i)}/tasks/${r}`:i?u=`/workspaces/${encodeURIComponent(i)}/tasks/${r}`:u=`/tasks/${r}`,a?`${u}/${a}`:u}function iC(t,a,i){return a&&i?`/environments/${encodeURIComponent(i)}/workspaces/${encodeURIComponent(a)}/tasks/${encodeURIComponent(t)}/edit`:a?`/workspaces/${encodeURIComponent(a)}/tasks/${encodeURIComponent(t)}/edit`:`/tasks/${encodeURIComponent(t)}/edit`}function Xi(t,a,i){const o=new URLSearchParams;t&&o.set("workspace",t),a&&o.set("parent",a);const r=o.toString();if(t&&i){const u=`/environments/${encodeURIComponent(i)}/workspaces/${encodeURIComponent(t)}/tasks/new`;return a?`${u}?parent=${encodeURIComponent(a)}`:u}return r?`/tasks/new?${r}`:"/tasks/new"}function Sb(t){return`/sessions/new?${new URLSearchParams({env:t}).toString()}`}const Pi="/environments",oC="/environments/new";function Gi(t){return`/environments/${encodeURIComponent(t)}`}function lC(t){return`/environments/${encodeURIComponent(t)}/edit`}const il="/settings",rC="/settings/credentials",cC="/pair",uC="/chat",Os="/",dC="/tasks",Tb="/workspaces/new",kb="/knowledge";function fC(t,a){const i=typeof window<"u"?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`:"ws://localhost:3000",o=x.useRef(void 0),[r,u]=x.useState(!1),d=x.useRef(a.onMessage);d.current=a.onMessage;const p=x.useRef(a.onConnect);p.current=a.onConnect;const m=x.useRef(a.onDisconnect);m.current=a.onDisconnect;const g=x.useCallback(v=>{var y;((y=o.current)==null?void 0:y.readyState)===WebSocket.OPEN&&o.current.send(JSON.stringify(v))},[]);return x.useEffect(()=>{let v,y;function b(){v=new WebSocket(i),o.current=v,v.onopen=()=>{u(!0),p.current(g)},v.onmessage=S=>{if(typeof S.data!="string"){console.warn("[ws] Received non-string WebSocket message; ignoring");return}const T=kT(S.data);T&&d.current(T)},v.onclose=S=>{var T;if(u(!1),o.current=void 0,(T=m.current)==null||T.call(m),clearTimeout(y),S.code===ET){window.location.href=cC;return}y=setTimeout(b,CT)},v.onerror=()=>{v.close()}}return b(),()=>{clearTimeout(y),v==null||v.close()}},[i,g]),{connected:r,send:g}}const hC=5e3;function pC(t){const[a,i]=x.useState([]),[o,r]=x.useState({}),u=x.useCallback(b=>{switch(b.type){case"environment.added":return!0;case"environment.removed":{const S=b.payload.environmentId;return S&&(i(T=>T.filter(E=>E.id!==S)),r(T=>{const E={...T};return delete E[S],E})),t({type:"list_sessions"}),!0}case"environment.changed":return t({type:"list_environments"}),!0;case"environment.provision_progress":{const S=b.payload;if(typeof S.environmentId!="string"||typeof S.stage!="string"||typeof S.message!="string"||typeof S.progress!="number")return fl("environment.provision_progress","invalid payload"),!0;if(r(T=>({...T,[S.environmentId]:{stage:S.stage,message:S.message,progress:S.progress}})),S.stage==="ready"){const T=S.environmentId;setTimeout(()=>{r(E=>{const N={...E};return delete N[T],N})},hC)}return!0}default:return!1}},[t]),d=x.useCallback(b=>{var S;switch(b.type){case"environments":return i(Kn((S=b.payload)==null?void 0:S.environments,mT,"environments","environments").map(gT)),!0;default:return!1}},[]),p=x.useCallback((b,S,T)=>{t({type:"add_environment",payload:{displayName:b,adapterType:S,adapterConfig:T||{}}})},[t]),m=x.useCallback((b,S)=>{const T={environmentId:b,...S};t({type:"update_environment",payload:T})},[t]),g=x.useCallback(b=>{t({type:"provision_environment",payload:{environmentId:b}})},[t]),v=x.useCallback(b=>{t({type:"stop_environment",payload:{environmentId:b}})},[t]),y=x.useCallback(b=>{t({type:"remove_environment",payload:{environmentId:b}})},[t]);return{environments:a,provisionStatus:o,addEnvironment:p,updateEnvironment:m,provisionEnvironment:g,stopEnvironment:v,removeEnvironment:y,handleMessage:d,handleEvent:u}}const ef=new Set(["pending","running","idle"]),mC=new Set(["stopped","suspended"]),hy=["pending","running","idle"];function gC(t){const[a,i]=x.useState([]),[o,r]=x.useState([]),[u,d]=x.useState(0),[p,m]=x.useState(void 0),[g,v]=x.useState({}),y=x.useCallback(j=>{var D,R,w,F,H;switch(j.type){case"sessions":return i(B=>{var ae;const q=Kn((ae=j.payload)==null?void 0:ae.sessions,ay,"sessions","sessions"),X=new Map(B.map(te=>[te.id,te]));return q.map(te=>{const ee=X.get(te.id),z=ee==null?void 0:ee.status;return!z||z===te.status?te:mC.has(z)&&ef.has(te.status)?{...te,status:z,...ee.endReason!==void 0?{endReason:ee.endReason}:{}}:ef.has(z)&&ef.has(te.status)&&hy.indexOf(z)>hy.indexOf(te.status)?{...te,status:z}:te})}),!0;case"session_event":{if(!sy(j.payload))return fl("session_event","payload is not a valid SessionEvent"),!0;const B=j.payload;let q=0;if(r(X=>{const ae=[...X,B];return ae.length>Di?(q=ae.length-Di,ae.slice(-Di)):ae}),q>0&&d(X=>X+q),B.eventType==="usage")try{const X=JSON.parse(B.content),ae=Number(X.input_tokens)||0,te=Number(X.output_tokens)||0,ee=Number(X.cost_usd)||0;(ae>0||te>0||ee>0)&&i(z=>z.map(ne=>ne.id===B.sessionId?{...ne,inputTokens:(ne.inputTokens??0)+ae,outputTokens:(ne.outputTokens??0)+te,costUsd:(ne.costUsd??0)+ee}:ne))}catch{}if(B.eventType==="status"){const X=tb(B.content),ae=nb(B.content);i(te=>te.some(z=>z.id===B.sessionId)?te.map(z=>z.id===B.sessionId?{...z,status:X,...ae!==void 0?{endReason:ae}:{}}:z):[...te,{id:B.sessionId,environmentId:"",runtime:"",status:X,prompt:"",startedAt:B.timestamp,...ae!==void 0?{endReason:ae}:{}}])}return!0}case"session_events":{const B=Kn((D=j.payload)==null?void 0:D.events,sy,"session_events","events"),q=(R=j.payload)==null?void 0:R.sessionId;if(typeof q!="string")return fl("session_events","missing or non-string sessionId"),!0;if(B.length>0){let X=0;r(ae=>{const te=new Set;for(const ne of ae)ne.sessionId===q&&te.add(`${ne.timestamp}|${ne.eventType}`);const ee=B.filter(ne=>!te.has(`${ne.timestamp}|${ne.eventType}`)),z=[...ae,...ee].sort((ne,I)=>ne.sessionId!==I.sessionId?0:ne.timestamp.localeCompare(I.timestamp));return z.length>Di?(X=z.length-Di,z.slice(-Di)):z}),X>0&&d(ae=>ae+X)}return!0}case"spawned":{const B=(w=j.payload)==null?void 0:w.sessionId;return typeof B=="string"&&B&&m(B),t({type:"list_sessions"}),!0}case"task_sessions":{const B=(F=j.payload)==null?void 0:F.taskId;if(typeof B!="string"||!B)return!0;const q=Kn((H=j.payload)==null?void 0:H.sessions,ay,"task_sessions","sessions");return v(X=>({...X,[B]:q})),!0}default:return!1}},[t]),b=x.useCallback((j,D,R,w)=>{t({type:"spawn",payload:{environmentId:j,prompt:D,personaId:R||"",worktreeBasePath:w||""}})},[t]),S=x.useCallback((j,D)=>{t({type:"send_input",payload:{sessionId:j,text:D}})},[t]),T=x.useCallback(j=>{t({type:"kill",payload:{sessionId:j}})},[t]),E=x.useCallback(j=>{t({type:"get_session_events",payload:{sessionId:j}})},[t]),N=x.useCallback(()=>{r([]),d(0)},[]),C=x.useCallback(j=>{t({type:"get_task_sessions",payload:{taskId:j}})},[t]);return{sessions:a,events:o,eventsDropped:u,lastSpawnedId:p,taskSessions:g,spawn:b,sendInput:S,kill:T,loadSessionEvents:E,clearEvents:N,loadTaskSessions:C,handleMessage:y}}const vC=15e3;function yC(t){const[a,i]=x.useState([]),[o,r]=x.useState(!1),u=x.useRef(new Map),d=x.useCallback(()=>{r(u.current.size>0)},[]),p=x.useCallback(S=>{switch(S.type){case"workspace.created":{const T=typeof S.payload.requestId=="string"?S.payload.requestId:"";if(T){const E=u.current.get(T);E&&(clearTimeout(E.timer),u.current.delete(T),d(),E.onSuccess())}return t({type:"list_workspaces"}),!0}case"workspace.archived":case"workspace.updated":return t({type:"list_workspaces"}),!0;default:return!1}},[t,d]),m=x.useCallback(S=>{var T,E,N;switch(S.type){case"workspaces":return i(Kn((T=S.payload)==null?void 0:T.workspaces,vT,"workspaces","workspaces")),!0;case"create_workspace_error":{const C=typeof((E=S.payload)==null?void 0:E.requestId)=="string"?S.payload.requestId:"",j=typeof((N=S.payload)==null?void 0:N.message)=="string"?S.payload.message:"Failed to create workspace";if(r(!1),C){const D=u.current.get(C);D?(clearTimeout(D.timer),u.current.delete(C),d(),D.onError(j)):console.error("Received create_workspace_error for unknown requestId",{requestId:C,errorMessage:j})}else console.error("Received create_workspace_error without requestId",{errorMessage:j});return!0}default:return!1}},[d]),g=x.useCallback(()=>{for(const[,S]of u.current)clearTimeout(S.timer),S.onError("Disconnected");u.current.clear(),d()},[d]),v=x.useCallback((S,T,E,N,C,j,D,R,w)=>{const F={name:S,description:T||"",repoUrl:E||"",environmentId:N||"",defaultPersonaId:C||"",useWorktrees:j??!0,worktreeBasePath:D||""},H=crypto.randomUUID();F.requestId=H;const B=w??(()=>{}),q=setTimeout(()=>{u.current.delete(H)&&(d(),B("Request timed out"))},vC);u.current.set(H,{onSuccess:R??(()=>{}),onError:B,timer:q}),d(),t({type:"create_workspace",payload:F})},[t,d]),y=x.useCallback(S=>{t({type:"archive_workspace",payload:{workspaceId:S}})},[t]),b=x.useCallback((S,T)=>{t({type:"update_workspace",payload:{workspaceId:S,...T}})},[t]);return{workspaces:a,workspaceCreating:o,createWorkspace:v,archiveWorkspace:y,updateWorkspace:b,handleMessage:m,handleEvent:p,onDisconnect:g}}const bC=15e3;function xC(t){const[a,i]=x.useState([]),[o,r]=x.useState(void 0),u=x.useRef(new Map),d=x.useCallback(j=>{const D=j.payload;switch(j.type){case"task.created":{const R=typeof D.requestId=="string"?D.requestId:"";if(R){const F=u.current.get(R);F&&(clearTimeout(F.timer),u.current.delete(R),F.onSuccess())}const w=typeof D.workspaceId=="string"?D.workspaceId:"";return w&&t({type:"list_tasks",payload:{workspaceId:w}}),!0}case"task.started":{const R=typeof D.taskId=="string"?D.taskId:"",w=typeof D.sessionId=="string"?D.sessionId:"",F=typeof D.workspaceId=="string"?D.workspaceId:"";return r(H=>R&&H===R?void 0:H),w&&(t({type:"list_sessions"}),R&&i(H=>H.map(B=>B.id===R?{...B,latestSessionId:w}:B))),F?t({type:"list_tasks",payload:{workspaceId:F}}):R&&i(H=>{const B=H.find(q=>q.id===R);return B!=null&&B.workspaceId?t({type:"list_tasks",payload:{workspaceId:B.workspaceId}}):t({type:"list_tasks",payload:{}}),H}),!0}case"task.completed":case"task.deleted":case"task.updated":{const R=typeof D.workspaceId=="string"?D.workspaceId:"",w=typeof D.taskId=="string"?D.taskId:"";return R?t({type:"list_tasks",payload:{workspaceId:R}}):w&&i(F=>{const H=F.find(B=>B.id===w);return H!=null&&H.workspaceId?t({type:"list_tasks",payload:{workspaceId:H.workspaceId}}):t({type:"list_tasks",payload:{}}),F}),!0}default:return!1}},[t]),p=x.useCallback(j=>{var D,R,w,F;switch(j.type){case"tasks":{const H=Kn((D=j.payload)==null?void 0:D.tasks,yT,"tasks","tasks"),B=typeof((R=j.payload)==null?void 0:R.workspaceId)=="string"&&j.payload.workspaceId?j.payload.workspaceId:"";return B?(i(q=>[...q.filter(X=>X.workspaceId!==B),...H]),!0):(i(q=>{const X=new Set(H.map(ae=>ae.id));return[...q.filter(ae=>!X.has(ae.id)),...H]}),!0)}case"create_task_error":{const H=typeof((w=j.payload)==null?void 0:w.requestId)=="string"?j.payload.requestId:"",B=typeof((F=j.payload)==null?void 0:F.message)=="string"?j.payload.message:"Failed to create task";if(H){const q=u.current.get(H);q?(clearTimeout(q.timer),u.current.delete(H),q.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=x.useCallback(()=>{r(void 0);for(const[,j]of u.current)clearTimeout(j.timer),j.onError("Disconnected");u.current.clear()},[]),g=x.useCallback(j=>{t({type:"list_tasks",payload:{workspaceId:j}})},[t]),v=x.useCallback(()=>{t({type:"list_tasks",payload:{}})},[t]),y=x.useCallback((j,D,R,w,F,H,B,q,X)=>{const ae={workspaceId:j,title:D,description:R||"",dependsOn:w||[],parentTaskId:F||"",defaultPersonaId:H||"",canDecompose:B||!1};if(q||X){const te=crypto.randomUUID();ae.requestId=te;const ee=X??(()=>{}),z=setTimeout(()=>{u.current.delete(te)&&ee("Request timed out")},bC);u.current.set(te,{onSuccess:q??(()=>{}),onError:ee,timer:z})}t({type:"create_task",payload:ae})},[t]),b=x.useCallback((j,D,R,w)=>{r(j),t({type:"start_task",payload:{taskId:j,personaId:D||"",environmentId:R||"",notes:w||""}})},[t]),S=x.useCallback(j=>{t({type:"stop_task",payload:{taskId:j}})},[t]),T=x.useCallback(j=>{t({type:"complete_task",payload:{taskId:j}})},[t]),E=x.useCallback(j=>{t({type:"resume_task",payload:{taskId:j}})},[t]),N=x.useCallback((j,D,R,w,F)=>{const H={taskId:j,title:D,description:R,dependsOn:w};F!==void 0&&(H.defaultPersonaId=F),t({type:"update_task",payload:H})},[t]),C=x.useCallback(j=>{t({type:"delete_task",payload:{taskId:j}})},[t]);return{tasks:a,taskStartingId:o,loadTasks:g,loadAllTasks:v,createTask:y,startTask:b,stopTask:S,completeTask:T,resumeTask:E,updateTask:N,deleteTask:C,handleMessage:p,handleEvent:d,onDisconnect:m}}function _C(t){const[a,i]=x.useState([]),o=x.useCallback(p=>{if(p.type==="finding.posted"){const m=typeof p.payload.workspaceId=="string"?p.payload.workspaceId:"";return m&&t({type:"list_findings",payload:{workspaceId:m}}),!0}return!1},[t]),r=x.useCallback(p=>{var m;switch(p.type){case"findings":return i(Kn((m=p.payload)==null?void 0:m.findings,bT,"findings","findings")),!0;default:return!1}},[]),u=x.useCallback(p=>{t({type:"list_findings",payload:{workspaceId:p}})},[t]),d=x.useCallback((p,m,g,v,y)=>{t({type:"post_finding",payload:{workspaceId:p,title:m,content:g,category:v||"general",tags:y||[]}})},[t]);return{findings:a,loadFindings:u,postFinding:d,handleMessage:r,handleEvent:o}}function SC(t){const[a,i]=x.useState([]),o=x.useCallback(m=>m.type==="token.changed"?(t({type:"list_tokens"}),!0):!1,[t]),r=x.useCallback(m=>{var g;switch(m.type){case"tokens":return i(Kn((g=m.payload)==null?void 0:g.tokens,xT,"tokens","tokens")),!0;default:return!1}},[]),u=x.useCallback(()=>{t({type:"list_tokens"})},[t]),d=x.useCallback((m,g,v,y,b)=>{t({type:"set_token",payload:{name:m,value:g,tokenType:v,envVar:y,filePath:b}})},[t]),p=x.useCallback(m=>{t({type:"delete_token",payload:{name:m}})},[t]);return{tokens:a,loadTokens:u,setToken:d,deleteToken:p,handleMessage:r,handleEvent:o}}function TC(t){const[a,i]=x.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),o=x.useCallback(d=>d.type==="credential.providers_changed"?(iy(d.payload)&&i(d.payload),!0):!1,[]),r=x.useCallback(d=>{switch(d.type){case"credential_providers":return iy(d.payload)&&i(d.payload),!0;default:return!1}},[]),u=x.useCallback(d=>{t({type:"set_credential_providers",payload:d})},[t]);return{credentialProviders:a,updateCredentialProviders:u,handleMessage:r,handleEvent:o}}function kC(t,a){const[i,o]=x.useState([]),[r,u]=x.useState(""),[d,p]=x.useState(""),[m,g]=x.useState(!1),v=x.useCallback(S=>{var T,E,N;switch(S.type){case"codespaces_list":{const C=Kn((T=S.payload)==null?void 0:T.codespaces,ST,"codespaces_list","codespaces"),j=typeof((E=S.payload)==null?void 0:E.error)=="string"?S.payload.error:"";return o(C),p(j),!0}case"codespace_created":return g(!1),t({type:"list_codespaces"}),!0;case"codespace_create_error":{g(!1);const C=typeof((N=S.payload)==null?void 0:N.message)=="string"?S.payload.message:"Failed to create codespace";return u(C),!0}default:return!1}},[t]),y=x.useCallback(()=>{t({type:"list_codespaces"})},[t]),b=x.useCallback((S,T)=>{if(!a){u("Not connected to server. Please try again once the connection is restored.");return}g(!0),u("");const E={repo:S};T&&(E.machine=T),t({type:"create_codespace",payload:E})},[t,a]);return{codespaces:i,codespaceError:r,codespaceListError:d,codespaceCreating:m,listCodespaces:y,createCodespace:b,handleMessage:v}}function CC(t){const[a,i]=x.useState([]),o=x.useCallback(m=>{switch(m.type){case"persona.created":case"persona.updated":case"persona.deleted":return t({type:"list_personas"}),!0;default:return!1}},[t]),r=x.useCallback(m=>{var g;switch(m.type){case"personas":{const v=Kn((g=m.payload)==null?void 0:g.personas,TT,"personas","personas");return i(v),!0}default:return!1}},[]),u=x.useCallback((m,g,v,y,b,S,T,E)=>{t({type:"create_persona",payload:{name:m,description:g,systemPrompt:v,runtime:y||"",model:b||"",maxTurns:S||0,type:T||"agent",script:E||""}})},[t]),d=x.useCallback((m,g,v,y,b,S,T,E,N)=>{const C={personaId:m};g!==void 0&&(C.name=g),v!==void 0&&(C.description=v),y!==void 0&&(C.systemPrompt=y),b!==void 0&&(C.runtime=b),S!==void 0&&(C.model=S),T!==void 0&&(C.maxTurns=T),E!==void 0&&(C.type=E),N!==void 0&&(C.script=N),t({type:"update_persona",payload:C})},[t]),p=x.useCallback(m=>{t({type:"delete_persona",payload:{personaId:m}})},[t]);return{personas:a,createPersona:u,updatePersona:d,deletePersona:p,handleMessage:r,handleEvent:o}}function qr(t,a=0){return{id:t.id,label:t.title||t.label||t.id,kind:t.kind,category:t.category,sourceType:t.sourceType,sourceId:t.sourceId,content:t.content,tags:t.tags,workspaceId:t.workspaceId,createdAt:t.createdAt,updatedAt:t.updatedAt,val:a}}function tf(t){return{source:t.fromId,target:t.toId,type:t.type}}const EC=new Set(["knowledge.listRecent.result","knowledge.search.result","knowledge.getNode.result","knowledge.expand.result"]);function NC(t){const[a,i]=x.useState(new Map),[o,r]=x.useState([]),[u,d]=x.useState(void 0),[p,m]=x.useState(void 0),[g,v]=x.useState(!1),[y,b]=x.useState(""),S=x.useCallback(R=>{v(!0),t({type:"knowledge.listRecent",payload:{limit:30,workspaceId:R}})},[t]),T=x.useCallback(R=>{R.trim()&&(b(R),m(void 0),d(void 0),v(!0),t({type:"knowledge.search",payload:{query:R,limit:20}}))},[t]),E=x.useCallback(()=>{b(""),S()},[S]),N=x.useCallback(R=>{m(R),t({type:"knowledge.getNode",payload:{id:R}})},[t]),C=x.useCallback(()=>{m(void 0),d(void 0)},[]),j=x.useCallback(R=>{t({type:"knowledge.expand",payload:{id:R,depth:1}})},[t]),D=x.useCallback(R=>{if(!EC.has(R.type))return!1;const w=R.payload??{};switch(R.type){case"knowledge.listRecent.result":{if(w.error)return v(!1),!0;const F=w.nodes??[],H=w.edges??[],B=new Map,q=[];for(const X of F)B.set(X.id,qr(X));for(const X of H)q.push(tf(X));for(const X of q){const ae=B.get(X.source);ae&&(ae.val+=1);const te=B.get(X.target);te&&(te.val+=1)}return i(B),r(q),v(!1),!0}case"knowledge.search.result":{if(w.error)return v(!1),!0;const F=w.results??[],H=new Map,B=[];for(const q of F){const X=q.node,ae=q.edges??[];H.set(X.id,qr(X,ae.length));for(const te of ae)B.push(tf(te))}return i(H),r(B),v(!1),!0}case"knowledge.getNode.result":{if(w.error)return d(void 0),!0;const F=w.node,H=w.edges??[];return d({node:qr(F,H.length),edges:H.map(B=>({fromId:B.fromId,toId:B.toId,type:B.type,metadata:B.metadata}))}),!0}case"knowledge.expand.result":{const F=w.nodes??[],H=w.edges??[];return i(B=>{const q=new Map(B);for(const X of F)q.has(X.id)||q.set(X.id,qr(X));return q}),r(B=>{const q=new Set(B.map(ae=>`${ae.source}:${ae.target}:${ae.type}`)),X=[];for(const ae of H){const te=tf(ae),ee=`${te.source}:${te.target}:${te.type}`;q.has(ee)||X.push(te)}return[...B,...X]}),!0}}return!1},[]);return{graphData:{nodes:[...a.values()],links:o},selectedNode:u,selectedId:p,loading:g,searchQuery:y,search:T,clearSearch:E,selectNode:N,clearSelection:C,expandNode:j,loadRecent:S,handleMessage:D}}function jC(t){const[a,i]=x.useState(""),[o,r]=x.useState(void 0),[u,d]=x.useState({}),{connected:p,send:m}=fC(t,{onMessage:q,onConnect:X,onDisconnect:ae}),g=pC(m),v=gC(m),y=yC(m),b=xC(m),S=_C(m),T=SC(m),E=TC(m),N=kC(m,p),C=CC(m),j=NC(m),D="default_persona_id",R="onboarding_completed",w=x.useCallback(ee=>{i(ee),m({type:"set_setting",payload:{key:D,value:ee}})},[m]),F=x.useCallback(()=>{r(!0),m({type:"set_setting",payload:{key:R,value:"true"}})},[m]),H=x.useCallback((ee,z)=>{m({type:"get_usage",payload:{scope:ee,id:z}})},[m]);function B(ee){const z=ee.payload.key,ne=ee.payload.value;if(ee.type==="setting.changed"){z===D&&i(ne??""),z===R&&r(ne==="true");return}g.handleEvent(ee)||y.handleEvent(ee)||b.handleEvent(ee)||S.handleEvent(ee)||T.handleEvent(ee)||E.handleEvent(ee)||C.handleEvent(ee)}function q(ee){var z,ne,I,Y,oe;if(pT(ee)){B(ee);return}if(ee.type==="usage_stats"){const G=((z=ee.payload)==null?void 0:z.scope)||"",O=((ne=ee.payload)==null?void 0:ne.id)||"";if(G&&O){const ie=`${G}:${O}`;d(xe=>{var re,Ke,yt,fe;return{...xe,[ie]:{inputTokens:Number((re=ee.payload)==null?void 0:re.inputTokens)||0,outputTokens:Number((Ke=ee.payload)==null?void 0:Ke.outputTokens)||0,costUsd:Number((yt=ee.payload)==null?void 0:yt.costUsd)||0,sessionCount:Number((fe=ee.payload)==null?void 0:fe.sessionCount)||0}}})}return}if(ee.type==="setting"){const G=(I=ee.payload)==null?void 0:I.key,O=(Y=ee.payload)==null?void 0:Y.value;G===D&&i(O??""),G===R&&r(O==="true");return}if(!g.handleMessage(ee)&&!v.handleMessage(ee)&&!y.handleMessage(ee)&&!b.handleMessage(ee)&&!S.handleMessage(ee)&&!T.handleMessage(ee)&&!E.handleMessage(ee)&&!N.handleMessage(ee)&&!C.handleMessage(ee)&&!j.handleMessage(ee)&&ee.type==="error"){console.error("[ws]",(oe=ee.payload)==null?void 0:oe.message);return}}function X(ee){ee({type:"list_environments"}),ee({type:"list_sessions"}),ee({type:"list_workspaces"}),ee({type:"list_tokens"}),ee({type:"get_credential_providers"}),ee({type:"list_personas"}),ee({type:"get_setting",payload:{key:D}}),ee({type:"get_setting",payload:{key:R}}),ee({type:"list_tasks",payload:{}}),ee({type:"subscribe_all"})}function ae(){y.onDisconnect(),b.onDisconnect()}const te=x.useCallback(()=>{m({type:"list_environments"}),m({type:"list_sessions"}),m({type:"list_workspaces"}),m({type:"list_tokens"})},[m]);return{connected:p,send:m,environments:g.environments,sessions:v.sessions,events:v.events,eventsDropped:v.eventsDropped,lastSpawnedId:v.lastSpawnedId,workspaces:y.workspaces,tasks:b.tasks,findings:S.findings,tokens:T.tokens,spawn:v.spawn,sendInput:v.sendInput,kill:v.kill,refresh:te,loadSessionEvents:v.loadSessionEvents,clearEvents:v.clearEvents,createWorkspace:y.createWorkspace,archiveWorkspace:y.archiveWorkspace,updateWorkspace:y.updateWorkspace,loadTasks:b.loadTasks,loadAllTasks:b.loadAllTasks,createTask:b.createTask,startTask:b.startTask,stopTask:b.stopTask,completeTask:b.completeTask,resumeTask:b.resumeTask,updateTask:b.updateTask,deleteTask:b.deleteTask,loadFindings:S.loadFindings,postFinding:S.postFinding,addEnvironment:g.addEnvironment,updateEnvironment:g.updateEnvironment,loadTokens:T.loadTokens,setToken:T.setToken,deleteToken:T.deleteToken,credentialProviders:E.credentialProviders,updateCredentialProviders:E.updateCredentialProviders,provisionStatus:g.provisionStatus,provisionEnvironment:g.provisionEnvironment,stopEnvironment:g.stopEnvironment,removeEnvironment:g.removeEnvironment,codespaces:N.codespaces,codespaceError:N.codespaceError,codespaceListError:N.codespaceListError,codespaceCreating:N.codespaceCreating,listCodespaces:N.listCodespaces,createCodespace:N.createCodespace,workspaceCreating:y.workspaceCreating,taskStartingId:b.taskStartingId,personas:C.personas,createPersona:C.createPersona,updatePersona:C.updatePersona,deletePersona:C.deletePersona,taskSessions:v.taskSessions,loadTaskSessions:v.loadTaskSessions,appDefaultPersonaId:a,setAppDefaultPersonaId:w,onboardingCompleted:o,completeOnboarding:F,usageCache:u,loadUsage:H,knowledge:j}}const dh=x.createContext(void 0);function wC({children:t}){const a=jC();return c.jsx(dh.Provider,{value:a,children:t})}function qe(){const t=x.useContext(dh);if(!t)throw new Error("useGrackle must be used within GrackleProvider");return t}const AC=[{id:"env-local-01",displayName:"Local Dev",adapterType:"local",adapterConfig:"{}",status:"connected",bootstrapped:!0},{id:"env-docker-01",displayName:"Docker Sandbox",adapterType:"docker",adapterConfig:'{"image":"node:20"}',status:"connected",bootstrapped:!0},{id:"env-cs-01",displayName:"GitHub Codespace",adapterType:"codespace",adapterConfig:'{"codespaceName":"my-codespace"}',status:"connected",bootstrapped:!0},{id:"env-remote-01",displayName:"Staging (SSH)",adapterType:"ssh",adapterConfig:'{"host":"192.168.1.10","user":"deploy","sshPort":22}',status:"disconnected",bootstrapped:!1}],DC=[{id:"sess-001-prev",environmentId:"env-local-01",runtime:"claude-code",status:"stopped",endReason:"interrupted",prompt:"Implement auth middleware",startedAt:"2026-02-26T14:00:00Z",endedAt:"2026-02-26T15:12:00Z",error:"Context window exceeded before completing implementation",inputTokens:84200,outputTokens:12750,costUsd:.41},{id:"sess-001",environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:"Refactor the authentication middleware to use JWT tokens",startedAt:"2026-02-27T08:15:00Z",inputTokens:42600,outputTokens:8100,costUsd:.22},{id:"sess-002",environmentId:"env-docker-01",runtime:"claude-code",status:"stopped",endReason:"completed",prompt:"Write unit tests for the user registration endpoint",startedAt:"2026-02-27T07:30:00Z",endedAt:"2026-02-27T07:33:00Z",inputTokens:31400,outputTokens:9800,costUsd:.18},{id:"sess-003",environmentId:"env-local-01",runtime:"claude-code",status:"stopped",endReason:"interrupted",prompt:"Migrate database schema to add audit_log table",startedAt:"2026-02-26T22:45:00Z",endedAt:"2026-02-26T23:10:00Z",inputTokens:56300,outputTokens:14200,costUsd:.31},{id:"sess-004",environmentId:"env-docker-01",runtime:"claude-code",status:"running",prompt:"Implement rate limiting for the public API",startedAt:"2026-02-27T09:00:00Z",inputTokens:18900,outputTokens:4500,costUsd:.1},{id:"sess-005",environmentId:"env-cs-01",runtime:"claude-code",status:"suspended",prompt:"Refactor database connection pooling for multi-tenant isolation",startedAt:"2026-02-27T06:00:00Z",inputTokens:67800,outputTokens:19300,costUsd:.38}],RC=[{sessionId:"sess-001-prev",eventType:"status",timestamp:"2026-02-26T14:00:01Z",content:"running"},{sessionId:"sess-001-prev",eventType:"output",timestamp:"2026-02-26T14:00:05Z",content:"Reading src/middleware/auth.ts to understand the current authentication flow..."},{sessionId:"sess-001-prev",eventType:"error",timestamp:"2026-02-26T15:12:00Z",content:"Context window exceeded before completing implementation"},{sessionId:"sess-001",eventType:"status",timestamp:"2026-02-27T08:15:01Z",content:"running"},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:02Z",content:"Analyzing current authentication middleware in src/middleware/auth.ts..."},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:04Z",content:`Found 3 files using session-based auth:
38
- - src/middleware/auth.ts
39
- - src/routes/login.ts
40
- - src/routes/protected.ts`},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:07Z",content:"Installing jsonwebtoken and @types/jsonwebtoken..."},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:12Z",content:`Rewriting auth middleware:
41
- \`\`\`typescript
42
- import jwt from "jsonwebtoken";
43
- import type { Request, Response, NextFunction } from "express";
44
-
45
- const JWT_SECRET = process.env.JWT_SECRET || "change-me";
46
-
47
- export function verifyToken(req: Request, res: Response, next: NextFunction): void {
48
- const header = req.headers.authorization;
49
- if (!header?.startsWith("Bearer ")) {
50
- res.status(401).json({ error: "Missing token" });
51
- return;
52
- }
53
- try {
54
- const decoded = jwt.verify(header.slice(7), JWT_SECRET);
55
- req.user = decoded;
56
- next();
57
- } catch {
58
- res.status(403).json({ error: "Invalid token" });
59
- }
60
- }
61
- \`\`\``},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:18Z",content:"Updated login route to issue JWT tokens with 24h expiry."},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:22Z",content:"Running test suite... 14 tests passed, 2 updated, 0 failed."},{sessionId:"sess-002",eventType:"status",timestamp:"2026-02-27T07:30:01Z",content:"running"},{sessionId:"sess-002",eventType:"output",timestamp:"2026-02-27T07:30:05Z",content:"Generating pytest tests for POST /api/register endpoint..."},{sessionId:"sess-002",eventType:"output",timestamp:"2026-02-27T07:32:00Z",content:"Created 8 test cases covering: valid registration, duplicate email, weak password, missing fields, SQL injection, XSS payload, rate limit, and CORS headers."},{sessionId:"sess-002",eventType:"status",timestamp:"2026-02-27T07:33:00Z",content:"completed"}],MC=[{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"}],OC=[{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:""}],py=[{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"}],BC=[{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:""}],IC=[{id:"persona-arch",name:"Software Architect",description:"Designs system architecture, defines interfaces, and decomposes large features into implementable tasks.",systemPrompt:"You are a senior software architect. Focus on clean interfaces, separation of concerns, and scalable patterns. When decomposing work, create concrete subtasks with clear acceptance criteria.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:50,mcpServers:"[]",createdAt:"2026-02-20T10:00:00Z",updatedAt:"2026-02-20T10:00:00Z",type:"agent",script:""},{id:"persona-fe",name:"Frontend Engineer",description:"React specialist — builds UI components, writes CSS, implements routing, and creates Playwright tests.",systemPrompt:"You are a frontend engineer specializing in React, TypeScript, and modern CSS. Follow component composition patterns, use semantic HTML, and write accessible markup.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit","Bash"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:100,mcpServers:"[]",createdAt:"2026-02-20T10:05:00Z",updatedAt:"2026-02-20T10:05:00Z",type:"agent",script:""},{id:"persona-reviewer",name:"Code Reviewer",description:"Reviews diffs for correctness, security, and style. Posts findings for issues discovered.",systemPrompt:"You are a meticulous code reviewer. Check for security vulnerabilities, performance issues, and style consistency. Post findings for anything noteworthy.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:30,mcpServers:"[]",createdAt:"2026-02-20T10:10:00Z",updatedAt:"2026-02-20T10:10:00Z",type:"agent",script:""},{id:"persona-tester",name:"QA Engineer",description:"Writes comprehensive test suites — unit tests, integration tests, and E2E Playwright specs.",systemPrompt:"You are a QA engineer focused on test coverage. Write tests that cover happy paths, edge cases, error scenarios, and accessibility. Use Playwright for E2E tests.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit","Bash"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:80,mcpServers:"[]",createdAt:"2026-02-20T10:15:00Z",updatedAt:"2026-02-20T10:15:00Z",type:"agent",script:""},{id:"persona-lint",name:"Lint & Format",description:"Scripted persona — runs ESLint and Prettier on changed files, auto-fixes violations, and posts a findings summary.",systemPrompt:"",toolConfig:"{}",runtime:"genaiscript",model:"",maxTurns:1,mcpServers:"[]",createdAt:"2026-02-21T09:00:00Z",updatedAt:"2026-02-21T09:00:00Z",type:"script",script:`const files = env.files.filter(f => /\\.(ts|tsx|js)$/.test(f.filename));
62
- for (const f of files) {
63
- const eslintResult = await host.exec("npx", ["eslint", "--fix", f.filename]);
64
- if (eslintResult.exitCode !== 0) {
65
- env.findings.push({ category: "lint", title: \`Lint issues in \${f.filename}\`, content: eslintResult.stderr });
66
- }
67
- const prettierResult = await host.exec("npx", ["prettier", "--write", f.filename]);
68
- if (prettierResult.exitCode !== 0) {
69
- env.findings.push({ category: "format", title: \`Prettier issues in \${f.filename}\`, content: prettierResult.stderr });
70
- }
71
- }
72
- env.findings.push({ category: "summary", title: "Lint & format pass complete", content: \`Ran ESLint and Prettier on \${files.length} files\` });`}],LC={"task-001b":[{id:"sess-001-prev",environmentId:"env-local-01",runtime:"claude-code",status:"stopped",endReason:"interrupted",prompt:"Implement auth middleware",startedAt:"2026-02-26T14:00:00Z"},{id:"sess-001",environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:"Implement auth middleware",startedAt:"2026-02-27T08:15:00Z"}],"task-006c":[{id:"sess-004",environmentId:"env-docker-01",runtime:"claude-code",status:"running",prompt:"Add compression options",startedAt:"2026-02-27T09:00:00Z"}]};function Nt(t){return new Date(Date.now()+t).toISOString()}const my=[{label:"API Refactor",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Nt(0),content:"running"}},{delayMs:800,event:{eventType:"output",timestamp:Nt(800),content:"Analyzing current API structure in src/routes/..."}},{delayMs:1600,event:{eventType:"output",timestamp:Nt(1600),content:`Found 5 endpoints that need refactoring:
73
- - GET /api/users
74
- - POST /api/users
75
- - GET /api/users/:id
76
- - PUT /api/users/:id
77
- - DELETE /api/users/:id`}},{delayMs:2800,event:{eventType:"output",timestamp:Nt(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:Nt(4e3),content:"Running test suite... 22 tests passed, 3 updated, 0 failed."}},{delayMs:5e3,event:{eventType:"status",timestamp:Nt(5e3),content:"completed"}}]},{label:"Database Migration",pauseForInput:!0,pauseAfterStep:3,steps:[{delayMs:0,event:{eventType:"status",timestamp:Nt(0),content:"running"}},{delayMs:600,event:{eventType:"output",timestamp:Nt(600),content:"Scanning current schema for migration targets..."}},{delayMs:1400,event:{eventType:"output",timestamp:Nt(1400),content:`Found tables to modify:
78
- - users (add column: last_login_at)
79
- - sessions (add index on expires_at)
80
- - audit_log (new table)`}},{delayMs:2200,event:{eventType:"output",timestamp:Nt(2200),content:`⚠ This migration will add a NOT NULL column to the users table.
81
- The table has 50,000+ rows — this may lock the table briefly.
82
-
83
- Please confirm to proceed.`}}],resumeSteps:[{delayMs:500,event:{eventType:"output",timestamp:Nt(0),content:"Proceeding with migration..."}},{delayMs:1500,event:{eventType:"output",timestamp:Nt(1e3),content:`Migration 001_add_last_login.sql applied successfully.
84
- Migration 002_sessions_index.sql applied successfully.
85
- Migration 003_audit_log.sql applied successfully.`}},{delayMs:2500,event:{eventType:"output",timestamp:Nt(2e3),content:"All 3 migrations applied. Running verification queries... OK."}},{delayMs:3200,event:{eventType:"status",timestamp:Nt(2700),content:"completed"}}]},{label:"Test Writer",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Nt(0),content:"running"}},{delayMs:700,event:{eventType:"output",timestamp:Nt(700),content:"Generating test scaffolding for src/services/billing.ts..."}},{delayMs:1800,event:{eventType:"output",timestamp:Nt(1800),content:`Writing test cases:
86
- - should calculate monthly total
87
- - should apply discount codes
88
- - should handle currency conversion
89
- - should reject expired cards`}},{delayMs:2800,event:{eventType:"output",timestamp:Nt(2800),content:`Error: Cannot resolve import 'src/services/stripe-client.ts' — module not found.
90
- The billing service depends on a Stripe client that doesn't exist in this environment.`}},{delayMs:3500,event:{eventType:"status",timestamp:Nt(3500),content:"failed"}}]}],gy=400;function UC({children:t}){const[a,i]=x.useState(AC),[o,r]=x.useState(DC),[u,d]=x.useState(RC),[p,m]=x.useState(void 0),[g,v]=x.useState(MC),[y,b]=x.useState(OC),[S,T]=x.useState(py),[E,N]=x.useState(BC),[C,j]=x.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),[D,R]=x.useState(IC),[w]=x.useState(LC),[F,H]=x.useState(""),B=x.useRef(0),q=x.useRef(0),X=x.useRef(new Set),ae=x.useRef(new Map),te=x.useRef(y);te.current=y;const ee=x.useRef(new Map),z=x.useRef(new Map),ne=x.useCallback(W=>(B.current+=1,`mock-${W}-${String(B.current).padStart(3,"0")}`),[]),I=x.useCallback(()=>{const W=my[q.current%my.length];return q.current+=1,W},[]),Y=x.useCallback((W,le,ce)=>{const _e=setTimeout(()=>{var ge;X.current.delete(_e),ce&&((ge=ae.current.get(ce))==null||ge.delete(_e)),W()},le);X.current.add(_e),ce&&(ae.current.has(ce)||ae.current.set(ce,new Set),ae.current.get(ce).add(_e))},[]),oe=x.useCallback(W=>{const le=ae.current.get(W);le&&(le.forEach(ce=>{clearTimeout(ce),X.current.delete(ce)}),ae.current.delete(W))},[]),G=x.useCallback((W,le,ce)=>{r(_e=>_e.map(ge=>ge.id===W?{...ge,status:le,...ce!==void 0?{endReason:ce}:{}}:ge))},[]),O=x.useCallback(W=>{d(le=>[...le,W])},[]),ie=x.useCallback((W,le,ce)=>{le.forEach((_e,ge)=>{Y(()=>{const Qe={sessionId:W,..._e.event,timestamp:new Date().toISOString()};if(O(Qe),_e.event.eventType==="status"){const Ee=tb(_e.event.content),Je=nb(_e.event.content);G(W,Ee,Je)}ge===le.length-1&&ce&&ce()},_e.delayMs,W)})},[Y,O,G]),xe=x.useCallback((W,le,ce,_e)=>{console.log("[MockGrackle] spawn",{environmentId:W,prompt:le,runtime:_e});const ge=ne("sess"),Qe={id:ge,environmentId:W,runtime:_e||"claude-code",status:"running",prompt:le,startedAt:new Date().toISOString()};r(Je=>[...Je,Qe]),m(ge);const Ee=I();if(console.log(`[MockGrackle] Playing scenario: ${Ee.label}`),Ee.pauseForInput){const Je=Ee.pauseAfterStep??Ee.steps.length-1,je=Ee.steps.slice(0,Je+1),nt=je.length>0?je[je.length-1].delayMs:0;ie(ge,je),Y(()=>{G(ge,"idle"),O({sessionId:ge,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},nt+gy,ge),Ee.resumeSteps&&ee.current.set(ge,Ee.resumeSteps)}else ie(ge,Ee.steps)},[ne,I,ie,Y,G,O]),re=x.useCallback(W=>{console.log("[MockGrackle] kill",W),oe(W),ee.current.delete(W),G(W,"stopped","killed"),O({sessionId:W,eventType:"status",timestamp:new Date().toISOString(),content:"killed"}),b(le=>le.map(ce=>ce.latestSessionId===W&&ce.status==="working"?{...ce,status:"not_started"}:ce))},[oe,G,O]),Ke=x.useCallback(()=>{console.log("[MockGrackle] refresh")},[]),yt=x.useCallback(W=>{console.log("[MockGrackle] loadSessionEvents",W)},[]),fe=x.useCallback(()=>{console.log("[MockGrackle] clearEvents"),d([])},[]),Rt=x.useCallback((W,le,ce,_e,ge,Qe,Ee,Je,je)=>{console.log("[MockGrackle] createWorkspace",{name:W,description:le});const nt={id:ne("proj"),name:W,description:le||"",repoUrl:ce||"",environmentId:_e||"",status:"active",worktreeBasePath:Ee||"",useWorktrees:Qe??!0,defaultPersonaId:ge||"",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};v(Pe=>[...Pe,nt]),Je&&Je()},[ne]),mn=x.useCallback(W=>{console.log("[MockGrackle] archiveWorkspace",W),v(le=>le.map(ce=>ce.id===W?{...ce,status:"archived"}:ce))},[]),Rn=x.useCallback(W=>{console.log("[MockGrackle] loadTasks",W)},[]),Ln=x.useCallback((W,le,ce,_e,ge,Qe,Ee,Je,je)=>{console.log("[MockGrackle] createTask",{workspaceId:W,title:le,parentTaskId:ge}),b(nt=>{const Gt=nt.filter(gn=>gn.workspaceId===W).reduce((gn,Ca)=>Math.max(gn,Ca.sortOrder),0),tn=ge?nt.find(gn=>gn.id===ge):void 0;if(ge&&!tn)return console.warn("[MockGrackle] Parent task not found:",ge),nt;if(tn&&!tn.canDecompose)return console.warn("[MockGrackle] Parent task does not have decomposition rights:",ge),nt;const Vt=tn?tn.depth+1:0,ka={id:ne("task"),workspaceId:W,title:le,description:ce||"",status:"not_started",branch:"",latestSessionId:"",dependsOn:_e||[],reviewNotes:void 0,sortOrder:Gt+1,createdAt:new Date().toISOString(),parentTaskId:ge||"",depth:Vt,childTaskIds:[],canDecompose:Ee??!ge,defaultPersonaId:Qe||""};return[...nt,ka]}),Je&&Je()},[ne]),Te=x.useCallback((W,le,ce,_e)=>{var nt;console.log("[MockGrackle] startTask",{taskId:W});const ge=te.current.find(Pe=>Pe.id===W),Qe=(ge==null?void 0:ge.title)??"",Ee=ne("sess"),Je={id:Ee,environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:Qe||W,startedAt:new Date().toISOString()};r(Pe=>[...Pe,Je]),b(Pe=>Pe.map(Gt=>Gt.id===W?{...Gt,status:"working",latestSessionId:Ee,branch:`mock/${W.slice(0,8)}`}:Gt));const je=I();if(console.log(`[MockGrackle] Playing task scenario: ${je.label}`),je.pauseForInput){const Pe=je.pauseAfterStep??je.steps.length-1,Gt=je.steps.slice(0,Pe+1),tn=Gt.length>0?Gt[Gt.length-1].delayMs:0;if(ie(Ee,Gt),Y(()=>{G(Ee,"idle"),O({sessionId:Ee,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},tn+gy,Ee),je.resumeSteps){const Vt=[...je.resumeSteps];ee.current.set(Ee,Vt);const ka=Vt.reduce((gn,Ca)=>Math.max(gn,Ca.delayMs),0);z.current.set(Ee,{taskId:W,delayAfterResume:ka+200})}}else{const Pe=je.steps.length>0?je.steps[je.steps.length-1].delayMs:0;ie(Ee,je.steps);const Gt=(nt=je.steps[je.steps.length-1])==null?void 0:nt.event.content;Y(()=>{Gt==="completed"?b(tn=>tn.map(Vt=>Vt.id===W&&Vt.status==="working"?{...Vt,status:"paused"}:Vt)):Gt==="failed"&&b(tn=>tn.map(Vt=>Vt.id===W&&Vt.status==="working"?{...Vt,status:"failed"}:Vt))},Pe+100,Ee)}},[ne,I,ie,Y,G,O]),pt=x.useCallback((W,le)=>{console.log("[MockGrackle] sendInput",{sessionId:W,text:le}),O({sessionId:W,eventType:"output",timestamp:new Date().toISOString(),content:`User input: ${le}`}),G(W,"running"),O({sessionId:W,eventType:"status",timestamp:new Date().toISOString(),content:"running"});const ce=ee.current.get(W);if(ce)ee.current.delete(W),ie(W,ce);else{const ge=[{delayMs:500,event:{eventType:"output",timestamp:new Date().toISOString(),content:"I received your input, continuing..."}},{delayMs:1500,event:{eventType:"status",timestamp:new Date().toISOString(),content:"completed"}}];ie(W,ge)}const _e=z.current.get(W);_e&&(z.current.delete(W),Y(()=>{b(ge=>ge.map(Qe=>Qe.id===_e.taskId&&Qe.status==="working"?{...Qe,status:"paused"}:Qe))},_e.delayAfterResume,W))},[O,G,ie,Y]),Hs=x.useCallback(W=>{console.log("[MockGrackle] completeTask",W),b(le=>le.map(ce=>ce.id===W?{...ce,status:"complete"}:ce))},[]),Un=x.useCallback(W=>{console.log("[MockGrackle] resumeTask",W)},[]),Ps=x.useCallback((W,le,ce,_e,ge)=>{console.log("[MockGrackle] updateTask",{taskId:W,title:le}),b(Qe=>Qe.map(Ee=>Ee.id===W?{...Ee,title:le.trim()||Ee.title,description:ce,dependsOn:_e,...ge!==void 0?{defaultPersonaId:ge}:{}}:Ee))},[]),Gs=x.useCallback(W=>{console.log("[MockGrackle] deleteTask",W),b(le=>le.filter(ce=>ce.id!==W))},[]),Nl=x.useCallback(W=>{console.log("[MockGrackle] loadFindings",W),T(py.filter(le=>le.workspaceId===W))},[]),eo=x.useCallback((W,le,ce,_e,ge)=>{console.log("[MockGrackle] postFinding",{workspaceId:W,title:le});const Qe={id:ne("find"),workspaceId:W,taskId:"",sessionId:"",category:_e||"general",title:le,content:ce,tags:ge||[],createdAt:new Date().toISOString()};T(Ee=>[...Ee,Qe])},[ne]),$s=x.useCallback((W,le,ce)=>{console.log("[MockGrackle] addEnvironment",{displayName:W,adapterType:le,adapterConfig:ce})},[]),Fs=x.useCallback((W,le)=>{console.log("[MockGrackle] updateEnvironment",{environmentId:W,...le}),i(ce=>ce.map(_e=>_e.id!==W?_e:{..._e,...le.displayName!==void 0?{displayName:le.displayName}:{},...le.adapterConfig!==void 0?{adapterConfig:JSON.stringify(le.adapterConfig)}:{}}))},[]),qs=x.useCallback(()=>{console.log("[MockGrackle] loadTokens")},[]),jl=x.useCallback((W,le,ce,_e,ge)=>{console.log("[MockGrackle] setToken",{name:W,tokenType:ce}),N(Qe=>[...Qe.filter(Je=>Je.name!==W),{name:W,tokenType:ce,envVar:_e,filePath:ge,expiresAt:""}])},[]),wl=x.useCallback(W=>{console.log("[MockGrackle] deleteToken",W),N(le=>le.filter(ce=>ce.name!==W))},[]),zt=x.useCallback(W=>{console.log("[MockGrackle] updateCredentialProviders",W),j(W)},[]);x.useEffect(()=>()=>{X.current.forEach(clearTimeout),X.current.clear()},[]);const Bc=x.useMemo(()=>({connected:!0,send:()=>{},environments:a,sessions:o,events:u,eventsDropped:0,lastSpawnedId:p,workspaces:g,tasks:y,findings:S,tokens:E,credentialProviders:C,spawn:xe,sendInput:pt,kill:re,refresh:Ke,loadSessionEvents:yt,clearEvents:fe,createWorkspace:Rt,archiveWorkspace:mn,updateWorkspace:(W,le)=>{console.log("[MockGrackle] updateWorkspace",{workspaceId:W,...le}),v(ce=>ce.map(_e=>_e.id!==W?_e:{..._e,...le.name!==void 0?{name:le.name}:{},...le.description!==void 0?{description:le.description}:{},...le.repoUrl!==void 0?{repoUrl:le.repoUrl}:{},...le.environmentId!==void 0?{environmentId:le.environmentId}:{},...le.worktreeBasePath!==void 0?{worktreeBasePath:le.worktreeBasePath}:{},...le.useWorktrees!==void 0?{useWorktrees:le.useWorktrees}:{},...le.defaultPersonaId!==void 0?{defaultPersonaId:le.defaultPersonaId}:{},updatedAt:new Date().toISOString()}))},loadTasks:Rn,loadAllTasks:()=>{console.log("[MockGrackle] loadAllTasks")},createTask:Ln,startTask:Te,stopTask:W=>{console.log("[MockGrackle] stopTask",{taskId:W}),Hs(W)},completeTask:Hs,resumeTask:Un,updateTask:Ps,deleteTask:Gs,loadFindings:Nl,postFinding:eo,addEnvironment:$s,updateEnvironment:Fs,loadTokens:qs,setToken:jl,deleteToken:wl,updateCredentialProviders:zt,provisionStatus:{},provisionEnvironment:()=>{},stopEnvironment:()=>{},removeEnvironment:()=>{},codespaces:[],codespaceError:"",codespaceListError:"",codespaceCreating:!1,listCodespaces:()=>{},createCodespace:()=>{},workspaceCreating:!1,taskStartingId:void 0,personas:D,createPersona:(W,le,ce,_e,ge,Qe,Ee,Je)=>{console.log("[MockGrackle] createPersona",{name:W});const je={id:`mock-persona-${Date.now()}`,name:W,description:le,systemPrompt:ce,toolConfig:"{}",runtime:_e??"claude-code",model:ge||"",maxTurns:Qe||0,mcpServers:"[]",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),type:Ee||"agent",script:Je||""};R(nt=>[...nt,je])},updatePersona:(W,le,ce,_e,ge,Qe,Ee,Je,je)=>{console.log("[MockGrackle] updatePersona",{personaId:W,name:le}),R(nt=>nt.map(Pe=>Pe.id!==W?Pe:{...Pe,...le!==void 0?{name:le}:{},...ce!==void 0?{description:ce}:{},..._e!==void 0?{systemPrompt:_e}:{},...ge!==void 0?{runtime:ge}:{},...Qe!==void 0?{model:Qe}:{},...Ee!==void 0?{maxTurns:Ee}:{},...Je!==void 0?{type:Je}:{},...je!==void 0?{script:je}:{},updatedAt:new Date().toISOString()}))},deletePersona:W=>{console.log("[MockGrackle] deletePersona",W),R(le=>le.filter(ce=>ce.id!==W))},taskSessions:w,loadTaskSessions:W=>{console.log("[MockGrackle] loadTaskSessions",W)},appDefaultPersonaId:F,setAppDefaultPersonaId:W=>{console.log("[MockGrackle] setAppDefaultPersonaId",W),H(W)},onboardingCompleted:!0,completeOnboarding:()=>{console.log("[MockGrackle] completeOnboarding")},usageCache:{"workspace:proj-alpha":{inputTokens:214500,outputTokens:44850,costUsd:1.12,sessionCount:4},"workspace:proj-beta":{inputTokens:86700,outputTokens:23800,costUsd:.48,sessionCount:3},"task:task-001":{inputTokens:126800,outputTokens:20850,costUsd:.63,sessionCount:2},"task:task-006":{inputTokens:18900,outputTokens:4500,costUsd:.1,sessionCount:1},"task_tree:task-001":{inputTokens:126800,outputTokens:20850,costUsd:.63,sessionCount:2},"task_tree:task-006":{inputTokens:18900,outputTokens:4500,costUsd:.1,sessionCount:1}},loadUsage:(W,le)=>{console.log(`[MockGrackle] loadUsage(${W}, ${le})`)},knowledge:{graphData:{nodes:[],links:[]},selectedNode:void 0,loading:!1,selectedId:void 0,searchQuery:"",search:()=>{},clearSearch:()=>{},selectNode:()=>{},clearSelection:()=>{},expandNode:()=>{},loadRecent:()=>{},handleMessage:()=>!1}}),[a,o,u,p,g,y,S,E,C,D,w,F,xe,pt,re,Ke,yt,fe,Rt,mn,Rn,Ln,Te,Hs,Un,Ps,Gs,Nl,eo,$s,Fs,qs,jl,wl,zt]);return c.jsx(dh.Provider,{value:Bc,children:t})}const Cb=x.createContext(void 0),zC=4e3;function VC({children:t}){const[a,i]=x.useState([]),o=x.useRef(0),r=x.useCallback(d=>{i(p=>p.filter(m=>m.id!==d))},[]),u=x.useCallback((d,p="info",m=zC)=>{const g=`toast-${++o.current}`;i(v=>[...v,{id:g,message:d,variant:p,duration:m}])},[]);return c.jsx(Cb.Provider,{value:{toasts:a,showToast:u,dismissToast:r},children:t})}function Us(){const t=x.useContext(Cb);if(!t)throw new Error("useToast must be used within ToastProvider");return t}const Ec=[{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"]}],Eb=new Set(Ec.map(t=>t.id)),vy="grackle";function Nf(t){return Ec.find(a=>a.id===t)}const jf="grackle-theme",Nb="grackle-prefer-system",jb="(prefers-color-scheme: dark)";let Jo=[],sc;function nf(){sc=void 0;for(const t of Jo)t()}function wf(){return typeof window>"u"?!1:window.matchMedia(jb).matches}function ol(){if(typeof localStorage>"u")return vy;try{const t=localStorage.getItem(jf);if(t!==null&&Eb.has(t))return t}catch{}return vy}function uc(){if(typeof localStorage>"u")return!1;try{return localStorage.getItem(Nb)==="true"}catch{return!1}}function Af(t){return Ec.find(a=>a.variantLightId===t||a.variantDarkId===t)}function wb(t,a){const i=Nf(t);if(i!=null&&i.variantDarkId)return a&&i.variantLightId?wf()?i.variantDarkId:i.variantLightId:i.variantDarkId;if(i!=null&&i.hidden&&a){const o=Af(t);if(o!=null&&o.variantLightId&&o.variantDarkId)return wf()?o.variantDarkId:o.variantLightId}return t}function Oi(t,a,i=!1){i&&document.documentElement.classList.add("no-transitions"),document.documentElement.dataset.theme=wb(t,a),i&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove("no-transitions")}))}typeof document<"u"&&Oi(ol(),uc());function HC(){return sc===void 0&&(sc={themeId:ol(),systemDark:wf(),preferSystem:uc()}),sc}function PC(t){return Jo=[...Jo,t],()=>{Jo=Jo.filter(a=>a!==t)}}function GC(){const t=x.useSyncExternalStore(PC,HC),{themeId:a,preferSystem:i}=t,o=wb(a,i),r=x.useCallback(d=>{if(Eb.has(d)){try{localStorage.setItem(jf,d)}catch{}Oi(d,uc(),!0),nf()}},[]),u=x.useCallback(d=>{try{localStorage.setItem(Nb,d?"true":"false")}catch{}if(d){const p=ol(),m=Nf(p);if(m!=null&&m.hidden){const g=Af(p);if(g)try{localStorage.setItem(jf,g.id)}catch{}}}Oi(ol(),d,!0),nf()},[]);return x.useEffect(()=>{Oi(a,i)},[a,i]),x.useEffect(()=>{if(typeof window>"u")return;const d=window.matchMedia(jb),p=()=>{const m=ol(),g=uc();if(g){const v=Nf(m);if(v!=null&&v.variantDarkId&&v.variantLightId&&Oi(m,g),v!=null&&v.hidden){const y=Af(m);y!=null&&y.variantDarkId&&y.variantLightId&&Oi(m,g)}}nf()};return d.addEventListener("change",p),()=>{d.removeEventListener("change",p)}},[]),{themeId:a,setTheme:r,resolvedThemeId:o,preferSystem:i,setPreferSystem:u}}const Ab=x.createContext(void 0);function $C({children:t}){const a=GC();return c.jsx(Ab.Provider,{value:a,children:t})}function Db(){const t=x.useContext(Ab);if(!t)throw new Error("useThemeContext must be used within ThemeProvider");return t}const FC="_container_1mq5u_1",qC="_hamburger_1mq5u_33",KC="_brand_1mq5u_49",YC="_brandLogo_1mq5u_68",ZC="_info_1mq5u_75",XC="_connectionLabel_1mq5u_90",QC="_connectionDot_1mq5u_103",WC="_connected_1mq5u_106",JC="_disconnected_1mq5u_110",ga={container:FC,hamburger:qC,brand:KC,brandLogo:YC,info:ZC,connectionLabel:XC,connectionDot:QC,connected:WC,disconnected:JC};function eE({onToggleSidebar:t,sidebarOpen:a}){const{connected:i,environments:o,sessions:r}=qe(),u=Dt(),d=o.length,p=o.filter(g=>g.status==="connected").length,m=r.filter(g=>["running","idle"].includes(g.status)).length;return c.jsxs("div",{className:ga.container,children:[t&&c.jsx("button",{type:"button",className:ga.hamburger,onClick:t,"aria-label":"Toggle sidebar","aria-expanded":a,children:"☰"}),c.jsxs("button",{type:"button",className:ga.brand,onClick:()=>u(Os),title:"Home",children:[c.jsx("img",{src:"/icon-192x192.png",alt:"",className:ga.brandLogo,"aria-hidden":"true","data-testid":"statusbar-logo"}),"Grackle"]}),c.jsxs("div",{className:ga.info,children:[c.jsxs("span",{"aria-label":i?"Connected":"Disconnected",children:[c.jsx("span",{className:`${ga.connectionDot} ${i?ga.connected:ga.disconnected}`,"aria-hidden":"true",children:"●"})," ",c.jsx("span",{className:ga.connectionLabel,"aria-hidden":"true",children:i?"Connected":"Disconnected"})]}),c.jsxs("span",{children:[p,"/",d," env",d!==1?"s":""]}),c.jsxs("span",{children:[m," active"]})]})]})}const tE="_nav_13gkc_1",nE="_tab_13gkc_35",aE="_tabIcon_13gkc_68",sE="_tabLabel_13gkc_79",iE="_tabActive_13gkc_84",Zo={nav:tE,tab:nE,tabIcon:aE,tabLabel:sE,tabActive:iE},Cs=[{view:"dashboard",label:"Dashboard",icon:"🏠",route:Os,testId:"sidebar-tab-dashboard"},{view:"chat",label:"Chat",icon:"💬",route:uC,testId:"sidebar-tab-chat"},{view:"tasks",label:"Tasks",icon:"📋",route:dC,testId:"sidebar-tab-tasks"},{view:"environments",label:"Environments",icon:"🖥️",route:Pi,testId:"sidebar-tab-environments"},{view:"knowledge",label:"Knowledge",icon:"🧠",route:kb,testId:"sidebar-tab-knowledge"},{view:"settings",label:"Settings",icon:"⚙️",route:rC,testId:"sidebar-tab-settings"}];function oE(t){return t===Os||t==="/"?"dashboard":t.startsWith("/chat")||t.startsWith("/sessions")?"chat":t.startsWith("/workspaces")||t.startsWith("/environments")?"environments":t.startsWith(kb)?"knowledge":t.startsWith(il)?"settings":"tasks"}function lE(){const t=jt(),a=Dt(),i=x.useRef(null),o=oE(t.pathname),r=x.useCallback(d=>{a(d.route)},[a]),u=x.useCallback(d=>{var y,b;const p=(y=i.current)==null?void 0:y.querySelectorAll('[role="tab"]');if(!p)return;const m=Array.from(p).findIndex(S=>S===document.activeElement),g=m>=0?m:Cs.findIndex(S=>S.view===o);let v=g;if(d.key==="ArrowRight")d.preventDefault(),v=(g+1)%Cs.length;else if(d.key==="ArrowLeft")d.preventDefault(),v=(g-1+Cs.length)%Cs.length;else if(d.key==="Home")d.preventDefault(),v=0;else if(d.key==="End")d.preventDefault(),v=Cs.length-1;else return;a(Cs[v].route),(b=p[v])==null||b.focus()},[o,a]);return c.jsx("nav",{className:Zo.nav,ref:i,role:"tablist","aria-orientation":"horizontal","aria-label":"App navigation",onKeyDown:u,"data-testid":"sidebar-nav",children:Cs.map(d=>{const p=d.view===o;return c.jsxs("button",{role:"tab",type:"button","aria-selected":p,tabIndex:p?0:-1,className:`${Zo.tab} ${p?Zo.tabActive:""}`,onClick:()=>r(d),"data-testid":d.testId,title:d.label,"aria-label":d.label,children:[c.jsx("span",{className:Zo.tabIcon,"aria-hidden":"true",children:d.icon}),c.jsx("span",{className:Zo.tabLabel,children:d.label})]},d.view)})})}const Rb=x.createContext(void 0),Mb=x.createContext(void 0);function rE({children:t}){const[a,i]=x.useState(void 0),o=x.useCallback(r=>{i(r)},[]);return c.jsx(Mb.Provider,{value:o,children:c.jsx(Rb.Provider,{value:a,children:t})})}function Ob(){return x.useContext(Rb)}function cE(){const t=x.useContext(Mb);if(t===void 0)throw new Error("useSidebarSetter must be used within a SidebarProvider");return t}const uE="_container_pi6ii_1",dE="_content_pi6ii_66",yy={container:uE,content:dE},fE=320,Bb=220,Ib=600,Lb="grackle-sidebar-width";function hE(){try{const t=localStorage.getItem(Lb);if(t!==null){const a=Number(t);if(Number.isFinite(a)&&a>=Bb&&a<=Ib)return a}}catch{}return fE}function pE(t){try{localStorage.setItem(Lb,String(t))}catch{}}function mE(){const[t]=x.useState(hE),a=x.useRef(null),i=Ob();if(x.useEffect(()=>{const o=a.current;if(!o)return;const r=new ResizeObserver(u=>{for(const d of u){const p=d.borderBoxSize[0];if(p){const m=Math.round(p.inlineSize);m>=Bb&&m<=Ib&&pE(m)}}});return r.observe(o),()=>{r.disconnect()}},[]),i!==void 0)return c.jsx("div",{className:yy.container,ref:a,"data-testid":"sidebar",style:{width:t},children:c.jsx("div",{className:yy.content,children:i})})}function Nc(t){const a=cE();x.useLayoutEffect(()=>(a(t),()=>{a(void 0)}),[t,a])}const fh=x.createContext({});function hh(t){const a=x.useRef(null);return a.current===null&&(a.current=t()),a.current}const jc=x.createContext(null),ph=x.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class gE extends x.Component{getSnapshotBeforeUpdate(a){const i=this.props.childRef.current;if(i&&a.isPresent&&!this.props.isPresent){const o=this.props.sizeRef.current;o.height=i.offsetHeight||0,o.width=i.offsetWidth||0,o.top=i.offsetTop,o.left=i.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function vE({children:t,isPresent:a}){const i=x.useId(),o=x.useRef(null),r=x.useRef({width:0,height:0,top:0,left:0}),{nonce:u}=x.useContext(ph);return x.useInsertionEffect(()=>{const{width:d,height:p,top:m,left:g}=r.current;if(a||!o.current||!d||!p)return;o.current.dataset.motionPopId=i;const v=document.createElement("style");return u&&(v.nonce=u),document.head.appendChild(v),v.sheet&&v.sheet.insertRule(`
91
- [data-motion-pop-id="${i}"] {
92
- position: absolute !important;
93
- width: ${d}px !important;
94
- height: ${p}px !important;
95
- top: ${m}px !important;
96
- left: ${g}px !important;
97
- }
98
- `),()=>{document.head.removeChild(v)}},[a]),c.jsx(gE,{isPresent:a,childRef:o,sizeRef:r,children:x.cloneElement(t,{ref:o})})}const yE=({children:t,initial:a,isPresent:i,onExitComplete:o,custom:r,presenceAffectsLayout:u,mode:d})=>{const p=hh(bE),m=x.useId(),g=x.useCallback(y=>{p.set(y,!0);for(const b of p.values())if(!b)return;o&&o()},[p,o]),v=x.useMemo(()=>({id:m,initial:a,isPresent:i,custom:r,onExitComplete:g,register:y=>(p.set(y,!1),()=>p.delete(y))}),u?[Math.random(),g]:[i,g]);return x.useMemo(()=>{p.forEach((y,b)=>p.set(b,!1))},[i]),x.useEffect(()=>{!i&&!p.size&&o&&o()},[i]),d==="popLayout"&&(t=c.jsx(vE,{isPresent:i,children:t})),c.jsx(jc.Provider,{value:v,children:t})};function bE(){return new Map}function Ub(t=!0){const a=x.useContext(jc);if(a===null)return[!0,null];const{isPresent:i,onExitComplete:o,register:r}=a,u=x.useId();x.useEffect(()=>{t&&r(u)},[t]);const d=x.useCallback(()=>t&&o&&o(u),[u,o,t]);return!i&&o?[!1,d]:[!0]}const Kr=t=>t.key||"";function by(t){const a=[];return x.Children.forEach(t,i=>{x.isValidElement(i)&&a.push(i)}),a}const mh=typeof window<"u",zb=mh?x.useLayoutEffect:x.useEffect,Qn=({children:t,custom:a,initial:i=!0,onExitComplete:o,presenceAffectsLayout:r=!0,mode:u="sync",propagate:d=!1})=>{const[p,m]=Ub(d),g=x.useMemo(()=>by(t),[t]),v=d&&!p?[]:g.map(Kr),y=x.useRef(!0),b=x.useRef(g),S=hh(()=>new Map),[T,E]=x.useState(g),[N,C]=x.useState(g);zb(()=>{y.current=!1,b.current=g;for(let R=0;R<N.length;R++){const w=Kr(N[R]);v.includes(w)?S.delete(w):S.get(w)!==!0&&S.set(w,!1)}},[N,v.length,v.join("-")]);const j=[];if(g!==T){let R=[...g];for(let w=0;w<N.length;w++){const F=N[w],H=Kr(F);v.includes(H)||(R.splice(w,0,F),j.push(F))}u==="wait"&&j.length&&(R=j),C(by(R)),E(g);return}const{forceRender:D}=x.useContext(fh);return c.jsx(c.Fragment,{children:N.map(R=>{const w=Kr(R),F=d&&!p?!1:g===N||v.includes(w),H=()=>{if(S.has(w))S.set(w,!0);else return;let B=!0;S.forEach(q=>{q||(B=!1)}),B&&(D==null||D(),C(b.current),d&&(m==null||m()),o&&o())};return c.jsx(yE,{isPresent:F,initial:!y.current||i?void 0:!1,custom:F?void 0:a,presenceAffectsLayout:r,mode:u,onExitComplete:F?void 0:H,children:R},w)})})},fn=t=>t;let Vb=fn;const xE={useManualTiming:!1};function _E(t){let a=new Set,i=new Set,o=!1,r=!1;const u=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1};function p(g){u.has(g)&&(m.schedule(g),t()),g(d)}const m={schedule:(g,v=!1,y=!1)=>{const S=y&&o?a:i;return v&&u.add(g),S.has(g)||S.add(g),g},cancel:g=>{i.delete(g),u.delete(g)},process:g=>{if(d=g,o){r=!0;return}o=!0,[a,i]=[i,a],a.forEach(p),a.clear(),o=!1,r&&(r=!1,m.process(g))}};return m}const Yr=["read","resolveKeyframes","update","preRender","render","postRender"],SE=40;function Hb(t,a){let i=!1,o=!0;const r={delta:0,timestamp:0,isProcessing:!1},u=()=>i=!0,d=Yr.reduce((C,j)=>(C[j]=_E(u),C),{}),{read:p,resolveKeyframes:m,update:g,preRender:v,render:y,postRender:b}=d,S=()=>{const C=performance.now();i=!1,r.delta=o?1e3/60:Math.max(Math.min(C-r.timestamp,SE),1),r.timestamp=C,r.isProcessing=!0,p.process(r),m.process(r),g.process(r),v.process(r),y.process(r),b.process(r),r.isProcessing=!1,i&&a&&(o=!1,t(S))},T=()=>{i=!0,o=!0,r.isProcessing||t(S)};return{schedule:Yr.reduce((C,j)=>{const D=d[j];return C[j]=(R,w=!1,F=!1)=>(i||T(),D.schedule(R,w,F)),C},{}),cancel:C=>{for(let j=0;j<Yr.length;j++)d[Yr[j]].cancel(C)},state:r,steps:d}}const{schedule:lt,cancel:ts,state:Ut,steps:af}=Hb(typeof requestAnimationFrame<"u"?requestAnimationFrame:fn,!0),Pb=x.createContext({strict:!1}),xy={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},$i={};for(const t in xy)$i[t]={isEnabled:a=>xy[t].some(i=>!!a[i])};function TE(t){for(const a in t)$i[a]={...$i[a],...t[a]}}const kE=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 dc(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||kE.has(t)}let Gb=t=>!dc(t);function CE(t){t&&(Gb=a=>a.startsWith("on")?!dc(a):t(a))}try{CE(require("@emotion/is-prop-valid").default)}catch{}function EE(t,a,i){const o={};for(const r in t)r==="values"&&typeof t.values=="object"||(Gb(r)||i===!0&&dc(r)||!a&&!dc(r)||t.draggable&&r.startsWith("onDrag"))&&(o[r]=t[r]);return o}function NE(t){if(typeof Proxy>"u")return t;const a=new Map,i=(...o)=>t(...o);return new Proxy(i,{get:(o,r)=>r==="create"?t:(a.has(r)||a.set(r,t(r)),a.get(r))})}const wc=x.createContext({});function ml(t){return typeof t=="string"||Array.isArray(t)}function Ac(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const gh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],vh=["initial",...gh];function Dc(t){return Ac(t.animate)||vh.some(a=>ml(t[a]))}function $b(t){return!!(Dc(t)||t.variants)}function jE(t,a){if(Dc(t)){const{initial:i,animate:o}=t;return{initial:i===!1||ml(i)?i:void 0,animate:ml(o)?o:void 0}}return t.inherit!==!1?a:{}}function wE(t){const{initial:a,animate:i}=jE(t,x.useContext(wc));return x.useMemo(()=>({initial:a,animate:i}),[_y(a),_y(i)])}function _y(t){return Array.isArray(t)?t.join(" "):t}const AE=Symbol.for("motionComponentSymbol");function Bi(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function DE(t,a,i){return x.useCallback(o=>{o&&t.onMount&&t.onMount(o),a&&(o?a.mount(o):a.unmount()),i&&(typeof i=="function"?i(o):Bi(i)&&(i.current=o))},[a])}const yh=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),RE="framerAppearId",Fb="data-"+yh(RE),{schedule:bh}=Hb(queueMicrotask,!1),qb=x.createContext({});function ME(t,a,i,o,r){var u,d;const{visualElement:p}=x.useContext(wc),m=x.useContext(Pb),g=x.useContext(jc),v=x.useContext(ph).reducedMotion,y=x.useRef(null);o=o||m.renderer,!y.current&&o&&(y.current=o(t,{visualState:a,parent:p,props:i,presenceContext:g,blockInitialAnimation:g?g.initial===!1:!1,reducedMotionConfig:v}));const b=y.current,S=x.useContext(qb);b&&!b.projection&&r&&(b.type==="html"||b.type==="svg")&&OE(y.current,i,r,S);const T=x.useRef(!1);x.useInsertionEffect(()=>{b&&T.current&&b.update(i,g)});const E=i[Fb],N=x.useRef(!!E&&!(!((u=window.MotionHandoffIsComplete)===null||u===void 0)&&u.call(window,E))&&((d=window.MotionHasOptimisedAnimation)===null||d===void 0?void 0:d.call(window,E)));return zb(()=>{b&&(T.current=!0,window.MotionIsMounted=!0,b.updateFeatures(),bh.render(b.render),N.current&&b.animationState&&b.animationState.animateChanges())}),x.useEffect(()=>{b&&(!N.current&&b.animationState&&b.animationState.animateChanges(),N.current&&(queueMicrotask(()=>{var C;(C=window.MotionHandoffMarkAsComplete)===null||C===void 0||C.call(window,E)}),N.current=!1))}),b}function OE(t,a,i,o){const{layoutId:r,layout:u,drag:d,dragConstraints:p,layoutScroll:m,layoutRoot:g}=a;t.projection=new i(t.latestValues,a["data-framer-portal-id"]?void 0:Kb(t.parent)),t.projection.setOptions({layoutId:r,layout:u,alwaysMeasureLayout:!!d||p&&Bi(p),visualElement:t,animationType:typeof u=="string"?u:"both",initialPromotionConfig:o,layoutScroll:m,layoutRoot:g})}function Kb(t){if(t)return t.options.allowProjection!==!1?t.projection:Kb(t.parent)}function BE({preloadedFeatures:t,createVisualElement:a,useRender:i,useVisualState:o,Component:r}){var u,d;t&&TE(t);function p(g,v){let y;const b={...x.useContext(ph),...g,layoutId:IE(g)},{isStatic:S}=b,T=wE(g),E=o(g,S);if(!S&&mh){LE();const N=UE(b);y=N.MeasureLayout,T.visualElement=ME(r,E,b,a,N.ProjectionNode)}return c.jsxs(wc.Provider,{value:T,children:[y&&T.visualElement?c.jsx(y,{visualElement:T.visualElement,...b}):null,i(r,g,DE(E,T.visualElement,v),E,S,T.visualElement)]})}p.displayName=`motion.${typeof r=="string"?r:`create(${(d=(u=r.displayName)!==null&&u!==void 0?u:r.name)!==null&&d!==void 0?d:""})`}`;const m=x.forwardRef(p);return m[AE]=r,m}function IE({layoutId:t}){const a=x.useContext(fh).id;return a&&t!==void 0?a+"-"+t:t}function LE(t,a){x.useContext(Pb).strict}function UE(t){const{drag:a,layout:i}=$i;if(!a&&!i)return{};const o={...a,...i};return{MeasureLayout:a!=null&&a.isEnabled(t)||i!=null&&i.isEnabled(t)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}const zE=["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 xh(t){return typeof t!="string"||t.includes("-")?!1:!!(zE.indexOf(t)>-1||/[A-Z]/u.test(t))}function Sy(t){const a=[{},{}];return t==null||t.values.forEach((i,o)=>{a[0][o]=i.get(),a[1][o]=i.getVelocity()}),a}function _h(t,a,i,o){if(typeof a=="function"){const[r,u]=Sy(o);a=a(i!==void 0?i:t.custom,r,u)}if(typeof a=="string"&&(a=t.variants&&t.variants[a]),typeof a=="function"){const[r,u]=Sy(o);a=a(i!==void 0?i:t.custom,r,u)}return a}const Df=t=>Array.isArray(t),VE=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),HE=t=>Df(t)?t[t.length-1]||0:t,Pt=t=>!!(t&&t.getVelocity);function ic(t){const a=Pt(t)?t.get():t;return VE(a)?a.toValue():a}function PE({scrapeMotionValuesFromProps:t,createRenderState:a,onUpdate:i},o,r,u){const d={latestValues:GE(o,r,u,t),renderState:a()};return i&&(d.onMount=p=>i({props:o,current:p,...d}),d.onUpdate=p=>i(p)),d}const Yb=t=>(a,i)=>{const o=x.useContext(wc),r=x.useContext(jc),u=()=>PE(t,a,o,r);return i?u():hh(u)};function GE(t,a,i,o){const r={},u=o(t,{});for(const b in u)r[b]=ic(u[b]);let{initial:d,animate:p}=t;const m=Dc(t),g=$b(t);a&&g&&!m&&t.inherit!==!1&&(d===void 0&&(d=a.initial),p===void 0&&(p=a.animate));let v=i?i.initial===!1:!1;v=v||d===!1;const y=v?p:d;if(y&&typeof y!="boolean"&&!Ac(y)){const b=Array.isArray(y)?y:[y];for(let S=0;S<b.length;S++){const T=_h(t,b[S]);if(T){const{transitionEnd:E,transition:N,...C}=T;for(const j in C){let D=C[j];if(Array.isArray(D)){const R=v?D.length-1:0;D=D[R]}D!==null&&(r[j]=D)}for(const j in E)r[j]=E[j]}}}return r}const Qi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],zs=new Set(Qi),Zb=t=>a=>typeof a=="string"&&a.startsWith(t),Xb=Zb("--"),$E=Zb("var(--"),Sh=t=>$E(t)?FE.test(t.split("/*")[0].trim()):!1,FE=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Qb=(t,a)=>a&&typeof t=="number"?a.transform(t):t,Sa=(t,a,i)=>i>a?a:i<t?t:i,Wi={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},gl={...Wi,transform:t=>Sa(0,1,t)},Zr={...Wi,default:1},Tl=t=>({test:a=>typeof a=="string"&&a.endsWith(t)&&a.split(" ").length===1,parse:parseFloat,transform:a=>`${a}${t}`}),Qa=Tl("deg"),Zn=Tl("%"),ye=Tl("px"),qE=Tl("vh"),KE=Tl("vw"),Ty={...Zn,parse:t=>Zn.parse(t)/100,transform:t=>Zn.transform(t*100)},YE={borderWidth:ye,borderTopWidth:ye,borderRightWidth:ye,borderBottomWidth:ye,borderLeftWidth:ye,borderRadius:ye,radius:ye,borderTopLeftRadius:ye,borderTopRightRadius:ye,borderBottomRightRadius:ye,borderBottomLeftRadius:ye,width:ye,maxWidth:ye,height:ye,maxHeight:ye,top:ye,right:ye,bottom:ye,left:ye,padding:ye,paddingTop:ye,paddingRight:ye,paddingBottom:ye,paddingLeft:ye,margin:ye,marginTop:ye,marginRight:ye,marginBottom:ye,marginLeft:ye,backgroundPositionX:ye,backgroundPositionY:ye},ZE={rotate:Qa,rotateX:Qa,rotateY:Qa,rotateZ:Qa,scale:Zr,scaleX:Zr,scaleY:Zr,scaleZ:Zr,skew:Qa,skewX:Qa,skewY:Qa,distance:ye,translateX:ye,translateY:ye,translateZ:ye,x:ye,y:ye,z:ye,perspective:ye,transformPerspective:ye,opacity:gl,originX:Ty,originY:Ty,originZ:ye},ky={...Wi,transform:Math.round},Th={...YE,...ZE,zIndex:ky,size:ye,fillOpacity:gl,strokeOpacity:gl,numOctaves:ky},XE={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},QE=Qi.length;function WE(t,a,i){let o="",r=!0;for(let u=0;u<QE;u++){const d=Qi[u],p=t[d];if(p===void 0)continue;let m=!0;if(typeof p=="number"?m=p===(d.startsWith("scale")?1:0):m=parseFloat(p)===0,!m||i){const g=Qb(p,Th[d]);if(!m){r=!1;const v=XE[d]||d;o+=`${v}(${g}) `}i&&(a[d]=g)}}return o=o.trim(),i?o=i(a,r?"":o):r&&(o="none"),o}function kh(t,a,i){const{style:o,vars:r,transformOrigin:u}=t;let d=!1,p=!1;for(const m in a){const g=a[m];if(zs.has(m)){d=!0;continue}else if(Xb(m)){r[m]=g;continue}else{const v=Qb(g,Th[m]);m.startsWith("origin")?(p=!0,u[m]=v):o[m]=v}}if(a.transform||(d||i?o.transform=WE(a,t.transform,i):o.transform&&(o.transform="none")),p){const{originX:m="50%",originY:g="50%",originZ:v=0}=u;o.transformOrigin=`${m} ${g} ${v}`}}const JE={offset:"stroke-dashoffset",array:"stroke-dasharray"},eN={offset:"strokeDashoffset",array:"strokeDasharray"};function tN(t,a,i=1,o=0,r=!0){t.pathLength=1;const u=r?JE:eN;t[u.offset]=ye.transform(-o);const d=ye.transform(a),p=ye.transform(i);t[u.array]=`${d} ${p}`}function Cy(t,a,i){return typeof t=="string"?t:ye.transform(a+i*t)}function nN(t,a,i){const o=Cy(a,t.x,t.width),r=Cy(i,t.y,t.height);return`${o} ${r}`}function Ch(t,{attrX:a,attrY:i,attrScale:o,originX:r,originY:u,pathLength:d,pathSpacing:p=1,pathOffset:m=0,...g},v,y){if(kh(t,g,y),v){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:b,style:S,dimensions:T}=t;b.transform&&(T&&(S.transform=b.transform),delete b.transform),T&&(r!==void 0||u!==void 0||S.transform)&&(S.transformOrigin=nN(T,r!==void 0?r:.5,u!==void 0?u:.5)),a!==void 0&&(b.x=a),i!==void 0&&(b.y=i),o!==void 0&&(b.scale=o),d!==void 0&&tN(b,d,p,m,!1)}const Eh=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Wb=()=>({...Eh(),attrs:{}}),Nh=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Jb(t,{style:a,vars:i},o,r){Object.assign(t.style,a,r&&r.getProjectionStyles(o));for(const u in i)t.style.setProperty(u,i[u])}const ex=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function tx(t,a,i,o){Jb(t,a,void 0,o);for(const r in a.attrs)t.setAttribute(ex.has(r)?r:yh(r),a.attrs[r])}const fc={};function aN(t){Object.assign(fc,t)}function nx(t,{layout:a,layoutId:i}){return zs.has(t)||t.startsWith("origin")||(a||i!==void 0)&&(!!fc[t]||t==="opacity")}function jh(t,a,i){var o;const{style:r}=t,u={};for(const d in r)(Pt(r[d])||a.style&&Pt(a.style[d])||nx(d,t)||((o=i==null?void 0:i.getValue(d))===null||o===void 0?void 0:o.liveStyle)!==void 0)&&(u[d]=r[d]);return u}function ax(t,a,i){const o=jh(t,a,i);for(const r in t)if(Pt(t[r])||Pt(a[r])){const u=Qi.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;o[u]=t[r]}return o}function sN(t,a){try{a.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{a.dimensions={x:0,y:0,width:0,height:0}}}const Ey=["x","y","width","height","cx","cy","r"],iN={useVisualState:Yb({scrapeMotionValuesFromProps:ax,createRenderState:Wb,onUpdate:({props:t,prevProps:a,current:i,renderState:o,latestValues:r})=>{if(!i)return;let u=!!t.drag;if(!u){for(const p in r)if(zs.has(p)){u=!0;break}}if(!u)return;let d=!a;if(a)for(let p=0;p<Ey.length;p++){const m=Ey[p];t[m]!==a[m]&&(d=!0)}d&&lt.read(()=>{sN(i,o),lt.render(()=>{Ch(o,r,Nh(i.tagName),t.transformTemplate),tx(i,o)})})}})},oN={useVisualState:Yb({scrapeMotionValuesFromProps:jh,createRenderState:Eh})};function sx(t,a,i){for(const o in a)!Pt(a[o])&&!nx(o,i)&&(t[o]=a[o])}function lN({transformTemplate:t},a){return x.useMemo(()=>{const i=Eh();return kh(i,a,t),Object.assign({},i.vars,i.style)},[a])}function rN(t,a){const i=t.style||{},o={};return sx(o,i,t),Object.assign(o,lN(t,a)),o}function cN(t,a){const i={},o=rN(t,a);return t.drag&&t.dragListener!==!1&&(i.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(i.tabIndex=0),i.style=o,i}function uN(t,a,i,o){const r=x.useMemo(()=>{const u=Wb();return Ch(u,a,Nh(o),t.transformTemplate),{...u.attrs,style:{...u.style}}},[a]);if(t.style){const u={};sx(u,t.style,t),r.style={...u,...r.style}}return r}function dN(t=!1){return(i,o,r,{latestValues:u},d)=>{const m=(xh(i)?uN:cN)(o,u,d,i),g=EE(o,typeof i=="string",t),v=i!==x.Fragment?{...g,...m,ref:r}:{},{children:y}=o,b=x.useMemo(()=>Pt(y)?y.get():y,[y]);return x.createElement(i,{...v,children:b})}}function fN(t,a){return function(o,{forwardMotionProps:r}={forwardMotionProps:!1}){const d={...xh(o)?iN:oN,preloadedFeatures:t,useRender:dN(r),createVisualElement:a,Component:o};return BE(d)}}function ix(t,a){if(!Array.isArray(a))return!1;const i=a.length;if(i!==t.length)return!1;for(let o=0;o<i;o++)if(a[o]!==t[o])return!1;return!0}function Rc(t,a,i){const o=t.getProps();return _h(o,a,i!==void 0?i:o.custom,t)}function wh(t,a){return t?t[a]||t.default||t:void 0}const ox=new Set(["width","height","top","left","right","bottom",...Qi]);let oc;function hN(){oc=void 0}const Xn={now:()=>(oc===void 0&&Xn.set(Ut.isProcessing||xE.useManualTiming?Ut.timestamp:performance.now()),oc),set:t=>{oc=t,queueMicrotask(hN)}};function Ah(t,a){t.indexOf(a)===-1&&t.push(a)}function Dh(t,a){const i=t.indexOf(a);i>-1&&t.splice(i,1)}class Rh{constructor(){this.subscriptions=[]}add(a){return Ah(this.subscriptions,a),()=>Dh(this.subscriptions,a)}notify(a,i,o){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](a,i,o);else for(let u=0;u<r;u++){const d=this.subscriptions[u];d&&d(a,i,o)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function lx(t,a){return a?t*(1e3/a):0}const Ny=30,pN=t=>!isNaN(parseFloat(t));class mN{constructor(a,i={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(o,r=!0)=>{const u=Xn.now();this.updatedAt!==u&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),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=Xn.now(),this.canTrackVelocity===null&&a!==void 0&&(this.canTrackVelocity=pN(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 Rh);const o=this.events[a].add(i);return a==="change"?()=>{o(),lt.read(()=>{this.events.change.getSize()||this.stop()})}:o}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,o){this.set(i),this.prev=void 0,this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt-o}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=Xn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||a-this.updatedAt>Ny)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,Ny);return lx(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 vl(t,a){return new mN(t,a)}function gN(t,a,i){t.hasValue(a)?t.getValue(a).set(i):t.addValue(a,vl(i))}function vN(t,a){const i=Rc(t,a);let{transitionEnd:o={},transition:r={},...u}=i||{};u={...u,...o};for(const d in u){const p=HE(u[d]);gN(t,d,p)}}function yN(t){return!!(Pt(t)&&t.add)}function Rf(t,a){const i=t.getValue("willChange");if(yN(i))return i.add(a)}function rx(t){return t.props[Fb]}function Mh(t){let a;return()=>(a===void 0&&(a=t()),a)}const bN=Mh(()=>window.ScrollTimeline!==void 0);class xN{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 o=0;o<this.animations.length;o++)this.animations[o][a]=i}attachTimeline(a,i){const o=this.animations.map(r=>{if(bN()&&r.attachTimeline)return r.attachTimeline(a);if(typeof i=="function")return i(r)});return()=>{o.forEach((r,u)=>{r&&r(),this.animations[u].stop()})}}get time(){return this.getAll("time")}set time(a){this.setAll("time",a)}get speed(){return this.getAll("speed")}set speed(a){this.setAll("speed",a)}get startTime(){return this.getAll("startTime")}get duration(){let a=0;for(let i=0;i<this.animations.length;i++)a=Math.max(a,this.animations[i].duration);return a}runAll(a){this.animations.forEach(i=>i[a]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class _N extends xN{then(a,i){return Promise.all(this.animations).then(a).catch(i)}}const ya=t=>t*1e3,ba=t=>t/1e3;function Oh(t){return typeof t=="function"}function jy(t,a){t.timeline=a,t.onfinish=null}const Bh=t=>Array.isArray(t)&&typeof t[0]=="number",SN={linearEasing:void 0};function TN(t,a){const i=Mh(t);return()=>{var o;return(o=SN[a])!==null&&o!==void 0?o:i()}}const hc=TN(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Fi=(t,a,i)=>{const o=a-t;return o===0?1:(i-t)/o},cx=(t,a,i=10)=>{let o="";const r=Math.max(Math.round(a/i),2);for(let u=0;u<r;u++)o+=t(Fi(0,r-1,u))+", ";return`linear(${o.substring(0,o.length-2)})`};function ux(t){return!!(typeof t=="function"&&hc()||!t||typeof t=="string"&&(t in Mf||hc())||Bh(t)||Array.isArray(t)&&t.every(ux))}const el=([t,a,i,o])=>`cubic-bezier(${t}, ${a}, ${i}, ${o})`,Mf={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:el([0,.65,.55,1]),circOut:el([.55,0,1,.45]),backIn:el([.31,.01,.66,-.59]),backOut:el([.33,1.53,.69,.99])};function dx(t,a){if(t)return typeof t=="function"&&hc()?cx(t,a):Bh(t)?el(t):Array.isArray(t)?t.map(i=>dx(i,a)||Mf.easeOut):Mf[t]}const fx=(t,a,i)=>(((1-3*i+3*a)*t+(3*i-6*a))*t+3*a)*t,kN=1e-7,CN=12;function EN(t,a,i,o,r){let u,d,p=0;do d=a+(i-a)/2,u=fx(d,o,r)-t,u>0?i=d:a=d;while(Math.abs(u)>kN&&++p<CN);return d}function kl(t,a,i,o){if(t===a&&i===o)return fn;const r=u=>EN(u,0,1,t,i);return u=>u===0||u===1?u:fx(r(u),a,o)}const hx=t=>a=>a<=.5?t(2*a)/2:(2-t(2*(1-a)))/2,px=t=>a=>1-t(1-a),mx=kl(.33,1.53,.69,.99),Ih=px(mx),gx=hx(Ih),vx=t=>(t*=2)<1?.5*Ih(t):.5*(2-Math.pow(2,-10*(t-1))),Lh=t=>1-Math.sin(Math.acos(t)),yx=px(Lh),bx=hx(Lh),xx=t=>/^0[^.\s]+$/u.test(t);function NN(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||xx(t):!0}const ll=t=>Math.round(t*1e5)/1e5,Uh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function jN(t){return t==null}const wN=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,zh=(t,a)=>i=>!!(typeof i=="string"&&wN.test(i)&&i.startsWith(t)||a&&!jN(i)&&Object.prototype.hasOwnProperty.call(i,a)),_x=(t,a,i)=>o=>{if(typeof o!="string")return o;const[r,u,d,p]=o.match(Uh);return{[t]:parseFloat(r),[a]:parseFloat(u),[i]:parseFloat(d),alpha:p!==void 0?parseFloat(p):1}},AN=t=>Sa(0,255,t),sf={...Wi,transform:t=>Math.round(AN(t))},Rs={test:zh("rgb","red"),parse:_x("red","green","blue"),transform:({red:t,green:a,blue:i,alpha:o=1})=>"rgba("+sf.transform(t)+", "+sf.transform(a)+", "+sf.transform(i)+", "+ll(gl.transform(o))+")"};function DN(t){let a="",i="",o="",r="";return t.length>5?(a=t.substring(1,3),i=t.substring(3,5),o=t.substring(5,7),r=t.substring(7,9)):(a=t.substring(1,2),i=t.substring(2,3),o=t.substring(3,4),r=t.substring(4,5),a+=a,i+=i,o+=o,r+=r),{red:parseInt(a,16),green:parseInt(i,16),blue:parseInt(o,16),alpha:r?parseInt(r,16)/255:1}}const Of={test:zh("#"),parse:DN,transform:Rs.transform},Ii={test:zh("hsl","hue"),parse:_x("hue","saturation","lightness"),transform:({hue:t,saturation:a,lightness:i,alpha:o=1})=>"hsla("+Math.round(t)+", "+Zn.transform(ll(a))+", "+Zn.transform(ll(i))+", "+ll(gl.transform(o))+")"},Ht={test:t=>Rs.test(t)||Of.test(t)||Ii.test(t),parse:t=>Rs.test(t)?Rs.parse(t):Ii.test(t)?Ii.parse(t):Of.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Rs.transform(t):Ii.transform(t)},RN=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function MN(t){var a,i;return isNaN(t)&&typeof t=="string"&&(((a=t.match(Uh))===null||a===void 0?void 0:a.length)||0)+(((i=t.match(RN))===null||i===void 0?void 0:i.length)||0)>0}const Sx="number",Tx="color",ON="var",BN="var(",wy="${}",IN=/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 yl(t){const a=t.toString(),i=[],o={color:[],number:[],var:[]},r=[];let u=0;const p=a.replace(IN,m=>(Ht.test(m)?(o.color.push(u),r.push(Tx),i.push(Ht.parse(m))):m.startsWith(BN)?(o.var.push(u),r.push(ON),i.push(m)):(o.number.push(u),r.push(Sx),i.push(parseFloat(m))),++u,wy)).split(wy);return{values:i,split:p,indexes:o,types:r}}function kx(t){return yl(t).values}function Cx(t){const{split:a,types:i}=yl(t),o=a.length;return r=>{let u="";for(let d=0;d<o;d++)if(u+=a[d],r[d]!==void 0){const p=i[d];p===Sx?u+=ll(r[d]):p===Tx?u+=Ht.transform(r[d]):u+=r[d]}return u}}const LN=t=>typeof t=="number"?0:t;function UN(t){const a=kx(t);return Cx(t)(a.map(LN))}const ns={test:MN,parse:kx,createTransformer:Cx,getAnimatableNone:UN},zN=new Set(["brightness","contrast","saturate","opacity"]);function VN(t){const[a,i]=t.slice(0,-1).split("(");if(a==="drop-shadow")return t;const[o]=i.match(Uh)||[];if(!o)return t;const r=i.replace(o,"");let u=zN.has(a)?1:0;return o!==i&&(u*=100),a+"("+u+r+")"}const HN=/\b([a-z-]*)\(.*?\)/gu,Bf={...ns,getAnimatableNone:t=>{const a=t.match(HN);return a?a.map(VN).join(" "):t}},PN={...Th,color:Ht,backgroundColor:Ht,outlineColor:Ht,fill:Ht,stroke:Ht,borderColor:Ht,borderTopColor:Ht,borderRightColor:Ht,borderBottomColor:Ht,borderLeftColor:Ht,filter:Bf,WebkitFilter:Bf},Vh=t=>PN[t];function Ex(t,a){let i=Vh(t);return i!==Bf&&(i=ns),i.getAnimatableNone?i.getAnimatableNone(a):void 0}const GN=new Set(["auto","none","0"]);function $N(t,a,i){let o=0,r;for(;o<t.length&&!r;){const u=t[o];typeof u=="string"&&!GN.has(u)&&yl(u).values.length&&(r=t[o]),o++}if(r&&i)for(const u of a)t[u]=Ex(i,r)}const Ay=t=>t===Wi||t===ye,Dy=(t,a)=>parseFloat(t.split(", ")[a]),Ry=(t,a)=>(i,{transform:o})=>{if(o==="none"||!o)return 0;const r=o.match(/^matrix3d\((.+)\)$/u);if(r)return Dy(r[1],a);{const u=o.match(/^matrix\((.+)\)$/u);return u?Dy(u[1],t):0}},FN=new Set(["x","y","z"]),qN=Qi.filter(t=>!FN.has(t));function KN(t){const a=[];return qN.forEach(i=>{const o=t.getValue(i);o!==void 0&&(a.push([i,o.get()]),o.set(i.startsWith("scale")?1:0))}),a}const qi={width:({x:t},{paddingLeft:a="0",paddingRight:i="0"})=>t.max-t.min-parseFloat(a)-parseFloat(i),height:({y:t},{paddingTop:a="0",paddingBottom:i="0"})=>t.max-t.min-parseFloat(a)-parseFloat(i),top:(t,{top:a})=>parseFloat(a),left:(t,{left:a})=>parseFloat(a),bottom:({y:t},{top:a})=>parseFloat(a)+(t.max-t.min),right:({x:t},{left:a})=>parseFloat(a)+(t.max-t.min),x:Ry(4,13),y:Ry(5,14)};qi.translateX=qi.x;qi.translateY=qi.y;const Ms=new Set;let If=!1,Lf=!1;function Nx(){if(Lf){const t=Array.from(Ms).filter(o=>o.needsMeasurement),a=new Set(t.map(o=>o.element)),i=new Map;a.forEach(o=>{const r=KN(o);r.length&&(i.set(o,r),o.render())}),t.forEach(o=>o.measureInitialState()),a.forEach(o=>{o.render();const r=i.get(o);r&&r.forEach(([u,d])=>{var p;(p=o.getValue(u))===null||p===void 0||p.set(d)})}),t.forEach(o=>o.measureEndState()),t.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}Lf=!1,If=!1,Ms.forEach(t=>t.complete()),Ms.clear()}function jx(){Ms.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Lf=!0)})}function YN(){jx(),Nx()}class Hh{constructor(a,i,o,r,u,d=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...a],this.onComplete=i,this.name=o,this.motionValue=r,this.element=u,this.isAsync=d}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ms.add(this),If||(If=!0,lt.read(jx),lt.resolveKeyframes(Nx))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:a,name:i,element:o,motionValue:r}=this;for(let u=0;u<a.length;u++)if(a[u]===null)if(u===0){const d=r==null?void 0:r.get(),p=a[a.length-1];if(d!==void 0)a[0]=d;else if(o&&i){const m=o.readValue(i,p);m!=null&&(a[0]=m)}a[0]===void 0&&(a[0]=p),r&&d===void 0&&r.set(a[0])}else a[u]=a[u-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ms.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ms.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const wx=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),ZN=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function XN(t){const a=ZN.exec(t);if(!a)return[,];const[,i,o,r]=a;return[`--${i??o}`,r]}function Ax(t,a,i=1){const[o,r]=XN(t);if(!o)return;const u=window.getComputedStyle(a).getPropertyValue(o);if(u){const d=u.trim();return wx(d)?parseFloat(d):d}return Sh(r)?Ax(r,a,i+1):r}const Dx=t=>a=>a.test(t),QN={test:t=>t==="auto",parse:t=>t},Rx=[Wi,ye,Zn,Qa,KE,qE,QN],My=t=>Rx.find(Dx(t));class Mx extends Hh{constructor(a,i,o,r,u){super(a,i,o,r,u,!0)}readKeyframes(){const{unresolvedKeyframes:a,element:i,name:o}=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(),Sh(g))){const v=Ax(g,i.current);v!==void 0&&(a[m]=v),m===a.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!ox.has(o)||a.length!==2)return;const[r,u]=a,d=My(r),p=My(u);if(d!==p)if(Ay(d)&&Ay(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,o=[];for(let r=0;r<a.length;r++)NN(a[r])&&o.push(r);o.length&&$N(a,o,i)}measureInitialState(){const{element:a,unresolvedKeyframes:i,name:o}=this;if(!a||!a.current)return;o==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=qi[o](a.measureViewportBox(),window.getComputedStyle(a.current)),i[0]=this.measuredOrigin;const r=i[i.length-1];r!==void 0&&a.getValue(o,r).jump(r,!1)}measureEndState(){var a;const{element:i,name:o,unresolvedKeyframes:r}=this;if(!i||!i.current)return;const u=i.getValue(o);u&&u.jump(this.measuredOrigin,!1);const d=r.length-1,p=r[d];r[d]=qi[o](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 Oy=(t,a)=>a==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(ns.test(t)||t==="0")&&!t.startsWith("url("));function WN(t){const a=t[0];if(t.length===1)return!0;for(let i=0;i<t.length;i++)if(t[i]!==a)return!0}function JN(t,a,i,o){const r=t[0];if(r===null)return!1;if(a==="display"||a==="visibility")return!0;const u=t[t.length-1],d=Oy(r,a),p=Oy(u,a);return!d||!p?!1:WN(t)||(i==="spring"||Oh(i))&&o}const ej=t=>t!==null;function Mc(t,{repeat:a,repeatType:i="loop"},o){const r=t.filter(ej),u=a&&i!=="loop"&&a%2===1?0:r.length-1;return!u||o===void 0?r[u]:o}const tj=40;class Ox{constructor({autoplay:a=!0,delay:i=0,type:o="keyframes",repeat:r=0,repeatDelay:u=0,repeatType:d="loop",...p}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Xn.now(),this.options={autoplay:a,delay:i,type:o,repeat:r,repeatDelay:u,repeatType:d,...p},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>tj?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&YN(),this._resolved}onKeyframesResolved(a,i){this.resolvedAt=Xn.now(),this.hasAttemptedResolve=!0;const{name:o,type:r,velocity:u,delay:d,onComplete:p,onUpdate:m,isGenerator:g}=this.options;if(!g&&!JN(a,o,r,u))if(d)this.options.duration=0;else{m&&m(Mc(a,this.options,i)),p&&p(),this.resolveFinishedPromise();return}const v=this.initPlayback(a,i);v!==!1&&(this._resolved={keyframes:a,finalKeyframe:i,...v},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 Uf=2e4;function Bx(t){let a=0;const i=50;let o=t.next(a);for(;!o.done&&a<Uf;)a+=i,o=t.next(a);return a>=Uf?1/0:a}const ut=(t,a,i)=>t+(a-t)*i;function of(t,a,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+(a-t)*6*i:i<1/2?a:i<2/3?t+(a-t)*(2/3-i)*6:t}function nj({hue:t,saturation:a,lightness:i,alpha:o}){t/=360,a/=100,i/=100;let r=0,u=0,d=0;if(!a)r=u=d=i;else{const p=i<.5?i*(1+a):i+a-i*a,m=2*i-p;r=of(m,p,t+1/3),u=of(m,p,t),d=of(m,p,t-1/3)}return{red:Math.round(r*255),green:Math.round(u*255),blue:Math.round(d*255),alpha:o}}function pc(t,a){return i=>i>0?a:t}const lf=(t,a,i)=>{const o=t*t,r=i*(a*a-o)+o;return r<0?0:Math.sqrt(r)},aj=[Of,Rs,Ii],sj=t=>aj.find(a=>a.test(t));function By(t){const a=sj(t);if(!a)return!1;let i=a.parse(t);return a===Ii&&(i=nj(i)),i}const Iy=(t,a)=>{const i=By(t),o=By(a);if(!i||!o)return pc(t,a);const r={...i};return u=>(r.red=lf(i.red,o.red,u),r.green=lf(i.green,o.green,u),r.blue=lf(i.blue,o.blue,u),r.alpha=ut(i.alpha,o.alpha,u),Rs.transform(r))},ij=(t,a)=>i=>a(t(i)),Cl=(...t)=>t.reduce(ij),zf=new Set(["none","hidden"]);function oj(t,a){return zf.has(t)?i=>i<=0?t:a:i=>i>=1?a:t}function lj(t,a){return i=>ut(t,a,i)}function Ph(t){return typeof t=="number"?lj:typeof t=="string"?Sh(t)?pc:Ht.test(t)?Iy:uj:Array.isArray(t)?Ix:typeof t=="object"?Ht.test(t)?Iy:rj:pc}function Ix(t,a){const i=[...t],o=i.length,r=t.map((u,d)=>Ph(u)(u,a[d]));return u=>{for(let d=0;d<o;d++)i[d]=r[d](u);return i}}function rj(t,a){const i={...t,...a},o={};for(const r in i)t[r]!==void 0&&a[r]!==void 0&&(o[r]=Ph(t[r])(t[r],a[r]));return r=>{for(const u in o)i[u]=o[u](r);return i}}function cj(t,a){var i;const o=[],r={color:0,var:0,number:0};for(let u=0;u<a.values.length;u++){const d=a.types[u],p=t.indexes[d][r[d]],m=(i=t.values[p])!==null&&i!==void 0?i:0;o[u]=m,r[d]++}return o}const uj=(t,a)=>{const i=ns.createTransformer(a),o=yl(t),r=yl(a);return o.indexes.var.length===r.indexes.var.length&&o.indexes.color.length===r.indexes.color.length&&o.indexes.number.length>=r.indexes.number.length?zf.has(t)&&!r.values.length||zf.has(a)&&!o.values.length?oj(t,a):Cl(Ix(cj(o,r),r.values),i):pc(t,a)};function Lx(t,a,i){return typeof t=="number"&&typeof a=="number"&&typeof i=="number"?ut(t,a,i):Ph(t)(t,a)}const dj=5;function Ux(t,a,i){const o=Math.max(a-dj,0);return lx(i-t(o),a-o)}const ht={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},rf=.001;function fj({duration:t=ht.duration,bounce:a=ht.bounce,velocity:i=ht.velocity,mass:o=ht.mass}){let r,u,d=1-a;d=Sa(ht.minDamping,ht.maxDamping,d),t=Sa(ht.minDuration,ht.maxDuration,ba(t)),d<1?(r=g=>{const v=g*d,y=v*t,b=v-i,S=Vf(g,d),T=Math.exp(-y);return rf-b/S*T},u=g=>{const y=g*d*t,b=y*i+i,S=Math.pow(d,2)*Math.pow(g,2)*t,T=Math.exp(-y),E=Vf(Math.pow(g,2),d);return(-r(g)+rf>0?-1:1)*((b-S)*T)/E}):(r=g=>{const v=Math.exp(-g*t),y=(g-i)*t+1;return-rf+v*y},u=g=>{const v=Math.exp(-g*t),y=(i-g)*(t*t);return v*y});const p=5/t,m=pj(r,u,p);if(t=ya(t),isNaN(m))return{stiffness:ht.stiffness,damping:ht.damping,duration:t};{const g=Math.pow(m,2)*o;return{stiffness:g,damping:d*2*Math.sqrt(o*g),duration:t}}}const hj=12;function pj(t,a,i){let o=i;for(let r=1;r<hj;r++)o=o-t(o)/a(o);return o}function Vf(t,a){return t*Math.sqrt(1-a*a)}const mj=["duration","bounce"],gj=["stiffness","damping","mass"];function Ly(t,a){return a.some(i=>t[i]!==void 0)}function vj(t){let a={velocity:ht.velocity,stiffness:ht.stiffness,damping:ht.damping,mass:ht.mass,isResolvedFromDuration:!1,...t};if(!Ly(t,gj)&&Ly(t,mj))if(t.visualDuration){const i=t.visualDuration,o=2*Math.PI/(i*1.2),r=o*o,u=2*Sa(.05,1,1-(t.bounce||0))*Math.sqrt(r);a={...a,mass:ht.mass,stiffness:r,damping:u}}else{const i=fj(t);a={...a,...i,mass:ht.mass},a.isResolvedFromDuration=!0}return a}function zx(t=ht.visualDuration,a=ht.bounce){const i=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:a}:t;let{restSpeed:o,restDelta:r}=i;const u=i.keyframes[0],d=i.keyframes[i.keyframes.length-1],p={done:!1,value:u},{stiffness:m,damping:g,mass:v,duration:y,velocity:b,isResolvedFromDuration:S}=vj({...i,velocity:-ba(i.velocity||0)}),T=b||0,E=g/(2*Math.sqrt(m*v)),N=d-u,C=ba(Math.sqrt(m/v)),j=Math.abs(N)<5;o||(o=j?ht.restSpeed.granular:ht.restSpeed.default),r||(r=j?ht.restDelta.granular:ht.restDelta.default);let D;if(E<1){const w=Vf(C,E);D=F=>{const H=Math.exp(-E*C*F);return d-H*((T+E*C*N)/w*Math.sin(w*F)+N*Math.cos(w*F))}}else if(E===1)D=w=>d-Math.exp(-C*w)*(N+(T+C*N)*w);else{const w=C*Math.sqrt(E*E-1);D=F=>{const H=Math.exp(-E*C*F),B=Math.min(w*F,300);return d-H*((T+E*C*N)*Math.sinh(B)+w*N*Math.cosh(B))/w}}const R={calculatedDuration:S&&y||null,next:w=>{const F=D(w);if(S)p.done=w>=y;else{let H=0;E<1&&(H=w===0?ya(T):Ux(D,w,F));const B=Math.abs(H)<=o,q=Math.abs(d-F)<=r;p.done=B&&q}return p.value=p.done?d:F,p},toString:()=>{const w=Math.min(Bx(R),Uf),F=cx(H=>R.next(w*H).value,w,30);return w+"ms "+F}};return R}function Uy({keyframes:t,velocity:a=0,power:i=.8,timeConstant:o=325,bounceDamping:r=10,bounceStiffness:u=500,modifyTarget:d,min:p,max:m,restDelta:g=.5,restSpeed:v}){const y=t[0],b={done:!1,value:y},S=B=>p!==void 0&&B<p||m!==void 0&&B>m,T=B=>p===void 0?m:m===void 0||Math.abs(p-B)<Math.abs(m-B)?p:m;let E=i*a;const N=y+E,C=d===void 0?N:d(N);C!==N&&(E=C-y);const j=B=>-E*Math.exp(-B/o),D=B=>C+j(B),R=B=>{const q=j(B),X=D(B);b.done=Math.abs(q)<=g,b.value=b.done?C:X};let w,F;const H=B=>{S(b.value)&&(w=B,F=zx({keyframes:[b.value,T(b.value)],velocity:Ux(D,B,b.value),damping:r,stiffness:u,restDelta:g,restSpeed:v}))};return H(0),{calculatedDuration:null,next:B=>{let q=!1;return!F&&w===void 0&&(q=!0,R(B),H(B)),w!==void 0&&B>=w?F.next(B-w):(!q&&R(B),b)}}}const yj=kl(.42,0,1,1),bj=kl(0,0,.58,1),Vx=kl(.42,0,.58,1),xj=t=>Array.isArray(t)&&typeof t[0]!="number",_j={linear:fn,easeIn:yj,easeInOut:Vx,easeOut:bj,circIn:Lh,circInOut:bx,circOut:yx,backIn:Ih,backInOut:gx,backOut:mx,anticipate:vx},zy=t=>{if(Bh(t)){Vb(t.length===4);const[a,i,o,r]=t;return kl(a,i,o,r)}else if(typeof t=="string")return _j[t];return t};function Sj(t,a,i){const o=[],r=i||Lx,u=t.length-1;for(let d=0;d<u;d++){let p=r(t[d],t[d+1]);if(a){const m=Array.isArray(a)?a[d]||fn:a;p=Cl(m,p)}o.push(p)}return o}function Tj(t,a,{clamp:i=!0,ease:o,mixer:r}={}){const u=t.length;if(Vb(u===a.length),u===1)return()=>a[0];if(u===2&&a[0]===a[1])return()=>a[1];const d=t[0]===t[1];t[0]>t[u-1]&&(t=[...t].reverse(),a=[...a].reverse());const p=Sj(a,o,r),m=p.length,g=v=>{if(d&&v<t[0])return a[0];let y=0;if(m>1)for(;y<t.length-2&&!(v<t[y+1]);y++);const b=Fi(t[y],t[y+1],v);return p[y](b)};return i?v=>g(Sa(t[0],t[u-1],v)):g}function kj(t,a){const i=t[t.length-1];for(let o=1;o<=a;o++){const r=Fi(0,a,o);t.push(ut(i,1,r))}}function Cj(t){const a=[0];return kj(a,t.length-1),a}function Ej(t,a){return t.map(i=>i*a)}function Nj(t,a){return t.map(()=>a||Vx).splice(0,t.length-1)}function mc({duration:t=300,keyframes:a,times:i,ease:o="easeInOut"}){const r=xj(o)?o.map(zy):zy(o),u={done:!1,value:a[0]},d=Ej(i&&i.length===a.length?i:Cj(a),t),p=Tj(d,a,{ease:Array.isArray(r)?r:Nj(a,r)});return{calculatedDuration:t,next:m=>(u.value=p(m),u.done=m>=t,u)}}const jj=t=>{const a=({timestamp:i})=>t(i);return{start:()=>lt.update(a,!0),stop:()=>ts(a),now:()=>Ut.isProcessing?Ut.timestamp:Xn.now()}},wj={decay:Uy,inertia:Uy,tween:mc,keyframes:mc,spring:zx},Aj=t=>t/100;class Gh extends Ox{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:o,element:r,keyframes:u}=this.options,d=(r==null?void 0:r.KeyframeResolver)||Hh,p=(m,g)=>this.onKeyframesResolved(m,g);this.resolver=new d(u,p,i,o,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:o=0,repeatDelay:r=0,repeatType:u,velocity:d=0}=this.options,p=Oh(i)?i:wj[i]||mc;let m,g;p!==mc&&typeof a[0]!="number"&&(m=Cl(Aj,Lx(a[0],a[1])),a=[0,100]);const v=p({...this.options,keyframes:a});u==="mirror"&&(g=p({...this.options,keyframes:[...a].reverse(),velocity:-d})),v.calculatedDuration===null&&(v.calculatedDuration=Bx(v));const{calculatedDuration:y}=v,b=y+r,S=b*(o+1)-r;return{generator:v,mirroredGenerator:g,mapPercentToKeyframes:m,calculatedDuration:y,resolvedDuration:b,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:o}=this;if(!o){const{keyframes:B}=this.options;return{done:!0,value:B[B.length-1]}}const{finalKeyframe:r,generator:u,mirroredGenerator:d,mapPercentToKeyframes:p,keyframes:m,calculatedDuration:g,totalDuration:v,resolvedDuration:y}=o;if(this.startTime===null)return u.next(0);const{delay:b,repeat:S,repeatType:T,repeatDelay:E,onUpdate:N}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,a):this.speed<0&&(this.startTime=Math.min(a-v/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 C=this.currentTime-b*(this.speed>=0?1:-1),j=this.speed>=0?C<0:C>v;this.currentTime=Math.max(C,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=v);let D=this.currentTime,R=u;if(S){const B=Math.min(this.currentTime,v)/y;let q=Math.floor(B),X=B%1;!X&&B>=1&&(X=1),X===1&&q--,q=Math.min(q,S+1),!!(q%2)&&(T==="reverse"?(X=1-X,E&&(X-=E/y)):T==="mirror"&&(R=d)),D=Sa(0,1,X)*y}const w=j?{done:!1,value:m[0]}:R.next(D);p&&(w.value=p(w.value));let{done:F}=w;!j&&g!==null&&(F=this.speed>=0?this.currentTime>=v:this.currentTime<=0);const H=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&F);return H&&r!==void 0&&(w.value=Mc(m,this.options,r)),N&&N(w.value),H&&this.finish(),w}get duration(){const{resolved:a}=this;return a?ba(a.calculatedDuration):0}get time(){return ba(this.currentTime)}set time(a){a=ya(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=ba(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:a=jj,onPlay:i,startTime:o}=this.options;this.driver||(this.driver=a(u=>this.tick(u))),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=o??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 Dj=new Set(["opacity","clipPath","filter","transform"]);function Rj(t,a,i,{delay:o=0,duration:r=300,repeat:u=0,repeatType:d="loop",ease:p="easeInOut",times:m}={}){const g={[a]:i};m&&(g.offset=m);const v=dx(p,r);return Array.isArray(v)&&(g.easing=v),t.animate(g,{delay:o,duration:r,easing:Array.isArray(v)?"linear":v,fill:"both",iterations:u+1,direction:d==="reverse"?"alternate":"normal"})}const Mj=Mh(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),gc=10,Oj=2e4;function Bj(t){return Oh(t.type)||t.type==="spring"||!ux(t.ease)}function Ij(t,a){const i=new Gh({...a,keyframes:t,repeat:0,delay:0,isGenerator:!0});let o={done:!1,value:t[0]};const r=[];let u=0;for(;!o.done&&u<Oj;)o=i.sample(u),r.push(o.value),u+=gc;return{times:void 0,keyframes:r,duration:u-gc,ease:"linear"}}const Hx={anticipate:vx,backInOut:gx,circInOut:bx};function Lj(t){return t in Hx}class Vy extends Ox{constructor(a){super(a);const{name:i,motionValue:o,element:r,keyframes:u}=this.options;this.resolver=new Mx(u,(d,p)=>this.onKeyframesResolved(d,p),i,o,r),this.resolver.scheduleResolve()}initPlayback(a,i){let{duration:o=300,times:r,ease:u,type:d,motionValue:p,name:m,startTime:g}=this.options;if(!p.owner||!p.owner.current)return!1;if(typeof u=="string"&&hc()&&Lj(u)&&(u=Hx[u]),Bj(this.options)){const{onComplete:y,onUpdate:b,motionValue:S,element:T,...E}=this.options,N=Ij(a,E);a=N.keyframes,a.length===1&&(a[1]=a[0]),o=N.duration,r=N.times,u=N.ease,d="keyframes"}const v=Rj(p.owner.current,m,a,{...this.options,duration:o,times:r,ease:u});return v.startTime=g??this.calcStartTime(),this.pendingTimeline?(jy(v,this.pendingTimeline),this.pendingTimeline=void 0):v.onfinish=()=>{const{onComplete:y}=this.options;p.set(Mc(a,this.options,i)),y&&y(),this.cancel(),this.resolveFinishedPromise()},{animation:v,duration:o,times:r,type:d,ease:u,keyframes:a}}get duration(){const{resolved:a}=this;if(!a)return 0;const{duration:i}=a;return ba(i)}get time(){const{resolved:a}=this;if(!a)return 0;const{animation:i}=a;return ba(i.currentTime||0)}set time(a){const{resolved:i}=this;if(!i)return;const{animation:o}=i;o.currentTime=ya(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:o}=i;o.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 fn;const{animation:o}=i;jy(o,a)}return fn}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:o,duration:r,type:u,ease:d,times:p}=a;if(i.playState==="idle"||i.playState==="finished")return;if(this.time){const{motionValue:g,onUpdate:v,onComplete:y,element:b,...S}=this.options,T=new Gh({...S,keyframes:o,duration:r,type:u,ease:d,times:p,isGenerator:!0}),E=ya(this.time);g.setWithVelocity(T.sample(E-gc).value,T.sample(E).value,gc)}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:o,repeatDelay:r,repeatType:u,damping:d,type:p}=a;if(!i||!i.owner||!(i.owner.current instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:g}=i.owner.getProps();return Mj()&&o&&Dj.has(o)&&!m&&!g&&!r&&u!=="mirror"&&d!==0&&p!=="inertia"}}const Uj={type:"spring",stiffness:500,damping:25,restSpeed:10},zj=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Vj={type:"keyframes",duration:.8},Hj={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Pj=(t,{keyframes:a})=>a.length>2?Vj:zs.has(t)?t.startsWith("scale")?zj(a[1]):Uj:Hj;function Gj({when:t,delay:a,delayChildren:i,staggerChildren:o,staggerDirection:r,repeat:u,repeatType:d,repeatDelay:p,from:m,elapsed:g,...v}){return!!Object.keys(v).length}const $h=(t,a,i,o={},r,u)=>d=>{const p=wh(o,t)||{},m=p.delay||o.delay||0;let{elapsed:g=0}=o;g=g-ya(m);let v={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:a.getVelocity(),...p,delay:-g,onUpdate:b=>{a.set(b),p.onUpdate&&p.onUpdate(b)},onComplete:()=>{d(),p.onComplete&&p.onComplete()},name:t,motionValue:a,element:u?void 0:r};Gj(p)||(v={...v,...Pj(t,v)}),v.duration&&(v.duration=ya(v.duration)),v.repeatDelay&&(v.repeatDelay=ya(v.repeatDelay)),v.from!==void 0&&(v.keyframes[0]=v.from);let y=!1;if((v.type===!1||v.duration===0&&!v.repeatDelay)&&(v.duration=0,v.delay===0&&(y=!0)),y&&!u&&a.get()!==void 0){const b=Mc(v.keyframes,p);if(b!==void 0)return lt.update(()=>{v.onUpdate(b),v.onComplete()}),new _N([])}return!u&&Vy.supports(v)?new Vy(v):new Gh(v)};function $j({protectedKeys:t,needsAnimating:a},i){const o=t.hasOwnProperty(i)&&a[i]!==!0;return a[i]=!1,o}function Px(t,a,{delay:i=0,transitionOverride:o,type:r}={}){var u;let{transition:d=t.getDefaultTransition(),transitionEnd:p,...m}=a;o&&(d=o);const g=[],v=r&&t.animationState&&t.animationState.getState()[r];for(const y in m){const b=t.getValue(y,(u=t.latestValues[y])!==null&&u!==void 0?u:null),S=m[y];if(S===void 0||v&&$j(v,y))continue;const T={delay:i,...wh(d||{},y)};let E=!1;if(window.MotionHandoffAnimation){const C=rx(t);if(C){const j=window.MotionHandoffAnimation(C,y,lt);j!==null&&(T.startTime=j,E=!0)}}Rf(t,y),b.start($h(y,b,S,t.shouldReduceMotion&&ox.has(y)?{type:!1}:T,t,E));const N=b.animation;N&&g.push(N)}return p&&Promise.all(g).then(()=>{lt.update(()=>{p&&vN(t,p)})}),g}function Hf(t,a,i={}){var o;const r=Rc(t,a,i.type==="exit"?(o=t.presenceContext)===null||o===void 0?void 0:o.custom:void 0);let{transition:u=t.getDefaultTransition()||{}}=r||{};i.transitionOverride&&(u=i.transitionOverride);const d=r?()=>Promise.all(Px(t,r,i)):()=>Promise.resolve(),p=t.variantChildren&&t.variantChildren.size?(g=0)=>{const{delayChildren:v=0,staggerChildren:y,staggerDirection:b}=u;return Fj(t,a,v+g,y,b,i)}:()=>Promise.resolve(),{when:m}=u;if(m){const[g,v]=m==="beforeChildren"?[d,p]:[p,d];return g().then(()=>v())}else return Promise.all([d(),p(i.delay)])}function Fj(t,a,i=0,o=0,r=1,u){const d=[],p=(t.variantChildren.size-1)*o,m=r===1?(g=0)=>g*o:(g=0)=>p-g*o;return Array.from(t.variantChildren).sort(qj).forEach((g,v)=>{g.notify("AnimationStart",a),d.push(Hf(g,a,{...u,delay:i+m(v)}).then(()=>g.notify("AnimationComplete",a)))}),Promise.all(d)}function qj(t,a){return t.sortNodePosition(a)}function Kj(t,a,i={}){t.notify("AnimationStart",a);let o;if(Array.isArray(a)){const r=a.map(u=>Hf(t,u,i));o=Promise.all(r)}else if(typeof a=="string")o=Hf(t,a,i);else{const r=typeof a=="function"?Rc(t,a,i.custom):a;o=Promise.all(Px(t,r,i))}return o.then(()=>{t.notify("AnimationComplete",a)})}const Yj=vh.length;function Gx(t){if(!t)return;if(!t.isControllingVariants){const i=t.parent?Gx(t.parent)||{}:{};return t.props.initial!==void 0&&(i.initial=t.props.initial),i}const a={};for(let i=0;i<Yj;i++){const o=vh[i],r=t.props[o];(ml(r)||r===!1)&&(a[o]=r)}return a}const Zj=[...gh].reverse(),Xj=gh.length;function Qj(t){return a=>Promise.all(a.map(({animation:i,options:o})=>Kj(t,i,o)))}function Wj(t){let a=Qj(t),i=Hy(),o=!0;const r=m=>(g,v)=>{var y;const b=Rc(t,v,m==="exit"?(y=t.presenceContext)===null||y===void 0?void 0:y.custom:void 0);if(b){const{transition:S,transitionEnd:T,...E}=b;g={...g,...E,...T}}return g};function u(m){a=m(t)}function d(m){const{props:g}=t,v=Gx(t.parent)||{},y=[],b=new Set;let S={},T=1/0;for(let N=0;N<Xj;N++){const C=Zj[N],j=i[C],D=g[C]!==void 0?g[C]:v[C],R=ml(D),w=C===m?j.isActive:null;w===!1&&(T=N);let F=D===v[C]&&D!==g[C]&&R;if(F&&o&&t.manuallyAnimateOnMount&&(F=!1),j.protectedKeys={...S},!j.isActive&&w===null||!D&&!j.prevProp||Ac(D)||typeof D=="boolean")continue;const H=Jj(j.prevProp,D);let B=H||C===m&&j.isActive&&!F&&R||N>T&&R,q=!1;const X=Array.isArray(D)?D:[D];let ae=X.reduce(r(C),{});w===!1&&(ae={});const{prevResolvedValues:te={}}=j,ee={...te,...ae},z=Y=>{B=!0,b.has(Y)&&(q=!0,b.delete(Y)),j.needsAnimating[Y]=!0;const oe=t.getValue(Y);oe&&(oe.liveStyle=!1)};for(const Y in ee){const oe=ae[Y],G=te[Y];if(S.hasOwnProperty(Y))continue;let O=!1;Df(oe)&&Df(G)?O=!ix(oe,G):O=oe!==G,O?oe!=null?z(Y):b.add(Y):oe!==void 0&&b.has(Y)?z(Y):j.protectedKeys[Y]=!0}j.prevProp=D,j.prevResolvedValues=ae,j.isActive&&(S={...S,...ae}),o&&t.blockInitialAnimation&&(B=!1),B&&(!(F&&H)||q)&&y.push(...X.map(Y=>({animation:Y,options:{type:C}})))}if(b.size){const N={};b.forEach(C=>{const j=t.getBaseTarget(C),D=t.getValue(C);D&&(D.liveStyle=!0),N[C]=j??null}),y.push({animation:N})}let E=!!y.length;return o&&(g.initial===!1||g.initial===g.animate)&&!t.manuallyAnimateOnMount&&(E=!1),o=!1,E?a(y):Promise.resolve()}function p(m,g){var v;if(i[m].isActive===g)return Promise.resolve();(v=t.variantChildren)===null||v===void 0||v.forEach(b=>{var S;return(S=b.animationState)===null||S===void 0?void 0:S.setActive(m,g)}),i[m].isActive=g;const y=d(m);for(const b in i)i[b].protectedKeys={};return y}return{animateChanges:d,setActive:p,setAnimateFunction:u,getState:()=>i,reset:()=>{i=Hy(),o=!0}}}function Jj(t,a){return typeof a=="string"?a!==t:Array.isArray(a)?!ix(a,t):!1}function Es(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Hy(){return{animate:Es(!0),whileInView:Es(),whileHover:Es(),whileTap:Es(),whileDrag:Es(),whileFocus:Es(),exit:Es()}}class is{constructor(a){this.isMounted=!1,this.node=a}update(){}}class ew extends is{constructor(a){super(a),a.animationState||(a.animationState=Wj(a))}updateAnimationControlsSubscription(){const{animate:a}=this.node.getProps();Ac(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 tw=0;class nw extends is{constructor(){super(...arguments),this.id=tw++}update(){if(!this.node.presenceContext)return;const{isPresent:a,onExitComplete:i}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||a===o)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 aw={animation:{Feature:ew},exit:{Feature:nw}},In={x:!1,y:!1};function $x(){return In.x||In.y}function sw(t){return t==="x"||t==="y"?In[t]?null:(In[t]=!0,()=>{In[t]=!1}):In.x||In.y?null:(In.x=In.y=!0,()=>{In.x=In.y=!1})}const Fh=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function bl(t,a,i,o={passive:!0}){return t.addEventListener(a,i,o),()=>t.removeEventListener(a,i)}function El(t){return{point:{x:t.pageX,y:t.pageY}}}const iw=t=>a=>Fh(a)&&t(a,El(a));function rl(t,a,i,o){return bl(t,a,iw(i),o)}const Py=(t,a)=>Math.abs(t-a);function ow(t,a){const i=Py(t.x,a.x),o=Py(t.y,a.y);return Math.sqrt(i**2+o**2)}class Fx{constructor(a,i,{transformPagePoint:o,contextWindow:r,dragSnapToOrigin:u=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=uf(this.lastMoveEventInfo,this.history),b=this.startEvent!==null,S=ow(y.offset,{x:0,y:0})>=3;if(!b&&!S)return;const{point:T}=y,{timestamp:E}=Ut;this.history.push({...T,timestamp:E});const{onStart:N,onMove:C}=this.handlers;b||(N&&N(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,y)},this.handlePointerMove=(y,b)=>{this.lastMoveEvent=y,this.lastMoveEventInfo=cf(b,this.transformPagePoint),lt.update(this.updatePoint,!0)},this.handlePointerUp=(y,b)=>{this.end();const{onEnd:S,onSessionEnd:T,resumeAnimation:E}=this.handlers;if(this.dragSnapToOrigin&&E&&E(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const N=uf(y.type==="pointercancel"?this.lastMoveEventInfo:cf(b,this.transformPagePoint),this.history);this.startEvent&&S&&S(y,N),T&&T(y,N)},!Fh(a))return;this.dragSnapToOrigin=u,this.handlers=i,this.transformPagePoint=o,this.contextWindow=r||window;const d=El(a),p=cf(d,this.transformPagePoint),{point:m}=p,{timestamp:g}=Ut;this.history=[{...m,timestamp:g}];const{onSessionStart:v}=i;v&&v(a,uf(p,this.history)),this.removeListeners=Cl(rl(this.contextWindow,"pointermove",this.handlePointerMove),rl(this.contextWindow,"pointerup",this.handlePointerUp),rl(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(a){this.handlers=a}end(){this.removeListeners&&this.removeListeners(),ts(this.updatePoint)}}function cf(t,a){return a?{point:a(t.point)}:t}function Gy(t,a){return{x:t.x-a.x,y:t.y-a.y}}function uf({point:t},a){return{point:t,delta:Gy(t,qx(a)),offset:Gy(t,lw(a)),velocity:rw(a,.1)}}function lw(t){return t[0]}function qx(t){return t[t.length-1]}function rw(t,a){if(t.length<2)return{x:0,y:0};let i=t.length-1,o=null;const r=qx(t);for(;i>=0&&(o=t[i],!(r.timestamp-o.timestamp>ya(a)));)i--;if(!o)return{x:0,y:0};const u=ba(r.timestamp-o.timestamp);if(u===0)return{x:0,y:0};const d={x:(r.x-o.x)/u,y:(r.y-o.y)/u};return d.x===1/0&&(d.x=0),d.y===1/0&&(d.y=0),d}const Kx=1e-4,cw=1-Kx,uw=1+Kx,Yx=.01,dw=0-Yx,fw=0+Yx;function hn(t){return t.max-t.min}function hw(t,a,i){return Math.abs(t-a)<=i}function $y(t,a,i,o=.5){t.origin=o,t.originPoint=ut(a.min,a.max,t.origin),t.scale=hn(i)/hn(a),t.translate=ut(i.min,i.max,t.origin)-t.originPoint,(t.scale>=cw&&t.scale<=uw||isNaN(t.scale))&&(t.scale=1),(t.translate>=dw&&t.translate<=fw||isNaN(t.translate))&&(t.translate=0)}function cl(t,a,i,o){$y(t.x,a.x,i.x,o?o.originX:void 0),$y(t.y,a.y,i.y,o?o.originY:void 0)}function Fy(t,a,i){t.min=i.min+a.min,t.max=t.min+hn(a)}function pw(t,a,i){Fy(t.x,a.x,i.x),Fy(t.y,a.y,i.y)}function qy(t,a,i){t.min=a.min-i.min,t.max=t.min+hn(a)}function ul(t,a,i){qy(t.x,a.x,i.x),qy(t.y,a.y,i.y)}function mw(t,{min:a,max:i},o){return a!==void 0&&t<a?t=o?ut(a,t,o.min):Math.max(t,a):i!==void 0&&t>i&&(t=o?ut(i,t,o.max):Math.min(t,i)),t}function Ky(t,a,i){return{min:a!==void 0?t.min+a:void 0,max:i!==void 0?t.max+i-(t.max-t.min):void 0}}function gw(t,{top:a,left:i,bottom:o,right:r}){return{x:Ky(t.x,i,r),y:Ky(t.y,a,o)}}function Yy(t,a){let i=a.min-t.min,o=a.max-t.max;return a.max-a.min<t.max-t.min&&([i,o]=[o,i]),{min:i,max:o}}function vw(t,a){return{x:Yy(t.x,a.x),y:Yy(t.y,a.y)}}function yw(t,a){let i=.5;const o=hn(t),r=hn(a);return r>o?i=Fi(a.min,a.max-o,t.min):o>r&&(i=Fi(t.min,t.max-r,a.min)),Sa(0,1,i)}function bw(t,a){const i={};return a.min!==void 0&&(i.min=a.min-t.min),a.max!==void 0&&(i.max=a.max-t.min),i}const Pf=.35;function xw(t=Pf){return t===!1?t=0:t===!0&&(t=Pf),{x:Zy(t,"left","right"),y:Zy(t,"top","bottom")}}function Zy(t,a,i){return{min:Xy(t,a),max:Xy(t,i)}}function Xy(t,a){return typeof t=="number"?t:t[a]||0}const Qy=()=>({translate:0,scale:1,origin:0,originPoint:0}),Li=()=>({x:Qy(),y:Qy()}),Wy=()=>({min:0,max:0}),vt=()=>({x:Wy(),y:Wy()});function wn(t){return[t("x"),t("y")]}function Zx({top:t,left:a,right:i,bottom:o}){return{x:{min:a,max:i},y:{min:t,max:o}}}function _w({x:t,y:a}){return{top:a.min,right:t.max,bottom:a.max,left:t.min}}function Sw(t,a){if(!a)return t;const i=a({x:t.left,y:t.top}),o=a({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:o.y,right:o.x}}function df(t){return t===void 0||t===1}function Gf({scale:t,scaleX:a,scaleY:i}){return!df(t)||!df(a)||!df(i)}function ws(t){return Gf(t)||Xx(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Xx(t){return Jy(t.x)||Jy(t.y)}function Jy(t){return t&&t!=="0%"}function vc(t,a,i){const o=t-i,r=a*o;return i+r}function e0(t,a,i,o,r){return r!==void 0&&(t=vc(t,r,o)),vc(t,i,o)+a}function $f(t,a=0,i=1,o,r){t.min=e0(t.min,a,i,o,r),t.max=e0(t.max,a,i,o,r)}function Qx(t,{x:a,y:i}){$f(t.x,a.translate,a.scale,a.originPoint),$f(t.y,i.translate,i.scale,i.originPoint)}const t0=.999999999999,n0=1.0000000000001;function Tw(t,a,i,o=!1){const r=i.length;if(!r)return;a.x=a.y=1;let u,d;for(let p=0;p<r;p++){u=i[p],d=u.projectionDelta;const{visualElement:m}=u.options;m&&m.props.style&&m.props.style.display==="contents"||(o&&u.options.layoutScroll&&u.scroll&&u!==u.root&&zi(t,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),d&&(a.x*=d.x.scale,a.y*=d.y.scale,Qx(t,d)),o&&ws(u.latestValues)&&zi(t,u.latestValues))}a.x<n0&&a.x>t0&&(a.x=1),a.y<n0&&a.y>t0&&(a.y=1)}function Ui(t,a){t.min=t.min+a,t.max=t.max+a}function a0(t,a,i,o,r=.5){const u=ut(t.min,t.max,r);$f(t,a,i,u,o)}function zi(t,a){a0(t.x,a.x,a.scaleX,a.scale,a.originX),a0(t.y,a.y,a.scaleY,a.scale,a.originY)}function Wx(t,a){return Zx(Sw(t.getBoundingClientRect(),a))}function kw(t,a,i){const o=Wx(t,i),{scroll:r}=a;return r&&(Ui(o.x,r.offset.x),Ui(o.y,r.offset.y)),o}const Jx=({current:t})=>t?t.ownerDocument.defaultView:null,Cw=new WeakMap;class Ew{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=vt(),this.visualElement=a}start(a,{snapToCursor:i=!1}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const r=v=>{const{dragSnapToOrigin:y}=this.getProps();y?this.pauseAnimation():this.stopAnimation(),i&&this.snapToCursor(El(v).point)},u=(v,y)=>{const{drag:b,dragPropagation:S,onDragStart:T}=this.getProps();if(b&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=sw(b),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),wn(N=>{let C=this.getAxisMotionValue(N).get()||0;if(Zn.test(C)){const{projection:j}=this.visualElement;if(j&&j.layout){const D=j.layout.layoutBox[N];D&&(C=hn(D)*(parseFloat(C)/100))}}this.originPoint[N]=C}),T&&lt.postRender(()=>T(v,y)),Rf(this.visualElement,"transform");const{animationState:E}=this.visualElement;E&&E.setActive("whileDrag",!0)},d=(v,y)=>{const{dragPropagation:b,dragDirectionLock:S,onDirectionLock:T,onDrag:E}=this.getProps();if(!b&&!this.openDragLock)return;const{offset:N}=y;if(S&&this.currentDirection===null){this.currentDirection=Nw(N),this.currentDirection!==null&&T&&T(this.currentDirection);return}this.updateAxis("x",y.point,N),this.updateAxis("y",y.point,N),this.visualElement.render(),E&&E(v,y)},p=(v,y)=>this.stop(v,y),m=()=>wn(v=>{var y;return this.getAnimationState(v)==="paused"&&((y=this.getAxisMotionValue(v).animation)===null||y===void 0?void 0:y.play())}),{dragSnapToOrigin:g}=this.getProps();this.panSession=new Fx(a,{onSessionStart:r,onStart:u,onMove:d,onSessionEnd:p,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,contextWindow:Jx(this.visualElement)})}stop(a,i){const o=this.isDragging;if(this.cancel(),!o)return;const{velocity:r}=i;this.startAnimation(r);const{onDragEnd:u}=this.getProps();u&&lt.postRender(()=>u(a,i))}cancel(){this.isDragging=!1;const{projection:a,animationState:i}=this.visualElement;a&&(a.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}updateAxis(a,i,o){const{drag:r}=this.getProps();if(!o||!Xr(a,r,this.currentDirection))return;const u=this.getAxisMotionValue(a);let d=this.originPoint[a]+o[a];this.constraints&&this.constraints[a]&&(d=mw(d,this.constraints[a],this.elastic[a])),u.set(d)}resolveConstraints(){var a;const{dragConstraints:i,dragElastic:o}=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,u=this.constraints;i&&Bi(i)?this.constraints||(this.constraints=this.resolveRefConstraints()):i&&r?this.constraints=gw(r.layoutBox,i):this.constraints=!1,this.elastic=xw(o),u!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&wn(d=>{this.constraints!==!1&&this.getAxisMotionValue(d)&&(this.constraints[d]=bw(r.layoutBox[d],this.constraints[d]))})}resolveRefConstraints(){const{dragConstraints:a,onMeasureDragConstraints:i}=this.getProps();if(!a||!Bi(a))return!1;const o=a.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const u=kw(o,r.root,this.visualElement.getTransformPagePoint());let d=vw(r.layout.layoutBox,u);if(i){const p=i(_w(d));this.hasMutatedConstraints=!!p,p&&(d=Zx(p))}return d}startAnimation(a){const{drag:i,dragMomentum:o,dragElastic:r,dragTransition:u,dragSnapToOrigin:d,onDragTransitionEnd:p}=this.getProps(),m=this.constraints||{},g=wn(v=>{if(!Xr(v,i,this.currentDirection))return;let y=m&&m[v]||{};d&&(y={min:0,max:0});const b=r?200:1e6,S=r?40:1e7,T={type:"inertia",velocity:o?a[v]:0,bounceStiffness:b,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...u,...y};return this.startAxisValueAnimation(v,T)});return Promise.all(g).then(p)}startAxisValueAnimation(a,i){const o=this.getAxisMotionValue(a);return Rf(this.visualElement,a),o.start($h(a,o,0,i,this.visualElement,!1))}stopAnimation(){wn(a=>this.getAxisMotionValue(a).stop())}pauseAnimation(){wn(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()}`,o=this.visualElement.getProps(),r=o[i];return r||this.visualElement.getValue(a,(o.initial?o.initial[a]:void 0)||0)}snapToCursor(a){wn(i=>{const{drag:o}=this.getProps();if(!Xr(i,o,this.currentDirection))return;const{projection:r}=this.visualElement,u=this.getAxisMotionValue(i);if(r&&r.layout){const{min:d,max:p}=r.layout.layoutBox[i];u.set(a[i]-ut(d,p,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:a,dragConstraints:i}=this.getProps(),{projection:o}=this.visualElement;if(!Bi(i)||!o||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};wn(d=>{const p=this.getAxisMotionValue(d);if(p&&this.constraints!==!1){const m=p.get();r[d]=yw({min:m,max:m},this.constraints[d])}});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.resolveConstraints(),wn(d=>{if(!Xr(d,a,null))return;const p=this.getAxisMotionValue(d),{min:m,max:g}=this.constraints[d];p.set(ut(m,g,r[d]))})}addListeners(){if(!this.visualElement.current)return;Cw.set(this.visualElement,this);const a=this.visualElement.current,i=rl(a,"pointerdown",m=>{const{drag:g,dragListener:v=!0}=this.getProps();g&&v&&this.start(m)}),o=()=>{const{dragConstraints:m}=this.getProps();Bi(m)&&m.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,u=r.addEventListener("measure",o);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),lt.read(o);const d=bl(window,"resize",()=>this.scalePositionWithinConstraints()),p=r.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:g})=>{this.isDragging&&g&&(wn(v=>{const y=this.getAxisMotionValue(v);y&&(this.originPoint[v]+=m[v].translate,y.set(y.get()+m[v].translate))}),this.visualElement.render())}));return()=>{d(),i(),u(),p&&p()}}getProps(){const a=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:o=!1,dragPropagation:r=!1,dragConstraints:u=!1,dragElastic:d=Pf,dragMomentum:p=!0}=a;return{...a,drag:i,dragDirectionLock:o,dragPropagation:r,dragConstraints:u,dragElastic:d,dragMomentum:p}}}function Xr(t,a,i){return(a===!0||a===t)&&(i===null||i===t)}function Nw(t,a=10){let i=null;return Math.abs(t.y)>a?i="y":Math.abs(t.x)>a&&(i="x"),i}class jw extends is{constructor(a){super(a),this.removeGroupControls=fn,this.removeListeners=fn,this.controls=new Ew(a)}mount(){const{dragControls:a}=this.node.getProps();a&&(this.removeGroupControls=a.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||fn}unmount(){this.removeGroupControls(),this.removeListeners()}}const s0=t=>(a,i)=>{t&&lt.postRender(()=>t(a,i))};class ww extends is{constructor(){super(...arguments),this.removePointerDownListener=fn}onPointerDown(a){this.session=new Fx(a,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Jx(this.node)})}createPanHandlers(){const{onPanSessionStart:a,onPanStart:i,onPan:o,onPanEnd:r}=this.node.getProps();return{onSessionStart:s0(a),onStart:s0(i),onMove:o,onEnd:(u,d)=>{delete this.session,r&&lt.postRender(()=>r(u,d))}}}mount(){this.removePointerDownListener=rl(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 lc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function i0(t,a){return a.max===a.min?0:t/(a.max-a.min)*100}const Xo={correct:(t,a)=>{if(!a.target)return t;if(typeof t=="string")if(ye.test(t))t=parseFloat(t);else return t;const i=i0(t,a.target.x),o=i0(t,a.target.y);return`${i}% ${o}%`}},Aw={correct:(t,{treeScale:a,projectionDelta:i})=>{const o=t,r=ns.parse(t);if(r.length>5)return o;const u=ns.createTransformer(t),d=typeof r[0]!="number"?1:0,p=i.x.scale*a.x,m=i.y.scale*a.y;r[0+d]/=p,r[1+d]/=m;const g=ut(p,m,.5);return typeof r[2+d]=="number"&&(r[2+d]/=g),typeof r[3+d]=="number"&&(r[3+d]/=g),u(r)}};class Dw extends x.Component{componentDidMount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:o,layoutId:r}=this.props,{projection:u}=a;aN(Rw),u&&(i.group&&i.group.add(u),o&&o.register&&r&&o.register(u),u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,onExitComplete:()=>this.safeToRemove()})),lc.hasEverUpdated=!0}getSnapshotBeforeUpdate(a){const{layoutDependency:i,visualElement:o,drag:r,isPresent:u}=this.props,d=o.projection;return d&&(d.isPresent=u,r||a.layoutDependency!==i||i===void 0?d.willUpdate():this.safeToRemove(),a.isPresent!==u&&(u?d.promote():d.relegate()||lt.postRender(()=>{const p=d.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:a}=this.props.visualElement;a&&(a.root.didUpdate(),bh.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:o}=this.props,{projection:r}=a;r&&(r.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(r),o&&o.deregister&&o.deregister(r))}safeToRemove(){const{safeToRemove:a}=this.props;a&&a()}render(){return null}}function e_(t){const[a,i]=Ub(),o=x.useContext(fh);return c.jsx(Dw,{...t,layoutGroup:o,switchLayoutGroup:x.useContext(qb),isPresent:a,safeToRemove:i})}const Rw={borderRadius:{...Xo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Xo,borderTopRightRadius:Xo,borderBottomLeftRadius:Xo,borderBottomRightRadius:Xo,boxShadow:Aw};function Mw(t,a,i){const o=Pt(t)?t:vl(t);return o.start($h("",o,a,i)),o.animation}function Ow(t){return t instanceof SVGElement&&t.tagName!=="svg"}const Bw=(t,a)=>t.depth-a.depth;class Iw{constructor(){this.children=[],this.isDirty=!1}add(a){Ah(this.children,a),this.isDirty=!0}remove(a){Dh(this.children,a),this.isDirty=!0}forEach(a){this.isDirty&&this.children.sort(Bw),this.isDirty=!1,this.children.forEach(a)}}function Lw(t,a){const i=Xn.now(),o=({timestamp:r})=>{const u=r-i;u>=a&&(ts(o),t(u-a))};return lt.read(o,!0),()=>ts(o)}const t_=["TopLeft","TopRight","BottomLeft","BottomRight"],Uw=t_.length,o0=t=>typeof t=="string"?parseFloat(t):t,l0=t=>typeof t=="number"||ye.test(t);function zw(t,a,i,o,r,u){r?(t.opacity=ut(0,i.opacity!==void 0?i.opacity:1,Vw(o)),t.opacityExit=ut(a.opacity!==void 0?a.opacity:1,0,Hw(o))):u&&(t.opacity=ut(a.opacity!==void 0?a.opacity:1,i.opacity!==void 0?i.opacity:1,o));for(let d=0;d<Uw;d++){const p=`border${t_[d]}Radius`;let m=r0(a,p),g=r0(i,p);if(m===void 0&&g===void 0)continue;m||(m=0),g||(g=0),m===0||g===0||l0(m)===l0(g)?(t[p]=Math.max(ut(o0(m),o0(g),o),0),(Zn.test(g)||Zn.test(m))&&(t[p]+="%")):t[p]=g}(a.rotate||i.rotate)&&(t.rotate=ut(a.rotate||0,i.rotate||0,o))}function r0(t,a){return t[a]!==void 0?t[a]:t.borderRadius}const Vw=n_(0,.5,yx),Hw=n_(.5,.95,fn);function n_(t,a,i){return o=>o<t?0:o>a?1:i(Fi(t,a,o))}function c0(t,a){t.min=a.min,t.max=a.max}function Nn(t,a){c0(t.x,a.x),c0(t.y,a.y)}function u0(t,a){t.translate=a.translate,t.scale=a.scale,t.originPoint=a.originPoint,t.origin=a.origin}function d0(t,a,i,o,r){return t-=a,t=vc(t,1/i,o),r!==void 0&&(t=vc(t,1/r,o)),t}function Pw(t,a=0,i=1,o=.5,r,u=t,d=t){if(Zn.test(a)&&(a=parseFloat(a),a=ut(d.min,d.max,a/100)-d.min),typeof a!="number")return;let p=ut(u.min,u.max,o);t===u&&(p-=a),t.min=d0(t.min,a,i,p,r),t.max=d0(t.max,a,i,p,r)}function f0(t,a,[i,o,r],u,d){Pw(t,a[i],a[o],a[r],a.scale,u,d)}const Gw=["x","scaleX","originX"],$w=["y","scaleY","originY"];function h0(t,a,i,o){f0(t.x,a,Gw,i?i.x:void 0,o?o.x:void 0),f0(t.y,a,$w,i?i.y:void 0,o?o.y:void 0)}function p0(t){return t.translate===0&&t.scale===1}function a_(t){return p0(t.x)&&p0(t.y)}function m0(t,a){return t.min===a.min&&t.max===a.max}function Fw(t,a){return m0(t.x,a.x)&&m0(t.y,a.y)}function g0(t,a){return Math.round(t.min)===Math.round(a.min)&&Math.round(t.max)===Math.round(a.max)}function s_(t,a){return g0(t.x,a.x)&&g0(t.y,a.y)}function v0(t){return hn(t.x)/hn(t.y)}function y0(t,a){return t.translate===a.translate&&t.scale===a.scale&&t.originPoint===a.originPoint}class qw{constructor(){this.members=[]}add(a){Ah(this.members,a),a.scheduleRender()}remove(a){if(Dh(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 o;for(let r=i;r>=0;r--){const u=this.members[r];if(u.isPresent!==!1){o=u;break}}return o?(this.promote(o),!0):!1}promote(a,i){const o=this.lead;if(a!==o&&(this.prevLead=o,this.lead=a,a.show(),o)){o.instance&&o.scheduleRender(),a.scheduleRender(),a.resumeFrom=o,i&&(a.resumeFrom.preserveOpacity=!0),o.snapshot&&(a.snapshot=o.snapshot,a.snapshot.latestValues=o.animationValues||o.latestValues),a.root&&a.root.isUpdating&&(a.isLayoutDirty=!0);const{crossfade:r}=a.options;r===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(a=>{const{options:i,resumingFrom:o}=a;i.onExitComplete&&i.onExitComplete(),o&&o.options.onExitComplete&&o.options.onExitComplete()})}scheduleRender(){this.members.forEach(a=>{a.instance&&a.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Kw(t,a,i){let o="";const r=t.x.translate/a.x,u=t.y.translate/a.y,d=(i==null?void 0:i.z)||0;if((r||u||d)&&(o=`translate3d(${r}px, ${u}px, ${d}px) `),(a.x!==1||a.y!==1)&&(o+=`scale(${1/a.x}, ${1/a.y}) `),i){const{transformPerspective:g,rotate:v,rotateX:y,rotateY:b,skewX:S,skewY:T}=i;g&&(o=`perspective(${g}px) ${o}`),v&&(o+=`rotate(${v}deg) `),y&&(o+=`rotateX(${y}deg) `),b&&(o+=`rotateY(${b}deg) `),S&&(o+=`skewX(${S}deg) `),T&&(o+=`skewY(${T}deg) `)}const p=t.x.scale*a.x,m=t.y.scale*a.y;return(p!==1||m!==1)&&(o+=`scale(${p}, ${m})`),o||"none"}const As={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},tl=typeof window<"u"&&window.MotionDebug!==void 0,ff=["","X","Y","Z"],Yw={visibility:"hidden"},b0=1e3;let Zw=0;function hf(t,a,i,o){const{latestValues:r}=a;r[t]&&(i[t]=r[t],a.setStaticValue(t,0),o&&(o[t]=0))}function i_(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:a}=t.options;if(!a)return;const i=rx(a);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:r,layoutId:u}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",lt,!(r||u))}const{parent:o}=t;o&&!o.hasCheckedOptimisedAppear&&i_(o)}function o_({attachResizeListener:t,defaultParent:a,measureScroll:i,checkIsScrollRoot:o,resetTransform:r}){return class{constructor(d={},p=a==null?void 0:a()){this.id=Zw++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,tl&&(As.totalNodes=As.resolvedTargetDeltas=As.recalculatedProjection=0),this.nodes.forEach(Ww),this.nodes.forEach(aA),this.nodes.forEach(sA),this.nodes.forEach(Jw),tl&&window.MotionDebug.record(As)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=d,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 Iw)}addEventListener(d,p){return this.eventHandlers.has(d)||this.eventHandlers.set(d,new Rh),this.eventHandlers.get(d).add(p)}notifyListeners(d,...p){const m=this.eventHandlers.get(d);m&&m.notify(...p)}hasListeners(d){return this.eventHandlers.has(d)}mount(d,p=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Ow(d),this.instance=d;const{layoutId:m,layout:g,visualElement:v}=this.options;if(v&&!v.current&&v.mount(d),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),p&&(g||m)&&(this.isLayoutDirty=!0),t){let y;const b=()=>this.root.updateBlockedByResize=!1;t(d,()=>{this.root.updateBlockedByResize=!0,y&&y(),y=Lw(b,250),lc.hasAnimatedSinceResize&&(lc.hasAnimatedSinceResize=!1,this.nodes.forEach(_0))})}m&&this.root.registerSharedNode(m,this),this.options.animate!==!1&&v&&(m||g)&&this.addEventListener("didUpdate",({delta:y,hasLayoutChanged:b,hasRelativeTargetChanged:S,layout:T})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const E=this.options.transition||v.getDefaultTransition()||cA,{onLayoutAnimationStart:N,onLayoutAnimationComplete:C}=v.getProps(),j=!this.targetLayout||!s_(this.targetLayout,T)||S,D=!b&&S;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||D||b&&(j||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(y,D);const R={...wh(E,"layout"),onPlay:N,onComplete:C};(v.shouldReduceMotion||this.options.layoutRoot)&&(R.delay=0,R.type=!1),this.startAnimation(R)}else b||_0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=T})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const d=this.getStack();d&&d.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,ts(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(iA),this.animationId++)}getTransformTemplate(){const{visualElement:d}=this.options;return d&&d.getProps().transformTemplate}willUpdate(d=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&i_(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let v=0;v<this.path.length;v++){const y=this.path[v];y.shouldResetTransform=!0,y.updateScroll("snapshot"),y.options.layoutRoot&&y.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(),d&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(x0);return}this.isUpdating||this.nodes.forEach(tA),this.isUpdating=!1,this.nodes.forEach(nA),this.nodes.forEach(Xw),this.nodes.forEach(Qw),this.clearAllSnapshots();const p=Xn.now();Ut.delta=Sa(0,1e3/60,p-Ut.timestamp),Ut.timestamp=p,Ut.isProcessing=!0,af.update.process(Ut),af.preRender.process(Ut),af.render.process(Ut),Ut.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,bh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(eA),this.sharedNodes.forEach(oA)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,lt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){lt.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 d=this.layout;this.layout=this.measure(!1),this.layoutCorrected=vt(),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,d?d.layoutBox:void 0)}updateScroll(d="measure"){let p=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===d&&(p=!1),p){const m=o(this.instance);this.scroll={animationId:this.root.animationId,phase:d,isRoot:m,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!r)return;const d=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,p=this.projectionDelta&&!a_(this.projectionDelta),m=this.getTransformTemplate(),g=m?m(this.latestValues,""):void 0,v=g!==this.prevTransformTemplateValue;d&&(p||ws(this.latestValues)||v)&&(r(this.instance,g),this.shouldResetTransform=!1,this.scheduleRender())}measure(d=!0){const p=this.measurePageBox();let m=this.removeElementScroll(p);return d&&(m=this.removeTransform(m)),uA(m),{animationId:this.root.animationId,measuredBox:p,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:p}=this.options;if(!p)return vt();const m=p.measureViewportBox();if(!(((d=this.scroll)===null||d===void 0?void 0:d.wasRoot)||this.path.some(dA))){const{scroll:v}=this.root;v&&(Ui(m.x,v.offset.x),Ui(m.y,v.offset.y))}return m}removeElementScroll(d){var p;const m=vt();if(Nn(m,d),!((p=this.scroll)===null||p===void 0)&&p.wasRoot)return m;for(let g=0;g<this.path.length;g++){const v=this.path[g],{scroll:y,options:b}=v;v!==this.root&&y&&b.layoutScroll&&(y.wasRoot&&Nn(m,d),Ui(m.x,y.offset.x),Ui(m.y,y.offset.y))}return m}applyTransform(d,p=!1){const m=vt();Nn(m,d);for(let g=0;g<this.path.length;g++){const v=this.path[g];!p&&v.options.layoutScroll&&v.scroll&&v!==v.root&&zi(m,{x:-v.scroll.offset.x,y:-v.scroll.offset.y}),ws(v.latestValues)&&zi(m,v.latestValues)}return ws(this.latestValues)&&zi(m,this.latestValues),m}removeTransform(d){const p=vt();Nn(p,d);for(let m=0;m<this.path.length;m++){const g=this.path[m];if(!g.instance||!ws(g.latestValues))continue;Gf(g.latestValues)&&g.updateSnapshot();const v=vt(),y=g.measurePageBox();Nn(v,y),h0(p,g.latestValues,g.snapshot?g.snapshot.layoutBox:void 0,v)}return ws(this.latestValues)&&h0(p,this.latestValues),p}setTargetDelta(d){this.targetDelta=d,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(d){this.options={...this.options,...d,crossfade:d.crossfade!==void 0?d.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!==Ut.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(d=!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(!(d||g&&this.isSharedProjectionDirty||this.isProjectionDirty||!((p=this.parent)===null||p===void 0)&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:y,layoutId:b}=this.options;if(!(!this.layout||!(y||b))){if(this.resolvedRelativeTargetAt=Ut.timestamp,!this.targetDelta&&!this.relativeTarget){const S=this.getClosestProjectingParent();S&&S.layout&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=vt(),this.relativeTargetOrigin=vt(),ul(this.relativeTargetOrigin,this.layout.layoutBox,S.layout.layoutBox),Nn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=vt(),this.targetWithTransforms=vt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),pw(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Nn(this.target,this.layout.layoutBox),Qx(this.target,this.targetDelta)):Nn(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=vt(),this.relativeTargetOrigin=vt(),ul(this.relativeTargetOrigin,this.target,S.target),Nn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}tl&&As.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Gf(this.parent.latestValues)||Xx(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 d;const p=this.getLead(),m=!!this.resumingFrom||this!==p;let g=!0;if((this.isProjectionDirty||!((d=this.parent)===null||d===void 0)&&d.isProjectionDirty)&&(g=!1),m&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(g=!1),this.resolvedRelativeTargetAt===Ut.timestamp&&(g=!1),g)return;const{layout:v,layoutId:y}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(v||y))return;Nn(this.layoutCorrected,this.layout.layoutBox);const b=this.treeScale.x,S=this.treeScale.y;Tw(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=vt());const{target:T}=p;if(!T){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(u0(this.prevProjectionDelta.x,this.projectionDelta.x),u0(this.prevProjectionDelta.y,this.projectionDelta.y)),cl(this.projectionDelta,this.layoutCorrected,T,this.latestValues),(this.treeScale.x!==b||this.treeScale.y!==S||!y0(this.projectionDelta.x,this.prevProjectionDelta.x)||!y0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",T)),tl&&As.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(d=!0){var p;if((p=this.options.visualElement)===null||p===void 0||p.scheduleRender(),d){const m=this.getStack();m&&m.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Li(),this.projectionDelta=Li(),this.projectionDeltaWithTransform=Li()}setAnimationOrigin(d,p=!1){const m=this.snapshot,g=m?m.latestValues:{},v={...this.latestValues},y=Li();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const b=vt(),S=m?m.source:void 0,T=this.layout?this.layout.source:void 0,E=S!==T,N=this.getStack(),C=!N||N.members.length<=1,j=!!(E&&!C&&this.options.crossfade===!0&&!this.path.some(rA));this.animationProgress=0;let D;this.mixTargetDelta=R=>{const w=R/1e3;S0(y.x,d.x,w),S0(y.y,d.y,w),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ul(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox),lA(this.relativeTarget,this.relativeTargetOrigin,b,w),D&&Fw(this.relativeTarget,D)&&(this.isProjectionDirty=!1),D||(D=vt()),Nn(D,this.relativeTarget)),E&&(this.animationValues=v,zw(v,g,this.latestValues,w,j,C)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(d){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(ts(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=lt.update(()=>{lc.hasAnimatedSinceResize=!0,this.currentAnimation=Mw(0,b0,{...d,onUpdate:p=>{this.mixTargetDelta(p),d.onUpdate&&d.onUpdate(p)},onComplete:()=>{d.onComplete&&d.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 d=this.getStack();d&&d.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(b0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const d=this.getLead();let{targetWithTransforms:p,target:m,layout:g,latestValues:v}=d;if(!(!p||!m||!g)){if(this!==d&&this.layout&&g&&l_(this.options.animationType,this.layout.layoutBox,g.layoutBox)){m=this.target||vt();const y=hn(this.layout.layoutBox.x);m.x.min=d.target.x.min,m.x.max=m.x.min+y;const b=hn(this.layout.layoutBox.y);m.y.min=d.target.y.min,m.y.max=m.y.min+b}Nn(p,m),zi(p,v),cl(this.projectionDeltaWithTransform,this.layoutCorrected,p,v)}}registerSharedNode(d,p){this.sharedNodes.has(d)||this.sharedNodes.set(d,new qw),this.sharedNodes.get(d).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 d=this.getStack();return d?d.lead===this:!0}getLead(){var d;const{layoutId:p}=this.options;return p?((d=this.getStack())===null||d===void 0?void 0:d.lead)||this:this}getPrevLead(){var d;const{layoutId:p}=this.options;return p?(d=this.getStack())===null||d===void 0?void 0:d.prevLead:void 0}getStack(){const{layoutId:d}=this.options;if(d)return this.root.sharedNodes.get(d)}promote({needsReset:d,transition:p,preserveFollowOpacity:m}={}){const g=this.getStack();g&&g.promote(this,m),d&&(this.projectionDelta=void 0,this.needsReset=!0),p&&this.setOptions({transition:p})}relegate(){const d=this.getStack();return d?d.relegate(this):!1}resetSkewAndRotation(){const{visualElement:d}=this.options;if(!d)return;let p=!1;const{latestValues:m}=d;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(p=!0),!p)return;const g={};m.z&&hf("z",d,g,this.animationValues);for(let v=0;v<ff.length;v++)hf(`rotate${ff[v]}`,d,g,this.animationValues),hf(`skew${ff[v]}`,d,g,this.animationValues);d.render();for(const v in g)d.setStaticValue(v,g[v]),this.animationValues&&(this.animationValues[v]=g[v]);d.scheduleRender()}getProjectionStyles(d){var p,m;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Yw;const g={visibility:""},v=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,g.opacity="",g.pointerEvents=ic(d==null?void 0:d.pointerEvents)||"",g.transform=v?v(this.latestValues,""):"none",g;const y=this.getLead();if(!this.projectionDelta||!this.layout||!y.target){const E={};return this.options.layoutId&&(E.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,E.pointerEvents=ic(d==null?void 0:d.pointerEvents)||""),this.hasProjected&&!ws(this.latestValues)&&(E.transform=v?v({},""):"none",this.hasProjected=!1),E}const b=y.animationValues||y.latestValues;this.applyTransformsToTarget(),g.transform=Kw(this.projectionDeltaWithTransform,this.treeScale,b),v&&(g.transform=v(b,g.transform));const{x:S,y:T}=this.projectionDelta;g.transformOrigin=`${S.origin*100}% ${T.origin*100}% 0`,y.animationValues?g.opacity=y===this?(m=(p=b.opacity)!==null&&p!==void 0?p:this.latestValues.opacity)!==null&&m!==void 0?m:1:this.preserveOpacity?this.latestValues.opacity:b.opacityExit:g.opacity=y===this?b.opacity!==void 0?b.opacity:"":b.opacityExit!==void 0?b.opacityExit:0;for(const E in fc){if(b[E]===void 0)continue;const{correct:N,applyTo:C}=fc[E],j=g.transform==="none"?b[E]:N(b[E],y);if(C){const D=C.length;for(let R=0;R<D;R++)g[C[R]]=j}else g[E]=j}return this.options.layoutId&&(g.pointerEvents=y===this?ic(d==null?void 0:d.pointerEvents)||"":"none"),g}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(d=>{var p;return(p=d.currentAnimation)===null||p===void 0?void 0:p.stop()}),this.root.nodes.forEach(x0),this.root.sharedNodes.clear()}}}function Xw(t){t.updateLayout()}function Qw(t){var a;const i=((a=t.resumeFrom)===null||a===void 0?void 0:a.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&i&&t.hasListeners("didUpdate")){const{layoutBox:o,measuredBox:r}=t.layout,{animationType:u}=t.options,d=i.source!==t.layout.source;u==="size"?wn(y=>{const b=d?i.measuredBox[y]:i.layoutBox[y],S=hn(b);b.min=o[y].min,b.max=b.min+S}):l_(u,i.layoutBox,o)&&wn(y=>{const b=d?i.measuredBox[y]:i.layoutBox[y],S=hn(o[y]);b.max=b.min+S,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[y].max=t.relativeTarget[y].min+S)});const p=Li();cl(p,o,i.layoutBox);const m=Li();d?cl(m,t.applyTransform(r,!0),i.measuredBox):cl(m,o,i.layoutBox);const g=!a_(p);let v=!1;if(!t.resumeFrom){const y=t.getClosestProjectingParent();if(y&&!y.resumeFrom){const{snapshot:b,layout:S}=y;if(b&&S){const T=vt();ul(T,i.layoutBox,b.layoutBox);const E=vt();ul(E,o,S.layoutBox),s_(T,E)||(v=!0),y.options.layoutRoot&&(t.relativeTarget=E,t.relativeTargetOrigin=T,t.relativeParent=y)}}}t.notifyListeners("didUpdate",{layout:o,snapshot:i,delta:m,layoutDelta:p,hasLayoutChanged:g,hasRelativeTargetChanged:v})}else if(t.isLead()){const{onExitComplete:o}=t.options;o&&o()}t.options.transition=void 0}function Ww(t){tl&&As.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Jw(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function eA(t){t.clearSnapshot()}function x0(t){t.clearMeasurements()}function tA(t){t.isLayoutDirty=!1}function nA(t){const{visualElement:a}=t.options;a&&a.getProps().onBeforeLayoutMeasure&&a.notify("BeforeLayoutMeasure"),t.resetTransform()}function _0(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function aA(t){t.resolveTargetDelta()}function sA(t){t.calcProjection()}function iA(t){t.resetSkewAndRotation()}function oA(t){t.removeLeadSnapshot()}function S0(t,a,i){t.translate=ut(a.translate,0,i),t.scale=ut(a.scale,1,i),t.origin=a.origin,t.originPoint=a.originPoint}function T0(t,a,i,o){t.min=ut(a.min,i.min,o),t.max=ut(a.max,i.max,o)}function lA(t,a,i,o){T0(t.x,a.x,i.x,o),T0(t.y,a.y,i.y,o)}function rA(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const cA={duration:.45,ease:[.4,0,.1,1]},k0=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),C0=k0("applewebkit/")&&!k0("chrome/")?Math.round:fn;function E0(t){t.min=C0(t.min),t.max=C0(t.max)}function uA(t){E0(t.x),E0(t.y)}function l_(t,a,i){return t==="position"||t==="preserve-aspect"&&!hw(v0(a),v0(i),.2)}function dA(t){var a;return t!==t.root&&((a=t.scroll)===null||a===void 0?void 0:a.wasRoot)}const fA=o_({attachResizeListener:(t,a)=>bl(t,"resize",a),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),pf={current:void 0},r_=o_({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!pf.current){const t=new fA({});t.mount(window),t.setOptions({layoutScroll:!0}),pf.current=t}return pf.current},resetTransform:(t,a)=>{t.style.transform=a!==void 0?a:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),hA={pan:{Feature:ww},drag:{Feature:jw,ProjectionNode:r_,MeasureLayout:e_}};function pA(t,a,i){var o;if(t instanceof Element)return[t];if(typeof t=="string"){let r=document;const u=(o=void 0)!==null&&o!==void 0?o:r.querySelectorAll(t);return u?Array.from(u):[]}return Array.from(t)}function c_(t,a){const i=pA(t),o=new AbortController,r={passive:!0,...a,signal:o.signal};return[i,r,()=>o.abort()]}function N0(t){return a=>{a.pointerType==="touch"||$x()||t(a)}}function mA(t,a,i={}){const[o,r,u]=c_(t,i),d=N0(p=>{const{target:m}=p,g=a(p);if(typeof g!="function"||!m)return;const v=N0(y=>{g(y),m.removeEventListener("pointerleave",v)});m.addEventListener("pointerleave",v,r)});return o.forEach(p=>{p.addEventListener("pointerenter",d,r)}),u}function j0(t,a,i){const{props:o}=t;t.animationState&&o.whileHover&&t.animationState.setActive("whileHover",i==="Start");const r="onHover"+i,u=o[r];u&&lt.postRender(()=>u(a,El(a)))}class gA extends is{mount(){const{current:a}=this.node;a&&(this.unmount=mA(a,i=>(j0(this.node,i,"Start"),o=>j0(this.node,o,"End"))))}unmount(){}}class vA extends is{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=Cl(bl(this.node.current,"focus",()=>this.onFocus()),bl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const u_=(t,a)=>a?t===a?!0:u_(t,a.parentElement):!1,yA=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function bA(t){return yA.has(t.tagName)||t.tabIndex!==-1}const nl=new WeakSet;function w0(t){return a=>{a.key==="Enter"&&t(a)}}function mf(t,a){t.dispatchEvent(new PointerEvent("pointer"+a,{isPrimary:!0,bubbles:!0}))}const xA=(t,a)=>{const i=t.currentTarget;if(!i)return;const o=w0(()=>{if(nl.has(i))return;mf(i,"down");const r=w0(()=>{mf(i,"up")}),u=()=>mf(i,"cancel");i.addEventListener("keyup",r,a),i.addEventListener("blur",u,a)});i.addEventListener("keydown",o,a),i.addEventListener("blur",()=>i.removeEventListener("keydown",o),a)};function A0(t){return Fh(t)&&!$x()}function _A(t,a,i={}){const[o,r,u]=c_(t,i),d=p=>{const m=p.currentTarget;if(!A0(p)||nl.has(m))return;nl.add(m);const g=a(p),v=(S,T)=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",b),!(!A0(S)||!nl.has(m))&&(nl.delete(m),typeof g=="function"&&g(S,{success:T}))},y=S=>{v(S,i.useGlobalTarget||u_(m,S.target))},b=S=>{v(S,!1)};window.addEventListener("pointerup",y,r),window.addEventListener("pointercancel",b,r)};return o.forEach(p=>{!bA(p)&&p.getAttribute("tabindex")===null&&(p.tabIndex=0),(i.useGlobalTarget?window:p).addEventListener("pointerdown",d,r),p.addEventListener("focus",g=>xA(g,r),r)}),u}function D0(t,a,i){const{props:o}=t;t.animationState&&o.whileTap&&t.animationState.setActive("whileTap",i==="Start");const r="onTap"+(i==="End"?"":i),u=o[r];u&&lt.postRender(()=>u(a,El(a)))}class SA extends is{mount(){const{current:a}=this.node;a&&(this.unmount=_A(a,i=>(D0(this.node,i,"Start"),(o,{success:r})=>D0(this.node,o,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ff=new WeakMap,gf=new WeakMap,TA=t=>{const a=Ff.get(t.target);a&&a(t)},kA=t=>{t.forEach(TA)};function CA({root:t,...a}){const i=t||document;gf.has(i)||gf.set(i,{});const o=gf.get(i),r=JSON.stringify(a);return o[r]||(o[r]=new IntersectionObserver(kA,{root:t,...a})),o[r]}function EA(t,a,i){const o=CA(a);return Ff.set(t,i),o.observe(t),()=>{Ff.delete(t),o.unobserve(t)}}const NA={some:0,all:1};class jA extends is{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:a={}}=this.node.getProps(),{root:i,margin:o,amount:r="some",once:u}=a,d={root:i?i.current:void 0,rootMargin:o,threshold:typeof r=="number"?r:NA[r]},p=m=>{const{isIntersecting:g}=m;if(this.isInView===g||(this.isInView=g,u&&!g&&this.hasEnteredView))return;g&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",g);const{onViewportEnter:v,onViewportLeave:y}=this.node.getProps(),b=g?v:y;b&&b(m)};return EA(this.node.current,d,p)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:a,prevProps:i}=this.node;["amount","margin","root"].some(wA(a,i))&&this.startObserver()}unmount(){}}function wA({viewport:t={}},{viewport:a={}}={}){return i=>t[i]!==a[i]}const AA={inView:{Feature:jA},tap:{Feature:SA},focus:{Feature:vA},hover:{Feature:gA}},DA={layout:{ProjectionNode:r_,MeasureLayout:e_}},yc={current:null},qh={current:!1};function d_(){if(qh.current=!0,!!mh)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),a=()=>yc.current=t.matches;t.addListener(a),a()}else yc.current=!1}const RA=[...Rx,Ht,ns],MA=t=>RA.find(Dx(t)),R0=new WeakMap;function OA(t,a,i){for(const o in a){const r=a[o],u=i[o];if(Pt(r))t.addValue(o,r);else if(Pt(u))t.addValue(o,vl(r,{owner:t}));else if(u!==r)if(t.hasValue(o)){const d=t.getValue(o);d.liveStyle===!0?d.jump(r):d.hasAnimated||d.set(r)}else{const d=t.getStaticValue(o);t.addValue(o,vl(d!==void 0?d:r,{owner:t}))}}for(const o in i)a[o]===void 0&&t.removeValue(o);return a}const M0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class BA{scrapeMotionValuesFromProps(a,i,o){return{}}constructor({parent:a,props:i,presenceContext:o,reducedMotionConfig:r,blockInitialAnimation:u,visualState:d},p={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Hh,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=Xn.now();this.renderScheduledAt<S&&(this.renderScheduledAt=S,lt.render(this.render,!1,!0))};const{latestValues:m,renderState:g,onUpdate:v}=d;this.onUpdate=v,this.latestValues=m,this.baseTarget={...m},this.initialValues=i.initial?{...m}:{},this.renderState=g,this.parent=a,this.props=i,this.presenceContext=o,this.depth=a?a.depth+1:0,this.reducedMotionConfig=r,this.options=p,this.blockInitialAnimation=!!u,this.isControllingVariants=Dc(i),this.isVariantNode=$b(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(a&&a.current);const{willChange:y,...b}=this.scrapeMotionValuesFromProps(i,{},this);for(const S in b){const T=b[S];m[S]!==void 0&&Pt(T)&&T.set(m[S],!1)}}mount(a){this.current=a,R0.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,o)=>this.bindToMotionValue(o,i)),qh.current||d_(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:yc.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){R0.delete(this.current),this.projection&&this.projection.unmount(),ts(this.notifyUpdate),ts(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 o=zs.has(a),r=i.on("change",p=>{this.latestValues[a]=p,this.props.onUpdate&&lt.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0)}),u=i.on("renderRequest",this.scheduleRender);let d;window.MotionCheckAppearSync&&(d=window.MotionCheckAppearSync(this,a,i)),this.valueSubscriptions.set(a,()=>{r(),u(),d&&d(),i.owner&&i.stop()})}sortNodePosition(a){return!this.current||!this.sortInstanceNodePosition||this.type!==a.type?0:this.sortInstanceNodePosition(this.current,a.current)}updateFeatures(){let a="animation";for(a in $i){const i=$i[a];if(!i)continue;const{isEnabled:o,Feature:r}=i;if(!this.features[a]&&r&&o(this.props)&&(this.features[a]=new r(this)),this.features[a]){const u=this.features[a];u.isMounted?u.update():(u.mount(),u.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):vt()}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 o=0;o<M0.length;o++){const r=M0[o];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const u="on"+r,d=a[u];d&&(this.propEventSubscriptions[r]=this.on(r,d))}this.prevMotionValues=OA(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 o=this.values.get(a);i!==o&&(o&&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 o=this.values.get(a);return o===void 0&&i!==void 0&&(o=vl(i===null?void 0:i,{owner:this}),this.addValue(a,o)),o}readValue(a,i){var o;let r=this.latestValues[a]!==void 0||!this.current?this.latestValues[a]:(o=this.getBaseTargetFromProps(this.props,a))!==null&&o!==void 0?o:this.readValueFromInstance(this.current,a,this.options);return r!=null&&(typeof r=="string"&&(wx(r)||xx(r))?r=parseFloat(r):!MA(r)&&ns.test(i)&&(r=Ex(a,i)),this.setBaseTarget(a,Pt(r)?r.get():r)),Pt(r)?r.get():r}setBaseTarget(a,i){this.baseTarget[a]=i}getBaseTarget(a){var i;const{initial:o}=this.props;let r;if(typeof o=="string"||typeof o=="object"){const d=_h(this.props,o,(i=this.presenceContext)===null||i===void 0?void 0:i.custom);d&&(r=d[a])}if(o&&r!==void 0)return r;const u=this.getBaseTargetFromProps(this.props,a);return u!==void 0&&!Pt(u)?u:this.initialValues[a]!==void 0&&r===void 0?void 0:this.baseTarget[a]}on(a,i){return this.events[a]||(this.events[a]=new Rh),this.events[a].add(i)}notify(a,...i){this.events[a]&&this.events[a].notify(...i)}}class f_ extends BA{constructor(){super(...arguments),this.KeyframeResolver=Mx}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:o}){delete i[a],delete o[a]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:a}=this.props;Pt(a)&&(this.childSubscription=a.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}function IA(t){return window.getComputedStyle(t)}class LA extends f_{constructor(){super(...arguments),this.type="html",this.renderInstance=Jb}readValueFromInstance(a,i){if(zs.has(i)){const o=Vh(i);return o&&o.default||0}else{const o=IA(a),r=(Xb(i)?o.getPropertyValue(i):o[i])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(a,{transformPagePoint:i}){return Wx(a,i)}build(a,i,o){kh(a,i,o.transformTemplate)}scrapeMotionValuesFromProps(a,i,o){return jh(a,i,o)}}class UA extends f_{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=vt}getBaseTargetFromProps(a,i){return a[i]}readValueFromInstance(a,i){if(zs.has(i)){const o=Vh(i);return o&&o.default||0}return i=ex.has(i)?i:yh(i),a.getAttribute(i)}scrapeMotionValuesFromProps(a,i,o){return ax(a,i,o)}build(a,i,o){Ch(a,i,this.isSVGTag,o.transformTemplate)}renderInstance(a,i,o,r){tx(a,i,o,r)}mount(a){this.isSVGTag=Nh(a.tagName),super.mount(a)}}const zA=(t,a)=>xh(t)?new UA(a):new LA(a,{allowProjection:t!==x.Fragment}),VA=fN({...aw,...AA,...hA,...DA},zA),Ct=NE(VA);function HA(){!qh.current&&d_();const[t]=x.useState(yc.current);return t}var et;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TEXT=1]="TEXT",t[t.TOOL_USE=2]="TOOL_USE",t[t.TOOL_RESULT=3]="TOOL_RESULT",t[t.ERROR=4]="ERROR",t[t.STATUS=5]="STATUS",t[t.SYSTEM=6]="SYSTEM",t[t.FINDING=7]="FINDING",t[t.SUBTASK_CREATE=8]="SUBTASK_CREATE",t[t.USER_INPUT=9]="USER_INPUT",t[t.SIGNAL=10]="SIGNAL",t[t.USAGE=11]="USAGE"})(et||(et={}));var kt;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.NOT_STARTED=1]="NOT_STARTED",t[t.WORKING=3]="WORKING",t[t.PAUSED=4]="PAUSED",t[t.COMPLETE=5]="COMPLETE",t[t.FAILED=6]="FAILED"})(kt||(kt={}));var Wa;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.ACTIVE=1]="ACTIVE",t[t.ARCHIVED=2]="ARCHIVED"})(Wa||(Wa={}));var Ja;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.OPEN=1]="OPEN",t[t.CLOSED=2]="CLOSED"})(Ja||(Ja={}));var Fn;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.OFF=1]="OFF",t[t.SUBSCRIPTION=2]="SUBSCRIPTION",t[t.API_KEY=3]="API_KEY"})(Fn||(Fn={}));var es;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.OFF=1]="OFF",t[t.ON=2]="ON"})(es||(es={}));const PA=8,O0="system",Qo="system";Object.assign(Object.create(null),{"":et.UNSPECIFIED,text:et.TEXT,tool_use:et.TOOL_USE,tool_result:et.TOOL_RESULT,error:et.ERROR,status:et.STATUS,system:et.SYSTEM,finding:et.FINDING,subtask_create:et.SUBTASK_CREATE,user_input:et.USER_INPUT,signal:et.SIGNAL,usage:et.USAGE});et.UNSPECIFIED+"",et.TEXT+"",et.TOOL_USE+"",et.TOOL_RESULT+"",et.ERROR+"",et.STATUS+"",et.SYSTEM+"",et.FINDING+"",et.SUBTASK_CREATE+"",et.USER_INPUT+"",et.SIGNAL+"",et.USAGE+"";Object.assign(Object.create(null),{"":kt.UNSPECIFIED,not_started:kt.NOT_STARTED,working:kt.WORKING,paused:kt.PAUSED,complete:kt.COMPLETE,failed:kt.FAILED,pending:kt.NOT_STARTED,assigned:kt.NOT_STARTED,in_progress:kt.WORKING,waiting_input:kt.PAUSED,review:kt.PAUSED,done:kt.COMPLETE});kt.UNSPECIFIED+"",kt.NOT_STARTED+"",kt.WORKING+"",kt.PAUSED+"",kt.COMPLETE+"",kt.FAILED+"";Object.assign(Object.create(null),{"":Wa.UNSPECIFIED,active:Wa.ACTIVE,archived:Wa.ARCHIVED});Wa.UNSPECIFIED+"",Wa.ACTIVE+"",Wa.ARCHIVED+"";Object.assign(Object.create(null),{"":Ja.UNSPECIFIED,open:Ja.OPEN,closed:Ja.CLOSED});Ja.UNSPECIFIED+"",Ja.OPEN+"",Ja.CLOSED+"";Object.assign(Object.create(null),{"":Fn.UNSPECIFIED,off:Fn.OFF,subscription:Fn.SUBSCRIPTION,api_key:Fn.API_KEY});Fn.UNSPECIFIED+"",Fn.OFF+"",Fn.SUBSCRIPTION+"",Fn.API_KEY+"";Object.assign(Object.create(null),{"":es.UNSPECIFIED,off:es.OFF,on:es.ON});es.UNSPECIFIED+"",es.OFF+"",es.ON+"";function Ta(t){return Array.isArray?Array.isArray(t):m_(t)==="[object Array]"}function GA(t){if(typeof t=="string")return t;let a=t+"";return a=="0"&&1/t==-1/0?"-0":a}function $A(t){return t==null?"":GA(t)}function qn(t){return typeof t=="string"}function h_(t){return typeof t=="number"}function FA(t){return t===!0||t===!1||qA(t)&&m_(t)=="[object Boolean]"}function p_(t){return typeof t=="object"}function qA(t){return p_(t)&&t!==null}function dn(t){return t!=null}function vf(t){return!t.trim().length}function m_(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const KA="Incorrect 'index' type",YA=t=>`Invalid value for key ${t}`,ZA=t=>`Pattern length exceeds max of ${t}.`,XA=t=>`Missing ${t} property in key`,QA=t=>`Property 'weight' in key '${t}' must be a positive integer`,B0=Object.prototype.hasOwnProperty;class WA{constructor(a){this._keys=[],this._keyMap={};let i=0;a.forEach(o=>{let r=g_(o);this._keys.push(r),this._keyMap[r.id]=r,i+=r.weight}),this._keys.forEach(o=>{o.weight/=i})}get(a){return this._keyMap[a]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function g_(t){let a=null,i=null,o=null,r=1,u=null;if(qn(t)||Ta(t))o=t,a=I0(t),i=qf(t);else{if(!B0.call(t,"name"))throw new Error(XA("name"));const d=t.name;if(o=d,B0.call(t,"weight")&&(r=t.weight,r<=0))throw new Error(QA(d));a=I0(d),i=qf(d),u=t.getFn}return{path:a,id:i,weight:r,src:o,getFn:u}}function I0(t){return Ta(t)?t:t.split(".")}function qf(t){return Ta(t)?t.join("."):t}function JA(t,a){let i=[],o=!1;const r=(u,d,p)=>{if(dn(u))if(!d[p])i.push(u);else{let m=d[p];const g=u[m];if(!dn(g))return;if(p===d.length-1&&(qn(g)||h_(g)||FA(g)))i.push($A(g));else if(Ta(g)){o=!0;for(let v=0,y=g.length;v<y;v+=1)r(g[v],d,p+1)}else d.length&&r(g,d,p+1)}};return r(t,qn(a)?a.split("."):a,0),o?i:i[0]}const e2={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},t2={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,a)=>t.score===a.score?t.idx<a.idx?-1:1:t.score<a.score?-1:1},n2={location:0,threshold:.6,distance:100},a2={useExtendedSearch:!1,getFn:JA,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var be={...t2,...e2,...n2,...a2};const s2=/[^ ]+/g;function i2(t=1,a=3){const i=new Map,o=Math.pow(10,a);return{get(r){const u=r.match(s2).length;if(i.has(u))return i.get(u);const d=1/Math.pow(u,.5*t),p=parseFloat(Math.round(d*o)/o);return i.set(u,p),p},clear(){i.clear()}}}class Kh{constructor({getFn:a=be.getFn,fieldNormWeight:i=be.fieldNormWeight}={}){this.norm=i2(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,o)=>{this._keysMap[i.id]=o})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,qn(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();qn(a)?this._addString(a,i):this._addObject(a,i)}removeAt(a){this.records.splice(a,1);for(let i=a,o=this.size();i<o;i+=1)this.records[i].i-=1}getValueForItemAtKeyId(a,i){return a[this._keysMap[i]]}size(){return this.records.length}_addString(a,i){if(!dn(a)||vf(a))return;let o={v:a,i,n:this.norm.get(a)};this.records.push(o)}_addObject(a,i){let o={i,$:{}};this.keys.forEach((r,u)=>{let d=r.getFn?r.getFn(a):this.getFn(a,r.path);if(dn(d)){if(Ta(d)){let p=[];const m=[{nestedArrIndex:-1,value:d}];for(;m.length;){const{nestedArrIndex:g,value:v}=m.pop();if(dn(v))if(qn(v)&&!vf(v)){let y={v,i:g,n:this.norm.get(v)};p.push(y)}else Ta(v)&&v.forEach((y,b)=>{m.push({nestedArrIndex:b,value:y})})}o.$[u]=p}else if(qn(d)&&!vf(d)){let p={v:d,n:this.norm.get(d)};o.$[u]=p}}}),this.records.push(o)}toJSON(){return{keys:this.keys,records:this.records}}}function v_(t,a,{getFn:i=be.getFn,fieldNormWeight:o=be.fieldNormWeight}={}){const r=new Kh({getFn:i,fieldNormWeight:o});return r.setKeys(t.map(g_)),r.setSources(a),r.create(),r}function o2(t,{getFn:a=be.getFn,fieldNormWeight:i=be.fieldNormWeight}={}){const{keys:o,records:r}=t,u=new Kh({getFn:a,fieldNormWeight:i});return u.setKeys(o),u.setIndexRecords(r),u}function Qr(t,{errors:a=0,currentLocation:i=0,expectedLocation:o=0,distance:r=be.distance,ignoreLocation:u=be.ignoreLocation}={}){const d=a/t.length;if(u)return d;const p=Math.abs(o-i);return r?d+p/r:p?1:d}function l2(t=[],a=be.minMatchCharLength){let i=[],o=-1,r=-1,u=0;for(let d=t.length;u<d;u+=1){let p=t[u];p&&o===-1?o=u:!p&&o!==-1&&(r=u-1,r-o+1>=a&&i.push([o,r]),o=-1)}return t[u-1]&&u-o>=a&&i.push([o,u-1]),i}const Ds=32;function r2(t,a,i,{location:o=be.location,distance:r=be.distance,threshold:u=be.threshold,findAllMatches:d=be.findAllMatches,minMatchCharLength:p=be.minMatchCharLength,includeMatches:m=be.includeMatches,ignoreLocation:g=be.ignoreLocation}={}){if(a.length>Ds)throw new Error(ZA(Ds));const v=a.length,y=t.length,b=Math.max(0,Math.min(o,y));let S=u,T=b;const E=p>1||m,N=E?Array(y):[];let C;for(;(C=t.indexOf(a,T))>-1;){let H=Qr(a,{currentLocation:C,expectedLocation:b,distance:r,ignoreLocation:g});if(S=Math.min(H,S),T=C+v,E){let B=0;for(;B<v;)N[C+B]=1,B+=1}}T=-1;let j=[],D=1,R=v+y;const w=1<<v-1;for(let H=0;H<v;H+=1){let B=0,q=R;for(;B<q;)Qr(a,{errors:H,currentLocation:b+q,expectedLocation:b,distance:r,ignoreLocation:g})<=S?B=q:R=q,q=Math.floor((R-B)/2+B);R=q;let X=Math.max(1,b-q+1),ae=d?y:Math.min(b+q,y)+v,te=Array(ae+2);te[ae+1]=(1<<H)-1;for(let z=ae;z>=X;z-=1){let ne=z-1,I=i[t.charAt(ne)];if(E&&(N[ne]=+!!I),te[z]=(te[z+1]<<1|1)&I,H&&(te[z]|=(j[z+1]|j[z])<<1|1|j[z+1]),te[z]&w&&(D=Qr(a,{errors:H,currentLocation:ne,expectedLocation:b,distance:r,ignoreLocation:g}),D<=S)){if(S=D,T=ne,T<=b)break;X=Math.max(1,2*b-T)}}if(Qr(a,{errors:H+1,currentLocation:b,expectedLocation:b,distance:r,ignoreLocation:g})>S)break;j=te}const F={isMatch:T>=0,score:Math.max(.001,D)};if(E){const H=l2(N,p);H.length?m&&(F.indices=H):F.isMatch=!1}return F}function c2(t){let a={};for(let i=0,o=t.length;i<o;i+=1){const r=t.charAt(i);a[r]=(a[r]||0)|1<<o-i-1}return a}const bc=String.prototype.normalize?(t=>t.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,"")):(t=>t);class y_{constructor(a,{location:i=be.location,threshold:o=be.threshold,distance:r=be.distance,includeMatches:u=be.includeMatches,findAllMatches:d=be.findAllMatches,minMatchCharLength:p=be.minMatchCharLength,isCaseSensitive:m=be.isCaseSensitive,ignoreDiacritics:g=be.ignoreDiacritics,ignoreLocation:v=be.ignoreLocation}={}){if(this.options={location:i,threshold:o,distance:r,includeMatches:u,findAllMatches:d,minMatchCharLength:p,isCaseSensitive:m,ignoreDiacritics:g,ignoreLocation:v},a=m?a:a.toLowerCase(),a=g?bc(a):a,this.pattern=a,this.chunks=[],!this.pattern.length)return;const y=(S,T)=>{this.chunks.push({pattern:S,alphabet:c2(S),startIndex:T})},b=this.pattern.length;if(b>Ds){let S=0;const T=b%Ds,E=b-T;for(;S<E;)y(this.pattern.substr(S,Ds),S),S+=Ds;if(T){const N=b-Ds;y(this.pattern.substr(N),N)}}else y(this.pattern,0)}searchIn(a){const{isCaseSensitive:i,ignoreDiacritics:o,includeMatches:r}=this.options;if(a=i?a:a.toLowerCase(),a=o?bc(a):a,this.pattern===a){let E={isMatch:!0,score:0};return r&&(E.indices=[[0,a.length-1]]),E}const{location:u,distance:d,threshold:p,findAllMatches:m,minMatchCharLength:g,ignoreLocation:v}=this.options;let y=[],b=0,S=!1;this.chunks.forEach(({pattern:E,alphabet:N,startIndex:C})=>{const{isMatch:j,score:D,indices:R}=r2(a,E,N,{location:u+C,distance:d,threshold:p,findAllMatches:m,minMatchCharLength:g,includeMatches:r,ignoreLocation:v});j&&(S=!0),b+=D,j&&R&&(y=[...y,...R])});let T={isMatch:S,score:S?b/this.chunks.length:1};return S&&r&&(T.indices=y),T}}class os{constructor(a){this.pattern=a}static isMultiMatch(a){return L0(a,this.multiRegex)}static isSingleMatch(a){return L0(a,this.singleRegex)}search(){}}function L0(t,a){const i=t.match(a);return i?i[1]:null}class u2 extends os{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 d2 extends os{constructor(a){super(a)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(a){const o=a.indexOf(this.pattern)===-1;return{isMatch:o,score:o?0:1,indices:[0,a.length-1]}}}class f2 extends os{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 h2 extends os{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 p2 extends os{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 m2 extends os{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 b_ extends os{constructor(a,{location:i=be.location,threshold:o=be.threshold,distance:r=be.distance,includeMatches:u=be.includeMatches,findAllMatches:d=be.findAllMatches,minMatchCharLength:p=be.minMatchCharLength,isCaseSensitive:m=be.isCaseSensitive,ignoreDiacritics:g=be.ignoreDiacritics,ignoreLocation:v=be.ignoreLocation}={}){super(a),this._bitapSearch=new y_(a,{location:i,threshold:o,distance:r,includeMatches:u,findAllMatches:d,minMatchCharLength:p,isCaseSensitive:m,ignoreDiacritics:g,ignoreLocation:v})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(a){return this._bitapSearch.searchIn(a)}}class x_ extends os{constructor(a){super(a)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(a){let i=0,o;const r=[],u=this.pattern.length;for(;(o=a.indexOf(this.pattern,i))>-1;)i=o+u,r.push([o,i-1]);const d=!!r.length;return{isMatch:d,score:d?0:1,indices:r}}}const Kf=[u2,x_,f2,h2,m2,p2,d2,b_],U0=Kf.length,g2=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,v2="|";function y2(t,a={}){return t.split(v2).map(i=>{let o=i.trim().split(g2).filter(u=>u&&!!u.trim()),r=[];for(let u=0,d=o.length;u<d;u+=1){const p=o[u];let m=!1,g=-1;for(;!m&&++g<U0;){const v=Kf[g];let y=v.isMultiMatch(p);y&&(r.push(new v(y,a)),m=!0)}if(!m)for(g=-1;++g<U0;){const v=Kf[g];let y=v.isSingleMatch(p);if(y){r.push(new v(y,a));break}}}return r})}const b2=new Set([b_.type,x_.type]);class x2{constructor(a,{isCaseSensitive:i=be.isCaseSensitive,ignoreDiacritics:o=be.ignoreDiacritics,includeMatches:r=be.includeMatches,minMatchCharLength:u=be.minMatchCharLength,ignoreLocation:d=be.ignoreLocation,findAllMatches:p=be.findAllMatches,location:m=be.location,threshold:g=be.threshold,distance:v=be.distance}={}){this.query=null,this.options={isCaseSensitive:i,ignoreDiacritics:o,includeMatches:r,minMatchCharLength:u,findAllMatches:p,ignoreLocation:d,location:m,threshold:g,distance:v},a=i?a:a.toLowerCase(),a=o?bc(a):a,this.pattern=a,this.query=y2(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:o,isCaseSensitive:r,ignoreDiacritics:u}=this.options;a=r?a:a.toLowerCase(),a=u?bc(a):a;let d=0,p=[],m=0;for(let g=0,v=i.length;g<v;g+=1){const y=i[g];p.length=0,d=0;for(let b=0,S=y.length;b<S;b+=1){const T=y[b],{isMatch:E,indices:N,score:C}=T.search(a);if(E){if(d+=1,m+=C,o){const j=T.constructor.type;b2.has(j)?p=[...p,...N]:p.push(N)}}else{m=0,d=0,p.length=0;break}}if(d){let b={isMatch:!0,score:m/d};return o&&(b.indices=p),b}}return{isMatch:!1,score:1}}}const Yf=[];function _2(...t){Yf.push(...t)}function Zf(t,a){for(let i=0,o=Yf.length;i<o;i+=1){let r=Yf[i];if(r.condition(t,a))return new r(t,a)}return new y_(t,a)}const xc={AND:"$and",OR:"$or"},Xf={PATH:"$path",PATTERN:"$val"},Qf=t=>!!(t[xc.AND]||t[xc.OR]),S2=t=>!!t[Xf.PATH],T2=t=>!Ta(t)&&p_(t)&&!Qf(t),z0=t=>({[xc.AND]:Object.keys(t).map(a=>({[a]:t[a]}))});function __(t,a,{auto:i=!0}={}){const o=r=>{let u=Object.keys(r);const d=S2(r);if(!d&&u.length>1&&!Qf(r))return o(z0(r));if(T2(r)){const m=d?r[Xf.PATH]:u[0],g=d?r[Xf.PATTERN]:r[m];if(!qn(g))throw new Error(YA(m));const v={keyId:qf(m),pattern:g};return i&&(v.searcher=Zf(g,a)),v}let p={children:[],operator:u[0]};return u.forEach(m=>{const g=r[m];Ta(g)&&g.forEach(v=>{p.children.push(o(v))})}),p};return Qf(t)||(t=z0(t)),o(t)}function k2(t,{ignoreFieldNorm:a=be.ignoreFieldNorm}){t.forEach(i=>{let o=1;i.matches.forEach(({key:r,norm:u,score:d})=>{const p=r?r.weight:null;o*=Math.pow(d===0&&p?Number.EPSILON:d,(p||1)*(a?1:u))}),i.score=o})}function C2(t,a){const i=t.matches;a.matches=[],dn(i)&&i.forEach(o=>{if(!dn(o.indices)||!o.indices.length)return;const{indices:r,value:u}=o;let d={indices:r,value:u};o.key&&(d.key=o.key.src),o.idx>-1&&(d.refIndex=o.idx),a.matches.push(d)})}function E2(t,a){a.score=t.score}function N2(t,a,{includeMatches:i=be.includeMatches,includeScore:o=be.includeScore}={}){const r=[];return i&&r.push(C2),o&&r.push(E2),t.map(u=>{const{idx:d}=u,p={item:a[d],refIndex:d};return r.length&&r.forEach(m=>{m(u,p)}),p})}class Ji{constructor(a,i={},o){this.options={...be,...i},this.options.useExtendedSearch,this._keyStore=new WA(this.options.keys),this.setCollection(a,o)}setCollection(a,i){if(this._docs=a,i&&!(i instanceof Kh))throw new Error(KA);this._myIndex=i||v_(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(a){dn(a)&&(this._docs.push(a),this._myIndex.add(a))}remove(a=()=>!1){const i=[];for(let o=0,r=this._docs.length;o<r;o+=1){const u=this._docs[o];a(u,o)&&(this.removeAt(o),o-=1,r-=1,i.push(u))}return i}removeAt(a){this._docs.splice(a,1),this._myIndex.removeAt(a)}getIndex(){return this._myIndex}search(a,{limit:i=-1}={}){const{includeMatches:o,includeScore:r,shouldSort:u,sortFn:d,ignoreFieldNorm:p}=this.options;let m=qn(a)?qn(this._docs[0])?this._searchStringList(a):this._searchObjectList(a):this._searchLogical(a);return k2(m,{ignoreFieldNorm:p}),u&&m.sort(d),h_(i)&&i>-1&&(m=m.slice(0,i)),N2(m,this._docs,{includeMatches:o,includeScore:r})}_searchStringList(a){const i=Zf(a,this.options),{records:o}=this._myIndex,r=[];return o.forEach(({v:u,i:d,n:p})=>{if(!dn(u))return;const{isMatch:m,score:g,indices:v}=i.searchIn(u);m&&r.push({item:u,idx:d,matches:[{score:g,value:u,norm:p,indices:v}]})}),r}_searchLogical(a){const i=__(a,this.options),o=(p,m,g)=>{if(!p.children){const{keyId:y,searcher:b}=p,S=this._findMatches({key:this._keyStore.get(y),value:this._myIndex.getValueForItemAtKeyId(m,y),searcher:b});return S&&S.length?[{idx:g,item:m,matches:S}]:[]}const v=[];for(let y=0,b=p.children.length;y<b;y+=1){const S=p.children[y],T=o(S,m,g);if(T.length)v.push(...T);else if(p.operator===xc.AND)return[]}return v},r=this._myIndex.records,u={},d=[];return r.forEach(({$:p,i:m})=>{if(dn(p)){let g=o(i,p,m);g.length&&(u[m]||(u[m]={idx:m,item:p,matches:[]},d.push(u[m])),g.forEach(({matches:v})=>{u[m].matches.push(...v)}))}}),d}_searchObjectList(a){const i=Zf(a,this.options),{keys:o,records:r}=this._myIndex,u=[];return r.forEach(({$:d,i:p})=>{if(!dn(d))return;let m=[];o.forEach((g,v)=>{m.push(...this._findMatches({key:g,value:d[v],searcher:i}))}),m.length&&u.push({idx:p,item:d,matches:m})}),u}_findMatches({key:a,value:i,searcher:o}){if(!dn(i))return[];let r=[];if(Ta(i))i.forEach(({v:u,i:d,n:p})=>{if(!dn(u))return;const{isMatch:m,score:g,indices:v}=o.searchIn(u);m&&r.push({score:g,key:a,value:u,idx:d,norm:p,indices:v})});else{const{v:u,n:d}=i,{isMatch:p,score:m,indices:g}=o.searchIn(u);p&&r.push({score:m,key:a,value:u,norm:d,indices:g})}return r}}Ji.version="7.1.0";Ji.createIndex=v_;Ji.parseIndex=o2;Ji.config=be;Ji.parseQuery=__;_2(x2);function j2(t,a,i,o){if(!a.trim())return[];const r=.3;return new Ji(t,{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 Wf={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 as(t){return t==="blocked"?Wf.blocked:Wf[Yh(t)]}const w2={not_started:"statusPending",working:"statusInProgress",paused:"statusWaitingInput",complete:"statusDone",failed:"statusFailed"};function A2(t){return w2[Yh(t)]??"statusPending"}const D2=["working","paused","failed","not_started","blocked","complete"],V0=["not_started","working","paused","complete","failed"],R2={pending:"not_started",assigned:"not_started",in_progress:"working",waiting_input:"paused",review:"paused",done:"complete"};function Yh(t){return t in Wf&&t!=="blocked"?t:R2[t]??"not_started"}const M2={not_started:"--text-tertiary",working:"--accent-green",paused:"--accent-yellow",complete:"--accent-green",failed:"--accent-red",pending:"--text-tertiary",assigned:"--text-tertiary",in_progress:"--accent-green",review:"--accent-yellow",done:"--accent-green",waiting_input:"--accent-yellow"};function O2(t){if(t.length===0)return[];const a=[...t].sort((o,r)=>o[0]-r[0]),i=[[a[0][0],a[0][1]]];for(let o=1;o<a.length;o++){const r=i[i.length-1],[u,d]=a[o];u<=r[1]+1?r[1]=Math.max(r[1],d):i.push([u,d])}return i}function S_({text:t,indices:a,highlightClass:i}){if(!a||a.length===0)return c.jsx(c.Fragment,{children:t});const o=O2(a),r=[];let u=0;for(const[d,p]of o)d>u&&r.push(c.jsx("span",{children:t.slice(u,d)},`p${u}`)),r.push(c.jsx("mark",{className:i,children:t.slice(d,p+1)},`m${d}`)),u=p+1;return u<t.length&&r.push(c.jsx("span",{children:t.slice(u)},`p${u}`)),c.jsx(c.Fragment,{children:r})}function B2(t){const a=new Map(t.map(o=>[o.id,{...o,children:[]}])),i=[];for(const o of a.values())o.parentTaskId&&a.has(o.parentTaskId)?a.get(o.parentTaskId).children.push(o):i.push(o);for(const o of a.values())o.children.sort((r,u)=>r.sortOrder-u.sortOrder);return i.sort((o,r)=>o.sortOrder-r.sortOrder)}function I2(t,a){const i=new Map;for(const u of t){const p=u.dependsOn.length>0&&u.dependsOn.some(g=>a.get(g)!=="complete")?"blocked":u.status,m=i.get(p);m?m.push(u):i.set(p,[u])}const o=[],r=new Set;for(const u of D2){r.add(u);const d=i.get(u);if(d&&d.length>0){d.sort((m,g)=>m.sortOrder-g.sortOrder);const p=as(u);o.push({status:u,label:p.label,style:p,tasks:d})}}for(const[u,d]of i)if(!r.has(u)&&d.length>0){d.sort((m,g)=>m.sortOrder-g.sortOrder);const p=as(u);o.push({status:u,label:p.label,style:p,tasks:d})}return o}const L2="_container_z4i38_1",U2="_header_z4i38_5",z2="_headerActions_z4i38_17",V2="_searchInput_z4i38_23",H2="_searchHighlight_z4i38_56",P2="_groupToggle_z4i38_62",G2="_groupToggleActive_z4i38_89",$2="_addButton_z4i38_93",F2="_taskRow_z4i38_120",q2="_selected_z4i38_140",K2="_expandArrow_z4i38_150",Y2="_expanded_z4i38_157",Z2="_leafSpacer_z4i38_161",X2="_taskStatusIcon_z4i38_166",Q2="_taskTitle_z4i38_170",W2="_workspaceBadge_z4i38_177",J2="_childCountBadge_z4i38_195",eD="_dependencyBadge_z4i38_208",tD="_blockedBadge_z4i38_220",nD="_addChildButton_z4i38_225",aD="_emptyState_z4i38_268",sD="_statusGroupHeader_z4i38_275",iD="_statusGroupIcon_z4i38_294",oD="_statusGroupLabel_z4i38_298",lD="_statusGroupCount_z4i38_303",Oe={container:L2,header:U2,headerActions:z2,searchInput:V2,searchHighlight:H2,groupToggle:P2,groupToggleActive:G2,addButton:$2,taskRow:F2,selected:q2,expandArrow:K2,expanded:Y2,leafSpacer:Z2,taskStatusIcon:X2,taskTitle:Q2,workspaceBadge:W2,childCountBadge:J2,dependencyBadge:eD,blockedBadge:tD,addChildButton:nD,emptyState:aD,statusGroupHeader:sD,statusGroupIcon:iD,statusGroupLabel:oD,statusGroupCount:lD},rD=[{name:"title",weight:2},{name:"description",weight:1}],T_=16,cD=16,k_="grackle-task-group-by-status";function H0(){try{return localStorage.getItem(k_)==="true"}catch{return!1}}function uD(t){try{localStorage.setItem(k_,String(t))}catch{}}function dD({group:t,isExpanded:a,onToggle:i,selectedTaskId:o,navigate:r,titleHighlights:u,workspaceNames:d}){return c.jsxs("div",{"data-testid":`status-group-${t.status}`,children:[c.jsxs("div",{className:Oe.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:`${Oe.expandArrow} ${a?Oe.expanded:""}`,children:"▸"}),c.jsx("span",{className:Oe.statusGroupIcon,style:{color:t.style.color},children:t.style.icon}),c.jsx("span",{className:Oe.statusGroupLabel,children:t.label}),c.jsx("span",{className:Oe.statusGroupCount,children:t.tasks.length})]}),c.jsx(Qn,{children:a&&c.jsx(Ct.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},style:{overflow:"hidden"},children:t.tasks.map(p=>{const m=as(p.status),g=o===p.id,v=p.parentTaskId||!p.workspaceId?void 0:d.get(p.workspaceId);return c.jsxs("div",{onClick:()=>r(_a(p.id)),className:`${Oe.taskRow} ${g?Oe.selected:""}`,style:{"--task-indent":`${T_}px`},"data-task-id":p.id,children:[c.jsx("span",{className:Oe.leafSpacer}),c.jsx("span",{className:Oe.taskStatusIcon,style:{color:m.color},children:m.icon}),c.jsx("span",{className:Oe.taskTitle,title:p.title,children:c.jsx(S_,{text:p.title,indices:u.get(p.id),highlightClass:Oe.searchHighlight})}),v&&c.jsx("span",{className:Oe.workspaceBadge,title:v,children:v})]},p.id)})})})]})}function C_({node:t,depth:a,expandedTasks:i,toggleTask:o,selectedTaskId:r,navigate:u,taskStatusById:d,titleHighlights:p,workspaceNames:m}){const g=as(t.status),v=t.dependsOn.length>0&&t.dependsOn.some(C=>d.get(C)!=="complete"),y=i.has(t.id),b=t.children.length>0,S=r===t.id,T=T_+a*cD,N=a===0&&!t.parentTaskId&&t.workspaceId?m.get(t.workspaceId):void 0;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{onClick:()=>u(_a(t.id)),className:`${Oe.taskRow} ${S?Oe.selected:""}`,style:{"--task-indent":`${T}px`},"data-task-id":t.id,children:[b&&c.jsx("span",{className:`${Oe.expandArrow} ${y?Oe.expanded:""}`,role:"button",tabIndex:0,"aria-label":y?"Collapse task":"Expand task",onClick:C=>{C.stopPropagation(),o(t.id)},onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),C.stopPropagation(),o(t.id))},children:"▸"}),!b&&c.jsx("span",{className:Oe.leafSpacer}),c.jsx("span",{className:Oe.taskStatusIcon,style:{color:g.color},children:g.icon}),c.jsx("span",{className:Oe.taskTitle,title:t.title,children:c.jsx(S_,{text:t.title,indices:p.get(t.id),highlightClass:Oe.searchHighlight})}),N&&c.jsx("span",{className:Oe.workspaceBadge,title:N,children:N}),b&&c.jsxs("span",{className:Oe.childCountBadge,children:[t.children.filter(C=>C.status==="complete").length,"/",t.children.length]}),t.dependsOn.length>0&&c.jsx("span",{className:`${Oe.dependencyBadge} ${v?Oe.blockedBadge:""}`,title:`Depends on: ${t.dependsOn.join(", ")}`,children:v?"blocked":"dep"}),a<PA&&c.jsx("button",{onClick:C=>{C.stopPropagation(),u(Xi(t.workspaceId,t.id))},title:"Add child task","aria-label":"Add child task",className:Oe.addChildButton,children:"+"})]}),c.jsx(Qn,{children:b&&y&&c.jsx(Ct.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.15},style:{overflow:"hidden"},children:t.children.map(C=>c.jsx(C_,{node:C,depth:a+1,expandedTasks:i,toggleTask:o,selectedTaskId:r,navigate:u,taskStatusById:d,titleHighlights:p,workspaceNames:m},C.id))})})]})}function fD(){const{workspaces:t,tasks:a}=qe(),i=Dt(),[o,r]=x.useState(new Set),[u,d]=x.useState(new Set),[p,m]=x.useState(H0),[g,v]=x.useState(H0),[y,b]=x.useState(new Map),S=Tt("/tasks/:taskId/*"),T=(S==null?void 0:S.params.taskId)!=="new"?S==null?void 0:S.params.taskId:void 0,E=x.useMemo(()=>new Map(a.map(z=>[z.id,z.status])),[a]),N=x.useMemo(()=>new Map(t.map(z=>[z.id,z.name])),[t]),C=()=>{const z=!p;uD(z),m(z),z&&(v(!0),b(new Map))},j=z=>{b(ne=>{const I=new Map(ne),Y=I.has(z)?I.get(z):g;return I.set(z,!Y),I})},D=z=>y.has(z)?y.get(z):g,R=z=>{r(ne=>{const I=new Set(ne);return I.has(z)?(I.delete(z),d(Y=>new Set(Y).add(z))):(I.add(z),d(Y=>{const oe=new Set(Y);return oe.delete(z),oe})),I})};x.useEffect(()=>{const z=new Set(a.filter(ne=>ne.parentTaskId).map(ne=>ne.parentTaskId));z.size>0&&r(ne=>{const I=new Set(ne);for(const Y of z)u.has(Y)||I.add(Y);return I})},[a,u]);const[w,F]=x.useState(""),{directMatchTaskIds:H,treeMatchTaskIds:B,titleHighlights:q}=x.useMemo(()=>{if(!w.trim())return{directMatchTaskIds:null,treeMatchTaskIds:null,titleHighlights:new Map};const z=j2(a,w,rD),ne=new Set(z.map(G=>G.item.id)),I=new Map;for(const G of z){const O=G.matches.find(ie=>ie.key==="title");O&&I.set(G.item.id,O.indices)}const Y=new Set(ne),oe=new Map(a.map(G=>[G.id,G]));for(const G of[...ne]){let O=oe.get(G);for(;O!=null&&O.parentTaskId;)Y.add(O.parentTaskId),O=oe.get(O.parentTaskId)}return{directMatchTaskIds:ne,treeMatchTaskIds:Y,titleHighlights:I}},[w,a]),X=H!==null,ae=X?p?H:B:null,te=ae?a.filter(z=>ae.has(z.id)):a,ee=p?[]:B2(te);return c.jsxs("div",{className:Oe.container,children:[c.jsxs("div",{className:Oe.header,children:[c.jsx("span",{children:"Tasks"}),c.jsxs("div",{className:Oe.headerActions,children:[c.jsx("button",{className:`${Oe.groupToggle} ${p?Oe.groupToggleActive:""}`,onClick:C,"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:Oe.addButton,onClick:()=>i(Xi()),"aria-label":"New task",title:"New task","data-testid":"new-task-button",children:"+"})]})]}),a.length>0&&c.jsx("input",{type:"text",value:w,onChange:z=>F(z.target.value),placeholder:"Filter...","aria-label":"Filter tasks",className:Oe.searchInput,"data-testid":"sidebar-search"}),p?I2(te,E).map(z=>c.jsx(dD,{group:z,isExpanded:D(z.status),onToggle:()=>j(z.status),selectedTaskId:T,navigate:i,titleHighlights:q,workspaceNames:N},z.status)):ee.map(z=>c.jsx(C_,{node:z,depth:0,expandedTasks:o,toggleTask:R,selectedTaskId:T,navigate:i,taskStatusById:E,titleHighlights:q,workspaceNames:N},z.id)),te.length===0&&!X&&c.jsx("div",{className:Oe.emptyState,children:"No tasks yet. Click + to create one."}),te.length===0&&X&&c.jsx("div",{className:Oe.emptyState,children:"No matching tasks"})]})}const hD="_nav_14i94_1",pD="_tab_14i94_24",mD="_tabActive_14i94_62",gD="_tabLabel_14i94_75",vD="_statusDot_14i94_81",yD="_pulse_14i94_87",bD="_addButton_14i94_99",xD="_empty_14i94_132",Xa={nav:hD,tab:pD,tabActive:mD,tabLabel:gD,statusDot:vD,pulse:yD,addButton:bD,empty:xD},_D={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function SD(){const{environments:t}=qe(),a=Dt(),i=x.useRef(null),o=Tt("/environments/:environmentId"),r=Tt("/environments/:environmentId/edit"),u=Tt("/environments/:environmentId/workspaces/:workspaceId"),d=Tt("/environments/:environmentId/workspaces/:workspaceId/*"),p=(o==null?void 0:o.params.environmentId)??(r==null?void 0:r.params.environmentId)??(u==null?void 0:u.params.environmentId)??(d==null?void 0:d.params.environmentId),m=p==="new"?void 0:p,g=x.useCallback(b=>{a(Gi(b))},[a]),v=x.useCallback(b=>{var C;const S=(C=i.current)==null?void 0:C.querySelectorAll('[role="tab"]');if(!S||S.length===0)return;const T=Array.from(S).findIndex(j=>j===document.activeElement),E=T>=0?T:t.findIndex(j=>j.id===m);let N=E;if(b.key==="ArrowDown")b.preventDefault(),N=(E+1)%S.length;else if(b.key==="ArrowUp")b.preventDefault(),N=(E-1+S.length)%S.length;else if(b.key==="Home")b.preventDefault(),N=0;else if(b.key==="End")b.preventDefault(),N=S.length-1;else return;N<t.length&&a(Gi(t[N].id)),S[N].focus()},[m,t,a]),y=m??(t.length>0?t[0].id:void 0);return c.jsxs("div",{className:Xa.nav,"data-testid":"environment-nav",children:[c.jsx("nav",{ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Environments",onKeyDown:v,children:t.map(b=>{const S=b.id===m,T=b.id===y,E=_D[b.status]||"var(--text-tertiary)",N=b.status==="connected";return c.jsxs("button",{role:"tab",type:"button","aria-selected":S,tabIndex:T?0:-1,className:`${Xa.tab} ${S?Xa.tabActive:""}`,onClick:()=>g(b.id),"data-testid":"env-nav-item",children:[c.jsx("span",{className:`${Xa.statusDot} ${N?Xa.pulse:""}`,style:{color:E},children:"●"}),c.jsx("span",{className:Xa.tabLabel,title:b.displayName||b.id,children:b.displayName||b.id})]},b.id)})}),c.jsx("button",{type:"button",className:Xa.addButton,onClick:()=>a(oC),title:"Add environment","data-testid":"env-nav-add",children:"+ Add Environment"}),t.length===0&&c.jsx("div",{className:Xa.empty,children:"No environments yet."})]})}const TD="_nav_1bhou_1",kD="_tab_1bhou_24",CD="_tabIcon_1bhou_62",ED="_tabActive_1bhou_68",Wr={nav:TD,tab:kD,tabIcon:CD,tabActive:ED},va=[{path:"credentials",label:"Credentials",icon:"🔑"},{path:"personas",label:"Personas",icon:"👤"},{path:"appearance",label:"Appearance",icon:"🎨"},{path:"about",label:"About",icon:"ℹ️"}];function ND(){var d;const t=jt(),a=Dt(),i=x.useRef(null),o=((d=va.find(p=>t.pathname===`${il}/${p.path}`))==null?void 0:d.path)??va[0].path,r=x.useCallback(p=>{a(`${il}/${p}`)},[a]),u=x.useCallback(p=>{var S,T;const m=(S=i.current)==null?void 0:S.querySelectorAll('[role="tab"]');if(!m)return;const g=Array.from(m).findIndex(E=>E===document.activeElement),v=g>=0?g:va.findIndex(E=>E.path===o);let y=v;if(p.key==="ArrowDown")p.preventDefault(),y=(v+1)%va.length;else if(p.key==="ArrowUp")p.preventDefault(),y=(v-1+va.length)%va.length;else if(p.key==="Home")p.preventDefault(),y=0;else if(p.key==="End")p.preventDefault(),y=va.length-1;else return;const b=va[y].path;a(`${il}/${b}`),(T=m[y])==null||T.focus()},[o,a]);return c.jsx("nav",{className:Wr.nav,ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Settings",onKeyDown:u,children:va.map(p=>{const m=p.path===o;return c.jsxs("button",{role:"tab",type:"button","aria-selected":m,tabIndex:m?0:-1,className:`${Wr.tab} ${m?Wr.tabActive:""}`,onClick:()=>r(p.path),children:[c.jsx("span",{className:Wr.tabIcon,"aria-hidden":"true",children:p.icon}),p.label]},p.path)})})}const jD="_nav_1snmp_1",wD="_searchForm_1snmp_8",AD="_searchInput_1snmp_15",DD="_searchButton_1snmp_33",RD="_clearButton_1snmp_68",MD="_workspaceSelect_1snmp_85",OD="_listHeader_1snmp_99",BD="_nodeList_1snmp_108",ID="_nodeItem_1snmp_116",LD="_indicator_1snmp_129",UD="_label_1snmp_136",zD="_badge_1snmp_145",jn={nav:jD,searchForm:wD,searchInput:AD,searchButton:DD,clearButton:RD,workspaceSelect:MD,listHeader:OD,nodeList:BD,nodeItem:ID,indicator:LD,label:UD,badge:zD};function VD(){const{knowledge:t,workspaces:a}=qe(),[i,o]=x.useState(""),r=x.useCallback(m=>{m.preventDefault(),i.trim()&&t.search(i.trim())},[i,t]),u=x.useCallback(()=>{o(""),t.clearSearch()},[t]),d=x.useCallback(m=>{t.selectNode(m)},[t]),p=x.useCallback(m=>{o(""),t.loadRecent(m||void 0)},[t]);return c.jsxs("div",{className:jn.nav,"data-testid":"knowledge-nav",children:[c.jsxs("form",{className:jn.searchForm,onSubmit:r,children:[c.jsx("input",{className:jn.searchInput,type:"text",placeholder:"Search...",value:i,onChange:m=>{o(m.target.value)},"data-testid":"knowledge-search-input"}),c.jsx("button",{type:"submit",className:jn.searchButton,disabled:t.loading,children:"Go"})]}),t.searchQuery&&c.jsx("button",{type:"button",className:jn.clearButton,onClick:u,children:"Clear search"}),c.jsxs("select",{className:jn.workspaceSelect,onChange:m=>{p(m.target.value)},"data-testid":"knowledge-workspace-filter",children:[c.jsx("option",{value:"",children:"All workspaces"}),a.map(m=>c.jsx("option",{value:m.id,children:m.name},m.id))]}),c.jsxs("div",{className:jn.listHeader,children:["Nodes (",t.graphData.nodes.length,")"]}),c.jsx("ul",{className:jn.nodeList,children:t.graphData.nodes.map(m=>c.jsxs("li",{className:jn.nodeItem,onClick:()=>{d(m.id)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),d(m.id))},role:"button",tabIndex:0,children:[c.jsx("span",{className:jn.indicator,style:{backgroundColor:m.kind==="reference"?"#4A9EFF":m.category==="decision"?"#22C55E":m.category==="concept"?"#A855F7":m.category==="snippet"?"#6B7280":"#EAB308"}}),c.jsx("span",{className:jn.label,children:m.label}),c.jsx("span",{className:jn.badge,children:m.kind==="reference"?m.sourceType:m.category})]},m.id))})]})}function HD(){const t=x.useMemo(()=>c.jsx(fD,{}),[]);return Nc(t),c.jsx(Ls,{})}function PD(){const t=x.useMemo(()=>c.jsx(SD,{}),[]);return Nc(t),c.jsx(Ls,{})}function GD(){const t=x.useMemo(()=>c.jsx(ND,{}),[]);return Nc(t),c.jsx(Ls,{})}function $D(){const t=x.useMemo(()=>c.jsx(VD,{}),[]);return Nc(t),c.jsx(Ls,{})}const FD="_bar_tnfsh_1",qD="_btnPrimary_tnfsh_32",KD="_statusText_tnfsh_85",YD="_statusCompleted_tnfsh_90",ZD="_statusFailed_tnfsh_94",XD="_statusBlocked_tnfsh_98",QD="_hintText_tnfsh_103",ct={bar:FD,btnPrimary:qD,statusText:KD,statusCompleted:YD,statusFailed:ZD,statusBlocked:XD,hintText:QD};function WD(){const{sessions:t,tasks:a,environments:i}=qe(),o=Dt(),r=jt(),u=Tt("/sessions/:sessionId"),d=Tt("/tasks/:taskId"),p=Tt("/tasks/:taskId/stream"),m=Tt("/tasks/:taskId/findings"),g=Tt("/tasks/:taskId/edit"),v=Tt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId"),y=Tt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream"),b=Tt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings"),S=Tt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit"),T=Tt("/sessions/new"),E=Tt("/environments/:environmentId/workspaces/:workspaceId"),N=Tt("/tasks/new"),C=Tt("/chat"),j=Tt("/"),D=Tt("/settings/*"),R=u==null?void 0:u.params.sessionId,w=(d==null?void 0:d.params.taskId)??(p==null?void 0:p.params.taskId)??(m==null?void 0:m.params.taskId)??(v==null?void 0:v.params.taskId)??(y==null?void 0:y.params.taskId)??(b==null?void 0:b.params.taskId)??(S==null?void 0:S.params.taskId),F=v??y??b??S,H=(F==null?void 0:F.params.environmentId)??(E==null?void 0:E.params.environmentId),B=r.pathname.startsWith("/environments")&&!E&&!F,q=!!C,X=!!T,ae=!!E&&!v&&!y&&!b&&!S,te=!!N;if(!!j&&!X&&!ae&&!te||!!D||(!!g||!!S)||te||B||X)return c.jsx(c.Fragment,{});if(q)return i.find(Y=>Y.adapterType==="local"&&Y.status==="connected")?c.jsx(c.Fragment,{}):c.jsx("div",{className:ct.bar,children:c.jsx("span",{className:ct.hintText,children:"Add a local environment to start chatting"})});if(ae)return c.jsx("div",{className:ct.bar,children:c.jsx("span",{className:ct.hintText,children:"Select a task or click + to create one"})});if(w){const I=a.find(G=>G.id===w);if(!I)return c.jsx("div",{className:ct.bar,children:c.jsx("span",{className:ct.hintText,children:"Loading..."})});const Y=new Map(a.map(G=>[G.id,G])),oe=I.dependsOn.some(G=>{const O=Y.get(G);return O!==void 0&&O.status!=="complete"});if(I.status==="not_started"){const G=oe?I.dependsOn.map(O=>Y.get(O)).filter(O=>O&&O.status!=="complete").map(O=>O.title):[];return c.jsx("div",{className:ct.bar,children:oe?c.jsxs("span",{className:ct.statusBlocked,children:["Blocked by: ",G.join(", ")]}):c.jsx("span",{className:ct.hintText,children:"Use the buttons above to start or manage this task"})})}if(I.status==="working"||I.status==="paused"){const G=I.latestSessionId||void 0,O=G?t.find(xe=>xe.id===G):void 0;return O&&O.status!=="stopped"?c.jsx(c.Fragment,{}):c.jsx("div",{className:ct.bar,children:c.jsx("span",{className:ct.hintText,children:"Waiting for agent..."})})}if(I.status==="complete")return c.jsxs("div",{className:ct.bar,children:[c.jsx("span",{className:`${ct.statusText} ${ct.statusCompleted}`,children:"Task completed"}),c.jsx("button",{onClick:()=>o(Xi(I.workspaceId,void 0,H)),className:ct.btnPrimary,children:"+ New Task"})]});if(I.status==="failed")return c.jsx("div",{className:ct.bar,children:c.jsx("span",{className:`${ct.statusText} ${ct.statusFailed}`,children:"Task failed"})})}if(R){const I=t.find(G=>G.id===R),Y=(I==null?void 0:I.status)==="stopped";if(I!==void 0&&!Y)return c.jsx(c.Fragment,{});if(Y)return c.jsxs("div",{className:ct.bar,children:[c.jsxs("span",{className:`${ct.statusText} ${ct.hintText}`,children:["Session ",I.endReason||I.status]}),c.jsx("button",{onClick:()=>o(Sb(I.environmentId)),className:ct.btnPrimary,children:"+ New Chat"})]})}return c.jsx("div",{className:ct.bar,children:c.jsx("span",{className:ct.hintText,children:"Loading..."})})}const JD="_toast_da8ll_1",eR="_success_da8ll_18",tR="_icon_da8ll_22",nR="_error_da8ll_25",aR="_warning_da8ll_32",sR="_info_da8ll_38",iR="_message_da8ll_53",oR="_close_da8ll_60",Wo={toast:JD,success:eR,icon:tR,error:nR,warning:aR,info:sR,message:iR,close:oR},lR={success:"✓",error:"✕",warning:"⚠",info:"ℹ"};function rR({toast:t,onDismiss:a}){return x.useEffect(()=>{const i=setTimeout(()=>a(t.id),t.duration);return()=>clearTimeout(i)},[t.id,t.duration,a]),c.jsxs(Ct.div,{className:`${Wo.toast} ${Wo[t.variant]}`,role:"status",initial:{opacity:0,y:-16,scale:.94},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.94},transition:{duration:.2,ease:"easeOut"},layout:!0,children:[c.jsx("span",{className:Wo.icon,"aria-hidden":"true",children:lR[t.variant]}),c.jsx("span",{className:Wo.message,children:t.message}),c.jsx("button",{type:"button",className:Wo.close,onClick:()=>a(t.id),"aria-label":"Dismiss notification",children:"×"})]})}const cR="_container_qqse2_1",uR={container:cR};function dR(){const{toasts:t,dismissToast:a}=Us();return c.jsx("div",{className:uR.container,"data-testid":"toast-container",children:c.jsx(Qn,{children:t.map(i=>c.jsx(rR,{toast:i,onDismiss:a},i.id))})})}const fR="_breadcrumbs_17or2_1",hR="_list_17or2_11",pR="_item_17or2_21",mR="_separator_17or2_28",gR="_link_17or2_34",vR="_current_17or2_57",Ri={breadcrumbs:fR,list:hR,item:pR,separator:mR,link:gR,current:vR},yR="›";function Vs({segments:t}){return c.jsx("nav",{className:Ri.breadcrumbs,"aria-label":"Breadcrumb","data-testid":"breadcrumbs",children:c.jsx("ol",{className:Ri.list,children:t.map((a,i)=>{const o=i===t.length-1;return c.jsxs("li",{className:Ri.item,children:[i>0&&c.jsx("span",{className:Ri.separator,"aria-hidden":"true",children:yR}),a.url&&!o?c.jsx(ch,{className:Ri.link,to:a.url,title:a.label,children:a.label}):c.jsx("span",{className:Ri.current,"aria-current":"page",title:a.label,children:a.label})]},i)})})})}function Jf(){Jf=function(r,u){return new i(r,void 0,u)};var t=RegExp.prototype,a=new WeakMap;function i(r,u,d){var p=new RegExp(r,u);return a.set(p,d||a.get(r)),_c(p,i.prototype)}function o(r,u){var d=a.get(u);return Object.keys(d).reduce(function(p,m){var g=d[m];if(typeof g=="number")p[m]=r[g];else{for(var v=0;r[g[v]]===void 0&&v+1<g.length;)v++;p[m]=r[g[v]]}return p},Object.create(null))}return(function(r,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(u&&u.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),u&&_c(r,u)})(i,RegExp),i.prototype.exec=function(r){var u=t.exec.call(this,r);if(u){u.groups=o(u,this);var d=u.indices;d&&(d.groups=o(d,this))}return u},i.prototype[Symbol.replace]=function(r,u){if(typeof u=="string"){var d=a.get(this);return t[Symbol.replace].call(this,r,u.replace(/\$<([^>]+)>/g,function(m,g){var v=d[g];return"$"+(Array.isArray(v)?v.join("$"):v)}))}if(typeof u=="function"){var p=this;return t[Symbol.replace].call(this,r,function(){var m=arguments;return typeof m[m.length-1]!="object"&&(m=[].slice.call(m)).push(o(m,p)),u.apply(this,m)})}return t[Symbol.replace].call(this,r,u)},Jf.apply(this,arguments)}function _c(t,a){return _c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,o){return i.__proto__=o,i},_c(t,a)}function P0(t,a){(a==null||a>t.length)&&(a=t.length);for(var i=0,o=new Array(a);i<a;i++)o[i]=t[i];return o}function yf(t,a){var i=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=(function(r,u){if(r){if(typeof r=="string")return P0(r,u);var d=Object.prototype.toString.call(r).slice(8,-1);return d==="Object"&&r.constructor&&(d=r.constructor.name),d==="Map"||d==="Set"?Array.from(r):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?P0(r,u):void 0}})(t))||a){i&&(t=i);var o=0;return function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
99
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var bR=(function(t){return function(a){return a===void 0&&(a={}),(function(o,r){if(r&&!o.registered(r))throw new Error('The default language "'+r+'" is not registered with refractor.')})(t,a.defaultLanguage),function(o){XS(o,"element",i)};function i(o,r,u){var d,p;if(u&&u.tagName==="pre"&&o.tagName==="code"){var m=(o==null||(d=o.data)==null?void 0:d.meta)||(o==null||(p=o.properties)==null?void 0:p.metastring)||"";o.properties.className?typeof o.properties.className=="boolean"?o.properties.className=[]:Array.isArray(o.properties.className)||(o.properties.className=[o.properties.className]):o.properties.className=[];var g,v,y=(function(w){for(var F,H=yf(w.properties.className);!(F=H()).done;){var B=F.value;if(B.slice(0,9)==="language-")return B.slice(9).toLowerCase()}return null})(o);if(!y&&a.defaultLanguage&&o.properties.className.push("language-"+(y=a.defaultLanguage)),o.properties.className.push("code-highlight"),y)try{var b,S;S=(b=y)!=null&&b.includes("diff-")?y.split("-")[1]:y,g=t.highlight(Gr(o),S),u.properties.className=(u.properties.className||[]).concat("language-"+S)}catch(w){if(!a.ignoreMissing||!/Unknown language/.test(w.message))throw w;g=o}else g=o;g.children=(v=1,function w(F){return F.reduce(function(H,B){if(B.type==="text"){var q=B.value,X=(q.match(/\n/g)||"").length;if(X===0)B.position={start:{line:v,column:1},end:{line:v,column:1}},H.push(B);else for(var ae,te=q.split(`
100
- `),ee=yf(te.entries());!(ae=ee()).done;){var z=ae.value,ne=z[0],I=z[1];H.push({type:"text",value:ne===te.length-1?I:I+`
101
- `,position:{start:{line:v+ne,column:1},end:{line:v+ne,column:1}}})}return v+=X,H}if(Object.prototype.hasOwnProperty.call(B,"children")){var Y=v;return B.children=w(B.children),H.push(B),B.position={start:{line:Y,column:1},end:{line:v,column:1}},H}return H.push(B),H},[])})(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 T,E=(function(w){var F=/{([\d,-]+)}/,H=w.split(",").map(function(X){return X.trim()}).join();if(F.test(H)){var B=F.exec(H)[1],q=WS(B);return function(X){return q.includes(X+1)}}return function(){return!1}})(m),N=(function(w){var F=Jf(/showLineNumbers=(\d+)/i,{lines:1});if(F.test(w)){var H=F.exec(w);return Number(H.groups.lines)}return 1})(m),C=(function(w){for(var F=new Array(w),H=0;H<w;H++)F[H]={type:"element",tagName:"span",properties:{className:[]},children:[]};return F})(g.position.end.line),j=["showlinenumbers=false",'showlinenumbers="false"',"showlinenumbers={false}"],D=function(){var w,F,H=T.value,B=H[0],q=H[1];q.properties.className=["code-line"];var X=JS(g,function(ae){return ae.position.start.line<=B+1&&ae.position.end.line>=B+1});q.children=X.children,(m.toLowerCase().includes("showLineNumbers".toLowerCase())||a.showLineNumbers===!0||typeof a.showLineNumbers=="object"&&a.showLineNumbers.includes(y))&&!j.some(function(ae){return m.toLowerCase().includes(ae)})&&(q.properties.line=[(B+N).toString()],q.properties.className.push("line-number")),E(B)&&q.properties.className.push("highlight-line"),(y==="diff"||(w=y)!=null&&w.includes("diff-"))&&Gr(q).substring(0,1)==="-"?q.properties.className.push("deleted"):(y==="diff"||(F=y)!=null&&F.includes("diff-"))&&Gr(q).substring(0,1)==="+"&&q.properties.className.push("inserted")},R=yf(C.entries());!(T=R()).done;)D();C.length>0&&Gr(C[C.length-1]).trim()===""&&C.pop(),o.children=C}}}})(QS);function E_(t){if(t>=1e6)return`${(t/1e6).toFixed(1)}M`;if(t>=1e3){const a=Number((t/1e3).toFixed(1));return a>=1e3?`${(t/1e6).toFixed(1)}M`:`${a.toFixed(1)}k`}return String(t)}function Ki(t){return t===0?"-":t<.01?`$${t.toFixed(4)}`:`$${t.toFixed(2)}`}const xR="_systemContextEvent_1qbiw_1",_R="_systemContextHeader_1qbiw_7",SR="_systemContextBadge_1qbiw_28",TR="_systemContextToggle_1qbiw_37",kR="_systemContextPre_1qbiw_43",CR="_systemContextEllipsis_1qbiw_54",ER="_systemEvent_1qbiw_58",NR="_systemTimestamp_1qbiw_65",jR="_textEvent_1qbiw_69",wR="_toolUseEvent_1qbiw_155",AR="_toolUseHeader_1qbiw_175",DR="_toolUsePrefix_1qbiw_182",RR="_toolUseName_1qbiw_187",MR="_toolUseArgs_1qbiw_192",OR="_toolResultEvent_1qbiw_203",BR="_toolResultHeader_1qbiw_208",IR="_toolResultIndicatorOk_1qbiw_232",LR="_toolResultIndicatorError_1qbiw_239",UR="_toolResultLabel_1qbiw_246",zR="_toolResultToggle_1qbiw_250",VR="_toolResultCommand_1qbiw_256",HR="_toolResultEllipsis_1qbiw_266",PR="_toolResultPre_1qbiw_270",GR="_errorEvent_1qbiw_291",$R="_statusEvent_1qbiw_299",FR="_userInputEvent_1qbiw_308",qR="_userInputContent_1qbiw_314",KR="_signalEvent_1qbiw_331",YR="_signalBadge_1qbiw_342",ZR="_signalContent_1qbiw_351",XR="_usageEvent_1qbiw_356",QR="_usageBadge_1qbiw_363",WR="_defaultEvent_1qbiw_372",Ie={systemContextEvent:xR,systemContextHeader:_R,systemContextBadge:SR,systemContextToggle:TR,systemContextPre:kR,systemContextEllipsis:CR,systemEvent:ER,systemTimestamp:NR,textEvent:jR,toolUseEvent:wR,toolUseHeader:AR,toolUsePrefix:DR,toolUseName:RR,toolUseArgs:MR,toolResultEvent:OR,toolResultHeader:BR,toolResultIndicatorOk:IR,toolResultIndicatorError:LR,toolResultLabel:UR,toolResultToggle:zR,toolResultCommand:VR,toolResultEllipsis:HR,toolResultPre:PR,errorEvent:GR,statusEvent:$R,userInputEvent:FR,userInputContent:qR,signalEvent:KR,signalBadge:YR,signalContent:ZR,usageEvent:XR,usageBadge:QR,defaultEvent:WR},G0=3;function JR({content:t}){const[a,i]=x.useState(!1),o=t.split(`
102
- `),r=o.length>G0,u=a?t:o.slice(0,G0).join(`
103
- `);return c.jsxs("div",{className:Ie.systemContextEvent,"data-testid":"system-context-event",children:[c.jsxs("button",{type:"button",className:Ie.systemContextHeader,onClick:()=>{i(d=>!d)},"aria-expanded":a,children:[c.jsx("span",{className:Ie.systemContextBadge,children:"SYSTEM PROMPT"}),r&&c.jsx("span",{className:Ie.systemContextToggle,"aria-hidden":"true",children:a?"▾":"▸"})]}),c.jsxs("pre",{className:Ie.systemContextPre,children:[u,!a&&r&&c.jsx("span",{className:Ie.systemContextEllipsis,children:"…"})]})]})}function eM({time:t,content:a}){return c.jsxs("div",{className:Ie.systemEvent,children:[c.jsxs("span",{className:Ie.systemTimestamp,children:["[",t,"]"]})," ",a]})}function tM({content:t}){return c.jsx("div",{className:Ie.textEvent,children:c.jsx(th,{remarkPlugins:[nh],rehypePlugins:[bR],children:t})})}function nM({content:t}){let a="",i=t;try{const o=JSON.parse(t);a=o.tool||"",i=JSON.stringify(o.args,null,2)}catch{}return c.jsxs("div",{className:Ie.toolUseEvent,children:[c.jsxs("div",{className:Ie.toolUseHeader,children:[c.jsx("span",{className:Ie.toolUsePrefix,children:">"}),a?c.jsx("span",{className:Ie.toolUseName,children:a}):null]}),c.jsx("pre",{className:Ie.toolUseArgs,children:i})]})}const $0=5;function aM(t,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 o=typeof i.path=="string"?` in ${i.path}`:"";return`${i.pattern}${o}`}if(typeof i.path=="string")return i.path;if(typeof i.query=="string")return i.query;try{const o=JSON.stringify(a);return o.length>150?`${o.slice(0,150)}…`:o}catch{return""}}function sM({content:t,raw:a,toolUseCtx:i}){const[o,r]=x.useState(!1);let u=!1;if(a)try{u=JSON.parse(a).is_error===!0}catch{}const d=t.split(`
104
- `),p=d.length>$0,m=o?t:d.slice(0,$0).join(`
105
- `),v=((i==null?void 0:i.tool)??"")||(u?"Tool error":"Tool output"),y=i?aM(i.tool,i.args):"",b=c.jsxs(c.Fragment,{children:[c.jsx("span",{className:u?Ie.toolResultIndicatorError:Ie.toolResultIndicatorOk,"aria-label":u?"error":"success","data-testid":u?"tool-result-indicator-error":"tool-result-indicator-ok",children:u?"✗":"✓"}),c.jsx("span",{className:Ie.toolResultLabel,"data-testid":"tool-result-label",children:v}),p&&c.jsx("span",{className:Ie.toolResultToggle,"aria-hidden":"true",children:o?"▾":"▸"})]});return c.jsxs("div",{className:Ie.toolResultEvent,"data-testid":"tool-result",children:[p?c.jsx("button",{className:Ie.toolResultHeader,"data-testid":"tool-result-header",onClick:()=>{r(S=>!S)},"aria-expanded":o,children:b}):c.jsx("div",{className:Ie.toolResultHeader,"data-testid":"tool-result-header",children:b}),y&&c.jsx("div",{className:Ie.toolResultCommand,children:y}),c.jsxs("pre",{className:Ie.toolResultPre,"data-testid":"tool-result-content",children:[m,!o&&p&&c.jsx("span",{className:Ie.toolResultEllipsis,children:"…"})]})]})}function iM({content:t}){return c.jsxs("div",{className:Ie.errorEvent,children:["Error: ",t]})}function oM({content:t}){return c.jsxs("div",{className:Ie.statusEvent,children:["--- ",t," ---"]})}function lM({content:t}){return c.jsx("div",{className:Ie.userInputEvent,children:c.jsx("span",{className:Ie.userInputContent,children:t})})}function rM({content:t}){return c.jsxs("div",{className:Ie.signalEvent,"data-testid":"signal-event",children:[c.jsx("span",{className:Ie.signalBadge,children:"SIGNAL"}),c.jsx("span",{className:Ie.signalContent,children:t})]})}function cM({content:t}){let a=t;try{const i=JSON.parse(t),o=Number(i.input_tokens)||0,r=Number(i.output_tokens)||0,u=E_(o+r),d=Ki(Number(i.cost_usd)||0);a=`${u} tokens · ${d}`}catch{}return c.jsx("div",{className:Ie.usageEvent,"data-testid":"usage-event",children:c.jsx("span",{className:Ie.usageBadge,children:a})})}function uM({content:t}){return c.jsx("div",{className:Ie.defaultEvent,children:t})}function dM({event:t,toolUseCtx:a}){const i=new Date(t.timestamp).toLocaleTimeString();switch(t.eventType){case"system":{if(t.raw)try{if(JSON.parse(t.raw).systemContext===!0)return c.jsx(JR,{content:t.content})}catch{}return c.jsx(eM,{time:i,content:t.content})}case"text":case"output":return c.jsx(tM,{content:t.content});case"tool_use":return c.jsx(nM,{content:t.content});case"tool_result":return c.jsx(sM,{content:t.content,raw:t.raw,toolUseCtx:a});case"error":return c.jsx(iM,{content:t.content});case"status":return c.jsx(oM,{content:t.content});case"user_input":return c.jsx(lM,{content:t.content});case"signal":return c.jsx(rM,{content:t.content});case"usage":return c.jsx(cM,{content:t.content});default:return c.jsx(uM,{content:t.content})}}const fM="_overlay_cmicx_1",hM="_dialog_cmicx_11",pM="_title_cmicx_30",mM="_description_cmicx_38",gM="_actions_cmicx_45",vM="_cancelButton_cmicx_52",yM="_confirmButton_cmicx_79",Ns={overlay:fM,dialog:hM,title:pM,description:mM,actions:gM,cancelButton:vM,confirmButton:yM};function Oc({isOpen:t,title:a,description:i,confirmLabel:o="Delete",onConfirm:r,onCancel:u}){const d=x.useId(),p=x.useId();return c.jsx(Qn,{children:t&&c.jsx(Ct.div,{className:Ns.overlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},onClick:u,onKeyDown:m=>{m.key==="Escape"&&u()},role:"dialog","aria-modal":"true","aria-labelledby":d,"aria-describedby":i?p:void 0,children:c.jsxs(Ct.div,{className:Ns.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:d,className:Ns.title,children:a}),i&&c.jsx("p",{id:p,className:Ns.description,children:i}),c.jsxs("div",{className:Ns.actions,children:[c.jsx("button",{type:"button",className:Ns.cancelButton,onClick:u,autoFocus:!0,children:"Cancel"}),c.jsx("button",{type:"button",className:Ns.confirmButton,onClick:r,children:o})]})]})})})}const bM="_spinner_1uyt1_1",xM="_spin_1uyt1_1",_M="_sm_1uyt1_14",SM="_md_1uyt1_20",TM="_lg_1uyt1_26",kM="_xl_1uyt1_32",F0={spinner:bM,spin:xM,sm:_M,md:SM,lg:TM,xl:kM};function N_({size:t="md",className:a,label:i="Loading",liveRegion:o=!1}){return c.jsx("span",{className:`${F0.spinner} ${F0[t]} ${a??""}`,role:o?"status":void 0,"aria-label":i,"aria-hidden":o?void 0:!0})}const CM="_splash_1bn1g_1",EM="_logo_1bn1g_11",q0={splash:CM,logo:EM};function j_(){return c.jsxs("div",{className:q0.splash,"data-testid":"splash-screen",children:[c.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:q0.logo}),c.jsx(N_,{size:"xl",label:"Loading Grackle",liveRegion:!0})]})}function NM(t,a){const i=x.useRef(null);x.useEffect(()=>{const o=i.current;if(i.current=t,o===null)return;const r=new Map;for(const d of o)r.set(d.id,d);const u=new Set;for(const d of t){u.add(d.id);const p=r.get(d.id);if(p&&p.status!==d.status&&d.status!=="sleeping"){if(d.status==="connecting"){a("Provisioning environment…","info");continue}d.status==="connected"?a("Environment connected","success"):d.status==="error"?a("Environment provision failed","error"):d.status==="disconnected"&&(p.status==="connected"?a("Environment disconnected","warning"):a("Environment stopped","info"))}}for(const d of o)u.has(d.id)||a("Environment removed","info")},[t,a])}function jM(t,a,i){const o=t.filter(m=>m.status==="running"||m.status==="idle"||m.status==="waiting").length,r=w_(a),u=a.filter(m=>eh(m,r)).length,d=a.filter(m=>m.status==="paused"||m.status==="failed"||eh(m,r)).length,p=i.filter(m=>m.status==="disconnected"||m.status==="error").length;return{activeSessions:o,blockedTasks:u,attentionTasks:d,unhealthyEnvironments:p}}function w_(t){const a=new Map;for(const i of t)a.set(i.id,i.status);return a}function eh(t,a){return t.dependsOn.some(i=>a.get(i)!=="complete")}function wM(t,a){var d;const i=new Map;for(const p of a)i.set(p.id,p);const o=w_(t),r=[];for(const p of t){const m=p.workspaceId?((d=i.get(p.workspaceId))==null?void 0:d.name)??"Unknown":"Unknown";p.status==="failed"?r.push({task:p,reason:"failed",workspaceName:m}):eh(p,o)?r.push({task:p,reason:"blocked",workspaceName:m}):p.status==="paused"&&r.push({task:p,reason:"paused",workspaceName:m})}const u={failed:0,blocked:1,paused:2};return r.sort((p,m)=>(u[p.reason]??3)-(u[m.reason]??3)),r}function AM(t,a){const i=new Map;for(const o of a)i.set(o.id,o);return t.filter(o=>o.status==="running"||o.status==="idle"||o.status==="waiting").map(o=>{var r;return{session:o,environmentName:((r=i.get(o.environmentId))==null?void 0:r.displayName)??"Unknown"}})}function DM(t,a,i){const o=new Map;for(const r of a){if(!r.workspaceId)continue;let u=o.get(r.workspaceId);u||(u={totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0},o.set(r.workspaceId,u)),u.totalTasks+=1,r.status==="complete"?u.completedTasks+=1:r.status==="working"?u.workingTasks+=1:r.status==="failed"&&(u.failedTasks+=1)}return t.map(r=>{const u=o.get(r.id)??{totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0};return{workspace:r,totalTasks:u.totalTasks,completedTasks:u.completedTasks,workingTasks:u.workingTasks,failedTasks:u.failedTasks}})}const RM="_dashboard_16pzm_1",MM="_kpiStrip_16pzm_11",OM="_kpiCard_16pzm_23",BM="_kpiValue_16pzm_68",IM="_kpiLabel_16pzm_76",LM="_bodyGrid_16pzm_84",UM="_section_16pzm_96",zM="_sectionHeader_16pzm_109",VM="_sectionIcon_16pzm_118",HM="_sectionTitle_16pzm_123",PM="_sectionCount_16pzm_131",GM="_sectionBody_16pzm_138",$M="_emptyHint_16pzm_143",FM="_sessionRow_16pzm_150",qM="_sessionPrompt_16pzm_177",KM="_sessionEnv_16pzm_186",YM="_sessionRuntime_16pzm_192",ZM="_sessionStatus_16pzm_198",XM="_statusDot_16pzm_207",QM="_attentionRow_16pzm_233",WM="_attentionTitle_16pzm_259",JM="_attentionMeta_16pzm_267",e3="_reasonBadge_16pzm_274",t3="_bottomGrid_16pzm_301",n3="_envRow_16pzm_312",a3="_envName_16pzm_323",s3="_envStatusBadge_16pzm_333",i3="_workspaceRow_16pzm_369",o3="_workspaceTop_16pzm_395",l3="_workspaceName_16pzm_401",r3="_workspaceCounts_16pzm_407",c3="_progressBar_16pzm_415",u3="_progressFill_16pzm_422",me={dashboard:RM,kpiStrip:MM,kpiCard:OM,kpiValue:BM,kpiLabel:IM,bodyGrid:LM,section:UM,sectionHeader:zM,sectionIcon:VM,sectionTitle:HM,sectionCount:PM,sectionBody:GM,emptyHint:$M,sessionRow:FM,sessionPrompt:qM,sessionEnv:KM,sessionRuntime:YM,sessionStatus:ZM,statusDot:XM,attentionRow:QM,attentionTitle:WM,attentionMeta:JM,reasonBadge:e3,bottomGrid:t3,envRow:n3,envName:a3,envStatusBadge:s3,workspaceRow:i3,workspaceTop:o3,workspaceName:l3,workspaceCounts:r3,progressBar:c3,progressFill:u3},d3={hidden:{opacity:0,y:12},visible:t=>({opacity:1,y:0,transition:{delay:t*.06,duration:.3,ease:"easeOut"}})},Jr={hidden:{opacity:0,y:16},visible:t=>({opacity:1,y:0,transition:{delay:.15+t*.08,duration:.35,ease:"easeOut"}})};function f3(t,a,i,o){const r=[`${t} of ${a} tasks completed`];return i>0&&r.push(`${i} in progress`),o>0&&r.push(`${o} failed`),r.join(", ")}function ec({value:t,label:a,accent:i,index:o,testId:r}){return c.jsxs(Ct.div,{className:me.kpiCard,"data-accent":i,"data-testid":r,variants:d3,initial:"hidden",animate:"visible",custom:o,children:[c.jsx("span",{className:me.kpiValue,children:t}),c.jsx("span",{className:me.kpiLabel,children:a})]})}function h3(){const{workspaces:t,tasks:a,sessions:i,environments:o,loadTasks:r}=qe(),u=Dt(),d=x.useRef(new Set);x.useEffect(()=>{for(const y of t)d.current.has(y.id)||(d.current.add(y.id),r(y.id))},[t,r]);const p=x.useMemo(()=>jM(i,a,o),[i,a,o]),m=x.useMemo(()=>AM(i,o),[i,o]),g=x.useMemo(()=>wM(a,t),[a,t]),v=x.useMemo(()=>DM(t,a),[t,a,o]);return c.jsxs("div",{className:me.dashboard,"data-testid":"dashboard",children:[c.jsxs("div",{className:me.kpiStrip,"data-testid":"dashboard-kpi-strip",children:[c.jsx(ec,{value:p.activeSessions,label:"Active Sessions",accent:"green",index:0,testId:"kpi-active-sessions"}),c.jsx(ec,{value:p.blockedTasks,label:"Blocked Tasks",accent:"yellow",index:1,testId:"kpi-blocked-tasks"}),c.jsx(ec,{value:p.attentionTasks,label:"Needs Attention",accent:"red",index:2,testId:"kpi-attention-tasks"}),c.jsx(ec,{value:p.unhealthyEnvironments,label:"Unhealthy Envs",accent:"blue",index:3,testId:"kpi-unhealthy-envs"})]}),c.jsxs("div",{className:me.bodyGrid,children:[c.jsxs(Ct.div,{className:me.section,variants:Jr,initial:"hidden",animate:"visible",custom:0,"data-testid":"dashboard-active-sessions",children:[c.jsxs("div",{className:me.sectionHeader,children:[c.jsx("span",{className:me.sectionIcon,"aria-hidden":"true",children:"●"}),c.jsx("span",{className:me.sectionTitle,children:"Active Sessions"}),c.jsx("span",{className:me.sectionCount,children:m.length})]}),c.jsx("div",{className:me.sectionBody,children:m.length===0?c.jsx("div",{className:me.emptyHint,children:"No active sessions"}):m.map(({session:y,environmentName:b})=>c.jsxs("button",{type:"button",className:me.sessionRow,onClick:()=>u(_b(y.id)),"data-testid":"session-row",children:[c.jsx("span",{className:me.sessionPrompt,title:y.prompt,children:y.prompt||"—"}),c.jsx("span",{className:me.sessionEnv,children:b}),c.jsx("span",{className:me.sessionRuntime,children:y.runtime}),c.jsxs("span",{className:me.sessionStatus,children:[c.jsx("span",{className:me.statusDot,"data-status":y.status}),y.status]})]},y.id))})]}),c.jsxs(Ct.div,{className:me.section,variants:Jr,initial:"hidden",animate:"visible",custom:1,"data-testid":"dashboard-needs-attention",children:[c.jsxs("div",{className:me.sectionHeader,children:[c.jsx("span",{className:me.sectionIcon,"aria-hidden":"true",children:"⚑"}),c.jsx("span",{className:me.sectionTitle,children:"Needs Attention"}),c.jsx("span",{className:me.sectionCount,children:g.length})]}),c.jsx("div",{className:me.sectionBody,children:g.length===0?c.jsx("div",{className:me.emptyHint,children:"All clear"}):g.map(({task:y,reason:b,workspaceName:S})=>c.jsxs("button",{type:"button",className:me.attentionRow,onClick:()=>u(_a(y.id)),"data-testid":"attention-row",children:[c.jsxs("div",{className:me.attentionTitle,children:[c.jsx("span",{className:me.reasonBadge,"data-reason":b,children:b}),y.title]}),c.jsx("div",{className:me.attentionMeta,children:c.jsx("span",{children:S})})]},y.id))})]})]}),c.jsxs("div",{className:me.bottomGrid,children:[c.jsxs(Ct.div,{className:me.section,variants:Jr,initial:"hidden",animate:"visible",custom:2,"data-testid":"dashboard-env-health",children:[c.jsxs("div",{className:me.sectionHeader,children:[c.jsx("span",{className:me.sectionIcon,"aria-hidden":"true",children:"◈"}),c.jsx("span",{className:me.sectionTitle,children:"Environment Health"}),c.jsx("span",{className:me.sectionCount,children:o.length})]}),c.jsx("div",{className:me.sectionBody,children:o.length===0?c.jsx("div",{className:me.emptyHint,children:"No environments configured"}):o.map(y=>c.jsxs("div",{className:me.envRow,"data-testid":"dashboard-env-row",children:[c.jsx("span",{className:me.envName,children:y.displayName}),c.jsx("span",{className:me.envStatusBadge,"data-status":y.status,children:y.status})]},y.id))})]}),c.jsxs(Ct.div,{className:me.section,variants:Jr,initial:"hidden",animate:"visible",custom:3,"data-testid":"dashboard-workspace-snapshot",children:[c.jsxs("div",{className:me.sectionHeader,children:[c.jsx("span",{className:me.sectionIcon,"aria-hidden":"true",children:"▦"}),c.jsx("span",{className:me.sectionTitle,children:"Workspaces"}),c.jsx("span",{className:me.sectionCount,children:t.length})]}),c.jsx("div",{className:me.sectionBody,children:v.length===0?c.jsx("div",{className:me.emptyHint,children:"No workspaces yet"}):v.map(({workspace:y,totalTasks:b,completedTasks:S,workingTasks:T,failedTasks:E})=>{const N=b>0?Math.round(S/b*100):0;return c.jsxs("button",{type:"button",className:me.workspaceRow,onClick:()=>u(Hi(y.id,y.environmentId)),"data-testid":"workspace-row",children:[c.jsxs("div",{className:me.workspaceTop,children:[c.jsx("span",{className:me.workspaceName,children:y.name}),c.jsxs("span",{className:me.workspaceCounts,"aria-label":f3(S,b,T,E),children:[S,"/",b,T>0&&c.jsxs("span",{style:{color:"var(--accent-green)"},"aria-hidden":"true",children:["▸",T]}),E>0&&c.jsxs("span",{style:{color:"var(--accent-red)"},"aria-hidden":"true",children:["✗",E]})]})]}),b>0&&c.jsx("div",{className:me.progressBar,children:c.jsx("div",{className:me.progressFill,style:{width:`${N}%`}})})]},y.id)})})]})]})]})}const p3="_panelContainer_aei9x_1",m3="_emptyState_aei9x_8",g3="_fadeIn_aei9x_1",v3="_workspaceSummary_aei9x_17",y3="_workspaceSummaryTitle_aei9x_28",b3="_workspaceSummarySubtitle_aei9x_32",x3="_header_aei9x_36",_3="_headerInfo_aei9x_69",S3="_killButton_aei9x_75",T3="_headerTitle_aei9x_104",k3="_headerActions_aei9x_119",C3="_taskStatusBadge_aei9x_126",E3="_taskBranch_aei9x_135",N3="_taskBlockedBadge_aei9x_141",j3="_btnPrimary_aei9x_149",w3="_btnDanger_aei9x_180",A3="_btnGhost_aei9x_219",D3="_rejectInput_aei9x_245",R3="_tabBar_aei9x_275",M3="_tab_aei9x_275",O3="_active_aei9x_301",B3="_eventScroll_aei9x_306",I3="_tabContent_aei9x_312",L3="_noContext_aei9x_317",U3="_overviewContent_aei9x_323",z3="_overviewDashboard_aei9x_332",V3="_overviewHero_aei9x_338",H3="_statusBadge_aei9x_345",P3="_statusPending_aei9x_357",G3="_statusAssigned_aei9x_362",$3="_statusInProgress_aei9x_367",F3="_statusReview_aei9x_372",q3="_statusDone_aei9x_377",K3="_statusFailed_aei9x_382",Y3="_statusWaitingInput_aei9x_387",Z3="_overviewBranchPill_aei9x_392",X3="_branchLink_aei9x_407",Q3="_overviewSection_aei9x_418",W3="_overviewLabel_aei9x_424",J3="_overviewValue_aei9x_431",eO="_overviewMuted_aei9x_436",tO="_overviewMarkdown_aei9x_442",nO="_envRow_aei9x_511",aO="_envDot_aei9x_517",sO="_envDotGreen_aei9x_524",iO="_envDotYellow_aei9x_528",oO="_envDotRed_aei9x_532",lO="_envDotGray_aei9x_536",rO="_depList_aei9x_540",cO="_depItem_aei9x_546",uO="_depBlocked_aei9x_553",dO="_depDone_aei9x_557",fO="_timeline_aei9x_561",hO="_timelineRow_aei9x_567",pO="_timelineKey_aei9x_574",mO="_timelineValue_aei9x_580",gO="_timelineDelta_aei9x_584",vO="_reviewNotes_aei9x_595",yO="_overviewDescription_aei9x_606",bO="_waitingMessage_aei9x_612",xO="_errorMessage_aei9x_616",_O="_eventOverflowWarning_aei9x_620",SO="_attemptSelector_aei9x_634",TO="_attemptLabel_aei9x_650",kO="_attemptButton_aei9x_654",CO="_attemptActive_aei9x_671",EO="_attemptStatus_aei9x_677",NO="_emptyCta_aei9x_683",jO="_ctaTitle_aei9x_695",wO="_ctaDescription_aei9x_701",AO="_ctaButton_aei9x_708",DO="_ctaCreateForm_aei9x_743",RO="_ctaCreateInput_aei9x_749",MO="_ctaCreateOk_aei9x_780",OO="_ctaLink_aei9x_815",BO="_workspaceHeader_aei9x_829",IO="_workspaceName_aei9x_854",LO="_workspaceMeta_aei9x_867",UO="_metaRow_aei9x_875",zO="_metaLabel_aei9x_888",VO="_metaValue_aei9x_903",HO="_archiveButton_aei9x_913",PO="_repoLink_aei9x_943",GO="_metaToggle_aei9x_953",$O="_metaToggleArrow_aei9x_974",FO="_metaToggleArrowOpen_aei9x_979",qO="_progressBarContainer_aei9x_983",KO="_progressBar_aei9x_983",YO="_progressFill_aei9x_999",ZO="_progressLabel_aei9x_1006",XO="_metaTimestamps_aei9x_1013",QO="_metaTimestamp_aei9x_1013",U={panelContainer:p3,emptyState:m3,fadeIn:g3,workspaceSummary:v3,workspaceSummaryTitle:y3,workspaceSummarySubtitle:b3,header:x3,headerInfo:_3,killButton:S3,headerTitle:T3,headerActions:k3,taskStatusBadge:C3,taskBranch:E3,taskBlockedBadge:N3,btnPrimary:j3,btnDanger:w3,btnGhost:A3,rejectInput:D3,tabBar:R3,tab:M3,active:O3,eventScroll:B3,tabContent:I3,noContext:L3,overviewContent:U3,overviewDashboard:z3,overviewHero:V3,statusBadge:H3,statusPending:P3,statusAssigned:G3,statusInProgress:$3,statusReview:F3,statusDone:q3,statusFailed:K3,statusWaitingInput:Y3,overviewBranchPill:Z3,branchLink:X3,overviewSection:Q3,overviewLabel:W3,overviewValue:J3,overviewMuted:eO,overviewMarkdown:tO,envRow:nO,envDot:aO,envDotGreen:sO,envDotYellow:iO,envDotRed:oO,envDotGray:lO,depList:rO,depItem:cO,depBlocked:uO,depDone:dO,timeline:fO,timelineRow:hO,timelineKey:pO,timelineValue:mO,timelineDelta:gO,reviewNotes:vO,overviewDescription:yO,waitingMessage:bO,errorMessage:xO,eventOverflowWarning:_O,attemptSelector:SO,attemptLabel:TO,attemptButton:kO,attemptActive:CO,attemptStatus:EO,emptyCta:NO,ctaTitle:jO,ctaDescription:wO,ctaButton:AO,ctaCreateForm:DO,ctaCreateInput:RO,ctaCreateOk:MO,ctaLink:OO,workspaceHeader:BO,workspaceName:IO,workspaceMeta:LO,metaRow:UO,metaLabel:zO,metaValue:VO,archiveButton:HO,repoLink:PO,metaToggle:GO,metaToggleArrow:$O,metaToggleArrowOpen:FO,progressBarContainer:qO,progressBar:KO,progressFill:YO,progressLabel:ZO,metaTimestamps:XO,metaTimestamp:QO};function WO(){return c.jsx("div",{className:U.emptyState,children:"Select a task or click + to create one"})}function JO(){return c.jsx("div",{className:U.emptyState,children:"Select an environment to manage its workspaces, or add a new one."})}function eB(){const{workspaces:t,environments:a}=qe(),i=Dt(),o=a.length>0;return t.length>0?c.jsx(h3,{}):c.jsxs("div",{className:U.emptyCta,"data-testid":"welcome-cta",children:[c.jsx("div",{className:U.ctaTitle,children:"Welcome to Grackle"}),c.jsx("div",{className:U.ctaDescription,children:"Organize your work into workspaces and let agents tackle the tasks."}),c.jsx("button",{className:U.ctaButton,onClick:()=>i(Tb),disabled:!o,"data-testid":"welcome-create-button",children:"Create Your First Workspace"}),!o&&c.jsx("div",{className:U.ctaDescription,children:"Add an environment first before creating a workspace."})]})}const A_=50;function tB(t,a,i,o,r=A_){return o?t<r:a-t-i<r}function nB(t,a){const i=a-t;return i>0?i:0}function aB({scrollRef:t,contentLength:a,isReversed:i}){const[o,r]=x.useState(!0),u=x.useRef(0),d=x.useRef(!1),p=x.useRef(0);x.useEffect(()=>{const g=t.current;if(!g)return;let v=!0;const y=()=>{p.current||(p.current=requestAnimationFrame(()=>{p.current=0;const b=tB(g.scrollTop,g.scrollHeight,g.clientHeight,i,A_);b!==v&&(v=b,r(b))}))};return g.addEventListener("scroll",y,{passive:!0}),()=>{g.removeEventListener("scroll",y),p.current&&(cancelAnimationFrame(p.current),p.current=0)}},[t,i]),x.useLayoutEffect(()=>{const g=t.current;!g||d.current||(d.current=!0,i?g.scrollTop=0:g.scrollTop=g.scrollHeight,r(!0))},[t,i]),x.useLayoutEffect(()=>{const g=t.current;if(g){if(i&&!o){const v=nB(u.current,g.scrollHeight);v>0&&(g.scrollTop+=v)}o&&(i?g.scrollTo({top:0,behavior:"smooth"}):g.scrollTo({top:g.scrollHeight,behavior:"smooth"})),u.current=g.scrollHeight}},[a,o,i,t]);const m=x.useCallback(()=>{const g=t.current;if(!g)return;const v=i?0:g.scrollHeight;g.scrollTo({top:v,behavior:"smooth"}),r(!0)},[t,i]);return{isAtAnchor:o,scrollToAnchor:m}}const sB="_wrapper_p24zt_1",iB="_scrollContainer_p24zt_9",oB="_toolbar_p24zt_15",lB="_directionToggle_p24zt_22",rB="_scrollToAnchor_p24zt_60",cB="_scrollToAnchorBottom_p24zt_84",uB="_scrollToAnchorTop_p24zt_88",js={wrapper:sB,scrollContainer:iB,toolbar:oB,directionToggle:lB,scrollToAnchor:rB,scrollToAnchorBottom:cB,scrollToAnchorTop:uB},D_="grackle-stream-direction";function dB(){try{return localStorage.getItem(D_)==="reversed"}catch{return!1}}function fB({eventsDropped:t}){return t<=0?c.jsx(c.Fragment,{}):c.jsxs("div",{className:U.eventOverflowWarning,role:"alert",children:["⚠"," ",t.toLocaleString()," older event",t===1?"":"s"," were dropped — only the most recent 5,000 are shown. Full history is available in the session log."]})}function Zh({events:t,eventsDropped:a,emptyState:i}){const o=x.useRef(null),[r,u]=x.useState(dB),d=HA(),p=x.useMemo(()=>r?[...t].reverse():t,[t,r]),{isAtAnchor:m,scrollToAnchor:g}=aB({scrollRef:o,contentLength:t.length,isReversed:r}),v=()=>{const S=!r;u(S);try{localStorage.setItem(D_,S?"reversed":"default")}catch{}},y=d?0:.2,b=r?-8:8;return c.jsxs("div",{className:js.wrapper,children:[c.jsx("div",{className:js.toolbar,children:c.jsx("button",{className:js.directionToggle,onClick:v,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:o,className:js.scrollContainer,"data-testid":"event-stream-scroll",children:[t.length===0&&i,c.jsx(fB,{eventsDropped:a}),c.jsx(Qn,{initial:!1,children:p.map((S,T)=>{const E=r?t.length-1-T:T;return c.jsx(Ct.div,{initial:{opacity:0,y:b},animate:{opacity:1,y:0},transition:{duration:y,ease:"easeOut"},children:c.jsx(dM,{event:S,toolUseCtx:S.toolUseCtx})},`${S.sessionId}-${S.timestamp}-${E}`)})})]}),c.jsx(Qn,{children:!m&&c.jsxs(Ct.button,{className:`${js.scrollToAnchor} ${r?js.scrollToAnchorTop:js.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"]})})]})}const hB="_bar_1xhb4_1",pB="_input_1xhb4_32",mB="_select_1xhb4_67",gB="_btnPrimary_1xhb4_103",vB="_btnDanger_1xhb4_134",yB="_btnGhost_1xhb4_173",bB="_badge_1xhb4_195",xB="_disconnectHint_1xhb4_205",en={bar:hB,input:pB,select:mB,btnPrimary:gB,btnDanger:vB,btnGhost:yB,badge:bB,disconnectHint:xB};function _B(t,a){if(!t)return!1;const i=a.find(o=>o.id===t);return i!==void 0&&(i.status==="disconnected"||i.status==="error")}function SB({environmentId:t,onReconnect:a}){return c.jsxs(c.Fragment,{children:[c.jsx("span",{className:en.disconnectHint,"data-testid":"env-disconnect-hint",children:"Environment unavailable"}),c.jsx("button",{type:"button",onClick:()=>a(t),className:en.btnGhost,"data-testid":"reconnect-btn",title:"Reconnect the environment to resume messaging",children:"Reconnect"})]})}function xl({mode:t,sessionId:a,environmentId:i,taskId:o,showStop:r,showPersonaSelect:u,onSessionKill:d}){const{sendInput:p,spawn:m,startTask:g,personas:v,environments:y,provisionEnvironment:b}=qe(),{showToast:S}=Us(),[T,E]=x.useState(""),[N,C]=x.useState(""),j=_B(i,y),D=R=>{if(R.preventDefault(),!!T.trim())if(t==="send"){if(!a||j)return;p(a,T),E("")}else if(t==="spawn"){if(!i)return;m(i,T,N),S("Session started","success"),E(""),C("")}else{if(!o)return;g(o,void 0,i,T),E("")}};return t==="spawn"?c.jsxs("form",{onSubmit:D,className:en.bar,children:[c.jsx("span",{className:en.badge,children:"new chat"}),c.jsx("input",{type:"text",value:T,onChange:R=>E(R.target.value),placeholder:"Enter prompt...",autoFocus:!0,className:en.input}),u&&c.jsxs("select",{value:N,onChange:R=>C(R.target.value),className:en.select,children:[c.jsx("option",{value:"",children:"(Default)"}),v.map(R=>c.jsx("option",{value:R.id,children:R.name},R.id))]}),c.jsx("button",{type:"submit",disabled:!T.trim()||!i,className:en.btnPrimary,children:"Go"})]}):t==="start"?c.jsxs("form",{onSubmit:D,className:en.bar,children:[c.jsx("input",{type:"text",value:T,onChange:R=>E(R.target.value),placeholder:"Type a message...",autoFocus:!0,className:en.input}),c.jsx("button",{type:"submit",disabled:!T.trim(),className:en.btnPrimary,children:"Send"})]}):c.jsxs("form",{onSubmit:D,className:en.bar,children:[j&&i&&c.jsx(SB,{environmentId:i,onReconnect:b}),c.jsx("input",{type:"text",value:T,onChange:R=>E(R.target.value),placeholder:"Type a message...",autoFocus:!j,disabled:j,className:en.input}),c.jsx("span",{title:j?"Environment is unavailable — reconnect first":void 0,children:c.jsx("button",{type:"submit",disabled:!T.trim()||j,className:en.btnPrimary,children:"Send"})}),r&&d&&c.jsx("button",{type:"button",onClick:d,className:en.btnDanger,title:"Stop session",children:"Stop"})]})}function Xh(t){const a=[];for(const i of t){const o=a[a.length-1];i.eventType==="text"&&(o==null?void 0:o.eventType)==="text"?a[a.length-1]={...o,content:o.content+i.content}:a.push(i)}return a}function Qh(t){const a=new Map;for(const u of t)if(u.raw)try{a.set(u,JSON.parse(u.raw))}catch{}const i=new Map;for(const u of t){if(u.eventType!=="tool_use")continue;const d=a.get(u);if(!(!d||typeof d.id!="string"))try{const p=JSON.parse(u.content);i.set(d.id,{tool:p.tool,args:p.args})}catch{}}const o=new Set;return t.map(u=>{if(u.eventType!=="tool_result")return u;const d=a.get(u);if(!d||typeof d.tool_use_id!="string")return u;const p=i.get(d.tool_use_id);return p?(o.add(d.tool_use_id),{...u,toolUseCtx:p}):u}).filter(u=>{if(u.eventType!=="tool_use")return!0;const d=a.get(u);return d&&typeof d.id=="string"?!o.has(d.id):!0})}const TB="_panelContainer_pz4cr_1",kB="_emptyState_pz4cr_8",CB="_emptyTitle_pz4cr_20",EB="_emptyDescription_pz4cr_26",NB="_emptyHint_pz4cr_32",al={panelContainer:TB,emptyState:kB,emptyTitle:CB,emptyDescription:EB,emptyHint:NB};function jB({hasLocalEnvironment:t}){return c.jsxs("div",{className:al.emptyState,"data-testid":"chat-empty-state",children:[c.jsx("div",{className:al.emptyTitle,children:"Welcome to Grackle"}),c.jsx("div",{className:al.emptyDescription,children:t?"Type a message below to start chatting with the System agent. It can help you plan work, create tasks, and coordinate agents.":"Add a local environment in Settings to start chatting."}),!t&&c.jsx("div",{className:al.emptyHint,children:"Go to Settings → Environments to add one."})]})}function wB(){const{tasks:t,sessions:a,events:i,eventsDropped:o,environments:r,loadTaskSessions:u,loadSessionEvents:d,kill:p,taskSessions:m}=qe(),g=x.useRef(void 0),v=t.find(E=>E.id===Qo),y=v!=null&&v.latestSessionId?a.find(E=>E.id===v.latestSessionId)??(m[Qo]??[]).find(E=>E.id===v.latestSessionId):void 0;x.useEffect(()=>{u(Qo)},[u]),x.useEffect(()=>{v!=null&&v.latestSessionId&&u(Qo)},[v==null?void 0:v.latestSessionId,u]),x.useEffect(()=>{y&&y.id!==g.current&&(g.current=y.id,d(y.id))},[y==null?void 0:y.id,d]);const b=x.useMemo(()=>{if(!y)return[];const E=i.filter(N=>N.sessionId===y.id);return Qh(Xh(E))},[i,y==null?void 0:y.id]),S=r.find(E=>E.adapterType==="local"&&E.status==="connected"),T=y!==void 0&&y.status!=="stopped"&&y.status!=="suspended";return c.jsxs("div",{className:al.panelContainer,"data-testid":"chat-page",children:[c.jsx(Zh,{events:b,eventsDropped:o,emptyState:c.jsx(jB,{hasLocalEnvironment:!!S})}),S&&T&&c.jsx(xl,{mode:"send",sessionId:y.id,environmentId:y.environmentId,showStop:!0,onSessionKill:()=>p(y.id)}),S&&!T&&c.jsx(xl,{mode:"start",taskId:Qo,environmentId:S.id})]})}function AB(t,a){const i=[];let o=t;const r=new Set;for(;o&&a.has(o)&&!r.has(o);){r.add(o);const u=a.get(o);i.unshift(u),o=u.parentTaskId||void 0}return i}const Bs={label:"Home",url:Os};function DB(t){return t?[Bs,{label:"Settings",url:il},{label:t,url:void 0}]:[Bs,{label:"Settings",url:void 0}]}const R_={label:"Environments",url:Pi};function RB(){return[Bs,{label:"Environments",url:void 0}]}function MB(){return[Bs,{label:"New Chat",url:void 0}]}function OB(t){return[Bs,{label:`Session ${t.slice(0,8)}`,url:void 0}]}function BB(t,a,i,o){const r=i.find(d=>d.id===t),u=o.find(d=>d.id===a);return[Bs,R_,{label:(u==null?void 0:u.displayName)??"Environment",url:Gi(a)},{label:(r==null?void 0:r.name)??"Workspace",url:void 0}]}function IB(t,a,i,o,r){const u=AB(t,r),d=r.get(t),p=d==null?void 0:d.workspaceId,m=p?i.find(S=>S.id===p):void 0,g=a??(m==null?void 0:m.environmentId),v=g?o.find(S=>S.id===g):void 0,y=[Bs];v&&g&&(y.push(R_),y.push({label:v.displayName,url:Gi(g)})),m&&g&&y.push({label:m.name,url:Hi(m.id,g)});for(let S=0;S<u.length-1;S++)y.push({label:u[S].title,url:_a(u[S].id,void 0,p,g)});const b=u[u.length-1];return y.push({label:(b==null?void 0:b.title)??t,url:void 0}),y}function LB(){const t=MB(),[a]=uh(),i=a.get("env")??"";return c.jsxs("div",{className:U.panelContainer,children:[c.jsx(Vs,{segments:t}),c.jsx("div",{className:U.emptyState,children:"Enter a prompt below to start a new session"}),c.jsx(xl,{mode:"spawn",environmentId:i,showPersonaSelect:!0})]})}function UB({sessionId:t,session:a,isActive:i,onKill:o}){return c.jsxs("div",{className:U.header,children:[c.jsxs("span",{children:["Session: ",t.slice(0,8),a&&` | ${a.runtime} | ${a.endReason||a.status}`,a!=null&&a.inputTokens||a!=null&&a.outputTokens||a!=null&&a.costUsd?` | ${E_((a.inputTokens??0)+(a.outputTokens??0))} tokens · ${Ki(a.costUsd??0)}`:""]}),c.jsxs("span",{className:U.headerInfo,children:[a&&c.jsx("span",{children:a.prompt.length>60?a.prompt.slice(0,60)+"...":a.prompt}),i&&c.jsx("button",{onClick:()=>o(t),title:"Stop session",className:U.killButton,children:"×"})]})]})}function zB({session:t}){const a=t&&(t.status==="stopped"||t.status==="suspended"),i=a?`Session ${t.endReason||t.status} with no events recorded.`:"Waiting for events...";return c.jsx("div",{className:a?U.errorMessage:U.waitingMessage,children:i})}function VB(){const{sessionId:t}=ss(),{events:a,eventsDropped:i,sessions:o,kill:r,loadSessionEvents:u}=qe(),d=x.useRef(void 0),p=OB(t),m=o.find(y=>y.id===t)??void 0,g=x.useMemo(()=>{const y=t?a.filter(b=>b.sessionId===t):[];return Qh(Xh(y))},[a,t]);if(x.useEffect(()=>{t&&t!==d.current&&(d.current=t,u(t))},[t,u]),!t)return c.jsx("div",{className:U.emptyState,children:"No session selected"});const v=(m==null?void 0:m.status)==="running"||(m==null?void 0:m.status)==="idle";return c.jsxs("div",{className:U.panelContainer,children:[c.jsx(Vs,{segments:p}),c.jsx(UB,{sessionId:t,session:m,isActive:v,onKill:r}),c.jsx(Zh,{events:g,eventsDropped:i,emptyState:c.jsx(zB,{session:m})}),v&&c.jsx(xl,{mode:"send",sessionId:t,environmentId:m.environmentId,showStop:!0,onSessionKill:()=>r(t)})]})}const K0=220,Y0=70,HB=40,PB=60,GB="hierarchy",$B="dependency";function FB(t){return x.useMemo(()=>{if(t.length===0)return{nodes:[],edges:[]};const a=new Zv.graphlib.Graph({multigraph:!0});a.setDefaultEdgeLabel(()=>({})),a.setGraph({rankdir:"TB",nodesep:HB,ranksep:PB});const i=new Map(t.map(d=>[d.id,d])),o=new Map;for(const d of t)if(d.parentTaskId&&i.has(d.parentTaskId)){const p=o.get(d.parentTaskId)||[];p.push(d),o.set(d.parentTaskId,p)}for(const d of t)a.setNode(d.id,{width:K0,height:Y0});const r=[];for(const d of t){if(d.parentTaskId&&i.has(d.parentTaskId)){const p=`hierarchy-${d.parentTaskId}-${d.id}`;a.setEdge(d.parentTaskId,d.id,{},p),r.push({id:p,source:d.parentTaskId,target:d.id,type:"smoothstep",data:{edgeType:GB},style:{stroke:"var(--accent-green)",strokeWidth:2},animated:!1})}for(const p of d.dependsOn)if(i.has(p)){const m=`dependency-${p}-${d.id}`;a.setEdge(p,d.id,{},m),r.push({id:m,source:p,target:d.id,type:"smoothstep",data:{edgeType:$B},style:{stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeDasharray:"6 3"},animated:!1})}}return Zv.layout(a),{nodes:t.map(d=>{const p=a.node(d.id),m=o.get(d.id)||[];return{id:d.id,type:"task",position:{x:p.x-K0/2,y:p.y-Y0/2},data:{task:d,childCount:m.length,doneChildCount:m.filter(g=>g.status==="complete").length,hasDependencies:d.dependsOn.length>0}}}),edges:r}},[t])}const qB="_dagContainer_js4w6_1",KB="_taskNode_js4w6_26",YB="_taskNodeBorder_js4w6_54",ZB="_taskNodeContent_js4w6_60",XB="_taskNodeHeader_js4w6_70",QB="_taskNodeIcon_js4w6_77",WB="_taskNodeTitle_js4w6_82",JB="_taskNodeBadges_js4w6_90",e6="_childBadge_js4w6_95",t6="_depBadge_js4w6_107",n6="_handle_js4w6_119",a6="_emptyCta_js4w6_126",s6="_ctaDescription_js4w6_137",i6="_ctaButton_js4w6_144",Ft={dagContainer:qB,taskNode:KB,taskNodeBorder:YB,taskNodeContent:ZB,taskNodeHeader:XB,taskNodeIcon:QB,taskNodeTitle:WB,taskNodeBadges:JB,childBadge:e6,depBadge:t6,handle:n6,emptyCta:a6,ctaDescription:s6,ctaButton:i6};function o6({data:t}){const{task:a,childCount:i,doneChildCount:o,hasDependencies:r}=t,u=as(a.status);return c.jsxs("div",{className:Ft.taskNode,"data-task-id":a.id,"data-task-title":a.title,children:[c.jsx(Xv,{type:"target",position:Qv.Top,className:Ft.handle}),c.jsx("div",{className:Ft.taskNodeBorder,style:{backgroundColor:u.color}}),c.jsxs("div",{className:Ft.taskNodeContent,children:[c.jsxs("div",{className:Ft.taskNodeHeader,children:[c.jsx("span",{className:Ft.taskNodeIcon,style:{color:u.color},children:u.icon}),c.jsx("span",{className:Ft.taskNodeTitle,children:a.title})]}),c.jsxs("div",{className:Ft.taskNodeBadges,children:[i>0&&c.jsxs("span",{className:Ft.childBadge,children:[o,"/",i]}),r&&c.jsx("span",{className:Ft.depBadge,children:"dep"})]})]}),c.jsx(Xv,{type:"source",position:Qv.Bottom,className:Ft.handle})]})}const l6=M2,r6={task:o6};function c6({workspaceId:t,environmentId:a}){const{tasks:i}=qe(),o=Dt(),{resolvedThemeId:r}=Db(),u=x.useMemo(()=>i.filter(y=>y.workspaceId===t),[i,t]),{nodes:d,edges:p}=FB(u),m=x.useMemo(()=>{const y=getComputedStyle(document.documentElement),b={};for(const[S,T]of Object.entries(l6))b[S]=y.getPropertyValue(T).trim()||"#6b7a8d";return b},[r]),g=x.useCallback((y,b)=>{o(_a(b.id,void 0,t,a))},[o,t,a]),v=x.useCallback(y=>{const b=y.data;return m[b.task.status]||m.pending},[m]);return u.length===0?c.jsxs("div",{className:Ft.emptyCta,children:[c.jsx("button",{className:Ft.ctaButton,onClick:()=>o(Xi(t,void 0,a)),children:"Create Task"}),c.jsx("div",{className:Ft.ctaDescription,children:"Create tasks to see the dependency graph"})]}):c.jsx("div",{className:Ft.dagContainer,children:c.jsxs(tT,{nodes:d,edges:p,nodeTypes:r6,onNodeClick:g,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,children:[c.jsx(nT,{variant:aT.Dots,gap:24,size:1,color:"var(--text-disabled)"}),c.jsx(sT,{showInteractive:!1}),c.jsx(iT,{nodeColor:v,maskColor:"var(--bg-overlay)",style:{background:"var(--bg-inset)"}})]})})}function u6({tasks:t,taskStatusById:a,sessionStatusByTaskId:i}){const o=new Map;for(const u of t)if(u.parentTaskId){const d=o.get(u.parentTaskId);d?d.push(u):o.set(u.parentTaskId,[u])}const r=new Map(V0.map(u=>[u,[]]));for(const u of t){const d=Yh(u.status),p=u.dependsOn.length>0&&u.dependsOn.some(T=>a.get(T)!=="complete"),m=o.get(u.id)??[],g=m.length,v=m.filter(T=>T.status==="complete").length;let y;if(d==="paused"&&i){const T=i.get(u.id);T==="idle"?y="Needs input":T==="completed"&&(y="Ready to complete")}const b={task:u,isBlocked:p,childCount:g,doneChildCount:v,pausedSubBadge:y},S=r.get(d);S?S.push(b):r.get("not_started").push(b)}for(const u of r.values())u.sort((d,p)=>d.task.sortOrder-p.task.sortOrder);return V0.map(u=>{const d=as(u);return{status:u,label:d.label,style:d,tasks:r.get(u)??[]}})}const d6="_boardContainer_1c4y1_1",f6="_column_1c4y1_17",h6="_columnHeader_1c4y1_34",p6="_columnIcon_1c4y1_47",m6="_columnLabel_1c4y1_52",g6="_columnCount_1c4y1_57",v6="_cardList_1c4y1_67",y6="_emptyPlaceholder_1c4y1_76",b6="_card_1c4y1_67",x6="_cardHeader_1c4y1_107",_6="_cardStatusIcon_1c4y1_113",S6="_cardTitle_1c4y1_119",T6="_cardBadges_1c4y1_127",k6="_badge_1c4y1_134",C6="_blockedBadge_1c4y1_146",E6="_childBadge_1c4y1_151",N6="_depBadge_1c4y1_155",j6="_parentBadge_1c4y1_159",w6="_pausedSubBadge_1c4y1_166",A6="_personaBadge_1c4y1_170",D6="_envBadge_1c4y1_174",R6="_emptyCta_1c4y1_178",M6="_ctaButton_1c4y1_188",O6="_ctaDescription_1c4y1_204",Ge={boardContainer:d6,column:f6,columnHeader:h6,columnIcon:p6,columnLabel:m6,columnCount:g6,cardList:v6,emptyPlaceholder:y6,card:b6,cardHeader:x6,cardStatusIcon:_6,cardTitle:S6,cardBadges:T6,badge:k6,blockedBadge:C6,childBadge:E6,depBadge:N6,parentBadge:j6,pausedSubBadge:w6,personaBadge:A6,envBadge:D6,emptyCta:R6,ctaButton:M6,ctaDescription:O6};function B6({workspaceId:t,environmentId:a}){const{tasks:i,sessions:o,personas:r,environments:u}=qe(),d=Dt(),p=x.useMemo(()=>i.filter(b=>b.workspaceId===t),[i,t]),m=x.useMemo(()=>new Map(i.map(b=>[b.id,b.status])),[i]),g=x.useMemo(()=>new Map(p.map(b=>[b.id,b])),[p]),v=x.useMemo(()=>{const b=new Map(o.map(j=>[j.id,j])),S=new Map(r.map(j=>[j.id,j])),T=new Map(u.map(j=>[j.id,j])),E=new Map,N=new Map,C=new Map;for(const j of p)if(j.latestSessionId){const D=b.get(j.latestSessionId);if(D){if(E.set(j.id,D.endReason||D.status),D.personaId){const R=S.get(D.personaId);R&&N.set(j.id,R.name)}if(D.environmentId){const R=T.get(D.environmentId);R&&C.set(j.id,R.displayName)}}}return{sessionStatusByTaskId:E,personaNameByTaskId:N,environmentNameByTaskId:C}},[p,o,r,u]),y=x.useMemo(()=>u6({tasks:p,taskStatusById:m,sessionStatusByTaskId:v.sessionStatusByTaskId}),[p,m,v]);return p.length===0?c.jsxs("div",{className:Ge.emptyCta,"data-testid":"board-empty-cta",children:[c.jsx("button",{className:Ge.ctaButton,onClick:()=>d(Xi(t,void 0,a)),children:"Create Task"}),c.jsx("div",{className:Ge.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}):c.jsx("div",{className:Ge.boardContainer,"data-testid":"board-container",children:y.map(b=>c.jsxs("section",{className:Ge.column,"data-testid":`board-column-${b.status}`,"aria-label":`${b.label}, ${b.tasks.length} ${b.tasks.length===1?"task":"tasks"}`,children:[c.jsxs("div",{className:Ge.columnHeader,children:[c.jsx("span",{className:Ge.columnIcon,style:{color:b.style.color},children:b.style.icon}),c.jsx("span",{className:Ge.columnLabel,children:b.label}),c.jsx("span",{className:Ge.columnCount,"data-testid":`board-count-${b.status}`,children:b.tasks.length})]}),c.jsx("div",{className:Ge.cardList,children:b.tasks.length===0?c.jsx("div",{className:Ge.emptyPlaceholder,children:"No tasks"}):c.jsx(Qn,{mode:"popLayout",children:b.tasks.map(S=>c.jsx(Ct.div,{layout:!0,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},children:c.jsx(I6,{boardTask:S,tasksById:g,personaName:v.personaNameByTaskId.get(S.task.id),envName:v.environmentNameByTaskId.get(S.task.id),onClick:()=>d(_a(S.task.id,void 0,t,a))})},S.task.id))})})]},b.status))})}function I6({boardTask:t,tasksById:a,personaName:i,envName:o,onClick:r}){const{task:u,isBlocked:d,childCount:p,doneChildCount:m,pausedSubBadge:g}=t,v=as(u.status),y=u.parentTaskId?a.get(u.parentTaskId):void 0;return c.jsxs("div",{className:Ge.card,tabIndex:0,role:"button","data-testid":`board-card-${u.id}`,onClick:r,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),r())},children:[c.jsxs("div",{className:Ge.cardHeader,children:[c.jsx("span",{className:Ge.cardStatusIcon,style:{color:v.color},children:v.icon}),c.jsx("span",{className:Ge.cardTitle,children:u.title})]}),c.jsxs("div",{className:Ge.cardBadges,children:[y&&c.jsx("span",{className:`${Ge.badge} ${Ge.parentBadge}`,title:y.title,children:y.title}),p>0&&c.jsxs("span",{className:`${Ge.badge} ${Ge.childBadge}`,children:[m,"/",p]}),d&&c.jsx("span",{className:`${Ge.badge} ${Ge.blockedBadge}`,children:"blocked"}),u.dependsOn.length>0&&!d&&c.jsx("span",{className:`${Ge.badge} ${Ge.depBadge}`,children:"dep"}),g&&c.jsx("span",{className:`${Ge.badge} ${Ge.pausedSubBadge}`,children:g}),i&&c.jsx("span",{className:`${Ge.badge} ${Ge.personaBadge}`,children:i}),o&&c.jsx("span",{className:`${Ge.badge} ${Ge.envBadge}`,children:o})]})]})}function Wh(t){const{value:a,onSave:i,validate:o,fieldId:r,activeFieldId:u,onActivate:d,enterToSave:p=!0,trimOnSave:m=!0}=t,[g,v]=x.useState(""),[y,b]=x.useState(""),S=x.useRef(!1),T=u===r,E=x.useCallback(H=>{v(H),b("")},[]),N=x.useCallback(()=>{b("")},[]),C=x.useCallback(()=>{S.current=!1,d==null||d(null),v(""),b("")},[d]),j=x.useCallback(()=>{const H=m?g.trim():g;if(o){const q=o(g);if(q){b(q);return}}const B=m?a.trim():a;if(H===B){C();return}i(H),C()},[g,a,m,o,i,C]),D=x.useCallback(()=>{S.current=!0,d==null||d(r),v(a),b("")},[r,a,d]),R=x.useCallback(H=>{if(S.current){S.current=!1;return}H.relatedTarget instanceof HTMLElement&&H.relatedTarget.dataset.editAction===r||j()},[r,j]),w=x.useCallback(H=>{H.key==="Escape"?C():H.key==="Enter"&&p&&j()},[C,p,j]),F=(()=>{if(!T)return!1;const H=m?a.trim():a;return(m?g.trim():g)!==H})();return x.useEffect(()=>{!T&&(g!==""||y!=="")&&(v(""),b(""))},[T,g,y]),{isEditing:T,draft:g,error:y,isDirty:F,startEdit:D,cancelEdit:C,save:j,setDraft:E,clearError:N,handleBlur:R,handleKeyDown:w,ignoreInitialBlurRef:S}}const L6="_editFieldWrapper_yuzty_1",U6="_editInput_yuzty_10",z6="_editTextarea_yuzty_42",V6="_editSelect_yuzty_78",H6="_editError_yuzty_111",P6="_editInputInvalid_yuzty_118",G6="_editHint_yuzty_123",$6="_unsavedDot_yuzty_132",F6="_metaValueClickable_yuzty_140",q6="_editButton_yuzty_159",K6="_metaPlaceholder_yuzty_175",Y6="_worktreeToggle_yuzty_180",ze={editFieldWrapper:L6,editInput:U6,editTextarea:z6,editSelect:V6,editError:H6,editInputInvalid:P6,editHint:G6,unsavedDot:$6,metaValueClickable:F6,editButton:q6,metaPlaceholder:K6,worktreeToggle:Y6};function un(t){const{value:a,onSave:i,validate:o,mode:r="edit",fieldId:u="text",activeFieldId:d,onActivate:p,onChange:m,renderDisplay:g,placeholder:v,maxLength:y,ariaLabel:b,"data-testid":S}=t,T=x.useRef(null),E=Wh({value:a,onSave:i,validate:o,fieldId:u,activeFieldId:d,onActivate:p,enterToSave:!0,trimOnSave:!0});if(x.useEffect(()=>{if(E.isEditing){const C=window.setTimeout(()=>{var j;(j=T.current)==null||j.focus()},0);return()=>window.clearTimeout(C)}},[E.isEditing]),r==="create"){const C=D=>{m==null||m(D.target.value)},j=o==null?void 0:o(a);return c.jsxs("div",{className:ze.editFieldWrapper,children:[c.jsx("input",{className:`${ze.editInput} ${j?ze.editInputInvalid:""}`,value:a,onChange:C,maxLength:y,placeholder:v,"aria-label":b,"data-testid":S?`${S}-input`:void 0}),j&&c.jsx("span",{className:ze.editError,"data-testid":"edit-error",children:j})]})}if(E.isEditing)return c.jsxs("div",{className:ze.editFieldWrapper,children:[c.jsx("input",{ref:T,className:`${ze.editInput} ${E.error?ze.editInputInvalid:""}`,value:E.draft,onChange:C=>E.setDraft(C.target.value),onBlur:E.handleBlur,onKeyDown:E.handleKeyDown,maxLength:y,placeholder:v,"aria-label":b,"data-testid":S?`${S}-input`:void 0}),E.isDirty&&c.jsx("span",{className:ze.unsavedDot,title:"Unsaved changes"}),E.error&&c.jsx("span",{className:ze.editError,"data-testid":"edit-error",children:E.error}),c.jsx("span",{className:ze.editHint,children:"Enter to save · Esc to cancel"})]});const N=g==null?void 0:g(a);return c.jsxs("span",{role:"button",tabIndex:0,className:ze.metaValueClickable,onClick:()=>E.startEdit(),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),E.startEdit())},title:"Click to edit","aria-label":b,"data-testid":S?`${S}-button`:void 0,children:[N!==void 0?N:a?c.jsx("span",{children:a}):c.jsx("span",{className:ze.metaPlaceholder,children:v||"None"}),c.jsx("span",{className:ze.editButton,"aria-hidden":"true",children:"✏️"})]})}function Z6(t){const{value:a,onSave:i,validate:o,mode:r="edit",fieldId:u="textarea",activeFieldId:d,onActivate:p,onChange:m,renderDisplay:g,placeholder:v,ariaLabel:y,"data-testid":b}=t,S=x.useRef(null),T=Wh({value:a,onSave:i,validate:o,fieldId:u,activeFieldId:d,onActivate:p,enterToSave:!1,trimOnSave:!1});if(x.useEffect(()=>{if(T.isEditing){const N=window.setTimeout(()=>{var C;(C=S.current)==null||C.focus()},0);return()=>window.clearTimeout(N)}},[T.isEditing]),r==="create"){const N=j=>{m==null||m(j.target.value)},C=o==null?void 0:o(a);return c.jsxs("div",{className:ze.editFieldWrapper,children:[c.jsx("textarea",{className:`${ze.editTextarea} ${C?ze.editInputInvalid:""}`,value:a,onChange:N,placeholder:v,"aria-label":y,"data-testid":b?`${b}-input`:void 0}),C&&c.jsx("span",{className:ze.editError,"data-testid":"edit-error",children:C})]})}if(T.isEditing)return c.jsxs("div",{className:ze.editFieldWrapper,children:[c.jsx("textarea",{ref:S,className:`${ze.editTextarea} ${T.error?ze.editInputInvalid:""}`,value:T.draft,onChange:N=>T.setDraft(N.target.value),onBlur:T.handleBlur,onKeyDown:T.handleKeyDown,title:y,"aria-label":y,"data-testid":b?`${b}-input`:void 0}),T.isDirty&&c.jsx("span",{className:ze.unsavedDot,title:"Unsaved changes"}),T.error&&c.jsx("span",{className:ze.editError,"data-testid":"edit-error",children:T.error}),c.jsx("span",{className:ze.editHint,children:"Tab to save · Esc to cancel"})]});const E=g==null?void 0:g(a);return c.jsxs("span",{role:"button",tabIndex:0,className:ze.metaValueClickable,onClick:()=>T.startEdit(),onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),T.startEdit())},title:"Click to edit","aria-label":y,"data-testid":b?`${b}-button`:void 0,children:[E!==void 0?E:a?c.jsx("span",{children:a}):c.jsx("span",{className:ze.metaPlaceholder,children:v||"None"}),c.jsx("span",{className:ze.editButton,"aria-hidden":"true",children:"✏️"})]})}function M_(t){var D;const{value:a,onSave:i,mode:o="edit",options:r,fieldId:u="select",activeFieldId:d,onActivate:p,onChange:m,renderDisplay:g,placeholder:v,ariaLabel:y,"data-testid":b}=t,S=x.useRef(null),T=Wh({value:a,onSave:i,fieldId:u,activeFieldId:d,onActivate:p,enterToSave:!1,trimOnSave:!1});x.useEffect(()=>{if(T.isEditing){const R=window.setTimeout(()=>{var w;(w=S.current)==null||w.focus()},0);return()=>window.clearTimeout(R)}},[T.isEditing]);const E=x.useCallback(R=>{const w=R.target.value;T.ignoreInitialBlurRef.current=!1,w!==a&&i(w),T.cancelEdit()},[a,i,T]),N=x.useCallback(R=>{if(T.ignoreInitialBlurRef.current){T.ignoreInitialBlurRef.current=!1;return}R.relatedTarget instanceof HTMLElement&&R.relatedTarget.dataset.editAction===u||T.cancelEdit()},[u,T]);if(o==="create")return c.jsx("select",{className:ze.editSelect,value:a,onChange:R=>m==null?void 0:m(R.target.value),"aria-label":y,"data-testid":b?`${b}-select`:void 0,children:r.map(R=>c.jsx("option",{value:R.value,children:R.label},R.value))});if(T.isEditing)return c.jsx("select",{ref:S,className:ze.editSelect,value:T.draft,onChange:E,onBlur:N,title:y,"aria-label":y,"data-testid":b?`${b}-select`:void 0,children:r.map(R=>c.jsx("option",{value:R.value,children:R.label},R.value))});const C=g==null?void 0:g(a),j=(D=r.find(R=>R.value===a))==null?void 0:D.label;return c.jsxs("button",{type:"button",className:ze.metaValueClickable,onClick:()=>T.startEdit(),title:"Click to change","aria-label":y,"data-testid":b?`${b}-button`:void 0,children:[C!==void 0?C:j?c.jsx("span",{children:j}):c.jsx("span",{className:ze.metaPlaceholder,children:v||"None"}),c.jsx("span",{className:ze.editButton,"aria-hidden":"true",children:"✏️"})]})}function X6(t){const{checked:a,onChange:i,label:o,ariaLabel:r,"data-testid":u}=t;return c.jsxs("label",{className:ze.worktreeToggle,"data-testid":u,children:[c.jsx("input",{type:"checkbox",checked:a,onChange:d=>i(d.target.checked),"aria-label":r}),c.jsx("span",{children:o})]})}const Q6="_envRow_1e1r5_1",W6="_envDot_1e1r5_7",J6="_envDotGreen_1e1r5_14",eI="_envDotYellow_1e1r5_18",tI="_envDotRed_1e1r5_22",nI="_envDotGray_1e1r5_26",Vi={envRow:Q6,envDot:W6,envDotGreen:J6,envDotYellow:eI,envDotRed:tI,envDotGray:nI};function aI(t){const a=t.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?Vi.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?Vi.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?Vi.envDotRed:Vi.envDotGray}function sI(t){const{value:a,onSave:i,environments:o,allowNone:r=!1,fieldId:u="environment",activeFieldId:d,onActivate:p,placeholder:m="No environment",ariaLabel:g="Environment","data-testid":v}=t,y=o.find(T=>T.id===a),b=[...r?[{value:"",label:"None"}]:[],...o.map(T=>({value:T.id,label:T.displayName}))],S=()=>{if(y)return c.jsxs("span",{className:Vi.envRow,children:[c.jsx("span",{className:`${Vi.envDot} ${aI(y.status)}`}),y.displayName]})};return c.jsx(M_,{value:a,onSave:i,options:b,fieldId:u,activeFieldId:d,onActivate:p,renderDisplay:S,placeholder:m,ariaLabel:g,"data-testid":v})}function Z0(t){if(!t)return"";const a=new Date(t);if(isNaN(a.getTime()))return"";const o=Date.now()-a.getTime();if(o<0)return"just now";const r=Math.floor(o/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const u=Math.floor(r/60);if(u<24)return`${u}h ago`;const d=Math.floor(u/24);return d<30?`${d}d ago`:a.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}const bf=100;function iI(){const{workspaceId:t,environmentId:a}=ss(),i=Dt(),{tasks:o,environments:r,workspaces:u,personas:d,sessions:p,archiveWorkspace:m,updateWorkspace:g,usageCache:v,loadUsage:y}=qe(),[b,S]=x.useState("tasks"),[T,E]=x.useState(!1),[N,C]=x.useState(null),[j,D]=x.useState(!1),R=x.useRef(void 0),w=u.find(z=>z.id===t),F=a??(w==null?void 0:w.environmentId)??"",H=BB(t,F,u,r);x.useEffect(()=>{const z=R.current;R.current=t,!(z===void 0||z===t)&&N!==null&&C(null)},[t,N]);const B=p.reduce((z,ne)=>z+(ne.costUsd??0),0);x.useEffect(()=>{t&&y("workspace",t)},[t,y,B]);const q=t?v[`workspace:${t}`]:void 0,X=o.filter(z=>z.workspaceId===t),ae=X.filter(z=>z.status==="complete").length,te=X.length,ee=te>0?Math.round(ae/te*100):0;return c.jsxs("div",{className:U.panelContainer,children:[c.jsx(Vs,{segments:H}),c.jsxs("div",{className:U.workspaceHeader,children:[c.jsx("span",{className:U.workspaceName,"data-testid":"workspace-name",children:c.jsx(un,{value:(w==null?void 0:w.name)||"",onSave:z=>{w&&g(w.id,{name:z})},validate:z=>{const ne=z.trim();if(!ne)return"Name is required";if(ne.length>bf)return`Max ${bf} characters`},maxLength:bf,fieldId:"name",activeFieldId:N,onActivate:C,ariaLabel:"Workspace name",renderDisplay:z=>z||t||void 0,"data-testid":"edit-name"})}),c.jsx("button",{className:U.archiveButton,onClick:()=>E(!0),title:"Archive workspace","data-testid":"archive-workspace-button",children:"Archive"})]}),c.jsxs("button",{className:U.metaToggle,onClick:()=>D(!j),"aria-expanded":!j,"aria-controls":"workspace-meta-panel","data-testid":"meta-toggle",children:[c.jsx("span",{className:`${U.metaToggleArrow} ${j?"":U.metaToggleArrowOpen}`,children:"▶"}),"Details"]}),!j&&c.jsxs("div",{className:U.workspaceMeta,"data-testid":"workspace-meta",id:"workspace-meta-panel",children:[c.jsxs("div",{className:U.metaRow,children:[c.jsx("span",{className:U.metaLabel,children:"Description"}),c.jsx("div",{className:U.metaValue,children:c.jsx(Z6,{value:(w==null?void 0:w.description)||"",onSave:z=>{w&&g(w.id,{description:z})},fieldId:"description",activeFieldId:N,onActivate:C,renderDisplay:z=>z?c.jsx("span",{className:U.overviewMarkdown,children:c.jsx(th,{remarkPlugins:[nh],children:z})}):void 0,placeholder:"No description",ariaLabel:"Workspace description","data-testid":"edit-description"})})]}),c.jsxs("div",{className:U.metaRow,children:[c.jsx("span",{className:U.metaLabel,children:"Repository"}),c.jsx("div",{className:U.metaValue,children:c.jsx(un,{value:(w==null?void 0:w.repoUrl)||"",onSave:z=>{w&&g(w.id,{repoUrl:z})},validate:z=>{const ne=z.trim();if(ne&&!/^https?:\/\/.+/.test(ne))return"Must be a valid http(s) URL"},fieldId:"repoUrl",activeFieldId:N,onActivate:C,renderDisplay:z=>z&&/^https?:\/\//i.test(z)?c.jsx("a",{className:U.repoLink,href:z,target:"_blank",rel:"noopener noreferrer",onClick:ne=>ne.stopPropagation(),children:z}):z?c.jsx("span",{children:z}):void 0,placeholder:"No repository",ariaLabel:"Workspace repository URL","data-testid":"edit-repo"})})]}),c.jsxs("div",{className:U.metaRow,children:[c.jsx("span",{className:U.metaLabel,children:"Environment"}),c.jsx("div",{className:U.metaValue,children:c.jsx(sI,{value:(w==null?void 0:w.environmentId)||"",onSave:z=>{w&&z&&g(w.id,{environmentId:z})},environments:r,fieldId:"environmentId",activeFieldId:N,onActivate:C,placeholder:"Select environment",ariaLabel:"Workspace environment","data-testid":"edit-env"})})]}),c.jsxs("div",{className:U.metaRow,children:[c.jsx("span",{className:U.metaLabel,children:"Persona"}),c.jsx("div",{className:U.metaValue,children:c.jsx(M_,{value:(w==null?void 0:w.defaultPersonaId)||"",onSave:z=>{w&&g(w.id,{defaultPersonaId:z})},options:[{value:"",label:"(Inherit)"},...d.map(z=>({value:z.id,label:z.name}))],fieldId:"defaultPersonaId",activeFieldId:N,onActivate:C,renderDisplay:z=>{const ne=d.find(I=>I.id===z);if(ne)return c.jsx("span",{children:ne.name})},placeholder:(w==null?void 0:w.defaultPersonaId)||"(Inherit)",ariaLabel:"Workspace default persona","data-testid":"edit-persona"})})]}),c.jsxs("div",{className:U.metaRow,children:[c.jsx("span",{className:U.metaLabel,children:"Worktrees"}),c.jsx("div",{className:U.metaValue,children:c.jsx(X6,{checked:(w==null?void 0:w.useWorktrees)??!0,onChange:z=>{w&&g(w.id,{useWorktrees:z})},label:"Enable worktree isolation","data-testid":"worktree-toggle"})})]}),c.jsxs("div",{className:U.metaRow,children:[c.jsx("span",{className:U.metaLabel,children:"Working Dir"}),c.jsx("div",{className:U.metaValue,children:c.jsx(un,{value:(w==null?void 0:w.worktreeBasePath)||"",onSave:z=>{w&&g(w.id,{worktreeBasePath:z})},fieldId:"worktreeBasePath",activeFieldId:N,onActivate:C,placeholder:"Default (server default)",ariaLabel:"Working directory","data-testid":"edit-worktree-base-path"})})]}),w&&c.jsxs("div",{className:U.metaTimestamps,children:[c.jsxs("span",{className:U.metaTimestamp,children:["Created ",Z0(w.createdAt)]}),w.updatedAt&&w.updatedAt!==w.createdAt&&c.jsxs("span",{className:U.metaTimestamp,children:["· Updated ",Z0(w.updatedAt)]})]})]}),te>0&&c.jsxs("div",{className:U.progressBarContainer,"data-testid":"progress-bar",children:[c.jsx("div",{className:U.progressBar,children:c.jsx("div",{className:U.progressFill,style:{width:`${ee}%`}})}),c.jsxs("span",{className:U.progressLabel,children:[ae,"/",te]})]}),q&&q.costUsd>0&&c.jsx("div",{className:U.progressBarContainer,children:c.jsxs("span",{className:U.progressLabel,children:["Usage: ",Ki(q.costUsd)," (",q.sessionCount," session",q.sessionCount!==1?"s":"",")"]})}),c.jsxs("div",{className:U.tabBar,role:"tablist","aria-label":"Workspace view",children:[c.jsx("button",{role:"tab","aria-selected":b==="graph",className:`${U.tab} ${b==="graph"?U.active:""}`,onClick:()=>S("graph"),children:"Graph"}),c.jsx("button",{role:"tab","aria-selected":b==="board",className:`${U.tab} ${b==="board"?U.active:""}`,onClick:()=>S("board"),"data-testid":"board-tab",children:"Board"}),c.jsx("button",{role:"tab","aria-selected":b==="tasks",className:`${U.tab} ${b==="tasks"?U.active:""}`,onClick:()=>S("tasks"),children:"Tasks"})]}),b==="tasks"&&te>0&&c.jsxs("div",{className:U.workspaceSummary,children:[c.jsx("span",{className:U.workspaceSummaryTitle,children:`${ae}/${te} tasks complete`}),c.jsx("span",{className:U.workspaceSummarySubtitle,children:"Select a task or click + to create one"})]}),b==="tasks"&&te===0&&c.jsxs("div",{className:U.emptyCta,children:[c.jsx("button",{className:U.ctaButton,onClick:()=>i(Xi(t,void 0,F)),children:"Create Task"}),c.jsx("div",{className:U.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}),b==="board"&&c.jsx(B6,{workspaceId:t,environmentId:F}),b==="graph"&&c.jsx(c6,{workspaceId:t,environmentId:F}),c.jsx(Oc,{isOpen:T,title:"Archive Workspace?",description:"This will hide the workspace from the sidebar. Tasks will not be deleted.",confirmLabel:"Archive",onConfirm:()=>{w&&(m(w.id),i("/",{replace:!0})),E(!1)},onCancel:()=>E(!1)})]})}const oI="_formContent_ymnez_1",lI="_section_ymnez_13",rI="_label_ymnez_19",cI="_titleInput_ymnez_26",uI="_descriptionTextarea_ymnez_58",dI="_selectField_ymnez_94",fI="_checkboxRow_ymnez_128",hI="_checkboxLabel_ymnez_141",pI="_fieldError_ymnez_146",it={formContent:oI,section:lI,label:rI,titleInput:cI,descriptionTextarea:uI,selectField:dI,checkboxRow:fI,checkboxLabel:hI,fieldError:pI};function mI(t,a){return{name:(t==null?void 0:t.name)??"",description:(t==null?void 0:t.description)??"",repoUrl:(t==null?void 0:t.repoUrl)??"",environmentId:(t==null?void 0:t.environmentId)??a??"",defaultPersonaId:(t==null?void 0:t.defaultPersonaId)??"",useWorktrees:(t==null?void 0:t.useWorktrees)??!0,worktreeBasePath:(t==null?void 0:t.worktreeBasePath)??""}}const gI=100;function vI({values:t,onChange:a,environments:i,personas:o,errors:r,disabled:u,autoFocusName:d}){const p=(m,g)=>{a({...t,[m]:g})};return c.jsxs("div",{className:it.formContent,children:[c.jsxs("div",{className:it.section,children:[c.jsx("label",{className:it.label,htmlFor:"ws-name",children:"Name"}),c.jsx("input",{id:"ws-name",className:it.titleInput,type:"text",value:t.name,onChange:m=>p("name",m.target.value),placeholder:"Workspace name",maxLength:gI,autoFocus:d,disabled:u,"data-testid":"workspace-form-name"}),(r==null?void 0:r.name)&&c.jsx("span",{className:it.fieldError,"data-testid":"workspace-form-error-name",children:r.name})]}),c.jsxs("div",{className:it.section,children:[c.jsx("label",{className:it.label,htmlFor:"ws-description",children:"Description"}),c.jsx("textarea",{id:"ws-description",className:it.descriptionTextarea,value:t.description,onChange:m=>p("description",m.target.value),placeholder:"Optional description (Markdown supported)",disabled:u,"data-testid":"workspace-form-description"})]}),c.jsxs("div",{className:it.section,children:[c.jsx("label",{className:it.label,htmlFor:"ws-repo",children:"Repository URL"}),c.jsx("input",{id:"ws-repo",className:it.titleInput,type:"text",value:t.repoUrl,onChange:m=>p("repoUrl",m.target.value),placeholder:"https://github.com/org/repo",disabled:u,"data-testid":"workspace-form-repo"}),(r==null?void 0:r.repoUrl)&&c.jsx("span",{className:it.fieldError,"data-testid":"workspace-form-error-repoUrl",children:r.repoUrl})]}),c.jsxs("div",{className:it.section,children:[c.jsx("label",{className:it.label,htmlFor:"ws-environment",children:"Environment"}),c.jsxs("select",{id:"ws-environment",className:it.selectField,value:t.environmentId,onChange:m=>p("environmentId",m.target.value),disabled:u,"data-testid":"workspace-form-environment",children:[c.jsx("option",{value:"",children:"Select environment…"}),i.map(m=>c.jsx("option",{value:m.id,children:m.displayName||m.id},m.id))]}),(r==null?void 0:r.environmentId)&&c.jsx("span",{className:it.fieldError,"data-testid":"workspace-form-error-environmentId",children:r.environmentId})]}),c.jsxs("div",{className:it.section,children:[c.jsx("label",{className:it.label,htmlFor:"ws-persona",children:"Default Persona"}),c.jsxs("select",{id:"ws-persona",className:it.selectField,value:t.defaultPersonaId,onChange:m=>p("defaultPersonaId",m.target.value),disabled:u,"data-testid":"workspace-form-persona",children:[c.jsx("option",{value:"",children:"(Inherit)"}),o.map(m=>c.jsx("option",{value:m.id,children:m.name},m.id))]})]}),c.jsx("div",{className:it.section,children:c.jsxs("label",{className:it.checkboxRow,children:[c.jsx("input",{type:"checkbox",checked:t.useWorktrees,onChange:m=>p("useWorktrees",m.target.checked),disabled:u,"data-testid":"workspace-form-worktrees"}),c.jsx("span",{className:it.checkboxLabel,children:"Enable worktree isolation"})]})}),c.jsxs("div",{className:it.section,children:[c.jsx("label",{className:it.label,htmlFor:"ws-workdir",children:"Working Directory"}),c.jsx("input",{id:"ws-workdir",className:it.titleInput,type:"text",value:t.worktreeBasePath,onChange:m=>p("worktreeBasePath",m.target.value),placeholder:"Default (server default)",disabled:u,"data-testid":"workspace-form-workdir"})]})]})}const yI="_container_cddyd_1",bI="_header_cddyd_8",xI="_headerTitle_cddyd_35",_I="_badge_cddyd_44",SI="_headerActions_cddyd_54",TI="_body_cddyd_61",kI="_formContent_cddyd_73",CI="_section_cddyd_85",EI="_label_cddyd_91",NI="_titleInput_cddyd_98",jI="_descriptionTextarea_cddyd_131",wI="_parentContext_cddyd_167",AI="_parentLabel_cddyd_175",DI="_parentName_cddyd_182",RI="_personaSelect_cddyd_186",MI="_depList_cddyd_220",OI="_depItem_cddyd_226",BI="_depItemSelected_cddyd_248",II="_noDeps_cddyd_252",LI="_btnPrimary_cddyd_258",UI="_btnGhost_cddyd_289",Ne={container:yI,header:bI,headerTitle:xI,badge:_I,headerActions:SI,body:TI,formContent:kI,section:CI,label:EI,titleInput:NI,descriptionTextarea:jI,parentContext:wI,parentLabel:AI,parentName:DI,personaSelect:RI,depList:MI,depItem:OI,depItemSelected:BI,noDeps:II,btnPrimary:LI,btnGhost:UI};function zI(t){const a={};return t.name.trim()||(a.name="Name is required"),t.repoUrl.trim()&&!/^https?:\/\/.+/i.test(t.repoUrl.trim())&&(a.repoUrl="Must be a valid http(s) URL"),t.environmentId||(a.environmentId="Environment is required"),Object.keys(a).length>0?a:void 0}const VI=[{label:"Home",url:Os},{label:"New Workspace",url:void 0}];function HI(){const[t]=uh(),a=t.get("environment")??void 0,{environments:i,personas:o,createWorkspace:r,workspaceCreating:u}=qe(),{showToast:d}=Us(),p=Dt(),[m,g]=x.useState(()=>{var N;return mI(void 0,a||((N=i[0])==null?void 0:N.id))}),[v,y]=x.useState(),[b,S]=x.useState();x.useEffect(()=>{a||m.environmentId||i.length===0||g(N=>{var C;return N.environmentId?N:{...N,environmentId:((C=i[0])==null?void 0:C.id)??""}})},[i,a,m.environmentId]);const T=()=>{const N=zI(m);if(N){y(N),S(void 0);return}y(void 0),S(void 0),r(m.name.trim(),m.description,m.repoUrl.trim(),m.environmentId,m.defaultPersonaId,m.useWorktrees,m.worktreeBasePath,()=>{d("Workspace created","success"),p(Os,{replace:!0})},C=>{S(C)})},E=()=>{p(a?Gi(a):Os,{replace:!0})};return c.jsxs("div",{className:Ne.container,children:[c.jsxs("div",{className:Ne.header,children:[c.jsx("div",{className:Ne.headerTitle,children:c.jsx(Vs,{segments:VI})}),c.jsxs("div",{className:Ne.headerActions,children:[c.jsx("button",{className:Ne.btnGhost,onClick:E,disabled:u,"data-testid":"workspace-create-cancel",children:"Cancel"}),c.jsx("button",{className:Ne.btnPrimary,onClick:T,disabled:u||!m.name.trim()||!m.environmentId,"data-testid":"workspace-create-save",children:u?c.jsx(N_,{size:"sm",label:"Creating"}):"Create Workspace"})]})]}),c.jsxs("div",{className:Ne.body,children:[c.jsx(vI,{values:m,onChange:N=>{g(N),y(void 0),S(void 0)},environments:i,personas:o,errors:v,disabled:u,autoFocusName:!0}),b&&c.jsx("div",{className:Ne.error,"data-testid":"workspace-create-submit-error",children:b})]})]})}function O_({mode:t,taskId:a,workspaceId:i,parentTaskId:o,environmentId:r}){const{tasks:u,workspaces:d,personas:p,createTask:m,updateTask:g}=qe(),{showToast:v}=Us(),y=Dt(),b=t==="edit",S=b&&a?u.find(fe=>fe.id===a):void 0,T=b?(S==null?void 0:S.workspaceId)??"":i??"",[E,N]=x.useState(T),C=T||E,j=d.find(fe=>fe.id===C),D=r??(j==null?void 0:j.environmentId),R=!b&&!i,w=b?(S==null?void 0:S.parentTaskId)??"":o??"",F=w?u.find(fe=>fe.id===w):void 0,[H,B]=x.useState((S==null?void 0:S.title)??""),[q,X]=x.useState((S==null?void 0:S.description)??""),[ae,te]=x.useState((S==null?void 0:S.dependsOn)??[]),[ee,z]=x.useState((S==null?void 0:S.defaultPersonaId)??""),[ne,I]=x.useState((S==null?void 0:S.canDecompose)??!1),[Y,oe]=x.useState(!1),G=x.useRef(!1);x.useEffect(()=>{b&&S&&!G.current&&(G.current=!0,B(S.title),X(S.description),te(S.dependsOn),z(S.defaultPersonaId),I(S.canDecompose))},[b,S]);const O=u.filter(fe=>fe.workspaceId===C&&(!b||fe.id!==a)&&fe.id!==w),ie=H.trim().length>0&&(!b||S!==void 0)&&C.length>0,xe=fe=>{te(Rt=>Rt.includes(fe)?Rt.filter(mn=>mn!==fe):[...Rt,fe])},re=()=>{!ie||Y||b&&S===void 0||(b&&a?(g(a,H.trim(),q,ae,ee),v("Task updated","success"),y(_a(a,void 0,C,D),{replace:!0})):(oe(!0),m(C,H.trim(),q,ae.length>0?ae:void 0,w||void 0,ee,ne,()=>{v("Task created","success"),y(i?Hi(i,D):"/tasks",{replace:!0})},fe=>{v(fe,"error"),oe(!1)})))},Ke=()=>{y(b&&a?_a(a,void 0,C,D):i?Hi(i,D):"/tasks")},yt=b?"edit task":w?"child task":"new task";return c.jsxs("div",{className:Ne.container,children:[c.jsxs("div",{className:Ne.header,children:[c.jsxs("div",{className:Ne.headerTitle,children:[c.jsx("span",{className:Ne.badge,children:yt}),F&&c.jsxs("span",{className:Ne.parentContext,children:[c.jsx("span",{className:Ne.parentLabel,children:"Child of"}),c.jsx("span",{className:Ne.parentName,children:F.title})]})]}),c.jsxs("div",{className:Ne.headerActions,children:[c.jsx("button",{onClick:re,disabled:!ie||Y,className:Ne.btnPrimary,"data-testid":"task-edit-save",children:Y?"Creating…":b?"Save Changes":"Create"}),c.jsx("button",{onClick:Ke,className:Ne.btnGhost,children:"Cancel"})]})]}),c.jsx("div",{className:Ne.body,children:c.jsxs("div",{className:Ne.formContent,children:[R&&c.jsxs("div",{className:Ne.section,children:[c.jsx("label",{className:Ne.label,htmlFor:"task-edit-workspace",children:"Workspace"}),c.jsxs("select",{id:"task-edit-workspace",value:E,onChange:fe=>N(fe.target.value),className:Ne.personaSelect,"data-testid":"task-edit-workspace",children:[c.jsx("option",{value:"",children:"Select a workspace..."}),d.map(fe=>c.jsx("option",{value:fe.id,children:fe.name},fe.id))]})]}),c.jsxs("div",{className:Ne.section,children:[c.jsx("label",{className:Ne.label,htmlFor:"task-edit-title",children:"Title"}),c.jsx("input",{id:"task-edit-title",type:"text",value:H,onChange:fe=>B(fe.target.value),placeholder:"Task title...",autoFocus:!0,className:Ne.titleInput,"data-testid":"task-edit-title",onKeyDown:fe=>{fe.key==="Enter"&&ie&&re()}})]}),c.jsxs("div",{className:Ne.section,children:[c.jsx("label",{className:Ne.label,htmlFor:"task-edit-description",children:"Description"}),c.jsx("textarea",{id:"task-edit-description",value:q,onChange:fe=>X(fe.target.value),placeholder:"Describe the task... (markdown supported)",className:Ne.descriptionTextarea,"data-testid":"task-edit-description",rows:8})]}),c.jsxs("div",{className:Ne.section,children:[c.jsx("label",{className:Ne.label,htmlFor:"task-edit-persona",children:"Default Persona"}),c.jsxs("select",{id:"task-edit-persona",value:ee,onChange:fe=>z(fe.target.value),className:Ne.personaSelect,"data-testid":"task-edit-persona",children:[c.jsx("option",{value:"",children:"(Inherit)"}),p.map(fe=>c.jsx("option",{value:fe.id,children:fe.name},fe.id))]})]}),!b&&c.jsx("div",{className:Ne.section,children:c.jsxs("label",{className:Ne.depItem,"data-testid":"task-edit-can-decompose",children:[c.jsx("input",{type:"checkbox",checked:ne,onChange:fe=>I(fe.target.checked)}),"Can spawn subtasks"]})}),c.jsxs("div",{className:Ne.section,children:[c.jsx("div",{className:Ne.label,children:"Dependencies"}),O.length===0?c.jsx("div",{className:Ne.noDeps,children:"No other tasks in this workspace"}):c.jsx("div",{className:Ne.depList,children:O.map(fe=>{const Rt=ae.includes(fe.id);return c.jsxs("label",{className:`${Ne.depItem} ${Rt?Ne.depItemSelected:""}`,"data-testid":`dep-option-${fe.id}`,children:[c.jsx("input",{type:"checkbox",checked:Rt,onChange:()=>xe(fe.id)}),fe.title,c.jsxs("span",{style:{opacity:.5,fontSize:"11px",marginLeft:"4px"},children:["(",fe.status,")"]})]},fe.id)})})]})]})})]})}function X0(){const{workspaceId:t,environmentId:a}=ss(),[i]=uh(),o=t??i.get("workspace")??"",r=i.get("parent")??void 0;return c.jsx(O_,{mode:"new",workspaceId:o,parentTaskId:r,environmentId:a})}function Q0(){const{taskId:t,workspaceId:a,environmentId:i}=ss();return c.jsx(O_,{mode:"edit",taskId:t,workspaceId:a,environmentId:i})}const PI="_container_1pqxm_1",GI="_emptyState_1pqxm_8",$I="_card_1pqxm_14",FI="_cardHeader_1pqxm_34",qI="_categoryBadge_1pqxm_46",KI="_findingTitle_1pqxm_54",YI="_findingDate_1pqxm_60",ZI="_findingContent_1pqxm_72",XI="_tags_1pqxm_78",QI="_tag_1pqxm_78",Gn={container:PI,emptyState:GI,card:$I,cardHeader:FI,categoryBadge:qI,findingTitle:KI,findingDate:YI,findingContent:ZI,tags:XI,tag:QI};function WI(t){const a=new Date(t),i=new Date,o=i.getTime()-a.getTime(),r=Math.floor(o/1e3),u=Math.floor(r/60),d=Math.floor(u/60),p=Math.floor(d/24);if(r<60)return"just now";if(u<60)return`${u}m ago`;if(d<24)return`${d}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"}),v=a.getDate();return m?`${g} ${v}`:`${g} ${v} ${a.getFullYear()}`}const W0={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 JI({workspaceId:t}){const{findings:a}=qe(),i=a.filter(o=>o.workspaceId===t);return i.length===0?c.jsx("div",{className:Gn.emptyState,children:"No findings yet. Agents will post discoveries here."}):c.jsx("div",{className:Gn.container,children:i.map((o,r)=>{const u=W0[o.category]||W0.general;return c.jsxs(Ct.div,{className:Gn.card,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:r*.05,duration:.2},children:[c.jsxs("div",{className:Gn.cardHeader,children:[c.jsx("span",{className:Gn.categoryBadge,style:{background:u.bg,color:u.text},children:o.category}),c.jsx("span",{className:Gn.findingTitle,children:o.title}),c.jsx("span",{className:Gn.findingDate,title:o.createdAt,children:WI(o.createdAt)})]}),c.jsx("div",{className:Gn.findingContent,children:o.content.length>300?o.content.slice(0,300)+"...":o.content}),o.tags.length>0&&c.jsx("div",{className:Gn.tags,children:o.tags.map(d=>c.jsx("span",{className:Gn.tag,style:{color:u.text,textShadow:`0 0 8px ${u.text}`},children:d},d))})]},o.id)})})}function tc(t){if(!t)return"—";const a=new Date(t);return isNaN(a.getTime())?"—":a.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})}function xf(t,a){if(!t||!a)return;const i=new Date(a).getTime()-new Date(t).getTime();if(isNaN(i)||i<0)return;const o=Math.floor(i/6e4),r=Math.floor(i%6e4/1e3);if(o===0)return`${r}s`;const u=Math.floor(o/60),d=o%60;return u===0?`${o}m ${r}s`:`${u}h ${d}m`}function J0(t){const a=t.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?U.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?U.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?U.envDotRed:U.envDotGray}function e4({status:t}){const a=as(t),i=A2(t);return c.jsx("span",{className:`${U.statusBadge} ${U[i]??U.statusPending}`,children:a.label})}function t4({task:t,tasksById:a,environments:i,workspaces:o,taskSessions:r,selectedEnvId:u}){const{loadUsage:d,usageCache:p}=qe(),m=r.reduce((D,R)=>D+(R.costUsd??0),0);x.useEffect(()=>{d("task",t.id),t.childTaskIds.length>0&&d("task_tree",t.id)},[t.id,t.childTaskIds.length,d,m]);const g=`task:${t.id}`,v=g in p?p[g]:void 0,y=`task_tree:${t.id}`,b=t.childTaskIds.length>0&&y in p?p[y]:void 0,S=r.length>0?r[r.length-1]:void 0,T=(S==null?void 0:S.environmentId)??"",E=T?i.find(D=>D.id===T):void 0,N=o.find(D=>D.id===t.workspaceId),C=i.find(D=>D.id===u),j=t.branch&&(N!=null&&N.repoUrl)?`${N.repoUrl.replace(/\/$/,"")}/tree/${encodeURIComponent(t.branch)}`:void 0;return c.jsxs("div",{className:U.overviewDashboard,children:[c.jsxs("div",{className:U.overviewHero,children:[c.jsx(e4,{status:t.status}),t.branch&&c.jsx("span",{className:U.overviewBranchPill,children:j?c.jsxs("a",{href:j,target:"_blank",rel:"noreferrer noopener",className:U.branchLink,children:["🔗"," ",t.branch]}):c.jsxs("span",{children:["🔗"," ",t.branch]})})]}),typeof t.description=="string"&&t.description&&c.jsxs("div",{className:U.overviewSection,children:[c.jsx("div",{className:U.overviewLabel,children:"Description"}),c.jsx("div",{className:U.overviewMarkdown,children:c.jsx(th,{remarkPlugins:[nh],children:t.description})})]}),c.jsxs("div",{className:U.overviewSection,children:[c.jsx("div",{className:U.overviewLabel,children:"Environment"}),T&&E?c.jsxs("div",{className:U.envRow,"data-testid":"task-overview-environment",children:[c.jsx("span",{className:`${U.envDot} ${J0(E.status)}`,title:E.status,"aria-label":`Status: ${E.status}`,role:"img"}),c.jsx("span",{className:U.overviewValue,children:E.displayName})]}):C?c.jsxs("div",{className:U.envRow,"data-testid":"task-overview-environment",children:[c.jsx("span",{className:`${U.envDot} ${J0(C.status)}`,title:C.status,"aria-label":`Status: ${C.status}`,role:"img"}),c.jsx("span",{className:U.overviewValue,children:C.displayName}),c.jsx("span",{className:U.overviewMuted,children:"(workspace default)"})]}):c.jsx("div",{className:U.overviewMuted,children:"Set in workspace settings"})]}),c.jsxs("div",{className:U.overviewSection,children:[c.jsx("div",{className:U.overviewLabel,children:"Dependencies"}),t.dependsOn.length===0?c.jsx("div",{className:U.overviewMuted,children:"None"}):c.jsx("div",{className:U.depList,children:t.dependsOn.map(D=>{const R=a.get(D),w=(R==null?void 0:R.status)==="complete";return c.jsxs("div",{className:`${U.depItem} ${w?U.depDone:U.depBlocked}`,children:[c.jsx("span",{children:w?"✓":"○"}),c.jsx("span",{children:(R==null?void 0:R.title)??D})]},D)})})]}),c.jsxs("div",{className:U.overviewSection,children:[c.jsx("div",{className:U.overviewLabel,children:"Timeline"}),c.jsxs("div",{className:U.timeline,children:[t.createdAt&&c.jsxs("div",{className:U.timelineRow,children:[c.jsx("span",{className:U.timelineKey,children:"Created"}),c.jsx("span",{className:U.timelineValue,children:tc(t.createdAt)})]}),t.assignedAt&&(()=>{const D=xf(t.createdAt,t.assignedAt);return c.jsxs("div",{className:U.timelineRow,children:[c.jsx("span",{className:U.timelineKey,children:"Assigned"}),c.jsx("span",{className:U.timelineValue,children:tc(t.assignedAt)}),D!==void 0&&c.jsx("span",{className:U.timelineDelta,children:D})]})})(),t.startedAt&&(()=>{const D=xf(t.assignedAt??t.createdAt,t.startedAt);return c.jsxs("div",{className:U.timelineRow,children:[c.jsx("span",{className:U.timelineKey,children:"Started"}),c.jsx("span",{className:U.timelineValue,children:tc(t.startedAt)}),D!==void 0&&c.jsx("span",{className:U.timelineDelta,children:D})]})})(),t.completedAt&&(()=>{const D=xf(t.startedAt,t.completedAt);return c.jsxs("div",{className:U.timelineRow,children:[c.jsx("span",{className:U.timelineKey,children:"Completed"}),c.jsx("span",{className:U.timelineValue,children:tc(t.completedAt)}),D!==void 0&&c.jsx("span",{className:U.timelineDelta,children:D})]})})(),!t.createdAt&&!t.assignedAt&&!t.startedAt&&!t.completedAt&&c.jsx("div",{className:U.overviewMuted,children:"No timing data"})]})]}),v&&v.costUsd>0&&c.jsxs("div",{className:U.overviewSection,children:[c.jsx("div",{className:U.overviewLabel,children:"Usage"}),c.jsxs("div",{className:U.timeline,children:[c.jsxs("div",{className:U.timelineRow,children:[c.jsx("span",{className:U.timelineKey,children:"Cost"}),c.jsx("span",{className:U.timelineValue,children:Ki(v.costUsd)}),c.jsxs("span",{className:U.timelineDelta,children:[v.sessionCount," session",v.sessionCount!==1?"s":""]})]}),b&&b.costUsd>v.costUsd&&c.jsxs("div",{className:U.timelineRow,children:[c.jsx("span",{className:U.timelineKey,children:"Total (incl. subtasks)"}),c.jsx("span",{className:U.timelineValue,children:Ki(b.costUsd)}),c.jsxs("span",{className:U.timelineDelta,children:[b.sessionCount," session",b.sessionCount!==1?"s":""]})]})]})]}),t.reviewNotes&&c.jsxs("div",{className:U.overviewSection,children:[c.jsx("div",{className:U.overviewLabel,children:"Review Notes"}),c.jsx("div",{className:U.reviewNotes,children:t.reviewNotes})]})]})}function n4({task:t,sessionId:a,isBlocked:i,onStart:o,onResume:r,onStop:u,onPause:d,onDelete:p,onEdit:m}){if(t.status==="not_started")return i?c.jsxs("div",{className:U.headerActions,children:[c.jsx("button",{onClick:m,className:U.btnGhost,children:"Edit"}),c.jsx("button",{onClick:p,className:U.btnDanger,children:"Delete"})]}):c.jsxs("div",{className:U.headerActions,children:[c.jsx("button",{onClick:o,className:U.btnPrimary,children:"Start"}),c.jsx("button",{onClick:m,className:U.btnGhost,children:"Edit"}),c.jsx("button",{onClick:p,className:U.btnDanger,children:"Delete"})]});if(t.status==="working")return c.jsxs("div",{className:U.headerActions,children:[c.jsx("button",{onClick:u,className:U.btnDanger,children:"Stop"}),c.jsx("button",{onClick:d,disabled:!a,className:U.btnGhost,children:"Pause"})]});if(t.status==="paused")return c.jsxs("div",{className:U.headerActions,children:[c.jsx("button",{onClick:u,className:U.btnPrimary,children:"Stop"}),c.jsx("button",{onClick:r,className:U.btnGhost,children:"Resume"}),c.jsx("button",{onClick:p,className:U.btnDanger,children:"Delete"})]});if(t.status==="complete")return c.jsx("div",{className:U.headerActions,children:c.jsx("button",{onClick:p,className:U.btnDanger,children:"Delete"})});if(t.status==="failed")return c.jsxs("div",{className:U.headerActions,children:[c.jsx("button",{onClick:o,className:U.btnPrimary,children:"Retry"}),c.jsx("button",{onClick:p,className:U.btnDanger,children:"Delete"})]})}function a4({taskSessions:t,selectedSessionId:a,onSelect:i}){if(!(t.length<2))return c.jsxs("div",{className:U.attemptSelector,"data-testid":"attempt-selector",children:[c.jsx("span",{className:U.attemptLabel,children:"Attempts:"}),t.map((o,r)=>{const u=o.id===a,d=o.status==="stopped"&&o.endReason==="completed"?"✓":o.status==="stopped"?"✗":o.status==="running"||o.status==="idle"?"●":"";return c.jsxs("button",{className:`${U.attemptButton} ${u?U.attemptActive:""}`,onClick:()=>i(o.id),title:`Attempt #${r+1} — ${o.status}`,"aria-label":`Attempt #${r+1}, ${o.status}`,"aria-pressed":u,"data-testid":`attempt-${r+1}`,children:["#",r+1,d&&c.jsx("span",{className:U.attemptStatus,children:d})]},o.id)})]})}function Mi(){const{taskId:t,workspaceId:a,environmentId:i}=ss(),o=jt(),r=Dt(),{events:u,eventsDropped:d,tasks:p,sessions:m,environments:g,loadSessionEvents:v,loadFindings:y,kill:b,startTask:S,stopTask:T,resumeTask:E,deleteTask:N,workspaces:C,taskSessions:j,loadTaskSessions:D}=qe(),R=x.useRef(void 0),w=x.useRef(void 0),F=x.useRef(void 0),H=x.useRef(void 0),B=x.useRef(void 0),q=o.pathname.endsWith("/stream")?"stream":o.pathname.endsWith("/findings")?"findings":"overview",[X,ae]=x.useState(q),[te,ee]=x.useState(!1),[z,ne]=x.useState(void 0),[I,Y]=x.useState(""),oe=x.useRef(q);q!==oe.current&&(oe.current=q,q!==X&&ae(q));const G=p.find(Te=>Te.id===t),O=(G==null?void 0:G.workspaceId)||void 0,ie=C.find(Te=>Te.id===O);x.useEffect(()=>{if(I===""){if(ie!=null&&ie.environmentId)Y(ie.environmentId);else if(g.length>0){const Te=g.find(pt=>pt.status==="connected");Y((Te==null?void 0:Te.id)??g[0].id)}}},[I,ie==null?void 0:ie.environmentId,g]);const xe=G?j[G.id]??[]:[];let re;z&&xe.some(Te=>Te.id===z)?re=z:re=(G==null?void 0:G.latestSessionId)||void 0;const Ke=()=>{ee(!0)},yt=()=>{if(!G)return;N(G.id),ee(!1);const Te=i??(ie==null?void 0:ie.environmentId);r(G.workspaceId&&Te?Hi(G.workspaceId,Te):"/",{replace:!0})};if((G==null?void 0:G.id)!==w.current&&(w.current=G==null?void 0:G.id,z!==void 0&&ne(void 0),I!==""&&Y("")),x.useEffect(()=>{if(!(G!=null&&G.id))return;const Te=G.id!==H.current,pt=G.latestSessionId!==B.current;(Te||pt)&&(H.current=G.id,B.current=G.latestSessionId,D(G.id))},[G==null?void 0:G.id,G==null?void 0:G.latestSessionId,D]),(G==null?void 0:G.status)!==F.current){const Te=F.current===void 0;F.current=G==null?void 0:G.status;const pt=(G==null?void 0:G.status)==="not_started"?"overview":(G==null?void 0:G.status)==="working"||(G==null?void 0:G.status)==="paused"?"stream":(G==null?void 0:G.status)==="complete"?"findings":void 0;pt&&pt!==X&&!(Te&&q!=="overview")&&ae(pt)}const fe=x.useMemo(()=>new Map(p.map(Te=>[Te.id,Te])),[p]),Rt=x.useMemo(()=>{const Te=re?u.filter(pt=>pt.sessionId===re):[];return Qh(Xh(Te))},[u,re]),mn=G?G.dependsOn.some(Te=>{const pt=fe.get(Te);return pt!==void 0&&pt.status!=="complete"}):!1,Rn=x.useMemo(()=>IB(t,i,C,g,fe),[t,i,C,g,fe]);x.useEffect(()=>{re&&re!==R.current&&(R.current=re,v(re))},[re,v]),x.useEffect(()=>{X==="findings"&&O&&y(O)},[X,O,y]);const Ln=Te=>{ae(Te),r(_a(t,Te==="overview"?void 0:Te,a,i))};return c.jsxs("div",{className:U.panelContainer,children:[c.jsx(Vs,{segments:Rn}),c.jsxs("div",{className:U.header,children:[c.jsxs("span",{className:U.headerTitle,children:[c.jsx("span",{"data-testid":"task-title",children:(G==null?void 0:G.title)||t}),G&&c.jsx("span",{className:U.taskStatusBadge,"data-testid":"task-status",children:G.status}),(G==null?void 0:G.branch)&&c.jsx("span",{className:U.taskBranch,children:G.branch}),mn&&c.jsx("span",{className:U.taskBlockedBadge,children:"blocked"})]}),G&&c.jsx(n4,{task:G,sessionId:re,isBlocked:mn,onStart:()=>S(G.id,void 0,I),onResume:()=>E(G.id),onStop:()=>T(G.id),onPause:()=>re&&b(re),onDelete:Ke,onEdit:()=>r(iC(G.id,a,i))})]}),c.jsxs("div",{className:U.tabBar,role:"tablist","aria-label":"Task view",children:[c.jsx("button",{role:"tab","aria-selected":X==="overview",className:`${U.tab} ${X==="overview"?U.active:""}`,onClick:()=>Ln("overview"),children:"Overview"}),c.jsx("button",{role:"tab","aria-selected":X==="stream",className:`${U.tab} ${X==="stream"?U.active:""}`,onClick:()=>Ln("stream"),children:"Stream"}),c.jsx("button",{role:"tab","aria-selected":X==="findings",className:`${U.tab} ${X==="findings"?U.active:""}`,onClick:()=>Ln("findings"),children:"Findings"})]}),c.jsxs(Qn,{mode:"wait",children:[X==="overview"&&c.jsx(Ct.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:U.overviewContent,"data-testid":"task-overview",children:G?c.jsx(t4,{task:G,tasksById:fe,environments:g,workspaces:C,taskSessions:xe,selectedEnvId:I}):c.jsx("div",{className:U.waitingMessage,children:"No additional details"})},"overview"),X==="stream"&&c.jsxs(Ct.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden"},children:[c.jsx(a4,{taskSessions:xe,selectedSessionId:re,onSelect:Te=>ne(Te)}),c.jsx(Zh,{events:Rt,eventsDropped:d,emptyState:!re&&G?c.jsxs("div",{className:U.emptyCta,children:[c.jsx("button",{className:U.ctaButton,onClick:()=>S(G.id,void 0,I),children:"Start Task"}),c.jsx("div",{className:U.ctaDescription,children:"Click to begin agent execution"})]}):re&&Rt.length===0?c.jsx("div",{className:U.waitingMessage,children:"Waiting for events..."}):void 0})]},"stream"),X==="findings"&&c.jsx(Ct.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:U.tabContent,children:O?c.jsx(JI,{workspaceId:O}):c.jsx("div",{className:U.noContext,children:"Navigate to a task within a workspace to view findings"})},"findings")]}),(()=>{if(!G||G.status!=="working"&&G.status!=="paused")return;const Te=re?m.find(pt=>pt.id===re):void 0;if(!(!Te||Te.status==="stopped"))return c.jsx(xl,{mode:"send",sessionId:Te.id,environmentId:Te.environmentId})})(),G&&c.jsx(Oc,{isOpen:te,title:"Delete Task?",description:`"${G.title}" will be permanently removed.`,onConfirm:yt,onCancel:()=>ee(!1)})]})}const s4="_container_legrg_1",i4="_header_legrg_8",o4="_headerTitle_legrg_35",l4="_badge_legrg_44",r4="_headerActions_legrg_54",c4="_body_legrg_61",u4="_formContent_legrg_73",d4="_section_legrg_85",f4="_label_legrg_91",h4="_nameInput_legrg_98",p4="_fieldInput_legrg_131",m4="_adapterSelect_legrg_164",g4="_readOnlyValue_legrg_198",v4="_codespaceSection_legrg_204",y4="_codespaceActions_legrg_210",b4="_creatingHint_legrg_216",x4="_errorHint_legrg_222",_4="_btnPrimary_legrg_235",S4="_btnGhost_legrg_266",se={container:s4,header:i4,headerTitle:o4,badge:l4,headerActions:r4,body:c4,formContent:u4,section:d4,label:f4,nameInput:h4,fieldInput:p4,adapterSelect:m4,readOnlyValue:g4,codespaceSection:v4,codespaceActions:y4,creatingHint:b4,errorHint:x4,btnPrimary:_4,btnGhost:S4},rc=1,cc=65535;function _f(t){if(!t.trim())return!0;const a=Number(t);return Number.isInteger(a)&&a>=rc&&a<=cc}function Sf(t){try{const a=JSON.parse(t);if(typeof a=="object"&&a!==null&&!Array.isArray(a))return a}catch{}return{}}function T4({codespaceName:t,onCodespaceNameChange:a,envName:i,onEnvNameChange:o}){const{codespaces:r,codespaceError:u,codespaceListError:d,codespaceCreating:p,createCodespace:m}=qe(),[g,v]=x.useState("pick"),[y,b]=x.useState(""),[S,T]=x.useState("");return g==="create"?c.jsxs("div",{className:se.codespaceSection,children:[c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Repository"}),c.jsx("input",{type:"text",value:y,onChange:E=>b(E.target.value),placeholder:"owner/repo",className:se.fieldInput,"data-testid":"env-codespace-repo"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Machine Type"}),c.jsx("input",{type:"text",value:S,onChange:E=>T(E.target.value),placeholder:"Machine type (optional)...",className:se.fieldInput,"data-testid":"env-codespace-machine"})]}),c.jsxs("div",{className:se.codespaceActions,children:[c.jsx("button",{onClick:()=>{y.trim()&&(m(y.trim(),S.trim()||void 0),v("pick"),b(""),T(""))},disabled:!y.trim(),className:se.btnPrimary,children:"Create"}),c.jsx("button",{onClick:()=>{v("pick"),b(""),T("")},className:se.btnGhost,children:"Cancel"})]})]}):c.jsx("div",{className:se.codespaceSection,children:c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Codespace"}),!d&&c.jsxs("select",{value:t,onChange:E=>{E.target.value==="__create__"?(v("create"),a("")):(a(E.target.value),E.target.value&&!i.trim()&&o(E.target.value))},disabled:p,className:se.adapterSelect,"data-testid":"env-codespace-select",children:[c.jsx("option",{value:"",children:"Select a codespace..."}),r.map(E=>c.jsxs("option",{value:E.name,children:[E.name," (",E.repository,") — ",E.state]},E.name)),c.jsx("option",{value:"__create__",children:"Create new from repo..."})]}),p&&c.jsx("span",{className:se.creatingHint,children:"Creating codespace..."}),d&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:se.errorHint,children:d}),c.jsx("input",{type:"text",value:t,onChange:E=>a(E.target.value),placeholder:"Or enter codespace name manually...",className:se.fieldInput,"data-testid":"env-codespace-manual"})]}),u&&!d&&c.jsx("span",{className:se.errorHint,children:u})]})})}function B_({mode:t,environmentId:a}){const{environments:i,addEnvironment:o,updateEnvironment:r,listCodespaces:u}=qe(),{showToast:d}=Us(),p=Dt(),m=t==="edit",g=m&&a?i.find(O=>O.id===a):void 0,[v,y]=x.useState(""),[b,S]=x.useState("local"),[T,E]=x.useState(""),[N,C]=x.useState(""),[j,D]=x.useState(""),[R,w]=x.useState(""),[F,H]=x.useState(""),[B,q]=x.useState(""),[X,ae]=x.useState(""),[te,ee]=x.useState(null),z=x.useCallback(()=>{const O={};if(b==="local"){if(T.trim()&&(O.host=T.trim()),N.trim()){const ie=Number(N);Number.isInteger(ie)&&(O.port=ie)}}else if(b==="ssh"){if(O.host=T.trim(),j.trim()&&(O.user=j.trim()),N.trim()){const ie=Number(N);Number.isInteger(ie)&&(O.sshPort=ie)}R.trim()&&(O.identityFile=R.trim())}else b==="docker"?(F.trim()&&(O.image=F.trim()),B.trim()&&(O.repo=B.trim())):b==="codespace"&&(O.codespaceName=X.trim());return O},[b,T,N,j,R,F,B,X]),ne=()=>!(!v.trim()||b==="ssh"&&!T.trim()||b==="codespace"&&!X.trim()||(b==="local"||b==="ssh")&&!_f(N)),I=()=>{ne()&&(o(v.trim(),b,z()),d("Environment added successfully","success"),p(Pi,{replace:!0}))},Y=()=>{p(a?Gi(a):Pi)},oe=x.useCallback((O,ie)=>{if(!g||!a)return;const xe=Sf(g.adapterConfig),re=ie.trim();re?xe[O]=re:delete xe[O],r(a,{adapterConfig:xe})},[g,a,r]),G=x.useCallback((O,ie)=>{if(!g||!a)return;const xe=Sf(g.adapterConfig);if(ie.trim()){const re=Number(ie);Number.isInteger(re)&&re>=rc&&re<=cc&&(xe[O]=re)}else delete xe[O];r(a,{adapterConfig:xe})},[g,a,r]);if(m){if(!g)return c.jsxs("div",{className:se.container,children:[c.jsxs("div",{className:se.header,children:[c.jsx("div",{className:se.headerTitle,children:c.jsx("span",{className:se.badge,children:"edit environment"})}),c.jsx("div",{className:se.headerActions,children:c.jsx("button",{onClick:Y,className:se.btnGhost,children:"Back"})})]}),c.jsx("div",{className:se.body,children:c.jsx("div",{className:se.formContent,children:c.jsx("span",{className:se.readOnlyValue,children:"Environment not found"})})})]});const O=Sf(g.adapterConfig);return c.jsxs("div",{className:se.container,"data-testid":"env-edit-panel",children:[c.jsxs("div",{className:se.header,children:[c.jsx("div",{className:se.headerTitle,children:c.jsx("span",{className:se.badge,children:"edit environment"})}),c.jsx("div",{className:se.headerActions,children:c.jsx("button",{onClick:Y,className:se.btnGhost,"data-testid":"env-edit-back",children:"Back"})})]}),c.jsx("div",{className:se.body,children:c.jsxs("div",{className:se.formContent,children:[c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Name"}),c.jsx(un,{value:g.displayName,onSave:ie=>{a&&r(a,{displayName:ie})},validate:ie=>ie.trim()===""?"Name cannot be empty":void 0,mode:"edit",fieldId:"name",activeFieldId:te,onActivate:ee,placeholder:"Environment name",ariaLabel:"Environment name","data-testid":"env-edit-name"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Adapter Type"}),c.jsx("span",{className:se.readOnlyValue,"data-testid":"env-edit-adapter-type",children:g.adapterType})]}),g.adapterType==="local"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Host"}),c.jsx(un,{value:String(O.host??""),onSave:ie=>oe("host",ie),mode:"edit",fieldId:"host",activeFieldId:te,onActivate:ee,placeholder:"(default)",ariaLabel:"Host","data-testid":"env-edit-host"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Port"}),c.jsx(un,{value:String(O.port??""),onSave:ie=>G("port",ie),validate:ie=>_f(ie)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"port",activeFieldId:te,onActivate:ee,placeholder:"(default)",ariaLabel:"Port","data-testid":"env-edit-port"})]})]}),g.adapterType==="ssh"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Host"}),c.jsx(un,{value:String(O.host??""),onSave:ie=>oe("host",ie),validate:ie=>ie.trim()===""?"Host is required":void 0,mode:"edit",fieldId:"host",activeFieldId:te,onActivate:ee,placeholder:"hostname or IP",ariaLabel:"Host","data-testid":"env-edit-host"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"User"}),c.jsx(un,{value:String(O.user??""),onSave:ie=>oe("user",ie),mode:"edit",fieldId:"user",activeFieldId:te,onActivate:ee,placeholder:"(default)",ariaLabel:"User","data-testid":"env-edit-user"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"SSH Port"}),c.jsx(un,{value:String(O.sshPort??""),onSave:ie=>G("sshPort",ie),validate:ie=>_f(ie)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"sshPort",activeFieldId:te,onActivate:ee,placeholder:"22",ariaLabel:"SSH Port","data-testid":"env-edit-ssh-port"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Identity File"}),c.jsx(un,{value:String(O.identityFile??""),onSave:ie=>oe("identityFile",ie),mode:"edit",fieldId:"identityFile",activeFieldId:te,onActivate:ee,placeholder:"~/.ssh/id_rsa",ariaLabel:"Identity File","data-testid":"env-edit-identity-file"})]})]}),g.adapterType==="docker"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Image"}),c.jsx(un,{value:String(O.image??""),onSave:ie=>oe("image",ie),mode:"edit",fieldId:"image",activeFieldId:te,onActivate:ee,placeholder:"(default)",ariaLabel:"Image","data-testid":"env-edit-image"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Repo"}),c.jsx(un,{value:String(O.repo??""),onSave:ie=>oe("repo",ie),mode:"edit",fieldId:"repo",activeFieldId:te,onActivate:ee,placeholder:"(none)",ariaLabel:"Repo","data-testid":"env-edit-repo"})]})]}),g.adapterType==="codespace"&&c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Codespace Name"}),c.jsx(un,{value:String(O.codespaceName??""),onSave:ie=>oe("codespaceName",ie),validate:ie=>ie.trim()===""?"Codespace name is required":void 0,mode:"edit",fieldId:"codespaceName",activeFieldId:te,onActivate:ee,placeholder:"codespace-name",ariaLabel:"Codespace Name","data-testid":"env-edit-codespace-name"})]})]})})]})}return c.jsxs("div",{className:se.container,"data-testid":"env-create-panel",children:[c.jsxs("div",{className:se.header,children:[c.jsx("div",{className:se.headerTitle,children:c.jsx("span",{className:se.badge,children:"new environment"})}),c.jsxs("div",{className:se.headerActions,children:[c.jsx("button",{onClick:I,disabled:!ne(),className:se.btnPrimary,"data-testid":"env-create-submit",children:"Create"}),c.jsx("button",{onClick:Y,className:se.btnGhost,children:"Cancel"})]})]}),c.jsx("div",{className:se.body,children:c.jsxs("div",{className:se.formContent,children:[c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-name",children:"Name"}),c.jsx("input",{id:"env-create-name",type:"text",value:v,onChange:O=>y(O.target.value),placeholder:"Environment name...",autoFocus:!0,className:se.nameInput,"data-testid":"env-create-name",onKeyDown:O=>{O.key==="Enter"&&ne()&&I()}})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-adapter",children:"Adapter Type"}),c.jsxs("select",{id:"env-create-adapter",value:b,onChange:O=>{S(O.target.value),O.target.value==="codespace"&&u()},className:se.adapterSelect,"data-testid":"env-create-adapter",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"})]})]}),b==="local"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-host",children:"Host"}),c.jsx("input",{id:"env-create-host",type:"text",value:T,onChange:O=>E(O.target.value),placeholder:"Host (optional)...",className:se.fieldInput,"data-testid":"env-create-host"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-port",children:"Port"}),c.jsx("input",{id:"env-create-port",type:"number",min:rc,max:cc,value:N,onChange:O=>C(O.target.value),placeholder:"Port (optional)...",className:se.fieldInput,"data-testid":"env-create-port"})]})]}),b==="ssh"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-host",children:"Host"}),c.jsx("input",{id:"env-create-host",type:"text",value:T,onChange:O=>E(O.target.value),placeholder:"Host (required)...",className:se.fieldInput,"data-testid":"env-create-host"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-user",children:"User"}),c.jsx("input",{id:"env-create-user",type:"text",value:j,onChange:O=>D(O.target.value),placeholder:"User (optional)...",className:se.fieldInput,"data-testid":"env-create-user"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-port",children:"SSH Port"}),c.jsx("input",{id:"env-create-port",type:"number",min:rc,max:cc,value:N,onChange:O=>C(O.target.value),placeholder:"SSH port (optional)...",className:se.fieldInput,"data-testid":"env-create-port"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-identity",children:"Identity File"}),c.jsx("input",{id:"env-create-identity",type:"text",value:R,onChange:O=>w(O.target.value),placeholder:"Identity file (optional)...",className:se.fieldInput,"data-testid":"env-create-identity"})]})]}),b==="docker"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-image",children:"Image"}),c.jsx("input",{id:"env-create-image",type:"text",value:F,onChange:O=>H(O.target.value),placeholder:"Image (optional)...",className:se.fieldInput,"data-testid":"env-create-image"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-repo",children:"Repo"}),c.jsx("input",{id:"env-create-repo",type:"text",value:B,onChange:O=>q(O.target.value),placeholder:"Repo (optional)...",className:se.fieldInput,"data-testid":"env-create-repo"})]})]}),b==="codespace"&&c.jsx(T4,{codespaceName:X,onCodespaceNameChange:ae,envName:v,onEnvNameChange:y})]})})]})}function k4(){return c.jsx(B_,{mode:"new"})}function C4(){const{environmentId:t}=ss();return c.jsx(B_,{mode:"edit",environmentId:t})}const E4="_layout_11u79_1",N4="_content_11u79_8",j4="_tabPanel_11u79_14",dl={layout:E4,content:N4,tabPanel:j4};function w4(){const t=RB();return c.jsxs("div",{className:dl.layout,children:[c.jsx(Vs,{segments:t}),c.jsx("div",{className:dl.content,children:c.jsx(Ls,{})})]})}const A4="_container_13sb6_1",D4="_envHeader_13sb6_6",R4="_envTitleRow_13sb6_10",M4="_statusDot_13sb6_16",O4="_envName_13sb6_21",B4="_statusBadge_13sb6_27",I4="_envMeta_13sb6_33",L4="_metaTag_13sb6_39",U4="_actions_13sb6_51",z4="_provisionMessage_13sb6_59",V4="_errorMessage_13sb6_64",H4="_section_13sb6_69",P4="_sectionHeader_13sb6_73",G4="_cardList_13sb6_121",$4="_card_13sb6_121",F4="_cardHeader_13sb6_138",q4="_cardName_13sb6_144",K4="_cardActions_13sb6_149",Y4="_cardDescription_13sb6_154",Z4="_cardMeta_13sb6_160",X4="_repoLink_13sb6_166",Q4="_empty_13sb6_174",W4="_btnPrimary_13sb6_180",J4="_btnOutline_13sb6_214",e5="_btnSmall_13sb6_241",t5="_btnDanger_13sb6_267",Be={container:A4,envHeader:D4,envTitleRow:R4,statusDot:M4,envName:O4,statusBadge:B4,envMeta:I4,metaTag:L4,actions:U4,provisionMessage:z4,errorMessage:V4,section:H4,sectionHeader:P4,cardList:G4,card:$4,cardHeader:F4,cardName:q4,cardActions:K4,cardDescription:Y4,cardMeta:Z4,repoLink:X4,empty:Q4,btnPrimary:W4,btnOutline:J4,btnSmall:e5,btnDanger:t5},n5={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function a5(){const{environmentId:t}=ss(),a=Dt(),{environments:i,workspaces:o,sessions:r,provisionStatus:u,provisionEnvironment:d,stopEnvironment:p,removeEnvironment:m,archiveWorkspace:g}=qe(),[v,y]=x.useState(!1),[b,S]=x.useState(void 0),T=i.find(q=>q.id===t);if(!t||!T)return c.jsx($n,{to:Pi,replace:!0});const E=o.filter(q=>q.environmentId===T.id),N=r.filter(q=>q.environmentId===T.id),C=N.reduce((q,X)=>q+(X.costUsd??0),0),j=n5[T.status]||"var(--text-tertiary)",D=T.status==="connected",R=T.status==="connecting",w=T.status==="disconnected"||T.status==="error",F=T.id in u?u[T.id]:void 0,H=()=>{m(T.id),y(!1),a(Pi,{replace:!0})},B=q=>{g(q),S(void 0)};return c.jsxs("div",{className:Be.container,children:[c.jsx(Oc,{isOpen:v,title:"Delete Environment?",description:`"${T.displayName||T.id}" will be permanently removed along with all its data.`,onConfirm:H,onCancel:()=>y(!1)}),c.jsxs("div",{className:Be.envHeader,children:[c.jsxs("div",{className:Be.envTitleRow,children:[c.jsx("span",{className:Be.statusDot,style:{color:j},children:"●"}),c.jsx("h2",{className:Be.envName,children:T.displayName||T.id}),c.jsx("span",{className:Be.statusBadge,style:{color:j},children:T.status})]}),c.jsxs("div",{className:Be.envMeta,children:[c.jsxs("span",{className:Be.metaTag,children:["Adapter: ",T.adapterType]}),N.length>0&&c.jsxs("span",{className:Be.metaTag,children:[N.length," session",N.length!==1?"s":""]}),C>0&&c.jsxs("span",{className:Be.metaTag,children:["Cost: ",Ki(C)]})]})]}),c.jsxs("div",{className:Be.actions,children:[D&&c.jsxs(c.Fragment,{children:[c.jsx("button",{className:Be.btnPrimary,onClick:()=>a(Sb(T.id)),children:"New Chat"}),c.jsx("button",{className:Be.btnOutline,onClick:()=>p(T.id),children:"Stop"})]}),w&&c.jsx("button",{className:Be.btnPrimary,onClick:()=>d(T.id),children:T.status==="error"?"Retry":"Connect"}),R&&F!==void 0&&c.jsx("span",{className:Be.provisionMessage,children:F.message}),T.status==="error"&&(F==null?void 0:F.stage)==="error"&&c.jsx("span",{className:Be.errorMessage,children:F.message}),c.jsx("button",{className:Be.btnOutline,onClick:()=>a(lC(T.id)),"data-testid":"env-edit-btn",children:"Edit Config"}),c.jsx("button",{className:Be.btnDanger,onClick:()=>y(!0),children:"Delete"})]}),c.jsxs("div",{className:Be.section,children:[c.jsxs("div",{className:Be.sectionHeader,children:[c.jsx("h3",{children:"Workspaces"}),c.jsx("button",{className:Be.btnPrimary,onClick:()=>a(`${Tb}?environment=${encodeURIComponent(T.id)}`),"data-testid":"workspace-create-button",children:"+ New Workspace"})]}),E.length===0&&c.jsx("p",{className:Be.empty,children:"No workspaces yet. Create one to get started."}),c.jsx("div",{className:Be.cardList,children:E.map(q=>c.jsx(s5,{workspace:q,confirmArchiveId:b,onOpen:()=>a(Hi(q.id,T.id)),onArchive:()=>S(q.id),onConfirmArchive:()=>B(q.id),onCancelArchive:()=>S(void 0)},q.id))})]})]})}function s5({workspace:t,confirmArchiveId:a,onOpen:i,onArchive:o,onConfirmArchive:r,onCancelArchive:u}){const d=a===t.id,p=t.repoUrl&&/^https?:\/\//.test(t.repoUrl);return c.jsxs("div",{className:Be.card,"data-testid":"workspace-card",children:[c.jsxs("div",{className:Be.cardHeader,children:[c.jsx("strong",{className:Be.cardName,children:t.name}),c.jsxs("div",{className:Be.cardActions,children:[c.jsx("button",{className:Be.btnSmall,onClick:i,children:"Open"}),d?c.jsxs(c.Fragment,{children:[c.jsx("button",{className:Be.btnDanger,onClick:r,children:"Confirm"}),c.jsx("button",{className:Be.btnSmall,onClick:u,children:"Cancel"})]}):c.jsx("button",{className:Be.btnSmall,onClick:o,children:"Archive"})]})]}),t.description&&c.jsx("p",{className:Be.cardDescription,children:t.description}),t.repoUrl&&c.jsx("div",{className:Be.cardMeta,children:p?c.jsx("a",{href:t.repoUrl,target:"_blank",rel:"noopener noreferrer",className:Be.repoLink,children:t.repoUrl}):c.jsx("span",{children:t.repoUrl})})]})}const i5={credentials:"Credentials",personas:"Personas",appearance:"Appearance",about:"About"};function o5(){const a=jt().pathname.replace(/^\/settings\/?/,"").split("/")[0],i=i5[a],o=DB(i);return c.jsxs("div",{className:dl.layout,children:[c.jsx(Vs,{segments:o}),c.jsx("div",{className:dl.content,children:c.jsx("div",{className:dl.tabPanel,children:c.jsx(Ls,{})},a)})]})}const l5="_section_1ingb_14",r5="_sectionTitle_1ingb_26",c5="_sectionDescription_1ingb_35",u5="_tokenList_1ingb_48",d5="_tokenRow_1ingb_55",f5="_tokenBadge_1ingb_68",h5="_tokenName_1ingb_83",p5="_tokenTarget_1ingb_90",m5="_deleteButton_1ingb_99",g5="_addForm_1ingb_113",v5="_formRow_1ingb_119",y5="_input_1ingb_125",b5="_select_1ingb_155",x5="_addButton_1ingb_187",_5="_emptyStateInfo_1ingb_221",S5="_themeOptions_1ingb_229",T5="_themeOption_1ingb_229",k5="_themeOptionSelected_1ingb_254",C5="_themeOptionHeader_1ingb_259",E5="_themeOptionLabel_1ingb_266",N5="_themeOptionDesc_1ingb_273",j5="_variantToggle_1ingb_279",w5="_variantButton_1ingb_286",A5="_variantActive_1ingb_305",D5="_themeSwatches_1ingb_311",R5="_themeSwatch_1ingb_311",M5="_systemToggle_1ingb_325",O5="_systemToggleHint_1ingb_341",B5="_themeActive_1ingb_348",I5="_aboutGrid_1ingb_354",L5="_aboutItem_1ingb_360",U5="_aboutLabel_1ingb_373",z5="_aboutValue_1ingb_379",V5="_aboutDot_1ingb_387",H5="_aboutDotConnected_1ingb_394",P5="_aboutDotDisconnected_1ingb_398",de={section:l5,sectionTitle:r5,sectionDescription:c5,tokenList:u5,tokenRow:d5,tokenBadge:f5,tokenName:h5,tokenTarget:p5,deleteButton:m5,addForm:g5,formRow:v5,input:y5,select:b5,addButton:x5,emptyStateInfo:_5,themeOptions:S5,themeOption:T5,themeOptionSelected:k5,themeOptionHeader:C5,themeOptionLabel:E5,themeOptionDesc:N5,variantToggle:j5,variantButton:w5,variantActive:A5,themeSwatches:D5,themeSwatch:R5,systemToggle:M5,systemToggleHint:O5,themeActive:B5,aboutGrid:I5,aboutItem:L5,aboutLabel:U5,aboutValue:z5,aboutDot:V5,aboutDotConnected:H5,aboutDotDisconnected:P5},G5=[{key:"claude",label:"Claude",description:"Forward Claude credentials for AI agent access.",options:[{value:"off",label:"Off"},{value:"subscription",label:"Subscription"},{value:"api_key",label:"API Key"}]},{key:"github",label:"GitHub",description:"Forward GITHUB_TOKEN and GH_TOKEN for git operations.",options:[{value:"off",label:"Off"},{value:"on",label:"On"}]},{key:"copilot",label:"Copilot",description:"Forward Copilot tokens (COPILOT_GITHUB_TOKEN, CLI config).",options:[{value:"off",label:"Off"},{value:"on",label:"On"}]},{key:"codex",label:"Codex",description:"Forward OPENAI_API_KEY for Codex/OpenAI access.",options:[{value:"off",label:"Off"},{value:"on",label:"On"}]},{key:"goose",label:"Goose",description:"Forward Goose config and API keys for Goose agent access.",options:[{value:"off",label:"Off"},{value:"on",label:"On"}]}];function $5(){const{credentialProviders:t,updateCredentialProviders:a}=qe(),i=(o,r)=>{const u={...t};o==="claude"?u.claude=r:u[o]=r,a(u)};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:G5.map(o=>c.jsxs("div",{className:de.tokenRow,children:[c.jsx("span",{className:de.tokenName,children:o.label}),c.jsx("span",{className:de.tokenTarget,children:o.description}),c.jsx("select",{className:de.select,value:t[o.key],onChange:r=>i(o.key,r.target.value),children:o.options.map(r=>c.jsx("option",{value:r.value,children:r.label},r.value))})]},o.key))})]})}const F5=[{value:"env_var",label:"Environment Variable"},{value:"file",label:"File"}];function q5(){const{tokens:t,setToken:a,deleteToken:i}=qe(),{showToast:o}=Us(),[r,u]=x.useState(""),[d,p]=x.useState(""),[m,g]=x.useState("env_var"),[v,y]=x.useState(""),[b,S]=x.useState(null),T=C=>{if(C.preventDefault(),!r||!d)return;const j=m==="env_var"?v||r.toUpperCase()+"_TOKEN":"";a(r,d,m,j,m==="file"?v:""),o("Token saved successfully","success"),u(""),p(""),y("")},E=C=>{S(C)},N=()=>{b&&(i(b),o("Token deleted","info")),S(null)};return c.jsxs(c.Fragment,{children:[c.jsx(Oc,{isOpen:b!==null,title:"Delete Token?",description:b?`"${b}" will be permanently removed.`:void 0,onConfirm:N,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."}),t.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:t.map(C=>c.jsxs("div",{className:de.tokenRow,children:[c.jsx("span",{className:de.tokenBadge,children:C.tokenType}),c.jsx("span",{className:de.tokenName,children:C.name}),c.jsx("span",{className:de.tokenTarget,children:C.tokenType==="env_var"?C.envVar:C.filePath}),c.jsx("button",{className:de.deleteButton,onClick:()=>E(C.name),title:`Delete ${C.name}`,children:"×"})]},C.name))}),c.jsxs("form",{className:de.addForm,onSubmit:T,children:[c.jsxs("div",{className:de.formRow,children:[c.jsx("input",{className:de.input,type:"text",placeholder:"Token name",value:r,onChange:C=>u(C.target.value)}),c.jsx("input",{className:de.input,type:"password",placeholder:"Value",value:d,onChange:C=>p(C.target.value)})]}),c.jsxs("div",{className:de.formRow,children:[c.jsx("select",{className:de.select,value:m,onChange:C=>g(C.target.value),children:F5.map(C=>c.jsx("option",{value:C.value,children:C.label},C.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:v,onChange:C=>y(C.target.value)}),c.jsx("button",{className:de.addButton,type:"submit",children:"Add Token"})]})]})]})]})}function K5(){return c.jsxs(c.Fragment,{children:[c.jsx($5,{}),c.jsx(q5,{})]})}const Y5="_container_xb7ms_1",Z5="_header_xb7ms_7",X5="_form_xb7ms_19",Q5="_formActions_xb7ms_87",W5="_list_xb7ms_93",J5="_card_xb7ms_99",eL="_active_xb7ms_109",tL="_cardHeader_xb7ms_113",nL="_cardTitle_xb7ms_123",aL="_defaultBadge_xb7ms_129",sL="_cardActions_xb7ms_143",iL="_description_xb7ms_148",oL="_meta_xb7ms_154",lL="_promptDetails_xb7ms_171",rL="_promptText_xb7ms_183",cL="_empty_xb7ms_200",uL="_btnPrimary_xb7ms_206",dL="_btnSecondary_xb7ms_240",fL="_btnSmall_xb7ms_267",hL="_btnDanger_xb7ms_293",pL="_typeToggle_xb7ms_336",mL="_typeBadge_xb7ms_350",gL="_scriptEditor_xb7ms_364",vL="_optional_xb7ms_371",He={container:Y5,header:Z5,form:X5,formActions:Q5,list:W5,card:J5,active:eL,cardHeader:tL,cardTitle:nL,defaultBadge:aL,cardActions:sL,description:iL,meta:oL,promptDetails:lL,promptText:rL,empty:cL,btnPrimary:uL,btnSecondary:dL,btnSmall:fL,btnDanger:hL,typeToggle:pL,typeBadge:mL,scriptEditor:gL,optional:vL};function yL(){const{personas:t,createPersona:a,updatePersona:i,deletePersona:o,appDefaultPersonaId:r,setAppDefaultPersonaId:u}=qe(),[d,p]=x.useState(null),[m,g]=x.useState(!1),[v,y]=x.useState(null),[b,S]=x.useState(""),[T,E]=x.useState(""),[N,C]=x.useState(""),[j,D]=x.useState("claude-code"),[R,w]=x.useState("sonnet"),[F,H]=x.useState(0),[B,q]=x.useState("agent"),[X,ae]=x.useState(""),te=()=>{S(""),E(""),C(""),D("claude-code"),w("sonnet"),H(0),q("agent"),ae("")},ee=()=>{te(),p(null),g(!0)},z=O=>{S(O.name),E(O.description),C(O.systemPrompt);const ie=O.type==="script"?"script":"agent";D(ie==="script"?O.runtime||"genaiscript":O.runtime),w(O.model),H(O.maxTurns),q(ie),ae(O.script||""),p(O),g(!1)},ne=O=>{q(O),O==="script"?D("genaiscript"):j==="genaiscript"&&D("claude-code")},I=O=>{if(O.preventDefault(),!!b.trim()){if(B==="script"){if(!X.trim())return}else if(!N.trim()||!j||!R)return;d?(i(d.id,b,T,N,j,R,F,B,X),p(null)):(a(b,T,N,j,R,F,B,X),g(!1)),te()}},Y=O=>{o(O),y(null),(d==null?void 0:d.id)===O&&(p(null),te())},oe=()=>{p(null),g(!1),te()},G=()=>c.jsxs("form",{onSubmit:I,className:He.form,children:[c.jsx("h3",{children:d?"Edit Persona":"Create Persona"}),c.jsxs("div",{className:He.typeToggle,"data-testid":"persona-type-toggle",children:[c.jsxs("label",{children:[c.jsx("input",{type:"radio",name:"personaType",value:"agent",checked:B==="agent",onChange:()=>ne("agent")}),"Agent"]}),c.jsxs("label",{children:[c.jsx("input",{type:"radio",name:"personaType",value:"script",checked:B==="script",onChange:()=>ne("script")}),"Script"]})]}),c.jsxs("label",{children:["Name",c.jsx("input",{type:"text",value:b,onChange:O=>S(O.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:T,onChange:O=>E(O.target.value),placeholder:"Brief description..."})]}),c.jsxs("label",{children:["Runtime",c.jsx("select",{value:j,onChange:O=>D(O.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:"goose",children:"goose"}),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:R,onChange:O=>w(O.target.value),placeholder:"e.g. sonnet"})]}),c.jsxs("label",{children:["Max Turns",c.jsx("input",{type:"number",value:F,onChange:O=>H(parseInt(O.target.value,10)||0),min:0})]}),c.jsxs("label",{children:["System Prompt",c.jsx("textarea",{value:N,onChange:O=>C(O.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:He.optional,children:"(optional)"}),c.jsx("input",{type:"text",value:R,onChange:O=>w(O.target.value),placeholder:"e.g. sonnet (leave empty for script-only)"})]}),c.jsxs("label",{children:["System Prompt ",c.jsx("span",{className:He.optional,children:"(optional)"}),c.jsx("textarea",{value:N,onChange:O=>C(O.target.value),placeholder:"Optional context for the script...",rows:4})]}),c.jsxs("label",{children:["Script",c.jsx("textarea",{value:X,onChange:O=>ae(O.target.value),placeholder:`script({ model: "openai:gpt-4o" });
106
-
107
- const grackle = await host.mcpServer({
108
- id: "grackle",
109
- url: env.vars.GRACKLE_MCP_URL,
110
- });
111
-
112
- $\`Summarize the current tasks.\`;`,rows:20,className:He.scriptEditor,required:!0,"data-testid":"persona-script-editor"})]})]}),c.jsxs("div",{className:He.formActions,children:[c.jsx("button",{type:"submit",className:He.btnPrimary,children:d?"Save":"Create"}),c.jsx("button",{type:"button",onClick:oe,className:He.btnSecondary,children:"Cancel"})]})]});return c.jsxs("div",{className:He.container,children:[c.jsxs("div",{className:He.header,children:[c.jsx("h2",{children:"Personas"}),c.jsx("button",{onClick:ee,className:He.btnPrimary,children:"+ New Persona"})]}),(m||d)&&G(),t.length===0&&!m?c.jsx("p",{className:He.empty,children:"No personas yet. Create one to get started."}):c.jsx("div",{className:He.list,children:t.map(O=>{const ie=r===O.id,xe=O.type==="script";return c.jsxs("div",{className:`${He.card} ${(d==null?void 0:d.id)===O.id?He.active:""}`,"data-testid":`persona-card-${O.id}`,children:[c.jsxs("div",{className:He.cardHeader,children:[c.jsxs("span",{className:He.cardTitle,children:[c.jsx("strong",{children:O.name}),c.jsx("span",{className:He.typeBadge,"data-testid":`persona-type-badge-${O.id}`,children:xe?"Script":"Agent"}),ie&&c.jsx("span",{className:He.defaultBadge,"data-testid":`persona-default-badge-${O.id}`,children:"App Default"})]}),c.jsxs("div",{className:He.cardActions,children:[!ie&&c.jsx("button",{onClick:()=>u(O.id),className:He.btnSmall,"data-testid":`persona-set-default-${O.id}`,title:"Set as app default persona",children:"Set Default"}),c.jsx("button",{onClick:()=>z(O),className:He.btnSmall,children:"Edit"}),v===O.id?c.jsxs(c.Fragment,{children:[c.jsx("button",{onClick:()=>Y(O.id),className:He.btnDanger,children:"Confirm"}),c.jsx("button",{onClick:()=>y(null),className:He.btnSmall,children:"Cancel"})]}):c.jsx("button",{onClick:()=>y(O.id),className:He.btnSmall,children:"Delete"})]})]}),O.description&&c.jsx("p",{className:He.description,children:O.description}),c.jsxs("div",{className:He.meta,children:[O.runtime&&c.jsxs("span",{children:["Runtime: ",O.runtime]}),O.model&&c.jsxs("span",{children:["Model: ",O.model]}),O.maxTurns>0&&c.jsxs("span",{children:["Max turns: ",O.maxTurns]})]}),xe?c.jsxs("details",{className:He.promptDetails,children:[c.jsx("summary",{children:"Script"}),c.jsx("pre",{className:He.promptText,children:O.script})]}):c.jsxs("details",{className:He.promptDetails,children:[c.jsx("summary",{children:"System Prompt"}),c.jsx("pre",{className:He.promptText,children:O.systemPrompt})]})]},O.id)})})]})}function bL(){return c.jsx(yL,{})}function xL(){const{themeId:t,resolvedThemeId:a,setTheme:i,preferSystem:o,setPreferSystem:r}=Db();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:Ec.filter(u=>!u.hidden).map(u=>{const d=!!(u.variantLightId&&u.variantDarkId),p=d?t===u.id||t===u.variantLightId||t===u.variantDarkId:t===u.id,m=d&&a===u.variantLightId;return c.jsxs("button",{type:"button",className:`${de.themeOption} ${p?de.themeOptionSelected:""}`,"aria-pressed":p,onClick:()=>i(u.id),children:[c.jsxs("span",{className:de.themeOptionHeader,children:[c.jsxs("span",{children:[c.jsx("span",{className:de.themeOptionLabel,children:u.label}),c.jsx("span",{className:de.themeOptionDesc,children:u.description})]}),d&&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(u.variantLightId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(u.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(u.variantDarkId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(u.variantDarkId))},"aria-label":"Dark variant","aria-pressed":p&&!m,children:"☾"})]})]}),u.swatches&&c.jsx("span",{className:de.themeSwatches,children:u.swatches.map((g,v)=>c.jsx("span",{className:de.themeSwatch,style:{background:g}},v))})]},u.id)})}),c.jsxs("label",{className:de.systemToggle,children:[c.jsx("input",{type:"checkbox",checked:o,onChange:u=>r(u.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 _L(){return c.jsx(xL,{})}function SL(){const{connected:t,environments:a,sessions:i}=qe(),o=a.filter(d=>d.status==="connected").length,r=a.length,u=i.filter(d=>["running","idle"].includes(d.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} ${t?de.aboutDotConnected:de.aboutDotDisconnected}`}),t?"Connected":"Disconnected"]})]}),c.jsxs("div",{className:de.aboutItem,children:[c.jsx("span",{className:de.aboutLabel,children:"Environments"}),c.jsxs("span",{className:de.aboutValue,children:[o,"/",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:u})]}),c.jsxs("div",{className:de.aboutItem,children:[c.jsx("span",{className:de.aboutLabel,children:"Version"}),c.jsx("span",{className:de.aboutValue,children:"0.72.4"})]})]})]})}function TL(){return c.jsx(SL,{})}const kL="_wizard_1260s_1",CL="_container_1260s_10",EL="_stepContent_1260s_19",NL="_logoArea_1260s_28",jL="_logoImage_1260s_32",wL="_heading_1260s_41",AL="_tagline_1260s_49",DL="_subtitle_1260s_56",RL="_featureList_1260s_64",ML="_runtimeGrid_1260s_89",OL="_runtimeCard_1260s_101",BL="_runtimeName_1260s_133",IL="_runtimeDescription_1260s_139",LL="_buttonRow_1260s_144",UL="_primaryButton_1260s_151",zL="_ghostButton_1260s_185",VL="_dots_1260s_213",HL="_dot_1260s_213",tt={wizard:kL,container:CL,stepContent:EL,logoArea:NL,logoImage:jL,heading:wL,tagline:AL,subtitle:DL,featureList:RL,runtimeGrid:ML,runtimeCard:OL,runtimeName:BL,runtimeDescription:IL,buttonRow:LL,primaryButton:UL,ghostButton:zL,dots:VL,dot:HL};function PL({onNext:t}){return c.jsxs("div",{className:tt.stepContent,"data-testid":"setup-welcome",children:[c.jsx("div",{className:tt.logoArea,children:c.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:tt.logoImage})}),c.jsx("h1",{className:tt.heading,children:"Welcome to Grackle"}),c.jsx("p",{className:tt.tagline,children:"Multi-agent orchestration for software teams"}),c.jsx("button",{type:"button",className:tt.primaryButton,onClick:t,"data-testid":"setup-get-started",children:"Get Started"})]})}function GL({onNext:t,onBack:a}){return c.jsxs("div",{className:tt.stepContent,"data-testid":"setup-about",children:[c.jsx("h2",{className:tt.heading,children:"What is Grackle?"}),c.jsxs("ul",{className:tt.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:tt.buttonRow,children:[c.jsx("button",{type:"button",className:tt.ghostButton,onClick:a,children:"Back"}),c.jsx("button",{type:"button",className:tt.primaryButton,onClick:t,"data-testid":"setup-about-next",children:"Next"})]})]})}const $L=[{id:"claude-code",name:"Claude Code",description:"Anthropic's agentic coding tool"},{id:"copilot",name:"Copilot Coding Agent",description:"GitHub's AI pair programmer"},{id:"codex",name:"Codex CLI",description:"OpenAI's coding agent"},{id:"goose",name:"Goose",description:"Block's open-source AI coding agent"}];function FL({currentRuntime:t,onFinish:a,onBack:i,finishDisabled:o}){const[r,u]=x.useState(t||"claude-code");return x.useEffect(()=>{t&&u(t)},[t]),c.jsxs("div",{className:tt.stepContent,"data-testid":"setup-runtime",children:[c.jsx("h2",{className:tt.heading,children:"Choose Your Runtime"}),c.jsx("p",{className:tt.subtitle,children:"Select the primary agent runtime for your workspace. You can change this later."}),c.jsx("div",{className:tt.runtimeGrid,children:$L.map(d=>c.jsxs("button",{type:"button",className:tt.runtimeCard,"data-selected":r===d.id,"aria-pressed":r===d.id,"data-testid":`runtime-card-${d.id}`,onClick:()=>u(d.id),children:[c.jsx("span",{className:tt.runtimeName,children:d.name}),c.jsx("span",{className:tt.runtimeDescription,children:d.description})]},d.id))}),c.jsxs("div",{className:tt.buttonRow,children:[c.jsx("button",{type:"button",className:tt.ghostButton,onClick:i,children:"Back"}),c.jsx("button",{type:"button",className:tt.primaryButton,onClick:()=>a(r),disabled:o,"data-testid":"setup-finish",children:"Finish"})]})]})}const qL=3,eb={"claude-code":"sonnet",copilot:"gpt-4o",codex:"o3",goose:""};function KL(){const{personas:t,updatePersona:a,completeOnboarding:i,onboardingCompleted:o}=qe(),r=Dt(),[u,d]=x.useState(0),p=t.find(g=>g.id==="claude-code"),m=x.useCallback(g=>{if(p&&g!==p.runtime){const y=eb[g]??"sonnet";a(p.id,void 0,void 0,void 0,g,y)}const v=t.find(y=>y.id===O0);if(v&&g!==v.runtime){const y=eb[g]??"sonnet";a(O0,void 0,void 0,void 0,g,y)}i(),r("/",{replace:!0})},[p,t,a,i,r]);return o===!0?c.jsx($n,{to:"/",replace:!0}):c.jsx("div",{className:tt.wizard,"data-testid":"setup-wizard",children:c.jsxs("div",{className:tt.container,children:[c.jsx(Qn,{mode:"wait",children:c.jsxs(Ct.div,{initial:{opacity:0,x:40},animate:{opacity:1,x:0},exit:{opacity:0,x:-40},transition:{duration:.2,ease:"easeInOut"},children:[u===0&&c.jsx(PL,{onNext:()=>d(1)}),u===1&&c.jsx(GL,{onNext:()=>d(2),onBack:()=>d(0)}),u===2&&c.jsx(FL,{currentRuntime:(p==null?void 0:p.runtime)??"claude-code",onFinish:m,onBack:()=>d(1),finishDisabled:!p})]},u)}),c.jsx("div",{className:tt.dots,children:Array.from({length:qL},(g,v)=>c.jsx("span",{className:tt.dot,"data-active":v===u},v))})]})})}const YL="_root_zndgp_1",ZL="_body_zndgp_7",XL="_main_zndgp_19",QL="_sidebarWrapper_zndgp_26",WL="_overlay_zndgp_51",sl={root:YL,body:ZL,main:XL,sidebarWrapper:QL,overlay:WL},JL=x.lazy(()=>hT(()=>import("./KnowledgePage-D37ybuo_.js"),__vite__mapDeps([0,1,2,3])).then(t=>({default:t.KnowledgePage}))),e8=typeof window<"u"&&new URLSearchParams(window.location.search).has("mock");function t8(){const t=jt(),i=Ob()!==void 0,[o,r]=x.useState(!1),u=x.useCallback(()=>r(d=>!d),[]);return x.useEffect(()=>{r(!1)},[t.pathname]),x.useEffect(()=>{if(!o)return;const d=p=>{p.key==="Escape"&&r(!1)};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[o]),c.jsxs(c.Fragment,{children:[c.jsx(eE,{onToggleSidebar:i?u:void 0,sidebarOpen:o}),c.jsx(lE,{}),c.jsxs("div",{className:sl.body,children:[i&&c.jsx("div",{className:sl.sidebarWrapper,"data-sidebar-open":o,children:c.jsx(mE,{})}),i&&o&&c.jsx("div",{className:sl.overlay,"data-testid":"drawer-overlay",onClick:()=>r(!1)}),c.jsxs("div",{className:sl.main,children:[c.jsx(Ls,{}),c.jsx(WD,{})]})]}),c.jsx(dR,{})]})}function n8(){const{lastSpawnedId:t,environments:a,connected:i,onboardingCompleted:o}=qe(),{showToast:r}=Us();NM(a,r);const u=Dt(),d=jt();return x.useEffect(()=>{t&&!d.pathname.includes("/tasks/")&&u(_b(t),{replace:!0})},[t,u,d.pathname]),i&&o===!1?c.jsx($n,{to:"/setup",replace:!0}):c.jsx(rE,{children:c.jsx("div",{className:sl.root,children:c.jsx(t8,{})})})}function Tf(){const{workspaceId:t}=ss(),{workspaces:a}=qe(),i=jt(),o=a.find(m=>m.id===t);if(!(o!=null&&o.environmentId))return a.length===0?void 0:c.jsx($n,{to:"/environments",replace:!0});const r=encodeURIComponent(t),u=`/workspaces/${r}`,d=i.pathname.startsWith(u)?i.pathname.slice(u.length):"",p=`/environments/${encodeURIComponent(o.environmentId)}/workspaces/${r}${d}${i.search}${i.hash}`;return c.jsx($n,{to:p,replace:!0})}function a8(){return c.jsxs(kk,{children:[c.jsx(Se,{path:"setup",element:c.jsx(KL,{})}),c.jsxs(Se,{element:c.jsx(n8,{}),children:[c.jsx(Se,{index:!0,element:c.jsx(eB,{})}),c.jsx(Se,{path:"chat",element:c.jsx(wB,{})}),c.jsx(Se,{path:"sessions/new",element:c.jsx(LB,{})}),c.jsx(Se,{path:"sessions/:sessionId",element:c.jsx(VB,{})}),c.jsx(Se,{element:c.jsx($D,{}),children:c.jsx(Se,{path:"knowledge",element:c.jsx(x.Suspense,{fallback:c.jsx(j_,{}),children:c.jsx(JL,{})})})}),c.jsxs(Se,{element:c.jsx(HD,{}),children:[c.jsx(Se,{path:"tasks",element:c.jsx(WO,{})}),c.jsx(Se,{path:"tasks/new",element:c.jsx(X0,{})}),c.jsx(Se,{path:"tasks/:taskId",element:c.jsx(Mi,{})}),c.jsx(Se,{path:"tasks/:taskId/stream",element:c.jsx(Mi,{})}),c.jsx(Se,{path:"tasks/:taskId/findings",element:c.jsx(Mi,{})}),c.jsx(Se,{path:"tasks/:taskId/edit",element:c.jsx(Q0,{})})]}),c.jsxs(Se,{element:c.jsx(PD,{}),children:[c.jsx(Se,{path:"workspaces",element:c.jsx($n,{to:"/environments",replace:!0})}),c.jsx(Se,{path:"workspaces/new",element:c.jsx(HI,{})}),c.jsx(Se,{path:"workspaces/:workspaceId",element:c.jsx(Tf,{})}),c.jsx(Se,{path:"workspaces/:workspaceId/tasks/:taskId",element:c.jsx(Tf,{})}),c.jsx(Se,{path:"workspaces/:workspaceId/tasks/:taskId/*",element:c.jsx(Tf,{})}),c.jsx(Se,{path:"environments/:environmentId/workspaces/:workspaceId",element:c.jsx(iI,{})}),c.jsx(Se,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/new",element:c.jsx(X0,{})}),c.jsx(Se,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId",element:c.jsx(Mi,{})}),c.jsx(Se,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream",element:c.jsx(Mi,{})}),c.jsx(Se,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings",element:c.jsx(Mi,{})}),c.jsx(Se,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit",element:c.jsx(Q0,{})}),c.jsxs(Se,{path:"environments",element:c.jsx(w4,{}),children:[c.jsx(Se,{index:!0,element:c.jsx(JO,{})}),c.jsx(Se,{path:"new",element:c.jsx(k4,{})}),c.jsx(Se,{path:":environmentId",element:c.jsx(a5,{})}),c.jsx(Se,{path:":environmentId/edit",element:c.jsx(C4,{})})]})]}),c.jsx(Se,{element:c.jsx(GD,{}),children:c.jsxs(Se,{path:"settings",element:c.jsx(o5,{}),children:[c.jsx(Se,{index:!0,element:c.jsx($n,{to:"credentials",replace:!0})}),c.jsx(Se,{path:"environments",element:c.jsx($n,{to:"/environments",replace:!0})}),c.jsx(Se,{path:"credentials",element:c.jsx(K5,{})}),c.jsx(Se,{path:"tokens",element:c.jsx($n,{to:"../credentials",replace:!0})}),c.jsx(Se,{path:"personas",element:c.jsx(bL,{})}),c.jsx(Se,{path:"appearance",element:c.jsx(_L,{})}),c.jsx(Se,{path:"about",element:c.jsx(TL,{})})]})}),c.jsx(Se,{path:"*",element:c.jsx($n,{to:"/",replace:!0})})]})]})}const s8=1e4;function i8(){const{onboardingCompleted:t}=qe(),[a,i]=x.useState(!1);x.useEffect(()=>{if(t!==void 0)return;const r=setTimeout(()=>i(!0),s8);return()=>clearTimeout(r)},[t]);const o=t===void 0&&!a;return c.jsx(Qn,{mode:"wait",children:o?c.jsx(Ct.div,{initial:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:c.jsx(j_,{})},"splash"):c.jsx(Ct.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.25},style:{minHeight:"100vh"},children:c.jsx(Zk,{children:c.jsx(a8,{})})},"app")})}function o8(){const t=e8?UC:wC;return c.jsx($C,{children:c.jsx(VC,{children:c.jsx(t,{children:c.jsx(i8,{})})})})}uT.createRoot(document.getElementById("root")).render(c.jsx(x.StrictMode,{children:c.jsx(o8,{})}));export{Vs as B,kb as K,qe as a,_b as s,_a as t,Dt as u};