@grackle-ai/web 0.69.0 → 0.69.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-CNHMdDia.js +100 -0
- package/dist/index.html +1 -1
- package/package.json +2 -2
- package/dist/assets/index-C05gZEug.js +0 -100
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import{r as RS,a as b,j as c,v as OS,b as BS,t as Ur,i as IS,f as LS,M as Kf,c as Zf}from"./markdown-gcy1Jmzi.js";import{r as zS,d as Pv,H as $v,P as Fv,i as US,B as VS,a as HS,C as GS,M as PS}from"./dagview-EHk2VaeR.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))l(r);new MutationObserver(r=>{for(const f of r)if(f.type==="childList")for(const d of f.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function i(r){const f={};return r.integrity&&(f.integrity=r.integrity),r.referrerPolicy&&(f.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?f.credentials="include":r.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function l(r){if(r.ep)return;r.ep=!0;const f=i(r);fetch(r.href,f)}})();var Hd={exports:{}},Ho={},Gd={exports:{}},Pd={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* scheduler.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var qv;function $S(){return qv||(qv=1,(function(n){function a(V,H){var z=V.length;V.push(H);e:for(;0<z;){var re=z-1>>>1,B=V[re];if(0<r(B,H))V[re]=H,V[z]=B,z=re;else break e}}function i(V){return V.length===0?null:V[0]}function l(V){if(V.length===0)return null;var H=V[0],z=V.pop();if(z!==H){V[0]=z;e:for(var re=0,B=V.length,oe=B>>>1;re<oe;){var fe=2*(re+1)-1,se=V[fe],Oe=fe+1,ot=V[Oe];if(0>r(se,z))Oe<B&&0>r(ot,se)?(V[re]=ot,V[Oe]=z,re=Oe):(V[re]=se,V[fe]=z,re=fe);else if(Oe<B&&0>r(ot,z))V[re]=ot,V[Oe]=z,re=Oe;else break e}}return H}function r(V,H){var z=V.sortIndex-H.sortIndex;return z!==0?z:V.id-H.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var d=Date,p=d.now();n.unstable_now=function(){return d.now()-p}}var m=[],g=[],y=1,v=null,x=3,S=!1,C=!1,k=!1,N=!1,E=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function A(V){for(var H=i(g);H!==null;){if(H.callback===null)l(g);else if(H.startTime<=V)l(g),H.sortIndex=H.expirationTime,a(m,H);else break;H=i(g)}}function U(V){if(k=!1,A(V),!C)if(i(m)!==null)C=!0,Y||(Y=!0,R());else{var H=i(g);H!==null&&te(U,H.startTime-V)}}var Y=!1,F=-1,O=5,Z=-1;function ee(){return N?!0:!(n.unstable_now()-Z<O)}function ie(){if(N=!1,Y){var V=n.unstable_now();Z=V;var H=!0;try{e:{C=!1,k&&(k=!1,w(F),F=-1),S=!0;var z=x;try{t:{for(A(V),v=i(m);v!==null&&!(v.expirationTime>V&&ee());){var re=v.callback;if(typeof re=="function"){v.callback=null,x=v.priorityLevel;var B=re(v.expirationTime<=V);if(V=n.unstable_now(),typeof B=="function"){v.callback=B,A(V),H=!0;break t}v===i(m)&&l(m),A(V)}else l(m);v=i(m)}if(v!==null)H=!0;else{var oe=i(g);oe!==null&&te(U,oe.startTime-V),H=!1}}break e}finally{v=null,x=z,S=!1}H=void 0}}finally{H?R():Y=!1}}}var R;if(typeof D=="function")R=function(){D(ie)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,X=ae.port2;ae.port1.onmessage=ie,R=function(){X.postMessage(null)}}else R=function(){E(ie,0)};function te(V,H){F=E(function(){V(n.unstable_now())},H)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(V){V.callback=null},n.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<V?Math.floor(1e3/V):5},n.unstable_getCurrentPriorityLevel=function(){return x},n.unstable_next=function(V){switch(x){case 1:case 2:case 3:var H=3;break;default:H=x}var z=x;x=H;try{return V()}finally{x=z}},n.unstable_requestPaint=function(){N=!0},n.unstable_runWithPriority=function(V,H){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var z=x;x=V;try{return H()}finally{x=z}},n.unstable_scheduleCallback=function(V,H,z){var re=n.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?re+z:re):z=re,V){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=z+B,V={id:y++,callback:H,priorityLevel:V,startTime:z,expirationTime:B,sortIndex:-1},z>re?(V.sortIndex=z,a(g,V),i(m)===null&&V===i(g)&&(k?(w(F),F=-1):k=!0,te(U,z-re))):(V.sortIndex=B,a(m,V),C||S||(C=!0,Y||(Y=!0,R()))),V},n.unstable_shouldYield=ee,n.unstable_wrapCallback=function(V){var H=x;return function(){var z=x;x=H;try{return V.apply(this,arguments)}finally{x=z}}}})(Pd)),Pd}var Yv;function FS(){return Yv||(Yv=1,Gd.exports=$S()),Gd.exports}/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-dom-client.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Kv;function qS(){if(Kv)return Ho;Kv=1;var n=FS(),a=RS(),i=zS();function l(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function d(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(f(e)!==e)throw Error(l(188))}function g(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(l(188));return t!==e?null:e}for(var s=e,o=t;;){var u=s.return;if(u===null)break;var h=u.alternate;if(h===null){if(o=u.return,o!==null){s=o;continue}break}if(u.child===h.child){for(h=u.child;h;){if(h===s)return m(u),e;if(h===o)return m(u),t;h=h.sibling}throw Error(l(188))}if(s.return!==o.return)s=u,o=h;else{for(var _=!1,T=u.child;T;){if(T===s){_=!0,s=u,o=h;break}if(T===o){_=!0,o=u,s=h;break}T=T.sibling}if(!_){for(T=h.child;T;){if(T===s){_=!0,s=h,o=u;break}if(T===o){_=!0,o=h,s=u;break}T=T.sibling}if(!_)throw Error(l(189))}}if(s.alternate!==o)throw Error(l(190))}if(s.tag!==3)throw Error(l(188));return s.stateNode.current===s?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var v=Object.assign,x=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),D=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),Y=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),ee=Symbol.for("react.memo_cache_sentinel"),ie=Symbol.iterator;function R(e){return e===null||typeof e!="object"?null:(e=ie&&e[ie]||e["@@iterator"],typeof e=="function"?e:null)}var ae=Symbol.for("react.client.reference");function X(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ae?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case k:return"Fragment";case E:return"Profiler";case N:return"StrictMode";case U:return"Suspense";case Y:return"SuspenseList";case Z:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case D:return e.displayName||"Context";case w:return(e._context.displayName||"Context")+".Consumer";case A:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case F:return t=e.displayName||null,t!==null?t:X(e.type)||"Memo";case O:t=e._payload,e=e._init;try{return X(e(t))}catch{}}return null}var te=Array.isArray,V=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z={pending:!1,data:null,method:null,action:null},re=[],B=-1;function oe(e){return{current:e}}function fe(e){0>B||(e.current=re[B],re[B]=null,B--)}function se(e,t){B++,re[B]=e.current,e.current=t}var Oe=oe(null),ot=oe(null),$t=oe(null),Rn=oe(null);function Yn(e,t){switch(se($t,t),se(ot,e),se(Oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?fv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=fv(t),e=hv(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}fe(Oe),se(Oe,e)}function Jt(){fe(Oe),fe(ot),fe($t)}function Te(e){e.memoizedState!==null&&se(Rn,e);var t=Oe.current,s=hv(t,e.type);t!==s&&(se(ot,e),se(Oe,s))}function ct(e){ot.current===e&&(fe(Oe),fe(ot)),Rn.current===e&&(fe(Rn),Lo._currentValue=z)}var Ms,Rs;function On(e){if(Ms===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);Ms=t&&t[1]||"",Rs=-1<s.stack.indexOf(`
|
|
18
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
19
|
-
`+Ms+e+Rs}var Os=!1;function Bs(e,t){if(!e||Os)return"";Os=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(t){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(q){var $=q}Reflect.construct(e,[],J)}else{try{J.call()}catch(q){$=q}e.call(J.prototype)}}else{try{throw Error()}catch(q){$=q}(J=e())&&typeof J.catch=="function"&&J.catch(function(){})}}catch(q){if(q&&$&&typeof q.stack=="string")return[q.stack,$.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=o.DetermineComponentFrameRoot(),_=h[0],T=h[1];if(_&&T){var j=_.split(`
|
|
20
|
-
`),P=T.split(`
|
|
21
|
-
`);for(u=o=0;o<j.length&&!j[o].includes("DetermineComponentFrameRoot");)o++;for(;u<P.length&&!P[u].includes("DetermineComponentFrameRoot");)u++;if(o===j.length||u===P.length)for(o=j.length-1,u=P.length-1;1<=o&&0<=u&&j[o]!==P[u];)u--;for(;1<=o&&0<=u;o--,u--)if(j[o]!==P[u]){if(o!==1||u!==1)do if(o--,u--,0>u||j[o]!==P[u]){var K=`
|
|
22
|
-
`+j[o].replace(" at new "," at ");return e.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",e.displayName)),K}while(1<=o&&0<=u);break}}}finally{Os=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?On(s):""}function Tl(e,t){switch(e.tag){case 26:case 27:case 5:return On(e.type);case 16:return On("Lazy");case 13:return e.child!==t&&t!==null?On("Suspense Fallback"):On("Suspense");case 19:return On("SuspenseList");case 0:case 15:return Bs(e.type,!1);case 11:return Bs(e.type.render,!1);case 1:return Bs(e.type,!0);case 31:return On("Activity");default:return""}}function Ki(e){try{var t="",s=null;do t+=Tl(e,s),s=e,e=e.return;while(e);return t}catch(o){return`
|
|
23
|
-
Error generating stack: `+o.message+`
|
|
24
|
-
`+o.stack}}var Is=Object.prototype.hasOwnProperty,Ls=n.unstable_scheduleCallback,zs=n.unstable_cancelCallback,Cl=n.unstable_shouldYield,kl=n.unstable_requestPaint,Bt=n.unstable_now,Ac=n.unstable_getCurrentPriorityLevel,W=n.unstable_ImmediatePriority,le=n.unstable_UserBlockingPriority,ce=n.unstable_NormalPriority,xe=n.unstable_LowPriority,be=n.unstable_IdlePriority,Ze=n.log,Ce=n.unstable_setDisableYieldValue,ht=null,ke=null;function lt(e){if(typeof Ze=="function"&&Ce(e),ke&&typeof ke.setStrictMode=="function")try{ke.setStrictMode(ht,e)}catch{}}var Fe=Math.clz32?Math.clz32:It,Vt=Math.log,en=Math.LN2;function It(e){return e>>>=0,e===0?32:31-(Vt(e)/en|0)|0}var xa=256,pn=262144,_a=4194304;function as(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function El(e,t,s){var o=e.pendingLanes;if(o===0)return 0;var u=0,h=e.suspendedLanes,_=e.pingedLanes;e=e.warmLanes;var T=o&134217727;return T!==0?(o=T&~h,o!==0?u=as(o):(_&=T,_!==0?u=as(_):s||(s=T&~e,s!==0&&(u=as(s))))):(T=o&~h,T!==0?u=as(T):_!==0?u=as(_):s||(s=o&~e,s!==0&&(u=as(s)))),u===0?0:t!==0&&t!==u&&(t&h)===0&&(h=u&-u,s=t&-t,h>=s||h===32&&(s&4194048)!==0)?t:u}function Zi(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function x_(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Yh(){var e=_a;return _a<<=1,(_a&62914560)===0&&(_a=4194304),e}function wc(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function Xi(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function __(e,t,s,o,u,h){var _=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var T=e.entanglements,j=e.expirationTimes,P=e.hiddenUpdates;for(s=_&~s;0<s;){var K=31-Fe(s),J=1<<K;T[K]=0,j[K]=-1;var $=P[K];if($!==null)for(P[K]=null,K=0;K<$.length;K++){var q=$[K];q!==null&&(q.lane&=-536870913)}s&=~J}o!==0&&Kh(e,o,0),h!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=h&~(_&~t))}function Kh(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var o=31-Fe(t);e.entangledLanes|=t,e.entanglements[o]=e.entanglements[o]|1073741824|s&261930}function Zh(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var o=31-Fe(s),u=1<<o;u&t|e[o]&t&&(e[o]|=t),s&=~u}}function Xh(e,t){var s=t&-t;return s=(s&42)!==0?1:jc(s),(s&(e.suspendedLanes|t))!==0?0:s}function jc(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Dc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Qh(){var e=H.p;return e!==0?e:(e=window.event,e===void 0?32:Iv(e.type))}function Wh(e,t){var s=H.p;try{return H.p=e,t()}finally{H.p=s}}var Sa=Math.random().toString(36).slice(2),wt="__reactFiber$"+Sa,Ft="__reactProps$"+Sa,Us="__reactContainer$"+Sa,Mc="__reactEvents$"+Sa,S_="__reactListeners$"+Sa,T_="__reactHandles$"+Sa,Jh="__reactResources$"+Sa,Qi="__reactMarker$"+Sa;function Rc(e){delete e[wt],delete e[Ft],delete e[Mc],delete e[S_],delete e[T_]}function Vs(e){var t=e[wt];if(t)return t;for(var s=e.parentNode;s;){if(t=s[Us]||s[wt]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=xv(e);e!==null;){if(s=e[wt])return s;e=xv(e)}return t}e=s,s=e.parentNode}return null}function Hs(e){if(e=e[wt]||e[Us]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Wi(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(l(33))}function Gs(e){var t=e[Jh];return t||(t=e[Jh]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function kt(e){e[Qi]=!0}var ep=new Set,tp={};function ss(e,t){Ps(e,t),Ps(e+"Capture",t)}function Ps(e,t){for(tp[e]=t,e=0;e<t.length;e++)ep.add(t[e])}var C_=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]*$"),np={},ap={};function k_(e){return Is.call(ap,e)?!0:Is.call(np,e)?!1:C_.test(e)?ap[e]=!0:(np[e]=!0,!1)}function Nl(e,t,s){if(k_(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var o=t.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+s)}}function Al(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+s)}}function Kn(e,t,s,o){if(o===null)e.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+o)}}function mn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function sp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function E_(e,t,s){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var u=o.get,h=o.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(_){s=""+_,h.call(this,_)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return s},setValue:function(_){s=""+_},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Oc(e){if(!e._valueTracker){var t=sp(e)?"checked":"value";e._valueTracker=E_(e,t,""+e[t])}}function ip(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),o="";return e&&(o=sp(e)?e.checked?"true":"false":e.value),e=o,e!==s?(t.setValue(e),!0):!1}function wl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var N_=/[\n"\\]/g;function gn(e){return e.replace(N_,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Bc(e,t,s,o,u,h,_,T){e.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.type=_:e.removeAttribute("type"),t!=null?_==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+mn(t)):e.value!==""+mn(t)&&(e.value=""+mn(t)):_!=="submit"&&_!=="reset"||e.removeAttribute("value"),t!=null?Ic(e,_,mn(t)):s!=null?Ic(e,_,mn(s)):o!=null&&e.removeAttribute("value"),u==null&&h!=null&&(e.defaultChecked=!!h),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?e.name=""+mn(T):e.removeAttribute("name")}function op(e,t,s,o,u,h,_,T){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),t!=null||s!=null){if(!(h!=="submit"&&h!=="reset"||t!=null)){Oc(e);return}s=s!=null?""+mn(s):"",t=t!=null?""+mn(t):s,T||t===e.value||(e.value=t),e.defaultValue=t}o=o??u,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=T?e.checked:!!o,e.defaultChecked=!!o,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(e.name=_),Oc(e)}function Ic(e,t,s){t==="number"&&wl(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function $s(e,t,s,o){if(e=e.options,t){t={};for(var u=0;u<s.length;u++)t["$"+s[u]]=!0;for(s=0;s<e.length;s++)u=t.hasOwnProperty("$"+e[s].value),e[s].selected!==u&&(e[s].selected=u),u&&o&&(e[s].defaultSelected=!0)}else{for(s=""+mn(s),t=null,u=0;u<e.length;u++){if(e[u].value===s){e[u].selected=!0,o&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function lp(e,t,s){if(t!=null&&(t=""+mn(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+mn(s):""}function rp(e,t,s,o){if(t==null){if(o!=null){if(s!=null)throw Error(l(92));if(te(o)){if(1<o.length)throw Error(l(93));o=o[0]}s=o}s==null&&(s=""),t=s}s=mn(t),e.defaultValue=s,o=e.textContent,o===s&&o!==""&&o!==null&&(e.value=o),Oc(e)}function Fs(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var A_=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 cp(e,t,s){var o=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?o?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":o?e.setProperty(t,s):typeof s!="number"||s===0||A_.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function up(e,t,s){if(t!=null&&typeof t!="object")throw Error(l(62));if(e=e.style,s!=null){for(var o in s)!s.hasOwnProperty(o)||t!=null&&t.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="");for(var u in t)o=t[u],t.hasOwnProperty(u)&&s[u]!==o&&cp(e,u,o)}else for(var h in t)t.hasOwnProperty(h)&&cp(e,h,t[h])}function Lc(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 w_=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"]]),j_=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function jl(e){return j_.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Zn(){}var zc=null;function Uc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var qs=null,Ys=null;function dp(e){var t=Hs(e);if(t&&(e=t.stateNode)){var s=e[Ft]||null;e:switch(e=t.stateNode,t.type){case"input":if(Bc(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+gn(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var o=s[t];if(o!==e&&o.form===e.form){var u=o[Ft]||null;if(!u)throw Error(l(90));Bc(o,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<s.length;t++)o=s[t],o.form===e.form&&ip(o)}break e;case"textarea":lp(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&$s(e,!!s.multiple,t,!1)}}}var Vc=!1;function fp(e,t,s){if(Vc)return e(t,s);Vc=!0;try{var o=e(t);return o}finally{if(Vc=!1,(qs!==null||Ys!==null)&&(vr(),qs&&(t=qs,e=Ys,Ys=qs=null,dp(t),e)))for(t=0;t<e.length;t++)dp(e[t])}}function Ji(e,t){var s=e.stateNode;if(s===null)return null;var o=s[Ft]||null;if(o===null)return null;s=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(l(231,t,typeof s));return s}var Xn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hc=!1;if(Xn)try{var eo={};Object.defineProperty(eo,"passive",{get:function(){Hc=!0}}),window.addEventListener("test",eo,eo),window.removeEventListener("test",eo,eo)}catch{Hc=!1}var Ta=null,Gc=null,Dl=null;function hp(){if(Dl)return Dl;var e,t=Gc,s=t.length,o,u="value"in Ta?Ta.value:Ta.textContent,h=u.length;for(e=0;e<s&&t[e]===u[e];e++);var _=s-e;for(o=1;o<=_&&t[s-o]===u[h-o];o++);return Dl=u.slice(e,1<o?1-o:void 0)}function Ml(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Rl(){return!0}function pp(){return!1}function qt(e){function t(s,o,u,h,_){this._reactName=s,this._targetInst=u,this.type=o,this.nativeEvent=h,this.target=_,this.currentTarget=null;for(var T in e)e.hasOwnProperty(T)&&(s=e[T],this[T]=s?s(h):h[T]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Rl:pp,this.isPropagationStopped=pp,this}return v(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Rl)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Rl)},persist:function(){},isPersistent:Rl}),t}var is={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ol=qt(is),to=v({},is,{view:0,detail:0}),D_=qt(to),Pc,$c,no,Bl=v({},to,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qc,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!==no&&(no&&e.type==="mousemove"?(Pc=e.screenX-no.screenX,$c=e.screenY-no.screenY):$c=Pc=0,no=e),Pc)},movementY:function(e){return"movementY"in e?e.movementY:$c}}),mp=qt(Bl),M_=v({},Bl,{dataTransfer:0}),R_=qt(M_),O_=v({},to,{relatedTarget:0}),Fc=qt(O_),B_=v({},is,{animationName:0,elapsedTime:0,pseudoElement:0}),I_=qt(B_),L_=v({},is,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),z_=qt(L_),U_=v({},is,{data:0}),gp=qt(U_),V_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},H_={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"},G_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function P_(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=G_[e])?!!t[e]:!1}function qc(){return P_}var $_=v({},to,{key:function(e){if(e.key){var t=V_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ml(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?H_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qc,charCode:function(e){return e.type==="keypress"?Ml(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ml(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),F_=qt($_),q_=v({},Bl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),vp=qt(q_),Y_=v({},to,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qc}),K_=qt(Y_),Z_=v({},is,{propertyName:0,elapsedTime:0,pseudoElement:0}),X_=qt(Z_),Q_=v({},Bl,{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}),W_=qt(Q_),J_=v({},is,{newState:0,oldState:0}),e1=qt(J_),t1=[9,13,27,32],Yc=Xn&&"CompositionEvent"in window,ao=null;Xn&&"documentMode"in document&&(ao=document.documentMode);var n1=Xn&&"TextEvent"in window&&!ao,yp=Xn&&(!Yc||ao&&8<ao&&11>=ao),bp=" ",xp=!1;function _p(e,t){switch(e){case"keyup":return t1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ks=!1;function a1(e,t){switch(e){case"compositionend":return Sp(t);case"keypress":return t.which!==32?null:(xp=!0,bp);case"textInput":return e=t.data,e===bp&&xp?null:e;default:return null}}function s1(e,t){if(Ks)return e==="compositionend"||!Yc&&_p(e,t)?(e=hp(),Dl=Gc=Ta=null,Ks=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return yp&&t.locale!=="ko"?null:t.data;default:return null}}var i1={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 Tp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!i1[e.type]:t==="textarea"}function Cp(e,t,s,o){qs?Ys?Ys.push(o):Ys=[o]:qs=o,t=Cr(t,"onChange"),0<t.length&&(s=new Ol("onChange","change",null,s,o),e.push({event:s,listeners:t}))}var so=null,io=null;function o1(e){ov(e,0)}function Il(e){var t=Wi(e);if(ip(t))return e}function kp(e,t){if(e==="change")return t}var Ep=!1;if(Xn){var Kc;if(Xn){var Zc="oninput"in document;if(!Zc){var Np=document.createElement("div");Np.setAttribute("oninput","return;"),Zc=typeof Np.oninput=="function"}Kc=Zc}else Kc=!1;Ep=Kc&&(!document.documentMode||9<document.documentMode)}function Ap(){so&&(so.detachEvent("onpropertychange",wp),io=so=null)}function wp(e){if(e.propertyName==="value"&&Il(io)){var t=[];Cp(t,io,e,Uc(e)),fp(o1,t)}}function l1(e,t,s){e==="focusin"?(Ap(),so=t,io=s,so.attachEvent("onpropertychange",wp)):e==="focusout"&&Ap()}function r1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Il(io)}function c1(e,t){if(e==="click")return Il(t)}function u1(e,t){if(e==="input"||e==="change")return Il(t)}function d1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var tn=typeof Object.is=="function"?Object.is:d1;function oo(e,t){if(tn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),o=Object.keys(t);if(s.length!==o.length)return!1;for(o=0;o<s.length;o++){var u=s[o];if(!Is.call(t,u)||!tn(e[u],t[u]))return!1}return!0}function jp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Dp(e,t){var s=jp(e);e=0;for(var o;s;){if(s.nodeType===3){if(o=e+s.textContent.length,e<=t&&o>=t)return{node:s,offset:t-e};e=o}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=jp(s)}}function Mp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Mp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Rp(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=wl(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=wl(e.document)}return t}function Xc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var f1=Xn&&"documentMode"in document&&11>=document.documentMode,Zs=null,Qc=null,lo=null,Wc=!1;function Op(e,t,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Wc||Zs==null||Zs!==wl(o)||(o=Zs,"selectionStart"in o&&Xc(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),lo&&oo(lo,o)||(lo=o,o=Cr(Qc,"onSelect"),0<o.length&&(t=new Ol("onSelect","select",null,t,s),e.push({event:t,listeners:o}),t.target=Zs)))}function os(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var Xs={animationend:os("Animation","AnimationEnd"),animationiteration:os("Animation","AnimationIteration"),animationstart:os("Animation","AnimationStart"),transitionrun:os("Transition","TransitionRun"),transitionstart:os("Transition","TransitionStart"),transitioncancel:os("Transition","TransitionCancel"),transitionend:os("Transition","TransitionEnd")},Jc={},Bp={};Xn&&(Bp=document.createElement("div").style,"AnimationEvent"in window||(delete Xs.animationend.animation,delete Xs.animationiteration.animation,delete Xs.animationstart.animation),"TransitionEvent"in window||delete Xs.transitionend.transition);function ls(e){if(Jc[e])return Jc[e];if(!Xs[e])return e;var t=Xs[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in Bp)return Jc[e]=t[s];return e}var Ip=ls("animationend"),Lp=ls("animationiteration"),zp=ls("animationstart"),h1=ls("transitionrun"),p1=ls("transitionstart"),m1=ls("transitioncancel"),Up=ls("transitionend"),Vp=new Map,eu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");eu.push("scrollEnd");function wn(e,t){Vp.set(e,t),ss(t,[e])}var Ll=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},vn=[],Qs=0,tu=0;function zl(){for(var e=Qs,t=tu=Qs=0;t<e;){var s=vn[t];vn[t++]=null;var o=vn[t];vn[t++]=null;var u=vn[t];vn[t++]=null;var h=vn[t];if(vn[t++]=null,o!==null&&u!==null){var _=o.pending;_===null?u.next=u:(u.next=_.next,_.next=u),o.pending=u}h!==0&&Hp(s,u,h)}}function Ul(e,t,s,o){vn[Qs++]=e,vn[Qs++]=t,vn[Qs++]=s,vn[Qs++]=o,tu|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function nu(e,t,s,o){return Ul(e,t,s,o),Vl(e)}function rs(e,t){return Ul(e,null,null,t),Vl(e)}function Hp(e,t,s){e.lanes|=s;var o=e.alternate;o!==null&&(o.lanes|=s);for(var u=!1,h=e.return;h!==null;)h.childLanes|=s,o=h.alternate,o!==null&&(o.childLanes|=s),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(u=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,u&&t!==null&&(u=31-Fe(s),e=h.hiddenUpdates,o=e[u],o===null?e[u]=[t]:o.push(t),t.lane=s|536870912),h):null}function Vl(e){if(50<jo)throw jo=0,dd=null,Error(l(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ws={};function g1(e,t,s,o){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nn(e,t,s,o){return new g1(e,t,s,o)}function au(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Qn(e,t){var s=e.alternate;return s===null?(s=nn(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function Gp(e,t){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Hl(e,t,s,o,u,h){var _=0;if(o=e,typeof e=="function")au(e)&&(_=1);else if(typeof e=="string")_=_S(e,s,Oe.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Z:return e=nn(31,s,t,u),e.elementType=Z,e.lanes=h,e;case k:return cs(s.children,u,h,t);case N:_=8,u|=24;break;case E:return e=nn(12,s,t,u|2),e.elementType=E,e.lanes=h,e;case U:return e=nn(13,s,t,u),e.elementType=U,e.lanes=h,e;case Y:return e=nn(19,s,t,u),e.elementType=Y,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case D:_=10;break e;case w:_=9;break e;case A:_=11;break e;case F:_=14;break e;case O:_=16,o=null;break e}_=29,s=Error(l(130,e===null?"null":typeof e,"")),o=null}return t=nn(_,s,t,u),t.elementType=e,t.type=o,t.lanes=h,t}function cs(e,t,s,o){return e=nn(7,e,o,t),e.lanes=s,e}function su(e,t,s){return e=nn(6,e,null,t),e.lanes=s,e}function Pp(e){var t=nn(18,null,null,0);return t.stateNode=e,t}function iu(e,t,s){return t=nn(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var $p=new WeakMap;function yn(e,t){if(typeof e=="object"&&e!==null){var s=$p.get(e);return s!==void 0?s:(t={value:e,source:t,stack:Ki(t)},$p.set(e,t),t)}return{value:e,source:t,stack:Ki(t)}}var Js=[],ei=0,Gl=null,ro=0,bn=[],xn=0,Ca=null,Bn=1,In="";function Wn(e,t){Js[ei++]=ro,Js[ei++]=Gl,Gl=e,ro=t}function Fp(e,t,s){bn[xn++]=Bn,bn[xn++]=In,bn[xn++]=Ca,Ca=e;var o=Bn;e=In;var u=32-Fe(o)-1;o&=~(1<<u),s+=1;var h=32-Fe(t)+u;if(30<h){var _=u-u%5;h=(o&(1<<_)-1).toString(32),o>>=_,u-=_,Bn=1<<32-Fe(t)+u|s<<u|o,In=h+e}else Bn=1<<h|s<<u|o,In=e}function ou(e){e.return!==null&&(Wn(e,1),Fp(e,1,0))}function lu(e){for(;e===Gl;)Gl=Js[--ei],Js[ei]=null,ro=Js[--ei],Js[ei]=null;for(;e===Ca;)Ca=bn[--xn],bn[xn]=null,In=bn[--xn],bn[xn]=null,Bn=bn[--xn],bn[xn]=null}function qp(e,t){bn[xn++]=Bn,bn[xn++]=In,bn[xn++]=Ca,Bn=t.id,In=t.overflow,Ca=e}var jt=null,et=null,De=!1,ka=null,_n=!1,ru=Error(l(519));function Ea(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw co(yn(t,e)),ru}function Yp(e){var t=e.stateNode,s=e.type,o=e.memoizedProps;switch(t[wt]=e,t[Ft]=o,s){case"dialog":Ae("cancel",t),Ae("close",t);break;case"iframe":case"object":case"embed":Ae("load",t);break;case"video":case"audio":for(s=0;s<Mo.length;s++)Ae(Mo[s],t);break;case"source":Ae("error",t);break;case"img":case"image":case"link":Ae("error",t),Ae("load",t);break;case"details":Ae("toggle",t);break;case"input":Ae("invalid",t),op(t,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Ae("invalid",t);break;case"textarea":Ae("invalid",t),rp(t,o.value,o.defaultValue,o.children)}s=o.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||o.suppressHydrationWarning===!0||uv(t.textContent,s)?(o.popover!=null&&(Ae("beforetoggle",t),Ae("toggle",t)),o.onScroll!=null&&Ae("scroll",t),o.onScrollEnd!=null&&Ae("scrollend",t),o.onClick!=null&&(t.onclick=Zn),t=!0):t=!1,t||Ea(e,!0)}function Kp(e){for(jt=e.return;jt;)switch(jt.tag){case 5:case 31:case 13:_n=!1;return;case 27:case 3:_n=!0;return;default:jt=jt.return}}function ti(e){if(e!==jt)return!1;if(!De)return Kp(e),De=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||Ed(e.type,e.memoizedProps)),s=!s),s&&et&&Ea(e),Kp(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));et=bv(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));et=bv(e)}else t===27?(t=et,Va(e.type)?(e=Dd,Dd=null,et=e):et=t):et=jt?Tn(e.stateNode.nextSibling):null;return!0}function us(){et=jt=null,De=!1}function cu(){var e=ka;return e!==null&&(Xt===null?Xt=e:Xt.push.apply(Xt,e),ka=null),e}function co(e){ka===null?ka=[e]:ka.push(e)}var uu=oe(null),ds=null,Jn=null;function Na(e,t,s){se(uu,t._currentValue),t._currentValue=s}function ea(e){e._currentValue=uu.current,fe(uu)}function du(e,t,s){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===s)break;e=e.return}}function fu(e,t,s,o){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var h=u.dependencies;if(h!==null){var _=u.child;h=h.firstContext;e:for(;h!==null;){var T=h;h=u;for(var j=0;j<t.length;j++)if(T.context===t[j]){h.lanes|=s,T=h.alternate,T!==null&&(T.lanes|=s),du(h.return,s,e),o||(_=null);break e}h=T.next}}else if(u.tag===18){if(_=u.return,_===null)throw Error(l(341));_.lanes|=s,h=_.alternate,h!==null&&(h.lanes|=s),du(_,s,e),_=null}else _=u.child;if(_!==null)_.return=u;else for(_=u;_!==null;){if(_===e){_=null;break}if(u=_.sibling,u!==null){u.return=_.return,_=u;break}_=_.return}u=_}}function ni(e,t,s,o){e=null;for(var u=t,h=!1;u!==null;){if(!h){if((u.flags&524288)!==0)h=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var _=u.alternate;if(_===null)throw Error(l(387));if(_=_.memoizedProps,_!==null){var T=u.type;tn(u.pendingProps.value,_.value)||(e!==null?e.push(T):e=[T])}}else if(u===Rn.current){if(_=u.alternate,_===null)throw Error(l(387));_.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Lo):e=[Lo])}u=u.return}e!==null&&fu(t,e,s,o),t.flags|=262144}function Pl(e){for(e=e.firstContext;e!==null;){if(!tn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function fs(e){ds=e,Jn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Dt(e){return Zp(ds,e)}function $l(e,t){return ds===null&&fs(e),Zp(e,t)}function Zp(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},Jn===null){if(e===null)throw Error(l(308));Jn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Jn=Jn.next=t;return s}var v1=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,o){e.push(o)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},y1=n.unstable_scheduleCallback,b1=n.unstable_NormalPriority,vt={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function hu(){return{controller:new v1,data:new Map,refCount:0}}function uo(e){e.refCount--,e.refCount===0&&y1(b1,function(){e.controller.abort()})}var fo=null,pu=0,ai=0,si=null;function x1(e,t){if(fo===null){var s=fo=[];pu=0,ai=vd(),si={status:"pending",value:void 0,then:function(o){s.push(o)}}}return pu++,t.then(Xp,Xp),t}function Xp(){if(--pu===0&&fo!==null){si!==null&&(si.status="fulfilled");var e=fo;fo=null,ai=0,si=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function _1(e,t){var s=[],o={status:"pending",value:null,reason:null,then:function(u){s.push(u)}};return e.then(function(){o.status="fulfilled",o.value=t;for(var u=0;u<s.length;u++)(0,s[u])(t)},function(u){for(o.status="rejected",o.reason=u,u=0;u<s.length;u++)(0,s[u])(void 0)}),o}var Qp=V.S;V.S=function(e,t){Og=Bt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&x1(e,t),Qp!==null&&Qp(e,t)};var hs=oe(null);function mu(){var e=hs.current;return e!==null?e:Xe.pooledCache}function Fl(e,t){t===null?se(hs,hs.current):se(hs,t.pool)}function Wp(){var e=mu();return e===null?null:{parent:vt._currentValue,pool:e}}var ii=Error(l(460)),gu=Error(l(474)),ql=Error(l(542)),Yl={then:function(){}};function Jp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function em(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(Zn,Zn),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,nm(e),e;default:if(typeof t.status=="string")t.then(Zn,Zn);else{if(e=Xe,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=t,e.status="pending",e.then(function(o){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=o}},function(o){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=o}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,nm(e),e}throw ms=t,ii}}function ps(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(ms=s,ii):s}}var ms=null;function tm(){if(ms===null)throw Error(l(459));var e=ms;return ms=null,e}function nm(e){if(e===ii||e===ql)throw Error(l(483))}var oi=null,ho=0;function Kl(e){var t=ho;return ho+=1,oi===null&&(oi=[]),em(oi,e,t)}function po(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Zl(e,t){throw t.$$typeof===x?Error(l(525)):(e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function am(e){function t(L,M){if(e){var G=L.deletions;G===null?(L.deletions=[M],L.flags|=16):G.push(M)}}function s(L,M){if(!e)return null;for(;M!==null;)t(L,M),M=M.sibling;return null}function o(L){for(var M=new Map;L!==null;)L.key!==null?M.set(L.key,L):M.set(L.index,L),L=L.sibling;return M}function u(L,M){return L=Qn(L,M),L.index=0,L.sibling=null,L}function h(L,M,G){return L.index=G,e?(G=L.alternate,G!==null?(G=G.index,G<M?(L.flags|=67108866,M):G):(L.flags|=67108866,M)):(L.flags|=1048576,M)}function _(L){return e&&L.alternate===null&&(L.flags|=67108866),L}function T(L,M,G,Q){return M===null||M.tag!==6?(M=su(G,L.mode,Q),M.return=L,M):(M=u(M,G),M.return=L,M)}function j(L,M,G,Q){var pe=G.type;return pe===k?K(L,M,G.props.children,Q,G.key):M!==null&&(M.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===O&&ps(pe)===M.type)?(M=u(M,G.props),po(M,G),M.return=L,M):(M=Hl(G.type,G.key,G.props,null,L.mode,Q),po(M,G),M.return=L,M)}function P(L,M,G,Q){return M===null||M.tag!==4||M.stateNode.containerInfo!==G.containerInfo||M.stateNode.implementation!==G.implementation?(M=iu(G,L.mode,Q),M.return=L,M):(M=u(M,G.children||[]),M.return=L,M)}function K(L,M,G,Q,pe){return M===null||M.tag!==7?(M=cs(G,L.mode,Q,pe),M.return=L,M):(M=u(M,G),M.return=L,M)}function J(L,M,G){if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return M=su(""+M,L.mode,G),M.return=L,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case S:return G=Hl(M.type,M.key,M.props,null,L.mode,G),po(G,M),G.return=L,G;case C:return M=iu(M,L.mode,G),M.return=L,M;case O:return M=ps(M),J(L,M,G)}if(te(M)||R(M))return M=cs(M,L.mode,G,null),M.return=L,M;if(typeof M.then=="function")return J(L,Kl(M),G);if(M.$$typeof===D)return J(L,$l(L,M),G);Zl(L,M)}return null}function $(L,M,G,Q){var pe=M!==null?M.key:null;if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return pe!==null?null:T(L,M,""+G,Q);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case S:return G.key===pe?j(L,M,G,Q):null;case C:return G.key===pe?P(L,M,G,Q):null;case O:return G=ps(G),$(L,M,G,Q)}if(te(G)||R(G))return pe!==null?null:K(L,M,G,Q,null);if(typeof G.then=="function")return $(L,M,Kl(G),Q);if(G.$$typeof===D)return $(L,M,$l(L,G),Q);Zl(L,G)}return null}function q(L,M,G,Q,pe){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return L=L.get(G)||null,T(M,L,""+Q,pe);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case S:return L=L.get(Q.key===null?G:Q.key)||null,j(M,L,Q,pe);case C:return L=L.get(Q.key===null?G:Q.key)||null,P(M,L,Q,pe);case O:return Q=ps(Q),q(L,M,G,Q,pe)}if(te(Q)||R(Q))return L=L.get(G)||null,K(M,L,Q,pe,null);if(typeof Q.then=="function")return q(L,M,G,Kl(Q),pe);if(Q.$$typeof===D)return q(L,M,G,$l(M,Q),pe);Zl(M,Q)}return null}function ue(L,M,G,Q){for(var pe=null,Ie=null,he=M,Se=M=0,je=null;he!==null&&Se<G.length;Se++){he.index>Se?(je=he,he=null):je=he.sibling;var Le=$(L,he,G[Se],Q);if(Le===null){he===null&&(he=je);break}e&&he&&Le.alternate===null&&t(L,he),M=h(Le,M,Se),Ie===null?pe=Le:Ie.sibling=Le,Ie=Le,he=je}if(Se===G.length)return s(L,he),De&&Wn(L,Se),pe;if(he===null){for(;Se<G.length;Se++)he=J(L,G[Se],Q),he!==null&&(M=h(he,M,Se),Ie===null?pe=he:Ie.sibling=he,Ie=he);return De&&Wn(L,Se),pe}for(he=o(he);Se<G.length;Se++)je=q(he,L,Se,G[Se],Q),je!==null&&(e&&je.alternate!==null&&he.delete(je.key===null?Se:je.key),M=h(je,M,Se),Ie===null?pe=je:Ie.sibling=je,Ie=je);return e&&he.forEach(function(Fa){return t(L,Fa)}),De&&Wn(L,Se),pe}function ge(L,M,G,Q){if(G==null)throw Error(l(151));for(var pe=null,Ie=null,he=M,Se=M=0,je=null,Le=G.next();he!==null&&!Le.done;Se++,Le=G.next()){he.index>Se?(je=he,he=null):je=he.sibling;var Fa=$(L,he,Le.value,Q);if(Fa===null){he===null&&(he=je);break}e&&he&&Fa.alternate===null&&t(L,he),M=h(Fa,M,Se),Ie===null?pe=Fa:Ie.sibling=Fa,Ie=Fa,he=je}if(Le.done)return s(L,he),De&&Wn(L,Se),pe;if(he===null){for(;!Le.done;Se++,Le=G.next())Le=J(L,Le.value,Q),Le!==null&&(M=h(Le,M,Se),Ie===null?pe=Le:Ie.sibling=Le,Ie=Le);return De&&Wn(L,Se),pe}for(he=o(he);!Le.done;Se++,Le=G.next())Le=q(he,L,Se,Le.value,Q),Le!==null&&(e&&Le.alternate!==null&&he.delete(Le.key===null?Se:Le.key),M=h(Le,M,Se),Ie===null?pe=Le:Ie.sibling=Le,Ie=Le);return e&&he.forEach(function(MS){return t(L,MS)}),De&&Wn(L,Se),pe}function Ke(L,M,G,Q){if(typeof G=="object"&&G!==null&&G.type===k&&G.key===null&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case S:e:{for(var pe=G.key;M!==null;){if(M.key===pe){if(pe=G.type,pe===k){if(M.tag===7){s(L,M.sibling),Q=u(M,G.props.children),Q.return=L,L=Q;break e}}else if(M.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===O&&ps(pe)===M.type){s(L,M.sibling),Q=u(M,G.props),po(Q,G),Q.return=L,L=Q;break e}s(L,M);break}else t(L,M);M=M.sibling}G.type===k?(Q=cs(G.props.children,L.mode,Q,G.key),Q.return=L,L=Q):(Q=Hl(G.type,G.key,G.props,null,L.mode,Q),po(Q,G),Q.return=L,L=Q)}return _(L);case C:e:{for(pe=G.key;M!==null;){if(M.key===pe)if(M.tag===4&&M.stateNode.containerInfo===G.containerInfo&&M.stateNode.implementation===G.implementation){s(L,M.sibling),Q=u(M,G.children||[]),Q.return=L,L=Q;break e}else{s(L,M);break}else t(L,M);M=M.sibling}Q=iu(G,L.mode,Q),Q.return=L,L=Q}return _(L);case O:return G=ps(G),Ke(L,M,G,Q)}if(te(G))return ue(L,M,G,Q);if(R(G)){if(pe=R(G),typeof pe!="function")throw Error(l(150));return G=pe.call(G),ge(L,M,G,Q)}if(typeof G.then=="function")return Ke(L,M,Kl(G),Q);if(G.$$typeof===D)return Ke(L,M,$l(L,G),Q);Zl(L,G)}return typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint"?(G=""+G,M!==null&&M.tag===6?(s(L,M.sibling),Q=u(M,G),Q.return=L,L=Q):(s(L,M),Q=su(G,L.mode,Q),Q.return=L,L=Q),_(L)):s(L,M)}return function(L,M,G,Q){try{ho=0;var pe=Ke(L,M,G,Q);return oi=null,pe}catch(he){if(he===ii||he===ql)throw he;var Ie=nn(29,he,null,L.mode);return Ie.lanes=Q,Ie.return=L,Ie}finally{}}}var gs=am(!0),sm=am(!1),Aa=!1;function vu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function yu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function wa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ja(e,t,s){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Ve&2)!==0){var u=o.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),o.pending=t,t=Vl(e),Hp(e,null,s),t}return Ul(e,o,t,s),Vl(e)}function mo(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,Zh(e,s)}}function bu(e,t){var s=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,s===o)){var u=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?u=h=_:h=h.next=_,s=s.next}while(s!==null);h===null?u=h=t:h=h.next=t}else u=h=t;s={baseState:o.baseState,firstBaseUpdate:u,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var xu=!1;function go(){if(xu){var e=si;if(e!==null)throw e}}function vo(e,t,s,o){xu=!1;var u=e.updateQueue;Aa=!1;var h=u.firstBaseUpdate,_=u.lastBaseUpdate,T=u.shared.pending;if(T!==null){u.shared.pending=null;var j=T,P=j.next;j.next=null,_===null?h=P:_.next=P,_=j;var K=e.alternate;K!==null&&(K=K.updateQueue,T=K.lastBaseUpdate,T!==_&&(T===null?K.firstBaseUpdate=P:T.next=P,K.lastBaseUpdate=j))}if(h!==null){var J=u.baseState;_=0,K=P=j=null,T=h;do{var $=T.lane&-536870913,q=$!==T.lane;if(q?(we&$)===$:(o&$)===$){$!==0&&$===ai&&(xu=!0),K!==null&&(K=K.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var ue=e,ge=T;$=t;var Ke=s;switch(ge.tag){case 1:if(ue=ge.payload,typeof ue=="function"){J=ue.call(Ke,J,$);break e}J=ue;break e;case 3:ue.flags=ue.flags&-65537|128;case 0:if(ue=ge.payload,$=typeof ue=="function"?ue.call(Ke,J,$):ue,$==null)break e;J=v({},J,$);break e;case 2:Aa=!0}}$=T.callback,$!==null&&(e.flags|=64,q&&(e.flags|=8192),q=u.callbacks,q===null?u.callbacks=[$]:q.push($))}else q={lane:$,tag:T.tag,payload:T.payload,callback:T.callback,next:null},K===null?(P=K=q,j=J):K=K.next=q,_|=$;if(T=T.next,T===null){if(T=u.shared.pending,T===null)break;q=T,T=q.next,q.next=null,u.lastBaseUpdate=q,u.shared.pending=null}}while(!0);K===null&&(j=J),u.baseState=j,u.firstBaseUpdate=P,u.lastBaseUpdate=K,h===null&&(u.shared.lanes=0),Ba|=_,e.lanes=_,e.memoizedState=J}}function im(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function om(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)im(s[e],t)}var li=oe(null),Xl=oe(0);function lm(e,t){e=ca,se(Xl,e),se(li,t),ca=e|t.baseLanes}function _u(){se(Xl,ca),se(li,li.current)}function Su(){ca=Xl.current,fe(li),fe(Xl)}var an=oe(null),Sn=null;function Da(e){var t=e.alternate;se(pt,pt.current&1),se(an,e),Sn===null&&(t===null||li.current!==null||t.memoizedState!==null)&&(Sn=e)}function Tu(e){se(pt,pt.current),se(an,e),Sn===null&&(Sn=e)}function rm(e){e.tag===22?(se(pt,pt.current),se(an,e),Sn===null&&(Sn=e)):Ma()}function Ma(){se(pt,pt.current),se(an,an.current)}function sn(e){fe(an),Sn===e&&(Sn=null),fe(pt)}var pt=oe(0);function Ql(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||wd(s)||jd(s)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ta=0,_e=null,qe=null,yt=null,Wl=!1,ri=!1,vs=!1,Jl=0,yo=0,ci=null,S1=0;function ut(){throw Error(l(321))}function Cu(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!tn(e[s],t[s]))return!1;return!0}function ku(e,t,s,o,u,h){return ta=h,_e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,V.H=e===null||e.memoizedState===null?Fm:Vu,vs=!1,h=s(o,u),vs=!1,ri&&(h=um(t,s,o,u)),cm(e),h}function cm(e){V.H=_o;var t=qe!==null&&qe.next!==null;if(ta=0,yt=qe=_e=null,Wl=!1,yo=0,ci=null,t)throw Error(l(300));e===null||bt||(e=e.dependencies,e!==null&&Pl(e)&&(bt=!0))}function um(e,t,s,o){_e=e;var u=0;do{if(ri&&(ci=null),yo=0,ri=!1,25<=u)throw Error(l(301));if(u+=1,yt=qe=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}V.H=qm,h=t(s,o)}while(ri);return h}function T1(){var e=V.H,t=e.useState()[0];return t=typeof t.then=="function"?bo(t):t,e=e.useState()[0],(qe!==null?qe.memoizedState:null)!==e&&(_e.flags|=1024),t}function Eu(){var e=Jl!==0;return Jl=0,e}function Nu(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function Au(e){if(Wl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Wl=!1}ta=0,yt=qe=_e=null,ri=!1,yo=Jl=0,ci=null}function Ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return yt===null?_e.memoizedState=yt=e:yt=yt.next=e,yt}function mt(){if(qe===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=qe.next;var t=yt===null?_e.memoizedState:yt.next;if(t!==null)yt=t,qe=e;else{if(e===null)throw _e.alternate===null?Error(l(467)):Error(l(310));qe=e,e={memoizedState:qe.memoizedState,baseState:qe.baseState,baseQueue:qe.baseQueue,queue:qe.queue,next:null},yt===null?_e.memoizedState=yt=e:yt=yt.next=e}return yt}function er(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function bo(e){var t=yo;return yo+=1,ci===null&&(ci=[]),e=em(ci,e,t),t=_e,(yt===null?t.memoizedState:yt.next)===null&&(t=t.alternate,V.H=t===null||t.memoizedState===null?Fm:Vu),e}function tr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return bo(e);if(e.$$typeof===D)return Dt(e)}throw Error(l(438,String(e)))}function wu(e){var t=null,s=_e.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var o=_e.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(t={data:o.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=er(),_e.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),o=0;o<e;o++)s[o]=ee;return t.index++,s}function na(e,t){return typeof t=="function"?t(e):t}function nr(e){var t=mt();return ju(t,qe,e)}function ju(e,t,s){var o=e.queue;if(o===null)throw Error(l(311));o.lastRenderedReducer=s;var u=e.baseQueue,h=o.pending;if(h!==null){if(u!==null){var _=u.next;u.next=h.next,h.next=_}t.baseQueue=u=h,o.pending=null}if(h=e.baseState,u===null)e.memoizedState=h;else{t=u.next;var T=_=null,j=null,P=t,K=!1;do{var J=P.lane&-536870913;if(J!==P.lane?(we&J)===J:(ta&J)===J){var $=P.revertLane;if($===0)j!==null&&(j=j.next={lane:0,revertLane:0,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null}),J===ai&&(K=!0);else if((ta&$)===$){P=P.next,$===ai&&(K=!0);continue}else J={lane:0,revertLane:P.revertLane,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},j===null?(T=j=J,_=h):j=j.next=J,_e.lanes|=$,Ba|=$;J=P.action,vs&&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},j===null?(T=j=$,_=h):j=j.next=$,_e.lanes|=J,Ba|=J;P=P.next}while(P!==null&&P!==t);if(j===null?_=h:j.next=T,!tn(h,e.memoizedState)&&(bt=!0,K&&(s=si,s!==null)))throw s;e.memoizedState=h,e.baseState=_,e.baseQueue=j,o.lastRenderedState=h}return u===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function Du(e){var t=mt(),s=t.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=e;var o=s.dispatch,u=s.pending,h=t.memoizedState;if(u!==null){s.pending=null;var _=u=u.next;do h=e(h,_.action),_=_.next;while(_!==u);tn(h,t.memoizedState)||(bt=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),s.lastRenderedState=h}return[h,o]}function dm(e,t,s){var o=_e,u=mt(),h=De;if(h){if(s===void 0)throw Error(l(407));s=s()}else s=t();var _=!tn((qe||u).memoizedState,s);if(_&&(u.memoizedState=s,bt=!0),u=u.queue,Ou(pm.bind(null,o,u,e),[e]),u.getSnapshot!==t||_||yt!==null&&yt.memoizedState.tag&1){if(o.flags|=2048,ui(9,{destroy:void 0},hm.bind(null,o,u,s,t),null),Xe===null)throw Error(l(349));h||(ta&127)!==0||fm(o,t,s)}return s}function fm(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=_e.updateQueue,t===null?(t=er(),_e.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function hm(e,t,s,o){t.value=s,t.getSnapshot=o,mm(t)&&gm(e)}function pm(e,t,s){return s(function(){mm(t)&&gm(e)})}function mm(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!tn(e,s)}catch{return!0}}function gm(e){var t=rs(e,2);t!==null&&Qt(t,e,2)}function Mu(e){var t=Ht();if(typeof e=="function"){var s=e;if(e=s(),vs){lt(!0);try{s()}finally{lt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:na,lastRenderedState:e},t}function vm(e,t,s,o){return e.baseState=s,ju(e,qe,typeof o=="function"?o:na)}function C1(e,t,s,o,u){if(ir(e))throw Error(l(485));if(e=t.action,e!==null){var h={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){h.listeners.push(_)}};V.T!==null?s(!0):h.isTransition=!1,o(h),s=t.pending,s===null?(h.next=t.pending=h,ym(t,h)):(h.next=s.next,t.pending=s.next=h)}}function ym(e,t){var s=t.action,o=t.payload,u=e.state;if(t.isTransition){var h=V.T,_={};V.T=_;try{var T=s(u,o),j=V.S;j!==null&&j(_,T),bm(e,t,T)}catch(P){Ru(e,t,P)}finally{h!==null&&_.types!==null&&(h.types=_.types),V.T=h}}else try{h=s(u,o),bm(e,t,h)}catch(P){Ru(e,t,P)}}function bm(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(o){xm(e,t,o)},function(o){return Ru(e,t,o)}):xm(e,t,s)}function xm(e,t,s){t.status="fulfilled",t.value=s,_m(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,ym(e,s)))}function Ru(e,t,s){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do t.status="rejected",t.reason=s,_m(t),t=t.next;while(t!==o)}e.action=null}function _m(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Sm(e,t){return t}function Tm(e,t){if(De){var s=Xe.formState;if(s!==null){e:{var o=_e;if(De){if(et){t:{for(var u=et,h=_n;u.nodeType!==8;){if(!h){u=null;break t}if(u=Tn(u.nextSibling),u===null){u=null;break t}}h=u.data,u=h==="F!"||h==="F"?u:null}if(u){et=Tn(u.nextSibling),o=u.data==="F!";break e}}Ea(o)}o=!1}o&&(t=s[0])}}return s=Ht(),s.memoizedState=s.baseState=t,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sm,lastRenderedState:t},s.queue=o,s=Gm.bind(null,_e,o),o.dispatch=s,o=Mu(!1),h=Uu.bind(null,_e,!1,o.queue),o=Ht(),u={state:t,dispatch:null,action:e,pending:null},o.queue=u,s=C1.bind(null,_e,u,h,s),u.dispatch=s,o.memoizedState=e,[t,s,!1]}function Cm(e){var t=mt();return km(t,qe,e)}function km(e,t,s){if(t=ju(e,t,Sm)[0],e=nr(na)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var o=bo(t)}catch(_){throw _===ii?ql:_}else o=t;t=mt();var u=t.queue,h=u.dispatch;return s!==t.memoizedState&&(_e.flags|=2048,ui(9,{destroy:void 0},k1.bind(null,u,s),null)),[o,h,e]}function k1(e,t){e.action=t}function Em(e){var t=mt(),s=qe;if(s!==null)return km(t,s,e);mt(),t=t.memoizedState,s=mt();var o=s.queue.dispatch;return s.memoizedState=e,[t,o,!1]}function ui(e,t,s,o){return e={tag:e,create:s,deps:o,inst:t,next:null},t=_e.updateQueue,t===null&&(t=er(),_e.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(o=s.next,s.next=e,e.next=o,t.lastEffect=e),e}function Nm(){return mt().memoizedState}function ar(e,t,s,o){var u=Ht();_e.flags|=e,u.memoizedState=ui(1|t,{destroy:void 0},s,o===void 0?null:o)}function sr(e,t,s,o){var u=mt();o=o===void 0?null:o;var h=u.memoizedState.inst;qe!==null&&o!==null&&Cu(o,qe.memoizedState.deps)?u.memoizedState=ui(t,h,s,o):(_e.flags|=e,u.memoizedState=ui(1|t,h,s,o))}function Am(e,t){ar(8390656,8,e,t)}function Ou(e,t){sr(2048,8,e,t)}function E1(e){_e.flags|=4;var t=_e.updateQueue;if(t===null)t=er(),_e.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function wm(e){var t=mt().memoizedState;return E1({ref:t,nextImpl:e}),function(){if((Ve&2)!==0)throw Error(l(440));return t.impl.apply(void 0,arguments)}}function jm(e,t){return sr(4,2,e,t)}function Dm(e,t){return sr(4,4,e,t)}function Mm(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Rm(e,t,s){s=s!=null?s.concat([e]):null,sr(4,4,Mm.bind(null,t,e),s)}function Bu(){}function Om(e,t){var s=mt();t=t===void 0?null:t;var o=s.memoizedState;return t!==null&&Cu(t,o[1])?o[0]:(s.memoizedState=[e,t],e)}function Bm(e,t){var s=mt();t=t===void 0?null:t;var o=s.memoizedState;if(t!==null&&Cu(t,o[1]))return o[0];if(o=e(),vs){lt(!0);try{e()}finally{lt(!1)}}return s.memoizedState=[o,t],o}function Iu(e,t,s){return s===void 0||(ta&1073741824)!==0&&(we&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=Ig(),_e.lanes|=e,Ba|=e,s)}function Im(e,t,s,o){return tn(s,t)?s:li.current!==null?(e=Iu(e,s,o),tn(e,t)||(bt=!0),e):(ta&42)===0||(ta&1073741824)!==0&&(we&261930)===0?(bt=!0,e.memoizedState=s):(e=Ig(),_e.lanes|=e,Ba|=e,t)}function Lm(e,t,s,o,u){var h=H.p;H.p=h!==0&&8>h?h:8;var _=V.T,T={};V.T=T,Uu(e,!1,t,s);try{var j=u(),P=V.S;if(P!==null&&P(T,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var K=_1(j,o);xo(e,t,K,rn(e))}else xo(e,t,o,rn(e))}catch(J){xo(e,t,{then:function(){},status:"rejected",reason:J},rn())}finally{H.p=h,_!==null&&T.types!==null&&(_.types=T.types),V.T=_}}function N1(){}function Lu(e,t,s,o){if(e.tag!==5)throw Error(l(476));var u=zm(e).queue;Lm(e,u,t,z,s===null?N1:function(){return Um(e),s(o)})}function zm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:na,lastRenderedState:z},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:na,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Um(e){var t=zm(e);t.next===null&&(t=e.alternate.memoizedState),xo(e,t.next.queue,{},rn())}function zu(){return Dt(Lo)}function Vm(){return mt().memoizedState}function Hm(){return mt().memoizedState}function A1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=rn();e=wa(s);var o=ja(t,e,s);o!==null&&(Qt(o,t,s),mo(o,t,s)),t={cache:hu()},e.payload=t;return}t=t.return}}function w1(e,t,s){var o=rn();s={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},ir(e)?Pm(t,s):(s=nu(e,t,s,o),s!==null&&(Qt(s,e,o),$m(s,t,o)))}function Gm(e,t,s){var o=rn();xo(e,t,s,o)}function xo(e,t,s,o){var u={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(ir(e))Pm(t,u);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var _=t.lastRenderedState,T=h(_,s);if(u.hasEagerState=!0,u.eagerState=T,tn(T,_))return Ul(e,t,u,0),Xe===null&&zl(),!1}catch{}finally{}if(s=nu(e,t,u,o),s!==null)return Qt(s,e,o),$m(s,t,o),!0}return!1}function Uu(e,t,s,o){if(o={lane:2,revertLane:vd(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},ir(e)){if(t)throw Error(l(479))}else t=nu(e,s,o,2),t!==null&&Qt(t,e,2)}function ir(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function Pm(e,t){ri=Wl=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function $m(e,t,s){if((s&4194048)!==0){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,Zh(e,s)}}var _o={readContext:Dt,use:tr,useCallback:ut,useContext:ut,useEffect:ut,useImperativeHandle:ut,useLayoutEffect:ut,useInsertionEffect:ut,useMemo:ut,useReducer:ut,useRef:ut,useState:ut,useDebugValue:ut,useDeferredValue:ut,useTransition:ut,useSyncExternalStore:ut,useId:ut,useHostTransitionStatus:ut,useFormState:ut,useActionState:ut,useOptimistic:ut,useMemoCache:ut,useCacheRefresh:ut};_o.useEffectEvent=ut;var Fm={readContext:Dt,use:tr,useCallback:function(e,t){return Ht().memoizedState=[e,t===void 0?null:t],e},useContext:Dt,useEffect:Am,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,ar(4194308,4,Mm.bind(null,t,e),s)},useLayoutEffect:function(e,t){return ar(4194308,4,e,t)},useInsertionEffect:function(e,t){ar(4,2,e,t)},useMemo:function(e,t){var s=Ht();t=t===void 0?null:t;var o=e();if(vs){lt(!0);try{e()}finally{lt(!1)}}return s.memoizedState=[o,t],o},useReducer:function(e,t,s){var o=Ht();if(s!==void 0){var u=s(t);if(vs){lt(!0);try{s(t)}finally{lt(!1)}}}else u=t;return o.memoizedState=o.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},o.queue=e,e=e.dispatch=w1.bind(null,_e,e),[o.memoizedState,e]},useRef:function(e){var t=Ht();return e={current:e},t.memoizedState=e},useState:function(e){e=Mu(e);var t=e.queue,s=Gm.bind(null,_e,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:Bu,useDeferredValue:function(e,t){var s=Ht();return Iu(s,e,t)},useTransition:function(){var e=Mu(!1);return e=Lm.bind(null,_e,e.queue,!0,!1),Ht().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var o=_e,u=Ht();if(De){if(s===void 0)throw Error(l(407));s=s()}else{if(s=t(),Xe===null)throw Error(l(349));(we&127)!==0||fm(o,t,s)}u.memoizedState=s;var h={value:s,getSnapshot:t};return u.queue=h,Am(pm.bind(null,o,h,e),[e]),o.flags|=2048,ui(9,{destroy:void 0},hm.bind(null,o,h,s,t),null),s},useId:function(){var e=Ht(),t=Xe.identifierPrefix;if(De){var s=In,o=Bn;s=(o&~(1<<32-Fe(o)-1)).toString(32)+s,t="_"+t+"R_"+s,s=Jl++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=S1++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:zu,useFormState:Tm,useActionState:Tm,useOptimistic:function(e){var t=Ht();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Uu.bind(null,_e,!0,s),s.dispatch=t,[e,t]},useMemoCache:wu,useCacheRefresh:function(){return Ht().memoizedState=A1.bind(null,_e)},useEffectEvent:function(e){var t=Ht(),s={impl:e};return t.memoizedState=s,function(){if((Ve&2)!==0)throw Error(l(440));return s.impl.apply(void 0,arguments)}}},Vu={readContext:Dt,use:tr,useCallback:Om,useContext:Dt,useEffect:Ou,useImperativeHandle:Rm,useInsertionEffect:jm,useLayoutEffect:Dm,useMemo:Bm,useReducer:nr,useRef:Nm,useState:function(){return nr(na)},useDebugValue:Bu,useDeferredValue:function(e,t){var s=mt();return Im(s,qe.memoizedState,e,t)},useTransition:function(){var e=nr(na)[0],t=mt().memoizedState;return[typeof e=="boolean"?e:bo(e),t]},useSyncExternalStore:dm,useId:Vm,useHostTransitionStatus:zu,useFormState:Cm,useActionState:Cm,useOptimistic:function(e,t){var s=mt();return vm(s,qe,e,t)},useMemoCache:wu,useCacheRefresh:Hm};Vu.useEffectEvent=wm;var qm={readContext:Dt,use:tr,useCallback:Om,useContext:Dt,useEffect:Ou,useImperativeHandle:Rm,useInsertionEffect:jm,useLayoutEffect:Dm,useMemo:Bm,useReducer:Du,useRef:Nm,useState:function(){return Du(na)},useDebugValue:Bu,useDeferredValue:function(e,t){var s=mt();return qe===null?Iu(s,e,t):Im(s,qe.memoizedState,e,t)},useTransition:function(){var e=Du(na)[0],t=mt().memoizedState;return[typeof e=="boolean"?e:bo(e),t]},useSyncExternalStore:dm,useId:Vm,useHostTransitionStatus:zu,useFormState:Em,useActionState:Em,useOptimistic:function(e,t){var s=mt();return qe!==null?vm(s,qe,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:wu,useCacheRefresh:Hm};qm.useEffectEvent=wm;function Hu(e,t,s,o){t=e.memoizedState,s=s(o,t),s=s==null?t:v({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Gu={enqueueSetState:function(e,t,s){e=e._reactInternals;var o=rn(),u=wa(o);u.payload=t,s!=null&&(u.callback=s),t=ja(e,u,o),t!==null&&(Qt(t,e,o),mo(t,e,o))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var o=rn(),u=wa(o);u.tag=1,u.payload=t,s!=null&&(u.callback=s),t=ja(e,u,o),t!==null&&(Qt(t,e,o),mo(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=rn(),o=wa(s);o.tag=2,t!=null&&(o.callback=t),t=ja(e,o,s),t!==null&&(Qt(t,e,s),mo(t,e,s))}};function Ym(e,t,s,o,u,h,_){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,h,_):t.prototype&&t.prototype.isPureReactComponent?!oo(s,o)||!oo(u,h):!0}function Km(e,t,s,o){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,o),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,o),t.state!==e&&Gu.enqueueReplaceState(t,t.state,null)}function ys(e,t){var s=t;if("ref"in t){s={};for(var o in t)o!=="ref"&&(s[o]=t[o])}if(e=e.defaultProps){s===t&&(s=v({},s));for(var u in e)s[u]===void 0&&(s[u]=e[u])}return s}function Zm(e){Ll(e)}function Xm(e){console.error(e)}function Qm(e){Ll(e)}function or(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(o){setTimeout(function(){throw o})}}function Wm(e,t,s){try{var o=e.onCaughtError;o(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Pu(e,t,s){return s=wa(s),s.tag=3,s.payload={element:null},s.callback=function(){or(e,t)},s}function Jm(e){return e=wa(e),e.tag=3,e}function eg(e,t,s,o){var u=s.type.getDerivedStateFromError;if(typeof u=="function"){var h=o.value;e.payload=function(){return u(h)},e.callback=function(){Wm(t,s,o)}}var _=s.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(e.callback=function(){Wm(t,s,o),typeof u!="function"&&(Ia===null?Ia=new Set([this]):Ia.add(this));var T=o.stack;this.componentDidCatch(o.value,{componentStack:T!==null?T:""})})}function j1(e,t,s,o,u){if(s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(t=s.alternate,t!==null&&ni(t,s,u,!0),s=an.current,s!==null){switch(s.tag){case 31:case 13:return Sn===null?yr():s.alternate===null&&dt===0&&(dt=3),s.flags&=-257,s.flags|=65536,s.lanes=u,o===Yl?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([o]):t.add(o),pd(e,o,u)),!1;case 22:return s.flags|=65536,o===Yl?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([o])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([o]):s.add(o)),pd(e,o,u)),!1}throw Error(l(435,s.tag))}return pd(e,o,u),yr(),!1}if(De)return t=an.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,o!==ru&&(e=Error(l(422),{cause:o}),co(yn(e,s)))):(o!==ru&&(t=Error(l(423),{cause:o}),co(yn(t,s))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,o=yn(o,s),u=Pu(e.stateNode,o,u),bu(e,u),dt!==4&&(dt=2)),!1;var h=Error(l(520),{cause:o});if(h=yn(h,s),wo===null?wo=[h]:wo.push(h),dt!==4&&(dt=2),t===null)return!0;o=yn(o,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=u&-u,s.lanes|=e,e=Pu(s.stateNode,o,e),bu(s,e),!1;case 1:if(t=s.type,h=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Ia===null||!Ia.has(h))))return s.flags|=65536,u&=-u,s.lanes|=u,u=Jm(u),eg(u,e,s,o),bu(s,u),!1}s=s.return}while(s!==null);return!1}var $u=Error(l(461)),bt=!1;function Mt(e,t,s,o){t.child=e===null?sm(t,null,s,o):gs(t,e.child,s,o)}function tg(e,t,s,o,u){s=s.render;var h=t.ref;if("ref"in o){var _={};for(var T in o)T!=="ref"&&(_[T]=o[T])}else _=o;return fs(t),o=ku(e,t,s,_,h,u),T=Eu(),e!==null&&!bt?(Nu(e,t,u),aa(e,t,u)):(De&&T&&ou(t),t.flags|=1,Mt(e,t,o,u),t.child)}function ng(e,t,s,o,u){if(e===null){var h=s.type;return typeof h=="function"&&!au(h)&&h.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=h,ag(e,t,h,o,u)):(e=Hl(s.type,null,o,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!Wu(e,u)){var _=h.memoizedProps;if(s=s.compare,s=s!==null?s:oo,s(_,o)&&e.ref===t.ref)return aa(e,t,u)}return t.flags|=1,e=Qn(h,o),e.ref=t.ref,e.return=t,t.child=e}function ag(e,t,s,o,u){if(e!==null){var h=e.memoizedProps;if(oo(h,o)&&e.ref===t.ref)if(bt=!1,t.pendingProps=o=h,Wu(e,u))(e.flags&131072)!==0&&(bt=!0);else return t.lanes=e.lanes,aa(e,t,u)}return Fu(e,t,s,o,u)}function sg(e,t,s,o){var u=o.children,h=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((t.flags&128)!==0){if(h=h!==null?h.baseLanes|s:s,e!==null){for(o=t.child=e.child,u=0;o!==null;)u=u|o.lanes|o.childLanes,o=o.sibling;o=u&~h}else o=0,t.child=null;return ig(e,t,h,s,o)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Fl(t,h!==null?h.cachePool:null),h!==null?lm(t,h):_u(),rm(t);else return o=t.lanes=536870912,ig(e,t,h!==null?h.baseLanes|s:s,s,o)}else h!==null?(Fl(t,h.cachePool),lm(t,h),Ma(),t.memoizedState=null):(e!==null&&Fl(t,null),_u(),Ma());return Mt(e,t,u,s),t.child}function So(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ig(e,t,s,o,u){var h=mu();return h=h===null?null:{parent:vt._currentValue,pool:h},t.memoizedState={baseLanes:s,cachePool:h},e!==null&&Fl(t,null),_u(),rm(t),e!==null&&ni(e,t,o,!0),t.childLanes=u,null}function lr(e,t){return t=cr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function og(e,t,s){return gs(t,e.child,null,s),e=lr(t,t.pendingProps),e.flags|=2,sn(t),t.memoizedState=null,e}function D1(e,t,s){var o=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(De){if(o.mode==="hidden")return e=lr(t,o),t.lanes=536870912,So(null,e);if(Tu(t),(e=et)?(e=yv(e,_n),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ca!==null?{id:Bn,overflow:In}:null,retryLane:536870912,hydrationErrors:null},s=Pp(e),s.return=t,t.child=s,jt=t,et=null)):e=null,e===null)throw Ea(t);return t.lanes=536870912,null}return lr(t,o)}var h=e.memoizedState;if(h!==null){var _=h.dehydrated;if(Tu(t),u)if(t.flags&256)t.flags&=-257,t=og(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(l(558));else if(bt||ni(e,t,s,!1),u=(s&e.childLanes)!==0,bt||u){if(o=Xe,o!==null&&(_=Xh(o,s),_!==0&&_!==h.retryLane))throw h.retryLane=_,rs(e,_),Qt(o,e,_),$u;yr(),t=og(e,t,s)}else e=h.treeContext,et=Tn(_.nextSibling),jt=t,De=!0,ka=null,_n=!1,e!==null&&qp(t,e),t=lr(t,o),t.flags|=4096;return t}return e=Qn(e.child,{mode:o.mode,children:o.children}),e.ref=t.ref,t.child=e,e.return=t,e}function rr(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(l(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function Fu(e,t,s,o,u){return fs(t),s=ku(e,t,s,o,void 0,u),o=Eu(),e!==null&&!bt?(Nu(e,t,u),aa(e,t,u)):(De&&o&&ou(t),t.flags|=1,Mt(e,t,s,u),t.child)}function lg(e,t,s,o,u,h){return fs(t),t.updateQueue=null,s=um(t,o,s,u),cm(e),o=Eu(),e!==null&&!bt?(Nu(e,t,h),aa(e,t,h)):(De&&o&&ou(t),t.flags|=1,Mt(e,t,s,h),t.child)}function rg(e,t,s,o,u){if(fs(t),t.stateNode===null){var h=Ws,_=s.contextType;typeof _=="object"&&_!==null&&(h=Dt(_)),h=new s(o,h),t.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Gu,t.stateNode=h,h._reactInternals=t,h=t.stateNode,h.props=o,h.state=t.memoizedState,h.refs={},vu(t),_=s.contextType,h.context=typeof _=="object"&&_!==null?Dt(_):Ws,h.state=t.memoizedState,_=s.getDerivedStateFromProps,typeof _=="function"&&(Hu(t,s,_,o),h.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(_=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),_!==h.state&&Gu.enqueueReplaceState(h,h.state,null),vo(t,o,h,u),go(),h.state=t.memoizedState),typeof h.componentDidMount=="function"&&(t.flags|=4194308),o=!0}else if(e===null){h=t.stateNode;var T=t.memoizedProps,j=ys(s,T);h.props=j;var P=h.context,K=s.contextType;_=Ws,typeof K=="object"&&K!==null&&(_=Dt(K));var J=s.getDerivedStateFromProps;K=typeof J=="function"||typeof h.getSnapshotBeforeUpdate=="function",T=t.pendingProps!==T,K||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(T||P!==_)&&Km(t,h,o,_),Aa=!1;var $=t.memoizedState;h.state=$,vo(t,o,h,u),go(),P=t.memoizedState,T||$!==P||Aa?(typeof J=="function"&&(Hu(t,s,J,o),P=t.memoizedState),(j=Aa||Ym(t,s,j,o,$,P,_))?(K||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=o,t.memoizedState=P),h.props=o,h.state=P,h.context=_,o=j):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{h=t.stateNode,yu(e,t),_=t.memoizedProps,K=ys(s,_),h.props=K,J=t.pendingProps,$=h.context,P=s.contextType,j=Ws,typeof P=="object"&&P!==null&&(j=Dt(P)),T=s.getDerivedStateFromProps,(P=typeof T=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(_!==J||$!==j)&&Km(t,h,o,j),Aa=!1,$=t.memoizedState,h.state=$,vo(t,o,h,u),go();var q=t.memoizedState;_!==J||$!==q||Aa||e!==null&&e.dependencies!==null&&Pl(e.dependencies)?(typeof T=="function"&&(Hu(t,s,T,o),q=t.memoizedState),(K=Aa||Ym(t,s,K,o,$,q,j)||e!==null&&e.dependencies!==null&&Pl(e.dependencies))?(P||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(o,q,j),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(o,q,j)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||_===e.memoizedProps&&$===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&$===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=q),h.props=o,h.state=q,h.context=j,o=K):(typeof h.componentDidUpdate!="function"||_===e.memoizedProps&&$===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&$===e.memoizedState||(t.flags|=1024),o=!1)}return h=o,rr(e,t),o=(t.flags&128)!==0,h||o?(h=t.stateNode,s=o&&typeof s.getDerivedStateFromError!="function"?null:h.render(),t.flags|=1,e!==null&&o?(t.child=gs(t,e.child,null,u),t.child=gs(t,null,s,u)):Mt(e,t,s,u),t.memoizedState=h.state,e=t.child):e=aa(e,t,u),e}function cg(e,t,s,o){return us(),t.flags|=256,Mt(e,t,s,o),t.child}var qu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Yu(e){return{baseLanes:e,cachePool:Wp()}}function Ku(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=ln),e}function ug(e,t,s){var o=t.pendingProps,u=!1,h=(t.flags&128)!==0,_;if((_=h)||(_=e!==null&&e.memoizedState===null?!1:(pt.current&2)!==0),_&&(u=!0,t.flags&=-129),_=(t.flags&32)!==0,t.flags&=-33,e===null){if(De){if(u?Da(t):Ma(),(e=et)?(e=yv(e,_n),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ca!==null?{id:Bn,overflow:In}:null,retryLane:536870912,hydrationErrors:null},s=Pp(e),s.return=t,t.child=s,jt=t,et=null)):e=null,e===null)throw Ea(t);return jd(e)?t.lanes=32:t.lanes=536870912,null}var T=o.children;return o=o.fallback,u?(Ma(),u=t.mode,T=cr({mode:"hidden",children:T},u),o=cs(o,u,s,null),T.return=t,o.return=t,T.sibling=o,t.child=T,o=t.child,o.memoizedState=Yu(s),o.childLanes=Ku(e,_,s),t.memoizedState=qu,So(null,o)):(Da(t),Zu(t,T))}var j=e.memoizedState;if(j!==null&&(T=j.dehydrated,T!==null)){if(h)t.flags&256?(Da(t),t.flags&=-257,t=Xu(e,t,s)):t.memoizedState!==null?(Ma(),t.child=e.child,t.flags|=128,t=null):(Ma(),T=o.fallback,u=t.mode,o=cr({mode:"visible",children:o.children},u),T=cs(T,u,s,null),T.flags|=2,o.return=t,T.return=t,o.sibling=T,t.child=o,gs(t,e.child,null,s),o=t.child,o.memoizedState=Yu(s),o.childLanes=Ku(e,_,s),t.memoizedState=qu,t=So(null,o));else if(Da(t),jd(T)){if(_=T.nextSibling&&T.nextSibling.dataset,_)var P=_.dgst;_=P,o=Error(l(419)),o.stack="",o.digest=_,co({value:o,source:null,stack:null}),t=Xu(e,t,s)}else if(bt||ni(e,t,s,!1),_=(s&e.childLanes)!==0,bt||_){if(_=Xe,_!==null&&(o=Xh(_,s),o!==0&&o!==j.retryLane))throw j.retryLane=o,rs(e,o),Qt(_,e,o),$u;wd(T)||yr(),t=Xu(e,t,s)}else wd(T)?(t.flags|=192,t.child=e.child,t=null):(e=j.treeContext,et=Tn(T.nextSibling),jt=t,De=!0,ka=null,_n=!1,e!==null&&qp(t,e),t=Zu(t,o.children),t.flags|=4096);return t}return u?(Ma(),T=o.fallback,u=t.mode,j=e.child,P=j.sibling,o=Qn(j,{mode:"hidden",children:o.children}),o.subtreeFlags=j.subtreeFlags&65011712,P!==null?T=Qn(P,T):(T=cs(T,u,s,null),T.flags|=2),T.return=t,o.return=t,o.sibling=T,t.child=o,So(null,o),o=t.child,T=e.child.memoizedState,T===null?T=Yu(s):(u=T.cachePool,u!==null?(j=vt._currentValue,u=u.parent!==j?{parent:j,pool:j}:u):u=Wp(),T={baseLanes:T.baseLanes|s,cachePool:u}),o.memoizedState=T,o.childLanes=Ku(e,_,s),t.memoizedState=qu,So(e.child,o)):(Da(t),s=e.child,e=s.sibling,s=Qn(s,{mode:"visible",children:o.children}),s.return=t,s.sibling=null,e!==null&&(_=t.deletions,_===null?(t.deletions=[e],t.flags|=16):_.push(e)),t.child=s,t.memoizedState=null,s)}function Zu(e,t){return t=cr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function cr(e,t){return e=nn(22,e,null,t),e.lanes=0,e}function Xu(e,t,s){return gs(t,e.child,null,s),e=Zu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function dg(e,t,s){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),du(e.return,t,s)}function Qu(e,t,s,o,u,h){var _=e.memoizedState;_===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:o,tail:s,tailMode:u,treeForkCount:h}:(_.isBackwards=t,_.rendering=null,_.renderingStartTime=0,_.last=o,_.tail=s,_.tailMode=u,_.treeForkCount=h)}function fg(e,t,s){var o=t.pendingProps,u=o.revealOrder,h=o.tail;o=o.children;var _=pt.current,T=(_&2)!==0;if(T?(_=_&1|2,t.flags|=128):_&=1,se(pt,_),Mt(e,t,o,s),o=De?ro:0,!T&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&dg(e,s,t);else if(e.tag===19)dg(e,s,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(u){case"forwards":for(s=t.child,u=null;s!==null;)e=s.alternate,e!==null&&Ql(e)===null&&(u=s),s=s.sibling;s=u,s===null?(u=t.child,t.child=null):(u=s.sibling,s.sibling=null),Qu(t,!1,u,s,h,o);break;case"backwards":case"unstable_legacy-backwards":for(s=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&Ql(e)===null){t.child=u;break}e=u.sibling,u.sibling=s,s=u,u=e}Qu(t,!0,s,null,h,o);break;case"together":Qu(t,!1,null,null,void 0,o);break;default:t.memoizedState=null}return t.child}function aa(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),Ba|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(ni(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(l(153));if(t.child!==null){for(e=t.child,s=Qn(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=Qn(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function Wu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Pl(e)))}function M1(e,t,s){switch(t.tag){case 3:Yn(t,t.stateNode.containerInfo),Na(t,vt,e.memoizedState.cache),us();break;case 27:case 5:Te(t);break;case 4:Yn(t,t.stateNode.containerInfo);break;case 10:Na(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Tu(t),null;break;case 13:var o=t.memoizedState;if(o!==null)return o.dehydrated!==null?(Da(t),t.flags|=128,null):(s&t.child.childLanes)!==0?ug(e,t,s):(Da(t),e=aa(e,t,s),e!==null?e.sibling:null);Da(t);break;case 19:var u=(e.flags&128)!==0;if(o=(s&t.childLanes)!==0,o||(ni(e,t,s,!1),o=(s&t.childLanes)!==0),u){if(o)return fg(e,t,s);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),se(pt,pt.current),o)break;return null;case 22:return t.lanes=0,sg(e,t,s,t.pendingProps);case 24:Na(t,vt,e.memoizedState.cache)}return aa(e,t,s)}function hg(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)bt=!0;else{if(!Wu(e,s)&&(t.flags&128)===0)return bt=!1,M1(e,t,s);bt=(e.flags&131072)!==0}else bt=!1,De&&(t.flags&1048576)!==0&&Fp(t,ro,t.index);switch(t.lanes=0,t.tag){case 16:e:{var o=t.pendingProps;if(e=ps(t.elementType),t.type=e,typeof e=="function")au(e)?(o=ys(e,o),t.tag=1,t=rg(null,t,e,o,s)):(t.tag=0,t=Fu(null,t,e,o,s));else{if(e!=null){var u=e.$$typeof;if(u===A){t.tag=11,t=tg(null,t,e,o,s);break e}else if(u===F){t.tag=14,t=ng(null,t,e,o,s);break e}}throw t=X(e)||e,Error(l(306,t,""))}}return t;case 0:return Fu(e,t,t.type,t.pendingProps,s);case 1:return o=t.type,u=ys(o,t.pendingProps),rg(e,t,o,u,s);case 3:e:{if(Yn(t,t.stateNode.containerInfo),e===null)throw Error(l(387));o=t.pendingProps;var h=t.memoizedState;u=h.element,yu(e,t),vo(t,o,null,s);var _=t.memoizedState;if(o=_.cache,Na(t,vt,o),o!==h.cache&&fu(t,[vt],s,!0),go(),o=_.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:_.cache},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){t=cg(e,t,o,s);break e}else if(o!==u){u=yn(Error(l(424)),t),co(u),t=cg(e,t,o,s);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(et=Tn(e.firstChild),jt=t,De=!0,ka=null,_n=!0,s=sm(t,null,o,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(us(),o===u){t=aa(e,t,s);break e}Mt(e,t,o,s)}t=t.child}return t;case 26:return rr(e,t),e===null?(s=Cv(t.type,null,t.pendingProps,null))?t.memoizedState=s:De||(s=t.type,e=t.pendingProps,o=kr($t.current).createElement(s),o[wt]=t,o[Ft]=e,Rt(o,s,e),kt(o),t.stateNode=o):t.memoizedState=Cv(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Te(t),e===null&&De&&(o=t.stateNode=_v(t.type,t.pendingProps,$t.current),jt=t,_n=!0,u=et,Va(t.type)?(Dd=u,et=Tn(o.firstChild)):et=u),Mt(e,t,t.pendingProps.children,s),rr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&De&&((u=o=et)&&(o=rS(o,t.type,t.pendingProps,_n),o!==null?(t.stateNode=o,jt=t,et=Tn(o.firstChild),_n=!1,u=!0):u=!1),u||Ea(t)),Te(t),u=t.type,h=t.pendingProps,_=e!==null?e.memoizedProps:null,o=h.children,Ed(u,h)?o=null:_!==null&&Ed(u,_)&&(t.flags|=32),t.memoizedState!==null&&(u=ku(e,t,T1,null,null,s),Lo._currentValue=u),rr(e,t),Mt(e,t,o,s),t.child;case 6:return e===null&&De&&((e=s=et)&&(s=cS(s,t.pendingProps,_n),s!==null?(t.stateNode=s,jt=t,et=null,e=!0):e=!1),e||Ea(t)),null;case 13:return ug(e,t,s);case 4:return Yn(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=gs(t,null,o,s):Mt(e,t,o,s),t.child;case 11:return tg(e,t,t.type,t.pendingProps,s);case 7:return Mt(e,t,t.pendingProps,s),t.child;case 8:return Mt(e,t,t.pendingProps.children,s),t.child;case 12:return Mt(e,t,t.pendingProps.children,s),t.child;case 10:return o=t.pendingProps,Na(t,t.type,o.value),Mt(e,t,o.children,s),t.child;case 9:return u=t.type._context,o=t.pendingProps.children,fs(t),u=Dt(u),o=o(u),t.flags|=1,Mt(e,t,o,s),t.child;case 14:return ng(e,t,t.type,t.pendingProps,s);case 15:return ag(e,t,t.type,t.pendingProps,s);case 19:return fg(e,t,s);case 31:return D1(e,t,s);case 22:return sg(e,t,s,t.pendingProps);case 24:return fs(t),o=Dt(vt),e===null?(u=mu(),u===null&&(u=Xe,h=hu(),u.pooledCache=h,h.refCount++,h!==null&&(u.pooledCacheLanes|=s),u=h),t.memoizedState={parent:o,cache:u},vu(t),Na(t,vt,u)):((e.lanes&s)!==0&&(yu(e,t),vo(t,null,null,s),go()),u=e.memoizedState,h=t.memoizedState,u.parent!==o?(u={parent:o,cache:o},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),Na(t,vt,o)):(o=h.cache,Na(t,vt,o),o!==u.cache&&fu(t,[vt],s,!0))),Mt(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function sa(e){e.flags|=4}function Ju(e,t,s,o,u){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(Vg())e.flags|=8192;else throw ms=Yl,gu}else e.flags&=-16777217}function pg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!wv(t))if(Vg())e.flags|=8192;else throw ms=Yl,gu}function ur(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Yh():536870912,e.lanes|=t,pi|=t)}function To(e,t){if(!De)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function tt(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,o=0;if(t)for(var u=e.child;u!==null;)s|=u.lanes|u.childLanes,o|=u.subtreeFlags&65011712,o|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)s|=u.lanes|u.childLanes,o|=u.subtreeFlags,o|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=o,e.childLanes=s,t}function R1(e,t,s){var o=t.pendingProps;switch(lu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(t),null;case 1:return tt(t),null;case 3:return s=t.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),ea(vt),Jt(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ti(t)?sa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,cu())),tt(t),null;case 26:var u=t.type,h=t.memoizedState;return e===null?(sa(t),h!==null?(tt(t),pg(t,h)):(tt(t),Ju(t,u,null,o,s))):h?h!==e.memoizedState?(sa(t),tt(t),pg(t,h)):(tt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==o&&sa(t),tt(t),Ju(t,u,e,o,s)),null;case 27:if(ct(t),s=$t.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&sa(t);else{if(!o){if(t.stateNode===null)throw Error(l(166));return tt(t),null}e=Oe.current,ti(t)?Yp(t):(e=_v(u,o,s),t.stateNode=e,sa(t))}return tt(t),null;case 5:if(ct(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&sa(t);else{if(!o){if(t.stateNode===null)throw Error(l(166));return tt(t),null}if(h=Oe.current,ti(t))Yp(t);else{var _=kr($t.current);switch(h){case 1:h=_.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:h=_.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":h=_.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":h=_.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":h=_.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?_.createElement("select",{is:o.is}):_.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?_.createElement(u,{is:o.is}):_.createElement(u)}}h[wt]=t,h[Ft]=o;e:for(_=t.child;_!==null;){if(_.tag===5||_.tag===6)h.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===t)break e;for(;_.sibling===null;){if(_.return===null||_.return===t)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}t.stateNode=h;e:switch(Rt(h,u,o),u){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&sa(t)}}return tt(t),Ju(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==o&&sa(t);else{if(typeof o!="string"&&t.stateNode===null)throw Error(l(166));if(e=$t.current,ti(t)){if(e=t.stateNode,s=t.memoizedProps,o=null,u=jt,u!==null)switch(u.tag){case 27:case 5:o=u.memoizedProps}e[wt]=t,e=!!(e.nodeValue===s||o!==null&&o.suppressHydrationWarning===!0||uv(e.nodeValue,s)),e||Ea(t,!0)}else e=kr(e).createTextNode(o),e[wt]=t,t.stateNode=e}return tt(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(o=ti(t),s!==null){if(e===null){if(!o)throw Error(l(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[wt]=t}else us(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tt(t),e=!1}else s=cu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(sn(t),t):(sn(t),null);if((t.flags&128)!==0)throw Error(l(558))}return tt(t),null;case 13:if(o=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=ti(t),o!==null&&o.dehydrated!==null){if(e===null){if(!u)throw Error(l(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(l(317));u[wt]=t}else us(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tt(t),u=!1}else u=cu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(sn(t),t):(sn(t),null)}return sn(t),(t.flags&128)!==0?(t.lanes=s,t):(s=o!==null,e=e!==null&&e.memoizedState!==null,s&&(o=t.child,u=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(u=o.alternate.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==u&&(o.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),ur(t,t.updateQueue),tt(t),null);case 4:return Jt(),e===null&&_d(t.stateNode.containerInfo),tt(t),null;case 10:return ea(t.type),tt(t),null;case 19:if(fe(pt),o=t.memoizedState,o===null)return tt(t),null;if(u=(t.flags&128)!==0,h=o.rendering,h===null)if(u)To(o,!1);else{if(dt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=Ql(e),h!==null){for(t.flags|=128,To(o,!1),e=h.updateQueue,t.updateQueue=e,ur(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)Gp(s,e),s=s.sibling;return se(pt,pt.current&1|2),De&&Wn(t,o.treeForkCount),t.child}e=e.sibling}o.tail!==null&&Bt()>mr&&(t.flags|=128,u=!0,To(o,!1),t.lanes=4194304)}else{if(!u)if(e=Ql(h),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,ur(t,e),To(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!De)return tt(t),null}else 2*Bt()-o.renderingStartTime>mr&&s!==536870912&&(t.flags|=128,u=!0,To(o,!1),t.lanes=4194304);o.isBackwards?(h.sibling=t.child,t.child=h):(e=o.last,e!==null?e.sibling=h:t.child=h,o.last=h)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Bt(),e.sibling=null,s=pt.current,se(pt,u?s&1|2:s&1),De&&Wn(t,o.treeForkCount),e):(tt(t),null);case 22:case 23:return sn(t),Su(),o=t.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(t.flags|=8192):o&&(t.flags|=8192),o?(s&536870912)!==0&&(t.flags&128)===0&&(tt(t),t.subtreeFlags&6&&(t.flags|=8192)):tt(t),s=t.updateQueue,s!==null&&ur(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),o=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),o!==s&&(t.flags|=2048),e!==null&&fe(hs),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),ea(vt),tt(t),null;case 25:return null;case 30:return null}throw Error(l(156,t.tag))}function O1(e,t){switch(lu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ea(vt),Jt(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ct(t),null;case 31:if(t.memoizedState!==null){if(sn(t),t.alternate===null)throw Error(l(340));us()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(sn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));us()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return fe(pt),null;case 4:return Jt(),null;case 10:return ea(t.type),null;case 22:case 23:return sn(t),Su(),e!==null&&fe(hs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ea(vt),null;case 25:return null;default:return null}}function mg(e,t){switch(lu(t),t.tag){case 3:ea(vt),Jt();break;case 26:case 27:case 5:ct(t);break;case 4:Jt();break;case 31:t.memoizedState!==null&&sn(t);break;case 13:sn(t);break;case 19:fe(pt);break;case 10:ea(t.type);break;case 22:case 23:sn(t),Su(),e!==null&&fe(hs);break;case 24:ea(vt)}}function Co(e,t){try{var s=t.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var u=o.next;s=u;do{if((s.tag&e)===e){o=void 0;var h=s.create,_=s.inst;o=h(),_.destroy=o}s=s.next}while(s!==u)}}catch(T){$e(t,t.return,T)}}function Ra(e,t,s){try{var o=t.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var h=u.next;o=h;do{if((o.tag&e)===e){var _=o.inst,T=_.destroy;if(T!==void 0){_.destroy=void 0,u=t;var j=s,P=T;try{P()}catch(K){$e(u,j,K)}}}o=o.next}while(o!==h)}}catch(K){$e(t,t.return,K)}}function gg(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{om(t,s)}catch(o){$e(e,e.return,o)}}}function vg(e,t,s){s.props=ys(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(o){$e(e,t,o)}}function ko(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof s=="function"?e.refCleanup=s(o):s.current=o}}catch(u){$e(e,t,u)}}function Ln(e,t){var s=e.ref,o=e.refCleanup;if(s!==null)if(typeof o=="function")try{o()}catch(u){$e(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(u){$e(e,t,u)}else s.current=null}function yg(e){var t=e.type,s=e.memoizedProps,o=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&o.focus();break e;case"img":s.src?o.src=s.src:s.srcSet&&(o.srcset=s.srcSet)}}catch(u){$e(e,e.return,u)}}function ed(e,t,s){try{var o=e.stateNode;nS(o,e.type,s,t),o[Ft]=t}catch(u){$e(e,e.return,u)}}function bg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Va(e.type)||e.tag===4}function td(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||bg(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&&Va(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function nd(e,t,s){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(e),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=Zn));else if(o!==4&&(o===27&&Va(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(nd(e,t,s),e=e.sibling;e!==null;)nd(e,t,s),e=e.sibling}function dr(e,t,s){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(o!==4&&(o===27&&Va(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(dr(e,t,s),e=e.sibling;e!==null;)dr(e,t,s),e=e.sibling}function xg(e){var t=e.stateNode,s=e.memoizedProps;try{for(var o=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);Rt(t,o,s),t[wt]=e,t[Ft]=s}catch(h){$e(e,e.return,h)}}var ia=!1,xt=!1,ad=!1,_g=typeof WeakSet=="function"?WeakSet:Set,Et=null;function B1(e,t){if(e=e.containerInfo,Cd=Mr,e=Rp(e),Xc(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var o=s.getSelection&&s.getSelection();if(o&&o.rangeCount!==0){s=o.anchorNode;var u=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{s.nodeType,h.nodeType}catch{s=null;break e}var _=0,T=-1,j=-1,P=0,K=0,J=e,$=null;t:for(;;){for(var q;J!==s||u!==0&&J.nodeType!==3||(T=_+u),J!==h||o!==0&&J.nodeType!==3||(j=_+o),J.nodeType===3&&(_+=J.nodeValue.length),(q=J.firstChild)!==null;)$=J,J=q;for(;;){if(J===e)break t;if($===s&&++P===u&&(T=_),$===h&&++K===o&&(j=_),(q=J.nextSibling)!==null)break;J=$,$=J.parentNode}J=q}s=T===-1||j===-1?null:{start:T,end:j}}else s=null}s=s||{start:0,end:0}}else s=null;for(kd={focusedElem:e,selectionRange:s},Mr=!1,Et=t;Et!==null;)if(t=Et,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Et=e;else for(;Et!==null;){switch(t=Et,h=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)u=e[s],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,s=t,u=h.memoizedProps,h=h.memoizedState,o=s.stateNode;try{var ue=ys(s.type,u);e=o.getSnapshotBeforeUpdate(ue,h),o.__reactInternalSnapshotBeforeUpdate=e}catch(ge){$e(s,s.return,ge)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)Ad(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Ad(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(l(163))}if(e=t.sibling,e!==null){e.return=t.return,Et=e;break}Et=t.return}}function Sg(e,t,s){var o=s.flags;switch(s.tag){case 0:case 11:case 15:la(e,s),o&4&&Co(5,s);break;case 1:if(la(e,s),o&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(_){$e(s,s.return,_)}else{var u=ys(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(_){$e(s,s.return,_)}}o&64&&gg(s),o&512&&ko(s,s.return);break;case 3:if(la(e,s),o&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{om(e,t)}catch(_){$e(s,s.return,_)}}break;case 27:t===null&&o&4&&xg(s);case 26:case 5:la(e,s),t===null&&o&4&&yg(s),o&512&&ko(s,s.return);break;case 12:la(e,s);break;case 31:la(e,s),o&4&&kg(e,s);break;case 13:la(e,s),o&4&&Eg(e,s),o&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=$1.bind(null,s),uS(e,s))));break;case 22:if(o=s.memoizedState!==null||ia,!o){t=t!==null&&t.memoizedState!==null||xt,u=ia;var h=xt;ia=o,(xt=t)&&!h?ra(e,s,(s.subtreeFlags&8772)!==0):la(e,s),ia=u,xt=h}break;case 30:break;default:la(e,s)}}function Tg(e){var t=e.alternate;t!==null&&(e.alternate=null,Tg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Rc(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var st=null,Yt=!1;function oa(e,t,s){for(s=s.child;s!==null;)Cg(e,t,s),s=s.sibling}function Cg(e,t,s){if(ke&&typeof ke.onCommitFiberUnmount=="function")try{ke.onCommitFiberUnmount(ht,s)}catch{}switch(s.tag){case 26:xt||Ln(s,t),oa(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:xt||Ln(s,t);var o=st,u=Yt;Va(s.type)&&(st=s.stateNode,Yt=!1),oa(e,t,s),Oo(s.stateNode),st=o,Yt=u;break;case 5:xt||Ln(s,t);case 6:if(o=st,u=Yt,st=null,oa(e,t,s),st=o,Yt=u,st!==null)if(Yt)try{(st.nodeType===9?st.body:st.nodeName==="HTML"?st.ownerDocument.body:st).removeChild(s.stateNode)}catch(h){$e(s,t,h)}else try{st.removeChild(s.stateNode)}catch(h){$e(s,t,h)}break;case 18:st!==null&&(Yt?(e=st,gv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Si(e)):gv(st,s.stateNode));break;case 4:o=st,u=Yt,st=s.stateNode.containerInfo,Yt=!0,oa(e,t,s),st=o,Yt=u;break;case 0:case 11:case 14:case 15:Ra(2,s,t),xt||Ra(4,s,t),oa(e,t,s);break;case 1:xt||(Ln(s,t),o=s.stateNode,typeof o.componentWillUnmount=="function"&&vg(s,t,o)),oa(e,t,s);break;case 21:oa(e,t,s);break;case 22:xt=(o=xt)||s.memoizedState!==null,oa(e,t,s),xt=o;break;default:oa(e,t,s)}}function kg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Si(e)}catch(s){$e(t,t.return,s)}}}function Eg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Si(e)}catch(s){$e(t,t.return,s)}}function I1(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new _g),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new _g),t;default:throw Error(l(435,e.tag))}}function fr(e,t){var s=I1(e);t.forEach(function(o){if(!s.has(o)){s.add(o);var u=F1.bind(null,e,o);o.then(u,u)}})}function Kt(e,t){var s=t.deletions;if(s!==null)for(var o=0;o<s.length;o++){var u=s[o],h=e,_=t,T=_;e:for(;T!==null;){switch(T.tag){case 27:if(Va(T.type)){st=T.stateNode,Yt=!1;break e}break;case 5:st=T.stateNode,Yt=!1;break e;case 3:case 4:st=T.stateNode.containerInfo,Yt=!0;break e}T=T.return}if(st===null)throw Error(l(160));Cg(h,_,u),st=null,Yt=!1,h=u.alternate,h!==null&&(h.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Ng(t,e),t=t.sibling}var jn=null;function Ng(e,t){var s=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Kt(t,e),Zt(e),o&4&&(Ra(3,e,e.return),Co(3,e),Ra(5,e,e.return));break;case 1:Kt(t,e),Zt(e),o&512&&(xt||s===null||Ln(s,s.return)),o&64&&ia&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?o:s.concat(o))));break;case 26:var u=jn;if(Kt(t,e),Zt(e),o&512&&(xt||s===null||Ln(s,s.return)),o&4){var h=s!==null?s.memoizedState:null;if(o=e.memoizedState,s===null)if(o===null)if(e.stateNode===null){e:{o=e.type,s=e.memoizedProps,u=u.ownerDocument||u;t:switch(o){case"title":h=u.getElementsByTagName("title")[0],(!h||h[Qi]||h[wt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=u.createElement(o),u.head.insertBefore(h,u.querySelector("head > title"))),Rt(h,o,s),h[wt]=e,kt(h),o=h;break e;case"link":var _=Nv("link","href",u).get(o+(s.href||""));if(_){for(var T=0;T<_.length;T++)if(h=_[T],h.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&h.getAttribute("rel")===(s.rel==null?null:s.rel)&&h.getAttribute("title")===(s.title==null?null:s.title)&&h.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){_.splice(T,1);break t}}h=u.createElement(o),Rt(h,o,s),u.head.appendChild(h);break;case"meta":if(_=Nv("meta","content",u).get(o+(s.content||""))){for(T=0;T<_.length;T++)if(h=_[T],h.getAttribute("content")===(s.content==null?null:""+s.content)&&h.getAttribute("name")===(s.name==null?null:s.name)&&h.getAttribute("property")===(s.property==null?null:s.property)&&h.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&h.getAttribute("charset")===(s.charSet==null?null:s.charSet)){_.splice(T,1);break t}}h=u.createElement(o),Rt(h,o,s),u.head.appendChild(h);break;default:throw Error(l(468,o))}h[wt]=e,kt(h),o=h}e.stateNode=o}else Av(u,e.type,e.stateNode);else e.stateNode=Ev(u,o,e.memoizedProps);else h!==o?(h===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):h.count--,o===null?Av(u,e.type,e.stateNode):Ev(u,o,e.memoizedProps)):o===null&&e.stateNode!==null&&ed(e,e.memoizedProps,s.memoizedProps)}break;case 27:Kt(t,e),Zt(e),o&512&&(xt||s===null||Ln(s,s.return)),s!==null&&o&4&&ed(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Kt(t,e),Zt(e),o&512&&(xt||s===null||Ln(s,s.return)),e.flags&32){u=e.stateNode;try{Fs(u,"")}catch(ue){$e(e,e.return,ue)}}o&4&&e.stateNode!=null&&(u=e.memoizedProps,ed(e,u,s!==null?s.memoizedProps:u)),o&1024&&(ad=!0);break;case 6:if(Kt(t,e),Zt(e),o&4){if(e.stateNode===null)throw Error(l(162));o=e.memoizedProps,s=e.stateNode;try{s.nodeValue=o}catch(ue){$e(e,e.return,ue)}}break;case 3:if(Ar=null,u=jn,jn=Er(t.containerInfo),Kt(t,e),jn=u,Zt(e),o&4&&s!==null&&s.memoizedState.isDehydrated)try{Si(t.containerInfo)}catch(ue){$e(e,e.return,ue)}ad&&(ad=!1,Ag(e));break;case 4:o=jn,jn=Er(e.stateNode.containerInfo),Kt(t,e),Zt(e),jn=o;break;case 12:Kt(t,e),Zt(e);break;case 31:Kt(t,e),Zt(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,fr(e,o)));break;case 13:Kt(t,e),Zt(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(pr=Bt()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,fr(e,o)));break;case 22:u=e.memoizedState!==null;var j=s!==null&&s.memoizedState!==null,P=ia,K=xt;if(ia=P||u,xt=K||j,Kt(t,e),xt=K,ia=P,Zt(e),o&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(s===null||j||ia||xt||bs(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){j=s=t;try{if(h=j.stateNode,u)_=h.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{T=j.stateNode;var J=j.memoizedProps.style,$=J!=null&&J.hasOwnProperty("display")?J.display:null;T.style.display=$==null||typeof $=="boolean"?"":(""+$).trim()}}catch(ue){$e(j,j.return,ue)}}}else if(t.tag===6){if(s===null){j=t;try{j.stateNode.nodeValue=u?"":j.memoizedProps}catch(ue){$e(j,j.return,ue)}}}else if(t.tag===18){if(s===null){j=t;try{var q=j.stateNode;u?vv(q,!0):vv(j.stateNode,!1)}catch(ue){$e(j,j.return,ue)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;s===t&&(s=null),t=t.return}s===t&&(s=null),t.sibling.return=t.return,t=t.sibling}o&4&&(o=e.updateQueue,o!==null&&(s=o.retryQueue,s!==null&&(o.retryQueue=null,fr(e,s))));break;case 19:Kt(t,e),Zt(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,fr(e,o)));break;case 30:break;case 21:break;default:Kt(t,e),Zt(e)}}function Zt(e){var t=e.flags;if(t&2){try{for(var s,o=e.return;o!==null;){if(bg(o)){s=o;break}o=o.return}if(s==null)throw Error(l(160));switch(s.tag){case 27:var u=s.stateNode,h=td(e);dr(e,h,u);break;case 5:var _=s.stateNode;s.flags&32&&(Fs(_,""),s.flags&=-33);var T=td(e);dr(e,T,_);break;case 3:case 4:var j=s.stateNode.containerInfo,P=td(e);nd(e,P,j);break;default:throw Error(l(161))}}catch(K){$e(e,e.return,K)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ag(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ag(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function la(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Sg(e,t.alternate,t),t=t.sibling}function bs(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ra(4,t,t.return),bs(t);break;case 1:Ln(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&vg(t,t.return,s),bs(t);break;case 27:Oo(t.stateNode);case 26:case 5:Ln(t,t.return),bs(t);break;case 22:t.memoizedState===null&&bs(t);break;case 30:bs(t);break;default:bs(t)}e=e.sibling}}function ra(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var o=t.alternate,u=e,h=t,_=h.flags;switch(h.tag){case 0:case 11:case 15:ra(u,h,s),Co(4,h);break;case 1:if(ra(u,h,s),o=h,u=o.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(P){$e(o,o.return,P)}if(o=h,u=o.updateQueue,u!==null){var T=o.stateNode;try{var j=u.shared.hiddenCallbacks;if(j!==null)for(u.shared.hiddenCallbacks=null,u=0;u<j.length;u++)im(j[u],T)}catch(P){$e(o,o.return,P)}}s&&_&64&&gg(h),ko(h,h.return);break;case 27:xg(h);case 26:case 5:ra(u,h,s),s&&o===null&&_&4&&yg(h),ko(h,h.return);break;case 12:ra(u,h,s);break;case 31:ra(u,h,s),s&&_&4&&kg(u,h);break;case 13:ra(u,h,s),s&&_&4&&Eg(u,h);break;case 22:h.memoizedState===null&&ra(u,h,s),ko(h,h.return);break;case 30:break;default:ra(u,h,s)}t=t.sibling}}function sd(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&uo(s))}function id(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&uo(e))}function Dn(e,t,s,o){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)wg(e,t,s,o),t=t.sibling}function wg(e,t,s,o){var u=t.flags;switch(t.tag){case 0:case 11:case 15:Dn(e,t,s,o),u&2048&&Co(9,t);break;case 1:Dn(e,t,s,o);break;case 3:Dn(e,t,s,o),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&uo(e)));break;case 12:if(u&2048){Dn(e,t,s,o),e=t.stateNode;try{var h=t.memoizedProps,_=h.id,T=h.onPostCommit;typeof T=="function"&&T(_,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(j){$e(t,t.return,j)}}else Dn(e,t,s,o);break;case 31:Dn(e,t,s,o);break;case 13:Dn(e,t,s,o);break;case 23:break;case 22:h=t.stateNode,_=t.alternate,t.memoizedState!==null?h._visibility&2?Dn(e,t,s,o):Eo(e,t):h._visibility&2?Dn(e,t,s,o):(h._visibility|=2,di(e,t,s,o,(t.subtreeFlags&10256)!==0||!1)),u&2048&&sd(_,t);break;case 24:Dn(e,t,s,o),u&2048&&id(t.alternate,t);break;default:Dn(e,t,s,o)}}function di(e,t,s,o,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var h=e,_=t,T=s,j=o,P=_.flags;switch(_.tag){case 0:case 11:case 15:di(h,_,T,j,u),Co(8,_);break;case 23:break;case 22:var K=_.stateNode;_.memoizedState!==null?K._visibility&2?di(h,_,T,j,u):Eo(h,_):(K._visibility|=2,di(h,_,T,j,u)),u&&P&2048&&sd(_.alternate,_);break;case 24:di(h,_,T,j,u),u&&P&2048&&id(_.alternate,_);break;default:di(h,_,T,j,u)}t=t.sibling}}function Eo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,o=t,u=o.flags;switch(o.tag){case 22:Eo(s,o),u&2048&&sd(o.alternate,o);break;case 24:Eo(s,o),u&2048&&id(o.alternate,o);break;default:Eo(s,o)}t=t.sibling}}var No=8192;function fi(e,t,s){if(e.subtreeFlags&No)for(e=e.child;e!==null;)jg(e,t,s),e=e.sibling}function jg(e,t,s){switch(e.tag){case 26:fi(e,t,s),e.flags&No&&e.memoizedState!==null&&SS(s,jn,e.memoizedState,e.memoizedProps);break;case 5:fi(e,t,s);break;case 3:case 4:var o=jn;jn=Er(e.stateNode.containerInfo),fi(e,t,s),jn=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=No,No=16777216,fi(e,t,s),No=o):fi(e,t,s));break;default:fi(e,t,s)}}function Dg(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ao(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var o=t[s];Et=o,Rg(o,e)}Dg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Mg(e),e=e.sibling}function Mg(e){switch(e.tag){case 0:case 11:case 15:Ao(e),e.flags&2048&&Ra(9,e,e.return);break;case 3:Ao(e);break;case 12:Ao(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,hr(e)):Ao(e);break;default:Ao(e)}}function hr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var o=t[s];Et=o,Rg(o,e)}Dg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ra(8,t,t.return),hr(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,hr(t));break;default:hr(t)}e=e.sibling}}function Rg(e,t){for(;Et!==null;){var s=Et;switch(s.tag){case 0:case 11:case 15:Ra(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var o=s.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:uo(s.memoizedState.cache)}if(o=s.child,o!==null)o.return=s,Et=o;else e:for(s=e;Et!==null;){o=Et;var u=o.sibling,h=o.return;if(Tg(o),o===s){Et=null;break e}if(u!==null){u.return=h,Et=u;break e}Et=h}}}var L1={getCacheForType:function(e){var t=Dt(vt),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Dt(vt).controller.signal}},z1=typeof WeakMap=="function"?WeakMap:Map,Ve=0,Xe=null,Ne=null,we=0,Pe=0,on=null,Oa=!1,hi=!1,od=!1,ca=0,dt=0,Ba=0,xs=0,ld=0,ln=0,pi=0,wo=null,Xt=null,rd=!1,pr=0,Og=0,mr=1/0,gr=null,Ia=null,Tt=0,La=null,mi=null,ua=0,cd=0,ud=null,Bg=null,jo=0,dd=null;function rn(){return(Ve&2)!==0&&we!==0?we&-we:V.T!==null?vd():Qh()}function Ig(){if(ln===0)if((we&536870912)===0||De){var e=pn;pn<<=1,(pn&3932160)===0&&(pn=262144),ln=e}else ln=536870912;return e=an.current,e!==null&&(e.flags|=32),ln}function Qt(e,t,s){(e===Xe&&(Pe===2||Pe===9)||e.cancelPendingCommit!==null)&&(gi(e,0),za(e,we,ln,!1)),Xi(e,s),((Ve&2)===0||e!==Xe)&&(e===Xe&&((Ve&2)===0&&(xs|=s),dt===4&&za(e,we,ln,!1)),zn(e))}function Lg(e,t,s){if((Ve&6)!==0)throw Error(l(327));var o=!s&&(t&127)===0&&(t&e.expiredLanes)===0||Zi(e,t),u=o?H1(e,t):hd(e,t,!0),h=o;do{if(u===0){hi&&!o&&za(e,t,0,!1);break}else{if(s=e.current.alternate,h&&!U1(s)){u=hd(e,t,!1),h=!1;continue}if(u===2){if(h=t,e.errorRecoveryDisabledLanes&h)var _=0;else _=e.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){t=_;e:{var T=e;u=wo;var j=T.current.memoizedState.isDehydrated;if(j&&(gi(T,_).flags|=256),_=hd(T,_,!1),_!==2){if(od&&!j){T.errorRecoveryDisabledLanes|=h,xs|=h,u=4;break e}h=Xt,Xt=u,h!==null&&(Xt===null?Xt=h:Xt.push.apply(Xt,h))}u=_}if(h=!1,u!==2)continue}}if(u===1){gi(e,0),za(e,t,0,!0);break}e:{switch(o=e,h=u,h){case 0:case 1:throw Error(l(345));case 4:if((t&4194048)!==t)break;case 6:za(o,t,ln,!Oa);break e;case 2:Xt=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(u=pr+300-Bt(),10<u)){if(za(o,t,ln,!Oa),El(o,0,!0)!==0)break e;ua=t,o.timeoutHandle=pv(zg.bind(null,o,s,Xt,gr,rd,t,ln,xs,pi,Oa,h,"Throttled",-0,0),u);break e}zg(o,s,Xt,gr,rd,t,ln,xs,pi,Oa,h,null,-0,0)}}break}while(!0);zn(e)}function zg(e,t,s,o,u,h,_,T,j,P,K,J,$,q){if(e.timeoutHandle=-1,J=t.subtreeFlags,J&8192||(J&16785408)===16785408){J={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Zn},jg(t,h,J);var ue=(h&62914560)===h?pr-Bt():(h&4194048)===h?Og-Bt():0;if(ue=TS(J,ue),ue!==null){ua=h,e.cancelPendingCommit=ue(qg.bind(null,e,t,h,s,o,u,_,T,j,K,J,null,$,q)),za(e,h,_,!P);return}}qg(e,t,h,s,o,u,_,T,j)}function U1(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var o=0;o<s.length;o++){var u=s[o],h=u.getSnapshot;u=u.value;try{if(!tn(h(),u))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function za(e,t,s,o){t&=~ld,t&=~xs,e.suspendedLanes|=t,e.pingedLanes&=~t,o&&(e.warmLanes|=t),o=e.expirationTimes;for(var u=t;0<u;){var h=31-Fe(u),_=1<<h;o[h]=-1,u&=~_}s!==0&&Kh(e,s,t)}function vr(){return(Ve&6)===0?(Do(0),!1):!0}function fd(){if(Ne!==null){if(Pe===0)var e=Ne.return;else e=Ne,Jn=ds=null,Au(e),oi=null,ho=0,e=Ne;for(;e!==null;)mg(e.alternate,e),e=e.return;Ne=null}}function gi(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,iS(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),ua=0,fd(),Xe=e,Ne=s=Qn(e.current,null),we=t,Pe=0,on=null,Oa=!1,hi=Zi(e,t),od=!1,pi=ln=ld=xs=Ba=dt=0,Xt=wo=null,rd=!1,(t&8)!==0&&(t|=t&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=t;0<o;){var u=31-Fe(o),h=1<<u;t|=e[u],o&=~h}return ca=t,zl(),s}function Ug(e,t){_e=null,V.H=_o,t===ii||t===ql?(t=tm(),Pe=3):t===gu?(t=tm(),Pe=4):Pe=t===$u?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,on=t,Ne===null&&(dt=1,or(e,yn(t,e.current)))}function Vg(){var e=an.current;return e===null?!0:(we&4194048)===we?Sn===null:(we&62914560)===we||(we&536870912)!==0?e===Sn:!1}function Hg(){var e=V.H;return V.H=_o,e===null?_o:e}function Gg(){var e=V.A;return V.A=L1,e}function yr(){dt=4,Oa||(we&4194048)!==we&&an.current!==null||(hi=!0),(Ba&134217727)===0&&(xs&134217727)===0||Xe===null||za(Xe,we,ln,!1)}function hd(e,t,s){var o=Ve;Ve|=2;var u=Hg(),h=Gg();(Xe!==e||we!==t)&&(gr=null,gi(e,t)),t=!1;var _=dt;e:do try{if(Pe!==0&&Ne!==null){var T=Ne,j=on;switch(Pe){case 8:fd(),_=6;break e;case 3:case 2:case 9:case 6:an.current===null&&(t=!0);var P=Pe;if(Pe=0,on=null,vi(e,T,j,P),s&&hi){_=0;break e}break;default:P=Pe,Pe=0,on=null,vi(e,T,j,P)}}V1(),_=dt;break}catch(K){Ug(e,K)}while(!0);return t&&e.shellSuspendCounter++,Jn=ds=null,Ve=o,V.H=u,V.A=h,Ne===null&&(Xe=null,we=0,zl()),_}function V1(){for(;Ne!==null;)Pg(Ne)}function H1(e,t){var s=Ve;Ve|=2;var o=Hg(),u=Gg();Xe!==e||we!==t?(gr=null,mr=Bt()+500,gi(e,t)):hi=Zi(e,t);e:do try{if(Pe!==0&&Ne!==null){t=Ne;var h=on;t:switch(Pe){case 1:Pe=0,on=null,vi(e,t,h,1);break;case 2:case 9:if(Jp(h)){Pe=0,on=null,$g(t);break}t=function(){Pe!==2&&Pe!==9||Xe!==e||(Pe=7),zn(e)},h.then(t,t);break e;case 3:Pe=7;break e;case 4:Pe=5;break e;case 7:Jp(h)?(Pe=0,on=null,$g(t)):(Pe=0,on=null,vi(e,t,h,7));break;case 5:var _=null;switch(Ne.tag){case 26:_=Ne.memoizedState;case 5:case 27:var T=Ne;if(_?wv(_):T.stateNode.complete){Pe=0,on=null;var j=T.sibling;if(j!==null)Ne=j;else{var P=T.return;P!==null?(Ne=P,br(P)):Ne=null}break t}}Pe=0,on=null,vi(e,t,h,5);break;case 6:Pe=0,on=null,vi(e,t,h,6);break;case 8:fd(),dt=6;break e;default:throw Error(l(462))}}G1();break}catch(K){Ug(e,K)}while(!0);return Jn=ds=null,V.H=o,V.A=u,Ve=s,Ne!==null?0:(Xe=null,we=0,zl(),dt)}function G1(){for(;Ne!==null&&!Cl();)Pg(Ne)}function Pg(e){var t=hg(e.alternate,e,ca);e.memoizedProps=e.pendingProps,t===null?br(e):Ne=t}function $g(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=lg(s,t,t.pendingProps,t.type,void 0,we);break;case 11:t=lg(s,t,t.pendingProps,t.type.render,t.ref,we);break;case 5:Au(t);default:mg(s,t),t=Ne=Gp(t,ca),t=hg(s,t,ca)}e.memoizedProps=e.pendingProps,t===null?br(e):Ne=t}function vi(e,t,s,o){Jn=ds=null,Au(t),oi=null,ho=0;var u=t.return;try{if(j1(e,u,t,s,we)){dt=1,or(e,yn(s,e.current)),Ne=null;return}}catch(h){if(u!==null)throw Ne=u,h;dt=1,or(e,yn(s,e.current)),Ne=null;return}t.flags&32768?(De||o===1?e=!0:hi||(we&536870912)!==0?e=!1:(Oa=e=!0,(o===2||o===9||o===3||o===6)&&(o=an.current,o!==null&&o.tag===13&&(o.flags|=16384))),Fg(t,e)):br(t)}function br(e){var t=e;do{if((t.flags&32768)!==0){Fg(t,Oa);return}e=t.return;var s=R1(t.alternate,t,ca);if(s!==null){Ne=s;return}if(t=t.sibling,t!==null){Ne=t;return}Ne=t=e}while(t!==null);dt===0&&(dt=5)}function Fg(e,t){do{var s=O1(e.alternate,e);if(s!==null){s.flags&=32767,Ne=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){Ne=e;return}Ne=e=s}while(e!==null);dt=6,Ne=null}function qg(e,t,s,o,u,h,_,T,j){e.cancelPendingCommit=null;do xr();while(Tt!==0);if((Ve&6)!==0)throw Error(l(327));if(t!==null){if(t===e.current)throw Error(l(177));if(h=t.lanes|t.childLanes,h|=tu,__(e,s,h,_,T,j),e===Xe&&(Ne=Xe=null,we=0),mi=t,La=e,ua=s,cd=h,ud=u,Bg=o,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,q1(ce,function(){return Qg(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||o){o=V.T,V.T=null,u=H.p,H.p=2,_=Ve,Ve|=4;try{B1(e,t,s)}finally{Ve=_,H.p=u,V.T=o}}Tt=1,Yg(),Kg(),Zg()}}function Yg(){if(Tt===1){Tt=0;var e=La,t=mi,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=V.T,V.T=null;var o=H.p;H.p=2;var u=Ve;Ve|=4;try{Ng(t,e);var h=kd,_=Rp(e.containerInfo),T=h.focusedElem,j=h.selectionRange;if(_!==T&&T&&T.ownerDocument&&Mp(T.ownerDocument.documentElement,T)){if(j!==null&&Xc(T)){var P=j.start,K=j.end;if(K===void 0&&(K=P),"selectionStart"in T)T.selectionStart=P,T.selectionEnd=Math.min(K,T.value.length);else{var J=T.ownerDocument||document,$=J&&J.defaultView||window;if($.getSelection){var q=$.getSelection(),ue=T.textContent.length,ge=Math.min(j.start,ue),Ke=j.end===void 0?ge:Math.min(j.end,ue);!q.extend&&ge>Ke&&(_=Ke,Ke=ge,ge=_);var L=Dp(T,ge),M=Dp(T,Ke);if(L&&M&&(q.rangeCount!==1||q.anchorNode!==L.node||q.anchorOffset!==L.offset||q.focusNode!==M.node||q.focusOffset!==M.offset)){var G=J.createRange();G.setStart(L.node,L.offset),q.removeAllRanges(),ge>Ke?(q.addRange(G),q.extend(M.node,M.offset)):(G.setEnd(M.node,M.offset),q.addRange(G))}}}}for(J=[],q=T;q=q.parentNode;)q.nodeType===1&&J.push({element:q,left:q.scrollLeft,top:q.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<J.length;T++){var Q=J[T];Q.element.scrollLeft=Q.left,Q.element.scrollTop=Q.top}}Mr=!!Cd,kd=Cd=null}finally{Ve=u,H.p=o,V.T=s}}e.current=t,Tt=2}}function Kg(){if(Tt===2){Tt=0;var e=La,t=mi,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=V.T,V.T=null;var o=H.p;H.p=2;var u=Ve;Ve|=4;try{Sg(e,t.alternate,t)}finally{Ve=u,H.p=o,V.T=s}}Tt=3}}function Zg(){if(Tt===4||Tt===3){Tt=0,kl();var e=La,t=mi,s=ua,o=Bg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Tt=5:(Tt=0,mi=La=null,Xg(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(Ia=null),Dc(s),t=t.stateNode,ke&&typeof ke.onCommitFiberRoot=="function")try{ke.onCommitFiberRoot(ht,t,void 0,(t.current.flags&128)===128)}catch{}if(o!==null){t=V.T,u=H.p,H.p=2,V.T=null;try{for(var h=e.onRecoverableError,_=0;_<o.length;_++){var T=o[_];h(T.value,{componentStack:T.stack})}}finally{V.T=t,H.p=u}}(ua&3)!==0&&xr(),zn(e),u=e.pendingLanes,(s&261930)!==0&&(u&42)!==0?e===dd?jo++:(jo=0,dd=e):jo=0,Do(0)}}function Xg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,uo(t)))}function xr(){return Yg(),Kg(),Zg(),Qg()}function Qg(){if(Tt!==5)return!1;var e=La,t=cd;cd=0;var s=Dc(ua),o=V.T,u=H.p;try{H.p=32>s?32:s,V.T=null,s=ud,ud=null;var h=La,_=ua;if(Tt=0,mi=La=null,ua=0,(Ve&6)!==0)throw Error(l(331));var T=Ve;if(Ve|=4,Mg(h.current),wg(h,h.current,_,s),Ve=T,Do(0,!1),ke&&typeof ke.onPostCommitFiberRoot=="function")try{ke.onPostCommitFiberRoot(ht,h)}catch{}return!0}finally{H.p=u,V.T=o,Xg(e,t)}}function Wg(e,t,s){t=yn(s,t),t=Pu(e.stateNode,t,2),e=ja(e,t,2),e!==null&&(Xi(e,2),zn(e))}function $e(e,t,s){if(e.tag===3)Wg(e,e,s);else for(;t!==null;){if(t.tag===3){Wg(t,e,s);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Ia===null||!Ia.has(o))){e=yn(s,e),s=Jm(2),o=ja(t,s,2),o!==null&&(eg(s,o,t,e),Xi(o,2),zn(o));break}}t=t.return}}function pd(e,t,s){var o=e.pingCache;if(o===null){o=e.pingCache=new z1;var u=new Set;o.set(t,u)}else u=o.get(t),u===void 0&&(u=new Set,o.set(t,u));u.has(s)||(od=!0,u.add(s),e=P1.bind(null,e,t,s),t.then(e,e))}function P1(e,t,s){var o=e.pingCache;o!==null&&o.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,Xe===e&&(we&s)===s&&(dt===4||dt===3&&(we&62914560)===we&&300>Bt()-pr?(Ve&2)===0&&gi(e,0):ld|=s,pi===we&&(pi=0)),zn(e)}function Jg(e,t){t===0&&(t=Yh()),e=rs(e,t),e!==null&&(Xi(e,t),zn(e))}function $1(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Jg(e,s)}function F1(e,t){var s=0;switch(e.tag){case 31:case 13:var o=e.stateNode,u=e.memoizedState;u!==null&&(s=u.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(l(314))}o!==null&&o.delete(t),Jg(e,s)}function q1(e,t){return Ls(e,t)}var _r=null,yi=null,md=!1,Sr=!1,gd=!1,Ua=0;function zn(e){e!==yi&&e.next===null&&(yi===null?_r=yi=e:yi=yi.next=e),Sr=!0,md||(md=!0,K1())}function Do(e,t){if(!gd&&Sr){gd=!0;do for(var s=!1,o=_r;o!==null;){if(e!==0){var u=o.pendingLanes;if(u===0)var h=0;else{var _=o.suspendedLanes,T=o.pingedLanes;h=(1<<31-Fe(42|e)+1)-1,h&=u&~(_&~T),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(s=!0,av(o,h))}else h=we,h=El(o,o===Xe?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||Zi(o,h)||(s=!0,av(o,h));o=o.next}while(s);gd=!1}}function Y1(){ev()}function ev(){Sr=md=!1;var e=0;Ua!==0&&sS()&&(e=Ua);for(var t=Bt(),s=null,o=_r;o!==null;){var u=o.next,h=tv(o,t);h===0?(o.next=null,s===null?_r=u:s.next=u,u===null&&(yi=s)):(s=o,(e!==0||(h&3)!==0)&&(Sr=!0)),o=u}Tt!==0&&Tt!==5||Do(e),Ua!==0&&(Ua=0)}function tv(e,t){for(var s=e.suspendedLanes,o=e.pingedLanes,u=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var _=31-Fe(h),T=1<<_,j=u[_];j===-1?((T&s)===0||(T&o)!==0)&&(u[_]=x_(T,t)):j<=t&&(e.expiredLanes|=T),h&=~T}if(t=Xe,s=we,s=El(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,s===0||e===t&&(Pe===2||Pe===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&zs(o),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Zi(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(o!==null&&zs(o),Dc(s)){case 2:case 8:s=le;break;case 32:s=ce;break;case 268435456:s=be;break;default:s=ce}return o=nv.bind(null,e),s=Ls(s,o),e.callbackPriority=t,e.callbackNode=s,t}return o!==null&&o!==null&&zs(o),e.callbackPriority=2,e.callbackNode=null,2}function nv(e,t){if(Tt!==0&&Tt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(xr()&&e.callbackNode!==s)return null;var o=we;return o=El(e,e===Xe?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(Lg(e,o,t),tv(e,Bt()),e.callbackNode!=null&&e.callbackNode===s?nv.bind(null,e):null)}function av(e,t){if(xr())return null;Lg(e,t,!0)}function K1(){oS(function(){(Ve&6)!==0?Ls(W,Y1):ev()})}function vd(){if(Ua===0){var e=ai;e===0&&(e=xa,xa<<=1,(xa&261888)===0&&(xa=256)),Ua=e}return Ua}function sv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:jl(""+e)}function iv(e,t){var s=t.ownerDocument.createElement("input");return s.name=t.name,s.value=t.value,e.id&&s.setAttribute("form",e.id),t.parentNode.insertBefore(s,t),e=new FormData(e),s.parentNode.removeChild(s),e}function Z1(e,t,s,o,u){if(t==="submit"&&s&&s.stateNode===u){var h=sv((u[Ft]||null).action),_=o.submitter;_&&(t=(t=_[Ft]||null)?sv(t.formAction):_.getAttribute("formAction"),t!==null&&(h=t,_=null));var T=new Ol("action","action",null,o,u);e.push({event:T,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(Ua!==0){var j=_?iv(u,_):new FormData(u);Lu(s,{pending:!0,data:j,method:u.method,action:h},null,j)}}else typeof h=="function"&&(T.preventDefault(),j=_?iv(u,_):new FormData(u),Lu(s,{pending:!0,data:j,method:u.method,action:h},h,j))},currentTarget:u}]})}}for(var yd=0;yd<eu.length;yd++){var bd=eu[yd],X1=bd.toLowerCase(),Q1=bd[0].toUpperCase()+bd.slice(1);wn(X1,"on"+Q1)}wn(Ip,"onAnimationEnd"),wn(Lp,"onAnimationIteration"),wn(zp,"onAnimationStart"),wn("dblclick","onDoubleClick"),wn("focusin","onFocus"),wn("focusout","onBlur"),wn(h1,"onTransitionRun"),wn(p1,"onTransitionStart"),wn(m1,"onTransitionCancel"),wn(Up,"onTransitionEnd"),Ps("onMouseEnter",["mouseout","mouseover"]),Ps("onMouseLeave",["mouseout","mouseover"]),Ps("onPointerEnter",["pointerout","pointerover"]),Ps("onPointerLeave",["pointerout","pointerover"]),ss("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ss("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ss("onBeforeInput",["compositionend","keypress","textInput","paste"]),ss("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ss("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ss("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Mo="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(" "),W1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Mo));function ov(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var o=e[s],u=o.event;o=o.listeners;e:{var h=void 0;if(t)for(var _=o.length-1;0<=_;_--){var T=o[_],j=T.instance,P=T.currentTarget;if(T=T.listener,j!==h&&u.isPropagationStopped())break e;h=T,u.currentTarget=P;try{h(u)}catch(K){Ll(K)}u.currentTarget=null,h=j}else for(_=0;_<o.length;_++){if(T=o[_],j=T.instance,P=T.currentTarget,T=T.listener,j!==h&&u.isPropagationStopped())break e;h=T,u.currentTarget=P;try{h(u)}catch(K){Ll(K)}u.currentTarget=null,h=j}}}}function Ae(e,t){var s=t[Mc];s===void 0&&(s=t[Mc]=new Set);var o=e+"__bubble";s.has(o)||(lv(t,e,2,!1),s.add(o))}function xd(e,t,s){var o=0;t&&(o|=4),lv(s,e,o,t)}var Tr="_reactListening"+Math.random().toString(36).slice(2);function _d(e){if(!e[Tr]){e[Tr]=!0,ep.forEach(function(s){s!=="selectionchange"&&(W1.has(s)||xd(s,!1,e),xd(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Tr]||(t[Tr]=!0,xd("selectionchange",!1,t))}}function lv(e,t,s,o){switch(Iv(t)){case 2:var u=ES;break;case 8:u=NS;break;default:u=Id}s=u.bind(null,t,s,e),u=void 0,!Hc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),o?u!==void 0?e.addEventListener(t,s,{capture:!0,passive:u}):e.addEventListener(t,s,!0):u!==void 0?e.addEventListener(t,s,{passive:u}):e.addEventListener(t,s,!1)}function Sd(e,t,s,o,u){var h=o;if((t&1)===0&&(t&2)===0&&o!==null)e:for(;;){if(o===null)return;var _=o.tag;if(_===3||_===4){var T=o.stateNode.containerInfo;if(T===u)break;if(_===4)for(_=o.return;_!==null;){var j=_.tag;if((j===3||j===4)&&_.stateNode.containerInfo===u)return;_=_.return}for(;T!==null;){if(_=Vs(T),_===null)return;if(j=_.tag,j===5||j===6||j===26||j===27){o=h=_;continue e}T=T.parentNode}}o=o.return}fp(function(){var P=h,K=Uc(s),J=[];e:{var $=Vp.get(e);if($!==void 0){var q=Ol,ue=e;switch(e){case"keypress":if(Ml(s)===0)break e;case"keydown":case"keyup":q=F_;break;case"focusin":ue="focus",q=Fc;break;case"focusout":ue="blur",q=Fc;break;case"beforeblur":case"afterblur":q=Fc;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":q=mp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":q=R_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":q=K_;break;case Ip:case Lp:case zp:q=I_;break;case Up:q=X_;break;case"scroll":case"scrollend":q=D_;break;case"wheel":q=W_;break;case"copy":case"cut":case"paste":q=z_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":q=vp;break;case"toggle":case"beforetoggle":q=e1}var ge=(t&4)!==0,Ke=!ge&&(e==="scroll"||e==="scrollend"),L=ge?$!==null?$+"Capture":null:$;ge=[];for(var M=P,G;M!==null;){var Q=M;if(G=Q.stateNode,Q=Q.tag,Q!==5&&Q!==26&&Q!==27||G===null||L===null||(Q=Ji(M,L),Q!=null&&ge.push(Ro(M,Q,G))),Ke)break;M=M.return}0<ge.length&&($=new q($,ue,null,s,K),J.push({event:$,listeners:ge}))}}if((t&7)===0){e:{if($=e==="mouseover"||e==="pointerover",q=e==="mouseout"||e==="pointerout",$&&s!==zc&&(ue=s.relatedTarget||s.fromElement)&&(Vs(ue)||ue[Us]))break e;if((q||$)&&($=K.window===K?K:($=K.ownerDocument)?$.defaultView||$.parentWindow:window,q?(ue=s.relatedTarget||s.toElement,q=P,ue=ue?Vs(ue):null,ue!==null&&(Ke=f(ue),ge=ue.tag,ue!==Ke||ge!==5&&ge!==27&&ge!==6)&&(ue=null)):(q=null,ue=P),q!==ue)){if(ge=mp,Q="onMouseLeave",L="onMouseEnter",M="mouse",(e==="pointerout"||e==="pointerover")&&(ge=vp,Q="onPointerLeave",L="onPointerEnter",M="pointer"),Ke=q==null?$:Wi(q),G=ue==null?$:Wi(ue),$=new ge(Q,M+"leave",q,s,K),$.target=Ke,$.relatedTarget=G,Q=null,Vs(K)===P&&(ge=new ge(L,M+"enter",ue,s,K),ge.target=G,ge.relatedTarget=Ke,Q=ge),Ke=Q,q&&ue)t:{for(ge=J1,L=q,M=ue,G=0,Q=L;Q;Q=ge(Q))G++;Q=0;for(var pe=M;pe;pe=ge(pe))Q++;for(;0<G-Q;)L=ge(L),G--;for(;0<Q-G;)M=ge(M),Q--;for(;G--;){if(L===M||M!==null&&L===M.alternate){ge=L;break t}L=ge(L),M=ge(M)}ge=null}else ge=null;q!==null&&rv(J,$,q,ge,!1),ue!==null&&Ke!==null&&rv(J,Ke,ue,ge,!0)}}e:{if($=P?Wi(P):window,q=$.nodeName&&$.nodeName.toLowerCase(),q==="select"||q==="input"&&$.type==="file")var Ie=kp;else if(Tp($))if(Ep)Ie=u1;else{Ie=r1;var he=l1}else q=$.nodeName,!q||q.toLowerCase()!=="input"||$.type!=="checkbox"&&$.type!=="radio"?P&&Lc(P.elementType)&&(Ie=kp):Ie=c1;if(Ie&&(Ie=Ie(e,P))){Cp(J,Ie,s,K);break e}he&&he(e,$,P),e==="focusout"&&P&&$.type==="number"&&P.memoizedProps.value!=null&&Ic($,"number",$.value)}switch(he=P?Wi(P):window,e){case"focusin":(Tp(he)||he.contentEditable==="true")&&(Zs=he,Qc=P,lo=null);break;case"focusout":lo=Qc=Zs=null;break;case"mousedown":Wc=!0;break;case"contextmenu":case"mouseup":case"dragend":Wc=!1,Op(J,s,K);break;case"selectionchange":if(f1)break;case"keydown":case"keyup":Op(J,s,K)}var Se;if(Yc)e:{switch(e){case"compositionstart":var je="onCompositionStart";break e;case"compositionend":je="onCompositionEnd";break e;case"compositionupdate":je="onCompositionUpdate";break e}je=void 0}else Ks?_p(e,s)&&(je="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(je="onCompositionStart");je&&(yp&&s.locale!=="ko"&&(Ks||je!=="onCompositionStart"?je==="onCompositionEnd"&&Ks&&(Se=hp()):(Ta=K,Gc="value"in Ta?Ta.value:Ta.textContent,Ks=!0)),he=Cr(P,je),0<he.length&&(je=new gp(je,e,null,s,K),J.push({event:je,listeners:he}),Se?je.data=Se:(Se=Sp(s),Se!==null&&(je.data=Se)))),(Se=n1?a1(e,s):s1(e,s))&&(je=Cr(P,"onBeforeInput"),0<je.length&&(he=new gp("onBeforeInput","beforeinput",null,s,K),J.push({event:he,listeners:je}),he.data=Se)),Z1(J,e,P,s,K)}ov(J,t)})}function Ro(e,t,s){return{instance:e,listener:t,currentTarget:s}}function Cr(e,t){for(var s=t+"Capture",o=[];e!==null;){var u=e,h=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||h===null||(u=Ji(e,s),u!=null&&o.unshift(Ro(e,u,h)),u=Ji(e,t),u!=null&&o.push(Ro(e,u,h))),e.tag===3)return o;e=e.return}return[]}function J1(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function rv(e,t,s,o,u){for(var h=t._reactName,_=[];s!==null&&s!==o;){var T=s,j=T.alternate,P=T.stateNode;if(T=T.tag,j!==null&&j===o)break;T!==5&&T!==26&&T!==27||P===null||(j=P,u?(P=Ji(s,h),P!=null&&_.unshift(Ro(s,P,j))):u||(P=Ji(s,h),P!=null&&_.push(Ro(s,P,j)))),s=s.return}_.length!==0&&e.push({event:t,listeners:_})}var eS=/\r\n?/g,tS=/\u0000|\uFFFD/g;function cv(e){return(typeof e=="string"?e:""+e).replace(eS,`
|
|
25
|
-
`).replace(tS,"")}function uv(e,t){return t=cv(t),cv(e)===t}function Ye(e,t,s,o,u,h){switch(s){case"children":typeof o=="string"?t==="body"||t==="textarea"&&o===""||Fs(e,o):(typeof o=="number"||typeof o=="bigint")&&t!=="body"&&Fs(e,""+o);break;case"className":Al(e,"class",o);break;case"tabIndex":Al(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Al(e,s,o);break;case"style":up(e,o,h);break;case"data":if(t!=="object"){Al(e,"data",o);break}case"src":case"href":if(o===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(s);break}o=jl(""+o),e.setAttribute(s,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(s==="formAction"?(t!=="input"&&Ye(e,t,"name",u.name,u,null),Ye(e,t,"formEncType",u.formEncType,u,null),Ye(e,t,"formMethod",u.formMethod,u,null),Ye(e,t,"formTarget",u.formTarget,u,null)):(Ye(e,t,"encType",u.encType,u,null),Ye(e,t,"method",u.method,u,null),Ye(e,t,"target",u.target,u,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(s);break}o=jl(""+o),e.setAttribute(s,o);break;case"onClick":o!=null&&(e.onclick=Zn);break;case"onScroll":o!=null&&Ae("scroll",e);break;case"onScrollEnd":o!=null&&Ae("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(l(61));if(s=o.__html,s!=null){if(u.children!=null)throw Error(l(60));e.innerHTML=s}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}s=jl(""+o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,""+o):e.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":o===!0?e.setAttribute(s,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,o):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(s,o):e.removeAttribute(s);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(s):e.setAttribute(s,o);break;case"popover":Ae("beforetoggle",e),Ae("toggle",e),Nl(e,"popover",o);break;case"xlinkActuate":Kn(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Kn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Kn(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Kn(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Kn(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Kn(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Kn(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Kn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Kn(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Nl(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=w_.get(s)||s,Nl(e,s,o))}}function Td(e,t,s,o,u,h){switch(s){case"style":up(e,o,h);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(l(61));if(s=o.__html,s!=null){if(u.children!=null)throw Error(l(60));e.innerHTML=s}}break;case"children":typeof o=="string"?Fs(e,o):(typeof o=="number"||typeof o=="bigint")&&Fs(e,""+o);break;case"onScroll":o!=null&&Ae("scroll",e);break;case"onScrollEnd":o!=null&&Ae("scrollend",e);break;case"onClick":o!=null&&(e.onclick=Zn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!tp.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(u=s.endsWith("Capture"),t=s.slice(2,u?s.length-7:void 0),h=e[Ft]||null,h=h!=null?h[s]:null,typeof h=="function"&&e.removeEventListener(t,h,u),typeof o=="function")){typeof h!="function"&&h!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,o,u);break e}s in e?e[s]=o:o===!0?e.setAttribute(s,""):Nl(e,s,o)}}}function Rt(e,t,s){switch(t){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 o=!1,u=!1,h;for(h in s)if(s.hasOwnProperty(h)){var _=s[h];if(_!=null)switch(h){case"src":o=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:Ye(e,t,h,_,s,null)}}u&&Ye(e,t,"srcSet",s.srcSet,s,null),o&&Ye(e,t,"src",s.src,s,null);return;case"input":Ae("invalid",e);var T=h=_=u=null,j=null,P=null;for(o in s)if(s.hasOwnProperty(o)){var K=s[o];if(K!=null)switch(o){case"name":u=K;break;case"type":_=K;break;case"checked":j=K;break;case"defaultChecked":P=K;break;case"value":h=K;break;case"defaultValue":T=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(l(137,t));break;default:Ye(e,t,o,K,s,null)}}op(e,h,T,j,P,_,u,!1);return;case"select":Ae("invalid",e),o=_=h=null;for(u in s)if(s.hasOwnProperty(u)&&(T=s[u],T!=null))switch(u){case"value":h=T;break;case"defaultValue":_=T;break;case"multiple":o=T;default:Ye(e,t,u,T,s,null)}t=h,s=_,e.multiple=!!o,t!=null?$s(e,!!o,t,!1):s!=null&&$s(e,!!o,s,!0);return;case"textarea":Ae("invalid",e),h=u=o=null;for(_ in s)if(s.hasOwnProperty(_)&&(T=s[_],T!=null))switch(_){case"value":o=T;break;case"defaultValue":u=T;break;case"children":h=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(l(91));break;default:Ye(e,t,_,T,s,null)}rp(e,o,u,h);return;case"option":for(j in s)if(s.hasOwnProperty(j)&&(o=s[j],o!=null))switch(j){case"selected":e.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:Ye(e,t,j,o,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(o=0;o<Mo.length;o++)Ae(Mo[o],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)&&(o=s[P],o!=null))switch(P){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:Ye(e,t,P,o,s,null)}return;default:if(Lc(t)){for(K in s)s.hasOwnProperty(K)&&(o=s[K],o!==void 0&&Td(e,t,K,o,s,void 0));return}}for(T in s)s.hasOwnProperty(T)&&(o=s[T],o!=null&&Ye(e,t,T,o,s,null))}function nS(e,t,s,o){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,h=null,_=null,T=null,j=null,P=null,K=null;for(q in s){var J=s[q];if(s.hasOwnProperty(q)&&J!=null)switch(q){case"checked":break;case"value":break;case"defaultValue":j=J;default:o.hasOwnProperty(q)||Ye(e,t,q,null,o,J)}}for(var $ in o){var q=o[$];if(J=s[$],o.hasOwnProperty($)&&(q!=null||J!=null))switch($){case"type":h=q;break;case"name":u=q;break;case"checked":P=q;break;case"defaultChecked":K=q;break;case"value":_=q;break;case"defaultValue":T=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(l(137,t));break;default:q!==J&&Ye(e,t,$,q,o,J)}}Bc(e,_,T,j,P,K,h,u);return;case"select":q=_=T=$=null;for(h in s)if(j=s[h],s.hasOwnProperty(h)&&j!=null)switch(h){case"value":break;case"multiple":q=j;default:o.hasOwnProperty(h)||Ye(e,t,h,null,o,j)}for(u in o)if(h=o[u],j=s[u],o.hasOwnProperty(u)&&(h!=null||j!=null))switch(u){case"value":$=h;break;case"defaultValue":T=h;break;case"multiple":_=h;default:h!==j&&Ye(e,t,u,h,o,j)}t=T,s=_,o=q,$!=null?$s(e,!!s,$,!1):!!o!=!!s&&(t!=null?$s(e,!!s,t,!0):$s(e,!!s,s?[]:"",!1));return;case"textarea":q=$=null;for(T in s)if(u=s[T],s.hasOwnProperty(T)&&u!=null&&!o.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:Ye(e,t,T,null,o,u)}for(_ in o)if(u=o[_],h=s[_],o.hasOwnProperty(_)&&(u!=null||h!=null))switch(_){case"value":$=u;break;case"defaultValue":q=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(l(91));break;default:u!==h&&Ye(e,t,_,u,o,h)}lp(e,$,q);return;case"option":for(var ue in s)if($=s[ue],s.hasOwnProperty(ue)&&$!=null&&!o.hasOwnProperty(ue))switch(ue){case"selected":e.selected=!1;break;default:Ye(e,t,ue,null,o,$)}for(j in o)if($=o[j],q=s[j],o.hasOwnProperty(j)&&$!==q&&($!=null||q!=null))switch(j){case"selected":e.selected=$&&typeof $!="function"&&typeof $!="symbol";break;default:Ye(e,t,j,$,o,q)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ge in s)$=s[ge],s.hasOwnProperty(ge)&&$!=null&&!o.hasOwnProperty(ge)&&Ye(e,t,ge,null,o,$);for(P in o)if($=o[P],q=s[P],o.hasOwnProperty(P)&&$!==q&&($!=null||q!=null))switch(P){case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(l(137,t));break;default:Ye(e,t,P,$,o,q)}return;default:if(Lc(t)){for(var Ke in s)$=s[Ke],s.hasOwnProperty(Ke)&&$!==void 0&&!o.hasOwnProperty(Ke)&&Td(e,t,Ke,void 0,o,$);for(K in o)$=o[K],q=s[K],!o.hasOwnProperty(K)||$===q||$===void 0&&q===void 0||Td(e,t,K,$,o,q);return}}for(var L in s)$=s[L],s.hasOwnProperty(L)&&$!=null&&!o.hasOwnProperty(L)&&Ye(e,t,L,null,o,$);for(J in o)$=o[J],q=s[J],!o.hasOwnProperty(J)||$===q||$==null&&q==null||Ye(e,t,J,$,o,q)}function dv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function aS(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),o=0;o<s.length;o++){var u=s[o],h=u.transferSize,_=u.initiatorType,T=u.duration;if(h&&T&&dv(_)){for(_=0,T=u.responseEnd,o+=1;o<s.length;o++){var j=s[o],P=j.startTime;if(P>T)break;var K=j.transferSize,J=j.initiatorType;K&&dv(J)&&(j=j.responseEnd,_+=K*(j<T?1:(T-P)/(j-P)))}if(--o,t+=8*(h+_)/(u.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Cd=null,kd=null;function kr(e){return e.nodeType===9?e:e.ownerDocument}function fv(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 hv(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Ed(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Nd=null;function sS(){var e=window.event;return e&&e.type==="popstate"?e===Nd?!1:(Nd=e,!0):(Nd=null,!1)}var pv=typeof setTimeout=="function"?setTimeout:void 0,iS=typeof clearTimeout=="function"?clearTimeout:void 0,mv=typeof Promise=="function"?Promise:void 0,oS=typeof queueMicrotask=="function"?queueMicrotask:typeof mv<"u"?function(e){return mv.resolve(null).then(e).catch(lS)}:pv;function lS(e){setTimeout(function(){throw e})}function Va(e){return e==="head"}function gv(e,t){var s=t,o=0;do{var u=s.nextSibling;if(e.removeChild(s),u&&u.nodeType===8)if(s=u.data,s==="/$"||s==="/&"){if(o===0){e.removeChild(u),Si(t);return}o--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")o++;else if(s==="html")Oo(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,Oo(s);for(var h=s.firstChild;h;){var _=h.nextSibling,T=h.nodeName;h[Qi]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&h.rel.toLowerCase()==="stylesheet"||s.removeChild(h),h=_}}else s==="body"&&Oo(e.ownerDocument.body);s=u}while(s);Si(t)}function vv(e,t){var s=e;e=0;do{var o=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),o&&o.nodeType===8)if(s=o.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=o}while(s)}function Ad(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Ad(s),Rc(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function rS(e,t,s,o){for(;e.nodeType===1;){var u=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[Qi])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var h=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=Tn(e.nextSibling),e===null)break}return null}function cS(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=Tn(e.nextSibling),e===null))return null;return e}function yv(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Tn(e.nextSibling),e===null))return null;return e}function wd(e){return e.data==="$?"||e.data==="$~"}function jd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function uS(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var o=function(){t(),s.removeEventListener("DOMContentLoaded",o)};s.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function Tn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Dd=null;function bv(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return Tn(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function xv(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function _v(e,t,s){switch(t=kr(s),e){case"html":if(e=t.documentElement,!e)throw Error(l(452));return e;case"head":if(e=t.head,!e)throw Error(l(453));return e;case"body":if(e=t.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function Oo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Rc(e)}var Cn=new Map,Sv=new Set;function Er(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var da=H.d;H.d={f:dS,r:fS,D:hS,C:pS,L:mS,m:gS,X:yS,S:vS,M:bS};function dS(){var e=da.f(),t=vr();return e||t}function fS(e){var t=Hs(e);t!==null&&t.tag===5&&t.type==="form"?Um(t):da.r(e)}var bi=typeof document>"u"?null:document;function Tv(e,t,s){var o=bi;if(o&&typeof t=="string"&&t){var u=gn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof s=="string"&&(u+='[crossorigin="'+s+'"]'),Sv.has(u)||(Sv.add(u),e={rel:e,crossOrigin:s,href:t},o.querySelector(u)===null&&(t=o.createElement("link"),Rt(t,"link",e),kt(t),o.head.appendChild(t)))}}function hS(e){da.D(e),Tv("dns-prefetch",e,null)}function pS(e,t){da.C(e,t),Tv("preconnect",e,t)}function mS(e,t,s){da.L(e,t,s);var o=bi;if(o&&e&&t){var u='link[rel="preload"][as="'+gn(t)+'"]';t==="image"&&s&&s.imageSrcSet?(u+='[imagesrcset="'+gn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(u+='[imagesizes="'+gn(s.imageSizes)+'"]')):u+='[href="'+gn(e)+'"]';var h=u;switch(t){case"style":h=xi(e);break;case"script":h=_i(e)}Cn.has(h)||(e=v({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),Cn.set(h,e),o.querySelector(u)!==null||t==="style"&&o.querySelector(Bo(h))||t==="script"&&o.querySelector(Io(h))||(t=o.createElement("link"),Rt(t,"link",e),kt(t),o.head.appendChild(t)))}}function gS(e,t){da.m(e,t);var s=bi;if(s&&e){var o=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+gn(o)+'"][href="'+gn(e)+'"]',h=u;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=_i(e)}if(!Cn.has(h)&&(e=v({rel:"modulepreload",href:e},t),Cn.set(h,e),s.querySelector(u)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Io(h)))return}o=s.createElement("link"),Rt(o,"link",e),kt(o),s.head.appendChild(o)}}}function vS(e,t,s){da.S(e,t,s);var o=bi;if(o&&e){var u=Gs(o).hoistableStyles,h=xi(e);t=t||"default";var _=u.get(h);if(!_){var T={loading:0,preload:null};if(_=o.querySelector(Bo(h)))T.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},s),(s=Cn.get(h))&&Md(e,s);var j=_=o.createElement("link");kt(j),Rt(j,"link",e),j._p=new Promise(function(P,K){j.onload=P,j.onerror=K}),j.addEventListener("load",function(){T.loading|=1}),j.addEventListener("error",function(){T.loading|=2}),T.loading|=4,Nr(_,t,o)}_={type:"stylesheet",instance:_,count:1,state:T},u.set(h,_)}}}function yS(e,t){da.X(e,t);var s=bi;if(s&&e){var o=Gs(s).hoistableScripts,u=_i(e),h=o.get(u);h||(h=s.querySelector(Io(u)),h||(e=v({src:e,async:!0},t),(t=Cn.get(u))&&Rd(e,t),h=s.createElement("script"),kt(h),Rt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(u,h))}}function bS(e,t){da.M(e,t);var s=bi;if(s&&e){var o=Gs(s).hoistableScripts,u=_i(e),h=o.get(u);h||(h=s.querySelector(Io(u)),h||(e=v({src:e,async:!0,type:"module"},t),(t=Cn.get(u))&&Rd(e,t),h=s.createElement("script"),kt(h),Rt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(u,h))}}function Cv(e,t,s,o){var u=(u=$t.current)?Er(u):null;if(!u)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=xi(s.href),s=Gs(u).hoistableStyles,o=s.get(t),o||(o={type:"style",instance:null,count:0,state:null},s.set(t,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=xi(s.href);var h=Gs(u).hoistableStyles,_=h.get(e);if(_||(u=u.ownerDocument||u,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,_),(h=u.querySelector(Bo(e)))&&!h._p&&(_.instance=h,_.state.loading=5),Cn.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},Cn.set(e,s),h||xS(u,e,s,_.state))),t&&o===null)throw Error(l(528,""));return _}if(t&&o!==null)throw Error(l(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=_i(s),s=Gs(u).hoistableScripts,o=s.get(t),o||(o={type:"script",instance:null,count:0,state:null},s.set(t,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function xi(e){return'href="'+gn(e)+'"'}function Bo(e){return'link[rel="stylesheet"]['+e+"]"}function kv(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function xS(e,t,s,o){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?o.loading=1:(t=e.createElement("link"),o.preload=t,t.addEventListener("load",function(){return o.loading|=1}),t.addEventListener("error",function(){return o.loading|=2}),Rt(t,"link",s),kt(t),e.head.appendChild(t))}function _i(e){return'[src="'+gn(e)+'"]'}function Io(e){return"script[async]"+e}function Ev(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var o=e.querySelector('style[data-href~="'+gn(s.href)+'"]');if(o)return t.instance=o,kt(o),o;var u=v({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),kt(o),Rt(o,"style",u),Nr(o,s.precedence,e),t.instance=o;case"stylesheet":u=xi(s.href);var h=e.querySelector(Bo(u));if(h)return t.state.loading|=4,t.instance=h,kt(h),h;o=kv(s),(u=Cn.get(u))&&Md(o,u),h=(e.ownerDocument||e).createElement("link"),kt(h);var _=h;return _._p=new Promise(function(T,j){_.onload=T,_.onerror=j}),Rt(h,"link",o),t.state.loading|=4,Nr(h,s.precedence,e),t.instance=h;case"script":return h=_i(s.src),(u=e.querySelector(Io(h)))?(t.instance=u,kt(u),u):(o=s,(u=Cn.get(h))&&(o=v({},s),Rd(o,u)),e=e.ownerDocument||e,u=e.createElement("script"),kt(u),Rt(u,"link",o),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(l(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(o=t.instance,t.state.loading|=4,Nr(o,s.precedence,e));return t.instance}function Nr(e,t,s){for(var o=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=o.length?o[o.length-1]:null,h=u,_=0;_<o.length;_++){var T=o[_];if(T.dataset.precedence===t)h=T;else if(h!==u)break}h?h.parentNode.insertBefore(e,h.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function Md(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Rd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ar=null;function Nv(e,t,s){if(Ar===null){var o=new Map,u=Ar=new Map;u.set(s,o)}else u=Ar,o=u.get(s),o||(o=new Map,u.set(s,o));if(o.has(e))return o;for(o.set(e,null),s=s.getElementsByTagName(e),u=0;u<s.length;u++){var h=s[u];if(!(h[Qi]||h[wt]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var _=h.getAttribute(t)||"";_=e+_;var T=o.get(_);T?T.push(h):o.set(_,[h])}}return o}function Av(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function _S(e,t,s){if(s===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function wv(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function SS(e,t,s,o){if(s.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var u=xi(o.href),h=t.querySelector(Bo(u));if(h){t=h._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=wr.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=h,kt(h);return}h=t.ownerDocument||t,o=kv(o),(u=Cn.get(u))&&Md(o,u),h=h.createElement("link"),kt(h);var _=h;_._p=new Promise(function(T,j){_.onload=T,_.onerror=j}),Rt(h,"link",o),s.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=wr.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var Od=0;function TS(e,t){return e.stylesheets&&e.count===0&&Dr(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var o=setTimeout(function(){if(e.stylesheets&&Dr(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+t);0<e.imgBytes&&Od===0&&(Od=62500*aS());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Dr(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Od?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(u)}}:null}function wr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Dr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var jr=null;function Dr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,jr=new Map,t.forEach(CS,e),jr=null,wr.call(e))}function CS(e,t){if(!(t.state.loading&4)){var s=jr.get(e);if(s)var o=s.get(null);else{s=new Map,jr.set(e,s);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<u.length;h++){var _=u[h];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(s.set(_.dataset.precedence,_),o=_)}o&&s.set(null,o)}u=t.instance,_=u.getAttribute("data-precedence"),h=s.get(_)||o,h===o&&s.set(null,u),s.set(_,u),this.count++,o=wr.bind(this),u.addEventListener("load",o),u.addEventListener("error",o),h?h.parentNode.insertBefore(u,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var Lo={$$typeof:D,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function kS(e,t,s,o,u,h,_,T,j){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=wc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wc(0),this.hiddenUpdates=wc(null),this.identifierPrefix=o,this.onUncaughtError=u,this.onCaughtError=h,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.incompleteTransitions=new Map}function jv(e,t,s,o,u,h,_,T,j,P,K,J){return e=new kS(e,t,s,_,j,P,K,J,T),t=1,h===!0&&(t|=24),h=nn(3,null,null,t),e.current=h,h.stateNode=e,t=hu(),t.refCount++,e.pooledCache=t,t.refCount++,h.memoizedState={element:o,isDehydrated:s,cache:t},vu(h),e}function Dv(e){return e?(e=Ws,e):Ws}function Mv(e,t,s,o,u,h){u=Dv(u),o.context===null?o.context=u:o.pendingContext=u,o=wa(t),o.payload={element:s},h=h===void 0?null:h,h!==null&&(o.callback=h),s=ja(e,o,t),s!==null&&(Qt(s,e,t),mo(s,e,t))}function Rv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Bd(e,t){Rv(e,t),(e=e.alternate)&&Rv(e,t)}function Ov(e){if(e.tag===13||e.tag===31){var t=rs(e,67108864);t!==null&&Qt(t,e,67108864),Bd(e,67108864)}}function Bv(e){if(e.tag===13||e.tag===31){var t=rn();t=jc(t);var s=rs(e,t);s!==null&&Qt(s,e,t),Bd(e,t)}}var Mr=!0;function ES(e,t,s,o){var u=V.T;V.T=null;var h=H.p;try{H.p=2,Id(e,t,s,o)}finally{H.p=h,V.T=u}}function NS(e,t,s,o){var u=V.T;V.T=null;var h=H.p;try{H.p=8,Id(e,t,s,o)}finally{H.p=h,V.T=u}}function Id(e,t,s,o){if(Mr){var u=Ld(o);if(u===null)Sd(e,t,o,Rr,s),Lv(e,o);else if(wS(u,e,t,s,o))o.stopPropagation();else if(Lv(e,o),t&4&&-1<AS.indexOf(e)){for(;u!==null;){var h=Hs(u);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var _=as(h.pendingLanes);if(_!==0){var T=h;for(T.pendingLanes|=2,T.entangledLanes|=2;_;){var j=1<<31-Fe(_);T.entanglements[1]|=j,_&=~j}zn(h),(Ve&6)===0&&(mr=Bt()+500,Do(0))}}break;case 31:case 13:T=rs(h,2),T!==null&&Qt(T,h,2),vr(),Bd(h,2)}if(h=Ld(o),h===null&&Sd(e,t,o,Rr,s),h===u)break;u=h}u!==null&&o.stopPropagation()}else Sd(e,t,o,null,s)}}function Ld(e){return e=Uc(e),zd(e)}var Rr=null;function zd(e){if(Rr=null,e=Vs(e),e!==null){var t=f(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=d(t),e!==null)return e;e=null}else if(s===31){if(e=p(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Rr=e,null}function Iv(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(Ac()){case W:return 2;case le:return 8;case ce:case xe:return 32;case be:return 268435456;default:return 32}default:return 32}}var Ud=!1,Ha=null,Ga=null,Pa=null,zo=new Map,Uo=new Map,$a=[],AS="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 Lv(e,t){switch(e){case"focusin":case"focusout":Ha=null;break;case"dragenter":case"dragleave":Ga=null;break;case"mouseover":case"mouseout":Pa=null;break;case"pointerover":case"pointerout":zo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Uo.delete(t.pointerId)}}function Vo(e,t,s,o,u,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:s,eventSystemFlags:o,nativeEvent:h,targetContainers:[u]},t!==null&&(t=Hs(t),t!==null&&Ov(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function wS(e,t,s,o,u){switch(t){case"focusin":return Ha=Vo(Ha,e,t,s,o,u),!0;case"dragenter":return Ga=Vo(Ga,e,t,s,o,u),!0;case"mouseover":return Pa=Vo(Pa,e,t,s,o,u),!0;case"pointerover":var h=u.pointerId;return zo.set(h,Vo(zo.get(h)||null,e,t,s,o,u)),!0;case"gotpointercapture":return h=u.pointerId,Uo.set(h,Vo(Uo.get(h)||null,e,t,s,o,u)),!0}return!1}function zv(e){var t=Vs(e.target);if(t!==null){var s=f(t);if(s!==null){if(t=s.tag,t===13){if(t=d(s),t!==null){e.blockedOn=t,Wh(e.priority,function(){Bv(s)});return}}else if(t===31){if(t=p(s),t!==null){e.blockedOn=t,Wh(e.priority,function(){Bv(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Or(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Ld(e.nativeEvent);if(s===null){s=e.nativeEvent;var o=new s.constructor(s.type,s);zc=o,s.target.dispatchEvent(o),zc=null}else return t=Hs(s),t!==null&&Ov(t),e.blockedOn=s,!1;t.shift()}return!0}function Uv(e,t,s){Or(e)&&s.delete(t)}function jS(){Ud=!1,Ha!==null&&Or(Ha)&&(Ha=null),Ga!==null&&Or(Ga)&&(Ga=null),Pa!==null&&Or(Pa)&&(Pa=null),zo.forEach(Uv),Uo.forEach(Uv)}function Br(e,t){e.blockedOn===t&&(e.blockedOn=null,Ud||(Ud=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,jS)))}var Ir=null;function Vv(e){Ir!==e&&(Ir=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Ir===e&&(Ir=null);for(var t=0;t<e.length;t+=3){var s=e[t],o=e[t+1],u=e[t+2];if(typeof o!="function"){if(zd(o||s)===null)continue;break}var h=Hs(s);h!==null&&(e.splice(t,3),t-=3,Lu(h,{pending:!0,data:u,method:s.method,action:o},o,u))}}))}function Si(e){function t(j){return Br(j,e)}Ha!==null&&Br(Ha,e),Ga!==null&&Br(Ga,e),Pa!==null&&Br(Pa,e),zo.forEach(t),Uo.forEach(t);for(var s=0;s<$a.length;s++){var o=$a[s];o.blockedOn===e&&(o.blockedOn=null)}for(;0<$a.length&&(s=$a[0],s.blockedOn===null);)zv(s),s.blockedOn===null&&$a.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(o=0;o<s.length;o+=3){var u=s[o],h=s[o+1],_=u[Ft]||null;if(typeof h=="function")_||Vv(s);else if(_){var T=null;if(h&&h.hasAttribute("formAction")){if(u=h,_=h[Ft]||null)T=_.formAction;else if(zd(u)!==null)continue}else T=_.action;typeof T=="function"?s[o+1]=T:(s.splice(o,3),o-=3),Vv(s)}}}function Hv(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(_){return u=_})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),o||setTimeout(s,20)}function s(){if(!o&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function Vd(e){this._internalRoot=e}Lr.prototype.render=Vd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));var s=t.current,o=rn();Mv(s,o,e,t,null,null)},Lr.prototype.unmount=Vd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Mv(e.current,2,null,e,null,null),vr(),t[Us]=null}};function Lr(e){this._internalRoot=e}Lr.prototype.unstable_scheduleHydration=function(e){if(e){var t=Qh();e={blockedOn:null,target:e,priority:t};for(var s=0;s<$a.length&&t!==0&&t<$a[s].priority;s++);$a.splice(s,0,e),s===0&&zv(e)}};var Gv=a.version;if(Gv!=="19.2.4")throw Error(l(527,Gv,"19.2.4"));H.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=g(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var DS={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var zr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zr.isDisabled&&zr.supportsFiber)try{ht=zr.inject(DS),ke=zr}catch{}}return Ho.createRoot=function(e,t){if(!r(e))throw Error(l(299));var s=!1,o="",u=Zm,h=Xm,_=Qm;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(h=t.onCaughtError),t.onRecoverableError!==void 0&&(_=t.onRecoverableError)),t=jv(e,1,!1,null,null,s,o,null,u,h,_,Hv),e[Us]=t.current,_d(e),new Vd(t)},Ho.hydrateRoot=function(e,t,s){if(!r(e))throw Error(l(299));var o=!1,u="",h=Zm,_=Xm,T=Qm,j=null;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(u=s.identifierPrefix),s.onUncaughtError!==void 0&&(h=s.onUncaughtError),s.onCaughtError!==void 0&&(_=s.onCaughtError),s.onRecoverableError!==void 0&&(T=s.onRecoverableError),s.formState!==void 0&&(j=s.formState)),t=jv(e,1,!0,t,s??null,o,u,j,h,_,T,Hv),t.context=Dv(null),s=t.current,o=rn(),o=jc(o),u=wa(o),u.callback=null,ja(s,u,o),s=o,t.current.lanes=s,Xi(t,s),zn(t),e[Us]=t.current,_d(e),new Lr(t)},Ho.version="19.2.4",Ho}var Zv;function YS(){if(Zv)return Hd.exports;Zv=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),Hd.exports=qS(),Hd.exports}var KS=YS();function Pt(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function ol(n,a){return console.warn(`[ws] Malformed "${n}" message: ${a}`),!1}function ZS(n){return Pt(n)&&typeof n.id=="string"&&typeof n.type=="string"&&typeof n.timestamp=="string"&&Pt(n.payload)}function XS(n){return Pt(n)&&typeof n.id=="string"&&typeof n.displayName=="string"&&typeof n.adapterType=="string"&&typeof n.status=="string"&&typeof n.bootstrapped=="boolean"&&(typeof n.adapterConfig=="string"||n.adapterConfig===void 0)}function QS(n){return{...n,adapterConfig:n.adapterConfig??"{}"}}function Xv(n){return Pt(n)&&typeof n.id=="string"&&typeof n.environmentId=="string"&&typeof n.runtime=="string"&&typeof n.status=="string"&&typeof n.prompt=="string"&&typeof n.startedAt=="string"&&(n.endedAt===void 0||typeof n.endedAt=="string")&&(n.error===void 0||typeof n.error=="string")}function Qv(n){return Pt(n)&&typeof n.sessionId=="string"&&typeof n.eventType=="string"&&typeof n.timestamp=="string"&&typeof n.content=="string"&&(n.raw===void 0||typeof n.raw=="string")}function WS(n){return Pt(n)&&typeof n.id=="string"&&typeof n.name=="string"&&typeof n.description=="string"&&typeof n.repoUrl=="string"&&typeof n.environmentId=="string"&&typeof n.status=="string"&&typeof n.worktreeBasePath=="string"&&typeof n.useWorktrees=="boolean"&&(n.defaultPersonaId===void 0||typeof n.defaultPersonaId=="string")&&typeof n.createdAt=="string"&&typeof n.updatedAt=="string"}function JS(n){return Pt(n)&&typeof n.id=="string"&&(typeof n.workspaceId=="string"||n.workspaceId===void 0)&&typeof n.title=="string"&&typeof n.status=="string"&&typeof n.branch=="string"&&typeof n.sortOrder=="number"&&typeof n.depth=="number"&&(n.defaultPersonaId===void 0||typeof n.defaultPersonaId=="string")&&Array.isArray(n.dependsOn)&&Array.isArray(n.childTaskIds)}function eT(n){return Pt(n)&&typeof n.id=="string"&&typeof n.workspaceId=="string"&&typeof n.taskId=="string"&&typeof n.sessionId=="string"&&typeof n.category=="string"&&typeof n.title=="string"&&typeof n.content=="string"&&Array.isArray(n.tags)&&typeof n.createdAt=="string"}function tT(n){return Pt(n)&&typeof n.name=="string"&&typeof n.tokenType=="string"&&typeof n.envVar=="string"&&typeof n.filePath=="string"&&typeof n.expiresAt=="string"}const nT=new Set(["off","subscription","api_key"]),$d=new Set(["off","on"]);function Wv(n){return Pt(n)&&nT.has(n.claude)&&$d.has(n.github)&&$d.has(n.copilot)&&$d.has(n.codex)}function aT(n){return Pt(n)&&typeof n.name=="string"&&typeof n.repository=="string"&&typeof n.state=="string"&&typeof n.gitStatus=="string"}function sT(n){return Pt(n)&&typeof n.id=="string"&&typeof n.name=="string"&&typeof n.description=="string"&&typeof n.systemPrompt=="string"&&typeof n.toolConfig=="string"&&typeof n.runtime=="string"&&typeof n.model=="string"&&typeof n.maxTurns=="number"&&typeof n.mcpServers=="string"&&typeof n.createdAt=="string"&&typeof n.updatedAt=="string"&&typeof n.type=="string"&&typeof n.script=="string"}function Gn(n,a,i,l){return Array.isArray(n)?n.filter((r,f)=>a(r)?!0:(ol(i,`item at index ${f} in "${l}" has unexpected shape`),!1)):(ol(i,`expected "${l}" to be an array, got ${typeof n}`),[])}function iT(n){let a;try{a=JSON.parse(n)}catch{console.warn("[ws] Failed to parse WebSocket message as JSON");return}if(!Pt(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:Pt(a.payload)?a.payload:{}}:{type:a.type,payload:Pt(a.payload)?a.payload:void 0}}function oT(n){switch(n){case"waiting_input":return"idle";case"killed":return"interrupted";default:return n}}const lT=3e3,Ti=5e3,rT=4001;/**
|
|
26
|
-
* react-router v7.13.1
|
|
27
|
-
*
|
|
28
|
-
* Copyright (c) Remix Software Inc.
|
|
29
|
-
*
|
|
30
|
-
* This source code is licensed under the MIT license found in the
|
|
31
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
32
|
-
*
|
|
33
|
-
* @license MIT
|
|
34
|
-
*/var Jv="popstate";function ey(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function cT(n={}){function a(l,r){var g;let f=(g=r.state)==null?void 0:g.masked,{pathname:d,search:p,hash:m}=f||l.location;return gf("",{pathname:d,search:p,hash:m},r.state&&r.state.usr||null,r.state&&r.state.key||"default",f?{pathname:l.location.pathname,search:l.location.search,hash:l.location.hash}:void 0)}function i(l,r){return typeof r=="string"?r:ll(r)}return dT(a,i,null,n)}function nt(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function Nn(n,a){if(!n){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function uT(){return Math.random().toString(36).substring(2,10)}function ty(n,a){return{usr:n.state,key:n.key,idx:a,masked:n.unstable_mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function gf(n,a,i=null,l,r){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof a=="string"?Ui(a):a,state:i,key:a&&a.key||l||uT(),unstable_mask:r}}function ll({pathname:n="/",search:a="",hash:i=""}){return a&&a!=="?"&&(n+=a.charAt(0)==="?"?a:"?"+a),i&&i!=="#"&&(n+=i.charAt(0)==="#"?i:"#"+i),n}function Ui(n){let a={};if(n){let i=n.indexOf("#");i>=0&&(a.hash=n.substring(i),n=n.substring(0,i));let l=n.indexOf("?");l>=0&&(a.search=n.substring(l),n=n.substring(0,l)),n&&(a.pathname=n)}return a}function dT(n,a,i,l={}){let{window:r=document.defaultView,v5Compat:f=!1}=l,d=r.history,p="POP",m=null,g=y();g==null&&(g=0,d.replaceState({...d.state,idx:g},""));function y(){return(d.state||{idx:null}).idx}function v(){p="POP";let N=y(),E=N==null?null:N-g;g=N,m&&m({action:p,location:k.location,delta:E})}function x(N,E){p="PUSH";let w=ey(N)?N:gf(k.location,N,E);g=y()+1;let D=ty(w,g),A=k.createHref(w.unstable_mask||w);try{d.pushState(D,"",A)}catch(U){if(U instanceof DOMException&&U.name==="DataCloneError")throw U;r.location.assign(A)}f&&m&&m({action:p,location:k.location,delta:1})}function S(N,E){p="REPLACE";let w=ey(N)?N:gf(k.location,N,E);g=y();let D=ty(w,g),A=k.createHref(w.unstable_mask||w);d.replaceState(D,"",A),f&&m&&m({action:p,location:k.location,delta:0})}function C(N){return fT(N)}let k={get action(){return p},get location(){return n(r,d)},listen(N){if(m)throw new Error("A history only accepts one active listener");return r.addEventListener(Jv,v),m=N,()=>{r.removeEventListener(Jv,v),m=null}},createHref(N){return a(r,N)},createURL:C,encodeLocation(N){let E=C(N);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:x,replace:S,go(N){return d.go(N)}};return k}function fT(n,a=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),nt(i,"No window.location.(origin|href) available to create URL");let l=typeof n=="string"?n:ll(n);return l=l.replace(/ $/,"%20"),!a&&l.startsWith("//")&&(l=i+l),new URL(l,i)}function Y0(n,a,i="/"){return hT(n,a,i,!1)}function hT(n,a,i,l){let r=typeof a=="string"?Ui(a):a,f=ga(r.pathname||"/",i);if(f==null)return null;let d=K0(n);pT(d);let p=null;for(let m=0;p==null&&m<d.length;++m){let g=X0(f);p=TT(d[m],g,l)}return p}function K0(n,a=[],i=[],l="",r=!1){let f=(d,p,m=r,g)=>{let y={relativePath:g===void 0?d.path||"":g,caseSensitive:d.caseSensitive===!0,childrenIndex:p,route:d};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(l)&&m)return;nt(y.relativePath.startsWith(l),`Absolute route path "${y.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(l.length)}let v=Pn([l,y.relativePath]),x=i.concat(y);d.children&&d.children.length>0&&(nt(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),K0(d.children,a,x,v,m)),!(d.path==null&&!d.index)&&a.push({path:v,score:_T(v,d.index),routesMeta:x})};return n.forEach((d,p)=>{var m;if(d.path===""||!((m=d.path)!=null&&m.includes("?")))f(d,p);else for(let g of Z0(d.path))f(d,p,!0,g)}),a}function Z0(n){let a=n.split("/");if(a.length===0)return[];let[i,...l]=a,r=i.endsWith("?"),f=i.replace(/\?$/,"");if(l.length===0)return r?[f,""]:[f];let d=Z0(l.join("/")),p=[];return p.push(...d.map(m=>m===""?f:[f,m].join("/"))),r&&p.push(...d),p.map(m=>n.startsWith("/")&&m===""?"/":m)}function pT(n){n.sort((a,i)=>a.score!==i.score?i.score-a.score:ST(a.routesMeta.map(l=>l.childrenIndex),i.routesMeta.map(l=>l.childrenIndex)))}var mT=/^:[\w-]+$/,gT=3,vT=2,yT=1,bT=10,xT=-2,ny=n=>n==="*";function _T(n,a){let i=n.split("/"),l=i.length;return i.some(ny)&&(l+=xT),a&&(l+=vT),i.filter(r=>!ny(r)).reduce((r,f)=>r+(mT.test(f)?gT:f===""?yT:bT),l)}function ST(n,a){return n.length===a.length&&n.slice(0,-1).every((l,r)=>l===a[r])?n[n.length-1]-a[a.length-1]:0}function TT(n,a,i=!1){let{routesMeta:l}=n,r={},f="/",d=[];for(let p=0;p<l.length;++p){let m=l[p],g=p===l.length-1,y=f==="/"?a:a.slice(f.length)||"/",v=rl({path:m.relativePath,caseSensitive:m.caseSensitive,end:g},y),x=m.route;if(!v&&g&&i&&!l[l.length-1].route.index&&(v=rl({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},y)),!v)return null;Object.assign(r,v.params),d.push({params:r,pathname:Pn([f,v.pathname]),pathnameBase:AT(Pn([f,v.pathnameBase])),route:x}),v.pathnameBase!=="/"&&(f=Pn([f,v.pathnameBase]))}return d}function rl(n,a){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[i,l]=CT(n.path,n.caseSensitive,n.end),r=a.match(i);if(!r)return null;let f=r[0],d=f.replace(/(.)\/+$/,"$1"),p=r.slice(1);return{params:l.reduce((g,{paramName:y,isOptional:v},x)=>{if(y==="*"){let C=p[x]||"";d=f.slice(0,f.length-C.length).replace(/(.)\/+$/,"$1")}const S=p[x];return v&&!S?g[y]=void 0:g[y]=(S||"").replace(/%2F/g,"/"),g},{}),pathname:f,pathnameBase:d,pattern:n}}function CT(n,a=!1,i=!0){Nn(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let l=[],r="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,p,m,g,y)=>{if(l.push({paramName:p,isOptional:m!=null}),m){let v=y.charAt(g+d.length);return v&&v!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(l.push({paramName:"*"}),r+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?r+="\\/*$":n!==""&&n!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,a?void 0:"i"),l]}function X0(n){try{return n.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Nn(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),n}}function ga(n,a){if(a==="/")return n;if(!n.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,l=n.charAt(i);return l&&l!=="/"?null:n.slice(i)||"/"}var kT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function ET(n,a="/"){let{pathname:i,search:l="",hash:r=""}=typeof n=="string"?Ui(n):n,f;return i?(i=i.replace(/\/\/+/g,"/"),i.startsWith("/")?f=ay(i.substring(1),"/"):f=ay(i,a)):f=a,{pathname:f,search:wT(l),hash:jT(r)}}function ay(n,a){let i=a.replace(/\/+$/,"").split("/");return n.split("/").forEach(r=>{r===".."?i.length>1&&i.pop():r!=="."&&i.push(r)}),i.length>1?i.join("/"):"/"}function Fd(n,a,i,l){return`Cannot include a '${n}' character in a manually specified \`to.${a}\` field [${JSON.stringify(l)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function NT(n){return n.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function Xf(n){let a=NT(n);return a.map((i,l)=>l===a.length-1?i.pathname:i.pathnameBase)}function gc(n,a,i,l=!1){let r;typeof n=="string"?r=Ui(n):(r={...n},nt(!r.pathname||!r.pathname.includes("?"),Fd("?","pathname","search",r)),nt(!r.pathname||!r.pathname.includes("#"),Fd("#","pathname","hash",r)),nt(!r.search||!r.search.includes("#"),Fd("#","search","hash",r)));let f=n===""||r.pathname==="",d=f?"/":r.pathname,p;if(d==null)p=i;else{let v=a.length-1;if(!l&&d.startsWith("..")){let x=d.split("/");for(;x[0]==="..";)x.shift(),v-=1;r.pathname=x.join("/")}p=v>=0?a[v]:"/"}let m=ET(r,p),g=d&&d!=="/"&&d.endsWith("/"),y=(f||d===".")&&i.endsWith("/");return!m.pathname.endsWith("/")&&(g||y)&&(m.pathname+="/"),m}var Pn=n=>n.join("/").replace(/\/\/+/g,"/"),AT=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),wT=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,jT=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,DT=class{constructor(n,a,i,l=!1){this.status=n,this.statusText=a||"",this.internal=l,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function MT(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function RT(n){return n.map(a=>a.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Q0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function W0(n,a){let i=n;if(typeof i!="string"||!kT.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let l=i,r=!1;if(Q0)try{let f=new URL(window.location.href),d=i.startsWith("//")?new URL(f.protocol+i):new URL(i),p=ga(d.pathname,a);d.origin===f.origin&&p!=null?i=p+d.search+d.hash:r=!0}catch{Nn(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:l,isExternal:r,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var J0=["POST","PUT","PATCH","DELETE"];new Set(J0);var OT=["GET",...J0];new Set(OT);var Vi=b.createContext(null);Vi.displayName="DataRouter";var vc=b.createContext(null);vc.displayName="DataRouterState";var BT=b.createContext(!1),eb=b.createContext({isTransitioning:!1});eb.displayName="ViewTransition";var IT=b.createContext(new Map);IT.displayName="Fetchers";var LT=b.createContext(null);LT.displayName="Await";var hn=b.createContext(null);hn.displayName="Navigation";var gl=b.createContext(null);gl.displayName="Location";var An=b.createContext({outlet:null,matches:[],isDataRoute:!1});An.displayName="Route";var Qf=b.createContext(null);Qf.displayName="RouteError";var tb="REACT_ROUTER_ERROR",zT="REDIRECT",UT="ROUTE_ERROR_RESPONSE";function VT(n){if(n.startsWith(`${tb}:${zT}:{`))try{let a=JSON.parse(n.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function HT(n){if(n.startsWith(`${tb}:${UT}:{`))try{let a=JSON.parse(n.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new DT(a.status,a.statusText,a.data)}catch{}}function GT(n,{relative:a}={}){nt(js(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:l}=b.useContext(hn),{hash:r,pathname:f,search:d}=vl(n,{relative:a}),p=f;return i!=="/"&&(p=f==="/"?i:Pn([i,f])),l.createHref({pathname:p,search:d,hash:r})}function js(){return b.useContext(gl)!=null}function At(){return nt(js(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(gl).location}function Nt(n){nt(js(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:a}=At();return b.useMemo(()=>rl(n,X0(a)),[a,n])}var nb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ab(n){b.useContext(hn).static||b.useLayoutEffect(n)}function yc(){let{isDataRoute:n}=b.useContext(An);return n?aC():PT()}function PT(){nt(js(),"useNavigate() may be used only in the context of a <Router> component.");let n=b.useContext(Vi),{basename:a,navigator:i}=b.useContext(hn),{matches:l}=b.useContext(An),{pathname:r}=At(),f=JSON.stringify(Xf(l)),d=b.useRef(!1);return ab(()=>{d.current=!0}),b.useCallback((m,g={})=>{if(Nn(d.current,nb),!d.current)return;if(typeof m=="number"){i.go(m);return}let y=gc(m,JSON.parse(f),r,g.relative==="path");n==null&&a!=="/"&&(y.pathname=y.pathname==="/"?a:Pn([a,y.pathname])),(g.replace?i.replace:i.push)(y,g.state,g)},[a,i,f,r,n])}var $T=b.createContext(null);function FT(n){let a=b.useContext(An).outlet;return b.useMemo(()=>a&&b.createElement($T.Provider,{value:n},a),[a,n])}function Hi(){let{matches:n}=b.useContext(An),a=n[n.length-1];return a?a.params:{}}function vl(n,{relative:a}={}){let{matches:i}=b.useContext(An),{pathname:l}=At(),r=JSON.stringify(Xf(i));return b.useMemo(()=>gc(n,JSON.parse(r),l,a==="path"),[n,r,l,a])}function qT(n,a){return sb(n,a)}function sb(n,a,i){var N;nt(js(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=b.useContext(hn),{matches:r}=b.useContext(An),f=r[r.length-1],d=f?f.params:{},p=f?f.pathname:"/",m=f?f.pathnameBase:"/",g=f&&f.route;{let E=g&&g.path||"";ob(p,!g||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${E}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
35
|
-
|
|
36
|
-
Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let y=At(),v;if(a){let E=typeof a=="string"?Ui(a):a;nt(m==="/"||((N=E.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 "${E.pathname}" was given in the \`location\` prop.`),v=E}else v=y;let x=v.pathname||"/",S=x;if(m!=="/"){let E=m.replace(/^\//,"").split("/");S="/"+x.replace(/^\//,"").split("/").slice(E.length).join("/")}let C=Y0(n,{pathname:S});Nn(g||C!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Nn(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let k=QT(C&&C.map(E=>Object.assign({},E,{params:Object.assign({},d,E.params),pathname:Pn([m,l.encodeLocation?l.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?m:Pn([m,l.encodeLocation?l.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),r,i);return a&&k?b.createElement(gl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...v},navigationType:"POP"}},k):k}function YT(){let n=nC(),a=MT(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),i=n instanceof Error?n.stack:null,l="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:l},f={padding:"2px 4px",backgroundColor:l},d=null;return console.error("Error handled by React Router default ErrorBoundary:",n),d=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:f},"ErrorBoundary")," or"," ",b.createElement("code",{style:f},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},a),i?b.createElement("pre",{style:r},i):null,d)}var KT=b.createElement(YT,null),ib=class extends b.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,a){return a.location!==n.location||a.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:a.error,location:a.location,revalidation:n.revalidation||a.revalidation}}componentDidCatch(n,a){this.props.onError?this.props.onError(n,a):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const i=HT(n.digest);i&&(n=i)}let a=n!==void 0?b.createElement(An.Provider,{value:this.props.routeContext},b.createElement(Qf.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?b.createElement(ZT,{error:n},a):a}};ib.contextType=BT;var qd=new WeakMap;function ZT({children:n,error:a}){let{basename:i}=b.useContext(hn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let l=VT(a.digest);if(l){let r=qd.get(a);if(r)throw r;let f=W0(l.location,i);if(Q0&&!qd.get(a))if(f.isExternal||l.reloadDocument)window.location.href=f.absoluteURL||f.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:l.replace}));throw qd.set(a,d),d}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return n}function XT({routeContext:n,match:a,children:i}){let l=b.useContext(Vi);return l&&l.static&&l.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=a.route.id),b.createElement(An.Provider,{value:n},i)}function QT(n,a=[],i){let l=i==null?void 0:i.state;if(n==null){if(!l)return null;if(l.errors)n=l.matches;else if(a.length===0&&!l.initialized&&l.matches.length>0)n=l.matches;else return null}let r=n,f=l==null?void 0:l.errors;if(f!=null){let y=r.findIndex(v=>v.route.id&&(f==null?void 0:f[v.route.id])!==void 0);nt(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),r=r.slice(0,Math.min(r.length,y+1))}let d=!1,p=-1;if(i&&l){d=l.renderFallback;for(let y=0;y<r.length;y++){let v=r[y];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(p=y),v.route.id){let{loaderData:x,errors:S}=l,C=v.route.loader&&!x.hasOwnProperty(v.route.id)&&(!S||S[v.route.id]===void 0);if(v.route.lazy||C){i.isStatic&&(d=!0),p>=0?r=r.slice(0,p+1):r=[r[0]];break}}}}let m=i==null?void 0:i.onError,g=l&&m?(y,v)=>{var x,S;m(y,{location:l.location,params:((S=(x=l.matches)==null?void 0:x[0])==null?void 0:S.params)??{},unstable_pattern:RT(l.matches),errorInfo:v})}:void 0;return r.reduceRight((y,v,x)=>{let S,C=!1,k=null,N=null;l&&(S=f&&v.route.id?f[v.route.id]:void 0,k=v.route.errorElement||KT,d&&(p<0&&x===0?(ob("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,N=null):p===x&&(C=!0,N=v.route.hydrateFallbackElement||null)));let E=a.concat(r.slice(0,x+1)),w=()=>{let D;return S?D=k:C?D=N:v.route.Component?D=b.createElement(v.route.Component,null):v.route.element?D=v.route.element:D=y,b.createElement(XT,{match:v,routeContext:{outlet:y,matches:E,isDataRoute:l!=null},children:D})};return l&&(v.route.ErrorBoundary||v.route.errorElement||x===0)?b.createElement(ib,{location:l.location,revalidation:l.revalidation,component:k,error:S,children:w(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:g}):w()},null)}function Wf(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function WT(n){let a=b.useContext(Vi);return nt(a,Wf(n)),a}function JT(n){let a=b.useContext(vc);return nt(a,Wf(n)),a}function eC(n){let a=b.useContext(An);return nt(a,Wf(n)),a}function Jf(n){let a=eC(n),i=a.matches[a.matches.length-1];return nt(i.route.id,`${n} can only be used on routes that contain a unique "id"`),i.route.id}function tC(){return Jf("useRouteId")}function nC(){var l;let n=b.useContext(Qf),a=JT("useRouteError"),i=Jf("useRouteError");return n!==void 0?n:(l=a.errors)==null?void 0:l[i]}function aC(){let{router:n}=WT("useNavigate"),a=Jf("useNavigate"),i=b.useRef(!1);return ab(()=>{i.current=!0}),b.useCallback(async(r,f={})=>{Nn(i.current,nb),i.current&&(typeof r=="number"?await n.navigate(r):await n.navigate(r,{fromRouteId:a,...f}))},[n,a])}var sy={};function ob(n,a,i){!a&&!sy[n]&&(sy[n]=!0,Nn(!1,i))}b.memo(sC);function sC({routes:n,future:a,state:i,isStatic:l,onError:r}){return sb(n,void 0,{state:i,isStatic:l,onError:r})}function Ka({to:n,replace:a,state:i,relative:l}){nt(js(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=b.useContext(hn);Nn(!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:f}=b.useContext(An),{pathname:d}=At(),p=yc(),m=gc(n,Xf(f),d,l==="path"),g=JSON.stringify(m);return b.useEffect(()=>{p(JSON.parse(g),{replace:a,state:i,relative:l})},[p,g,l,a,i]),null}function eh(n){return FT(n.context)}function Be(n){nt(!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 iC({basename:n="/",children:a=null,location:i,navigationType:l="POP",navigator:r,static:f=!1,unstable_useTransitions:d}){nt(!js(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=n.replace(/^\/*/,"/"),m=b.useMemo(()=>({basename:p,navigator:r,static:f,unstable_useTransitions:d,future:{}}),[p,r,f,d]);typeof i=="string"&&(i=Ui(i));let{pathname:g="/",search:y="",hash:v="",state:x=null,key:S="default",unstable_mask:C}=i,k=b.useMemo(()=>{let N=ga(g,p);return N==null?null:{location:{pathname:N,search:y,hash:v,state:x,key:S,unstable_mask:C},navigationType:l}},[p,g,y,v,x,S,l,C]);return Nn(k!=null,`<Router basename="${p}"> is not able to match the URL "${g}${y}${v}" because it does not start with the basename, so the <Router> won't render anything.`),k==null?null:b.createElement(hn.Provider,{value:m},b.createElement(gl.Provider,{children:a,value:k}))}function oC({children:n,location:a}){return qT(vf(n),a)}function vf(n,a=[]){let i=[];return b.Children.forEach(n,(l,r)=>{if(!b.isValidElement(l))return;let f=[...a,r];if(l.type===b.Fragment){i.push.apply(i,vf(l.props.children,f));return}nt(l.type===Be,`[${typeof l.type=="string"?l.type:l.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),nt(!l.props.index||!l.props.children,"An index route cannot have child routes.");let d={id:l.props.id||f.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,middleware:l.props.middleware,loader:l.props.loader,action:l.props.action,hydrateFallbackElement:l.props.hydrateFallbackElement,HydrateFallback:l.props.HydrateFallback,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.hasErrorBoundary===!0||l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(d.children=vf(l.props.children,f)),i.push(d)}),i}var Xr="get",Qr="application/x-www-form-urlencoded";function bc(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function lC(n){return bc(n)&&n.tagName.toLowerCase()==="button"}function rC(n){return bc(n)&&n.tagName.toLowerCase()==="form"}function cC(n){return bc(n)&&n.tagName.toLowerCase()==="input"}function uC(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function dC(n,a){return n.button===0&&(!a||a==="_self")&&!uC(n)}function yf(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((a,i)=>{let l=n[i];return a.concat(Array.isArray(l)?l.map(r=>[i,r]):[[i,l]])},[]))}function fC(n,a){let i=yf(n);return a&&a.forEach((l,r)=>{i.has(r)||a.getAll(r).forEach(f=>{i.append(r,f)})}),i}var Vr=null;function hC(){if(Vr===null)try{new FormData(document.createElement("form"),0),Vr=!1}catch{Vr=!0}return Vr}var pC=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Yd(n){return n!=null&&!pC.has(n)?(Nn(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Qr}"`),null):n}function mC(n,a){let i,l,r,f,d;if(rC(n)){let p=n.getAttribute("action");l=p?ga(p,a):null,i=n.getAttribute("method")||Xr,r=Yd(n.getAttribute("enctype"))||Qr,f=new FormData(n)}else if(lC(n)||cC(n)&&(n.type==="submit"||n.type==="image")){let p=n.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=n.getAttribute("formaction")||p.getAttribute("action");if(l=m?ga(m,a):null,i=n.getAttribute("formmethod")||p.getAttribute("method")||Xr,r=Yd(n.getAttribute("formenctype"))||Yd(p.getAttribute("enctype"))||Qr,f=new FormData(p,n),!hC()){let{name:g,type:y,value:v}=n;if(y==="image"){let x=g?`${g}.`:"";f.append(`${x}x`,"0"),f.append(`${x}y`,"0")}else g&&f.append(g,v)}}else{if(bc(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=Xr,l=null,r=Qr,d=n}return f&&r==="text/plain"&&(d=f,f=void 0),{action:l,method:i.toLowerCase(),encType:r,formData:f,body:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function th(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function gC(n,a,i,l){let r=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return i?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${l}`:r.pathname=`${r.pathname}.${l}`:r.pathname==="/"?r.pathname=`_root.${l}`:a&&ga(r.pathname,a)==="/"?r.pathname=`${a.replace(/\/$/,"")}/_root.${l}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${l}`,r}async function vC(n,a){if(n.id in a)return a[n.id];try{let i=await import(n.module);return a[n.id]=i,i}catch(i){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function yC(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function bC(n,a,i){let l=await Promise.all(n.map(async r=>{let f=a.routes[r.route.id];if(f){let d=await vC(f,i);return d.links?d.links():[]}return[]}));return TC(l.flat(1).filter(yC).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function iy(n,a,i,l,r,f){let d=(m,g)=>i[g]?m.route.id!==i[g].route.id:!0,p=(m,g)=>{var y;return i[g].pathname!==m.pathname||((y=i[g].route.path)==null?void 0:y.endsWith("*"))&&i[g].params["*"]!==m.params["*"]};return f==="assets"?a.filter((m,g)=>d(m,g)||p(m,g)):f==="data"?a.filter((m,g)=>{var v;let y=l.routes[m.route.id];if(!y||!y.hasLoader)return!1;if(d(m,g)||p(m,g))return!0;if(m.route.shouldRevalidate){let x=m.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:((v=i[0])==null?void 0:v.params)||{},nextUrl:new URL(n,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function xC(n,a,{includeHydrateFallback:i}={}){return _C(n.map(l=>{let r=a.routes[l.route.id];if(!r)return[];let f=[r.module];return r.clientActionModule&&(f=f.concat(r.clientActionModule)),r.clientLoaderModule&&(f=f.concat(r.clientLoaderModule)),i&&r.hydrateFallbackModule&&(f=f.concat(r.hydrateFallbackModule)),r.imports&&(f=f.concat(r.imports)),f}).flat(1))}function _C(n){return[...new Set(n)]}function SC(n){let a={},i=Object.keys(n).sort();for(let l of i)a[l]=n[l];return a}function TC(n,a){let i=new Set;return new Set(a),n.reduce((l,r)=>{let f=JSON.stringify(SC(r));return i.has(f)||(i.add(f),l.push({key:f,link:r})),l},[])}function lb(){let n=b.useContext(Vi);return th(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function CC(){let n=b.useContext(vc);return th(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var nh=b.createContext(void 0);nh.displayName="FrameworkContext";function rb(){let n=b.useContext(nh);return th(n,"You must render this element inside a <HydratedRouter> element"),n}function kC(n,a){let i=b.useContext(nh),[l,r]=b.useState(!1),[f,d]=b.useState(!1),{onFocus:p,onBlur:m,onMouseEnter:g,onMouseLeave:y,onTouchStart:v}=a,x=b.useRef(null);b.useEffect(()=>{if(n==="render"&&d(!0),n==="viewport"){let k=E=>{E.forEach(w=>{d(w.isIntersecting)})},N=new IntersectionObserver(k,{threshold:.5});return x.current&&N.observe(x.current),()=>{N.disconnect()}}},[n]),b.useEffect(()=>{if(l){let k=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(k)}}},[l]);let S=()=>{r(!0)},C=()=>{r(!1),d(!1)};return i?n!=="intent"?[f,x,{}]:[f,x,{onFocus:Go(p,S),onBlur:Go(m,C),onMouseEnter:Go(g,S),onMouseLeave:Go(y,C),onTouchStart:Go(v,S)}]:[!1,x,{}]}function Go(n,a){return i=>{n&&n(i),i.defaultPrevented||a(i)}}function EC({page:n,...a}){let{router:i}=lb(),l=b.useMemo(()=>Y0(i.routes,n,i.basename),[i.routes,n,i.basename]);return l?b.createElement(AC,{page:n,matches:l,...a}):null}function NC(n){let{manifest:a,routeModules:i}=rb(),[l,r]=b.useState([]);return b.useEffect(()=>{let f=!1;return bC(n,a,i).then(d=>{f||r(d)}),()=>{f=!0}},[n,a,i]),l}function AC({page:n,matches:a,...i}){let l=At(),{future:r,manifest:f,routeModules:d}=rb(),{basename:p}=lb(),{loaderData:m,matches:g}=CC(),y=b.useMemo(()=>iy(n,a,g,f,l,"data"),[n,a,g,f,l]),v=b.useMemo(()=>iy(n,a,g,f,l,"assets"),[n,a,g,f,l]),x=b.useMemo(()=>{if(n===l.pathname+l.search+l.hash)return[];let k=new Set,N=!1;if(a.forEach(w=>{var A;let D=f.routes[w.route.id];!D||!D.hasLoader||(!y.some(U=>U.route.id===w.route.id)&&w.route.id in m&&((A=d[w.route.id])!=null&&A.shouldRevalidate)||D.hasClientLoader?N=!0:k.add(w.route.id))}),k.size===0)return[];let E=gC(n,p,r.unstable_trailingSlashAwareDataRequests,"data");return N&&k.size>0&&E.searchParams.set("_routes",a.filter(w=>k.has(w.route.id)).map(w=>w.route.id).join(",")),[E.pathname+E.search]},[p,r.unstable_trailingSlashAwareDataRequests,m,l,f,y,a,n,d]),S=b.useMemo(()=>xC(v,f),[v,f]),C=NC(v);return b.createElement(b.Fragment,null,x.map(k=>b.createElement("link",{key:k,rel:"prefetch",as:"fetch",href:k,...i})),S.map(k=>b.createElement("link",{key:k,rel:"modulepreload",href:k,...i})),C.map(({key:k,link:N})=>b.createElement("link",{key:k,nonce:i.nonce,...N,crossOrigin:N.crossOrigin??i.crossOrigin})))}function wC(...n){return a=>{n.forEach(i=>{typeof i=="function"?i(a):i!=null&&(i.current=a)})}}var jC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{jC&&(window.__reactRouterVersion="7.13.1")}catch{}function DC({basename:n,children:a,unstable_useTransitions:i,window:l}){let r=b.useRef();r.current==null&&(r.current=cT({window:l,v5Compat:!0}));let f=r.current,[d,p]=b.useState({action:f.action,location:f.location}),m=b.useCallback(g=>{i===!1?p(g):b.startTransition(()=>p(g))},[i]);return b.useLayoutEffect(()=>f.listen(m),[f,m]),b.createElement(iC,{basename:n,children:a,location:d.location,navigationType:d.action,navigator:f,unstable_useTransitions:i})}var cb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ah=b.forwardRef(function({onClick:a,discover:i="render",prefetch:l="none",relative:r,reloadDocument:f,replace:d,unstable_mask:p,state:m,target:g,to:y,preventScrollReset:v,viewTransition:x,unstable_defaultShouldRevalidate:S,...C},k){let{basename:N,navigator:E,unstable_useTransitions:w}=b.useContext(hn),D=typeof y=="string"&&cb.test(y),A=W0(y,N);y=A.to;let U=GT(y,{relative:r}),Y=At(),F=null;if(p){let te=gc(p,[],Y.unstable_mask?Y.unstable_mask.pathname:"/",!0);N!=="/"&&(te.pathname=te.pathname==="/"?N:Pn([N,te.pathname])),F=E.createHref(te)}let[O,Z,ee]=kC(l,C),ie=BC(y,{replace:d,unstable_mask:p,state:m,target:g,preventScrollReset:v,relative:r,viewTransition:x,unstable_defaultShouldRevalidate:S,unstable_useTransitions:w});function R(te){a&&a(te),te.defaultPrevented||ie(te)}let ae=!(A.isExternal||f),X=b.createElement("a",{...C,...ee,href:(ae?F:void 0)||A.absoluteURL||U,onClick:ae?R:a,ref:wC(k,Z),target:g,"data-discover":!D&&i==="render"?"true":void 0});return O&&!D?b.createElement(b.Fragment,null,X,b.createElement(EC,{page:U})):X});ah.displayName="Link";var MC=b.forwardRef(function({"aria-current":a="page",caseSensitive:i=!1,className:l="",end:r=!1,style:f,to:d,viewTransition:p,children:m,...g},y){let v=vl(d,{relative:g.relative}),x=At(),S=b.useContext(vc),{navigator:C,basename:k}=b.useContext(hn),N=S!=null&&VC(v)&&p===!0,E=C.encodeLocation?C.encodeLocation(v).pathname:v.pathname,w=x.pathname,D=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;i||(w=w.toLowerCase(),D=D?D.toLowerCase():null,E=E.toLowerCase()),D&&k&&(D=ga(D,k)||D);const A=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let U=w===E||!r&&w.startsWith(E)&&w.charAt(A)==="/",Y=D!=null&&(D===E||!r&&D.startsWith(E)&&D.charAt(E.length)==="/"),F={isActive:U,isPending:Y,isTransitioning:N},O=U?a:void 0,Z;typeof l=="function"?Z=l(F):Z=[l,U?"active":null,Y?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let ee=typeof f=="function"?f(F):f;return b.createElement(ah,{...g,"aria-current":O,className:Z,ref:y,style:ee,to:d,viewTransition:p},typeof m=="function"?m(F):m)});MC.displayName="NavLink";var RC=b.forwardRef(({discover:n="render",fetcherKey:a,navigate:i,reloadDocument:l,replace:r,state:f,method:d=Xr,action:p,onSubmit:m,relative:g,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:x,...S},C)=>{let{unstable_useTransitions:k}=b.useContext(hn),N=zC(),E=UC(p,{relative:g}),w=d.toLowerCase()==="get"?"get":"post",D=typeof p=="string"&&cb.test(p),A=U=>{if(m&&m(U),U.defaultPrevented)return;U.preventDefault();let Y=U.nativeEvent.submitter,F=(Y==null?void 0:Y.getAttribute("formmethod"))||d,O=()=>N(Y||U.currentTarget,{fetcherKey:a,method:F,navigate:i,replace:r,state:f,relative:g,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:x});k&&i!==!1?b.startTransition(()=>O()):O()};return b.createElement("form",{ref:C,method:w,action:E,onSubmit:l?m:A,...S,"data-discover":!D&&n==="render"?"true":void 0})});RC.displayName="Form";function OC(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ub(n){let a=b.useContext(Vi);return nt(a,OC(n)),a}function BC(n,{target:a,replace:i,unstable_mask:l,state:r,preventScrollReset:f,relative:d,viewTransition:p,unstable_defaultShouldRevalidate:m,unstable_useTransitions:g}={}){let y=yc(),v=At(),x=vl(n,{relative:d});return b.useCallback(S=>{if(dC(S,a)){S.preventDefault();let C=i!==void 0?i:ll(v)===ll(x),k=()=>y(n,{replace:C,unstable_mask:l,state:r,preventScrollReset:f,relative:d,viewTransition:p,unstable_defaultShouldRevalidate:m});g?b.startTransition(()=>k()):k()}},[v,y,x,i,l,r,a,n,f,d,p,m,g])}function db(n){Nn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let a=b.useRef(yf(n)),i=b.useRef(!1),l=At(),r=b.useMemo(()=>fC(l.search,i.current?null:a.current),[l.search]),f=yc(),d=b.useCallback((p,m)=>{const g=yf(typeof p=="function"?p(new URLSearchParams(r)):p);i.current=!0,f("?"+g,m)},[f,r]);return[r,d]}var IC=0,LC=()=>`__${String(++IC)}__`;function zC(){let{router:n}=ub("useSubmit"),{basename:a}=b.useContext(hn),i=tC(),l=n.fetch,r=n.navigate;return b.useCallback(async(f,d={})=>{let{action:p,method:m,encType:g,formData:y,body:v}=mC(f,a);if(d.navigate===!1){let x=d.fetcherKey||LC();await l(x,i,d.action||p,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:y,body:v,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:y,body:v,formMethod:d.method||m,formEncType:d.encType||g,replace:d.replace,state:d.state,fromRouteId:i,flushSync:d.flushSync,viewTransition:d.viewTransition})},[l,r,a,i])}function UC(n,{relative:a}={}){let{basename:i}=b.useContext(hn),l=b.useContext(An);nt(l,"useFormAction must be used inside a RouteContext");let[r]=l.matches.slice(-1),f={...vl(n||".",{relative:a})},d=At();if(n==null){f.search=d.search;let p=new URLSearchParams(f.search),m=p.getAll("index");if(m.some(y=>y==="")){p.delete("index"),m.filter(v=>v).forEach(v=>p.append("index",v));let y=p.toString();f.search=y?`?${y}`:""}}return(!n||n===".")&&r.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(f.pathname=f.pathname==="/"?i:Pn([i,f.pathname])),ll(f)}function VC(n,{relative:a}={}){let i=b.useContext(eb);nt(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:l}=ub("useViewTransitionState"),r=vl(n,{relative:a});if(!i.isTransitioning)return!1;let f=ga(i.currentLocation.pathname,l)||i.currentLocation.pathname,d=ga(i.nextLocation.pathname,l)||i.nextLocation.pathname;return rl(r.pathname,d)!=null||rl(r.pathname,f)!=null}function Ut(){const n=yc();return b.useCallback((a,i)=>{typeof a=="number"?n(a):n(a,i)},[n])}function fb(n){return`/sessions/${encodeURIComponent(n)}`}function Ri(n){return`/workspaces/${encodeURIComponent(n)}`}function va(n,a,i){const l=encodeURIComponent(n),r=i?`/workspaces/${encodeURIComponent(i)}/tasks/${l}`:`/tasks/${l}`;return a?`${r}/${a}`:r}function HC(n,a){return a?`/workspaces/${encodeURIComponent(a)}/tasks/${encodeURIComponent(n)}/edit`:`/tasks/${encodeURIComponent(n)}/edit`}function Gi(n,a){const i=new URLSearchParams;n&&i.set("workspace",n),a&&i.set("parent",a);const l=i.toString();return l?`/tasks/new?${l}`:"/tasks/new"}function hb(n){return`/sessions/new?${new URLSearchParams({env:n}).toString()}`}const cl="/environments",GC="/environments/new";function bf(n){return`/environments/${encodeURIComponent(n)}`}function PC(n){return`/environments/${encodeURIComponent(n)}/edit`}const Jo="/settings",$C="/settings/credentials",FC="/pair",qC="/chat",yl="/",YC="/tasks";function KC(n,a){const i=typeof window<"u"?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`:"ws://localhost:3000",l=b.useRef(void 0),[r,f]=b.useState(!1),d=b.useRef(a.onMessage);d.current=a.onMessage;const p=b.useRef(a.onConnect);p.current=a.onConnect;const m=b.useRef(a.onDisconnect);m.current=a.onDisconnect;const g=b.useCallback(y=>{var v;((v=l.current)==null?void 0:v.readyState)===WebSocket.OPEN&&l.current.send(JSON.stringify(y))},[]);return b.useEffect(()=>{let y,v;function x(){y=new WebSocket(i),l.current=y,y.onopen=()=>{f(!0),p.current(g)},y.onmessage=S=>{if(typeof S.data!="string"){console.warn("[ws] Received non-string WebSocket message; ignoring");return}const C=iT(S.data);C&&d.current(C)},y.onclose=S=>{var C;if(f(!1),l.current=void 0,(C=m.current)==null||C.call(m),clearTimeout(v),S.code===rT){window.location.href=FC;return}v=setTimeout(x,lT)},y.onerror=()=>{y.close()}}return x(),()=>{clearTimeout(v),y==null||y.close()}},[i,g]),{connected:r,send:g}}const ZC=5e3;function XC(n){const[a,i]=b.useState([]),[l,r]=b.useState({}),f=b.useCallback(x=>{switch(x.type){case"environment.added":return!0;case"environment.removed":{const S=x.payload.environmentId;return S&&(i(C=>C.filter(k=>k.id!==S)),r(C=>{const k={...C};return delete k[S],k})),n({type:"list_sessions"}),!0}case"environment.changed":return n({type:"list_environments"}),!0;case"environment.provision_progress":{const S=x.payload;if(typeof S.environmentId!="string"||typeof S.stage!="string"||typeof S.message!="string"||typeof S.progress!="number")return ol("environment.provision_progress","invalid payload"),!0;if(r(C=>({...C,[S.environmentId]:{stage:S.stage,message:S.message,progress:S.progress}})),S.stage==="ready"){const C=S.environmentId;setTimeout(()=>{r(k=>{const N={...k};return delete N[C],N})},ZC)}return!0}default:return!1}},[n]),d=b.useCallback(x=>{var S;switch(x.type){case"environments":return i(Gn((S=x.payload)==null?void 0:S.environments,XS,"environments","environments").map(QS)),!0;default:return!1}},[]),p=b.useCallback((x,S,C)=>{n({type:"add_environment",payload:{displayName:x,adapterType:S,adapterConfig:C||{}}})},[n]),m=b.useCallback((x,S)=>{const C={environmentId:x,...S};n({type:"update_environment",payload:C})},[n]),g=b.useCallback(x=>{n({type:"provision_environment",payload:{environmentId:x}})},[n]),y=b.useCallback(x=>{n({type:"stop_environment",payload:{environmentId:x}})},[n]),v=b.useCallback(x=>{n({type:"remove_environment",payload:{environmentId:x}})},[n]);return{environments:a,provisionStatus:l,addEnvironment:p,updateEnvironment:m,provisionEnvironment:g,stopEnvironment:y,removeEnvironment:v,handleMessage:d,handleEvent:f}}const Kd=new Set(["pending","running","idle"]),QC=new Set(["completed","failed","interrupted","hibernating","suspended"]),oy=["pending","running","idle"];function WC(n){const[a,i]=b.useState([]),[l,r]=b.useState([]),[f,d]=b.useState(0),[p,m]=b.useState(void 0),[g,y]=b.useState({}),v=b.useCallback(w=>{var D,A,U,Y,F;switch(w.type){case"sessions":return i(O=>{var ie;const Z=Gn((ie=w.payload)==null?void 0:ie.sessions,Xv,"sessions","sessions"),ee=new Map(O.map(R=>[R.id,R.status]));return Z.map(R=>{const ae=ee.get(R.id);return!ae||ae===R.status?R:QC.has(ae)&&Kd.has(R.status)?{...R,status:ae}:Kd.has(ae)&&Kd.has(R.status)&&oy.indexOf(ae)>oy.indexOf(R.status)?{...R,status:ae}:R})}),!0;case"session_event":{if(!Qv(w.payload))return ol("session_event","payload is not a valid SessionEvent"),!0;const O=w.payload;let Z=0;if(r(ee=>{const ie=[...ee,O];return ie.length>Ti?(Z=ie.length-Ti,ie.slice(-Ti)):ie}),Z>0&&d(ee=>ee+Z),O.eventType==="usage")try{const ee=JSON.parse(O.content),ie=Number(ee.input_tokens)||0,R=Number(ee.output_tokens)||0,ae=Number(ee.cost_usd)||0;(ie>0||R>0||ae>0)&&i(X=>X.map(te=>te.id===O.sessionId?{...te,inputTokens:(te.inputTokens??0)+ie,outputTokens:(te.outputTokens??0)+R,costUsd:(te.costUsd??0)+ae}:te))}catch{}if(O.eventType==="status"){const ee=oT(O.content);i(ie=>ie.some(ae=>ae.id===O.sessionId)?ie.map(ae=>ae.id===O.sessionId?{...ae,status:ee}:ae):[...ie,{id:O.sessionId,environmentId:"",runtime:"",status:ee,prompt:"",startedAt:O.timestamp}])}return!0}case"session_events":{const O=Gn((D=w.payload)==null?void 0:D.events,Qv,"session_events","events"),Z=(A=w.payload)==null?void 0:A.sessionId;if(typeof Z!="string")return ol("session_events","missing or non-string sessionId"),!0;if(O.length>0){let ee=0;r(ie=>{const R=new Set;for(const te of ie)te.sessionId===Z&&R.add(`${te.timestamp}|${te.eventType}`);const ae=O.filter(te=>!R.has(`${te.timestamp}|${te.eventType}`)),X=[...ie,...ae].sort((te,V)=>te.sessionId!==V.sessionId?0:te.timestamp.localeCompare(V.timestamp));return X.length>Ti?(ee=X.length-Ti,X.slice(-Ti)):X}),ee>0&&d(ie=>ie+ee)}return!0}case"spawned":{const O=(U=w.payload)==null?void 0:U.sessionId;return typeof O=="string"&&O&&m(O),n({type:"list_sessions"}),!0}case"task_sessions":{const O=(Y=w.payload)==null?void 0:Y.taskId;if(typeof O!="string"||!O)return!0;const Z=Gn((F=w.payload)==null?void 0:F.sessions,Xv,"task_sessions","sessions");return y(ee=>({...ee,[O]:Z})),!0}default:return!1}},[n]),x=b.useCallback((w,D,A,U)=>{n({type:"spawn",payload:{environmentId:w,prompt:D,personaId:A||"",worktreeBasePath:U||""}})},[n]),S=b.useCallback((w,D)=>{n({type:"send_input",payload:{sessionId:w,text:D}})},[n]),C=b.useCallback(w=>{n({type:"kill",payload:{sessionId:w}})},[n]),k=b.useCallback(w=>{n({type:"get_session_events",payload:{sessionId:w}})},[n]),N=b.useCallback(()=>{r([]),d(0)},[]),E=b.useCallback(w=>{n({type:"get_task_sessions",payload:{taskId:w}})},[n]);return{sessions:a,events:l,eventsDropped:f,lastSpawnedId:p,taskSessions:g,spawn:x,sendInput:S,kill:C,loadSessionEvents:k,clearEvents:N,loadTaskSessions:E,handleMessage:v}}function JC(n){const[a,i]=b.useState([]),[l,r]=b.useState(!1),f=b.useCallback(v=>{switch(v.type){case"workspace.created":return r(!1),n({type:"list_workspaces"}),!0;case"workspace.archived":case"workspace.updated":return n({type:"list_workspaces"}),!0;default:return!1}},[n]),d=b.useCallback(v=>{var x;switch(v.type){case"workspaces":return i(Gn((x=v.payload)==null?void 0:x.workspaces,WS,"workspaces","workspaces")),!0;default:return!1}},[]),p=b.useCallback(()=>{r(!1)},[]),m=b.useCallback((v,x,S,C,k)=>{r(!0),n({type:"create_workspace",payload:{name:v,description:x||"",repoUrl:S||"",environmentId:C||"",defaultPersonaId:k||""}})},[n]),g=b.useCallback(v=>{n({type:"archive_workspace",payload:{workspaceId:v}})},[n]),y=b.useCallback((v,x)=>{n({type:"update_workspace",payload:{workspaceId:v,...x}})},[n]);return{workspaces:a,workspaceCreating:l,createWorkspace:m,archiveWorkspace:g,updateWorkspace:y,handleMessage:d,handleEvent:f,onDisconnect:p}}const ek=15e3;function tk(n){const[a,i]=b.useState([]),[l,r]=b.useState(void 0),f=b.useRef(new Map),d=b.useCallback(w=>{const D=w.payload;switch(w.type){case"task.created":{const A=typeof D.requestId=="string"?D.requestId:"";if(A){const Y=f.current.get(A);Y&&(clearTimeout(Y.timer),f.current.delete(A),Y.onSuccess())}const U=typeof D.workspaceId=="string"?D.workspaceId:"";return U&&n({type:"list_tasks",payload:{workspaceId:U}}),!0}case"task.started":{const A=typeof D.taskId=="string"?D.taskId:"",U=typeof D.sessionId=="string"?D.sessionId:"",Y=typeof D.workspaceId=="string"?D.workspaceId:"";return r(F=>A&&F===A?void 0:F),U&&(n({type:"list_sessions"}),A&&i(F=>F.map(O=>O.id===A?{...O,latestSessionId:U}:O))),Y?n({type:"list_tasks",payload:{workspaceId:Y}}):A&&i(F=>{const O=F.find(Z=>Z.id===A);return O!=null&&O.workspaceId?n({type:"list_tasks",payload:{workspaceId:O.workspaceId}}):n({type:"list_tasks",payload:{}}),F}),!0}case"task.completed":case"task.deleted":case"task.updated":{const A=typeof D.workspaceId=="string"?D.workspaceId:"",U=typeof D.taskId=="string"?D.taskId:"";return A?n({type:"list_tasks",payload:{workspaceId:A}}):U&&i(Y=>{const F=Y.find(O=>O.id===U);return F!=null&&F.workspaceId?n({type:"list_tasks",payload:{workspaceId:F.workspaceId}}):n({type:"list_tasks",payload:{}}),Y}),!0}default:return!1}},[n]),p=b.useCallback(w=>{var D,A,U,Y;switch(w.type){case"tasks":{const F=Gn((D=w.payload)==null?void 0:D.tasks,JS,"tasks","tasks"),O=typeof((A=w.payload)==null?void 0:A.workspaceId)=="string"&&w.payload.workspaceId?w.payload.workspaceId:"";return O?(i(Z=>[...Z.filter(ee=>ee.workspaceId!==O),...F]),!0):(i(Z=>{const ee=new Set(F.map(ie=>ie.id));return[...Z.filter(ie=>!ee.has(ie.id)),...F]}),!0)}case"create_task_error":{const F=typeof((U=w.payload)==null?void 0:U.requestId)=="string"?w.payload.requestId:"",O=typeof((Y=w.payload)==null?void 0:Y.message)=="string"?w.payload.message:"Failed to create task";if(F){const Z=f.current.get(F);Z?(clearTimeout(Z.timer),f.current.delete(F),Z.onError(O)):console.error("[useTasks] create_task_error with unknown requestId:",O)}else console.error("[useTasks] create_task_error:",O);return!0}default:return!1}},[]),m=b.useCallback(()=>{r(void 0);for(const[,w]of f.current)clearTimeout(w.timer),w.onError("Disconnected");f.current.clear()},[]),g=b.useCallback(w=>{n({type:"list_tasks",payload:{workspaceId:w}})},[n]),y=b.useCallback(()=>{n({type:"list_tasks",payload:{}})},[n]),v=b.useCallback((w,D,A,U,Y,F,O,Z,ee)=>{const ie={workspaceId:w,title:D,description:A||"",dependsOn:U||[],parentTaskId:Y||"",defaultPersonaId:F||"",canDecompose:O||!1};if(Z||ee){const R=crypto.randomUUID();ie.requestId=R;const ae=ee??(()=>{}),X=setTimeout(()=>{f.current.delete(R)&&ae("Request timed out")},ek);f.current.set(R,{onSuccess:Z??(()=>{}),onError:ae,timer:X})}n({type:"create_task",payload:ie})},[n]),x=b.useCallback((w,D,A,U)=>{r(w),n({type:"start_task",payload:{taskId:w,personaId:D||"",environmentId:A||"",notes:U||""}})},[n]),S=b.useCallback(w=>{n({type:"stop_task",payload:{taskId:w}})},[n]),C=b.useCallback(w=>{n({type:"complete_task",payload:{taskId:w}})},[n]),k=b.useCallback(w=>{n({type:"resume_task",payload:{taskId:w}})},[n]),N=b.useCallback((w,D,A,U,Y)=>{const F={taskId:w,title:D,description:A,dependsOn:U};Y!==void 0&&(F.defaultPersonaId=Y),n({type:"update_task",payload:F})},[n]),E=b.useCallback(w=>{n({type:"delete_task",payload:{taskId:w}})},[n]);return{tasks:a,taskStartingId:l,loadTasks:g,loadAllTasks:y,createTask:v,startTask:x,stopTask:S,completeTask:C,resumeTask:k,updateTask:N,deleteTask:E,handleMessage:p,handleEvent:d,onDisconnect:m}}function nk(n){const[a,i]=b.useState([]),l=b.useCallback(p=>{if(p.type==="finding.posted"){const m=typeof p.payload.workspaceId=="string"?p.payload.workspaceId:"";return m&&n({type:"list_findings",payload:{workspaceId:m}}),!0}return!1},[n]),r=b.useCallback(p=>{var m;switch(p.type){case"findings":return i(Gn((m=p.payload)==null?void 0:m.findings,eT,"findings","findings")),!0;default:return!1}},[]),f=b.useCallback(p=>{n({type:"list_findings",payload:{workspaceId:p}})},[n]),d=b.useCallback((p,m,g,y,v)=>{n({type:"post_finding",payload:{workspaceId:p,title:m,content:g,category:y||"general",tags:v||[]}})},[n]);return{findings:a,loadFindings:f,postFinding:d,handleMessage:r,handleEvent:l}}function ak(n){const[a,i]=b.useState([]),l=b.useCallback(m=>m.type==="token.changed"?(n({type:"list_tokens"}),!0):!1,[n]),r=b.useCallback(m=>{var g;switch(m.type){case"tokens":return i(Gn((g=m.payload)==null?void 0:g.tokens,tT,"tokens","tokens")),!0;default:return!1}},[]),f=b.useCallback(()=>{n({type:"list_tokens"})},[n]),d=b.useCallback((m,g,y,v,x)=>{n({type:"set_token",payload:{name:m,value:g,tokenType:y,envVar:v,filePath:x}})},[n]),p=b.useCallback(m=>{n({type:"delete_token",payload:{name:m}})},[n]);return{tokens:a,loadTokens:f,setToken:d,deleteToken:p,handleMessage:r,handleEvent:l}}function sk(n){const[a,i]=b.useState({claude:"off",github:"off",copilot:"off",codex:"off"}),l=b.useCallback(d=>d.type==="credential.providers_changed"?(Wv(d.payload)&&i(d.payload),!0):!1,[]),r=b.useCallback(d=>{switch(d.type){case"credential_providers":return Wv(d.payload)&&i(d.payload),!0;default:return!1}},[]),f=b.useCallback(d=>{n({type:"set_credential_providers",payload:d})},[n]);return{credentialProviders:a,updateCredentialProviders:f,handleMessage:r,handleEvent:l}}function ik(n,a){const[i,l]=b.useState([]),[r,f]=b.useState(""),[d,p]=b.useState(""),[m,g]=b.useState(!1),y=b.useCallback(S=>{var C,k,N;switch(S.type){case"codespaces_list":{const E=Gn((C=S.payload)==null?void 0:C.codespaces,aT,"codespaces_list","codespaces"),w=typeof((k=S.payload)==null?void 0:k.error)=="string"?S.payload.error:"";return l(E),p(w),!0}case"codespace_created":return g(!1),n({type:"list_codespaces"}),!0;case"codespace_create_error":{g(!1);const E=typeof((N=S.payload)==null?void 0:N.message)=="string"?S.payload.message:"Failed to create codespace";return f(E),!0}default:return!1}},[n]),v=b.useCallback(()=>{n({type:"list_codespaces"})},[n]),x=b.useCallback((S,C)=>{if(!a){f("Not connected to server. Please try again once the connection is restored.");return}g(!0),f("");const k={repo:S};C&&(k.machine=C),n({type:"create_codespace",payload:k})},[n,a]);return{codespaces:i,codespaceError:r,codespaceListError:d,codespaceCreating:m,listCodespaces:v,createCodespace:x,handleMessage:y}}function ok(n){const[a,i]=b.useState([]),l=b.useCallback(m=>{switch(m.type){case"persona.created":case"persona.updated":case"persona.deleted":return n({type:"list_personas"}),!0;default:return!1}},[n]),r=b.useCallback(m=>{var g;switch(m.type){case"personas":{const y=Gn((g=m.payload)==null?void 0:g.personas,sT,"personas","personas");return i(y),!0}default:return!1}},[]),f=b.useCallback((m,g,y,v,x,S,C,k)=>{n({type:"create_persona",payload:{name:m,description:g,systemPrompt:y,runtime:v||"",model:x||"",maxTurns:S||0,type:C||"agent",script:k||""}})},[n]),d=b.useCallback((m,g,y,v,x,S,C,k,N)=>{const E={personaId:m};g!==void 0&&(E.name=g),y!==void 0&&(E.description=y),v!==void 0&&(E.systemPrompt=v),x!==void 0&&(E.runtime=x),S!==void 0&&(E.model=S),C!==void 0&&(E.maxTurns=C),k!==void 0&&(E.type=k),N!==void 0&&(E.script=N),n({type:"update_persona",payload:E})},[n]),p=b.useCallback(m=>{n({type:"delete_persona",payload:{personaId:m}})},[n]);return{personas:a,createPersona:f,updatePersona:d,deletePersona:p,handleMessage:r,handleEvent:l}}function lk(n){const[a,i]=b.useState(""),[l,r]=b.useState(void 0),[f,d]=b.useState({}),{connected:p,send:m}=KC(n,{onMessage:O,onConnect:Z,onDisconnect:ee}),g=XC(m),y=WC(m),v=JC(m),x=tk(m),S=nk(m),C=ak(m),k=sk(m),N=ik(m,p),E=ok(m),w="default_persona_id",D="onboarding_completed",A=b.useCallback(R=>{i(R),m({type:"set_setting",payload:{key:w,value:R}})},[m]),U=b.useCallback(()=>{r(!0),m({type:"set_setting",payload:{key:D,value:"true"}})},[m]),Y=b.useCallback((R,ae)=>{m({type:"get_usage",payload:{scope:R,id:ae}})},[m]);function F(R){const ae=R.payload.key,X=R.payload.value;if(R.type==="setting.changed"){ae===w&&i(X??""),ae===D&&r(X==="true");return}g.handleEvent(R)||v.handleEvent(R)||x.handleEvent(R)||S.handleEvent(R)||C.handleEvent(R)||k.handleEvent(R)||E.handleEvent(R)}function O(R){var ae,X,te,V,H;if(ZS(R)){F(R);return}if(R.type==="usage_stats"){const z=((ae=R.payload)==null?void 0:ae.scope)||"",re=((X=R.payload)==null?void 0:X.id)||"";if(z&&re){const B=`${z}:${re}`;d(oe=>{var fe,se,Oe,ot;return{...oe,[B]:{inputTokens:Number((fe=R.payload)==null?void 0:fe.inputTokens)||0,outputTokens:Number((se=R.payload)==null?void 0:se.outputTokens)||0,costUsd:Number((Oe=R.payload)==null?void 0:Oe.costUsd)||0,sessionCount:Number((ot=R.payload)==null?void 0:ot.sessionCount)||0}}})}return}if(R.type==="setting"){const z=(te=R.payload)==null?void 0:te.key,re=(V=R.payload)==null?void 0:V.value;z===w&&i(re??""),z===D&&r(re==="true");return}if(!g.handleMessage(R)&&!y.handleMessage(R)&&!v.handleMessage(R)&&!x.handleMessage(R)&&!S.handleMessage(R)&&!C.handleMessage(R)&&!k.handleMessage(R)&&!N.handleMessage(R)&&!E.handleMessage(R)&&R.type==="error"){console.error("[ws]",(H=R.payload)==null?void 0:H.message);return}}function Z(R){R({type:"list_environments"}),R({type:"list_sessions"}),R({type:"list_workspaces"}),R({type:"list_tokens"}),R({type:"get_credential_providers"}),R({type:"list_personas"}),R({type:"get_setting",payload:{key:w}}),R({type:"get_setting",payload:{key:D}}),R({type:"list_tasks",payload:{}}),R({type:"subscribe_all"})}function ee(){v.onDisconnect(),x.onDisconnect()}const ie=b.useCallback(()=>{m({type:"list_environments"}),m({type:"list_sessions"}),m({type:"list_workspaces"}),m({type:"list_tokens"})},[m]);return{connected:p,environments:g.environments,sessions:y.sessions,events:y.events,eventsDropped:y.eventsDropped,lastSpawnedId:y.lastSpawnedId,workspaces:v.workspaces,tasks:x.tasks,findings:S.findings,tokens:C.tokens,spawn:y.spawn,sendInput:y.sendInput,kill:y.kill,refresh:ie,loadSessionEvents:y.loadSessionEvents,clearEvents:y.clearEvents,createWorkspace:v.createWorkspace,archiveWorkspace:v.archiveWorkspace,updateWorkspace:v.updateWorkspace,loadTasks:x.loadTasks,loadAllTasks:x.loadAllTasks,createTask:x.createTask,startTask:x.startTask,stopTask:x.stopTask,completeTask:x.completeTask,resumeTask:x.resumeTask,updateTask:x.updateTask,deleteTask:x.deleteTask,loadFindings:S.loadFindings,postFinding:S.postFinding,addEnvironment:g.addEnvironment,updateEnvironment:g.updateEnvironment,loadTokens:C.loadTokens,setToken:C.setToken,deleteToken:C.deleteToken,credentialProviders:k.credentialProviders,updateCredentialProviders:k.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:v.workspaceCreating,taskStartingId:x.taskStartingId,personas:E.personas,createPersona:E.createPersona,updatePersona:E.updatePersona,deletePersona:E.deletePersona,taskSessions:y.taskSessions,loadTaskSessions:y.loadTaskSessions,appDefaultPersonaId:a,setAppDefaultPersonaId:A,onboardingCompleted:l,completeOnboarding:U,usageCache:f,loadUsage:Y}}const sh=b.createContext(void 0);function rk({children:n}){const a=lk();return c.jsx(sh.Provider,{value:a,children:n})}function Je(){const n=b.useContext(sh);if(!n)throw new Error("useGrackle must be used within GrackleProvider");return n}const ck=[{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}],uk=[{id:"sess-001-prev",environmentId:"env-local-01",runtime:"claude-code",status:"failed",prompt:"Implement auth middleware",startedAt:"2026-02-26T14:00:00Z",endedAt:"2026-02-26T15:12:00Z",error:"Context window exceeded before completing implementation"},{id:"sess-001",environmentId:"env-local-01",runtime:"node",status:"running",prompt:"Refactor the authentication middleware to use JWT tokens",startedAt:"2026-02-27T08:15:00Z"},{id:"sess-002",environmentId:"env-docker-01",runtime:"python",status:"completed",prompt:"Write unit tests for the user registration endpoint",startedAt:"2026-02-27T07:30:00Z"},{id:"sess-003",environmentId:"env-local-01",runtime:"node",status:"failed",prompt:"Migrate database schema to add audit_log table",startedAt:"2026-02-26T22:45:00Z"},{id:"sess-004",environmentId:"env-docker-01",runtime:"python",status:"running",prompt:"Implement rate limiting for the public API",startedAt:"2026-02-27T09:00:00Z"}],dk=[{sessionId:"sess-001-prev",eventType:"status",timestamp:"2026-02-26T14:00:01Z",content:"running"},{sessionId:"sess-001-prev",eventType:"output",timestamp:"2026-02-26T14:00:05Z",content:"Reading src/middleware/auth.ts to understand the current authentication flow..."},{sessionId:"sess-001-prev",eventType:"error",timestamp:"2026-02-26T15:12:00Z",content:"Context window exceeded before completing implementation"},{sessionId:"sess-001",eventType:"status",timestamp:"2026-02-27T08:15:01Z",content:"running"},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:02Z",content:"Analyzing current authentication middleware in src/middleware/auth.ts..."},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:04Z",content:`Found 3 files using session-based auth:
|
|
37
|
-
- src/middleware/auth.ts
|
|
38
|
-
- src/routes/login.ts
|
|
39
|
-
- src/routes/protected.ts`},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:07Z",content:"Installing jsonwebtoken and @types/jsonwebtoken..."},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:12Z",content:`Rewriting auth middleware:
|
|
40
|
-
\`\`\`typescript
|
|
41
|
-
import jwt from "jsonwebtoken";
|
|
42
|
-
import type { Request, Response, NextFunction } from "express";
|
|
43
|
-
|
|
44
|
-
const JWT_SECRET = process.env.JWT_SECRET || "change-me";
|
|
45
|
-
|
|
46
|
-
export function verifyToken(req: Request, res: Response, next: NextFunction): void {
|
|
47
|
-
const header = req.headers.authorization;
|
|
48
|
-
if (!header?.startsWith("Bearer ")) {
|
|
49
|
-
res.status(401).json({ error: "Missing token" });
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
try {
|
|
53
|
-
const decoded = jwt.verify(header.slice(7), JWT_SECRET);
|
|
54
|
-
req.user = decoded;
|
|
55
|
-
next();
|
|
56
|
-
} catch {
|
|
57
|
-
res.status(403).json({ error: "Invalid token" });
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
\`\`\``},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:18Z",content:"Updated login route to issue JWT tokens with 24h expiry."},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:22Z",content:"Running test suite... 14 tests passed, 2 updated, 0 failed."},{sessionId:"sess-002",eventType:"status",timestamp:"2026-02-27T07:30:01Z",content:"running"},{sessionId:"sess-002",eventType:"output",timestamp:"2026-02-27T07:30:05Z",content:"Generating pytest tests for POST /api/register endpoint..."},{sessionId:"sess-002",eventType:"output",timestamp:"2026-02-27T07:32:00Z",content:"Created 8 test cases covering: valid registration, duplicate email, weak password, missing fields, SQL injection, XSS payload, rate limit, and CORS headers."},{sessionId:"sess-002",eventType:"status",timestamp:"2026-02-27T07:33:00Z",content:"completed"}],fk=[{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"}],hk=[{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:""}],ly=[{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"}],pk=[{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:""}],mk=[{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:""}],gk={"task-001b":[{id:"sess-001-prev",environmentId:"env-local-01",runtime:"claude-code",status:"failed",prompt:"Implement auth middleware",startedAt:"2026-02-26T14:00:00Z"},{id:"sess-001",environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:"Implement auth middleware",startedAt:"2026-02-27T08:15:00Z"}],"task-006c":[{id:"sess-004",environmentId:"env-docker-01",runtime:"claude-code",status:"running",prompt:"Add compression options",startedAt:"2026-02-27T09:00:00Z"}]};function Ct(n){return new Date(Date.now()+n).toISOString()}const ry=[{label:"API Refactor",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Ct(0),content:"running"}},{delayMs:800,event:{eventType:"output",timestamp:Ct(800),content:"Analyzing current API structure in src/routes/..."}},{delayMs:1600,event:{eventType:"output",timestamp:Ct(1600),content:`Found 5 endpoints that need refactoring:
|
|
61
|
-
- GET /api/users
|
|
62
|
-
- POST /api/users
|
|
63
|
-
- GET /api/users/:id
|
|
64
|
-
- PUT /api/users/:id
|
|
65
|
-
- DELETE /api/users/:id`}},{delayMs:2800,event:{eventType:"output",timestamp:Ct(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:Ct(4e3),content:"Running test suite... 22 tests passed, 3 updated, 0 failed."}},{delayMs:5e3,event:{eventType:"status",timestamp:Ct(5e3),content:"completed"}}]},{label:"Database Migration",pauseForInput:!0,pauseAfterStep:3,steps:[{delayMs:0,event:{eventType:"status",timestamp:Ct(0),content:"running"}},{delayMs:600,event:{eventType:"output",timestamp:Ct(600),content:"Scanning current schema for migration targets..."}},{delayMs:1400,event:{eventType:"output",timestamp:Ct(1400),content:`Found tables to modify:
|
|
66
|
-
- users (add column: last_login_at)
|
|
67
|
-
- sessions (add index on expires_at)
|
|
68
|
-
- audit_log (new table)`}},{delayMs:2200,event:{eventType:"output",timestamp:Ct(2200),content:`⚠ This migration will add a NOT NULL column to the users table.
|
|
69
|
-
The table has 50,000+ rows — this may lock the table briefly.
|
|
70
|
-
|
|
71
|
-
Please confirm to proceed.`}}],resumeSteps:[{delayMs:500,event:{eventType:"output",timestamp:Ct(0),content:"Proceeding with migration..."}},{delayMs:1500,event:{eventType:"output",timestamp:Ct(1e3),content:`Migration 001_add_last_login.sql applied successfully.
|
|
72
|
-
Migration 002_sessions_index.sql applied successfully.
|
|
73
|
-
Migration 003_audit_log.sql applied successfully.`}},{delayMs:2500,event:{eventType:"output",timestamp:Ct(2e3),content:"All 3 migrations applied. Running verification queries... OK."}},{delayMs:3200,event:{eventType:"status",timestamp:Ct(2700),content:"completed"}}]},{label:"Test Writer",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Ct(0),content:"running"}},{delayMs:700,event:{eventType:"output",timestamp:Ct(700),content:"Generating test scaffolding for src/services/billing.ts..."}},{delayMs:1800,event:{eventType:"output",timestamp:Ct(1800),content:`Writing test cases:
|
|
74
|
-
- should calculate monthly total
|
|
75
|
-
- should apply discount codes
|
|
76
|
-
- should handle currency conversion
|
|
77
|
-
- should reject expired cards`}},{delayMs:2800,event:{eventType:"output",timestamp:Ct(2800),content:`Error: Cannot resolve import 'src/services/stripe-client.ts' — module not found.
|
|
78
|
-
The billing service depends on a Stripe client that doesn't exist in this environment.`}},{delayMs:3500,event:{eventType:"status",timestamp:Ct(3500),content:"failed"}}]}],cy=400;function vk({children:n}){const[a,i]=b.useState(ck),[l,r]=b.useState(uk),[f,d]=b.useState(dk),[p,m]=b.useState(void 0),[g,y]=b.useState(fk),[v,x]=b.useState(hk),[S,C]=b.useState(ly),[k,N]=b.useState(pk),[E,w]=b.useState({claude:"off",github:"off",copilot:"off",codex:"off"}),[D,A]=b.useState(mk),[U]=b.useState(gk),[Y,F]=b.useState(""),O=b.useRef(0),Z=b.useRef(0),ee=b.useRef(new Set),ie=b.useRef(new Map),R=b.useRef(v);R.current=v;const ae=b.useRef(new Map),X=b.useRef(new Map),te=b.useCallback(W=>(O.current+=1,`mock-${W}-${String(O.current).padStart(3,"0")}`),[]),V=b.useCallback(()=>{const W=ry[Z.current%ry.length];return Z.current+=1,W},[]),H=b.useCallback((W,le,ce)=>{const xe=setTimeout(()=>{var be;ee.current.delete(xe),ce&&((be=ie.current.get(ce))==null||be.delete(xe)),W()},le);ee.current.add(xe),ce&&(ie.current.has(ce)||ie.current.set(ce,new Set),ie.current.get(ce).add(xe))},[]),z=b.useCallback(W=>{const le=ie.current.get(W);le&&(le.forEach(ce=>{clearTimeout(ce),ee.current.delete(ce)}),ie.current.delete(W))},[]),re=b.useCallback((W,le)=>{r(ce=>ce.map(xe=>xe.id===W?{...xe,status:le}:xe))},[]),B=b.useCallback(W=>{d(le=>[...le,W])},[]),oe=b.useCallback((W,le,ce)=>{le.forEach((xe,be)=>{H(()=>{const Ze={sessionId:W,...xe.event,timestamp:new Date().toISOString()};B(Ze),xe.event.eventType==="status"&&re(W,xe.event.content),be===le.length-1&&ce&&ce()},xe.delayMs,W)})},[H,B,re]),fe=b.useCallback((W,le,ce,xe)=>{console.log("[MockGrackle] spawn",{environmentId:W,prompt:le,runtime:xe});const be=te("sess"),Ze={id:be,environmentId:W,runtime:xe||"claude-code",status:"running",prompt:le,startedAt:new Date().toISOString()};r(ht=>[...ht,Ze]),m(be);const Ce=V();if(console.log(`[MockGrackle] Playing scenario: ${Ce.label}`),Ce.pauseForInput){const ht=Ce.pauseAfterStep??Ce.steps.length-1,ke=Ce.steps.slice(0,ht+1),lt=ke.length>0?ke[ke.length-1].delayMs:0;oe(be,ke),H(()=>{re(be,"idle"),B({sessionId:be,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},lt+cy,be),Ce.resumeSteps&&ae.current.set(be,Ce.resumeSteps)}else oe(be,Ce.steps)},[te,V,oe,H,re,B]),se=b.useCallback(W=>{console.log("[MockGrackle] kill",W),z(W),ae.current.delete(W),re(W,"interrupted"),B({sessionId:W,eventType:"status",timestamp:new Date().toISOString(),content:"interrupted"}),x(le=>le.map(ce=>ce.latestSessionId===W&&ce.status==="working"?{...ce,status:"not_started"}:ce))},[z,re,B]),Oe=b.useCallback(()=>{console.log("[MockGrackle] refresh")},[]),ot=b.useCallback(W=>{console.log("[MockGrackle] loadSessionEvents",W)},[]),$t=b.useCallback(()=>{console.log("[MockGrackle] clearEvents"),d([])},[]),Rn=b.useCallback((W,le,ce,xe,be)=>{console.log("[MockGrackle] createWorkspace",{name:W,description:le});const Ze={id:te("proj"),name:W,description:le||"",repoUrl:ce||"",environmentId:xe||"",status:"active",worktreeBasePath:"",useWorktrees:!0,defaultPersonaId:be||"",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};y(Ce=>[...Ce,Ze])},[te]),Yn=b.useCallback(W=>{console.log("[MockGrackle] archiveWorkspace",W),y(le=>le.map(ce=>ce.id===W?{...ce,status:"archived"}:ce))},[]),Jt=b.useCallback(W=>{console.log("[MockGrackle] loadTasks",W)},[]),Te=b.useCallback((W,le,ce,xe,be,Ze,Ce,ht,ke)=>{console.log("[MockGrackle] createTask",{workspaceId:W,title:le,parentTaskId:be}),x(lt=>{const Vt=lt.filter(pn=>pn.workspaceId===W).reduce((pn,_a)=>Math.max(pn,_a.sortOrder),0),en=be?lt.find(pn=>pn.id===be):void 0;if(be&&!en)return console.warn("[MockGrackle] Parent task not found:",be),lt;if(en&&!en.canDecompose)return console.warn("[MockGrackle] Parent task does not have decomposition rights:",be),lt;const It=en?en.depth+1:0,xa={id:te("task"),workspaceId:W,title:le,description:ce||"",status:"not_started",branch:"",latestSessionId:"",dependsOn:xe||[],reviewNotes:void 0,sortOrder:Vt+1,createdAt:new Date().toISOString(),parentTaskId:be||"",depth:It,childTaskIds:[],canDecompose:Ce??!be,defaultPersonaId:Ze||""};return[...lt,xa]}),ht&&ht()},[te]),ct=b.useCallback((W,le,ce,xe)=>{var lt;console.log("[MockGrackle] startTask",{taskId:W});const be=R.current.find(Fe=>Fe.id===W),Ze=(be==null?void 0:be.title)??"",Ce=te("sess"),ht={id:Ce,environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:Ze||W,startedAt:new Date().toISOString()};r(Fe=>[...Fe,ht]),x(Fe=>Fe.map(Vt=>Vt.id===W?{...Vt,status:"working",latestSessionId:Ce,branch:`mock/${W.slice(0,8)}`}:Vt));const ke=V();if(console.log(`[MockGrackle] Playing task scenario: ${ke.label}`),ke.pauseForInput){const Fe=ke.pauseAfterStep??ke.steps.length-1,Vt=ke.steps.slice(0,Fe+1),en=Vt.length>0?Vt[Vt.length-1].delayMs:0;if(oe(Ce,Vt),H(()=>{re(Ce,"idle"),B({sessionId:Ce,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},en+cy,Ce),ke.resumeSteps){const It=[...ke.resumeSteps];ae.current.set(Ce,It);const xa=It.reduce((pn,_a)=>Math.max(pn,_a.delayMs),0);X.current.set(Ce,{taskId:W,delayAfterResume:xa+200})}}else{const Fe=ke.steps.length>0?ke.steps[ke.steps.length-1].delayMs:0;oe(Ce,ke.steps);const Vt=(lt=ke.steps[ke.steps.length-1])==null?void 0:lt.event.content;H(()=>{Vt==="completed"?x(en=>en.map(It=>It.id===W&&It.status==="working"?{...It,status:"paused"}:It)):Vt==="failed"&&x(en=>en.map(It=>It.id===W&&It.status==="working"?{...It,status:"failed"}:It))},Fe+100,Ce)}},[te,V,oe,H,re,B]),Ms=b.useCallback((W,le)=>{console.log("[MockGrackle] sendInput",{sessionId:W,text:le}),B({sessionId:W,eventType:"output",timestamp:new Date().toISOString(),content:`User input: ${le}`}),re(W,"running"),B({sessionId:W,eventType:"status",timestamp:new Date().toISOString(),content:"running"});const ce=ae.current.get(W);if(ce)ae.current.delete(W),oe(W,ce);else{const be=[{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"}}];oe(W,be)}const xe=X.current.get(W);xe&&(X.current.delete(W),H(()=>{x(be=>be.map(Ze=>Ze.id===xe.taskId&&Ze.status==="working"?{...Ze,status:"paused"}:Ze))},xe.delayAfterResume,W))},[B,re,oe,H]),Rs=b.useCallback(W=>{console.log("[MockGrackle] completeTask",W),x(le=>le.map(ce=>ce.id===W?{...ce,status:"complete"}:ce))},[]),On=b.useCallback(W=>{console.log("[MockGrackle] resumeTask",W)},[]),Os=b.useCallback((W,le,ce,xe,be)=>{console.log("[MockGrackle] updateTask",{taskId:W,title:le}),x(Ze=>Ze.map(Ce=>Ce.id===W?{...Ce,title:le.trim()||Ce.title,description:ce,dependsOn:xe,...be!==void 0?{defaultPersonaId:be}:{}}:Ce))},[]),Bs=b.useCallback(W=>{console.log("[MockGrackle] deleteTask",W),x(le=>le.filter(ce=>ce.id!==W))},[]),Tl=b.useCallback(W=>{console.log("[MockGrackle] loadFindings",W),C(ly.filter(le=>le.workspaceId===W))},[]),Ki=b.useCallback((W,le,ce,xe,be)=>{console.log("[MockGrackle] postFinding",{workspaceId:W,title:le});const Ze={id:te("find"),workspaceId:W,taskId:"",sessionId:"",category:xe||"general",title:le,content:ce,tags:be||[],createdAt:new Date().toISOString()};C(Ce=>[...Ce,Ze])},[te]),Is=b.useCallback((W,le,ce)=>{console.log("[MockGrackle] addEnvironment",{displayName:W,adapterType:le,adapterConfig:ce})},[]),Ls=b.useCallback((W,le)=>{console.log("[MockGrackle] updateEnvironment",{environmentId:W,...le}),i(ce=>ce.map(xe=>xe.id!==W?xe:{...xe,...le.displayName!==void 0?{displayName:le.displayName}:{},...le.adapterConfig!==void 0?{adapterConfig:JSON.stringify(le.adapterConfig)}:{}}))},[]),zs=b.useCallback(()=>{console.log("[MockGrackle] loadTokens")},[]),Cl=b.useCallback((W,le,ce,xe,be)=>{console.log("[MockGrackle] setToken",{name:W,tokenType:ce}),N(Ze=>[...Ze.filter(ht=>ht.name!==W),{name:W,tokenType:ce,envVar:xe,filePath:be,expiresAt:""}])},[]),kl=b.useCallback(W=>{console.log("[MockGrackle] deleteToken",W),N(le=>le.filter(ce=>ce.name!==W))},[]),Bt=b.useCallback(W=>{console.log("[MockGrackle] updateCredentialProviders",W),w(W)},[]);b.useEffect(()=>()=>{ee.current.forEach(clearTimeout),ee.current.clear()},[]);const Ac=b.useMemo(()=>({connected:!0,environments:a,sessions:l,events:f,eventsDropped:0,lastSpawnedId:p,workspaces:g,tasks:v,findings:S,tokens:k,credentialProviders:E,spawn:fe,sendInput:Ms,kill:se,refresh:Oe,loadSessionEvents:ot,clearEvents:$t,createWorkspace:Rn,archiveWorkspace:Yn,updateWorkspace:(W,le)=>{console.log("[MockGrackle] updateWorkspace",{workspaceId:W,...le}),y(ce=>ce.map(xe=>xe.id!==W?xe:{...xe,...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:Jt,loadAllTasks:()=>{console.log("[MockGrackle] loadAllTasks")},createTask:Te,startTask:ct,stopTask:W=>{console.log("[MockGrackle] stopTask",{taskId:W}),Rs(W)},completeTask:Rs,resumeTask:On,updateTask:Os,deleteTask:Bs,loadFindings:Tl,postFinding:Ki,addEnvironment:Is,updateEnvironment:Ls,loadTokens:zs,setToken:Cl,deleteToken:kl,updateCredentialProviders:Bt,provisionStatus:{},provisionEnvironment:()=>{},stopEnvironment:()=>{},removeEnvironment:()=>{},codespaces:[],codespaceError:"",codespaceListError:"",codespaceCreating:!1,listCodespaces:()=>{},createCodespace:()=>{},workspaceCreating:!1,taskStartingId:void 0,personas:D,createPersona:(W,le,ce,xe,be,Ze,Ce,ht)=>{console.log("[MockGrackle] createPersona",{name:W});const ke={id:`mock-persona-${Date.now()}`,name:W,description:le,systemPrompt:ce,toolConfig:"{}",runtime:xe??"claude-code",model:be||"",maxTurns:Ze||0,mcpServers:"[]",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),type:Ce||"agent",script:ht||""};A(lt=>[...lt,ke])},updatePersona:(W,le,ce,xe,be,Ze,Ce,ht,ke)=>{console.log("[MockGrackle] updatePersona",{personaId:W,name:le}),A(lt=>lt.map(Fe=>Fe.id!==W?Fe:{...Fe,...le!==void 0?{name:le}:{},...ce!==void 0?{description:ce}:{},...xe!==void 0?{systemPrompt:xe}:{},...be!==void 0?{runtime:be}:{},...Ze!==void 0?{model:Ze}:{},...Ce!==void 0?{maxTurns:Ce}:{},...ht!==void 0?{type:ht}:{},...ke!==void 0?{script:ke}:{},updatedAt:new Date().toISOString()}))},deletePersona:W=>{console.log("[MockGrackle] deletePersona",W),A(le=>le.filter(ce=>ce.id!==W))},taskSessions:U,loadTaskSessions:W=>{console.log("[MockGrackle] loadTaskSessions",W)},appDefaultPersonaId:Y,setAppDefaultPersonaId:W=>{console.log("[MockGrackle] setAppDefaultPersonaId",W),F(W)},onboardingCompleted:!0,completeOnboarding:()=>{console.log("[MockGrackle] completeOnboarding")},usageCache:{},loadUsage:(W,le)=>{console.log(`[MockGrackle] loadUsage(${W}, ${le})`)}}),[a,l,f,p,g,v,S,k,E,D,U,Y,fe,Ms,se,Oe,ot,$t,Rn,Yn,Jt,Te,ct,Rs,On,Os,Bs,Tl,Ki,Is,Ls,zs,Cl,kl,Bt]);return c.jsx(sh.Provider,{value:Ac,children:n})}const pb=b.createContext(void 0),yk=4e3;function bk({children:n}){const[a,i]=b.useState([]),l=b.useRef(0),r=b.useCallback(d=>{i(p=>p.filter(m=>m.id!==d))},[]),f=b.useCallback((d,p="info",m=yk)=>{const g=`toast-${++l.current}`;i(y=>[...y,{id:g,message:d,variant:p,duration:m}])},[]);return c.jsx(pb.Provider,{value:{toasts:a,showToast:f,dismissToast:r},children:n})}function Pi(){const n=b.useContext(pb);if(!n)throw new Error("useToast must be used within ToastProvider");return n}const xc=[{id:"grackle",label:"Grackle",description:"The default Grackle theme — iridescent purple on clean dark.",swatches:["#0e1218","#8b5cf6","#60a5fa","#e5e7eb","#34d399"],variantLightId:"grackle-light",variantDarkId:"grackle-dark"},{id:"grackle-light",label:"Grackle Light",description:"Light Grackle variant.",hidden:!0},{id:"grackle-dark",label:"Grackle Dark",description:"Dark Grackle variant.",hidden:!0},{id:"glass",label:"Glassmorphism",description:"Dark frosted-glass aesthetic with backdrop blur effects.",swatches:["#0a0c14","#4ecca3","#70a1ff","#e2e8f0","#a855f7"]},{id:"matrix",label:"Matrix",description:"Phosphor-green CRT terminal with scanlines and glow.",swatches:["#050505","#00ff41","#00bfff","#33ff77","#ffb000"]},{id:"brutalist",label:"Neubrutalism",description:"Thick borders, raw colors, bold type — ugly on purpose.",swatches:["#f5f0e8","#ff5757","#5ce1e6","#1a1a1a","#ffde59"],variantLightId:"brutalist-light",variantDarkId:"brutalist-dark"},{id:"brutalist-light",label:"Neubrutalism Light",description:"Light neubrutalism variant.",hidden:!0},{id:"brutalist-dark",label:"Neubrutalism Dark",description:"Dark neubrutalism variant.",hidden:!0},{id:"monokai",label:"Monokai",description:"Classic warm editor palette — pink, green, and purple.",swatches:["#272822","#f92672","#a6e22e","#f8f8f2","#ae81ff"],variantLightId:"monokai-light",variantDarkId:"monokai-dark"},{id:"monokai-dark",label:"Monokai Dark",description:"Dark Monokai variant.",hidden:!0},{id:"monokai-light",label:"Monokai Light",description:"Light Monokai variant.",hidden:!0},{id:"ubuntu",label:"Ubuntu",description:"Aubergine terminal with the GNOME Tango palette.",swatches:["#300a24","#8ae234","#ef2929","#eeeeec","#fce94f"]},{id:"sandstone",label:"Sandstone",description:"Warm terracotta accent on dark brown, in the style of Claude Code.",swatches:["#1a1815","#C15F3C","#6b8afd","#e8e6e3","#a78bfa"]},{id:"verdigris",label:"Verdigris",description:"Teal accent on charcoal, in the style of ChatGPT.",swatches:["#141414","#00a67e","#3b82f6","#ececec","#ab68ff"]},{id:"primer",label:"Primer",description:"Blue accent on ink-dark grey, in the style of GitHub.",swatches:["#0d1117","#58a6ff","#3fb950","#c9d1d9","#bc8cff"]}],mb=new Set(xc.map(n=>n.id)),uy="grackle";function xf(n){return xc.find(a=>a.id===n)}const _f="grackle-theme",gb="grackle-prefer-system",vb="(prefers-color-scheme: dark)";let Ko=[],Wr;function Zd(){Wr=void 0;for(const n of Ko)n()}function Sf(){return typeof window>"u"?!1:window.matchMedia(vb).matches}function el(){if(typeof localStorage>"u")return uy;try{const n=localStorage.getItem(_f);if(n!==null&&mb.has(n))return n}catch{}return uy}function sc(){if(typeof localStorage>"u")return!1;try{return localStorage.getItem(gb)==="true"}catch{return!1}}function Tf(n){return xc.find(a=>a.variantLightId===n||a.variantDarkId===n)}function yb(n,a){const i=xf(n);if(i!=null&&i.variantDarkId)return a&&i.variantLightId?Sf()?i.variantDarkId:i.variantLightId:i.variantDarkId;if(i!=null&&i.hidden&&a){const l=Tf(n);if(l!=null&&l.variantLightId&&l.variantDarkId)return Sf()?l.variantDarkId:l.variantLightId}return n}function Ei(n,a,i=!1){i&&document.documentElement.classList.add("no-transitions"),document.documentElement.dataset.theme=yb(n,a),i&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove("no-transitions")}))}typeof document<"u"&&Ei(el(),sc());function xk(){return Wr===void 0&&(Wr={themeId:el(),systemDark:Sf(),preferSystem:sc()}),Wr}function _k(n){return Ko=[...Ko,n],()=>{Ko=Ko.filter(a=>a!==n)}}function Sk(){const n=b.useSyncExternalStore(_k,xk),{themeId:a,preferSystem:i}=n,l=yb(a,i),r=b.useCallback(d=>{if(mb.has(d)){try{localStorage.setItem(_f,d)}catch{}Ei(d,sc(),!0),Zd()}},[]),f=b.useCallback(d=>{try{localStorage.setItem(gb,d?"true":"false")}catch{}if(d){const p=el(),m=xf(p);if(m!=null&&m.hidden){const g=Tf(p);if(g)try{localStorage.setItem(_f,g.id)}catch{}}}Ei(el(),d,!0),Zd()},[]);return b.useEffect(()=>{Ei(a,i)},[a,i]),b.useEffect(()=>{if(typeof window>"u")return;const d=window.matchMedia(vb),p=()=>{const m=el(),g=sc();if(g){const y=xf(m);if(y!=null&&y.variantDarkId&&y.variantLightId&&Ei(m,g),y!=null&&y.hidden){const v=Tf(m);v!=null&&v.variantDarkId&&v.variantLightId&&Ei(m,g)}}Zd()};return d.addEventListener("change",p),()=>{d.removeEventListener("change",p)}},[]),{themeId:a,setTheme:r,resolvedThemeId:l,preferSystem:i,setPreferSystem:f}}const bb=b.createContext(void 0);function Tk({children:n}){const a=Sk();return c.jsx(bb.Provider,{value:a,children:n})}function xb(){const n=b.useContext(bb);if(!n)throw new Error("useThemeContext must be used within ThemeProvider");return n}const Ck="_container_1mq5u_1",kk="_hamburger_1mq5u_33",Ek="_brand_1mq5u_49",Nk="_brandLogo_1mq5u_68",Ak="_info_1mq5u_75",wk="_connectionLabel_1mq5u_90",jk="_connectionDot_1mq5u_103",Dk="_connected_1mq5u_106",Mk="_disconnected_1mq5u_110",fa={container:Ck,hamburger:kk,brand:Ek,brandLogo:Nk,info:Ak,connectionLabel:wk,connectionDot:jk,connected:Dk,disconnected:Mk};function Rk({onToggleSidebar:n,sidebarOpen:a}){const{connected:i,environments:l,sessions:r}=Je(),f=Ut(),d=l.length,p=l.filter(g=>g.status==="connected").length,m=r.filter(g=>["running","idle"].includes(g.status)).length;return c.jsxs("div",{className:fa.container,children:[n&&c.jsx("button",{type:"button",className:fa.hamburger,onClick:n,"aria-label":"Toggle sidebar","aria-expanded":a,children:"☰"}),c.jsxs("button",{type:"button",className:fa.brand,onClick:()=>f(yl),title:"Home",children:[c.jsx("img",{src:"/icon-192x192.png",alt:"",className:fa.brandLogo,"aria-hidden":"true","data-testid":"statusbar-logo"}),"Grackle"]}),c.jsxs("div",{className:fa.info,children:[c.jsxs("span",{"aria-label":i?"Connected":"Disconnected",children:[c.jsx("span",{className:`${fa.connectionDot} ${i?fa.connected:fa.disconnected}`,"aria-hidden":"true",children:"●"})," ",c.jsx("span",{className:fa.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 Ok="_nav_13gkc_1",Bk="_tab_13gkc_35",Ik="_tabIcon_13gkc_68",Lk="_tabLabel_13gkc_79",zk="_tabActive_13gkc_84",Po={nav:Ok,tab:Bk,tabIcon:Ik,tabLabel:Lk,tabActive:zk},_s=[{view:"dashboard",label:"Dashboard",icon:"🏠",route:yl,testId:"sidebar-tab-dashboard"},{view:"chat",label:"Chat",icon:"💬",route:qC,testId:"sidebar-tab-chat"},{view:"tasks",label:"Tasks",icon:"📋",route:YC,testId:"sidebar-tab-tasks"},{view:"environments",label:"Environments",icon:"🖥️",route:cl,testId:"sidebar-tab-environments"},{view:"settings",label:"Settings",icon:"⚙️",route:$C,testId:"sidebar-tab-settings"}];function _b(n){return n===yl||n==="/"?"dashboard":n.startsWith("/chat")||n.startsWith("/sessions")?"chat":n.startsWith("/workspaces")||n.startsWith("/environments")?"environments":n.startsWith(Jo)?"settings":"tasks"}function Uk(){const n=At(),a=Ut(),i=b.useRef(null),l=_b(n.pathname),r=b.useCallback(d=>{a(d.route)},[a]),f=b.useCallback(d=>{var v,x;const p=(v=i.current)==null?void 0:v.querySelectorAll('[role="tab"]');if(!p)return;const m=Array.from(p).findIndex(S=>S===document.activeElement),g=m>=0?m:_s.findIndex(S=>S.view===l);let y=g;if(d.key==="ArrowRight")d.preventDefault(),y=(g+1)%_s.length;else if(d.key==="ArrowLeft")d.preventDefault(),y=(g-1+_s.length)%_s.length;else if(d.key==="Home")d.preventDefault(),y=0;else if(d.key==="End")d.preventDefault(),y=_s.length-1;else return;a(_s[y].route),(x=p[y])==null||x.focus()},[l,a]);return c.jsx("nav",{className:Po.nav,ref:i,role:"tablist","aria-orientation":"horizontal","aria-label":"App navigation",onKeyDown:f,"data-testid":"sidebar-nav",children:_s.map(d=>{const p=d.view===l;return c.jsxs("button",{role:"tab",type:"button","aria-selected":p,tabIndex:p?0:-1,className:`${Po.tab} ${p?Po.tabActive:""}`,onClick:()=>r(d),"data-testid":d.testId,title:d.label,"aria-label":d.label,children:[c.jsx("span",{className:Po.tabIcon,"aria-hidden":"true",children:d.icon}),c.jsx("span",{className:Po.tabLabel,children:d.label})]},d.view)})})}const ih=b.createContext({});function oh(n){const a=b.useRef(null);return a.current===null&&(a.current=n()),a.current}const _c=b.createContext(null),lh=b.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"});class Vk extends b.Component{getSnapshotBeforeUpdate(a){const i=this.props.childRef.current;if(i&&a.isPresent&&!this.props.isPresent){const l=this.props.sizeRef.current;l.height=i.offsetHeight||0,l.width=i.offsetWidth||0,l.top=i.offsetTop,l.left=i.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Hk({children:n,isPresent:a}){const i=b.useId(),l=b.useRef(null),r=b.useRef({width:0,height:0,top:0,left:0}),{nonce:f}=b.useContext(lh);return b.useInsertionEffect(()=>{const{width:d,height:p,top:m,left:g}=r.current;if(a||!l.current||!d||!p)return;l.current.dataset.motionPopId=i;const y=document.createElement("style");return f&&(y.nonce=f),document.head.appendChild(y),y.sheet&&y.sheet.insertRule(`
|
|
79
|
-
[data-motion-pop-id="${i}"] {
|
|
80
|
-
position: absolute !important;
|
|
81
|
-
width: ${d}px !important;
|
|
82
|
-
height: ${p}px !important;
|
|
83
|
-
top: ${m}px !important;
|
|
84
|
-
left: ${g}px !important;
|
|
85
|
-
}
|
|
86
|
-
`),()=>{document.head.removeChild(y)}},[a]),c.jsx(Vk,{isPresent:a,childRef:l,sizeRef:r,children:b.cloneElement(n,{ref:l})})}const Gk=({children:n,initial:a,isPresent:i,onExitComplete:l,custom:r,presenceAffectsLayout:f,mode:d})=>{const p=oh(Pk),m=b.useId(),g=b.useCallback(v=>{p.set(v,!0);for(const x of p.values())if(!x)return;l&&l()},[p,l]),y=b.useMemo(()=>({id:m,initial:a,isPresent:i,custom:r,onExitComplete:g,register:v=>(p.set(v,!1),()=>p.delete(v))}),f?[Math.random(),g]:[i,g]);return b.useMemo(()=>{p.forEach((v,x)=>p.set(x,!1))},[i]),b.useEffect(()=>{!i&&!p.size&&l&&l()},[i]),d==="popLayout"&&(n=c.jsx(Hk,{isPresent:i,children:n})),c.jsx(_c.Provider,{value:y,children:n})};function Pk(){return new Map}function Sb(n=!0){const a=b.useContext(_c);if(a===null)return[!0,null];const{isPresent:i,onExitComplete:l,register:r}=a,f=b.useId();b.useEffect(()=>{n&&r(f)},[n]);const d=b.useCallback(()=>n&&l&&l(f),[f,l,n]);return!i&&l?[!1,d]:[!0]}const Hr=n=>n.key||"";function dy(n){const a=[];return b.Children.forEach(n,i=>{b.isValidElement(i)&&a.push(i)}),a}const rh=typeof window<"u",Tb=rh?b.useLayoutEffect:b.useEffect,qn=({children:n,custom:a,initial:i=!0,onExitComplete:l,presenceAffectsLayout:r=!0,mode:f="sync",propagate:d=!1})=>{const[p,m]=Sb(d),g=b.useMemo(()=>dy(n),[n]),y=d&&!p?[]:g.map(Hr),v=b.useRef(!0),x=b.useRef(g),S=oh(()=>new Map),[C,k]=b.useState(g),[N,E]=b.useState(g);Tb(()=>{v.current=!1,x.current=g;for(let A=0;A<N.length;A++){const U=Hr(N[A]);y.includes(U)?S.delete(U):S.get(U)!==!0&&S.set(U,!1)}},[N,y.length,y.join("-")]);const w=[];if(g!==C){let A=[...g];for(let U=0;U<N.length;U++){const Y=N[U],F=Hr(Y);y.includes(F)||(A.splice(U,0,Y),w.push(Y))}f==="wait"&&w.length&&(A=w),E(dy(A)),k(g);return}const{forceRender:D}=b.useContext(ih);return c.jsx(c.Fragment,{children:N.map(A=>{const U=Hr(A),Y=d&&!p?!1:g===N||y.includes(U),F=()=>{if(S.has(U))S.set(U,!0);else return;let O=!0;S.forEach(Z=>{Z||(O=!1)}),O&&(D==null||D(),E(x.current),d&&(m==null||m()),l&&l())};return c.jsx(Gk,{isPresent:Y,initial:!v.current||i?void 0:!1,custom:Y?void 0:a,presenceAffectsLayout:r,mode:f,onExitComplete:Y?void 0:F,children:A},U)})})},dn=n=>n;let Cb=dn;const $k={useManualTiming:!1};function Fk(n){let a=new Set,i=new Set,l=!1,r=!1;const f=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1};function p(g){f.has(g)&&(m.schedule(g),n()),g(d)}const m={schedule:(g,y=!1,v=!1)=>{const S=v&&l?a:i;return y&&f.add(g),S.has(g)||S.add(g),g},cancel:g=>{i.delete(g),f.delete(g)},process:g=>{if(d=g,l){r=!0;return}l=!0,[a,i]=[i,a],a.forEach(p),a.clear(),l=!1,r&&(r=!1,m.process(g))}};return m}const Gr=["read","resolveKeyframes","update","preRender","render","postRender"],qk=40;function kb(n,a){let i=!1,l=!0;const r={delta:0,timestamp:0,isProcessing:!1},f=()=>i=!0,d=Gr.reduce((E,w)=>(E[w]=Fk(f),E),{}),{read:p,resolveKeyframes:m,update:g,preRender:y,render:v,postRender:x}=d,S=()=>{const E=performance.now();i=!1,r.delta=l?1e3/60:Math.max(Math.min(E-r.timestamp,qk),1),r.timestamp=E,r.isProcessing=!0,p.process(r),m.process(r),g.process(r),y.process(r),v.process(r),x.process(r),r.isProcessing=!1,i&&a&&(l=!1,n(S))},C=()=>{i=!0,l=!0,r.isProcessing||n(S)};return{schedule:Gr.reduce((E,w)=>{const D=d[w];return E[w]=(A,U=!1,Y=!1)=>(i||C(),D.schedule(A,U,Y)),E},{}),cancel:E=>{for(let w=0;w<Gr.length;w++)d[Gr[w]].cancel(E)},state:r,steps:d}}const{schedule:at,cancel:Wa,state:Ot,steps:Xd}=kb(typeof requestAnimationFrame<"u"?requestAnimationFrame:dn,!0),Eb=b.createContext({strict:!1}),fy={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"]},Oi={};for(const n in fy)Oi[n]={isEnabled:a=>fy[n].some(i=>!!a[i])};function Yk(n){for(const a in n)Oi[a]={...Oi[a],...n[a]}}const Kk=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 ic(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||Kk.has(n)}let Nb=n=>!ic(n);function Zk(n){n&&(Nb=a=>a.startsWith("on")?!ic(a):n(a))}try{Zk(require("@emotion/is-prop-valid").default)}catch{}function Xk(n,a,i){const l={};for(const r in n)r==="values"&&typeof n.values=="object"||(Nb(r)||i===!0&&ic(r)||!a&&!ic(r)||n.draggable&&r.startsWith("onDrag"))&&(l[r]=n[r]);return l}function Qk(n){if(typeof Proxy>"u")return n;const a=new Map,i=(...l)=>n(...l);return new Proxy(i,{get:(l,r)=>r==="create"?n:(a.has(r)||a.set(r,n(r)),a.get(r))})}const Sc=b.createContext({});function ul(n){return typeof n=="string"||Array.isArray(n)}function Tc(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}const ch=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],uh=["initial",...ch];function Cc(n){return Tc(n.animate)||uh.some(a=>ul(n[a]))}function Ab(n){return!!(Cc(n)||n.variants)}function Wk(n,a){if(Cc(n)){const{initial:i,animate:l}=n;return{initial:i===!1||ul(i)?i:void 0,animate:ul(l)?l:void 0}}return n.inherit!==!1?a:{}}function Jk(n){const{initial:a,animate:i}=Wk(n,b.useContext(Sc));return b.useMemo(()=>({initial:a,animate:i}),[hy(a),hy(i)])}function hy(n){return Array.isArray(n)?n.join(" "):n}const eE=Symbol.for("motionComponentSymbol");function Ni(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function tE(n,a,i){return b.useCallback(l=>{l&&n.onMount&&n.onMount(l),a&&(l?a.mount(l):a.unmount()),i&&(typeof i=="function"?i(l):Ni(i)&&(i.current=l))},[a])}const dh=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),nE="framerAppearId",wb="data-"+dh(nE),{schedule:fh}=kb(queueMicrotask,!1),jb=b.createContext({});function aE(n,a,i,l,r){var f,d;const{visualElement:p}=b.useContext(Sc),m=b.useContext(Eb),g=b.useContext(_c),y=b.useContext(lh).reducedMotion,v=b.useRef(null);l=l||m.renderer,!v.current&&l&&(v.current=l(n,{visualState:a,parent:p,props:i,presenceContext:g,blockInitialAnimation:g?g.initial===!1:!1,reducedMotionConfig:y}));const x=v.current,S=b.useContext(jb);x&&!x.projection&&r&&(x.type==="html"||x.type==="svg")&&sE(v.current,i,r,S);const C=b.useRef(!1);b.useInsertionEffect(()=>{x&&C.current&&x.update(i,g)});const k=i[wb],N=b.useRef(!!k&&!(!((f=window.MotionHandoffIsComplete)===null||f===void 0)&&f.call(window,k))&&((d=window.MotionHasOptimisedAnimation)===null||d===void 0?void 0:d.call(window,k)));return Tb(()=>{x&&(C.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),fh.render(x.render),N.current&&x.animationState&&x.animationState.animateChanges())}),b.useEffect(()=>{x&&(!N.current&&x.animationState&&x.animationState.animateChanges(),N.current&&(queueMicrotask(()=>{var E;(E=window.MotionHandoffMarkAsComplete)===null||E===void 0||E.call(window,k)}),N.current=!1))}),x}function sE(n,a,i,l){const{layoutId:r,layout:f,drag:d,dragConstraints:p,layoutScroll:m,layoutRoot:g}=a;n.projection=new i(n.latestValues,a["data-framer-portal-id"]?void 0:Db(n.parent)),n.projection.setOptions({layoutId:r,layout:f,alwaysMeasureLayout:!!d||p&&Ni(p),visualElement:n,animationType:typeof f=="string"?f:"both",initialPromotionConfig:l,layoutScroll:m,layoutRoot:g})}function Db(n){if(n)return n.options.allowProjection!==!1?n.projection:Db(n.parent)}function iE({preloadedFeatures:n,createVisualElement:a,useRender:i,useVisualState:l,Component:r}){var f,d;n&&Yk(n);function p(g,y){let v;const x={...b.useContext(lh),...g,layoutId:oE(g)},{isStatic:S}=x,C=Jk(g),k=l(g,S);if(!S&&rh){lE();const N=rE(x);v=N.MeasureLayout,C.visualElement=aE(r,k,x,a,N.ProjectionNode)}return c.jsxs(Sc.Provider,{value:C,children:[v&&C.visualElement?c.jsx(v,{visualElement:C.visualElement,...x}):null,i(r,g,tE(k,C.visualElement,y),k,S,C.visualElement)]})}p.displayName=`motion.${typeof r=="string"?r:`create(${(d=(f=r.displayName)!==null&&f!==void 0?f:r.name)!==null&&d!==void 0?d:""})`}`;const m=b.forwardRef(p);return m[eE]=r,m}function oE({layoutId:n}){const a=b.useContext(ih).id;return a&&n!==void 0?a+"-"+n:n}function lE(n,a){b.useContext(Eb).strict}function rE(n){const{drag:a,layout:i}=Oi;if(!a&&!i)return{};const l={...a,...i};return{MeasureLayout:a!=null&&a.isEnabled(n)||i!=null&&i.isEnabled(n)?l.MeasureLayout:void 0,ProjectionNode:l.ProjectionNode}}const cE=["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 hh(n){return typeof n!="string"||n.includes("-")?!1:!!(cE.indexOf(n)>-1||/[A-Z]/u.test(n))}function py(n){const a=[{},{}];return n==null||n.values.forEach((i,l)=>{a[0][l]=i.get(),a[1][l]=i.getVelocity()}),a}function ph(n,a,i,l){if(typeof a=="function"){const[r,f]=py(l);a=a(i!==void 0?i:n.custom,r,f)}if(typeof a=="string"&&(a=n.variants&&n.variants[a]),typeof a=="function"){const[r,f]=py(l);a=a(i!==void 0?i:n.custom,r,f)}return a}const Cf=n=>Array.isArray(n),uE=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),dE=n=>Cf(n)?n[n.length-1]||0:n,zt=n=>!!(n&&n.getVelocity);function Jr(n){const a=zt(n)?n.get():n;return uE(a)?a.toValue():a}function fE({scrapeMotionValuesFromProps:n,createRenderState:a,onUpdate:i},l,r,f){const d={latestValues:hE(l,r,f,n),renderState:a()};return i&&(d.onMount=p=>i({props:l,current:p,...d}),d.onUpdate=p=>i(p)),d}const Mb=n=>(a,i)=>{const l=b.useContext(Sc),r=b.useContext(_c),f=()=>fE(n,a,l,r);return i?f():oh(f)};function hE(n,a,i,l){const r={},f=l(n,{});for(const x in f)r[x]=Jr(f[x]);let{initial:d,animate:p}=n;const m=Cc(n),g=Ab(n);a&&g&&!m&&n.inherit!==!1&&(d===void 0&&(d=a.initial),p===void 0&&(p=a.animate));let y=i?i.initial===!1:!1;y=y||d===!1;const v=y?p:d;if(v&&typeof v!="boolean"&&!Tc(v)){const x=Array.isArray(v)?v:[v];for(let S=0;S<x.length;S++){const C=ph(n,x[S]);if(C){const{transitionEnd:k,transition:N,...E}=C;for(const w in E){let D=E[w];if(Array.isArray(D)){const A=y?D.length-1:0;D=D[A]}D!==null&&(r[w]=D)}for(const w in k)r[w]=k[w]}}}return r}const $i=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ds=new Set($i),Rb=n=>a=>typeof a=="string"&&a.startsWith(n),Ob=Rb("--"),pE=Rb("var(--"),mh=n=>pE(n)?mE.test(n.split("/*")[0].trim()):!1,mE=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Bb=(n,a)=>a&&typeof n=="number"?a.transform(n):n,ya=(n,a,i)=>i>a?a:i<n?n:i,Fi={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},dl={...Fi,transform:n=>ya(0,1,n)},Pr={...Fi,default:1},bl=n=>({test:a=>typeof a=="string"&&a.endsWith(n)&&a.split(" ").length===1,parse:parseFloat,transform:a=>`${a}${n}`}),Ya=bl("deg"),$n=bl("%"),ve=bl("px"),gE=bl("vh"),vE=bl("vw"),my={...$n,parse:n=>$n.parse(n)/100,transform:n=>$n.transform(n*100)},yE={borderWidth:ve,borderTopWidth:ve,borderRightWidth:ve,borderBottomWidth:ve,borderLeftWidth:ve,borderRadius:ve,radius:ve,borderTopLeftRadius:ve,borderTopRightRadius:ve,borderBottomRightRadius:ve,borderBottomLeftRadius:ve,width:ve,maxWidth:ve,height:ve,maxHeight:ve,top:ve,right:ve,bottom:ve,left:ve,padding:ve,paddingTop:ve,paddingRight:ve,paddingBottom:ve,paddingLeft:ve,margin:ve,marginTop:ve,marginRight:ve,marginBottom:ve,marginLeft:ve,backgroundPositionX:ve,backgroundPositionY:ve},bE={rotate:Ya,rotateX:Ya,rotateY:Ya,rotateZ:Ya,scale:Pr,scaleX:Pr,scaleY:Pr,scaleZ:Pr,skew:Ya,skewX:Ya,skewY:Ya,distance:ve,translateX:ve,translateY:ve,translateZ:ve,x:ve,y:ve,z:ve,perspective:ve,transformPerspective:ve,opacity:dl,originX:my,originY:my,originZ:ve},gy={...Fi,transform:Math.round},gh={...yE,...bE,zIndex:gy,size:ve,fillOpacity:dl,strokeOpacity:dl,numOctaves:gy},xE={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},_E=$i.length;function SE(n,a,i){let l="",r=!0;for(let f=0;f<_E;f++){const d=$i[f],p=n[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=Bb(p,gh[d]);if(!m){r=!1;const y=xE[d]||d;l+=`${y}(${g}) `}i&&(a[d]=g)}}return l=l.trim(),i?l=i(a,r?"":l):r&&(l="none"),l}function vh(n,a,i){const{style:l,vars:r,transformOrigin:f}=n;let d=!1,p=!1;for(const m in a){const g=a[m];if(Ds.has(m)){d=!0;continue}else if(Ob(m)){r[m]=g;continue}else{const y=Bb(g,gh[m]);m.startsWith("origin")?(p=!0,f[m]=y):l[m]=y}}if(a.transform||(d||i?l.transform=SE(a,n.transform,i):l.transform&&(l.transform="none")),p){const{originX:m="50%",originY:g="50%",originZ:y=0}=f;l.transformOrigin=`${m} ${g} ${y}`}}const TE={offset:"stroke-dashoffset",array:"stroke-dasharray"},CE={offset:"strokeDashoffset",array:"strokeDasharray"};function kE(n,a,i=1,l=0,r=!0){n.pathLength=1;const f=r?TE:CE;n[f.offset]=ve.transform(-l);const d=ve.transform(a),p=ve.transform(i);n[f.array]=`${d} ${p}`}function vy(n,a,i){return typeof n=="string"?n:ve.transform(a+i*n)}function EE(n,a,i){const l=vy(a,n.x,n.width),r=vy(i,n.y,n.height);return`${l} ${r}`}function yh(n,{attrX:a,attrY:i,attrScale:l,originX:r,originY:f,pathLength:d,pathSpacing:p=1,pathOffset:m=0,...g},y,v){if(vh(n,g,v),y){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:x,style:S,dimensions:C}=n;x.transform&&(C&&(S.transform=x.transform),delete x.transform),C&&(r!==void 0||f!==void 0||S.transform)&&(S.transformOrigin=EE(C,r!==void 0?r:.5,f!==void 0?f:.5)),a!==void 0&&(x.x=a),i!==void 0&&(x.y=i),l!==void 0&&(x.scale=l),d!==void 0&&kE(x,d,p,m,!1)}const bh=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Ib=()=>({...bh(),attrs:{}}),xh=n=>typeof n=="string"&&n.toLowerCase()==="svg";function Lb(n,{style:a,vars:i},l,r){Object.assign(n.style,a,r&&r.getProjectionStyles(l));for(const f in i)n.style.setProperty(f,i[f])}const zb=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 Ub(n,a,i,l){Lb(n,a,void 0,l);for(const r in a.attrs)n.setAttribute(zb.has(r)?r:dh(r),a.attrs[r])}const oc={};function NE(n){Object.assign(oc,n)}function Vb(n,{layout:a,layoutId:i}){return Ds.has(n)||n.startsWith("origin")||(a||i!==void 0)&&(!!oc[n]||n==="opacity")}function _h(n,a,i){var l;const{style:r}=n,f={};for(const d in r)(zt(r[d])||a.style&&zt(a.style[d])||Vb(d,n)||((l=i==null?void 0:i.getValue(d))===null||l===void 0?void 0:l.liveStyle)!==void 0)&&(f[d]=r[d]);return f}function Hb(n,a,i){const l=_h(n,a,i);for(const r in n)if(zt(n[r])||zt(a[r])){const f=$i.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;l[f]=n[r]}return l}function AE(n,a){try{a.dimensions=typeof n.getBBox=="function"?n.getBBox():n.getBoundingClientRect()}catch{a.dimensions={x:0,y:0,width:0,height:0}}}const yy=["x","y","width","height","cx","cy","r"],wE={useVisualState:Mb({scrapeMotionValuesFromProps:Hb,createRenderState:Ib,onUpdate:({props:n,prevProps:a,current:i,renderState:l,latestValues:r})=>{if(!i)return;let f=!!n.drag;if(!f){for(const p in r)if(Ds.has(p)){f=!0;break}}if(!f)return;let d=!a;if(a)for(let p=0;p<yy.length;p++){const m=yy[p];n[m]!==a[m]&&(d=!0)}d&&at.read(()=>{AE(i,l),at.render(()=>{yh(l,r,xh(i.tagName),n.transformTemplate),Ub(i,l)})})}})},jE={useVisualState:Mb({scrapeMotionValuesFromProps:_h,createRenderState:bh})};function Gb(n,a,i){for(const l in a)!zt(a[l])&&!Vb(l,i)&&(n[l]=a[l])}function DE({transformTemplate:n},a){return b.useMemo(()=>{const i=bh();return vh(i,a,n),Object.assign({},i.vars,i.style)},[a])}function ME(n,a){const i=n.style||{},l={};return Gb(l,i,n),Object.assign(l,DE(n,a)),l}function RE(n,a){const i={},l=ME(n,a);return n.drag&&n.dragListener!==!1&&(i.draggable=!1,l.userSelect=l.WebkitUserSelect=l.WebkitTouchCallout="none",l.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(i.tabIndex=0),i.style=l,i}function OE(n,a,i,l){const r=b.useMemo(()=>{const f=Ib();return yh(f,a,xh(l),n.transformTemplate),{...f.attrs,style:{...f.style}}},[a]);if(n.style){const f={};Gb(f,n.style,n),r.style={...f,...r.style}}return r}function BE(n=!1){return(i,l,r,{latestValues:f},d)=>{const m=(hh(i)?OE:RE)(l,f,d,i),g=Xk(l,typeof i=="string",n),y=i!==b.Fragment?{...g,...m,ref:r}:{},{children:v}=l,x=b.useMemo(()=>zt(v)?v.get():v,[v]);return b.createElement(i,{...y,children:x})}}function IE(n,a){return function(l,{forwardMotionProps:r}={forwardMotionProps:!1}){const d={...hh(l)?wE:jE,preloadedFeatures:n,useRender:BE(r),createVisualElement:a,Component:l};return iE(d)}}function Pb(n,a){if(!Array.isArray(a))return!1;const i=a.length;if(i!==n.length)return!1;for(let l=0;l<i;l++)if(a[l]!==n[l])return!1;return!0}function kc(n,a,i){const l=n.getProps();return ph(l,a,i!==void 0?i:l.custom,n)}function Sh(n,a){return n?n[a]||n.default||n:void 0}const $b=new Set(["width","height","top","left","right","bottom",...$i]);let ec;function LE(){ec=void 0}const Fn={now:()=>(ec===void 0&&Fn.set(Ot.isProcessing||$k.useManualTiming?Ot.timestamp:performance.now()),ec),set:n=>{ec=n,queueMicrotask(LE)}};function Th(n,a){n.indexOf(a)===-1&&n.push(a)}function Ch(n,a){const i=n.indexOf(a);i>-1&&n.splice(i,1)}class kh{constructor(){this.subscriptions=[]}add(a){return Th(this.subscriptions,a),()=>Ch(this.subscriptions,a)}notify(a,i,l){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](a,i,l);else for(let f=0;f<r;f++){const d=this.subscriptions[f];d&&d(a,i,l)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Fb(n,a){return a?n*(1e3/a):0}const by=30,zE=n=>!isNaN(parseFloat(n));class UE{constructor(a,i={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(l,r=!0)=>{const f=Fn.now();this.updatedAt!==f&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(l),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(a),this.owner=i.owner}setCurrent(a){this.current=a,this.updatedAt=Fn.now(),this.canTrackVelocity===null&&a!==void 0&&(this.canTrackVelocity=zE(this.current))}setPrevFrameValue(a=this.current){this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt}onChange(a){return this.on("change",a)}on(a,i){this.events[a]||(this.events[a]=new kh);const l=this.events[a].add(i);return a==="change"?()=>{l(),at.read(()=>{this.events.change.getSize()||this.stop()})}:l}clearListeners(){for(const a in this.events)this.events[a].clear()}attach(a,i){this.passiveEffect=a,this.stopPassiveEffect=i}set(a,i=!0){!i||!this.passiveEffect?this.updateAndNotify(a,i):this.passiveEffect(a,this.updateAndNotify)}setWithVelocity(a,i,l){this.set(i),this.prev=void 0,this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt-l}jump(a,i=!0){this.updateAndNotify(a),this.prev=a,this.prevUpdatedAt=this.prevFrameValue=void 0,i&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const a=Fn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||a-this.updatedAt>by)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,by);return Fb(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 fl(n,a){return new UE(n,a)}function VE(n,a,i){n.hasValue(a)?n.getValue(a).set(i):n.addValue(a,fl(i))}function HE(n,a){const i=kc(n,a);let{transitionEnd:l={},transition:r={},...f}=i||{};f={...f,...l};for(const d in f){const p=dE(f[d]);VE(n,d,p)}}function GE(n){return!!(zt(n)&&n.add)}function kf(n,a){const i=n.getValue("willChange");if(GE(i))return i.add(a)}function qb(n){return n.props[wb]}function Eh(n){let a;return()=>(a===void 0&&(a=n()),a)}const PE=Eh(()=>window.ScrollTimeline!==void 0);class $E{constructor(a){this.stop=()=>this.runAll("stop"),this.animations=a.filter(Boolean)}get finished(){return Promise.all(this.animations.map(a=>"finished"in a?a.finished:a))}getAll(a){return this.animations[0][a]}setAll(a,i){for(let l=0;l<this.animations.length;l++)this.animations[l][a]=i}attachTimeline(a,i){const l=this.animations.map(r=>{if(PE()&&r.attachTimeline)return r.attachTimeline(a);if(typeof i=="function")return i(r)});return()=>{l.forEach((r,f)=>{r&&r(),this.animations[f].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 FE extends $E{then(a,i){return Promise.all(this.animations).then(a).catch(i)}}const pa=n=>n*1e3,ma=n=>n/1e3;function Nh(n){return typeof n=="function"}function xy(n,a){n.timeline=a,n.onfinish=null}const Ah=n=>Array.isArray(n)&&typeof n[0]=="number",qE={linearEasing:void 0};function YE(n,a){const i=Eh(n);return()=>{var l;return(l=qE[a])!==null&&l!==void 0?l:i()}}const lc=YE(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Bi=(n,a,i)=>{const l=a-n;return l===0?1:(i-n)/l},Yb=(n,a,i=10)=>{let l="";const r=Math.max(Math.round(a/i),2);for(let f=0;f<r;f++)l+=n(Bi(0,r-1,f))+", ";return`linear(${l.substring(0,l.length-2)})`};function Kb(n){return!!(typeof n=="function"&&lc()||!n||typeof n=="string"&&(n in Ef||lc())||Ah(n)||Array.isArray(n)&&n.every(Kb))}const Zo=([n,a,i,l])=>`cubic-bezier(${n}, ${a}, ${i}, ${l})`,Ef={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Zo([0,.65,.55,1]),circOut:Zo([.55,0,1,.45]),backIn:Zo([.31,.01,.66,-.59]),backOut:Zo([.33,1.53,.69,.99])};function Zb(n,a){if(n)return typeof n=="function"&&lc()?Yb(n,a):Ah(n)?Zo(n):Array.isArray(n)?n.map(i=>Zb(i,a)||Ef.easeOut):Ef[n]}const Xb=(n,a,i)=>(((1-3*i+3*a)*n+(3*i-6*a))*n+3*a)*n,KE=1e-7,ZE=12;function XE(n,a,i,l,r){let f,d,p=0;do d=a+(i-a)/2,f=Xb(d,l,r)-n,f>0?i=d:a=d;while(Math.abs(f)>KE&&++p<ZE);return d}function xl(n,a,i,l){if(n===a&&i===l)return dn;const r=f=>XE(f,0,1,n,i);return f=>f===0||f===1?f:Xb(r(f),a,l)}const Qb=n=>a=>a<=.5?n(2*a)/2:(2-n(2*(1-a)))/2,Wb=n=>a=>1-n(1-a),Jb=xl(.33,1.53,.69,.99),wh=Wb(Jb),ex=Qb(wh),tx=n=>(n*=2)<1?.5*wh(n):.5*(2-Math.pow(2,-10*(n-1))),jh=n=>1-Math.sin(Math.acos(n)),nx=Wb(jh),ax=Qb(jh),sx=n=>/^0[^.\s]+$/u.test(n);function QE(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||sx(n):!0}const tl=n=>Math.round(n*1e5)/1e5,Dh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function WE(n){return n==null}const JE=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Mh=(n,a)=>i=>!!(typeof i=="string"&&JE.test(i)&&i.startsWith(n)||a&&!WE(i)&&Object.prototype.hasOwnProperty.call(i,a)),ix=(n,a,i)=>l=>{if(typeof l!="string")return l;const[r,f,d,p]=l.match(Dh);return{[n]:parseFloat(r),[a]:parseFloat(f),[i]:parseFloat(d),alpha:p!==void 0?parseFloat(p):1}},eN=n=>ya(0,255,n),Qd={...Fi,transform:n=>Math.round(eN(n))},As={test:Mh("rgb","red"),parse:ix("red","green","blue"),transform:({red:n,green:a,blue:i,alpha:l=1})=>"rgba("+Qd.transform(n)+", "+Qd.transform(a)+", "+Qd.transform(i)+", "+tl(dl.transform(l))+")"};function tN(n){let a="",i="",l="",r="";return n.length>5?(a=n.substring(1,3),i=n.substring(3,5),l=n.substring(5,7),r=n.substring(7,9)):(a=n.substring(1,2),i=n.substring(2,3),l=n.substring(3,4),r=n.substring(4,5),a+=a,i+=i,l+=l,r+=r),{red:parseInt(a,16),green:parseInt(i,16),blue:parseInt(l,16),alpha:r?parseInt(r,16)/255:1}}const Nf={test:Mh("#"),parse:tN,transform:As.transform},Ai={test:Mh("hsl","hue"),parse:ix("hue","saturation","lightness"),transform:({hue:n,saturation:a,lightness:i,alpha:l=1})=>"hsla("+Math.round(n)+", "+$n.transform(tl(a))+", "+$n.transform(tl(i))+", "+tl(dl.transform(l))+")"},Lt={test:n=>As.test(n)||Nf.test(n)||Ai.test(n),parse:n=>As.test(n)?As.parse(n):Ai.test(n)?Ai.parse(n):Nf.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?As.transform(n):Ai.transform(n)},nN=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function aN(n){var a,i;return isNaN(n)&&typeof n=="string"&&(((a=n.match(Dh))===null||a===void 0?void 0:a.length)||0)+(((i=n.match(nN))===null||i===void 0?void 0:i.length)||0)>0}const ox="number",lx="color",sN="var",iN="var(",_y="${}",oN=/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 hl(n){const a=n.toString(),i=[],l={color:[],number:[],var:[]},r=[];let f=0;const p=a.replace(oN,m=>(Lt.test(m)?(l.color.push(f),r.push(lx),i.push(Lt.parse(m))):m.startsWith(iN)?(l.var.push(f),r.push(sN),i.push(m)):(l.number.push(f),r.push(ox),i.push(parseFloat(m))),++f,_y)).split(_y);return{values:i,split:p,indexes:l,types:r}}function rx(n){return hl(n).values}function cx(n){const{split:a,types:i}=hl(n),l=a.length;return r=>{let f="";for(let d=0;d<l;d++)if(f+=a[d],r[d]!==void 0){const p=i[d];p===ox?f+=tl(r[d]):p===lx?f+=Lt.transform(r[d]):f+=r[d]}return f}}const lN=n=>typeof n=="number"?0:n;function rN(n){const a=rx(n);return cx(n)(a.map(lN))}const Ja={test:aN,parse:rx,createTransformer:cx,getAnimatableNone:rN},cN=new Set(["brightness","contrast","saturate","opacity"]);function uN(n){const[a,i]=n.slice(0,-1).split("(");if(a==="drop-shadow")return n;const[l]=i.match(Dh)||[];if(!l)return n;const r=i.replace(l,"");let f=cN.has(a)?1:0;return l!==i&&(f*=100),a+"("+f+r+")"}const dN=/\b([a-z-]*)\(.*?\)/gu,Af={...Ja,getAnimatableNone:n=>{const a=n.match(dN);return a?a.map(uN).join(" "):n}},fN={...gh,color:Lt,backgroundColor:Lt,outlineColor:Lt,fill:Lt,stroke:Lt,borderColor:Lt,borderTopColor:Lt,borderRightColor:Lt,borderBottomColor:Lt,borderLeftColor:Lt,filter:Af,WebkitFilter:Af},Rh=n=>fN[n];function ux(n,a){let i=Rh(n);return i!==Af&&(i=Ja),i.getAnimatableNone?i.getAnimatableNone(a):void 0}const hN=new Set(["auto","none","0"]);function pN(n,a,i){let l=0,r;for(;l<n.length&&!r;){const f=n[l];typeof f=="string"&&!hN.has(f)&&hl(f).values.length&&(r=n[l]),l++}if(r&&i)for(const f of a)n[f]=ux(i,r)}const Sy=n=>n===Fi||n===ve,Ty=(n,a)=>parseFloat(n.split(", ")[a]),Cy=(n,a)=>(i,{transform:l})=>{if(l==="none"||!l)return 0;const r=l.match(/^matrix3d\((.+)\)$/u);if(r)return Ty(r[1],a);{const f=l.match(/^matrix\((.+)\)$/u);return f?Ty(f[1],n):0}},mN=new Set(["x","y","z"]),gN=$i.filter(n=>!mN.has(n));function vN(n){const a=[];return gN.forEach(i=>{const l=n.getValue(i);l!==void 0&&(a.push([i,l.get()]),l.set(i.startsWith("scale")?1:0))}),a}const Ii={width:({x:n},{paddingLeft:a="0",paddingRight:i="0"})=>n.max-n.min-parseFloat(a)-parseFloat(i),height:({y:n},{paddingTop:a="0",paddingBottom:i="0"})=>n.max-n.min-parseFloat(a)-parseFloat(i),top:(n,{top:a})=>parseFloat(a),left:(n,{left:a})=>parseFloat(a),bottom:({y:n},{top:a})=>parseFloat(a)+(n.max-n.min),right:({x:n},{left:a})=>parseFloat(a)+(n.max-n.min),x:Cy(4,13),y:Cy(5,14)};Ii.translateX=Ii.x;Ii.translateY=Ii.y;const ws=new Set;let wf=!1,jf=!1;function dx(){if(jf){const n=Array.from(ws).filter(l=>l.needsMeasurement),a=new Set(n.map(l=>l.element)),i=new Map;a.forEach(l=>{const r=vN(l);r.length&&(i.set(l,r),l.render())}),n.forEach(l=>l.measureInitialState()),a.forEach(l=>{l.render();const r=i.get(l);r&&r.forEach(([f,d])=>{var p;(p=l.getValue(f))===null||p===void 0||p.set(d)})}),n.forEach(l=>l.measureEndState()),n.forEach(l=>{l.suspendedScrollY!==void 0&&window.scrollTo(0,l.suspendedScrollY)})}jf=!1,wf=!1,ws.forEach(n=>n.complete()),ws.clear()}function fx(){ws.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(jf=!0)})}function yN(){fx(),dx()}class Oh{constructor(a,i,l,r,f,d=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...a],this.onComplete=i,this.name=l,this.motionValue=r,this.element=f,this.isAsync=d}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ws.add(this),wf||(wf=!0,at.read(fx),at.resolveKeyframes(dx))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:a,name:i,element:l,motionValue:r}=this;for(let f=0;f<a.length;f++)if(a[f]===null)if(f===0){const d=r==null?void 0:r.get(),p=a[a.length-1];if(d!==void 0)a[0]=d;else if(l&&i){const m=l.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[f]=a[f-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),ws.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ws.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const hx=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),bN=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function xN(n){const a=bN.exec(n);if(!a)return[,];const[,i,l,r]=a;return[`--${i??l}`,r]}function px(n,a,i=1){const[l,r]=xN(n);if(!l)return;const f=window.getComputedStyle(a).getPropertyValue(l);if(f){const d=f.trim();return hx(d)?parseFloat(d):d}return mh(r)?px(r,a,i+1):r}const mx=n=>a=>a.test(n),_N={test:n=>n==="auto",parse:n=>n},gx=[Fi,ve,$n,Ya,vE,gE,_N],ky=n=>gx.find(mx(n));class vx extends Oh{constructor(a,i,l,r,f){super(a,i,l,r,f,!0)}readKeyframes(){const{unresolvedKeyframes:a,element:i,name:l}=this;if(!i||!i.current)return;super.readKeyframes();for(let m=0;m<a.length;m++){let g=a[m];if(typeof g=="string"&&(g=g.trim(),mh(g))){const y=px(g,i.current);y!==void 0&&(a[m]=y),m===a.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!$b.has(l)||a.length!==2)return;const[r,f]=a,d=ky(r),p=ky(f);if(d!==p)if(Sy(d)&&Sy(p))for(let m=0;m<a.length;m++){const g=a[m];typeof g=="string"&&(a[m]=parseFloat(g))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:a,name:i}=this,l=[];for(let r=0;r<a.length;r++)QE(a[r])&&l.push(r);l.length&&pN(a,l,i)}measureInitialState(){const{element:a,unresolvedKeyframes:i,name:l}=this;if(!a||!a.current)return;l==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ii[l](a.measureViewportBox(),window.getComputedStyle(a.current)),i[0]=this.measuredOrigin;const r=i[i.length-1];r!==void 0&&a.getValue(l,r).jump(r,!1)}measureEndState(){var a;const{element:i,name:l,unresolvedKeyframes:r}=this;if(!i||!i.current)return;const f=i.getValue(l);f&&f.jump(this.measuredOrigin,!1);const d=r.length-1,p=r[d];r[d]=Ii[l](i.measureViewportBox(),window.getComputedStyle(i.current)),p!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=p),!((a=this.removedTransforms)===null||a===void 0)&&a.length&&this.removedTransforms.forEach(([m,g])=>{i.getValue(m).set(g)}),this.resolveNoneKeyframes()}}const Ey=(n,a)=>a==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(Ja.test(n)||n==="0")&&!n.startsWith("url("));function SN(n){const a=n[0];if(n.length===1)return!0;for(let i=0;i<n.length;i++)if(n[i]!==a)return!0}function TN(n,a,i,l){const r=n[0];if(r===null)return!1;if(a==="display"||a==="visibility")return!0;const f=n[n.length-1],d=Ey(r,a),p=Ey(f,a);return!d||!p?!1:SN(n)||(i==="spring"||Nh(i))&&l}const CN=n=>n!==null;function Ec(n,{repeat:a,repeatType:i="loop"},l){const r=n.filter(CN),f=a&&i!=="loop"&&a%2===1?0:r.length-1;return!f||l===void 0?r[f]:l}const kN=40;class yx{constructor({autoplay:a=!0,delay:i=0,type:l="keyframes",repeat:r=0,repeatDelay:f=0,repeatType:d="loop",...p}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Fn.now(),this.options={autoplay:a,delay:i,type:l,repeat:r,repeatDelay:f,repeatType:d,...p},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>kN?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&yN(),this._resolved}onKeyframesResolved(a,i){this.resolvedAt=Fn.now(),this.hasAttemptedResolve=!0;const{name:l,type:r,velocity:f,delay:d,onComplete:p,onUpdate:m,isGenerator:g}=this.options;if(!g&&!TN(a,l,r,f))if(d)this.options.duration=0;else{m&&m(Ec(a,this.options,i)),p&&p(),this.resolveFinishedPromise();return}const y=this.initPlayback(a,i);y!==!1&&(this._resolved={keyframes:a,finalKeyframe:i,...y},this.onPostResolved())}onPostResolved(){}then(a,i){return this.currentFinishedPromise.then(a,i)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(a=>{this.resolveFinishedPromise=a})}}const Df=2e4;function bx(n){let a=0;const i=50;let l=n.next(a);for(;!l.done&&a<Df;)a+=i,l=n.next(a);return a>=Df?1/0:a}const rt=(n,a,i)=>n+(a-n)*i;function Wd(n,a,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?n+(a-n)*6*i:i<1/2?a:i<2/3?n+(a-n)*(2/3-i)*6:n}function EN({hue:n,saturation:a,lightness:i,alpha:l}){n/=360,a/=100,i/=100;let r=0,f=0,d=0;if(!a)r=f=d=i;else{const p=i<.5?i*(1+a):i+a-i*a,m=2*i-p;r=Wd(m,p,n+1/3),f=Wd(m,p,n),d=Wd(m,p,n-1/3)}return{red:Math.round(r*255),green:Math.round(f*255),blue:Math.round(d*255),alpha:l}}function rc(n,a){return i=>i>0?a:n}const Jd=(n,a,i)=>{const l=n*n,r=i*(a*a-l)+l;return r<0?0:Math.sqrt(r)},NN=[Nf,As,Ai],AN=n=>NN.find(a=>a.test(n));function Ny(n){const a=AN(n);if(!a)return!1;let i=a.parse(n);return a===Ai&&(i=EN(i)),i}const Ay=(n,a)=>{const i=Ny(n),l=Ny(a);if(!i||!l)return rc(n,a);const r={...i};return f=>(r.red=Jd(i.red,l.red,f),r.green=Jd(i.green,l.green,f),r.blue=Jd(i.blue,l.blue,f),r.alpha=rt(i.alpha,l.alpha,f),As.transform(r))},wN=(n,a)=>i=>a(n(i)),_l=(...n)=>n.reduce(wN),Mf=new Set(["none","hidden"]);function jN(n,a){return Mf.has(n)?i=>i<=0?n:a:i=>i>=1?a:n}function DN(n,a){return i=>rt(n,a,i)}function Bh(n){return typeof n=="number"?DN:typeof n=="string"?mh(n)?rc:Lt.test(n)?Ay:ON:Array.isArray(n)?xx:typeof n=="object"?Lt.test(n)?Ay:MN:rc}function xx(n,a){const i=[...n],l=i.length,r=n.map((f,d)=>Bh(f)(f,a[d]));return f=>{for(let d=0;d<l;d++)i[d]=r[d](f);return i}}function MN(n,a){const i={...n,...a},l={};for(const r in i)n[r]!==void 0&&a[r]!==void 0&&(l[r]=Bh(n[r])(n[r],a[r]));return r=>{for(const f in l)i[f]=l[f](r);return i}}function RN(n,a){var i;const l=[],r={color:0,var:0,number:0};for(let f=0;f<a.values.length;f++){const d=a.types[f],p=n.indexes[d][r[d]],m=(i=n.values[p])!==null&&i!==void 0?i:0;l[f]=m,r[d]++}return l}const ON=(n,a)=>{const i=Ja.createTransformer(a),l=hl(n),r=hl(a);return l.indexes.var.length===r.indexes.var.length&&l.indexes.color.length===r.indexes.color.length&&l.indexes.number.length>=r.indexes.number.length?Mf.has(n)&&!r.values.length||Mf.has(a)&&!l.values.length?jN(n,a):_l(xx(RN(l,r),r.values),i):rc(n,a)};function _x(n,a,i){return typeof n=="number"&&typeof a=="number"&&typeof i=="number"?rt(n,a,i):Bh(n)(n,a)}const BN=5;function Sx(n,a,i){const l=Math.max(a-BN,0);return Fb(i-n(l),a-l)}const ft={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},ef=.001;function IN({duration:n=ft.duration,bounce:a=ft.bounce,velocity:i=ft.velocity,mass:l=ft.mass}){let r,f,d=1-a;d=ya(ft.minDamping,ft.maxDamping,d),n=ya(ft.minDuration,ft.maxDuration,ma(n)),d<1?(r=g=>{const y=g*d,v=y*n,x=y-i,S=Rf(g,d),C=Math.exp(-v);return ef-x/S*C},f=g=>{const v=g*d*n,x=v*i+i,S=Math.pow(d,2)*Math.pow(g,2)*n,C=Math.exp(-v),k=Rf(Math.pow(g,2),d);return(-r(g)+ef>0?-1:1)*((x-S)*C)/k}):(r=g=>{const y=Math.exp(-g*n),v=(g-i)*n+1;return-ef+y*v},f=g=>{const y=Math.exp(-g*n),v=(i-g)*(n*n);return y*v});const p=5/n,m=zN(r,f,p);if(n=pa(n),isNaN(m))return{stiffness:ft.stiffness,damping:ft.damping,duration:n};{const g=Math.pow(m,2)*l;return{stiffness:g,damping:d*2*Math.sqrt(l*g),duration:n}}}const LN=12;function zN(n,a,i){let l=i;for(let r=1;r<LN;r++)l=l-n(l)/a(l);return l}function Rf(n,a){return n*Math.sqrt(1-a*a)}const UN=["duration","bounce"],VN=["stiffness","damping","mass"];function wy(n,a){return a.some(i=>n[i]!==void 0)}function HN(n){let a={velocity:ft.velocity,stiffness:ft.stiffness,damping:ft.damping,mass:ft.mass,isResolvedFromDuration:!1,...n};if(!wy(n,VN)&&wy(n,UN))if(n.visualDuration){const i=n.visualDuration,l=2*Math.PI/(i*1.2),r=l*l,f=2*ya(.05,1,1-(n.bounce||0))*Math.sqrt(r);a={...a,mass:ft.mass,stiffness:r,damping:f}}else{const i=IN(n);a={...a,...i,mass:ft.mass},a.isResolvedFromDuration=!0}return a}function Tx(n=ft.visualDuration,a=ft.bounce){const i=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:a}:n;let{restSpeed:l,restDelta:r}=i;const f=i.keyframes[0],d=i.keyframes[i.keyframes.length-1],p={done:!1,value:f},{stiffness:m,damping:g,mass:y,duration:v,velocity:x,isResolvedFromDuration:S}=HN({...i,velocity:-ma(i.velocity||0)}),C=x||0,k=g/(2*Math.sqrt(m*y)),N=d-f,E=ma(Math.sqrt(m/y)),w=Math.abs(N)<5;l||(l=w?ft.restSpeed.granular:ft.restSpeed.default),r||(r=w?ft.restDelta.granular:ft.restDelta.default);let D;if(k<1){const U=Rf(E,k);D=Y=>{const F=Math.exp(-k*E*Y);return d-F*((C+k*E*N)/U*Math.sin(U*Y)+N*Math.cos(U*Y))}}else if(k===1)D=U=>d-Math.exp(-E*U)*(N+(C+E*N)*U);else{const U=E*Math.sqrt(k*k-1);D=Y=>{const F=Math.exp(-k*E*Y),O=Math.min(U*Y,300);return d-F*((C+k*E*N)*Math.sinh(O)+U*N*Math.cosh(O))/U}}const A={calculatedDuration:S&&v||null,next:U=>{const Y=D(U);if(S)p.done=U>=v;else{let F=0;k<1&&(F=U===0?pa(C):Sx(D,U,Y));const O=Math.abs(F)<=l,Z=Math.abs(d-Y)<=r;p.done=O&&Z}return p.value=p.done?d:Y,p},toString:()=>{const U=Math.min(bx(A),Df),Y=Yb(F=>A.next(U*F).value,U,30);return U+"ms "+Y}};return A}function jy({keyframes:n,velocity:a=0,power:i=.8,timeConstant:l=325,bounceDamping:r=10,bounceStiffness:f=500,modifyTarget:d,min:p,max:m,restDelta:g=.5,restSpeed:y}){const v=n[0],x={done:!1,value:v},S=O=>p!==void 0&&O<p||m!==void 0&&O>m,C=O=>p===void 0?m:m===void 0||Math.abs(p-O)<Math.abs(m-O)?p:m;let k=i*a;const N=v+k,E=d===void 0?N:d(N);E!==N&&(k=E-v);const w=O=>-k*Math.exp(-O/l),D=O=>E+w(O),A=O=>{const Z=w(O),ee=D(O);x.done=Math.abs(Z)<=g,x.value=x.done?E:ee};let U,Y;const F=O=>{S(x.value)&&(U=O,Y=Tx({keyframes:[x.value,C(x.value)],velocity:Sx(D,O,x.value),damping:r,stiffness:f,restDelta:g,restSpeed:y}))};return F(0),{calculatedDuration:null,next:O=>{let Z=!1;return!Y&&U===void 0&&(Z=!0,A(O),F(O)),U!==void 0&&O>=U?Y.next(O-U):(!Z&&A(O),x)}}}const GN=xl(.42,0,1,1),PN=xl(0,0,.58,1),Cx=xl(.42,0,.58,1),$N=n=>Array.isArray(n)&&typeof n[0]!="number",FN={linear:dn,easeIn:GN,easeInOut:Cx,easeOut:PN,circIn:jh,circInOut:ax,circOut:nx,backIn:wh,backInOut:ex,backOut:Jb,anticipate:tx},Dy=n=>{if(Ah(n)){Cb(n.length===4);const[a,i,l,r]=n;return xl(a,i,l,r)}else if(typeof n=="string")return FN[n];return n};function qN(n,a,i){const l=[],r=i||_x,f=n.length-1;for(let d=0;d<f;d++){let p=r(n[d],n[d+1]);if(a){const m=Array.isArray(a)?a[d]||dn:a;p=_l(m,p)}l.push(p)}return l}function YN(n,a,{clamp:i=!0,ease:l,mixer:r}={}){const f=n.length;if(Cb(f===a.length),f===1)return()=>a[0];if(f===2&&a[0]===a[1])return()=>a[1];const d=n[0]===n[1];n[0]>n[f-1]&&(n=[...n].reverse(),a=[...a].reverse());const p=qN(a,l,r),m=p.length,g=y=>{if(d&&y<n[0])return a[0];let v=0;if(m>1)for(;v<n.length-2&&!(y<n[v+1]);v++);const x=Bi(n[v],n[v+1],y);return p[v](x)};return i?y=>g(ya(n[0],n[f-1],y)):g}function KN(n,a){const i=n[n.length-1];for(let l=1;l<=a;l++){const r=Bi(0,a,l);n.push(rt(i,1,r))}}function ZN(n){const a=[0];return KN(a,n.length-1),a}function XN(n,a){return n.map(i=>i*a)}function QN(n,a){return n.map(()=>a||Cx).splice(0,n.length-1)}function cc({duration:n=300,keyframes:a,times:i,ease:l="easeInOut"}){const r=$N(l)?l.map(Dy):Dy(l),f={done:!1,value:a[0]},d=XN(i&&i.length===a.length?i:ZN(a),n),p=YN(d,a,{ease:Array.isArray(r)?r:QN(a,r)});return{calculatedDuration:n,next:m=>(f.value=p(m),f.done=m>=n,f)}}const WN=n=>{const a=({timestamp:i})=>n(i);return{start:()=>at.update(a,!0),stop:()=>Wa(a),now:()=>Ot.isProcessing?Ot.timestamp:Fn.now()}},JN={decay:jy,inertia:jy,tween:cc,keyframes:cc,spring:Tx},eA=n=>n/100;class Ih extends yx{constructor(a){super(a),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:m}=this.options;m&&m()};const{name:i,motionValue:l,element:r,keyframes:f}=this.options,d=(r==null?void 0:r.KeyframeResolver)||Oh,p=(m,g)=>this.onKeyframesResolved(m,g);this.resolver=new d(f,p,i,l,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(a){const{type:i="keyframes",repeat:l=0,repeatDelay:r=0,repeatType:f,velocity:d=0}=this.options,p=Nh(i)?i:JN[i]||cc;let m,g;p!==cc&&typeof a[0]!="number"&&(m=_l(eA,_x(a[0],a[1])),a=[0,100]);const y=p({...this.options,keyframes:a});f==="mirror"&&(g=p({...this.options,keyframes:[...a].reverse(),velocity:-d})),y.calculatedDuration===null&&(y.calculatedDuration=bx(y));const{calculatedDuration:v}=y,x=v+r,S=x*(l+1)-r;return{generator:y,mirroredGenerator:g,mapPercentToKeyframes:m,calculatedDuration:v,resolvedDuration:x,totalDuration:S}}onPostResolved(){const{autoplay:a=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!a?this.pause():this.state=this.pendingPlayState}tick(a,i=!1){const{resolved:l}=this;if(!l){const{keyframes:O}=this.options;return{done:!0,value:O[O.length-1]}}const{finalKeyframe:r,generator:f,mirroredGenerator:d,mapPercentToKeyframes:p,keyframes:m,calculatedDuration:g,totalDuration:y,resolvedDuration:v}=l;if(this.startTime===null)return f.next(0);const{delay:x,repeat:S,repeatType:C,repeatDelay:k,onUpdate:N}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,a):this.speed<0&&(this.startTime=Math.min(a-y/this.speed,this.startTime)),i?this.currentTime=a:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(a-this.startTime)*this.speed;const E=this.currentTime-x*(this.speed>=0?1:-1),w=this.speed>=0?E<0:E>y;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=y);let D=this.currentTime,A=f;if(S){const O=Math.min(this.currentTime,y)/v;let Z=Math.floor(O),ee=O%1;!ee&&O>=1&&(ee=1),ee===1&&Z--,Z=Math.min(Z,S+1),!!(Z%2)&&(C==="reverse"?(ee=1-ee,k&&(ee-=k/v)):C==="mirror"&&(A=d)),D=ya(0,1,ee)*v}const U=w?{done:!1,value:m[0]}:A.next(D);p&&(U.value=p(U.value));let{done:Y}=U;!w&&g!==null&&(Y=this.speed>=0?this.currentTime>=y:this.currentTime<=0);const F=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&Y);return F&&r!==void 0&&(U.value=Ec(m,this.options,r)),N&&N(U.value),F&&this.finish(),U}get duration(){const{resolved:a}=this;return a?ma(a.calculatedDuration):0}get time(){return ma(this.currentTime)}set time(a){a=pa(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=ma(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:a=WN,onPlay:i,startTime:l}=this.options;this.driver||(this.driver=a(f=>this.tick(f))),i&&i();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=l??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var a;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(a=this.currentTime)!==null&&a!==void 0?a:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:a}=this.options;a&&a()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(a){return this.startTime=0,this.tick(a,!0)}}const tA=new Set(["opacity","clipPath","filter","transform"]);function nA(n,a,i,{delay:l=0,duration:r=300,repeat:f=0,repeatType:d="loop",ease:p="easeInOut",times:m}={}){const g={[a]:i};m&&(g.offset=m);const y=Zb(p,r);return Array.isArray(y)&&(g.easing=y),n.animate(g,{delay:l,duration:r,easing:Array.isArray(y)?"linear":y,fill:"both",iterations:f+1,direction:d==="reverse"?"alternate":"normal"})}const aA=Eh(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),uc=10,sA=2e4;function iA(n){return Nh(n.type)||n.type==="spring"||!Kb(n.ease)}function oA(n,a){const i=new Ih({...a,keyframes:n,repeat:0,delay:0,isGenerator:!0});let l={done:!1,value:n[0]};const r=[];let f=0;for(;!l.done&&f<sA;)l=i.sample(f),r.push(l.value),f+=uc;return{times:void 0,keyframes:r,duration:f-uc,ease:"linear"}}const kx={anticipate:tx,backInOut:ex,circInOut:ax};function lA(n){return n in kx}class My extends yx{constructor(a){super(a);const{name:i,motionValue:l,element:r,keyframes:f}=this.options;this.resolver=new vx(f,(d,p)=>this.onKeyframesResolved(d,p),i,l,r),this.resolver.scheduleResolve()}initPlayback(a,i){let{duration:l=300,times:r,ease:f,type:d,motionValue:p,name:m,startTime:g}=this.options;if(!p.owner||!p.owner.current)return!1;if(typeof f=="string"&&lc()&&lA(f)&&(f=kx[f]),iA(this.options)){const{onComplete:v,onUpdate:x,motionValue:S,element:C,...k}=this.options,N=oA(a,k);a=N.keyframes,a.length===1&&(a[1]=a[0]),l=N.duration,r=N.times,f=N.ease,d="keyframes"}const y=nA(p.owner.current,m,a,{...this.options,duration:l,times:r,ease:f});return y.startTime=g??this.calcStartTime(),this.pendingTimeline?(xy(y,this.pendingTimeline),this.pendingTimeline=void 0):y.onfinish=()=>{const{onComplete:v}=this.options;p.set(Ec(a,this.options,i)),v&&v(),this.cancel(),this.resolveFinishedPromise()},{animation:y,duration:l,times:r,type:d,ease:f,keyframes:a}}get duration(){const{resolved:a}=this;if(!a)return 0;const{duration:i}=a;return ma(i)}get time(){const{resolved:a}=this;if(!a)return 0;const{animation:i}=a;return ma(i.currentTime||0)}set time(a){const{resolved:i}=this;if(!i)return;const{animation:l}=i;l.currentTime=pa(a)}get speed(){const{resolved:a}=this;if(!a)return 1;const{animation:i}=a;return i.playbackRate}set speed(a){const{resolved:i}=this;if(!i)return;const{animation:l}=i;l.playbackRate=a}get state(){const{resolved:a}=this;if(!a)return"idle";const{animation:i}=a;return i.playState}get startTime(){const{resolved:a}=this;if(!a)return null;const{animation:i}=a;return i.startTime}attachTimeline(a){if(!this._resolved)this.pendingTimeline=a;else{const{resolved:i}=this;if(!i)return dn;const{animation:l}=i;xy(l,a)}return dn}play(){if(this.isStopped)return;const{resolved:a}=this;if(!a)return;const{animation:i}=a;i.playState==="finished"&&this.updateFinishedPromise(),i.play()}pause(){const{resolved:a}=this;if(!a)return;const{animation:i}=a;i.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:a}=this;if(!a)return;const{animation:i,keyframes:l,duration:r,type:f,ease:d,times:p}=a;if(i.playState==="idle"||i.playState==="finished")return;if(this.time){const{motionValue:g,onUpdate:y,onComplete:v,element:x,...S}=this.options,C=new Ih({...S,keyframes:l,duration:r,type:f,ease:d,times:p,isGenerator:!0}),k=pa(this.time);g.setWithVelocity(C.sample(k-uc).value,C.sample(k).value,uc)}const{onStop:m}=this.options;m&&m(),this.cancel()}complete(){const{resolved:a}=this;a&&a.animation.finish()}cancel(){const{resolved:a}=this;a&&a.animation.cancel()}static supports(a){const{motionValue:i,name:l,repeatDelay:r,repeatType:f,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 aA()&&l&&tA.has(l)&&!m&&!g&&!r&&f!=="mirror"&&d!==0&&p!=="inertia"}}const rA={type:"spring",stiffness:500,damping:25,restSpeed:10},cA=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),uA={type:"keyframes",duration:.8},dA={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},fA=(n,{keyframes:a})=>a.length>2?uA:Ds.has(n)?n.startsWith("scale")?cA(a[1]):rA:dA;function hA({when:n,delay:a,delayChildren:i,staggerChildren:l,staggerDirection:r,repeat:f,repeatType:d,repeatDelay:p,from:m,elapsed:g,...y}){return!!Object.keys(y).length}const Lh=(n,a,i,l={},r,f)=>d=>{const p=Sh(l,n)||{},m=p.delay||l.delay||0;let{elapsed:g=0}=l;g=g-pa(m);let y={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:a.getVelocity(),...p,delay:-g,onUpdate:x=>{a.set(x),p.onUpdate&&p.onUpdate(x)},onComplete:()=>{d(),p.onComplete&&p.onComplete()},name:n,motionValue:a,element:f?void 0:r};hA(p)||(y={...y,...fA(n,y)}),y.duration&&(y.duration=pa(y.duration)),y.repeatDelay&&(y.repeatDelay=pa(y.repeatDelay)),y.from!==void 0&&(y.keyframes[0]=y.from);let v=!1;if((y.type===!1||y.duration===0&&!y.repeatDelay)&&(y.duration=0,y.delay===0&&(v=!0)),v&&!f&&a.get()!==void 0){const x=Ec(y.keyframes,p);if(x!==void 0)return at.update(()=>{y.onUpdate(x),y.onComplete()}),new FE([])}return!f&&My.supports(y)?new My(y):new Ih(y)};function pA({protectedKeys:n,needsAnimating:a},i){const l=n.hasOwnProperty(i)&&a[i]!==!0;return a[i]=!1,l}function Ex(n,a,{delay:i=0,transitionOverride:l,type:r}={}){var f;let{transition:d=n.getDefaultTransition(),transitionEnd:p,...m}=a;l&&(d=l);const g=[],y=r&&n.animationState&&n.animationState.getState()[r];for(const v in m){const x=n.getValue(v,(f=n.latestValues[v])!==null&&f!==void 0?f:null),S=m[v];if(S===void 0||y&&pA(y,v))continue;const C={delay:i,...Sh(d||{},v)};let k=!1;if(window.MotionHandoffAnimation){const E=qb(n);if(E){const w=window.MotionHandoffAnimation(E,v,at);w!==null&&(C.startTime=w,k=!0)}}kf(n,v),x.start(Lh(v,x,S,n.shouldReduceMotion&&$b.has(v)?{type:!1}:C,n,k));const N=x.animation;N&&g.push(N)}return p&&Promise.all(g).then(()=>{at.update(()=>{p&&HE(n,p)})}),g}function Of(n,a,i={}){var l;const r=kc(n,a,i.type==="exit"?(l=n.presenceContext)===null||l===void 0?void 0:l.custom:void 0);let{transition:f=n.getDefaultTransition()||{}}=r||{};i.transitionOverride&&(f=i.transitionOverride);const d=r?()=>Promise.all(Ex(n,r,i)):()=>Promise.resolve(),p=n.variantChildren&&n.variantChildren.size?(g=0)=>{const{delayChildren:y=0,staggerChildren:v,staggerDirection:x}=f;return mA(n,a,y+g,v,x,i)}:()=>Promise.resolve(),{when:m}=f;if(m){const[g,y]=m==="beforeChildren"?[d,p]:[p,d];return g().then(()=>y())}else return Promise.all([d(),p(i.delay)])}function mA(n,a,i=0,l=0,r=1,f){const d=[],p=(n.variantChildren.size-1)*l,m=r===1?(g=0)=>g*l:(g=0)=>p-g*l;return Array.from(n.variantChildren).sort(gA).forEach((g,y)=>{g.notify("AnimationStart",a),d.push(Of(g,a,{...f,delay:i+m(y)}).then(()=>g.notify("AnimationComplete",a)))}),Promise.all(d)}function gA(n,a){return n.sortNodePosition(a)}function vA(n,a,i={}){n.notify("AnimationStart",a);let l;if(Array.isArray(a)){const r=a.map(f=>Of(n,f,i));l=Promise.all(r)}else if(typeof a=="string")l=Of(n,a,i);else{const r=typeof a=="function"?kc(n,a,i.custom):a;l=Promise.all(Ex(n,r,i))}return l.then(()=>{n.notify("AnimationComplete",a)})}const yA=uh.length;function Nx(n){if(!n)return;if(!n.isControllingVariants){const i=n.parent?Nx(n.parent)||{}:{};return n.props.initial!==void 0&&(i.initial=n.props.initial),i}const a={};for(let i=0;i<yA;i++){const l=uh[i],r=n.props[l];(ul(r)||r===!1)&&(a[l]=r)}return a}const bA=[...ch].reverse(),xA=ch.length;function _A(n){return a=>Promise.all(a.map(({animation:i,options:l})=>vA(n,i,l)))}function SA(n){let a=_A(n),i=Ry(),l=!0;const r=m=>(g,y)=>{var v;const x=kc(n,y,m==="exit"?(v=n.presenceContext)===null||v===void 0?void 0:v.custom:void 0);if(x){const{transition:S,transitionEnd:C,...k}=x;g={...g,...k,...C}}return g};function f(m){a=m(n)}function d(m){const{props:g}=n,y=Nx(n.parent)||{},v=[],x=new Set;let S={},C=1/0;for(let N=0;N<xA;N++){const E=bA[N],w=i[E],D=g[E]!==void 0?g[E]:y[E],A=ul(D),U=E===m?w.isActive:null;U===!1&&(C=N);let Y=D===y[E]&&D!==g[E]&&A;if(Y&&l&&n.manuallyAnimateOnMount&&(Y=!1),w.protectedKeys={...S},!w.isActive&&U===null||!D&&!w.prevProp||Tc(D)||typeof D=="boolean")continue;const F=TA(w.prevProp,D);let O=F||E===m&&w.isActive&&!Y&&A||N>C&&A,Z=!1;const ee=Array.isArray(D)?D:[D];let ie=ee.reduce(r(E),{});U===!1&&(ie={});const{prevResolvedValues:R={}}=w,ae={...R,...ie},X=H=>{O=!0,x.has(H)&&(Z=!0,x.delete(H)),w.needsAnimating[H]=!0;const z=n.getValue(H);z&&(z.liveStyle=!1)};for(const H in ae){const z=ie[H],re=R[H];if(S.hasOwnProperty(H))continue;let B=!1;Cf(z)&&Cf(re)?B=!Pb(z,re):B=z!==re,B?z!=null?X(H):x.add(H):z!==void 0&&x.has(H)?X(H):w.protectedKeys[H]=!0}w.prevProp=D,w.prevResolvedValues=ie,w.isActive&&(S={...S,...ie}),l&&n.blockInitialAnimation&&(O=!1),O&&(!(Y&&F)||Z)&&v.push(...ee.map(H=>({animation:H,options:{type:E}})))}if(x.size){const N={};x.forEach(E=>{const w=n.getBaseTarget(E),D=n.getValue(E);D&&(D.liveStyle=!0),N[E]=w??null}),v.push({animation:N})}let k=!!v.length;return l&&(g.initial===!1||g.initial===g.animate)&&!n.manuallyAnimateOnMount&&(k=!1),l=!1,k?a(v):Promise.resolve()}function p(m,g){var y;if(i[m].isActive===g)return Promise.resolve();(y=n.variantChildren)===null||y===void 0||y.forEach(x=>{var S;return(S=x.animationState)===null||S===void 0?void 0:S.setActive(m,g)}),i[m].isActive=g;const v=d(m);for(const x in i)i[x].protectedKeys={};return v}return{animateChanges:d,setActive:p,setAnimateFunction:f,getState:()=>i,reset:()=>{i=Ry(),l=!0}}}function TA(n,a){return typeof a=="string"?a!==n:Array.isArray(a)?!Pb(a,n):!1}function Ss(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ry(){return{animate:Ss(!0),whileInView:Ss(),whileHover:Ss(),whileTap:Ss(),whileDrag:Ss(),whileFocus:Ss(),exit:Ss()}}class ts{constructor(a){this.isMounted=!1,this.node=a}update(){}}class CA extends ts{constructor(a){super(a),a.animationState||(a.animationState=SA(a))}updateAnimationControlsSubscription(){const{animate:a}=this.node.getProps();Tc(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 kA=0;class EA extends ts{constructor(){super(...arguments),this.id=kA++}update(){if(!this.node.presenceContext)return;const{isPresent:a,onExitComplete:i}=this.node.presenceContext,{isPresent:l}=this.node.prevPresenceContext||{};if(!this.node.animationState||a===l)return;const r=this.node.animationState.setActive("exit",!a);i&&!a&&r.then(()=>i(this.id))}mount(){const{register:a}=this.node.presenceContext||{};a&&(this.unmount=a(this.id))}unmount(){}}const NA={animation:{Feature:CA},exit:{Feature:EA}},Mn={x:!1,y:!1};function Ax(){return Mn.x||Mn.y}function AA(n){return n==="x"||n==="y"?Mn[n]?null:(Mn[n]=!0,()=>{Mn[n]=!1}):Mn.x||Mn.y?null:(Mn.x=Mn.y=!0,()=>{Mn.x=Mn.y=!1})}const zh=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1;function pl(n,a,i,l={passive:!0}){return n.addEventListener(a,i,l),()=>n.removeEventListener(a,i)}function Sl(n){return{point:{x:n.pageX,y:n.pageY}}}const wA=n=>a=>zh(a)&&n(a,Sl(a));function nl(n,a,i,l){return pl(n,a,wA(i),l)}const Oy=(n,a)=>Math.abs(n-a);function jA(n,a){const i=Oy(n.x,a.x),l=Oy(n.y,a.y);return Math.sqrt(i**2+l**2)}class wx{constructor(a,i,{transformPagePoint:l,contextWindow:r,dragSnapToOrigin:f=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=nf(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,S=jA(v.offset,{x:0,y:0})>=3;if(!x&&!S)return;const{point:C}=v,{timestamp:k}=Ot;this.history.push({...C,timestamp:k});const{onStart:N,onMove:E}=this.handlers;x||(N&&N(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),E&&E(this.lastMoveEvent,v)},this.handlePointerMove=(v,x)=>{this.lastMoveEvent=v,this.lastMoveEventInfo=tf(x,this.transformPagePoint),at.update(this.updatePoint,!0)},this.handlePointerUp=(v,x)=>{this.end();const{onEnd:S,onSessionEnd:C,resumeAnimation:k}=this.handlers;if(this.dragSnapToOrigin&&k&&k(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const N=nf(v.type==="pointercancel"?this.lastMoveEventInfo:tf(x,this.transformPagePoint),this.history);this.startEvent&&S&&S(v,N),C&&C(v,N)},!zh(a))return;this.dragSnapToOrigin=f,this.handlers=i,this.transformPagePoint=l,this.contextWindow=r||window;const d=Sl(a),p=tf(d,this.transformPagePoint),{point:m}=p,{timestamp:g}=Ot;this.history=[{...m,timestamp:g}];const{onSessionStart:y}=i;y&&y(a,nf(p,this.history)),this.removeListeners=_l(nl(this.contextWindow,"pointermove",this.handlePointerMove),nl(this.contextWindow,"pointerup",this.handlePointerUp),nl(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(a){this.handlers=a}end(){this.removeListeners&&this.removeListeners(),Wa(this.updatePoint)}}function tf(n,a){return a?{point:a(n.point)}:n}function By(n,a){return{x:n.x-a.x,y:n.y-a.y}}function nf({point:n},a){return{point:n,delta:By(n,jx(a)),offset:By(n,DA(a)),velocity:MA(a,.1)}}function DA(n){return n[0]}function jx(n){return n[n.length-1]}function MA(n,a){if(n.length<2)return{x:0,y:0};let i=n.length-1,l=null;const r=jx(n);for(;i>=0&&(l=n[i],!(r.timestamp-l.timestamp>pa(a)));)i--;if(!l)return{x:0,y:0};const f=ma(r.timestamp-l.timestamp);if(f===0)return{x:0,y:0};const d={x:(r.x-l.x)/f,y:(r.y-l.y)/f};return d.x===1/0&&(d.x=0),d.y===1/0&&(d.y=0),d}const Dx=1e-4,RA=1-Dx,OA=1+Dx,Mx=.01,BA=0-Mx,IA=0+Mx;function fn(n){return n.max-n.min}function LA(n,a,i){return Math.abs(n-a)<=i}function Iy(n,a,i,l=.5){n.origin=l,n.originPoint=rt(a.min,a.max,n.origin),n.scale=fn(i)/fn(a),n.translate=rt(i.min,i.max,n.origin)-n.originPoint,(n.scale>=RA&&n.scale<=OA||isNaN(n.scale))&&(n.scale=1),(n.translate>=BA&&n.translate<=IA||isNaN(n.translate))&&(n.translate=0)}function al(n,a,i,l){Iy(n.x,a.x,i.x,l?l.originX:void 0),Iy(n.y,a.y,i.y,l?l.originY:void 0)}function Ly(n,a,i){n.min=i.min+a.min,n.max=n.min+fn(a)}function zA(n,a,i){Ly(n.x,a.x,i.x),Ly(n.y,a.y,i.y)}function zy(n,a,i){n.min=a.min-i.min,n.max=n.min+fn(a)}function sl(n,a,i){zy(n.x,a.x,i.x),zy(n.y,a.y,i.y)}function UA(n,{min:a,max:i},l){return a!==void 0&&n<a?n=l?rt(a,n,l.min):Math.max(n,a):i!==void 0&&n>i&&(n=l?rt(i,n,l.max):Math.min(n,i)),n}function Uy(n,a,i){return{min:a!==void 0?n.min+a:void 0,max:i!==void 0?n.max+i-(n.max-n.min):void 0}}function VA(n,{top:a,left:i,bottom:l,right:r}){return{x:Uy(n.x,i,r),y:Uy(n.y,a,l)}}function Vy(n,a){let i=a.min-n.min,l=a.max-n.max;return a.max-a.min<n.max-n.min&&([i,l]=[l,i]),{min:i,max:l}}function HA(n,a){return{x:Vy(n.x,a.x),y:Vy(n.y,a.y)}}function GA(n,a){let i=.5;const l=fn(n),r=fn(a);return r>l?i=Bi(a.min,a.max-l,n.min):l>r&&(i=Bi(n.min,n.max-r,a.min)),ya(0,1,i)}function PA(n,a){const i={};return a.min!==void 0&&(i.min=a.min-n.min),a.max!==void 0&&(i.max=a.max-n.min),i}const Bf=.35;function $A(n=Bf){return n===!1?n=0:n===!0&&(n=Bf),{x:Hy(n,"left","right"),y:Hy(n,"top","bottom")}}function Hy(n,a,i){return{min:Gy(n,a),max:Gy(n,i)}}function Gy(n,a){return typeof n=="number"?n:n[a]||0}const Py=()=>({translate:0,scale:1,origin:0,originPoint:0}),wi=()=>({x:Py(),y:Py()}),$y=()=>({min:0,max:0}),gt=()=>({x:$y(),y:$y()});function En(n){return[n("x"),n("y")]}function Rx({top:n,left:a,right:i,bottom:l}){return{x:{min:a,max:i},y:{min:n,max:l}}}function FA({x:n,y:a}){return{top:a.min,right:n.max,bottom:a.max,left:n.min}}function qA(n,a){if(!a)return n;const i=a({x:n.left,y:n.top}),l=a({x:n.right,y:n.bottom});return{top:i.y,left:i.x,bottom:l.y,right:l.x}}function af(n){return n===void 0||n===1}function If({scale:n,scaleX:a,scaleY:i}){return!af(n)||!af(a)||!af(i)}function ks(n){return If(n)||Ox(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function Ox(n){return Fy(n.x)||Fy(n.y)}function Fy(n){return n&&n!=="0%"}function dc(n,a,i){const l=n-i,r=a*l;return i+r}function qy(n,a,i,l,r){return r!==void 0&&(n=dc(n,r,l)),dc(n,i,l)+a}function Lf(n,a=0,i=1,l,r){n.min=qy(n.min,a,i,l,r),n.max=qy(n.max,a,i,l,r)}function Bx(n,{x:a,y:i}){Lf(n.x,a.translate,a.scale,a.originPoint),Lf(n.y,i.translate,i.scale,i.originPoint)}const Yy=.999999999999,Ky=1.0000000000001;function YA(n,a,i,l=!1){const r=i.length;if(!r)return;a.x=a.y=1;let f,d;for(let p=0;p<r;p++){f=i[p],d=f.projectionDelta;const{visualElement:m}=f.options;m&&m.props.style&&m.props.style.display==="contents"||(l&&f.options.layoutScroll&&f.scroll&&f!==f.root&&Di(n,{x:-f.scroll.offset.x,y:-f.scroll.offset.y}),d&&(a.x*=d.x.scale,a.y*=d.y.scale,Bx(n,d)),l&&ks(f.latestValues)&&Di(n,f.latestValues))}a.x<Ky&&a.x>Yy&&(a.x=1),a.y<Ky&&a.y>Yy&&(a.y=1)}function ji(n,a){n.min=n.min+a,n.max=n.max+a}function Zy(n,a,i,l,r=.5){const f=rt(n.min,n.max,r);Lf(n,a,i,f,l)}function Di(n,a){Zy(n.x,a.x,a.scaleX,a.scale,a.originX),Zy(n.y,a.y,a.scaleY,a.scale,a.originY)}function Ix(n,a){return Rx(qA(n.getBoundingClientRect(),a))}function KA(n,a,i){const l=Ix(n,i),{scroll:r}=a;return r&&(ji(l.x,r.offset.x),ji(l.y,r.offset.y)),l}const Lx=({current:n})=>n?n.ownerDocument.defaultView:null,ZA=new WeakMap;class XA{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=gt(),this.visualElement=a}start(a,{snapToCursor:i=!1}={}){const{presenceContext:l}=this.visualElement;if(l&&l.isPresent===!1)return;const r=y=>{const{dragSnapToOrigin:v}=this.getProps();v?this.pauseAnimation():this.stopAnimation(),i&&this.snapToCursor(Sl(y).point)},f=(y,v)=>{const{drag:x,dragPropagation:S,onDragStart:C}=this.getProps();if(x&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=AA(x),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),En(N=>{let E=this.getAxisMotionValue(N).get()||0;if($n.test(E)){const{projection:w}=this.visualElement;if(w&&w.layout){const D=w.layout.layoutBox[N];D&&(E=fn(D)*(parseFloat(E)/100))}}this.originPoint[N]=E}),C&&at.postRender(()=>C(y,v)),kf(this.visualElement,"transform");const{animationState:k}=this.visualElement;k&&k.setActive("whileDrag",!0)},d=(y,v)=>{const{dragPropagation:x,dragDirectionLock:S,onDirectionLock:C,onDrag:k}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:N}=v;if(S&&this.currentDirection===null){this.currentDirection=QA(N),this.currentDirection!==null&&C&&C(this.currentDirection);return}this.updateAxis("x",v.point,N),this.updateAxis("y",v.point,N),this.visualElement.render(),k&&k(y,v)},p=(y,v)=>this.stop(y,v),m=()=>En(y=>{var v;return this.getAnimationState(y)==="paused"&&((v=this.getAxisMotionValue(y).animation)===null||v===void 0?void 0:v.play())}),{dragSnapToOrigin:g}=this.getProps();this.panSession=new wx(a,{onSessionStart:r,onStart:f,onMove:d,onSessionEnd:p,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,contextWindow:Lx(this.visualElement)})}stop(a,i){const l=this.isDragging;if(this.cancel(),!l)return;const{velocity:r}=i;this.startAnimation(r);const{onDragEnd:f}=this.getProps();f&&at.postRender(()=>f(a,i))}cancel(){this.isDragging=!1;const{projection:a,animationState:i}=this.visualElement;a&&(a.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:l}=this.getProps();!l&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}updateAxis(a,i,l){const{drag:r}=this.getProps();if(!l||!$r(a,r,this.currentDirection))return;const f=this.getAxisMotionValue(a);let d=this.originPoint[a]+l[a];this.constraints&&this.constraints[a]&&(d=UA(d,this.constraints[a],this.elastic[a])),f.set(d)}resolveConstraints(){var a;const{dragConstraints:i,dragElastic:l}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)===null||a===void 0?void 0:a.layout,f=this.constraints;i&&Ni(i)?this.constraints||(this.constraints=this.resolveRefConstraints()):i&&r?this.constraints=VA(r.layoutBox,i):this.constraints=!1,this.elastic=$A(l),f!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&En(d=>{this.constraints!==!1&&this.getAxisMotionValue(d)&&(this.constraints[d]=PA(r.layoutBox[d],this.constraints[d]))})}resolveRefConstraints(){const{dragConstraints:a,onMeasureDragConstraints:i}=this.getProps();if(!a||!Ni(a))return!1;const l=a.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const f=KA(l,r.root,this.visualElement.getTransformPagePoint());let d=HA(r.layout.layoutBox,f);if(i){const p=i(FA(d));this.hasMutatedConstraints=!!p,p&&(d=Rx(p))}return d}startAnimation(a){const{drag:i,dragMomentum:l,dragElastic:r,dragTransition:f,dragSnapToOrigin:d,onDragTransitionEnd:p}=this.getProps(),m=this.constraints||{},g=En(y=>{if(!$r(y,i,this.currentDirection))return;let v=m&&m[y]||{};d&&(v={min:0,max:0});const x=r?200:1e6,S=r?40:1e7,C={type:"inertia",velocity:l?a[y]:0,bounceStiffness:x,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...f,...v};return this.startAxisValueAnimation(y,C)});return Promise.all(g).then(p)}startAxisValueAnimation(a,i){const l=this.getAxisMotionValue(a);return kf(this.visualElement,a),l.start(Lh(a,l,0,i,this.visualElement,!1))}stopAnimation(){En(a=>this.getAxisMotionValue(a).stop())}pauseAnimation(){En(a=>{var i;return(i=this.getAxisMotionValue(a).animation)===null||i===void 0?void 0:i.pause()})}getAnimationState(a){var i;return(i=this.getAxisMotionValue(a).animation)===null||i===void 0?void 0:i.state}getAxisMotionValue(a){const i=`_drag${a.toUpperCase()}`,l=this.visualElement.getProps(),r=l[i];return r||this.visualElement.getValue(a,(l.initial?l.initial[a]:void 0)||0)}snapToCursor(a){En(i=>{const{drag:l}=this.getProps();if(!$r(i,l,this.currentDirection))return;const{projection:r}=this.visualElement,f=this.getAxisMotionValue(i);if(r&&r.layout){const{min:d,max:p}=r.layout.layoutBox[i];f.set(a[i]-rt(d,p,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:a,dragConstraints:i}=this.getProps(),{projection:l}=this.visualElement;if(!Ni(i)||!l||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};En(d=>{const p=this.getAxisMotionValue(d);if(p&&this.constraints!==!1){const m=p.get();r[d]=GA({min:m,max:m},this.constraints[d])}});const{transformTemplate:f}=this.visualElement.getProps();this.visualElement.current.style.transform=f?f({},""):"none",l.root&&l.root.updateScroll(),l.updateLayout(),this.resolveConstraints(),En(d=>{if(!$r(d,a,null))return;const p=this.getAxisMotionValue(d),{min:m,max:g}=this.constraints[d];p.set(rt(m,g,r[d]))})}addListeners(){if(!this.visualElement.current)return;ZA.set(this.visualElement,this);const a=this.visualElement.current,i=nl(a,"pointerdown",m=>{const{drag:g,dragListener:y=!0}=this.getProps();g&&y&&this.start(m)}),l=()=>{const{dragConstraints:m}=this.getProps();Ni(m)&&m.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,f=r.addEventListener("measure",l);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),at.read(l);const d=pl(window,"resize",()=>this.scalePositionWithinConstraints()),p=r.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:g})=>{this.isDragging&&g&&(En(y=>{const v=this.getAxisMotionValue(y);v&&(this.originPoint[y]+=m[y].translate,v.set(v.get()+m[y].translate))}),this.visualElement.render())}));return()=>{d(),i(),f(),p&&p()}}getProps(){const a=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:l=!1,dragPropagation:r=!1,dragConstraints:f=!1,dragElastic:d=Bf,dragMomentum:p=!0}=a;return{...a,drag:i,dragDirectionLock:l,dragPropagation:r,dragConstraints:f,dragElastic:d,dragMomentum:p}}}function $r(n,a,i){return(a===!0||a===n)&&(i===null||i===n)}function QA(n,a=10){let i=null;return Math.abs(n.y)>a?i="y":Math.abs(n.x)>a&&(i="x"),i}class WA extends ts{constructor(a){super(a),this.removeGroupControls=dn,this.removeListeners=dn,this.controls=new XA(a)}mount(){const{dragControls:a}=this.node.getProps();a&&(this.removeGroupControls=a.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||dn}unmount(){this.removeGroupControls(),this.removeListeners()}}const Xy=n=>(a,i)=>{n&&at.postRender(()=>n(a,i))};class JA extends ts{constructor(){super(...arguments),this.removePointerDownListener=dn}onPointerDown(a){this.session=new wx(a,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Lx(this.node)})}createPanHandlers(){const{onPanSessionStart:a,onPanStart:i,onPan:l,onPanEnd:r}=this.node.getProps();return{onSessionStart:Xy(a),onStart:Xy(i),onMove:l,onEnd:(f,d)=>{delete this.session,r&&at.postRender(()=>r(f,d))}}}mount(){this.removePointerDownListener=nl(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 tc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Qy(n,a){return a.max===a.min?0:n/(a.max-a.min)*100}const $o={correct:(n,a)=>{if(!a.target)return n;if(typeof n=="string")if(ve.test(n))n=parseFloat(n);else return n;const i=Qy(n,a.target.x),l=Qy(n,a.target.y);return`${i}% ${l}%`}},ew={correct:(n,{treeScale:a,projectionDelta:i})=>{const l=n,r=Ja.parse(n);if(r.length>5)return l;const f=Ja.createTransformer(n),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=rt(p,m,.5);return typeof r[2+d]=="number"&&(r[2+d]/=g),typeof r[3+d]=="number"&&(r[3+d]/=g),f(r)}};class tw extends b.Component{componentDidMount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:l,layoutId:r}=this.props,{projection:f}=a;NE(nw),f&&(i.group&&i.group.add(f),l&&l.register&&r&&l.register(f),f.root.didUpdate(),f.addEventListener("animationComplete",()=>{this.safeToRemove()}),f.setOptions({...f.options,onExitComplete:()=>this.safeToRemove()})),tc.hasEverUpdated=!0}getSnapshotBeforeUpdate(a){const{layoutDependency:i,visualElement:l,drag:r,isPresent:f}=this.props,d=l.projection;return d&&(d.isPresent=f,r||a.layoutDependency!==i||i===void 0?d.willUpdate():this.safeToRemove(),a.isPresent!==f&&(f?d.promote():d.relegate()||at.postRender(()=>{const p=d.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:a}=this.props.visualElement;a&&(a.root.didUpdate(),fh.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:l}=this.props,{projection:r}=a;r&&(r.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(r),l&&l.deregister&&l.deregister(r))}safeToRemove(){const{safeToRemove:a}=this.props;a&&a()}render(){return null}}function zx(n){const[a,i]=Sb(),l=b.useContext(ih);return c.jsx(tw,{...n,layoutGroup:l,switchLayoutGroup:b.useContext(jb),isPresent:a,safeToRemove:i})}const nw={borderRadius:{...$o,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:$o,borderTopRightRadius:$o,borderBottomLeftRadius:$o,borderBottomRightRadius:$o,boxShadow:ew};function aw(n,a,i){const l=zt(n)?n:fl(n);return l.start(Lh("",l,a,i)),l.animation}function sw(n){return n instanceof SVGElement&&n.tagName!=="svg"}const iw=(n,a)=>n.depth-a.depth;class ow{constructor(){this.children=[],this.isDirty=!1}add(a){Th(this.children,a),this.isDirty=!0}remove(a){Ch(this.children,a),this.isDirty=!0}forEach(a){this.isDirty&&this.children.sort(iw),this.isDirty=!1,this.children.forEach(a)}}function lw(n,a){const i=Fn.now(),l=({timestamp:r})=>{const f=r-i;f>=a&&(Wa(l),n(f-a))};return at.read(l,!0),()=>Wa(l)}const Ux=["TopLeft","TopRight","BottomLeft","BottomRight"],rw=Ux.length,Wy=n=>typeof n=="string"?parseFloat(n):n,Jy=n=>typeof n=="number"||ve.test(n);function cw(n,a,i,l,r,f){r?(n.opacity=rt(0,i.opacity!==void 0?i.opacity:1,uw(l)),n.opacityExit=rt(a.opacity!==void 0?a.opacity:1,0,dw(l))):f&&(n.opacity=rt(a.opacity!==void 0?a.opacity:1,i.opacity!==void 0?i.opacity:1,l));for(let d=0;d<rw;d++){const p=`border${Ux[d]}Radius`;let m=e0(a,p),g=e0(i,p);if(m===void 0&&g===void 0)continue;m||(m=0),g||(g=0),m===0||g===0||Jy(m)===Jy(g)?(n[p]=Math.max(rt(Wy(m),Wy(g),l),0),($n.test(g)||$n.test(m))&&(n[p]+="%")):n[p]=g}(a.rotate||i.rotate)&&(n.rotate=rt(a.rotate||0,i.rotate||0,l))}function e0(n,a){return n[a]!==void 0?n[a]:n.borderRadius}const uw=Vx(0,.5,nx),dw=Vx(.5,.95,dn);function Vx(n,a,i){return l=>l<n?0:l>a?1:i(Bi(n,a,l))}function t0(n,a){n.min=a.min,n.max=a.max}function kn(n,a){t0(n.x,a.x),t0(n.y,a.y)}function n0(n,a){n.translate=a.translate,n.scale=a.scale,n.originPoint=a.originPoint,n.origin=a.origin}function a0(n,a,i,l,r){return n-=a,n=dc(n,1/i,l),r!==void 0&&(n=dc(n,1/r,l)),n}function fw(n,a=0,i=1,l=.5,r,f=n,d=n){if($n.test(a)&&(a=parseFloat(a),a=rt(d.min,d.max,a/100)-d.min),typeof a!="number")return;let p=rt(f.min,f.max,l);n===f&&(p-=a),n.min=a0(n.min,a,i,p,r),n.max=a0(n.max,a,i,p,r)}function s0(n,a,[i,l,r],f,d){fw(n,a[i],a[l],a[r],a.scale,f,d)}const hw=["x","scaleX","originX"],pw=["y","scaleY","originY"];function i0(n,a,i,l){s0(n.x,a,hw,i?i.x:void 0,l?l.x:void 0),s0(n.y,a,pw,i?i.y:void 0,l?l.y:void 0)}function o0(n){return n.translate===0&&n.scale===1}function Hx(n){return o0(n.x)&&o0(n.y)}function l0(n,a){return n.min===a.min&&n.max===a.max}function mw(n,a){return l0(n.x,a.x)&&l0(n.y,a.y)}function r0(n,a){return Math.round(n.min)===Math.round(a.min)&&Math.round(n.max)===Math.round(a.max)}function Gx(n,a){return r0(n.x,a.x)&&r0(n.y,a.y)}function c0(n){return fn(n.x)/fn(n.y)}function u0(n,a){return n.translate===a.translate&&n.scale===a.scale&&n.originPoint===a.originPoint}class gw{constructor(){this.members=[]}add(a){Th(this.members,a),a.scheduleRender()}remove(a){if(Ch(this.members,a),a===this.prevLead&&(this.prevLead=void 0),a===this.lead){const i=this.members[this.members.length-1];i&&this.promote(i)}}relegate(a){const i=this.members.findIndex(r=>a===r);if(i===0)return!1;let l;for(let r=i;r>=0;r--){const f=this.members[r];if(f.isPresent!==!1){l=f;break}}return l?(this.promote(l),!0):!1}promote(a,i){const l=this.lead;if(a!==l&&(this.prevLead=l,this.lead=a,a.show(),l)){l.instance&&l.scheduleRender(),a.scheduleRender(),a.resumeFrom=l,i&&(a.resumeFrom.preserveOpacity=!0),l.snapshot&&(a.snapshot=l.snapshot,a.snapshot.latestValues=l.animationValues||l.latestValues),a.root&&a.root.isUpdating&&(a.isLayoutDirty=!0);const{crossfade:r}=a.options;r===!1&&l.hide()}}exitAnimationComplete(){this.members.forEach(a=>{const{options:i,resumingFrom:l}=a;i.onExitComplete&&i.onExitComplete(),l&&l.options.onExitComplete&&l.options.onExitComplete()})}scheduleRender(){this.members.forEach(a=>{a.instance&&a.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function vw(n,a,i){let l="";const r=n.x.translate/a.x,f=n.y.translate/a.y,d=(i==null?void 0:i.z)||0;if((r||f||d)&&(l=`translate3d(${r}px, ${f}px, ${d}px) `),(a.x!==1||a.y!==1)&&(l+=`scale(${1/a.x}, ${1/a.y}) `),i){const{transformPerspective:g,rotate:y,rotateX:v,rotateY:x,skewX:S,skewY:C}=i;g&&(l=`perspective(${g}px) ${l}`),y&&(l+=`rotate(${y}deg) `),v&&(l+=`rotateX(${v}deg) `),x&&(l+=`rotateY(${x}deg) `),S&&(l+=`skewX(${S}deg) `),C&&(l+=`skewY(${C}deg) `)}const p=n.x.scale*a.x,m=n.y.scale*a.y;return(p!==1||m!==1)&&(l+=`scale(${p}, ${m})`),l||"none"}const Es={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Xo=typeof window<"u"&&window.MotionDebug!==void 0,sf=["","X","Y","Z"],yw={visibility:"hidden"},d0=1e3;let bw=0;function of(n,a,i,l){const{latestValues:r}=a;r[n]&&(i[n]=r[n],a.setStaticValue(n,0),l&&(l[n]=0))}function Px(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:a}=n.options;if(!a)return;const i=qb(a);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:r,layoutId:f}=n.options;window.MotionCancelOptimisedAnimation(i,"transform",at,!(r||f))}const{parent:l}=n;l&&!l.hasCheckedOptimisedAppear&&Px(l)}function $x({attachResizeListener:n,defaultParent:a,measureScroll:i,checkIsScrollRoot:l,resetTransform:r}){return class{constructor(d={},p=a==null?void 0:a()){this.id=bw++,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,Xo&&(Es.totalNodes=Es.resolvedTargetDeltas=Es.recalculatedProjection=0),this.nodes.forEach(Sw),this.nodes.forEach(Nw),this.nodes.forEach(Aw),this.nodes.forEach(Tw),Xo&&window.MotionDebug.record(Es)},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 ow)}addEventListener(d,p){return this.eventHandlers.has(d)||this.eventHandlers.set(d,new kh),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=sw(d),this.instance=d;const{layoutId:m,layout:g,visualElement:y}=this.options;if(y&&!y.current&&y.mount(d),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),p&&(g||m)&&(this.isLayoutDirty=!0),n){let v;const x=()=>this.root.updateBlockedByResize=!1;n(d,()=>{this.root.updateBlockedByResize=!0,v&&v(),v=lw(x,250),tc.hasAnimatedSinceResize&&(tc.hasAnimatedSinceResize=!1,this.nodes.forEach(h0))})}m&&this.root.registerSharedNode(m,this),this.options.animate!==!1&&y&&(m||g)&&this.addEventListener("didUpdate",({delta:v,hasLayoutChanged:x,hasRelativeTargetChanged:S,layout:C})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const k=this.options.transition||y.getDefaultTransition()||Rw,{onLayoutAnimationStart:N,onLayoutAnimationComplete:E}=y.getProps(),w=!this.targetLayout||!Gx(this.targetLayout,C)||S,D=!x&&S;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||D||x&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(v,D);const A={...Sh(k,"layout"),onPlay:N,onComplete:E};(y.shouldReduceMotion||this.options.layoutRoot)&&(A.delay=0,A.type=!1),this.startAnimation(A)}else x||h0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=C})}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,Wa(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(ww),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&&Px(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let y=0;y<this.path.length;y++){const v=this.path[y];v.shouldResetTransform=!0,v.updateScroll("snapshot"),v.options.layoutRoot&&v.willUpdate(!1)}const{layoutId:p,layout:m}=this.options;if(p===void 0&&!m)return;const g=this.getTransformTemplate();this.prevTransformTemplateValue=g?g(this.latestValues,""):void 0,this.updateSnapshot(),d&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(f0);return}this.isUpdating||this.nodes.forEach(kw),this.isUpdating=!1,this.nodes.forEach(Ew),this.nodes.forEach(xw),this.nodes.forEach(_w),this.clearAllSnapshots();const p=Fn.now();Ot.delta=ya(0,1e3/60,p-Ot.timestamp),Ot.timestamp=p,Ot.isProcessing=!0,Xd.update.process(Ot),Xd.preRender.process(Ot),Xd.render.process(Ot),Ot.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,fh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Cw),this.sharedNodes.forEach(jw)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,at.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){at.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=gt(),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=l(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&&!Hx(this.projectionDelta),m=this.getTransformTemplate(),g=m?m(this.latestValues,""):void 0,y=g!==this.prevTransformTemplateValue;d&&(p||ks(this.latestValues)||y)&&(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)),Ow(m),{animationId:this.root.animationId,measuredBox:p,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:p}=this.options;if(!p)return gt();const m=p.measureViewportBox();if(!(((d=this.scroll)===null||d===void 0?void 0:d.wasRoot)||this.path.some(Bw))){const{scroll:y}=this.root;y&&(ji(m.x,y.offset.x),ji(m.y,y.offset.y))}return m}removeElementScroll(d){var p;const m=gt();if(kn(m,d),!((p=this.scroll)===null||p===void 0)&&p.wasRoot)return m;for(let g=0;g<this.path.length;g++){const y=this.path[g],{scroll:v,options:x}=y;y!==this.root&&v&&x.layoutScroll&&(v.wasRoot&&kn(m,d),ji(m.x,v.offset.x),ji(m.y,v.offset.y))}return m}applyTransform(d,p=!1){const m=gt();kn(m,d);for(let g=0;g<this.path.length;g++){const y=this.path[g];!p&&y.options.layoutScroll&&y.scroll&&y!==y.root&&Di(m,{x:-y.scroll.offset.x,y:-y.scroll.offset.y}),ks(y.latestValues)&&Di(m,y.latestValues)}return ks(this.latestValues)&&Di(m,this.latestValues),m}removeTransform(d){const p=gt();kn(p,d);for(let m=0;m<this.path.length;m++){const g=this.path[m];if(!g.instance||!ks(g.latestValues))continue;If(g.latestValues)&&g.updateSnapshot();const y=gt(),v=g.measurePageBox();kn(y,v),i0(p,g.latestValues,g.snapshot?g.snapshot.layoutBox:void 0,y)}return ks(this.latestValues)&&i0(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!==Ot.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:v,layoutId:x}=this.options;if(!(!this.layout||!(v||x))){if(this.resolvedRelativeTargetAt=Ot.timestamp,!this.targetDelta&&!this.relativeTarget){const S=this.getClosestProjectingParent();S&&S.layout&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=gt(),this.relativeTargetOrigin=gt(),sl(this.relativeTargetOrigin,this.layout.layoutBox,S.layout.layoutBox),kn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=gt(),this.targetWithTransforms=gt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),zA(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):kn(this.target,this.layout.layoutBox),Bx(this.target,this.targetDelta)):kn(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=gt(),this.relativeTargetOrigin=gt(),sl(this.relativeTargetOrigin,this.target,S.target),kn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Xo&&Es.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||If(this.parent.latestValues)||Ox(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===Ot.timestamp&&(g=!1),g)return;const{layout:y,layoutId:v}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(y||v))return;kn(this.layoutCorrected,this.layout.layoutBox);const x=this.treeScale.x,S=this.treeScale.y;YA(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=gt());const{target:C}=p;if(!C){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(n0(this.prevProjectionDelta.x,this.projectionDelta.x),n0(this.prevProjectionDelta.y,this.projectionDelta.y)),al(this.projectionDelta,this.layoutCorrected,C,this.latestValues),(this.treeScale.x!==x||this.treeScale.y!==S||!u0(this.projectionDelta.x,this.prevProjectionDelta.x)||!u0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",C)),Xo&&Es.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=wi(),this.projectionDelta=wi(),this.projectionDeltaWithTransform=wi()}setAnimationOrigin(d,p=!1){const m=this.snapshot,g=m?m.latestValues:{},y={...this.latestValues},v=wi();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const x=gt(),S=m?m.source:void 0,C=this.layout?this.layout.source:void 0,k=S!==C,N=this.getStack(),E=!N||N.members.length<=1,w=!!(k&&!E&&this.options.crossfade===!0&&!this.path.some(Mw));this.animationProgress=0;let D;this.mixTargetDelta=A=>{const U=A/1e3;p0(v.x,d.x,U),p0(v.y,d.y,U),this.setTargetDelta(v),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(sl(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Dw(this.relativeTarget,this.relativeTargetOrigin,x,U),D&&mw(this.relativeTarget,D)&&(this.isProjectionDirty=!1),D||(D=gt()),kn(D,this.relativeTarget)),k&&(this.animationValues=y,cw(y,g,this.latestValues,U,w,E)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=U},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&&(Wa(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=at.update(()=>{tc.hasAnimatedSinceResize=!0,this.currentAnimation=aw(0,d0,{...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(d0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const d=this.getLead();let{targetWithTransforms:p,target:m,layout:g,latestValues:y}=d;if(!(!p||!m||!g)){if(this!==d&&this.layout&&g&&Fx(this.options.animationType,this.layout.layoutBox,g.layoutBox)){m=this.target||gt();const v=fn(this.layout.layoutBox.x);m.x.min=d.target.x.min,m.x.max=m.x.min+v;const x=fn(this.layout.layoutBox.y);m.y.min=d.target.y.min,m.y.max=m.y.min+x}kn(p,m),Di(p,y),al(this.projectionDeltaWithTransform,this.layoutCorrected,p,y)}}registerSharedNode(d,p){this.sharedNodes.has(d)||this.sharedNodes.set(d,new gw),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&&of("z",d,g,this.animationValues);for(let y=0;y<sf.length;y++)of(`rotate${sf[y]}`,d,g,this.animationValues),of(`skew${sf[y]}`,d,g,this.animationValues);d.render();for(const y in g)d.setStaticValue(y,g[y]),this.animationValues&&(this.animationValues[y]=g[y]);d.scheduleRender()}getProjectionStyles(d){var p,m;if(!this.instance||this.isSVG)return;if(!this.isVisible)return yw;const g={visibility:""},y=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,g.opacity="",g.pointerEvents=Jr(d==null?void 0:d.pointerEvents)||"",g.transform=y?y(this.latestValues,""):"none",g;const v=this.getLead();if(!this.projectionDelta||!this.layout||!v.target){const k={};return this.options.layoutId&&(k.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,k.pointerEvents=Jr(d==null?void 0:d.pointerEvents)||""),this.hasProjected&&!ks(this.latestValues)&&(k.transform=y?y({},""):"none",this.hasProjected=!1),k}const x=v.animationValues||v.latestValues;this.applyTransformsToTarget(),g.transform=vw(this.projectionDeltaWithTransform,this.treeScale,x),y&&(g.transform=y(x,g.transform));const{x:S,y:C}=this.projectionDelta;g.transformOrigin=`${S.origin*100}% ${C.origin*100}% 0`,v.animationValues?g.opacity=v===this?(m=(p=x.opacity)!==null&&p!==void 0?p:this.latestValues.opacity)!==null&&m!==void 0?m:1:this.preserveOpacity?this.latestValues.opacity:x.opacityExit:g.opacity=v===this?x.opacity!==void 0?x.opacity:"":x.opacityExit!==void 0?x.opacityExit:0;for(const k in oc){if(x[k]===void 0)continue;const{correct:N,applyTo:E}=oc[k],w=g.transform==="none"?x[k]:N(x[k],v);if(E){const D=E.length;for(let A=0;A<D;A++)g[E[A]]=w}else g[k]=w}return this.options.layoutId&&(g.pointerEvents=v===this?Jr(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(f0),this.root.sharedNodes.clear()}}}function xw(n){n.updateLayout()}function _w(n){var a;const i=((a=n.resumeFrom)===null||a===void 0?void 0:a.snapshot)||n.snapshot;if(n.isLead()&&n.layout&&i&&n.hasListeners("didUpdate")){const{layoutBox:l,measuredBox:r}=n.layout,{animationType:f}=n.options,d=i.source!==n.layout.source;f==="size"?En(v=>{const x=d?i.measuredBox[v]:i.layoutBox[v],S=fn(x);x.min=l[v].min,x.max=x.min+S}):Fx(f,i.layoutBox,l)&&En(v=>{const x=d?i.measuredBox[v]:i.layoutBox[v],S=fn(l[v]);x.max=x.min+S,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[v].max=n.relativeTarget[v].min+S)});const p=wi();al(p,l,i.layoutBox);const m=wi();d?al(m,n.applyTransform(r,!0),i.measuredBox):al(m,l,i.layoutBox);const g=!Hx(p);let y=!1;if(!n.resumeFrom){const v=n.getClosestProjectingParent();if(v&&!v.resumeFrom){const{snapshot:x,layout:S}=v;if(x&&S){const C=gt();sl(C,i.layoutBox,x.layoutBox);const k=gt();sl(k,l,S.layoutBox),Gx(C,k)||(y=!0),v.options.layoutRoot&&(n.relativeTarget=k,n.relativeTargetOrigin=C,n.relativeParent=v)}}}n.notifyListeners("didUpdate",{layout:l,snapshot:i,delta:m,layoutDelta:p,hasLayoutChanged:g,hasRelativeTargetChanged:y})}else if(n.isLead()){const{onExitComplete:l}=n.options;l&&l()}n.options.transition=void 0}function Sw(n){Xo&&Es.totalNodes++,n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=!!(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}function Tw(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function Cw(n){n.clearSnapshot()}function f0(n){n.clearMeasurements()}function kw(n){n.isLayoutDirty=!1}function Ew(n){const{visualElement:a}=n.options;a&&a.getProps().onBeforeLayoutMeasure&&a.notify("BeforeLayoutMeasure"),n.resetTransform()}function h0(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function Nw(n){n.resolveTargetDelta()}function Aw(n){n.calcProjection()}function ww(n){n.resetSkewAndRotation()}function jw(n){n.removeLeadSnapshot()}function p0(n,a,i){n.translate=rt(a.translate,0,i),n.scale=rt(a.scale,1,i),n.origin=a.origin,n.originPoint=a.originPoint}function m0(n,a,i,l){n.min=rt(a.min,i.min,l),n.max=rt(a.max,i.max,l)}function Dw(n,a,i,l){m0(n.x,a.x,i.x,l),m0(n.y,a.y,i.y,l)}function Mw(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const Rw={duration:.45,ease:[.4,0,.1,1]},g0=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),v0=g0("applewebkit/")&&!g0("chrome/")?Math.round:dn;function y0(n){n.min=v0(n.min),n.max=v0(n.max)}function Ow(n){y0(n.x),y0(n.y)}function Fx(n,a,i){return n==="position"||n==="preserve-aspect"&&!LA(c0(a),c0(i),.2)}function Bw(n){var a;return n!==n.root&&((a=n.scroll)===null||a===void 0?void 0:a.wasRoot)}const Iw=$x({attachResizeListener:(n,a)=>pl(n,"resize",a),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),lf={current:void 0},qx=$x({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!lf.current){const n=new Iw({});n.mount(window),n.setOptions({layoutScroll:!0}),lf.current=n}return lf.current},resetTransform:(n,a)=>{n.style.transform=a!==void 0?a:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),Lw={pan:{Feature:JA},drag:{Feature:WA,ProjectionNode:qx,MeasureLayout:zx}};function zw(n,a,i){var l;if(n instanceof Element)return[n];if(typeof n=="string"){let r=document;const f=(l=void 0)!==null&&l!==void 0?l:r.querySelectorAll(n);return f?Array.from(f):[]}return Array.from(n)}function Yx(n,a){const i=zw(n),l=new AbortController,r={passive:!0,...a,signal:l.signal};return[i,r,()=>l.abort()]}function b0(n){return a=>{a.pointerType==="touch"||Ax()||n(a)}}function Uw(n,a,i={}){const[l,r,f]=Yx(n,i),d=b0(p=>{const{target:m}=p,g=a(p);if(typeof g!="function"||!m)return;const y=b0(v=>{g(v),m.removeEventListener("pointerleave",y)});m.addEventListener("pointerleave",y,r)});return l.forEach(p=>{p.addEventListener("pointerenter",d,r)}),f}function x0(n,a,i){const{props:l}=n;n.animationState&&l.whileHover&&n.animationState.setActive("whileHover",i==="Start");const r="onHover"+i,f=l[r];f&&at.postRender(()=>f(a,Sl(a)))}class Vw extends ts{mount(){const{current:a}=this.node;a&&(this.unmount=Uw(a,i=>(x0(this.node,i,"Start"),l=>x0(this.node,l,"End"))))}unmount(){}}class Hw extends ts{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=_l(pl(this.node.current,"focus",()=>this.onFocus()),pl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const Kx=(n,a)=>a?n===a?!0:Kx(n,a.parentElement):!1,Gw=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Pw(n){return Gw.has(n.tagName)||n.tabIndex!==-1}const Qo=new WeakSet;function _0(n){return a=>{a.key==="Enter"&&n(a)}}function rf(n,a){n.dispatchEvent(new PointerEvent("pointer"+a,{isPrimary:!0,bubbles:!0}))}const $w=(n,a)=>{const i=n.currentTarget;if(!i)return;const l=_0(()=>{if(Qo.has(i))return;rf(i,"down");const r=_0(()=>{rf(i,"up")}),f=()=>rf(i,"cancel");i.addEventListener("keyup",r,a),i.addEventListener("blur",f,a)});i.addEventListener("keydown",l,a),i.addEventListener("blur",()=>i.removeEventListener("keydown",l),a)};function S0(n){return zh(n)&&!Ax()}function Fw(n,a,i={}){const[l,r,f]=Yx(n,i),d=p=>{const m=p.currentTarget;if(!S0(p)||Qo.has(m))return;Qo.add(m);const g=a(p),y=(S,C)=>{window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",x),!(!S0(S)||!Qo.has(m))&&(Qo.delete(m),typeof g=="function"&&g(S,{success:C}))},v=S=>{y(S,i.useGlobalTarget||Kx(m,S.target))},x=S=>{y(S,!1)};window.addEventListener("pointerup",v,r),window.addEventListener("pointercancel",x,r)};return l.forEach(p=>{!Pw(p)&&p.getAttribute("tabindex")===null&&(p.tabIndex=0),(i.useGlobalTarget?window:p).addEventListener("pointerdown",d,r),p.addEventListener("focus",g=>$w(g,r),r)}),f}function T0(n,a,i){const{props:l}=n;n.animationState&&l.whileTap&&n.animationState.setActive("whileTap",i==="Start");const r="onTap"+(i==="End"?"":i),f=l[r];f&&at.postRender(()=>f(a,Sl(a)))}class qw extends ts{mount(){const{current:a}=this.node;a&&(this.unmount=Fw(a,i=>(T0(this.node,i,"Start"),(l,{success:r})=>T0(this.node,l,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const zf=new WeakMap,cf=new WeakMap,Yw=n=>{const a=zf.get(n.target);a&&a(n)},Kw=n=>{n.forEach(Yw)};function Zw({root:n,...a}){const i=n||document;cf.has(i)||cf.set(i,{});const l=cf.get(i),r=JSON.stringify(a);return l[r]||(l[r]=new IntersectionObserver(Kw,{root:n,...a})),l[r]}function Xw(n,a,i){const l=Zw(a);return zf.set(n,i),l.observe(n),()=>{zf.delete(n),l.unobserve(n)}}const Qw={some:0,all:1};class Ww extends ts{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:a={}}=this.node.getProps(),{root:i,margin:l,amount:r="some",once:f}=a,d={root:i?i.current:void 0,rootMargin:l,threshold:typeof r=="number"?r:Qw[r]},p=m=>{const{isIntersecting:g}=m;if(this.isInView===g||(this.isInView=g,f&&!g&&this.hasEnteredView))return;g&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",g);const{onViewportEnter:y,onViewportLeave:v}=this.node.getProps(),x=g?y:v;x&&x(m)};return Xw(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(Jw(a,i))&&this.startObserver()}unmount(){}}function Jw({viewport:n={}},{viewport:a={}}={}){return i=>n[i]!==a[i]}const ej={inView:{Feature:Ww},tap:{Feature:qw},focus:{Feature:Hw},hover:{Feature:Vw}},tj={layout:{ProjectionNode:qx,MeasureLayout:zx}},fc={current:null},Uh={current:!1};function Zx(){if(Uh.current=!0,!!rh)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),a=()=>fc.current=n.matches;n.addListener(a),a()}else fc.current=!1}const nj=[...gx,Lt,Ja],aj=n=>nj.find(mx(n)),C0=new WeakMap;function sj(n,a,i){for(const l in a){const r=a[l],f=i[l];if(zt(r))n.addValue(l,r);else if(zt(f))n.addValue(l,fl(r,{owner:n}));else if(f!==r)if(n.hasValue(l)){const d=n.getValue(l);d.liveStyle===!0?d.jump(r):d.hasAnimated||d.set(r)}else{const d=n.getStaticValue(l);n.addValue(l,fl(d!==void 0?d:r,{owner:n}))}}for(const l in i)a[l]===void 0&&n.removeValue(l);return a}const k0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class ij{scrapeMotionValuesFromProps(a,i,l){return{}}constructor({parent:a,props:i,presenceContext:l,reducedMotionConfig:r,blockInitialAnimation:f,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=Oh,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=Fn.now();this.renderScheduledAt<S&&(this.renderScheduledAt=S,at.render(this.render,!1,!0))};const{latestValues:m,renderState:g,onUpdate:y}=d;this.onUpdate=y,this.latestValues=m,this.baseTarget={...m},this.initialValues=i.initial?{...m}:{},this.renderState=g,this.parent=a,this.props=i,this.presenceContext=l,this.depth=a?a.depth+1:0,this.reducedMotionConfig=r,this.options=p,this.blockInitialAnimation=!!f,this.isControllingVariants=Cc(i),this.isVariantNode=Ab(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(a&&a.current);const{willChange:v,...x}=this.scrapeMotionValuesFromProps(i,{},this);for(const S in x){const C=x[S];m[S]!==void 0&&zt(C)&&C.set(m[S],!1)}}mount(a){this.current=a,C0.set(a,this),this.projection&&!this.projection.instance&&this.projection.mount(a),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,l)=>this.bindToMotionValue(l,i)),Uh.current||Zx(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:fc.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){C0.delete(this.current),this.projection&&this.projection.unmount(),Wa(this.notifyUpdate),Wa(this.render),this.valueSubscriptions.forEach(a=>a()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const a in this.events)this.events[a].clear();for(const a in this.features){const i=this.features[a];i&&(i.unmount(),i.isMounted=!1)}this.current=null}bindToMotionValue(a,i){this.valueSubscriptions.has(a)&&this.valueSubscriptions.get(a)();const l=Ds.has(a),r=i.on("change",p=>{this.latestValues[a]=p,this.props.onUpdate&&at.preRender(this.notifyUpdate),l&&this.projection&&(this.projection.isTransformDirty=!0)}),f=i.on("renderRequest",this.scheduleRender);let d;window.MotionCheckAppearSync&&(d=window.MotionCheckAppearSync(this,a,i)),this.valueSubscriptions.set(a,()=>{r(),f(),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 Oi){const i=Oi[a];if(!i)continue;const{isEnabled:l,Feature:r}=i;if(!this.features[a]&&r&&l(this.props)&&(this.features[a]=new r(this)),this.features[a]){const f=this.features[a];f.isMounted?f.update():(f.mount(),f.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):gt()}getStaticValue(a){return this.latestValues[a]}setStaticValue(a,i){this.latestValues[a]=i}update(a,i){(a.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=a,this.prevPresenceContext=this.presenceContext,this.presenceContext=i;for(let l=0;l<k0.length;l++){const r=k0[l];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const f="on"+r,d=a[f];d&&(this.propEventSubscriptions[r]=this.on(r,d))}this.prevMotionValues=sj(this,this.scrapeMotionValuesFromProps(a,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(a){return this.props.variants?this.props.variants[a]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(a){const i=this.getClosestVariantNode();if(i)return i.variantChildren&&i.variantChildren.add(a),()=>i.variantChildren.delete(a)}addValue(a,i){const l=this.values.get(a);i!==l&&(l&&this.removeValue(a),this.bindToMotionValue(a,i),this.values.set(a,i),this.latestValues[a]=i.get())}removeValue(a){this.values.delete(a);const i=this.valueSubscriptions.get(a);i&&(i(),this.valueSubscriptions.delete(a)),delete this.latestValues[a],this.removeValueFromRenderState(a,this.renderState)}hasValue(a){return this.values.has(a)}getValue(a,i){if(this.props.values&&this.props.values[a])return this.props.values[a];let l=this.values.get(a);return l===void 0&&i!==void 0&&(l=fl(i===null?void 0:i,{owner:this}),this.addValue(a,l)),l}readValue(a,i){var l;let r=this.latestValues[a]!==void 0||!this.current?this.latestValues[a]:(l=this.getBaseTargetFromProps(this.props,a))!==null&&l!==void 0?l:this.readValueFromInstance(this.current,a,this.options);return r!=null&&(typeof r=="string"&&(hx(r)||sx(r))?r=parseFloat(r):!aj(r)&&Ja.test(i)&&(r=ux(a,i)),this.setBaseTarget(a,zt(r)?r.get():r)),zt(r)?r.get():r}setBaseTarget(a,i){this.baseTarget[a]=i}getBaseTarget(a){var i;const{initial:l}=this.props;let r;if(typeof l=="string"||typeof l=="object"){const d=ph(this.props,l,(i=this.presenceContext)===null||i===void 0?void 0:i.custom);d&&(r=d[a])}if(l&&r!==void 0)return r;const f=this.getBaseTargetFromProps(this.props,a);return f!==void 0&&!zt(f)?f:this.initialValues[a]!==void 0&&r===void 0?void 0:this.baseTarget[a]}on(a,i){return this.events[a]||(this.events[a]=new kh),this.events[a].add(i)}notify(a,...i){this.events[a]&&this.events[a].notify(...i)}}class Xx extends ij{constructor(){super(...arguments),this.KeyframeResolver=vx}sortInstanceNodePosition(a,i){return a.compareDocumentPosition(i)&2?1:-1}getBaseTargetFromProps(a,i){return a.style?a.style[i]:void 0}removeValueFromRenderState(a,{vars:i,style:l}){delete i[a],delete l[a]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:a}=this.props;zt(a)&&(this.childSubscription=a.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}function oj(n){return window.getComputedStyle(n)}class lj extends Xx{constructor(){super(...arguments),this.type="html",this.renderInstance=Lb}readValueFromInstance(a,i){if(Ds.has(i)){const l=Rh(i);return l&&l.default||0}else{const l=oj(a),r=(Ob(i)?l.getPropertyValue(i):l[i])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(a,{transformPagePoint:i}){return Ix(a,i)}build(a,i,l){vh(a,i,l.transformTemplate)}scrapeMotionValuesFromProps(a,i,l){return _h(a,i,l)}}class rj extends Xx{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=gt}getBaseTargetFromProps(a,i){return a[i]}readValueFromInstance(a,i){if(Ds.has(i)){const l=Rh(i);return l&&l.default||0}return i=zb.has(i)?i:dh(i),a.getAttribute(i)}scrapeMotionValuesFromProps(a,i,l){return Hb(a,i,l)}build(a,i,l){yh(a,i,this.isSVGTag,l.transformTemplate)}renderInstance(a,i,l,r){Ub(a,i,l,r)}mount(a){this.isSVGTag=xh(a.tagName),super.mount(a)}}const cj=(n,a)=>hh(n)?new rj(a):new lj(a,{allowProjection:n!==b.Fragment}),uj=IE({...NA,...ej,...Lw,...tj},cj),St=Qk(uj);function dj(){!Uh.current&&Zx();const[n]=b.useState(fc.current);return n}var Qe;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.TEXT=1]="TEXT",n[n.TOOL_USE=2]="TOOL_USE",n[n.TOOL_RESULT=3]="TOOL_RESULT",n[n.ERROR=4]="ERROR",n[n.STATUS=5]="STATUS",n[n.SYSTEM=6]="SYSTEM",n[n.FINDING=7]="FINDING",n[n.SUBTASK_CREATE=8]="SUBTASK_CREATE",n[n.USER_INPUT=9]="USER_INPUT",n[n.SIGNAL=10]="SIGNAL",n[n.USAGE=11]="USAGE"})(Qe||(Qe={}));var _t;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.NOT_STARTED=1]="NOT_STARTED",n[n.WORKING=3]="WORKING",n[n.PAUSED=4]="PAUSED",n[n.COMPLETE=5]="COMPLETE",n[n.FAILED=6]="FAILED"})(_t||(_t={}));var Za;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.ACTIVE=1]="ACTIVE",n[n.ARCHIVED=2]="ARCHIVED"})(Za||(Za={}));var Xa;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.OPEN=1]="OPEN",n[n.CLOSED=2]="CLOSED"})(Xa||(Xa={}));var Vn;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.OFF=1]="OFF",n[n.SUBSCRIPTION=2]="SUBSCRIPTION",n[n.API_KEY=3]="API_KEY"})(Vn||(Vn={}));var Qa;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.OFF=1]="OFF",n[n.ON=2]="ON"})(Qa||(Qa={}));const fj=8,E0="system",Fo="system";Object.assign(Object.create(null),{"":Qe.UNSPECIFIED,text:Qe.TEXT,tool_use:Qe.TOOL_USE,tool_result:Qe.TOOL_RESULT,error:Qe.ERROR,status:Qe.STATUS,system:Qe.SYSTEM,finding:Qe.FINDING,subtask_create:Qe.SUBTASK_CREATE,user_input:Qe.USER_INPUT,signal:Qe.SIGNAL,usage:Qe.USAGE});Qe.UNSPECIFIED+"",Qe.TEXT+"",Qe.TOOL_USE+"",Qe.TOOL_RESULT+"",Qe.ERROR+"",Qe.STATUS+"",Qe.SYSTEM+"",Qe.FINDING+"",Qe.SUBTASK_CREATE+"",Qe.USER_INPUT+"",Qe.SIGNAL+"",Qe.USAGE+"";Object.assign(Object.create(null),{"":_t.UNSPECIFIED,not_started:_t.NOT_STARTED,working:_t.WORKING,paused:_t.PAUSED,complete:_t.COMPLETE,failed:_t.FAILED,pending:_t.NOT_STARTED,assigned:_t.NOT_STARTED,in_progress:_t.WORKING,waiting_input:_t.PAUSED,review:_t.PAUSED,done:_t.COMPLETE});_t.UNSPECIFIED+"",_t.NOT_STARTED+"",_t.WORKING+"",_t.PAUSED+"",_t.COMPLETE+"",_t.FAILED+"";Object.assign(Object.create(null),{"":Za.UNSPECIFIED,active:Za.ACTIVE,archived:Za.ARCHIVED});Za.UNSPECIFIED+"",Za.ACTIVE+"",Za.ARCHIVED+"";Object.assign(Object.create(null),{"":Xa.UNSPECIFIED,open:Xa.OPEN,closed:Xa.CLOSED});Xa.UNSPECIFIED+"",Xa.OPEN+"",Xa.CLOSED+"";Object.assign(Object.create(null),{"":Vn.UNSPECIFIED,off:Vn.OFF,subscription:Vn.SUBSCRIPTION,api_key:Vn.API_KEY});Vn.UNSPECIFIED+"",Vn.OFF+"",Vn.SUBSCRIPTION+"",Vn.API_KEY+"";Object.assign(Object.create(null),{"":Qa.UNSPECIFIED,off:Qa.OFF,on:Qa.ON});Qa.UNSPECIFIED+"",Qa.OFF+"",Qa.ON+"";function ba(n){return Array.isArray?Array.isArray(n):Jx(n)==="[object Array]"}function hj(n){if(typeof n=="string")return n;let a=n+"";return a=="0"&&1/n==-1/0?"-0":a}function pj(n){return n==null?"":hj(n)}function Hn(n){return typeof n=="string"}function Qx(n){return typeof n=="number"}function mj(n){return n===!0||n===!1||gj(n)&&Jx(n)=="[object Boolean]"}function Wx(n){return typeof n=="object"}function gj(n){return Wx(n)&&n!==null}function un(n){return n!=null}function uf(n){return!n.trim().length}function Jx(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}const vj="Incorrect 'index' type",yj=n=>`Invalid value for key ${n}`,bj=n=>`Pattern length exceeds max of ${n}.`,xj=n=>`Missing ${n} property in key`,_j=n=>`Property 'weight' in key '${n}' must be a positive integer`,N0=Object.prototype.hasOwnProperty;class Sj{constructor(a){this._keys=[],this._keyMap={};let i=0;a.forEach(l=>{let r=e_(l);this._keys.push(r),this._keyMap[r.id]=r,i+=r.weight}),this._keys.forEach(l=>{l.weight/=i})}get(a){return this._keyMap[a]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function e_(n){let a=null,i=null,l=null,r=1,f=null;if(Hn(n)||ba(n))l=n,a=A0(n),i=Uf(n);else{if(!N0.call(n,"name"))throw new Error(xj("name"));const d=n.name;if(l=d,N0.call(n,"weight")&&(r=n.weight,r<=0))throw new Error(_j(d));a=A0(d),i=Uf(d),f=n.getFn}return{path:a,id:i,weight:r,src:l,getFn:f}}function A0(n){return ba(n)?n:n.split(".")}function Uf(n){return ba(n)?n.join("."):n}function Tj(n,a){let i=[],l=!1;const r=(f,d,p)=>{if(un(f))if(!d[p])i.push(f);else{let m=d[p];const g=f[m];if(!un(g))return;if(p===d.length-1&&(Hn(g)||Qx(g)||mj(g)))i.push(pj(g));else if(ba(g)){l=!0;for(let y=0,v=g.length;y<v;y+=1)r(g[y],d,p+1)}else d.length&&r(g,d,p+1)}};return r(n,Hn(a)?a.split("."):a,0),l?i:i[0]}const Cj={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},kj={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(n,a)=>n.score===a.score?n.idx<a.idx?-1:1:n.score<a.score?-1:1},Ej={location:0,threshold:.6,distance:100},Nj={useExtendedSearch:!1,getFn:Tj,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var ye={...kj,...Cj,...Ej,...Nj};const Aj=/[^ ]+/g;function wj(n=1,a=3){const i=new Map,l=Math.pow(10,a);return{get(r){const f=r.match(Aj).length;if(i.has(f))return i.get(f);const d=1/Math.pow(f,.5*n),p=parseFloat(Math.round(d*l)/l);return i.set(f,p),p},clear(){i.clear()}}}class Vh{constructor({getFn:a=ye.getFn,fieldNormWeight:i=ye.fieldNormWeight}={}){this.norm=wj(i,3),this.getFn=a,this.isCreated=!1,this.setIndexRecords()}setSources(a=[]){this.docs=a}setIndexRecords(a=[]){this.records=a}setKeys(a=[]){this.keys=a,this._keysMap={},a.forEach((i,l)=>{this._keysMap[i.id]=l})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Hn(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();Hn(a)?this._addString(a,i):this._addObject(a,i)}removeAt(a){this.records.splice(a,1);for(let i=a,l=this.size();i<l;i+=1)this.records[i].i-=1}getValueForItemAtKeyId(a,i){return a[this._keysMap[i]]}size(){return this.records.length}_addString(a,i){if(!un(a)||uf(a))return;let l={v:a,i,n:this.norm.get(a)};this.records.push(l)}_addObject(a,i){let l={i,$:{}};this.keys.forEach((r,f)=>{let d=r.getFn?r.getFn(a):this.getFn(a,r.path);if(un(d)){if(ba(d)){let p=[];const m=[{nestedArrIndex:-1,value:d}];for(;m.length;){const{nestedArrIndex:g,value:y}=m.pop();if(un(y))if(Hn(y)&&!uf(y)){let v={v:y,i:g,n:this.norm.get(y)};p.push(v)}else ba(y)&&y.forEach((v,x)=>{m.push({nestedArrIndex:x,value:v})})}l.$[f]=p}else if(Hn(d)&&!uf(d)){let p={v:d,n:this.norm.get(d)};l.$[f]=p}}}),this.records.push(l)}toJSON(){return{keys:this.keys,records:this.records}}}function t_(n,a,{getFn:i=ye.getFn,fieldNormWeight:l=ye.fieldNormWeight}={}){const r=new Vh({getFn:i,fieldNormWeight:l});return r.setKeys(n.map(e_)),r.setSources(a),r.create(),r}function jj(n,{getFn:a=ye.getFn,fieldNormWeight:i=ye.fieldNormWeight}={}){const{keys:l,records:r}=n,f=new Vh({getFn:a,fieldNormWeight:i});return f.setKeys(l),f.setIndexRecords(r),f}function Fr(n,{errors:a=0,currentLocation:i=0,expectedLocation:l=0,distance:r=ye.distance,ignoreLocation:f=ye.ignoreLocation}={}){const d=a/n.length;if(f)return d;const p=Math.abs(l-i);return r?d+p/r:p?1:d}function Dj(n=[],a=ye.minMatchCharLength){let i=[],l=-1,r=-1,f=0;for(let d=n.length;f<d;f+=1){let p=n[f];p&&l===-1?l=f:!p&&l!==-1&&(r=f-1,r-l+1>=a&&i.push([l,r]),l=-1)}return n[f-1]&&f-l>=a&&i.push([l,f-1]),i}const Ns=32;function Mj(n,a,i,{location:l=ye.location,distance:r=ye.distance,threshold:f=ye.threshold,findAllMatches:d=ye.findAllMatches,minMatchCharLength:p=ye.minMatchCharLength,includeMatches:m=ye.includeMatches,ignoreLocation:g=ye.ignoreLocation}={}){if(a.length>Ns)throw new Error(bj(Ns));const y=a.length,v=n.length,x=Math.max(0,Math.min(l,v));let S=f,C=x;const k=p>1||m,N=k?Array(v):[];let E;for(;(E=n.indexOf(a,C))>-1;){let F=Fr(a,{currentLocation:E,expectedLocation:x,distance:r,ignoreLocation:g});if(S=Math.min(F,S),C=E+y,k){let O=0;for(;O<y;)N[E+O]=1,O+=1}}C=-1;let w=[],D=1,A=y+v;const U=1<<y-1;for(let F=0;F<y;F+=1){let O=0,Z=A;for(;O<Z;)Fr(a,{errors:F,currentLocation:x+Z,expectedLocation:x,distance:r,ignoreLocation:g})<=S?O=Z:A=Z,Z=Math.floor((A-O)/2+O);A=Z;let ee=Math.max(1,x-Z+1),ie=d?v:Math.min(x+Z,v)+y,R=Array(ie+2);R[ie+1]=(1<<F)-1;for(let X=ie;X>=ee;X-=1){let te=X-1,V=i[n.charAt(te)];if(k&&(N[te]=+!!V),R[X]=(R[X+1]<<1|1)&V,F&&(R[X]|=(w[X+1]|w[X])<<1|1|w[X+1]),R[X]&U&&(D=Fr(a,{errors:F,currentLocation:te,expectedLocation:x,distance:r,ignoreLocation:g}),D<=S)){if(S=D,C=te,C<=x)break;ee=Math.max(1,2*x-C)}}if(Fr(a,{errors:F+1,currentLocation:x,expectedLocation:x,distance:r,ignoreLocation:g})>S)break;w=R}const Y={isMatch:C>=0,score:Math.max(.001,D)};if(k){const F=Dj(N,p);F.length?m&&(Y.indices=F):Y.isMatch=!1}return Y}function Rj(n){let a={};for(let i=0,l=n.length;i<l;i+=1){const r=n.charAt(i);a[r]=(a[r]||0)|1<<l-i-1}return a}const hc=String.prototype.normalize?(n=>n.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(n=>n);class n_{constructor(a,{location:i=ye.location,threshold:l=ye.threshold,distance:r=ye.distance,includeMatches:f=ye.includeMatches,findAllMatches:d=ye.findAllMatches,minMatchCharLength:p=ye.minMatchCharLength,isCaseSensitive:m=ye.isCaseSensitive,ignoreDiacritics:g=ye.ignoreDiacritics,ignoreLocation:y=ye.ignoreLocation}={}){if(this.options={location:i,threshold:l,distance:r,includeMatches:f,findAllMatches:d,minMatchCharLength:p,isCaseSensitive:m,ignoreDiacritics:g,ignoreLocation:y},a=m?a:a.toLowerCase(),a=g?hc(a):a,this.pattern=a,this.chunks=[],!this.pattern.length)return;const v=(S,C)=>{this.chunks.push({pattern:S,alphabet:Rj(S),startIndex:C})},x=this.pattern.length;if(x>Ns){let S=0;const C=x%Ns,k=x-C;for(;S<k;)v(this.pattern.substr(S,Ns),S),S+=Ns;if(C){const N=x-Ns;v(this.pattern.substr(N),N)}}else v(this.pattern,0)}searchIn(a){const{isCaseSensitive:i,ignoreDiacritics:l,includeMatches:r}=this.options;if(a=i?a:a.toLowerCase(),a=l?hc(a):a,this.pattern===a){let k={isMatch:!0,score:0};return r&&(k.indices=[[0,a.length-1]]),k}const{location:f,distance:d,threshold:p,findAllMatches:m,minMatchCharLength:g,ignoreLocation:y}=this.options;let v=[],x=0,S=!1;this.chunks.forEach(({pattern:k,alphabet:N,startIndex:E})=>{const{isMatch:w,score:D,indices:A}=Mj(a,k,N,{location:f+E,distance:d,threshold:p,findAllMatches:m,minMatchCharLength:g,includeMatches:r,ignoreLocation:y});w&&(S=!0),x+=D,w&&A&&(v=[...v,...A])});let C={isMatch:S,score:S?x/this.chunks.length:1};return S&&r&&(C.indices=v),C}}class ns{constructor(a){this.pattern=a}static isMultiMatch(a){return w0(a,this.multiRegex)}static isSingleMatch(a){return w0(a,this.singleRegex)}search(){}}function w0(n,a){const i=n.match(a);return i?i[1]:null}class Oj extends ns{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 Bj extends ns{constructor(a){super(a)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(a){const l=a.indexOf(this.pattern)===-1;return{isMatch:l,score:l?0:1,indices:[0,a.length-1]}}}class Ij extends ns{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 Lj extends ns{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 zj extends ns{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 Uj extends ns{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 a_ extends ns{constructor(a,{location:i=ye.location,threshold:l=ye.threshold,distance:r=ye.distance,includeMatches:f=ye.includeMatches,findAllMatches:d=ye.findAllMatches,minMatchCharLength:p=ye.minMatchCharLength,isCaseSensitive:m=ye.isCaseSensitive,ignoreDiacritics:g=ye.ignoreDiacritics,ignoreLocation:y=ye.ignoreLocation}={}){super(a),this._bitapSearch=new n_(a,{location:i,threshold:l,distance:r,includeMatches:f,findAllMatches:d,minMatchCharLength:p,isCaseSensitive:m,ignoreDiacritics:g,ignoreLocation:y})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(a){return this._bitapSearch.searchIn(a)}}class s_ extends ns{constructor(a){super(a)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(a){let i=0,l;const r=[],f=this.pattern.length;for(;(l=a.indexOf(this.pattern,i))>-1;)i=l+f,r.push([l,i-1]);const d=!!r.length;return{isMatch:d,score:d?0:1,indices:r}}}const Vf=[Oj,s_,Ij,Lj,Uj,zj,Bj,a_],j0=Vf.length,Vj=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,Hj="|";function Gj(n,a={}){return n.split(Hj).map(i=>{let l=i.trim().split(Vj).filter(f=>f&&!!f.trim()),r=[];for(let f=0,d=l.length;f<d;f+=1){const p=l[f];let m=!1,g=-1;for(;!m&&++g<j0;){const y=Vf[g];let v=y.isMultiMatch(p);v&&(r.push(new y(v,a)),m=!0)}if(!m)for(g=-1;++g<j0;){const y=Vf[g];let v=y.isSingleMatch(p);if(v){r.push(new y(v,a));break}}}return r})}const Pj=new Set([a_.type,s_.type]);class $j{constructor(a,{isCaseSensitive:i=ye.isCaseSensitive,ignoreDiacritics:l=ye.ignoreDiacritics,includeMatches:r=ye.includeMatches,minMatchCharLength:f=ye.minMatchCharLength,ignoreLocation:d=ye.ignoreLocation,findAllMatches:p=ye.findAllMatches,location:m=ye.location,threshold:g=ye.threshold,distance:y=ye.distance}={}){this.query=null,this.options={isCaseSensitive:i,ignoreDiacritics:l,includeMatches:r,minMatchCharLength:f,findAllMatches:p,ignoreLocation:d,location:m,threshold:g,distance:y},a=i?a:a.toLowerCase(),a=l?hc(a):a,this.pattern=a,this.query=Gj(this.pattern,this.options)}static condition(a,i){return i.useExtendedSearch}searchIn(a){const i=this.query;if(!i)return{isMatch:!1,score:1};const{includeMatches:l,isCaseSensitive:r,ignoreDiacritics:f}=this.options;a=r?a:a.toLowerCase(),a=f?hc(a):a;let d=0,p=[],m=0;for(let g=0,y=i.length;g<y;g+=1){const v=i[g];p.length=0,d=0;for(let x=0,S=v.length;x<S;x+=1){const C=v[x],{isMatch:k,indices:N,score:E}=C.search(a);if(k){if(d+=1,m+=E,l){const w=C.constructor.type;Pj.has(w)?p=[...p,...N]:p.push(N)}}else{m=0,d=0,p.length=0;break}}if(d){let x={isMatch:!0,score:m/d};return l&&(x.indices=p),x}}return{isMatch:!1,score:1}}}const Hf=[];function Fj(...n){Hf.push(...n)}function Gf(n,a){for(let i=0,l=Hf.length;i<l;i+=1){let r=Hf[i];if(r.condition(n,a))return new r(n,a)}return new n_(n,a)}const pc={AND:"$and",OR:"$or"},Pf={PATH:"$path",PATTERN:"$val"},$f=n=>!!(n[pc.AND]||n[pc.OR]),qj=n=>!!n[Pf.PATH],Yj=n=>!ba(n)&&Wx(n)&&!$f(n),D0=n=>({[pc.AND]:Object.keys(n).map(a=>({[a]:n[a]}))});function i_(n,a,{auto:i=!0}={}){const l=r=>{let f=Object.keys(r);const d=qj(r);if(!d&&f.length>1&&!$f(r))return l(D0(r));if(Yj(r)){const m=d?r[Pf.PATH]:f[0],g=d?r[Pf.PATTERN]:r[m];if(!Hn(g))throw new Error(yj(m));const y={keyId:Uf(m),pattern:g};return i&&(y.searcher=Gf(g,a)),y}let p={children:[],operator:f[0]};return f.forEach(m=>{const g=r[m];ba(g)&&g.forEach(y=>{p.children.push(l(y))})}),p};return $f(n)||(n=D0(n)),l(n)}function Kj(n,{ignoreFieldNorm:a=ye.ignoreFieldNorm}){n.forEach(i=>{let l=1;i.matches.forEach(({key:r,norm:f,score:d})=>{const p=r?r.weight:null;l*=Math.pow(d===0&&p?Number.EPSILON:d,(p||1)*(a?1:f))}),i.score=l})}function Zj(n,a){const i=n.matches;a.matches=[],un(i)&&i.forEach(l=>{if(!un(l.indices)||!l.indices.length)return;const{indices:r,value:f}=l;let d={indices:r,value:f};l.key&&(d.key=l.key.src),l.idx>-1&&(d.refIndex=l.idx),a.matches.push(d)})}function Xj(n,a){a.score=n.score}function Qj(n,a,{includeMatches:i=ye.includeMatches,includeScore:l=ye.includeScore}={}){const r=[];return i&&r.push(Zj),l&&r.push(Xj),n.map(f=>{const{idx:d}=f,p={item:a[d],refIndex:d};return r.length&&r.forEach(m=>{m(f,p)}),p})}class qi{constructor(a,i={},l){this.options={...ye,...i},this.options.useExtendedSearch,this._keyStore=new Sj(this.options.keys),this.setCollection(a,l)}setCollection(a,i){if(this._docs=a,i&&!(i instanceof Vh))throw new Error(vj);this._myIndex=i||t_(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(a){un(a)&&(this._docs.push(a),this._myIndex.add(a))}remove(a=()=>!1){const i=[];for(let l=0,r=this._docs.length;l<r;l+=1){const f=this._docs[l];a(f,l)&&(this.removeAt(l),l-=1,r-=1,i.push(f))}return i}removeAt(a){this._docs.splice(a,1),this._myIndex.removeAt(a)}getIndex(){return this._myIndex}search(a,{limit:i=-1}={}){const{includeMatches:l,includeScore:r,shouldSort:f,sortFn:d,ignoreFieldNorm:p}=this.options;let m=Hn(a)?Hn(this._docs[0])?this._searchStringList(a):this._searchObjectList(a):this._searchLogical(a);return Kj(m,{ignoreFieldNorm:p}),f&&m.sort(d),Qx(i)&&i>-1&&(m=m.slice(0,i)),Qj(m,this._docs,{includeMatches:l,includeScore:r})}_searchStringList(a){const i=Gf(a,this.options),{records:l}=this._myIndex,r=[];return l.forEach(({v:f,i:d,n:p})=>{if(!un(f))return;const{isMatch:m,score:g,indices:y}=i.searchIn(f);m&&r.push({item:f,idx:d,matches:[{score:g,value:f,norm:p,indices:y}]})}),r}_searchLogical(a){const i=i_(a,this.options),l=(p,m,g)=>{if(!p.children){const{keyId:v,searcher:x}=p,S=this._findMatches({key:this._keyStore.get(v),value:this._myIndex.getValueForItemAtKeyId(m,v),searcher:x});return S&&S.length?[{idx:g,item:m,matches:S}]:[]}const y=[];for(let v=0,x=p.children.length;v<x;v+=1){const S=p.children[v],C=l(S,m,g);if(C.length)y.push(...C);else if(p.operator===pc.AND)return[]}return y},r=this._myIndex.records,f={},d=[];return r.forEach(({$:p,i:m})=>{if(un(p)){let g=l(i,p,m);g.length&&(f[m]||(f[m]={idx:m,item:p,matches:[]},d.push(f[m])),g.forEach(({matches:y})=>{f[m].matches.push(...y)}))}}),d}_searchObjectList(a){const i=Gf(a,this.options),{keys:l,records:r}=this._myIndex,f=[];return r.forEach(({$:d,i:p})=>{if(!un(d))return;let m=[];l.forEach((g,y)=>{m.push(...this._findMatches({key:g,value:d[y],searcher:i}))}),m.length&&f.push({idx:p,item:d,matches:m})}),f}_findMatches({key:a,value:i,searcher:l}){if(!un(i))return[];let r=[];if(ba(i))i.forEach(({v:f,i:d,n:p})=>{if(!un(f))return;const{isMatch:m,score:g,indices:y}=l.searchIn(f);m&&r.push({score:g,key:a,value:f,idx:d,norm:p,indices:y})});else{const{v:f,n:d}=i,{isMatch:p,score:m,indices:g}=l.searchIn(f);p&&r.push({score:m,key:a,value:f,norm:d,indices:g})}return r}}qi.version="7.1.0";qi.createIndex=t_;qi.parseIndex=jj;qi.config=ye;qi.parseQuery=i_;Fj($j);function Wj(n,a,i,l){if(!a.trim())return[];const r=.3;return new qi(n,{keys:i,threshold:r,ignoreLocation:!0,includeScore:!0,includeMatches:!0,minMatchCharLength:2}).search(a).map(m=>({item:m.item,score:m.score??1,matches:(m.matches??[]).map(g=>({key:g.key??"",indices:g.indices}))}))}const Ff={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 es(n){return n==="blocked"?Ff.blocked:Ff[Hh(n)]}const Jj={not_started:"statusPending",working:"statusInProgress",paused:"statusWaitingInput",complete:"statusDone",failed:"statusFailed"};function e2(n){return Jj[Hh(n)]??"statusPending"}const t2=["working","paused","failed","not_started","blocked","complete"],M0=["not_started","working","paused","complete","failed"],n2={pending:"not_started",assigned:"not_started",in_progress:"working",waiting_input:"paused",review:"paused",done:"complete"};function Hh(n){return n in Ff&&n!=="blocked"?n:n2[n]??"not_started"}const a2={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 s2(n){if(n.length===0)return[];const a=[...n].sort((l,r)=>l[0]-r[0]),i=[[a[0][0],a[0][1]]];for(let l=1;l<a.length;l++){const r=i[i.length-1],[f,d]=a[l];f<=r[1]+1?r[1]=Math.max(r[1],d):i.push([f,d])}return i}function o_({text:n,indices:a,highlightClass:i}){if(!a||a.length===0)return c.jsx(c.Fragment,{children:n});const l=s2(a),r=[];let f=0;for(const[d,p]of l)d>f&&r.push(c.jsx("span",{children:n.slice(f,d)},`p${f}`)),r.push(c.jsx("mark",{className:i,children:n.slice(d,p+1)},`m${d}`)),f=p+1;return f<n.length&&r.push(c.jsx("span",{children:n.slice(f)},`p${f}`)),c.jsx(c.Fragment,{children:r})}function i2(n){const a=new Map(n.map(l=>[l.id,{...l,children:[]}])),i=[];for(const l of a.values())l.parentTaskId&&a.has(l.parentTaskId)?a.get(l.parentTaskId).children.push(l):i.push(l);for(const l of a.values())l.children.sort((r,f)=>r.sortOrder-f.sortOrder);return i.sort((l,r)=>l.sortOrder-r.sortOrder)}function o2(n,a){const i=new Map;for(const f of n){const p=f.dependsOn.length>0&&f.dependsOn.some(g=>a.get(g)!=="complete")?"blocked":f.status,m=i.get(p);m?m.push(f):i.set(p,[f])}const l=[],r=new Set;for(const f of t2){r.add(f);const d=i.get(f);if(d&&d.length>0){d.sort((m,g)=>m.sortOrder-g.sortOrder);const p=es(f);l.push({status:f,label:p.label,style:p,tasks:d})}}for(const[f,d]of i)if(!r.has(f)&&d.length>0){d.sort((m,g)=>m.sortOrder-g.sortOrder);const p=es(f);l.push({status:f,label:p.label,style:p,tasks:d})}return l}const l2="_container_z4i38_1",r2="_header_z4i38_5",c2="_headerActions_z4i38_17",u2="_searchInput_z4i38_23",d2="_searchHighlight_z4i38_56",f2="_groupToggle_z4i38_62",h2="_groupToggleActive_z4i38_89",p2="_addButton_z4i38_93",m2="_taskRow_z4i38_120",g2="_selected_z4i38_140",v2="_expandArrow_z4i38_150",y2="_expanded_z4i38_157",b2="_leafSpacer_z4i38_161",x2="_taskStatusIcon_z4i38_166",_2="_taskTitle_z4i38_170",S2="_workspaceBadge_z4i38_177",T2="_childCountBadge_z4i38_195",C2="_dependencyBadge_z4i38_208",k2="_blockedBadge_z4i38_220",E2="_addChildButton_z4i38_225",N2="_emptyState_z4i38_268",A2="_statusGroupHeader_z4i38_275",w2="_statusGroupIcon_z4i38_294",j2="_statusGroupLabel_z4i38_298",D2="_statusGroupCount_z4i38_303",Me={container:l2,header:r2,headerActions:c2,searchInput:u2,searchHighlight:d2,groupToggle:f2,groupToggleActive:h2,addButton:p2,taskRow:m2,selected:g2,expandArrow:v2,expanded:y2,leafSpacer:b2,taskStatusIcon:x2,taskTitle:_2,workspaceBadge:S2,childCountBadge:T2,dependencyBadge:C2,blockedBadge:k2,addChildButton:E2,emptyState:N2,statusGroupHeader:A2,statusGroupIcon:w2,statusGroupLabel:j2,statusGroupCount:D2},M2=[{name:"title",weight:2},{name:"description",weight:1}],l_=16,R2=16,r_="grackle-task-group-by-status";function R0(){try{return localStorage.getItem(r_)==="true"}catch{return!1}}function O2(n){try{localStorage.setItem(r_,String(n))}catch{}}function B2({group:n,isExpanded:a,onToggle:i,selectedTaskId:l,navigate:r,titleHighlights:f,workspaceNames:d}){return c.jsxs("div",{"data-testid":`status-group-${n.status}`,children:[c.jsxs("div",{className:Me.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:`${Me.expandArrow} ${a?Me.expanded:""}`,children:"▸"}),c.jsx("span",{className:Me.statusGroupIcon,style:{color:n.style.color},children:n.style.icon}),c.jsx("span",{className:Me.statusGroupLabel,children:n.label}),c.jsx("span",{className:Me.statusGroupCount,children:n.tasks.length})]}),c.jsx(qn,{children:a&&c.jsx(St.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},style:{overflow:"hidden"},children:n.tasks.map(p=>{const m=es(p.status),g=l===p.id,y=p.parentTaskId||!p.workspaceId?void 0:d.get(p.workspaceId);return c.jsxs("div",{onClick:()=>r(va(p.id)),className:`${Me.taskRow} ${g?Me.selected:""}`,style:{"--task-indent":`${l_}px`},"data-task-id":p.id,children:[c.jsx("span",{className:Me.leafSpacer}),c.jsx("span",{className:Me.taskStatusIcon,style:{color:m.color},children:m.icon}),c.jsx("span",{className:Me.taskTitle,title:p.title,children:c.jsx(o_,{text:p.title,indices:f.get(p.id),highlightClass:Me.searchHighlight})}),y&&c.jsx("span",{className:Me.workspaceBadge,title:y,children:y})]},p.id)})})})]})}function c_({node:n,depth:a,expandedTasks:i,toggleTask:l,selectedTaskId:r,navigate:f,taskStatusById:d,titleHighlights:p,workspaceNames:m}){const g=es(n.status),y=n.dependsOn.length>0&&n.dependsOn.some(E=>d.get(E)!=="complete"),v=i.has(n.id),x=n.children.length>0,S=r===n.id,C=l_+a*R2,N=a===0&&!n.parentTaskId&&n.workspaceId?m.get(n.workspaceId):void 0;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{onClick:()=>f(va(n.id)),className:`${Me.taskRow} ${S?Me.selected:""}`,style:{"--task-indent":`${C}px`},"data-task-id":n.id,children:[x&&c.jsx("span",{className:`${Me.expandArrow} ${v?Me.expanded:""}`,role:"button",tabIndex:0,"aria-label":v?"Collapse task":"Expand task",onClick:E=>{E.stopPropagation(),l(n.id)},onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),E.stopPropagation(),l(n.id))},children:"▸"}),!x&&c.jsx("span",{className:Me.leafSpacer}),c.jsx("span",{className:Me.taskStatusIcon,style:{color:g.color},children:g.icon}),c.jsx("span",{className:Me.taskTitle,title:n.title,children:c.jsx(o_,{text:n.title,indices:p.get(n.id),highlightClass:Me.searchHighlight})}),N&&c.jsx("span",{className:Me.workspaceBadge,title:N,children:N}),x&&c.jsxs("span",{className:Me.childCountBadge,children:[n.children.filter(E=>E.status==="complete").length,"/",n.children.length]}),n.dependsOn.length>0&&c.jsx("span",{className:`${Me.dependencyBadge} ${y?Me.blockedBadge:""}`,title:`Depends on: ${n.dependsOn.join(", ")}`,children:y?"blocked":"dep"}),a<fj&&c.jsx("button",{onClick:E=>{E.stopPropagation(),f(Gi(n.workspaceId,n.id))},title:"Add child task","aria-label":"Add child task",className:Me.addChildButton,children:"+"})]}),c.jsx(qn,{children:x&&v&&c.jsx(St.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.15},style:{overflow:"hidden"},children:n.children.map(E=>c.jsx(c_,{node:E,depth:a+1,expandedTasks:i,toggleTask:l,selectedTaskId:r,navigate:f,taskStatusById:d,titleHighlights:p,workspaceNames:m},E.id))})})]})}function I2(){const{workspaces:n,tasks:a}=Je(),i=Ut(),[l,r]=b.useState(new Set),[f,d]=b.useState(new Set),[p,m]=b.useState(R0),[g,y]=b.useState(R0),[v,x]=b.useState(new Map),S=Nt("/tasks/:taskId/*"),C=(S==null?void 0:S.params.taskId)!=="new"?S==null?void 0:S.params.taskId:void 0,k=b.useMemo(()=>new Map(a.map(X=>[X.id,X.status])),[a]),N=b.useMemo(()=>new Map(n.map(X=>[X.id,X.name])),[n]),E=()=>{const X=!p;O2(X),m(X),X&&(y(!0),x(new Map))},w=X=>{x(te=>{const V=new Map(te),H=V.has(X)?V.get(X):g;return V.set(X,!H),V})},D=X=>v.has(X)?v.get(X):g,A=X=>{r(te=>{const V=new Set(te);return V.has(X)?(V.delete(X),d(H=>new Set(H).add(X))):(V.add(X),d(H=>{const z=new Set(H);return z.delete(X),z})),V})};b.useEffect(()=>{const X=new Set(a.filter(te=>te.parentTaskId).map(te=>te.parentTaskId));X.size>0&&r(te=>{const V=new Set(te);for(const H of X)f.has(H)||V.add(H);return V})},[a,f]);const[U,Y]=b.useState(""),{directMatchTaskIds:F,treeMatchTaskIds:O,titleHighlights:Z}=b.useMemo(()=>{if(!U.trim())return{directMatchTaskIds:null,treeMatchTaskIds:null,titleHighlights:new Map};const X=Wj(a,U,M2),te=new Set(X.map(re=>re.item.id)),V=new Map;for(const re of X){const B=re.matches.find(oe=>oe.key==="title");B&&V.set(re.item.id,B.indices)}const H=new Set(te),z=new Map(a.map(re=>[re.id,re]));for(const re of[...te]){let B=z.get(re);for(;B!=null&&B.parentTaskId;)H.add(B.parentTaskId),B=z.get(B.parentTaskId)}return{directMatchTaskIds:te,treeMatchTaskIds:H,titleHighlights:V}},[U,a]),ee=F!==null,ie=ee?p?F:O:null,R=ie?a.filter(X=>ie.has(X.id)):a,ae=p?[]:i2(R);return c.jsxs("div",{className:Me.container,children:[c.jsxs("div",{className:Me.header,children:[c.jsx("span",{children:"Tasks"}),c.jsxs("div",{className:Me.headerActions,children:[c.jsx("button",{className:`${Me.groupToggle} ${p?Me.groupToggleActive:""}`,onClick:E,"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:Me.addButton,onClick:()=>i(Gi()),"aria-label":"New task",title:"New task","data-testid":"new-task-button",children:"+"})]})]}),a.length>0&&c.jsx("input",{type:"text",value:U,onChange:X=>Y(X.target.value),placeholder:"Filter...","aria-label":"Filter tasks",className:Me.searchInput,"data-testid":"sidebar-search"}),p?o2(R,k).map(X=>c.jsx(B2,{group:X,isExpanded:D(X.status),onToggle:()=>w(X.status),selectedTaskId:C,navigate:i,titleHighlights:Z,workspaceNames:N},X.status)):ae.map(X=>c.jsx(c_,{node:X,depth:0,expandedTasks:l,toggleTask:A,selectedTaskId:C,navigate:i,taskStatusById:k,titleHighlights:Z,workspaceNames:N},X.id)),R.length===0&&!ee&&c.jsx("div",{className:Me.emptyState,children:"No tasks yet. Click + to create one."}),R.length===0&&ee&&c.jsx("div",{className:Me.emptyState,children:"No matching tasks"})]})}const L2="_nav_14i94_1",z2="_tab_14i94_24",U2="_tabActive_14i94_62",V2="_tabLabel_14i94_75",H2="_statusDot_14i94_81",G2="_pulse_14i94_87",P2="_addButton_14i94_99",$2="_empty_14i94_132",qa={nav:L2,tab:z2,tabActive:U2,tabLabel:V2,statusDot:H2,pulse:G2,addButton:P2,empty:$2},F2={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function q2(){const{environments:n}=Je(),a=Ut(),i=b.useRef(null),l=Nt("/environments/:environmentId"),r=Nt("/environments/:environmentId/edit"),f=(l==null?void 0:l.params.environmentId)??(r==null?void 0:r.params.environmentId),d=f==="new"?void 0:f,p=b.useCallback(y=>{a(bf(y))},[a]),m=b.useCallback(y=>{var k;const v=(k=i.current)==null?void 0:k.querySelectorAll('[role="tab"]');if(!v||v.length===0)return;const x=Array.from(v).findIndex(N=>N===document.activeElement),S=x>=0?x:n.findIndex(N=>N.id===d);let C=S;if(y.key==="ArrowDown")y.preventDefault(),C=(S+1)%v.length;else if(y.key==="ArrowUp")y.preventDefault(),C=(S-1+v.length)%v.length;else if(y.key==="Home")y.preventDefault(),C=0;else if(y.key==="End")y.preventDefault(),C=v.length-1;else return;C<n.length&&a(bf(n[C].id)),v[C].focus()},[d,n,a]),g=d??(n.length>0?n[0].id:void 0);return c.jsxs("div",{className:qa.nav,"data-testid":"environment-nav",children:[c.jsx("nav",{ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Environments",onKeyDown:m,children:n.map(y=>{const v=y.id===d,x=y.id===g,S=F2[y.status]||"var(--text-tertiary)",C=y.status==="connected";return c.jsxs("button",{role:"tab",type:"button","aria-selected":v,tabIndex:x?0:-1,className:`${qa.tab} ${v?qa.tabActive:""}`,onClick:()=>p(y.id),"data-testid":"env-nav-item",children:[c.jsx("span",{className:`${qa.statusDot} ${C?qa.pulse:""}`,style:{color:S},children:"●"}),c.jsx("span",{className:qa.tabLabel,title:y.displayName||y.id,children:y.displayName||y.id})]},y.id)})}),c.jsx("button",{type:"button",className:qa.addButton,onClick:()=>a(GC),title:"Add environment","data-testid":"env-nav-add",children:"+ Add Environment"}),n.length===0&&c.jsx("div",{className:qa.empty,children:"No environments yet."})]})}const Y2="_nav_1bhou_1",K2="_tab_1bhou_24",Z2="_tabIcon_1bhou_62",X2="_tabActive_1bhou_68",qr={nav:Y2,tab:K2,tabIcon:Z2,tabActive:X2},ha=[{path:"credentials",label:"Credentials",icon:"🔑"},{path:"personas",label:"Personas",icon:"👤"},{path:"appearance",label:"Appearance",icon:"🎨"},{path:"about",label:"About",icon:"ℹ️"}];function Q2(){var d;const n=At(),a=Ut(),i=b.useRef(null),l=((d=ha.find(p=>n.pathname===`${Jo}/${p.path}`))==null?void 0:d.path)??ha[0].path,r=b.useCallback(p=>{a(`${Jo}/${p}`)},[a]),f=b.useCallback(p=>{var S,C;const m=(S=i.current)==null?void 0:S.querySelectorAll('[role="tab"]');if(!m)return;const g=Array.from(m).findIndex(k=>k===document.activeElement),y=g>=0?g:ha.findIndex(k=>k.path===l);let v=y;if(p.key==="ArrowDown")p.preventDefault(),v=(y+1)%ha.length;else if(p.key==="ArrowUp")p.preventDefault(),v=(y-1+ha.length)%ha.length;else if(p.key==="Home")p.preventDefault(),v=0;else if(p.key==="End")p.preventDefault(),v=ha.length-1;else return;const x=ha[v].path;a(`${Jo}/${x}`),(C=m[v])==null||C.focus()},[l,a]);return c.jsx("nav",{className:qr.nav,ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Settings",onKeyDown:f,children:ha.map(p=>{const m=p.path===l;return c.jsxs("button",{role:"tab",type:"button","aria-selected":m,tabIndex:m?0:-1,className:`${qr.tab} ${m?qr.tabActive:""}`,onClick:()=>r(p.path),children:[c.jsx("span",{className:qr.tabIcon,"aria-hidden":"true",children:p.icon}),p.label]},p.path)})})}const W2="_container_pi6ii_1",J2="_content_pi6ii_66",O0={container:W2,content:J2},eD=320,u_=220,d_=600,f_="grackle-sidebar-width";function tD(){try{const n=localStorage.getItem(f_);if(n!==null){const a=Number(n);if(Number.isFinite(a)&&a>=u_&&a<=d_)return a}}catch{}return eD}function nD(n){try{localStorage.setItem(f_,String(n))}catch{}}function aD(){const[n]=b.useState(tD),a=b.useRef(null),i=At(),l=_b(i.pathname);return b.useEffect(()=>{const r=a.current;if(!r)return;const f=new ResizeObserver(d=>{for(const p of d){const m=p.borderBoxSize[0];if(m){const g=Math.round(m.inlineSize);g>=u_&&g<=d_&&nD(g)}}});return f.observe(r),()=>{f.disconnect()}},[]),c.jsx("div",{className:O0.container,ref:a,"data-testid":"sidebar",style:{width:n},children:c.jsxs("div",{className:O0.content,children:[l==="tasks"&&c.jsx(I2,{}),l==="environments"&&c.jsx(q2,{}),l==="settings"&&c.jsx(Q2,{})]})})}const sD="_bar_tnfsh_1",iD="_btnPrimary_tnfsh_32",oD="_statusText_tnfsh_85",lD="_statusCompleted_tnfsh_90",rD="_statusFailed_tnfsh_94",cD="_statusBlocked_tnfsh_98",uD="_hintText_tnfsh_103",it={bar:sD,btnPrimary:iD,statusText:oD,statusCompleted:lD,statusFailed:rD,statusBlocked:cD,hintText:uD};function dD(){const{sessions:n,tasks:a,environments:i}=Je(),l=Ut(),r=At(),f=Nt("/sessions/:sessionId"),d=Nt("/tasks/:taskId"),p=Nt("/tasks/:taskId/stream"),m=Nt("/tasks/:taskId/findings"),g=Nt("/tasks/:taskId/edit"),y=Nt("/workspaces/:workspaceId/tasks/:taskId"),v=Nt("/workspaces/:workspaceId/tasks/:taskId/stream"),x=Nt("/workspaces/:workspaceId/tasks/:taskId/findings"),S=Nt("/workspaces/:workspaceId/tasks/:taskId/edit"),C=Nt("/sessions/new"),k=r.pathname.startsWith("/environments"),N=Nt("/workspaces/:workspaceId"),E=Nt("/tasks/new"),w=Nt("/chat"),D=Nt("/"),A=Nt("/settings/*"),U=f==null?void 0:f.params.sessionId,Y=(d==null?void 0:d.params.taskId)??(p==null?void 0:p.params.taskId)??(m==null?void 0:m.params.taskId)??(y==null?void 0:y.params.taskId)??(v==null?void 0:v.params.taskId)??(x==null?void 0:x.params.taskId)??(S==null?void 0:S.params.taskId),F=!!w,O=!!C,Z=!!N&&!y&&!v&&!x&&!S,ee=!!E;if(!!D&&!O&&!Z&&!ee||!!A||(!!g||!!S)||ee||k||O)return c.jsx(c.Fragment,{});if(F)return i.find(te=>te.adapterType==="local"&&te.status==="connected")?c.jsx(c.Fragment,{}):c.jsx("div",{className:it.bar,children:c.jsx("span",{className:it.hintText,children:"Add a local environment to start chatting"})});if(Z)return c.jsx("div",{className:it.bar,children:c.jsx("span",{className:it.hintText,children:"Select a task or click + to create one"})});if(Y){const X=a.find(H=>H.id===Y);if(!X)return c.jsx("div",{className:it.bar,children:c.jsx("span",{className:it.hintText,children:"Loading..."})});const te=new Map(a.map(H=>[H.id,H])),V=X.dependsOn.some(H=>{const z=te.get(H);return z!==void 0&&z.status!=="complete"});if(X.status==="not_started"){const H=V?X.dependsOn.map(z=>te.get(z)).filter(z=>z&&z.status!=="complete").map(z=>z.title):[];return c.jsx("div",{className:it.bar,children:V?c.jsxs("span",{className:it.statusBlocked,children:["Blocked by: ",H.join(", ")]}):c.jsx("span",{className:it.hintText,children:"Use the buttons above to start or manage this task"})})}if(X.status==="working"||X.status==="paused"){const H=X.latestSessionId||void 0,z=H?n.find(B=>B.id===H):void 0;return z&&!["completed","failed","interrupted","hibernating"].includes(z.status)?c.jsx(c.Fragment,{}):c.jsx("div",{className:it.bar,children:c.jsx("span",{className:it.hintText,children:"Waiting for agent..."})})}if(X.status==="complete")return c.jsxs("div",{className:it.bar,children:[c.jsx("span",{className:`${it.statusText} ${it.statusCompleted}`,children:"Task completed"}),c.jsx("button",{onClick:()=>l(Gi(X.workspaceId)),className:it.btnPrimary,children:"+ New Task"})]});if(X.status==="failed")return c.jsx("div",{className:it.bar,children:c.jsx("span",{className:`${it.statusText} ${it.statusFailed}`,children:"Task failed"})})}if(U){const X=n.find(H=>H.id===U),te=X!==void 0&&["completed","failed","interrupted","hibernating"].includes(X.status);if(X!==void 0&&!te)return c.jsx(c.Fragment,{});if(te)return c.jsxs("div",{className:it.bar,children:[c.jsxs("span",{className:`${it.statusText} ${it.hintText}`,children:["Session ",X.status]}),c.jsx("button",{onClick:()=>l(hb(X.environmentId)),className:it.btnPrimary,children:"+ New Chat"})]})}return c.jsx("div",{className:it.bar,children:c.jsx("span",{className:it.hintText,children:"Loading..."})})}const fD="_toast_da8ll_1",hD="_success_da8ll_18",pD="_icon_da8ll_22",mD="_error_da8ll_25",gD="_warning_da8ll_32",vD="_info_da8ll_38",yD="_message_da8ll_53",bD="_close_da8ll_60",qo={toast:fD,success:hD,icon:pD,error:mD,warning:gD,info:vD,message:yD,close:bD},xD={success:"✓",error:"✕",warning:"⚠",info:"ℹ"};function _D({toast:n,onDismiss:a}){return b.useEffect(()=>{const i=setTimeout(()=>a(n.id),n.duration);return()=>clearTimeout(i)},[n.id,n.duration,a]),c.jsxs(St.div,{className:`${qo.toast} ${qo[n.variant]}`,role:"status",initial:{opacity:0,y:-16,scale:.94},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.94},transition:{duration:.2,ease:"easeOut"},layout:!0,children:[c.jsx("span",{className:qo.icon,"aria-hidden":"true",children:xD[n.variant]}),c.jsx("span",{className:qo.message,children:n.message}),c.jsx("button",{type:"button",className:qo.close,onClick:()=>a(n.id),"aria-label":"Dismiss notification",children:"×"})]})}const SD="_container_qqse2_1",TD={container:SD};function CD(){const{toasts:n,dismissToast:a}=Pi();return c.jsx("div",{className:TD.container,"data-testid":"toast-container",children:c.jsx(qn,{children:n.map(i=>c.jsx(_D,{toast:i,onDismiss:a},i.id))})})}const kD="_breadcrumbs_17or2_1",ED="_list_17or2_11",ND="_item_17or2_21",AD="_separator_17or2_28",wD="_link_17or2_34",jD="_current_17or2_57",Ci={breadcrumbs:kD,list:ED,item:ND,separator:AD,link:wD,current:jD},DD="›";function Yi({segments:n}){return c.jsx("nav",{className:Ci.breadcrumbs,"aria-label":"Breadcrumb","data-testid":"breadcrumbs",children:c.jsx("ol",{className:Ci.list,children:n.map((a,i)=>{const l=i===n.length-1;return c.jsxs("li",{className:Ci.item,children:[i>0&&c.jsx("span",{className:Ci.separator,"aria-hidden":"true",children:DD}),a.url&&!l?c.jsx(ah,{className:Ci.link,to:a.url,title:a.label,children:a.label}):c.jsx("span",{className:Ci.current,"aria-current":"page",title:a.label,children:a.label})]},i)})})})}function qf(){qf=function(r,f){return new i(r,void 0,f)};var n=RegExp.prototype,a=new WeakMap;function i(r,f,d){var p=new RegExp(r,f);return a.set(p,d||a.get(r)),mc(p,i.prototype)}function l(r,f){var d=a.get(f);return Object.keys(d).reduce(function(p,m){var g=d[m];if(typeof g=="number")p[m]=r[g];else{for(var y=0;r[g[y]]===void 0&&y+1<g.length;)y++;p[m]=r[g[y]]}return p},Object.create(null))}return(function(r,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(f&&f.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),f&&mc(r,f)})(i,RegExp),i.prototype.exec=function(r){var f=n.exec.call(this,r);if(f){f.groups=l(f,this);var d=f.indices;d&&(d.groups=l(d,this))}return f},i.prototype[Symbol.replace]=function(r,f){if(typeof f=="string"){var d=a.get(this);return n[Symbol.replace].call(this,r,f.replace(/\$<([^>]+)>/g,function(m,g){var y=d[g];return"$"+(Array.isArray(y)?y.join("$"):y)}))}if(typeof f=="function"){var p=this;return n[Symbol.replace].call(this,r,function(){var m=arguments;return typeof m[m.length-1]!="object"&&(m=[].slice.call(m)).push(l(m,p)),f.apply(this,m)})}return n[Symbol.replace].call(this,r,f)},qf.apply(this,arguments)}function mc(n,a){return mc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,l){return i.__proto__=l,i},mc(n,a)}function B0(n,a){(a==null||a>n.length)&&(a=n.length);for(var i=0,l=new Array(a);i<a;i++)l[i]=n[i];return l}function df(n,a){var i=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i)return(i=i.call(n)).next.bind(i);if(Array.isArray(n)||(i=(function(r,f){if(r){if(typeof r=="string")return B0(r,f);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)?B0(r,f):void 0}})(n))||a){i&&(n=i);var l=0;return function(){return l>=n.length?{done:!0}:{done:!1,value:n[l++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
87
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var MD=(function(n){return function(a){return a===void 0&&(a={}),(function(l,r){if(r&&!l.registered(r))throw new Error('The default language "'+r+'" is not registered with refractor.')})(n,a.defaultLanguage),function(l){OS(l,"element",i)};function i(l,r,f){var d,p;if(f&&f.tagName==="pre"&&l.tagName==="code"){var m=(l==null||(d=l.data)==null?void 0:d.meta)||(l==null||(p=l.properties)==null?void 0:p.metastring)||"";l.properties.className?typeof l.properties.className=="boolean"?l.properties.className=[]:Array.isArray(l.properties.className)||(l.properties.className=[l.properties.className]):l.properties.className=[];var g,y,v=(function(U){for(var Y,F=df(U.properties.className);!(Y=F()).done;){var O=Y.value;if(O.slice(0,9)==="language-")return O.slice(9).toLowerCase()}return null})(l);if(!v&&a.defaultLanguage&&l.properties.className.push("language-"+(v=a.defaultLanguage)),l.properties.className.push("code-highlight"),v)try{var x,S;S=(x=v)!=null&&x.includes("diff-")?v.split("-")[1]:v,g=n.highlight(Ur(l),S),f.properties.className=(f.properties.className||[]).concat("language-"+S)}catch(U){if(!a.ignoreMissing||!/Unknown language/.test(U.message))throw U;g=l}else g=l;g.children=(y=1,function U(Y){return Y.reduce(function(F,O){if(O.type==="text"){var Z=O.value,ee=(Z.match(/\n/g)||"").length;if(ee===0)O.position={start:{line:y,column:1},end:{line:y,column:1}},F.push(O);else for(var ie,R=Z.split(`
|
|
88
|
-
`),ae=df(R.entries());!(ie=ae()).done;){var X=ie.value,te=X[0],V=X[1];F.push({type:"text",value:te===R.length-1?V:V+`
|
|
89
|
-
`,position:{start:{line:y+te,column:1},end:{line:y+te,column:1}}})}return y+=ee,F}if(Object.prototype.hasOwnProperty.call(O,"children")){var H=y;return O.children=U(O.children),F.push(O),O.position={start:{line:H,column:1},end:{line:y,column:1}},F}return F.push(O),F},[])})(g.children),g.position=g.children.length>0?{start:{line:g.children[0].position.start.line,column:0},end:{line:g.children[g.children.length-1].position.end.line,column:0}}:{start:{line:0,column:0},end:{line:0,column:0}};for(var C,k=(function(U){var Y=/{([\d,-]+)}/,F=U.split(",").map(function(ee){return ee.trim()}).join();if(Y.test(F)){var O=Y.exec(F)[1],Z=IS(O);return function(ee){return Z.includes(ee+1)}}return function(){return!1}})(m),N=(function(U){var Y=qf(/showLineNumbers=(\d+)/i,{lines:1});if(Y.test(U)){var F=Y.exec(U);return Number(F.groups.lines)}return 1})(m),E=(function(U){for(var Y=new Array(U),F=0;F<U;F++)Y[F]={type:"element",tagName:"span",properties:{className:[]},children:[]};return Y})(g.position.end.line),w=["showlinenumbers=false",'showlinenumbers="false"',"showlinenumbers={false}"],D=function(){var U,Y,F=C.value,O=F[0],Z=F[1];Z.properties.className=["code-line"];var ee=LS(g,function(ie){return ie.position.start.line<=O+1&&ie.position.end.line>=O+1});Z.children=ee.children,(m.toLowerCase().includes("showLineNumbers".toLowerCase())||a.showLineNumbers===!0||typeof a.showLineNumbers=="object"&&a.showLineNumbers.includes(v))&&!w.some(function(ie){return m.toLowerCase().includes(ie)})&&(Z.properties.line=[(O+N).toString()],Z.properties.className.push("line-number")),k(O)&&Z.properties.className.push("highlight-line"),(v==="diff"||(U=v)!=null&&U.includes("diff-"))&&Ur(Z).substring(0,1)==="-"?Z.properties.className.push("deleted"):(v==="diff"||(Y=v)!=null&&Y.includes("diff-"))&&Ur(Z).substring(0,1)==="+"&&Z.properties.className.push("inserted")},A=df(E.entries());!(C=A()).done;)D();E.length>0&&Ur(E[E.length-1]).trim()===""&&E.pop(),l.children=E}}}})(BS);function h_(n){if(n>=1e6)return`${(n/1e6).toFixed(1)}M`;if(n>=1e3){const a=Number((n/1e3).toFixed(1));return a>=1e3?`${(n/1e6).toFixed(1)}M`:`${a.toFixed(1)}k`}return String(n)}function Li(n){return n===0?"-":n<.01?`$${n.toFixed(4)}`:`$${n.toFixed(2)}`}const RD="_systemContextEvent_1qbiw_1",OD="_systemContextHeader_1qbiw_7",BD="_systemContextBadge_1qbiw_28",ID="_systemContextToggle_1qbiw_37",LD="_systemContextPre_1qbiw_43",zD="_systemContextEllipsis_1qbiw_54",UD="_systemEvent_1qbiw_58",VD="_systemTimestamp_1qbiw_65",HD="_textEvent_1qbiw_69",GD="_toolUseEvent_1qbiw_155",PD="_toolUseHeader_1qbiw_175",$D="_toolUsePrefix_1qbiw_182",FD="_toolUseName_1qbiw_187",qD="_toolUseArgs_1qbiw_192",YD="_toolResultEvent_1qbiw_203",KD="_toolResultHeader_1qbiw_208",ZD="_toolResultIndicatorOk_1qbiw_232",XD="_toolResultIndicatorError_1qbiw_239",QD="_toolResultLabel_1qbiw_246",WD="_toolResultToggle_1qbiw_250",JD="_toolResultCommand_1qbiw_256",eM="_toolResultEllipsis_1qbiw_266",tM="_toolResultPre_1qbiw_270",nM="_errorEvent_1qbiw_291",aM="_statusEvent_1qbiw_299",sM="_userInputEvent_1qbiw_308",iM="_userInputContent_1qbiw_314",oM="_signalEvent_1qbiw_331",lM="_signalBadge_1qbiw_342",rM="_signalContent_1qbiw_351",cM="_usageEvent_1qbiw_356",uM="_usageBadge_1qbiw_363",dM="_defaultEvent_1qbiw_372",Re={systemContextEvent:RD,systemContextHeader:OD,systemContextBadge:BD,systemContextToggle:ID,systemContextPre:LD,systemContextEllipsis:zD,systemEvent:UD,systemTimestamp:VD,textEvent:HD,toolUseEvent:GD,toolUseHeader:PD,toolUsePrefix:$D,toolUseName:FD,toolUseArgs:qD,toolResultEvent:YD,toolResultHeader:KD,toolResultIndicatorOk:ZD,toolResultIndicatorError:XD,toolResultLabel:QD,toolResultToggle:WD,toolResultCommand:JD,toolResultEllipsis:eM,toolResultPre:tM,errorEvent:nM,statusEvent:aM,userInputEvent:sM,userInputContent:iM,signalEvent:oM,signalBadge:lM,signalContent:rM,usageEvent:cM,usageBadge:uM,defaultEvent:dM},I0=3;function fM({content:n}){const[a,i]=b.useState(!1),l=n.split(`
|
|
90
|
-
`),r=l.length>I0,f=a?n:l.slice(0,I0).join(`
|
|
91
|
-
`);return c.jsxs("div",{className:Re.systemContextEvent,"data-testid":"system-context-event",children:[c.jsxs("button",{type:"button",className:Re.systemContextHeader,onClick:()=>{i(d=>!d)},"aria-expanded":a,children:[c.jsx("span",{className:Re.systemContextBadge,children:"SYSTEM PROMPT"}),r&&c.jsx("span",{className:Re.systemContextToggle,"aria-hidden":"true",children:a?"▾":"▸"})]}),c.jsxs("pre",{className:Re.systemContextPre,children:[f,!a&&r&&c.jsx("span",{className:Re.systemContextEllipsis,children:"…"})]})]})}function hM({time:n,content:a}){return c.jsxs("div",{className:Re.systemEvent,children:[c.jsxs("span",{className:Re.systemTimestamp,children:["[",n,"]"]})," ",a]})}function pM({content:n}){return c.jsx("div",{className:Re.textEvent,children:c.jsx(Kf,{remarkPlugins:[Zf],rehypePlugins:[MD],children:n})})}function mM({content:n}){let a="",i=n;try{const l=JSON.parse(n);a=l.tool||"",i=JSON.stringify(l.args,null,2)}catch{}return c.jsxs("div",{className:Re.toolUseEvent,children:[c.jsxs("div",{className:Re.toolUseHeader,children:[c.jsx("span",{className:Re.toolUsePrefix,children:">"}),a?c.jsx("span",{className:Re.toolUseName,children:a}):null]}),c.jsx("pre",{className:Re.toolUseArgs,children:i})]})}const L0=5;function gM(n,a){if(a==null)return"";if(typeof a!="object")return String(a);const i=a;if(typeof i.command=="string")return i.command;if(typeof i.file_path=="string")return i.file_path;if(typeof i.pattern=="string"){const l=typeof i.path=="string"?` in ${i.path}`:"";return`${i.pattern}${l}`}if(typeof i.path=="string")return i.path;if(typeof i.query=="string")return i.query;try{const l=JSON.stringify(a);return l.length>150?`${l.slice(0,150)}…`:l}catch{return""}}function vM({content:n,raw:a,toolUseCtx:i}){const[l,r]=b.useState(!1);let f=!1;if(a)try{f=JSON.parse(a).is_error===!0}catch{}const d=n.split(`
|
|
92
|
-
`),p=d.length>L0,m=l?n:d.slice(0,L0).join(`
|
|
93
|
-
`),y=((i==null?void 0:i.tool)??"")||(f?"Tool error":"Tool output"),v=i?gM(i.tool,i.args):"",x=c.jsxs(c.Fragment,{children:[c.jsx("span",{className:f?Re.toolResultIndicatorError:Re.toolResultIndicatorOk,"aria-label":f?"error":"success","data-testid":f?"tool-result-indicator-error":"tool-result-indicator-ok",children:f?"✗":"✓"}),c.jsx("span",{className:Re.toolResultLabel,"data-testid":"tool-result-label",children:y}),p&&c.jsx("span",{className:Re.toolResultToggle,"aria-hidden":"true",children:l?"▾":"▸"})]});return c.jsxs("div",{className:Re.toolResultEvent,"data-testid":"tool-result",children:[p?c.jsx("button",{className:Re.toolResultHeader,"data-testid":"tool-result-header",onClick:()=>{r(S=>!S)},"aria-expanded":l,children:x}):c.jsx("div",{className:Re.toolResultHeader,"data-testid":"tool-result-header",children:x}),v&&c.jsx("div",{className:Re.toolResultCommand,children:v}),c.jsxs("pre",{className:Re.toolResultPre,"data-testid":"tool-result-content",children:[m,!l&&p&&c.jsx("span",{className:Re.toolResultEllipsis,children:"…"})]})]})}function yM({content:n}){return c.jsxs("div",{className:Re.errorEvent,children:["Error: ",n]})}function bM({content:n}){return c.jsxs("div",{className:Re.statusEvent,children:["--- ",n," ---"]})}function xM({content:n}){return c.jsx("div",{className:Re.userInputEvent,children:c.jsx("span",{className:Re.userInputContent,children:n})})}function _M({content:n}){return c.jsxs("div",{className:Re.signalEvent,"data-testid":"signal-event",children:[c.jsx("span",{className:Re.signalBadge,children:"SIGNAL"}),c.jsx("span",{className:Re.signalContent,children:n})]})}function SM({content:n}){let a=n;try{const i=JSON.parse(n),l=Number(i.input_tokens)||0,r=Number(i.output_tokens)||0,f=h_(l+r),d=Li(Number(i.cost_usd)||0);a=`${f} tokens · ${d}`}catch{}return c.jsx("div",{className:Re.usageEvent,"data-testid":"usage-event",children:c.jsx("span",{className:Re.usageBadge,children:a})})}function TM({content:n}){return c.jsx("div",{className:Re.defaultEvent,children:n})}function CM({event:n,toolUseCtx:a}){const i=new Date(n.timestamp).toLocaleTimeString();switch(n.eventType){case"system":{if(n.raw)try{if(JSON.parse(n.raw).systemContext===!0)return c.jsx(fM,{content:n.content})}catch{}return c.jsx(hM,{time:i,content:n.content})}case"text":case"output":return c.jsx(pM,{content:n.content});case"tool_use":return c.jsx(mM,{content:n.content});case"tool_result":return c.jsx(vM,{content:n.content,raw:n.raw,toolUseCtx:a});case"error":return c.jsx(yM,{content:n.content});case"status":return c.jsx(bM,{content:n.content});case"user_input":return c.jsx(xM,{content:n.content});case"signal":return c.jsx(_M,{content:n.content});case"usage":return c.jsx(SM,{content:n.content});default:return c.jsx(TM,{content:n.content})}}const kM="_overlay_cmicx_1",EM="_dialog_cmicx_11",NM="_title_cmicx_30",AM="_description_cmicx_38",wM="_actions_cmicx_45",jM="_cancelButton_cmicx_52",DM="_confirmButton_cmicx_79",Ts={overlay:kM,dialog:EM,title:NM,description:AM,actions:wM,cancelButton:jM,confirmButton:DM};function Nc({isOpen:n,title:a,description:i,confirmLabel:l="Delete",onConfirm:r,onCancel:f}){const d=b.useId(),p=b.useId();return c.jsx(qn,{children:n&&c.jsx(St.div,{className:Ts.overlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},onClick:f,onKeyDown:m=>{m.key==="Escape"&&f()},role:"dialog","aria-modal":"true","aria-labelledby":d,"aria-describedby":i?p:void 0,children:c.jsxs(St.div,{className:Ts.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:Ts.title,children:a}),i&&c.jsx("p",{id:p,className:Ts.description,children:i}),c.jsxs("div",{className:Ts.actions,children:[c.jsx("button",{type:"button",className:Ts.cancelButton,onClick:f,autoFocus:!0,children:"Cancel"}),c.jsx("button",{type:"button",className:Ts.confirmButton,onClick:r,children:l})]})]})})})}const MM="_spinner_1uyt1_1",RM="_spin_1uyt1_1",OM="_sm_1uyt1_14",BM="_md_1uyt1_20",IM="_lg_1uyt1_26",LM="_xl_1uyt1_32",z0={spinner:MM,spin:RM,sm:OM,md:BM,lg:IM,xl:LM};function Gh({size:n="md",className:a,label:i="Loading",liveRegion:l=!1}){return c.jsx("span",{className:`${z0.spinner} ${z0[n]} ${a??""}`,role:l?"status":void 0,"aria-label":i,"aria-hidden":l?void 0:!0})}const zM="_splash_1bn1g_1",UM="_logo_1bn1g_11",U0={splash:zM,logo:UM};function VM(){return c.jsxs("div",{className:U0.splash,"data-testid":"splash-screen",children:[c.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:U0.logo}),c.jsx(Gh,{size:"xl",label:"Loading Grackle",liveRegion:!0})]})}function HM(n,a){const i=b.useRef(null);b.useEffect(()=>{const l=i.current;if(i.current=n,l===null)return;const r=new Map;for(const d of l)r.set(d.id,d);const f=new Set;for(const d of n){f.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 l)f.has(d.id)||a("Environment removed","info")},[n,a])}function GM(n,a,i){const l=n.filter(m=>m.status==="running"||m.status==="idle"||m.status==="waiting").length,r=p_(a),f=a.filter(m=>Yf(m,r)).length,d=a.filter(m=>m.status==="paused"||m.status==="failed"||Yf(m,r)).length,p=i.filter(m=>m.status==="disconnected"||m.status==="error").length;return{activeSessions:l,blockedTasks:f,attentionTasks:d,unhealthyEnvironments:p}}function p_(n){const a=new Map;for(const i of n)a.set(i.id,i.status);return a}function Yf(n,a){return n.dependsOn.some(i=>a.get(i)!=="complete")}function PM(n,a){var d;const i=new Map;for(const p of a)i.set(p.id,p);const l=p_(n),r=[];for(const p of n){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}):Yf(p,l)?r.push({task:p,reason:"blocked",workspaceName:m}):p.status==="paused"&&r.push({task:p,reason:"paused",workspaceName:m})}const f={failed:0,blocked:1,paused:2};return r.sort((p,m)=>(f[p.reason]??3)-(f[m.reason]??3)),r}function $M(n,a){const i=new Map;for(const l of a)i.set(l.id,l);return n.filter(l=>l.status==="running"||l.status==="idle"||l.status==="waiting").map(l=>{var r;return{session:l,environmentName:((r=i.get(l.environmentId))==null?void 0:r.displayName)??"Unknown"}})}function FM(n,a,i){const l=new Map;for(const r of a){if(!r.workspaceId)continue;let f=l.get(r.workspaceId);f||(f={totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0},l.set(r.workspaceId,f)),f.totalTasks+=1,r.status==="complete"?f.completedTasks+=1:r.status==="working"?f.workingTasks+=1:r.status==="failed"&&(f.failedTasks+=1)}return n.map(r=>{const f=l.get(r.id)??{totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0};return{workspace:r,totalTasks:f.totalTasks,completedTasks:f.completedTasks,workingTasks:f.workingTasks,failedTasks:f.failedTasks}})}const qM="_dashboard_16pzm_1",YM="_kpiStrip_16pzm_11",KM="_kpiCard_16pzm_23",ZM="_kpiValue_16pzm_68",XM="_kpiLabel_16pzm_76",QM="_bodyGrid_16pzm_84",WM="_section_16pzm_96",JM="_sectionHeader_16pzm_109",eR="_sectionIcon_16pzm_118",tR="_sectionTitle_16pzm_123",nR="_sectionCount_16pzm_131",aR="_sectionBody_16pzm_138",sR="_emptyHint_16pzm_143",iR="_sessionRow_16pzm_150",oR="_sessionPrompt_16pzm_177",lR="_sessionEnv_16pzm_186",rR="_sessionRuntime_16pzm_192",cR="_sessionStatus_16pzm_198",uR="_statusDot_16pzm_207",dR="_attentionRow_16pzm_233",fR="_attentionTitle_16pzm_259",hR="_attentionMeta_16pzm_267",pR="_reasonBadge_16pzm_274",mR="_bottomGrid_16pzm_301",gR="_envRow_16pzm_312",vR="_envName_16pzm_323",yR="_envStatusBadge_16pzm_333",bR="_workspaceRow_16pzm_369",xR="_workspaceTop_16pzm_395",_R="_workspaceName_16pzm_401",SR="_workspaceCounts_16pzm_407",TR="_progressBar_16pzm_415",CR="_progressFill_16pzm_422",me={dashboard:qM,kpiStrip:YM,kpiCard:KM,kpiValue:ZM,kpiLabel:XM,bodyGrid:QM,section:WM,sectionHeader:JM,sectionIcon:eR,sectionTitle:tR,sectionCount:nR,sectionBody:aR,emptyHint:sR,sessionRow:iR,sessionPrompt:oR,sessionEnv:lR,sessionRuntime:rR,sessionStatus:cR,statusDot:uR,attentionRow:dR,attentionTitle:fR,attentionMeta:hR,reasonBadge:pR,bottomGrid:mR,envRow:gR,envName:vR,envStatusBadge:yR,workspaceRow:bR,workspaceTop:xR,workspaceName:_R,workspaceCounts:SR,progressBar:TR,progressFill:CR},kR={hidden:{opacity:0,y:12},visible:n=>({opacity:1,y:0,transition:{delay:n*.06,duration:.3,ease:"easeOut"}})},Yr={hidden:{opacity:0,y:16},visible:n=>({opacity:1,y:0,transition:{delay:.15+n*.08,duration:.35,ease:"easeOut"}})};function ER(n,a,i,l){const r=[`${n} of ${a} tasks completed`];return i>0&&r.push(`${i} in progress`),l>0&&r.push(`${l} failed`),r.join(", ")}function Kr({value:n,label:a,accent:i,index:l,testId:r}){return c.jsxs(St.div,{className:me.kpiCard,"data-accent":i,"data-testid":r,variants:kR,initial:"hidden",animate:"visible",custom:l,children:[c.jsx("span",{className:me.kpiValue,children:n}),c.jsx("span",{className:me.kpiLabel,children:a})]})}function NR(){const{workspaces:n,tasks:a,sessions:i,environments:l,loadTasks:r}=Je(),f=Ut(),d=b.useRef(new Set);b.useEffect(()=>{for(const v of n)d.current.has(v.id)||(d.current.add(v.id),r(v.id))},[n,r]);const p=b.useMemo(()=>GM(i,a,l),[i,a,l]),m=b.useMemo(()=>$M(i,l),[i,l]),g=b.useMemo(()=>PM(a,n),[a,n]),y=b.useMemo(()=>FM(n,a),[n,a,l]);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(Kr,{value:p.activeSessions,label:"Active Sessions",accent:"green",index:0,testId:"kpi-active-sessions"}),c.jsx(Kr,{value:p.blockedTasks,label:"Blocked Tasks",accent:"yellow",index:1,testId:"kpi-blocked-tasks"}),c.jsx(Kr,{value:p.attentionTasks,label:"Needs Attention",accent:"red",index:2,testId:"kpi-attention-tasks"}),c.jsx(Kr,{value:p.unhealthyEnvironments,label:"Unhealthy Envs",accent:"blue",index:3,testId:"kpi-unhealthy-envs"})]}),c.jsxs("div",{className:me.bodyGrid,children:[c.jsxs(St.div,{className:me.section,variants:Yr,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:v,environmentName:x})=>c.jsxs("button",{type:"button",className:me.sessionRow,onClick:()=>f(fb(v.id)),"data-testid":"session-row",children:[c.jsx("span",{className:me.sessionPrompt,title:v.prompt,children:v.prompt||"—"}),c.jsx("span",{className:me.sessionEnv,children:x}),c.jsx("span",{className:me.sessionRuntime,children:v.runtime}),c.jsxs("span",{className:me.sessionStatus,children:[c.jsx("span",{className:me.statusDot,"data-status":v.status}),v.status]})]},v.id))})]}),c.jsxs(St.div,{className:me.section,variants:Yr,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:v,reason:x,workspaceName:S})=>c.jsxs("button",{type:"button",className:me.attentionRow,onClick:()=>f(va(v.id)),"data-testid":"attention-row",children:[c.jsxs("div",{className:me.attentionTitle,children:[c.jsx("span",{className:me.reasonBadge,"data-reason":x,children:x}),v.title]}),c.jsx("div",{className:me.attentionMeta,children:c.jsx("span",{children:S})})]},v.id))})]})]}),c.jsxs("div",{className:me.bottomGrid,children:[c.jsxs(St.div,{className:me.section,variants:Yr,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:l.length})]}),c.jsx("div",{className:me.sectionBody,children:l.length===0?c.jsx("div",{className:me.emptyHint,children:"No environments configured"}):l.map(v=>c.jsxs("div",{className:me.envRow,"data-testid":"dashboard-env-row",children:[c.jsx("span",{className:me.envName,children:v.displayName}),c.jsx("span",{className:me.envStatusBadge,"data-status":v.status,children:v.status})]},v.id))})]}),c.jsxs(St.div,{className:me.section,variants:Yr,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:n.length})]}),c.jsx("div",{className:me.sectionBody,children:y.length===0?c.jsx("div",{className:me.emptyHint,children:"No workspaces yet"}):y.map(({workspace:v,totalTasks:x,completedTasks:S,workingTasks:C,failedTasks:k})=>{const N=x>0?Math.round(S/x*100):0;return c.jsxs("button",{type:"button",className:me.workspaceRow,onClick:()=>f(Ri(v.id)),"data-testid":"workspace-row",children:[c.jsxs("div",{className:me.workspaceTop,children:[c.jsx("span",{className:me.workspaceName,children:v.name}),c.jsxs("span",{className:me.workspaceCounts,"aria-label":ER(S,x,C,k),children:[S,"/",x,C>0&&c.jsxs("span",{style:{color:"var(--accent-green)"},"aria-hidden":"true",children:["▸",C]}),k>0&&c.jsxs("span",{style:{color:"var(--accent-red)"},"aria-hidden":"true",children:["✗",k]})]})]}),x>0&&c.jsx("div",{className:me.progressBar,children:c.jsx("div",{className:me.progressFill,style:{width:`${N}%`}})})]},v.id)})})]})]})]})}const AR="_panelContainer_aei9x_1",wR="_emptyState_aei9x_8",jR="_fadeIn_aei9x_1",DR="_workspaceSummary_aei9x_17",MR="_workspaceSummaryTitle_aei9x_28",RR="_workspaceSummarySubtitle_aei9x_32",OR="_header_aei9x_36",BR="_headerInfo_aei9x_69",IR="_killButton_aei9x_75",LR="_headerTitle_aei9x_104",zR="_headerActions_aei9x_119",UR="_taskStatusBadge_aei9x_126",VR="_taskBranch_aei9x_135",HR="_taskBlockedBadge_aei9x_141",GR="_btnPrimary_aei9x_149",PR="_btnDanger_aei9x_180",$R="_btnGhost_aei9x_219",FR="_rejectInput_aei9x_245",qR="_tabBar_aei9x_275",YR="_tab_aei9x_275",KR="_active_aei9x_301",ZR="_eventScroll_aei9x_306",XR="_tabContent_aei9x_312",QR="_noContext_aei9x_317",WR="_overviewContent_aei9x_323",JR="_overviewDashboard_aei9x_332",e3="_overviewHero_aei9x_338",t3="_statusBadge_aei9x_345",n3="_statusPending_aei9x_357",a3="_statusAssigned_aei9x_362",s3="_statusInProgress_aei9x_367",i3="_statusReview_aei9x_372",o3="_statusDone_aei9x_377",l3="_statusFailed_aei9x_382",r3="_statusWaitingInput_aei9x_387",c3="_overviewBranchPill_aei9x_392",u3="_branchLink_aei9x_407",d3="_overviewSection_aei9x_418",f3="_overviewLabel_aei9x_424",h3="_overviewValue_aei9x_431",p3="_overviewMuted_aei9x_436",m3="_overviewMarkdown_aei9x_442",g3="_envRow_aei9x_511",v3="_envDot_aei9x_517",y3="_envDotGreen_aei9x_524",b3="_envDotYellow_aei9x_528",x3="_envDotRed_aei9x_532",_3="_envDotGray_aei9x_536",S3="_depList_aei9x_540",T3="_depItem_aei9x_546",C3="_depBlocked_aei9x_553",k3="_depDone_aei9x_557",E3="_timeline_aei9x_561",N3="_timelineRow_aei9x_567",A3="_timelineKey_aei9x_574",w3="_timelineValue_aei9x_580",j3="_timelineDelta_aei9x_584",D3="_reviewNotes_aei9x_595",M3="_overviewDescription_aei9x_606",R3="_waitingMessage_aei9x_612",O3="_errorMessage_aei9x_616",B3="_eventOverflowWarning_aei9x_620",I3="_attemptSelector_aei9x_634",L3="_attemptLabel_aei9x_650",z3="_attemptButton_aei9x_654",U3="_attemptActive_aei9x_671",V3="_attemptStatus_aei9x_677",H3="_emptyCta_aei9x_683",G3="_ctaTitle_aei9x_695",P3="_ctaDescription_aei9x_701",$3="_ctaButton_aei9x_708",F3="_ctaCreateForm_aei9x_743",q3="_ctaCreateInput_aei9x_749",Y3="_ctaCreateOk_aei9x_780",K3="_ctaLink_aei9x_815",Z3="_workspaceHeader_aei9x_829",X3="_workspaceName_aei9x_854",Q3="_workspaceMeta_aei9x_867",W3="_metaRow_aei9x_875",J3="_metaLabel_aei9x_888",eO="_metaValue_aei9x_903",tO="_archiveButton_aei9x_913",nO="_repoLink_aei9x_943",aO="_metaToggle_aei9x_953",sO="_metaToggleArrow_aei9x_974",iO="_metaToggleArrowOpen_aei9x_979",oO="_progressBarContainer_aei9x_983",lO="_progressBar_aei9x_983",rO="_progressFill_aei9x_999",cO="_progressLabel_aei9x_1006",uO="_metaTimestamps_aei9x_1013",dO="_metaTimestamp_aei9x_1013",I={panelContainer:AR,emptyState:wR,fadeIn:jR,workspaceSummary:DR,workspaceSummaryTitle:MR,workspaceSummarySubtitle:RR,header:OR,headerInfo:BR,killButton:IR,headerTitle:LR,headerActions:zR,taskStatusBadge:UR,taskBranch:VR,taskBlockedBadge:HR,btnPrimary:GR,btnDanger:PR,btnGhost:$R,rejectInput:FR,tabBar:qR,tab:YR,active:KR,eventScroll:ZR,tabContent:XR,noContext:QR,overviewContent:WR,overviewDashboard:JR,overviewHero:e3,statusBadge:t3,statusPending:n3,statusAssigned:a3,statusInProgress:s3,statusReview:i3,statusDone:o3,statusFailed:l3,statusWaitingInput:r3,overviewBranchPill:c3,branchLink:u3,overviewSection:d3,overviewLabel:f3,overviewValue:h3,overviewMuted:p3,overviewMarkdown:m3,envRow:g3,envDot:v3,envDotGreen:y3,envDotYellow:b3,envDotRed:x3,envDotGray:_3,depList:S3,depItem:T3,depBlocked:C3,depDone:k3,timeline:E3,timelineRow:N3,timelineKey:A3,timelineValue:w3,timelineDelta:j3,reviewNotes:D3,overviewDescription:M3,waitingMessage:R3,errorMessage:O3,eventOverflowWarning:B3,attemptSelector:I3,attemptLabel:L3,attemptButton:z3,attemptActive:U3,attemptStatus:V3,emptyCta:H3,ctaTitle:G3,ctaDescription:P3,ctaButton:$3,ctaCreateForm:F3,ctaCreateInput:q3,ctaCreateOk:Y3,ctaLink:K3,workspaceHeader:Z3,workspaceName:X3,workspaceMeta:Q3,metaRow:W3,metaLabel:J3,metaValue:eO,archiveButton:tO,repoLink:nO,metaToggle:aO,metaToggleArrow:sO,metaToggleArrowOpen:iO,progressBarContainer:oO,progressBar:lO,progressFill:rO,progressLabel:cO,metaTimestamps:uO,metaTimestamp:dO};function fO(){return c.jsx("div",{className:I.emptyState,children:"Select a task or click + to create one"})}function hO(){return c.jsx("div",{className:I.emptyState,children:"Select an environment to manage its workspaces, or add a new one."})}function pO(){const{workspaces:n,environments:a,createWorkspace:i,workspaceCreating:l}=Je(),[r,f]=b.useState(!1),[d,p]=b.useState(""),m=a.length>0,g=()=>{!d.trim()||l||!m||i(d.trim(),void 0,void 0,a[0].id)};return n.length>0?c.jsx(NR,{}):c.jsxs("div",{className:I.emptyCta,"data-testid":"welcome-cta",children:[c.jsx("div",{className:I.ctaTitle,children:"Welcome to Grackle"}),c.jsx("div",{className:I.ctaDescription,children:"Organize your work into workspaces and let agents tackle the tasks."}),r?c.jsxs("div",{className:I.ctaCreateForm,children:[c.jsx("input",{type:"text",value:d,onChange:y=>p(y.target.value),onKeyDown:y=>{y.key==="Enter"?g():y.key==="Escape"&&(f(!1),p(""))},placeholder:"Workspace name...","aria-label":"Workspace name",autoFocus:!0,disabled:l,className:I.ctaCreateInput,"data-testid":"welcome-create-input"}),c.jsx("button",{onClick:g,className:I.ctaCreateOk,disabled:l,"aria-label":l?"Creating workspace":void 0,"data-testid":"welcome-create-ok",children:l?c.jsx(Gh,{size:"sm",label:"Creating workspace"}):"OK"})]}):c.jsx("button",{className:I.ctaButton,onClick:()=>f(!0),disabled:l||!m,"data-testid":"welcome-create-button",children:"Create Your First Workspace"}),!m&&c.jsx("div",{className:I.ctaDescription,children:"Add an environment first before creating a workspace."})]})}const m_=50;function mO(n,a,i,l,r=m_){return l?n<r:a-n-i<r}function gO(n,a){const i=a-n;return i>0?i:0}function vO({scrollRef:n,contentLength:a,isReversed:i}){const[l,r]=b.useState(!0),f=b.useRef(0),d=b.useRef(!1),p=b.useRef(0);b.useEffect(()=>{const g=n.current;if(!g)return;let y=!0;const v=()=>{p.current||(p.current=requestAnimationFrame(()=>{p.current=0;const x=mO(g.scrollTop,g.scrollHeight,g.clientHeight,i,m_);x!==y&&(y=x,r(x))}))};return g.addEventListener("scroll",v,{passive:!0}),()=>{g.removeEventListener("scroll",v),p.current&&(cancelAnimationFrame(p.current),p.current=0)}},[n,i]),b.useLayoutEffect(()=>{const g=n.current;!g||d.current||(d.current=!0,i?g.scrollTop=0:g.scrollTop=g.scrollHeight,r(!0))},[n,i]),b.useLayoutEffect(()=>{const g=n.current;if(g){if(i&&!l){const y=gO(f.current,g.scrollHeight);y>0&&(g.scrollTop+=y)}l&&(i?g.scrollTo({top:0,behavior:"smooth"}):g.scrollTo({top:g.scrollHeight,behavior:"smooth"})),f.current=g.scrollHeight}},[a,l,i,n]);const m=b.useCallback(()=>{const g=n.current;if(!g)return;const y=i?0:g.scrollHeight;g.scrollTo({top:y,behavior:"smooth"}),r(!0)},[n,i]);return{isAtAnchor:l,scrollToAnchor:m}}const yO="_wrapper_p24zt_1",bO="_scrollContainer_p24zt_9",xO="_toolbar_p24zt_15",_O="_directionToggle_p24zt_22",SO="_scrollToAnchor_p24zt_60",TO="_scrollToAnchorBottom_p24zt_84",CO="_scrollToAnchorTop_p24zt_88",Cs={wrapper:yO,scrollContainer:bO,toolbar:xO,directionToggle:_O,scrollToAnchor:SO,scrollToAnchorBottom:TO,scrollToAnchorTop:CO},g_="grackle-stream-direction";function kO(){try{return localStorage.getItem(g_)==="reversed"}catch{return!1}}function EO({eventsDropped:n}){return n<=0?c.jsx(c.Fragment,{}):c.jsxs("div",{className:I.eventOverflowWarning,role:"alert",children:["⚠"," ",n.toLocaleString()," older event",n===1?"":"s"," were dropped — only the most recent 5,000 are shown. Full history is available in the session log."]})}function Ph({events:n,eventsDropped:a,emptyState:i}){const l=b.useRef(null),[r,f]=b.useState(kO),d=dj(),p=b.useMemo(()=>r?[...n].reverse():n,[n,r]),{isAtAnchor:m,scrollToAnchor:g}=vO({scrollRef:l,contentLength:n.length,isReversed:r}),y=()=>{const S=!r;f(S);try{localStorage.setItem(g_,S?"reversed":"default")}catch{}},v=d?0:.2,x=r?-8:8;return c.jsxs("div",{className:Cs.wrapper,children:[c.jsx("div",{className:Cs.toolbar,children:c.jsx("button",{className:Cs.directionToggle,onClick:y,title:r?"Showing newest first":"Showing oldest first","aria-label":r?"Switch to newest at bottom":"Switch to newest at top","data-testid":"direction-toggle",children:r?"↓":"↑"})}),c.jsxs("div",{ref:l,className:Cs.scrollContainer,"data-testid":"event-stream-scroll",children:[n.length===0&&i,c.jsx(EO,{eventsDropped:a}),c.jsx(qn,{initial:!1,children:p.map((S,C)=>{const k=r?n.length-1-C:C;return c.jsx(St.div,{initial:{opacity:0,y:x},animate:{opacity:1,y:0},transition:{duration:v,ease:"easeOut"},children:c.jsx(CM,{event:S,toolUseCtx:S.toolUseCtx})},`${S.sessionId}-${S.timestamp}-${k}`)})})]}),c.jsx(qn,{children:!m&&c.jsxs(St.button,{className:`${Cs.scrollToAnchor} ${r?Cs.scrollToAnchorTop:Cs.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 NO="_bar_1xhb4_1",AO="_input_1xhb4_32",wO="_select_1xhb4_67",jO="_btnPrimary_1xhb4_103",DO="_btnDanger_1xhb4_134",MO="_btnGhost_1xhb4_173",RO="_badge_1xhb4_195",OO="_disconnectHint_1xhb4_205",Wt={bar:NO,input:AO,select:wO,btnPrimary:jO,btnDanger:DO,btnGhost:MO,badge:RO,disconnectHint:OO};function BO(n,a){if(!n)return!1;const i=a.find(l=>l.id===n);return i!==void 0&&(i.status==="disconnected"||i.status==="error")}function IO({environmentId:n,onReconnect:a}){return c.jsxs(c.Fragment,{children:[c.jsx("span",{className:Wt.disconnectHint,"data-testid":"env-disconnect-hint",children:"Environment unavailable"}),c.jsx("button",{type:"button",onClick:()=>a(n),className:Wt.btnGhost,"data-testid":"reconnect-btn",title:"Reconnect the environment to resume messaging",children:"Reconnect"})]})}function ml({mode:n,sessionId:a,environmentId:i,taskId:l,showStop:r,showPersonaSelect:f,onSessionKill:d}){const{sendInput:p,spawn:m,startTask:g,personas:y,environments:v,provisionEnvironment:x}=Je(),{showToast:S}=Pi(),[C,k]=b.useState(""),[N,E]=b.useState(""),w=BO(i,v),D=A=>{if(A.preventDefault(),!!C.trim())if(n==="send"){if(!a||w)return;p(a,C),k("")}else if(n==="spawn"){if(!i)return;m(i,C,N),S("Session started","success"),k(""),E("")}else{if(!l)return;g(l,void 0,i,C),k("")}};return n==="spawn"?c.jsxs("form",{onSubmit:D,className:Wt.bar,children:[c.jsx("span",{className:Wt.badge,children:"new chat"}),c.jsx("input",{type:"text",value:C,onChange:A=>k(A.target.value),placeholder:"Enter prompt...",autoFocus:!0,className:Wt.input}),f&&c.jsxs("select",{value:N,onChange:A=>E(A.target.value),className:Wt.select,children:[c.jsx("option",{value:"",children:"(Default)"}),y.map(A=>c.jsx("option",{value:A.id,children:A.name},A.id))]}),c.jsx("button",{type:"submit",disabled:!C.trim()||!i,className:Wt.btnPrimary,children:"Go"})]}):n==="start"?c.jsxs("form",{onSubmit:D,className:Wt.bar,children:[c.jsx("input",{type:"text",value:C,onChange:A=>k(A.target.value),placeholder:"Type a message...",autoFocus:!0,className:Wt.input}),c.jsx("button",{type:"submit",disabled:!C.trim(),className:Wt.btnPrimary,children:"Send"})]}):c.jsxs("form",{onSubmit:D,className:Wt.bar,children:[w&&i&&c.jsx(IO,{environmentId:i,onReconnect:x}),c.jsx("input",{type:"text",value:C,onChange:A=>k(A.target.value),placeholder:"Type a message...",autoFocus:!w,disabled:w,className:Wt.input}),c.jsx("span",{title:w?"Environment is unavailable — reconnect first":void 0,children:c.jsx("button",{type:"submit",disabled:!C.trim()||w,className:Wt.btnPrimary,children:"Send"})}),r&&d&&c.jsx("button",{type:"button",onClick:d,className:Wt.btnDanger,title:"Stop session",children:"Stop"})]})}function $h(n){const a=[];for(const i of n){const l=a[a.length-1];i.eventType==="text"&&(l==null?void 0:l.eventType)==="text"?a[a.length-1]={...l,content:l.content+i.content}:a.push(i)}return a}function Fh(n){const a=new Map;for(const f of n)if(f.raw)try{a.set(f,JSON.parse(f.raw))}catch{}const i=new Map;for(const f of n){if(f.eventType!=="tool_use")continue;const d=a.get(f);if(!(!d||typeof d.id!="string"))try{const p=JSON.parse(f.content);i.set(d.id,{tool:p.tool,args:p.args})}catch{}}const l=new Set;return n.map(f=>{if(f.eventType!=="tool_result")return f;const d=a.get(f);if(!d||typeof d.tool_use_id!="string")return f;const p=i.get(d.tool_use_id);return p?(l.add(d.tool_use_id),{...f,toolUseCtx:p}):f}).filter(f=>{if(f.eventType!=="tool_use")return!0;const d=a.get(f);return d&&typeof d.id=="string"?!l.has(d.id):!0})}const LO="_panelContainer_pz4cr_1",zO="_emptyState_pz4cr_8",UO="_emptyTitle_pz4cr_20",VO="_emptyDescription_pz4cr_26",HO="_emptyHint_pz4cr_32",Wo={panelContainer:LO,emptyState:zO,emptyTitle:UO,emptyDescription:VO,emptyHint:HO};function GO({hasLocalEnvironment:n}){return c.jsxs("div",{className:Wo.emptyState,"data-testid":"chat-empty-state",children:[c.jsx("div",{className:Wo.emptyTitle,children:"Welcome to Grackle"}),c.jsx("div",{className:Wo.emptyDescription,children:n?"Type a message below to start chatting with the System agent. It can help you plan work, create tasks, and coordinate agents.":"Add a local environment in Settings to start chatting."}),!n&&c.jsx("div",{className:Wo.emptyHint,children:"Go to Settings → Environments to add one."})]})}function PO(){const{tasks:n,sessions:a,events:i,eventsDropped:l,environments:r,loadTaskSessions:f,loadSessionEvents:d,kill:p,taskSessions:m}=Je(),g=b.useRef(void 0),y=n.find(k=>k.id===Fo),v=y!=null&&y.latestSessionId?a.find(k=>k.id===y.latestSessionId)??(m[Fo]??[]).find(k=>k.id===y.latestSessionId):void 0;b.useEffect(()=>{f(Fo)},[f]),b.useEffect(()=>{y!=null&&y.latestSessionId&&f(Fo)},[y==null?void 0:y.latestSessionId,f]),b.useEffect(()=>{v&&v.id!==g.current&&(g.current=v.id,d(v.id))},[v==null?void 0:v.id,d]);const x=b.useMemo(()=>{if(!v)return[];const k=i.filter(N=>N.sessionId===v.id);return Fh($h(k))},[i,v==null?void 0:v.id]),S=r.find(k=>k.adapterType==="local"&&k.status==="connected"),C=v!==void 0&&!["completed","failed","interrupted","hibernating","suspended"].includes(v.status);return c.jsxs("div",{className:Wo.panelContainer,"data-testid":"chat-page",children:[c.jsx(Ph,{events:x,eventsDropped:l,emptyState:c.jsx(GO,{hasLocalEnvironment:!!S})}),S&&C&&c.jsx(ml,{mode:"send",sessionId:v.id,environmentId:v.environmentId,showStop:!0,onSessionKill:()=>p(v.id)}),S&&!C&&c.jsx(ml,{mode:"start",taskId:Fo,environmentId:S.id})]})}function $O(n,a){const i=[];let l=n;const r=new Set;for(;l&&a.has(l)&&!r.has(l);){r.add(l);const f=a.get(l);i.unshift(f),l=f.parentTaskId||void 0}return i}const zi={label:"Home",url:yl};function FO(n){return n?[zi,{label:"Settings",url:Jo},{label:n,url:void 0}]:[zi,{label:"Settings",url:void 0}]}function qO(){return[zi,{label:"Environments",url:void 0}]}function YO(){return[zi,{label:"New Chat",url:void 0}]}function KO(n){return[zi,{label:`Session ${n.slice(0,8)}`,url:void 0}]}function ZO(n,a,i){const l=$O(n,i),r=i.get(n),f=r==null?void 0:r.workspaceId,d=f?a.find(g=>g.id===f):void 0,p=[zi];d&&p.push({label:d.name,url:Ri(d.id)});for(let g=0;g<l.length-1;g++)p.push({label:l[g].title,url:va(l[g].id)});const m=l[l.length-1];return p.push({label:(m==null?void 0:m.title)??n,url:void 0}),p}function XO(){const n=YO(),[a]=db(),i=a.get("env")??"";return c.jsxs("div",{className:I.panelContainer,children:[c.jsx(Yi,{segments:n}),c.jsx("div",{className:I.emptyState,children:"Enter a prompt below to start a new session"}),c.jsx(ml,{mode:"spawn",environmentId:i,showPersonaSelect:!0})]})}function QO({sessionId:n,session:a,isActive:i,onKill:l}){return c.jsxs("div",{className:I.header,children:[c.jsxs("span",{children:["Session: ",n.slice(0,8),a&&` | ${a.runtime} | ${a.status}`,a!=null&&a.inputTokens||a!=null&&a.outputTokens||a!=null&&a.costUsd?` | ${h_((a.inputTokens??0)+(a.outputTokens??0))} tokens · ${Li(a.costUsd??0)}`:""]}),c.jsxs("span",{className:I.headerInfo,children:[a&&c.jsx("span",{children:a.prompt.length>60?a.prompt.slice(0,60)+"...":a.prompt}),i&&c.jsx("button",{onClick:()=>l(n),title:"Stop session",className:I.killButton,children:"×"})]})]})}function WO({session:n}){const a=n&&["completed","failed","interrupted","suspended"].includes(n.status),i=a?`Session ${n.status} with no events recorded.`:"Waiting for events...";return c.jsx("div",{className:a?I.errorMessage:I.waitingMessage,children:i})}function JO(){const{sessionId:n}=Hi(),{events:a,eventsDropped:i,sessions:l,kill:r,loadSessionEvents:f}=Je(),d=b.useRef(void 0),p=KO(n),m=l.find(v=>v.id===n)??void 0,g=b.useMemo(()=>{const v=n?a.filter(x=>x.sessionId===n):[];return Fh($h(v))},[a,n]);if(b.useEffect(()=>{n&&n!==d.current&&(d.current=n,f(n))},[n,f]),!n)return c.jsx("div",{className:I.emptyState,children:"No session selected"});const y=(m==null?void 0:m.status)==="running"||(m==null?void 0:m.status)==="idle";return c.jsxs("div",{className:I.panelContainer,children:[c.jsx(Yi,{segments:p}),c.jsx(QO,{sessionId:n,session:m,isActive:y,onKill:r}),c.jsx(Ph,{events:g,eventsDropped:i,emptyState:c.jsx(WO,{session:m})}),y&&c.jsx(ml,{mode:"send",sessionId:n,environmentId:m.environmentId,showStop:!0,onSessionKill:()=>r(n)})]})}const V0=220,H0=70,eB=40,tB=60,nB="hierarchy",aB="dependency";function sB(n){return b.useMemo(()=>{if(n.length===0)return{nodes:[],edges:[]};const a=new Pv.graphlib.Graph({multigraph:!0});a.setDefaultEdgeLabel(()=>({})),a.setGraph({rankdir:"TB",nodesep:eB,ranksep:tB});const i=new Map(n.map(d=>[d.id,d])),l=new Map;for(const d of n)if(d.parentTaskId&&i.has(d.parentTaskId)){const p=l.get(d.parentTaskId)||[];p.push(d),l.set(d.parentTaskId,p)}for(const d of n)a.setNode(d.id,{width:V0,height:H0});const r=[];for(const d of n){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:nB},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:aB},style:{stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeDasharray:"6 3"},animated:!1})}}return Pv.layout(a),{nodes:n.map(d=>{const p=a.node(d.id),m=l.get(d.id)||[];return{id:d.id,type:"task",position:{x:p.x-V0/2,y:p.y-H0/2},data:{task:d,childCount:m.length,doneChildCount:m.filter(g=>g.status==="complete").length,hasDependencies:d.dependsOn.length>0}}}),edges:r}},[n])}const iB="_dagContainer_js4w6_1",oB="_taskNode_js4w6_26",lB="_taskNodeBorder_js4w6_54",rB="_taskNodeContent_js4w6_60",cB="_taskNodeHeader_js4w6_70",uB="_taskNodeIcon_js4w6_77",dB="_taskNodeTitle_js4w6_82",fB="_taskNodeBadges_js4w6_90",hB="_childBadge_js4w6_95",pB="_depBadge_js4w6_107",mB="_handle_js4w6_119",gB="_emptyCta_js4w6_126",vB="_ctaDescription_js4w6_137",yB="_ctaButton_js4w6_144",Gt={dagContainer:iB,taskNode:oB,taskNodeBorder:lB,taskNodeContent:rB,taskNodeHeader:cB,taskNodeIcon:uB,taskNodeTitle:dB,taskNodeBadges:fB,childBadge:hB,depBadge:pB,handle:mB,emptyCta:gB,ctaDescription:vB,ctaButton:yB};function bB({data:n}){const{task:a,childCount:i,doneChildCount:l,hasDependencies:r}=n,f=es(a.status);return c.jsxs("div",{className:Gt.taskNode,"data-task-id":a.id,"data-task-title":a.title,children:[c.jsx($v,{type:"target",position:Fv.Top,className:Gt.handle}),c.jsx("div",{className:Gt.taskNodeBorder,style:{backgroundColor:f.color}}),c.jsxs("div",{className:Gt.taskNodeContent,children:[c.jsxs("div",{className:Gt.taskNodeHeader,children:[c.jsx("span",{className:Gt.taskNodeIcon,style:{color:f.color},children:f.icon}),c.jsx("span",{className:Gt.taskNodeTitle,children:a.title})]}),c.jsxs("div",{className:Gt.taskNodeBadges,children:[i>0&&c.jsxs("span",{className:Gt.childBadge,children:[l,"/",i]}),r&&c.jsx("span",{className:Gt.depBadge,children:"dep"})]})]}),c.jsx($v,{type:"source",position:Fv.Bottom,className:Gt.handle})]})}const xB=a2,_B={task:bB};function SB({workspaceId:n}){const{tasks:a}=Je(),i=Ut(),{resolvedThemeId:l}=xb(),r=b.useMemo(()=>a.filter(y=>y.workspaceId===n),[a,n]),{nodes:f,edges:d}=sB(r),p=b.useMemo(()=>{const y=getComputedStyle(document.documentElement),v={};for(const[x,S]of Object.entries(xB))v[x]=y.getPropertyValue(S).trim()||"#6b7a8d";return v},[l]),m=b.useCallback((y,v)=>{i(va(v.id,void 0,n))},[i,n]),g=b.useCallback(y=>{const v=y.data;return p[v.task.status]||p.pending},[p]);return r.length===0?c.jsxs("div",{className:Gt.emptyCta,children:[c.jsx("button",{className:Gt.ctaButton,onClick:()=>i(Gi(n)),children:"Create Task"}),c.jsx("div",{className:Gt.ctaDescription,children:"Create tasks to see the dependency graph"})]}):c.jsx("div",{className:Gt.dagContainer,children:c.jsxs(US,{nodes:f,edges:d,nodeTypes:_B,onNodeClick:m,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,children:[c.jsx(VS,{variant:HS.Dots,gap:24,size:1,color:"var(--text-disabled)"}),c.jsx(GS,{showInteractive:!1}),c.jsx(PS,{nodeColor:g,maskColor:"var(--bg-overlay)",style:{background:"var(--bg-inset)"}})]})})}function TB({tasks:n,taskStatusById:a,sessionStatusByTaskId:i}){const l=new Map;for(const f of n)if(f.parentTaskId){const d=l.get(f.parentTaskId);d?d.push(f):l.set(f.parentTaskId,[f])}const r=new Map(M0.map(f=>[f,[]]));for(const f of n){const d=Hh(f.status),p=f.dependsOn.length>0&&f.dependsOn.some(C=>a.get(C)!=="complete"),m=l.get(f.id)??[],g=m.length,y=m.filter(C=>C.status==="complete").length;let v;if(d==="paused"&&i){const C=i.get(f.id);C==="idle"?v="Needs input":C==="completed"&&(v="Ready to complete")}const x={task:f,isBlocked:p,childCount:g,doneChildCount:y,pausedSubBadge:v},S=r.get(d);S?S.push(x):r.get("not_started").push(x)}for(const f of r.values())f.sort((d,p)=>d.task.sortOrder-p.task.sortOrder);return M0.map(f=>{const d=es(f);return{status:f,label:d.label,style:d,tasks:r.get(f)??[]}})}const CB="_boardContainer_1c4y1_1",kB="_column_1c4y1_17",EB="_columnHeader_1c4y1_34",NB="_columnIcon_1c4y1_47",AB="_columnLabel_1c4y1_52",wB="_columnCount_1c4y1_57",jB="_cardList_1c4y1_67",DB="_emptyPlaceholder_1c4y1_76",MB="_card_1c4y1_67",RB="_cardHeader_1c4y1_107",OB="_cardStatusIcon_1c4y1_113",BB="_cardTitle_1c4y1_119",IB="_cardBadges_1c4y1_127",LB="_badge_1c4y1_134",zB="_blockedBadge_1c4y1_146",UB="_childBadge_1c4y1_151",VB="_depBadge_1c4y1_155",HB="_parentBadge_1c4y1_159",GB="_pausedSubBadge_1c4y1_166",PB="_personaBadge_1c4y1_170",$B="_envBadge_1c4y1_174",FB="_emptyCta_1c4y1_178",qB="_ctaButton_1c4y1_188",YB="_ctaDescription_1c4y1_204",Ge={boardContainer:CB,column:kB,columnHeader:EB,columnIcon:NB,columnLabel:AB,columnCount:wB,cardList:jB,emptyPlaceholder:DB,card:MB,cardHeader:RB,cardStatusIcon:OB,cardTitle:BB,cardBadges:IB,badge:LB,blockedBadge:zB,childBadge:UB,depBadge:VB,parentBadge:HB,pausedSubBadge:GB,personaBadge:PB,envBadge:$B,emptyCta:FB,ctaButton:qB,ctaDescription:YB};function KB({workspaceId:n}){const{tasks:a,sessions:i,personas:l,environments:r}=Je(),f=Ut(),d=b.useMemo(()=>a.filter(v=>v.workspaceId===n),[a,n]),p=b.useMemo(()=>new Map(a.map(v=>[v.id,v.status])),[a]),m=b.useMemo(()=>new Map(d.map(v=>[v.id,v])),[d]),g=b.useMemo(()=>{const v=new Map(i.map(E=>[E.id,E])),x=new Map(l.map(E=>[E.id,E])),S=new Map(r.map(E=>[E.id,E])),C=new Map,k=new Map,N=new Map;for(const E of d)if(E.latestSessionId){const w=v.get(E.latestSessionId);if(w){if(C.set(E.id,w.status),w.personaId){const D=x.get(w.personaId);D&&k.set(E.id,D.name)}if(w.environmentId){const D=S.get(w.environmentId);D&&N.set(E.id,D.displayName)}}}return{sessionStatusByTaskId:C,personaNameByTaskId:k,environmentNameByTaskId:N}},[d,i,l,r]),y=b.useMemo(()=>TB({tasks:d,taskStatusById:p,sessionStatusByTaskId:g.sessionStatusByTaskId}),[d,p,g]);return d.length===0?c.jsxs("div",{className:Ge.emptyCta,"data-testid":"board-empty-cta",children:[c.jsx("button",{className:Ge.ctaButton,onClick:()=>f(Gi(n)),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(v=>c.jsxs("section",{className:Ge.column,"data-testid":`board-column-${v.status}`,"aria-label":`${v.label}, ${v.tasks.length} ${v.tasks.length===1?"task":"tasks"}`,children:[c.jsxs("div",{className:Ge.columnHeader,children:[c.jsx("span",{className:Ge.columnIcon,style:{color:v.style.color},children:v.style.icon}),c.jsx("span",{className:Ge.columnLabel,children:v.label}),c.jsx("span",{className:Ge.columnCount,"data-testid":`board-count-${v.status}`,children:v.tasks.length})]}),c.jsx("div",{className:Ge.cardList,children:v.tasks.length===0?c.jsx("div",{className:Ge.emptyPlaceholder,children:"No tasks"}):c.jsx(qn,{mode:"popLayout",children:v.tasks.map(x=>c.jsx(St.div,{layout:!0,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},children:c.jsx(ZB,{boardTask:x,tasksById:m,personaName:g.personaNameByTaskId.get(x.task.id),envName:g.environmentNameByTaskId.get(x.task.id),onClick:()=>f(va(x.task.id,void 0,n))})},x.task.id))})})]},v.status))})}function ZB({boardTask:n,tasksById:a,personaName:i,envName:l,onClick:r}){const{task:f,isBlocked:d,childCount:p,doneChildCount:m,pausedSubBadge:g}=n,y=es(f.status),v=f.parentTaskId?a.get(f.parentTaskId):void 0;return c.jsxs("div",{className:Ge.card,tabIndex:0,role:"button","data-testid":`board-card-${f.id}`,onClick:r,onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),r())},children:[c.jsxs("div",{className:Ge.cardHeader,children:[c.jsx("span",{className:Ge.cardStatusIcon,style:{color:y.color},children:y.icon}),c.jsx("span",{className:Ge.cardTitle,children:f.title})]}),c.jsxs("div",{className:Ge.cardBadges,children:[v&&c.jsx("span",{className:`${Ge.badge} ${Ge.parentBadge}`,title:v.title,children:v.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"}),f.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}),l&&c.jsx("span",{className:`${Ge.badge} ${Ge.envBadge}`,children:l})]})]})}function qh(n){const{value:a,onSave:i,validate:l,fieldId:r,activeFieldId:f,onActivate:d,enterToSave:p=!0,trimOnSave:m=!0}=n,[g,y]=b.useState(""),[v,x]=b.useState(""),S=b.useRef(!1),C=f===r,k=b.useCallback(F=>{y(F),x("")},[]),N=b.useCallback(()=>{x("")},[]),E=b.useCallback(()=>{S.current=!1,d==null||d(null),y(""),x("")},[d]),w=b.useCallback(()=>{const F=m?g.trim():g;if(l){const Z=l(g);if(Z){x(Z);return}}const O=m?a.trim():a;if(F===O){E();return}i(F),E()},[g,a,m,l,i,E]),D=b.useCallback(()=>{S.current=!0,d==null||d(r),y(a),x("")},[r,a,d]),A=b.useCallback(F=>{if(S.current){S.current=!1;return}F.relatedTarget instanceof HTMLElement&&F.relatedTarget.dataset.editAction===r||w()},[r,w]),U=b.useCallback(F=>{F.key==="Escape"?E():F.key==="Enter"&&p&&w()},[E,p,w]),Y=(()=>{if(!C)return!1;const F=m?a.trim():a;return(m?g.trim():g)!==F})();return b.useEffect(()=>{!C&&(g!==""||v!=="")&&(y(""),x(""))},[C,g,v]),{isEditing:C,draft:g,error:v,isDirty:Y,startEdit:D,cancelEdit:E,save:w,setDraft:k,clearError:N,handleBlur:A,handleKeyDown:U,ignoreInitialBlurRef:S}}const XB="_editFieldWrapper_yuzty_1",QB="_editInput_yuzty_10",WB="_editTextarea_yuzty_42",JB="_editSelect_yuzty_78",e6="_editError_yuzty_111",t6="_editInputInvalid_yuzty_118",n6="_editHint_yuzty_123",a6="_unsavedDot_yuzty_132",s6="_metaValueClickable_yuzty_140",i6="_editButton_yuzty_159",o6="_metaPlaceholder_yuzty_175",l6="_worktreeToggle_yuzty_180",Ue={editFieldWrapper:XB,editInput:QB,editTextarea:WB,editSelect:JB,editError:e6,editInputInvalid:t6,editHint:n6,unsavedDot:a6,metaValueClickable:s6,editButton:i6,metaPlaceholder:o6,worktreeToggle:l6};function cn(n){const{value:a,onSave:i,validate:l,mode:r="edit",fieldId:f="text",activeFieldId:d,onActivate:p,onChange:m,renderDisplay:g,placeholder:y,maxLength:v,ariaLabel:x,"data-testid":S}=n,C=b.useRef(null),k=qh({value:a,onSave:i,validate:l,fieldId:f,activeFieldId:d,onActivate:p,enterToSave:!0,trimOnSave:!0});if(b.useEffect(()=>{if(k.isEditing){const E=window.setTimeout(()=>{var w;(w=C.current)==null||w.focus()},0);return()=>window.clearTimeout(E)}},[k.isEditing]),r==="create"){const E=D=>{m==null||m(D.target.value)},w=l==null?void 0:l(a);return c.jsxs("div",{className:Ue.editFieldWrapper,children:[c.jsx("input",{className:`${Ue.editInput} ${w?Ue.editInputInvalid:""}`,value:a,onChange:E,maxLength:v,placeholder:y,"aria-label":x,"data-testid":S?`${S}-input`:void 0}),w&&c.jsx("span",{className:Ue.editError,"data-testid":"edit-error",children:w})]})}if(k.isEditing)return c.jsxs("div",{className:Ue.editFieldWrapper,children:[c.jsx("input",{ref:C,className:`${Ue.editInput} ${k.error?Ue.editInputInvalid:""}`,value:k.draft,onChange:E=>k.setDraft(E.target.value),onBlur:k.handleBlur,onKeyDown:k.handleKeyDown,maxLength:v,placeholder:y,"aria-label":x,"data-testid":S?`${S}-input`:void 0}),k.isDirty&&c.jsx("span",{className:Ue.unsavedDot,title:"Unsaved changes"}),k.error&&c.jsx("span",{className:Ue.editError,"data-testid":"edit-error",children:k.error}),c.jsx("span",{className:Ue.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:Ue.metaValueClickable,onClick:()=>k.startEdit(),onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),k.startEdit())},title:"Click to edit","aria-label":x,"data-testid":S?`${S}-button`:void 0,children:[N!==void 0?N:a?c.jsx("span",{children:a}):c.jsx("span",{className:Ue.metaPlaceholder,children:y||"None"}),c.jsx("span",{className:Ue.editButton,"aria-hidden":"true",children:"✏️"})]})}function r6(n){const{value:a,onSave:i,validate:l,mode:r="edit",fieldId:f="textarea",activeFieldId:d,onActivate:p,onChange:m,renderDisplay:g,placeholder:y,ariaLabel:v,"data-testid":x}=n,S=b.useRef(null),C=qh({value:a,onSave:i,validate:l,fieldId:f,activeFieldId:d,onActivate:p,enterToSave:!1,trimOnSave:!1});if(b.useEffect(()=>{if(C.isEditing){const N=window.setTimeout(()=>{var E;(E=S.current)==null||E.focus()},0);return()=>window.clearTimeout(N)}},[C.isEditing]),r==="create"){const N=w=>{m==null||m(w.target.value)},E=l==null?void 0:l(a);return c.jsxs("div",{className:Ue.editFieldWrapper,children:[c.jsx("textarea",{className:`${Ue.editTextarea} ${E?Ue.editInputInvalid:""}`,value:a,onChange:N,placeholder:y,"aria-label":v,"data-testid":x?`${x}-input`:void 0}),E&&c.jsx("span",{className:Ue.editError,"data-testid":"edit-error",children:E})]})}if(C.isEditing)return c.jsxs("div",{className:Ue.editFieldWrapper,children:[c.jsx("textarea",{ref:S,className:`${Ue.editTextarea} ${C.error?Ue.editInputInvalid:""}`,value:C.draft,onChange:N=>C.setDraft(N.target.value),onBlur:C.handleBlur,onKeyDown:C.handleKeyDown,title:v,"aria-label":v,"data-testid":x?`${x}-input`:void 0}),C.isDirty&&c.jsx("span",{className:Ue.unsavedDot,title:"Unsaved changes"}),C.error&&c.jsx("span",{className:Ue.editError,"data-testid":"edit-error",children:C.error}),c.jsx("span",{className:Ue.editHint,children:"Tab to save · Esc to cancel"})]});const k=g==null?void 0:g(a);return c.jsxs("span",{role:"button",tabIndex:0,className:Ue.metaValueClickable,onClick:()=>C.startEdit(),onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),C.startEdit())},title:"Click to edit","aria-label":v,"data-testid":x?`${x}-button`:void 0,children:[k!==void 0?k:a?c.jsx("span",{children:a}):c.jsx("span",{className:Ue.metaPlaceholder,children:y||"None"}),c.jsx("span",{className:Ue.editButton,"aria-hidden":"true",children:"✏️"})]})}function v_(n){var D;const{value:a,onSave:i,mode:l="edit",options:r,fieldId:f="select",activeFieldId:d,onActivate:p,onChange:m,renderDisplay:g,placeholder:y,ariaLabel:v,"data-testid":x}=n,S=b.useRef(null),C=qh({value:a,onSave:i,fieldId:f,activeFieldId:d,onActivate:p,enterToSave:!1,trimOnSave:!1});b.useEffect(()=>{if(C.isEditing){const A=window.setTimeout(()=>{var U;(U=S.current)==null||U.focus()},0);return()=>window.clearTimeout(A)}},[C.isEditing]);const k=b.useCallback(A=>{const U=A.target.value;C.ignoreInitialBlurRef.current=!1,U!==a&&i(U),C.cancelEdit()},[a,i,C]),N=b.useCallback(A=>{if(C.ignoreInitialBlurRef.current){C.ignoreInitialBlurRef.current=!1;return}A.relatedTarget instanceof HTMLElement&&A.relatedTarget.dataset.editAction===f||C.cancelEdit()},[f,C]);if(l==="create")return c.jsx("select",{className:Ue.editSelect,value:a,onChange:A=>m==null?void 0:m(A.target.value),"aria-label":v,"data-testid":x?`${x}-select`:void 0,children:r.map(A=>c.jsx("option",{value:A.value,children:A.label},A.value))});if(C.isEditing)return c.jsx("select",{ref:S,className:Ue.editSelect,value:C.draft,onChange:k,onBlur:N,title:v,"aria-label":v,"data-testid":x?`${x}-select`:void 0,children:r.map(A=>c.jsx("option",{value:A.value,children:A.label},A.value))});const E=g==null?void 0:g(a),w=(D=r.find(A=>A.value===a))==null?void 0:D.label;return c.jsxs("button",{type:"button",className:Ue.metaValueClickable,onClick:()=>C.startEdit(),title:"Click to change","aria-label":v,"data-testid":x?`${x}-button`:void 0,children:[E!==void 0?E:w?c.jsx("span",{children:w}):c.jsx("span",{className:Ue.metaPlaceholder,children:y||"None"}),c.jsx("span",{className:Ue.editButton,"aria-hidden":"true",children:"✏️"})]})}function c6(n){const{checked:a,onChange:i,label:l,ariaLabel:r,"data-testid":f}=n;return c.jsxs("label",{className:Ue.worktreeToggle,"data-testid":f,children:[c.jsx("input",{type:"checkbox",checked:a,onChange:d=>i(d.target.checked),"aria-label":r}),c.jsx("span",{children:l})]})}const u6="_envRow_1e1r5_1",d6="_envDot_1e1r5_7",f6="_envDotGreen_1e1r5_14",h6="_envDotYellow_1e1r5_18",p6="_envDotRed_1e1r5_22",m6="_envDotGray_1e1r5_26",Mi={envRow:u6,envDot:d6,envDotGreen:f6,envDotYellow:h6,envDotRed:p6,envDotGray:m6};function g6(n){const a=n.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?Mi.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?Mi.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?Mi.envDotRed:Mi.envDotGray}function v6(n){const{value:a,onSave:i,environments:l,allowNone:r=!1,fieldId:f="environment",activeFieldId:d,onActivate:p,placeholder:m="No environment",ariaLabel:g="Environment","data-testid":y}=n,v=l.find(C=>C.id===a),x=[...r?[{value:"",label:"None"}]:[],...l.map(C=>({value:C.id,label:C.displayName}))],S=()=>{if(v)return c.jsxs("span",{className:Mi.envRow,children:[c.jsx("span",{className:`${Mi.envDot} ${g6(v.status)}`}),v.displayName]})};return c.jsx(v_,{value:a,onSave:i,options:x,fieldId:f,activeFieldId:d,onActivate:p,renderDisplay:S,placeholder:m,ariaLabel:g,"data-testid":y})}function G0(n){if(!n)return"";const a=new Date(n);if(isNaN(a.getTime()))return"";const l=Date.now()-a.getTime();if(l<0)return"just now";const r=Math.floor(l/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const f=Math.floor(r/60);if(f<24)return`${f}h ago`;const d=Math.floor(f/24);return d<30?`${d}d ago`:a.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}const ff=100;function y6(){const{workspaceId:n}=Hi(),a=Ut(),{tasks:i,environments:l,workspaces:r,personas:f,sessions:d,archiveWorkspace:p,updateWorkspace:m,usageCache:g,loadUsage:y}=Je(),[v,x]=b.useState("tasks"),[S,C]=b.useState(!1),[k,N]=b.useState(null),[E,w]=b.useState(!1),D=b.useRef(void 0),A=r.find(R=>R.id===n),U=[{label:"Home",url:yl},{label:(A==null?void 0:A.name)??"Workspace",url:void 0}];b.useEffect(()=>{const R=D.current;D.current=n,!(R===void 0||R===n)&&k!==null&&N(null)},[n,k]);const Y=d.reduce((R,ae)=>R+(ae.costUsd??0),0);b.useEffect(()=>{n&&y("workspace",n)},[n,y,Y]);const F=n?g[`workspace:${n}`]:void 0,O=i.filter(R=>R.workspaceId===n),Z=O.filter(R=>R.status==="complete").length,ee=O.length,ie=ee>0?Math.round(Z/ee*100):0;return c.jsxs("div",{className:I.panelContainer,children:[c.jsx(Yi,{segments:U}),c.jsxs("div",{className:I.workspaceHeader,children:[c.jsx("span",{className:I.workspaceName,"data-testid":"workspace-name",children:c.jsx(cn,{value:(A==null?void 0:A.name)||"",onSave:R=>{A&&m(A.id,{name:R})},validate:R=>{const ae=R.trim();if(!ae)return"Name is required";if(ae.length>ff)return`Max ${ff} characters`},maxLength:ff,fieldId:"name",activeFieldId:k,onActivate:N,ariaLabel:"Workspace name",renderDisplay:R=>R||n||void 0,"data-testid":"edit-name"})}),c.jsx("button",{className:I.archiveButton,onClick:()=>C(!0),title:"Archive workspace","data-testid":"archive-workspace-button",children:"Archive"})]}),c.jsxs("button",{className:I.metaToggle,onClick:()=>w(!E),"aria-expanded":!E,"aria-controls":"workspace-meta-panel","data-testid":"meta-toggle",children:[c.jsx("span",{className:`${I.metaToggleArrow} ${E?"":I.metaToggleArrowOpen}`,children:"▶"}),"Details"]}),!E&&c.jsxs("div",{className:I.workspaceMeta,"data-testid":"workspace-meta",id:"workspace-meta-panel",children:[c.jsxs("div",{className:I.metaRow,children:[c.jsx("span",{className:I.metaLabel,children:"Description"}),c.jsx("div",{className:I.metaValue,children:c.jsx(r6,{value:(A==null?void 0:A.description)||"",onSave:R=>{A&&m(A.id,{description:R})},fieldId:"description",activeFieldId:k,onActivate:N,renderDisplay:R=>R?c.jsx("span",{className:I.overviewMarkdown,children:c.jsx(Kf,{remarkPlugins:[Zf],children:R})}):void 0,placeholder:"No description",ariaLabel:"Workspace description","data-testid":"edit-description"})})]}),c.jsxs("div",{className:I.metaRow,children:[c.jsx("span",{className:I.metaLabel,children:"Repository"}),c.jsx("div",{className:I.metaValue,children:c.jsx(cn,{value:(A==null?void 0:A.repoUrl)||"",onSave:R=>{A&&m(A.id,{repoUrl:R})},validate:R=>{const ae=R.trim();if(ae&&!/^https?:\/\/.+/.test(ae))return"Must be a valid http(s) URL"},fieldId:"repoUrl",activeFieldId:k,onActivate:N,renderDisplay:R=>R&&/^https?:\/\//i.test(R)?c.jsx("a",{className:I.repoLink,href:R,target:"_blank",rel:"noopener noreferrer",onClick:ae=>ae.stopPropagation(),children:R}):R?c.jsx("span",{children:R}):void 0,placeholder:"No repository",ariaLabel:"Workspace repository URL","data-testid":"edit-repo"})})]}),c.jsxs("div",{className:I.metaRow,children:[c.jsx("span",{className:I.metaLabel,children:"Environment"}),c.jsx("div",{className:I.metaValue,children:c.jsx(v6,{value:(A==null?void 0:A.environmentId)||"",onSave:R=>{A&&R&&m(A.id,{environmentId:R})},environments:l,fieldId:"environmentId",activeFieldId:k,onActivate:N,placeholder:"Select environment",ariaLabel:"Workspace environment","data-testid":"edit-env"})})]}),c.jsxs("div",{className:I.metaRow,children:[c.jsx("span",{className:I.metaLabel,children:"Persona"}),c.jsx("div",{className:I.metaValue,children:c.jsx(v_,{value:(A==null?void 0:A.defaultPersonaId)||"",onSave:R=>{A&&m(A.id,{defaultPersonaId:R})},options:[{value:"",label:"(Inherit)"},...f.map(R=>({value:R.id,label:R.name}))],fieldId:"defaultPersonaId",activeFieldId:k,onActivate:N,renderDisplay:R=>{const ae=f.find(X=>X.id===R);if(ae)return c.jsx("span",{children:ae.name})},placeholder:(A==null?void 0:A.defaultPersonaId)||"(Inherit)",ariaLabel:"Workspace default persona","data-testid":"edit-persona"})})]}),c.jsxs("div",{className:I.metaRow,children:[c.jsx("span",{className:I.metaLabel,children:"Worktrees"}),c.jsx("div",{className:I.metaValue,children:c.jsx(c6,{checked:(A==null?void 0:A.useWorktrees)??!0,onChange:R=>{A&&m(A.id,{useWorktrees:R})},label:"Enable worktree isolation","data-testid":"worktree-toggle"})})]}),c.jsxs("div",{className:I.metaRow,children:[c.jsx("span",{className:I.metaLabel,children:"Working Dir"}),c.jsx("div",{className:I.metaValue,children:c.jsx(cn,{value:(A==null?void 0:A.worktreeBasePath)||"",onSave:R=>{A&&m(A.id,{worktreeBasePath:R})},fieldId:"worktreeBasePath",activeFieldId:k,onActivate:N,placeholder:"Default (server default)",ariaLabel:"Working directory","data-testid":"edit-worktree-base-path"})})]}),A&&c.jsxs("div",{className:I.metaTimestamps,children:[c.jsxs("span",{className:I.metaTimestamp,children:["Created ",G0(A.createdAt)]}),A.updatedAt&&A.updatedAt!==A.createdAt&&c.jsxs("span",{className:I.metaTimestamp,children:["· Updated ",G0(A.updatedAt)]})]})]}),ee>0&&c.jsxs("div",{className:I.progressBarContainer,"data-testid":"progress-bar",children:[c.jsx("div",{className:I.progressBar,children:c.jsx("div",{className:I.progressFill,style:{width:`${ie}%`}})}),c.jsxs("span",{className:I.progressLabel,children:[Z,"/",ee]})]}),F&&F.costUsd>0&&c.jsx("div",{className:I.progressBarContainer,children:c.jsxs("span",{className:I.progressLabel,children:["Usage: ",Li(F.costUsd)," (",F.sessionCount," session",F.sessionCount!==1?"s":"",")"]})}),c.jsxs("div",{className:I.tabBar,role:"tablist","aria-label":"Workspace view",children:[c.jsx("button",{role:"tab","aria-selected":v==="graph",className:`${I.tab} ${v==="graph"?I.active:""}`,onClick:()=>x("graph"),children:"Graph"}),c.jsx("button",{role:"tab","aria-selected":v==="board",className:`${I.tab} ${v==="board"?I.active:""}`,onClick:()=>x("board"),"data-testid":"board-tab",children:"Board"}),c.jsx("button",{role:"tab","aria-selected":v==="tasks",className:`${I.tab} ${v==="tasks"?I.active:""}`,onClick:()=>x("tasks"),children:"Tasks"})]}),v==="tasks"&&ee>0&&c.jsxs("div",{className:I.workspaceSummary,children:[c.jsx("span",{className:I.workspaceSummaryTitle,children:`${Z}/${ee} tasks complete`}),c.jsx("span",{className:I.workspaceSummarySubtitle,children:"Select a task or click + to create one"})]}),v==="tasks"&&ee===0&&c.jsxs("div",{className:I.emptyCta,children:[c.jsx("button",{className:I.ctaButton,onClick:()=>a(Gi(n)),children:"Create Task"}),c.jsx("div",{className:I.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}),v==="board"&&c.jsx(KB,{workspaceId:n}),v==="graph"&&c.jsx(SB,{workspaceId:n}),c.jsx(Nc,{isOpen:S,title:"Archive Workspace?",description:"This will hide the workspace from the sidebar. Tasks will not be deleted.",confirmLabel:"Archive",onConfirm:()=>{A&&(p(A.id),a("/",{replace:!0})),C(!1)},onCancel:()=>C(!1)})]})}const b6="_container_cddyd_1",x6="_header_cddyd_8",_6="_headerTitle_cddyd_35",S6="_badge_cddyd_44",T6="_headerActions_cddyd_54",C6="_body_cddyd_61",k6="_formContent_cddyd_73",E6="_section_cddyd_85",N6="_label_cddyd_91",A6="_titleInput_cddyd_98",w6="_descriptionTextarea_cddyd_131",j6="_parentContext_cddyd_167",D6="_parentLabel_cddyd_175",M6="_parentName_cddyd_182",R6="_personaSelect_cddyd_186",O6="_depList_cddyd_220",B6="_depItem_cddyd_226",I6="_depItemSelected_cddyd_248",L6="_noDeps_cddyd_252",z6="_btnPrimary_cddyd_258",U6="_btnGhost_cddyd_289",ze={container:b6,header:x6,headerTitle:_6,badge:S6,headerActions:T6,body:C6,formContent:k6,section:E6,label:N6,titleInput:A6,descriptionTextarea:w6,parentContext:j6,parentLabel:D6,parentName:M6,personaSelect:R6,depList:O6,depItem:B6,depItemSelected:I6,noDeps:L6,btnPrimary:z6,btnGhost:U6};function y_({mode:n,taskId:a,workspaceId:i,parentTaskId:l}){const{tasks:r,workspaces:f,personas:d,createTask:p,updateTask:m}=Je(),{showToast:g}=Pi(),y=Ut(),v=n==="edit",x=v&&a?r.find(se=>se.id===a):void 0,S=v?(x==null?void 0:x.workspaceId)??"":i??"",[C,k]=b.useState(S),N=S||C,E=!v&&!i,w=v?(x==null?void 0:x.parentTaskId)??"":l??"",D=w?r.find(se=>se.id===w):void 0,[A,U]=b.useState((x==null?void 0:x.title)??""),[Y,F]=b.useState((x==null?void 0:x.description)??""),[O,Z]=b.useState((x==null?void 0:x.dependsOn)??[]),[ee,ie]=b.useState((x==null?void 0:x.defaultPersonaId)??""),[R,ae]=b.useState((x==null?void 0:x.canDecompose)??!1),[X,te]=b.useState(!1),V=b.useRef(!1);b.useEffect(()=>{v&&x&&!V.current&&(V.current=!0,U(x.title),F(x.description),Z(x.dependsOn),ie(x.defaultPersonaId),ae(x.canDecompose))},[v,x]);const H=r.filter(se=>se.workspaceId===N&&(!v||se.id!==a)&&se.id!==w),z=A.trim().length>0&&(!v||x!==void 0)&&N.length>0,re=se=>{Z(Oe=>Oe.includes(se)?Oe.filter(ot=>ot!==se):[...Oe,se])},B=()=>{!z||X||v&&x===void 0||(v&&a?(m(a,A.trim(),Y,O,ee),g("Task updated","success"),y(va(a,void 0,N),{replace:!0})):(te(!0),p(N,A.trim(),Y,O.length>0?O:void 0,w||void 0,ee,R,()=>{g("Task created","success"),y(i?Ri(i):"/tasks",{replace:!0})},se=>{g(se,"error"),te(!1)})))},oe=()=>{y(v&&a?va(a,void 0,N):i?Ri(i):"/tasks")},fe=v?"edit task":w?"child task":"new task";return c.jsxs("div",{className:ze.container,children:[c.jsxs("div",{className:ze.header,children:[c.jsxs("div",{className:ze.headerTitle,children:[c.jsx("span",{className:ze.badge,children:fe}),D&&c.jsxs("span",{className:ze.parentContext,children:[c.jsx("span",{className:ze.parentLabel,children:"Child of"}),c.jsx("span",{className:ze.parentName,children:D.title})]})]}),c.jsxs("div",{className:ze.headerActions,children:[c.jsx("button",{onClick:B,disabled:!z||X,className:ze.btnPrimary,"data-testid":"task-edit-save",children:X?"Creating…":v?"Save Changes":"Create"}),c.jsx("button",{onClick:oe,className:ze.btnGhost,children:"Cancel"})]})]}),c.jsx("div",{className:ze.body,children:c.jsxs("div",{className:ze.formContent,children:[E&&c.jsxs("div",{className:ze.section,children:[c.jsx("label",{className:ze.label,htmlFor:"task-edit-workspace",children:"Workspace"}),c.jsxs("select",{id:"task-edit-workspace",value:C,onChange:se=>k(se.target.value),className:ze.personaSelect,"data-testid":"task-edit-workspace",children:[c.jsx("option",{value:"",children:"Select a workspace..."}),f.map(se=>c.jsx("option",{value:se.id,children:se.name},se.id))]})]}),c.jsxs("div",{className:ze.section,children:[c.jsx("label",{className:ze.label,htmlFor:"task-edit-title",children:"Title"}),c.jsx("input",{id:"task-edit-title",type:"text",value:A,onChange:se=>U(se.target.value),placeholder:"Task title...",autoFocus:!0,className:ze.titleInput,"data-testid":"task-edit-title",onKeyDown:se=>{se.key==="Enter"&&z&&B()}})]}),c.jsxs("div",{className:ze.section,children:[c.jsx("label",{className:ze.label,htmlFor:"task-edit-description",children:"Description"}),c.jsx("textarea",{id:"task-edit-description",value:Y,onChange:se=>F(se.target.value),placeholder:"Describe the task... (markdown supported)",className:ze.descriptionTextarea,"data-testid":"task-edit-description",rows:8})]}),c.jsxs("div",{className:ze.section,children:[c.jsx("label",{className:ze.label,htmlFor:"task-edit-persona",children:"Default Persona"}),c.jsxs("select",{id:"task-edit-persona",value:ee,onChange:se=>ie(se.target.value),className:ze.personaSelect,"data-testid":"task-edit-persona",children:[c.jsx("option",{value:"",children:"(Inherit)"}),d.map(se=>c.jsx("option",{value:se.id,children:se.name},se.id))]})]}),!v&&c.jsx("div",{className:ze.section,children:c.jsxs("label",{className:ze.depItem,"data-testid":"task-edit-can-decompose",children:[c.jsx("input",{type:"checkbox",checked:R,onChange:se=>ae(se.target.checked)}),"Can spawn subtasks"]})}),c.jsxs("div",{className:ze.section,children:[c.jsx("div",{className:ze.label,children:"Dependencies"}),H.length===0?c.jsx("div",{className:ze.noDeps,children:"No other tasks in this workspace"}):c.jsx("div",{className:ze.depList,children:H.map(se=>{const Oe=O.includes(se.id);return c.jsxs("label",{className:`${ze.depItem} ${Oe?ze.depItemSelected:""}`,"data-testid":`dep-option-${se.id}`,children:[c.jsx("input",{type:"checkbox",checked:Oe,onChange:()=>re(se.id)}),se.title,c.jsxs("span",{style:{opacity:.5,fontSize:"11px",marginLeft:"4px"},children:["(",se.status,")"]})]},se.id)})})]})]})})]})}function V6(){const[n]=db(),a=n.get("workspace")??"",i=n.get("parent")??void 0;return c.jsx(y_,{mode:"new",workspaceId:a,parentTaskId:i})}function P0(){const{taskId:n}=Hi();return c.jsx(y_,{mode:"edit",taskId:n})}const H6="_container_1pqxm_1",G6="_emptyState_1pqxm_8",P6="_card_1pqxm_14",$6="_cardHeader_1pqxm_34",F6="_categoryBadge_1pqxm_46",q6="_findingTitle_1pqxm_54",Y6="_findingDate_1pqxm_60",K6="_findingContent_1pqxm_72",Z6="_tags_1pqxm_78",X6="_tag_1pqxm_78",Un={container:H6,emptyState:G6,card:P6,cardHeader:$6,categoryBadge:F6,findingTitle:q6,findingDate:Y6,findingContent:K6,tags:Z6,tag:X6};function Q6(n){const a=new Date(n),i=new Date,l=i.getTime()-a.getTime(),r=Math.floor(l/1e3),f=Math.floor(r/60),d=Math.floor(f/60),p=Math.floor(d/24);if(r<60)return"just now";if(f<60)return`${f}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"}),y=a.getDate();return m?`${g} ${y}`:`${g} ${y} ${a.getFullYear()}`}const $0={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 W6({workspaceId:n}){const{findings:a}=Je(),i=a.filter(l=>l.workspaceId===n);return i.length===0?c.jsx("div",{className:Un.emptyState,children:"No findings yet. Agents will post discoveries here."}):c.jsx("div",{className:Un.container,children:i.map((l,r)=>{const f=$0[l.category]||$0.general;return c.jsxs(St.div,{className:Un.card,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:r*.05,duration:.2},children:[c.jsxs("div",{className:Un.cardHeader,children:[c.jsx("span",{className:Un.categoryBadge,style:{background:f.bg,color:f.text},children:l.category}),c.jsx("span",{className:Un.findingTitle,children:l.title}),c.jsx("span",{className:Un.findingDate,title:l.createdAt,children:Q6(l.createdAt)})]}),c.jsx("div",{className:Un.findingContent,children:l.content.length>300?l.content.slice(0,300)+"...":l.content}),l.tags.length>0&&c.jsx("div",{className:Un.tags,children:l.tags.map(d=>c.jsx("span",{className:Un.tag,style:{color:f.text,textShadow:`0 0 8px ${f.text}`},children:d},d))})]},l.id)})})}function Zr(n){if(!n)return"—";const a=new Date(n);return isNaN(a.getTime())?"—":a.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})}function hf(n,a){if(!n||!a)return;const i=new Date(a).getTime()-new Date(n).getTime();if(isNaN(i)||i<0)return;const l=Math.floor(i/6e4),r=Math.floor(i%6e4/1e3);if(l===0)return`${r}s`;const f=Math.floor(l/60),d=l%60;return f===0?`${l}m ${r}s`:`${f}h ${d}m`}function F0(n){const a=n.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?I.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?I.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?I.envDotRed:I.envDotGray}function J6({status:n}){const a=es(n),i=e2(n);return c.jsx("span",{className:`${I.statusBadge} ${I[i]??I.statusPending}`,children:a.label})}function e4({task:n,tasksById:a,environments:i,workspaces:l,taskSessions:r,selectedEnvId:f}){const{loadUsage:d,usageCache:p}=Je(),m=r.reduce((D,A)=>D+(A.costUsd??0),0);b.useEffect(()=>{d("task",n.id),n.childTaskIds.length>0&&d("task_tree",n.id)},[n.id,n.childTaskIds.length,d,m]);const g=`task:${n.id}`,y=g in p?p[g]:void 0,v=`task_tree:${n.id}`,x=n.childTaskIds.length>0&&v in p?p[v]:void 0,S=r.length>0?r[r.length-1]:void 0,C=(S==null?void 0:S.environmentId)??"",k=C?i.find(D=>D.id===C):void 0,N=l.find(D=>D.id===n.workspaceId),E=i.find(D=>D.id===f),w=n.branch&&(N!=null&&N.repoUrl)?`${N.repoUrl.replace(/\/$/,"")}/tree/${encodeURIComponent(n.branch)}`:void 0;return c.jsxs("div",{className:I.overviewDashboard,children:[c.jsxs("div",{className:I.overviewHero,children:[c.jsx(J6,{status:n.status}),n.branch&&c.jsx("span",{className:I.overviewBranchPill,children:w?c.jsxs("a",{href:w,target:"_blank",rel:"noreferrer noopener",className:I.branchLink,children:["🔗"," ",n.branch]}):c.jsxs("span",{children:["🔗"," ",n.branch]})})]}),typeof n.description=="string"&&n.description&&c.jsxs("div",{className:I.overviewSection,children:[c.jsx("div",{className:I.overviewLabel,children:"Description"}),c.jsx("div",{className:I.overviewMarkdown,children:c.jsx(Kf,{remarkPlugins:[Zf],children:n.description})})]}),c.jsxs("div",{className:I.overviewSection,children:[c.jsx("div",{className:I.overviewLabel,children:"Environment"}),C&&k?c.jsxs("div",{className:I.envRow,"data-testid":"task-overview-environment",children:[c.jsx("span",{className:`${I.envDot} ${F0(k.status)}`,title:k.status,"aria-label":`Status: ${k.status}`,role:"img"}),c.jsx("span",{className:I.overviewValue,children:k.displayName})]}):E?c.jsxs("div",{className:I.envRow,"data-testid":"task-overview-environment",children:[c.jsx("span",{className:`${I.envDot} ${F0(E.status)}`,title:E.status,"aria-label":`Status: ${E.status}`,role:"img"}),c.jsx("span",{className:I.overviewValue,children:E.displayName}),c.jsx("span",{className:I.overviewMuted,children:"(workspace default)"})]}):c.jsx("div",{className:I.overviewMuted,children:"Set in workspace settings"})]}),c.jsxs("div",{className:I.overviewSection,children:[c.jsx("div",{className:I.overviewLabel,children:"Dependencies"}),n.dependsOn.length===0?c.jsx("div",{className:I.overviewMuted,children:"None"}):c.jsx("div",{className:I.depList,children:n.dependsOn.map(D=>{const A=a.get(D),U=(A==null?void 0:A.status)==="complete";return c.jsxs("div",{className:`${I.depItem} ${U?I.depDone:I.depBlocked}`,children:[c.jsx("span",{children:U?"✓":"○"}),c.jsx("span",{children:(A==null?void 0:A.title)??D})]},D)})})]}),c.jsxs("div",{className:I.overviewSection,children:[c.jsx("div",{className:I.overviewLabel,children:"Timeline"}),c.jsxs("div",{className:I.timeline,children:[n.createdAt&&c.jsxs("div",{className:I.timelineRow,children:[c.jsx("span",{className:I.timelineKey,children:"Created"}),c.jsx("span",{className:I.timelineValue,children:Zr(n.createdAt)})]}),n.assignedAt&&(()=>{const D=hf(n.createdAt,n.assignedAt);return c.jsxs("div",{className:I.timelineRow,children:[c.jsx("span",{className:I.timelineKey,children:"Assigned"}),c.jsx("span",{className:I.timelineValue,children:Zr(n.assignedAt)}),D!==void 0&&c.jsx("span",{className:I.timelineDelta,children:D})]})})(),n.startedAt&&(()=>{const D=hf(n.assignedAt??n.createdAt,n.startedAt);return c.jsxs("div",{className:I.timelineRow,children:[c.jsx("span",{className:I.timelineKey,children:"Started"}),c.jsx("span",{className:I.timelineValue,children:Zr(n.startedAt)}),D!==void 0&&c.jsx("span",{className:I.timelineDelta,children:D})]})})(),n.completedAt&&(()=>{const D=hf(n.startedAt,n.completedAt);return c.jsxs("div",{className:I.timelineRow,children:[c.jsx("span",{className:I.timelineKey,children:"Completed"}),c.jsx("span",{className:I.timelineValue,children:Zr(n.completedAt)}),D!==void 0&&c.jsx("span",{className:I.timelineDelta,children:D})]})})(),!n.createdAt&&!n.assignedAt&&!n.startedAt&&!n.completedAt&&c.jsx("div",{className:I.overviewMuted,children:"No timing data"})]})]}),y&&y.costUsd>0&&c.jsxs("div",{className:I.overviewSection,children:[c.jsx("div",{className:I.overviewLabel,children:"Usage"}),c.jsxs("div",{className:I.timeline,children:[c.jsxs("div",{className:I.timelineRow,children:[c.jsx("span",{className:I.timelineKey,children:"Cost"}),c.jsx("span",{className:I.timelineValue,children:Li(y.costUsd)}),c.jsxs("span",{className:I.timelineDelta,children:[y.sessionCount," session",y.sessionCount!==1?"s":""]})]}),x&&x.costUsd>y.costUsd&&c.jsxs("div",{className:I.timelineRow,children:[c.jsx("span",{className:I.timelineKey,children:"Total (incl. subtasks)"}),c.jsx("span",{className:I.timelineValue,children:Li(x.costUsd)}),c.jsxs("span",{className:I.timelineDelta,children:[x.sessionCount," session",x.sessionCount!==1?"s":""]})]})]})]}),n.reviewNotes&&c.jsxs("div",{className:I.overviewSection,children:[c.jsx("div",{className:I.overviewLabel,children:"Review Notes"}),c.jsx("div",{className:I.reviewNotes,children:n.reviewNotes})]})]})}function t4({task:n,sessionId:a,isBlocked:i,onStart:l,onResume:r,onStop:f,onPause:d,onDelete:p,onEdit:m}){if(n.status==="not_started")return i?c.jsxs("div",{className:I.headerActions,children:[c.jsx("button",{onClick:m,className:I.btnGhost,children:"Edit"}),c.jsx("button",{onClick:p,className:I.btnDanger,children:"Delete"})]}):c.jsxs("div",{className:I.headerActions,children:[c.jsx("button",{onClick:l,className:I.btnPrimary,children:"Start"}),c.jsx("button",{onClick:m,className:I.btnGhost,children:"Edit"}),c.jsx("button",{onClick:p,className:I.btnDanger,children:"Delete"})]});if(n.status==="working")return c.jsxs("div",{className:I.headerActions,children:[c.jsx("button",{onClick:f,className:I.btnDanger,children:"Stop"}),c.jsx("button",{onClick:d,disabled:!a,className:I.btnGhost,children:"Pause"})]});if(n.status==="paused")return c.jsxs("div",{className:I.headerActions,children:[c.jsx("button",{onClick:f,className:I.btnPrimary,children:"Stop"}),c.jsx("button",{onClick:r,className:I.btnGhost,children:"Resume"}),c.jsx("button",{onClick:p,className:I.btnDanger,children:"Delete"})]});if(n.status==="complete")return c.jsx("div",{className:I.headerActions,children:c.jsx("button",{onClick:p,className:I.btnDanger,children:"Delete"})});if(n.status==="failed")return c.jsxs("div",{className:I.headerActions,children:[c.jsx("button",{onClick:l,className:I.btnPrimary,children:"Retry"}),c.jsx("button",{onClick:p,className:I.btnDanger,children:"Delete"})]})}function n4({taskSessions:n,selectedSessionId:a,onSelect:i}){if(!(n.length<2))return c.jsxs("div",{className:I.attemptSelector,"data-testid":"attempt-selector",children:[c.jsx("span",{className:I.attemptLabel,children:"Attempts:"}),n.map((l,r)=>{const f=l.id===a,d=l.status==="completed"?"✓":l.status==="failed"?"✗":l.status==="running"||l.status==="idle"?"●":"";return c.jsxs("button",{className:`${I.attemptButton} ${f?I.attemptActive:""}`,onClick:()=>i(l.id),title:`Attempt #${r+1} — ${l.status}`,"aria-label":`Attempt #${r+1}, ${l.status}`,"aria-pressed":f,"data-testid":`attempt-${r+1}`,children:["#",r+1,d&&c.jsx("span",{className:I.attemptStatus,children:d})]},l.id)})]})}function ki(){const{taskId:n,workspaceId:a}=Hi(),i=At(),l=Ut(),{events:r,eventsDropped:f,tasks:d,sessions:p,environments:m,loadSessionEvents:g,loadFindings:y,kill:v,startTask:x,stopTask:S,resumeTask:C,deleteTask:k,workspaces:N,taskSessions:E,loadTaskSessions:w}=Je(),D=b.useRef(void 0),A=b.useRef(void 0),U=b.useRef(void 0),Y=b.useRef(void 0),F=b.useRef(void 0),O=i.pathname.endsWith("/stream")?"stream":i.pathname.endsWith("/findings")?"findings":"overview",[Z,ee]=b.useState(O),[ie,R]=b.useState(!1),[ae,X]=b.useState(void 0),[te,V]=b.useState(""),H=b.useRef(O);O!==H.current&&(H.current=O,O!==Z&&ee(O));const z=d.find(Te=>Te.id===n),re=(z==null?void 0:z.workspaceId)||void 0,B=N.find(Te=>Te.id===re);b.useEffect(()=>{if(te===""){if(B!=null&&B.environmentId)V(B.environmentId);else if(m.length>0){const Te=m.find(ct=>ct.status==="connected");V((Te==null?void 0:Te.id)??m[0].id)}}},[te,B==null?void 0:B.environmentId,m]);const oe=z?E[z.id]??[]:[];let fe;ae&&oe.some(Te=>Te.id===ae)?fe=ae:fe=(z==null?void 0:z.latestSessionId)||void 0;const se=()=>{R(!0)},Oe=()=>{z&&(k(z.id),R(!1),l(z.workspaceId?Ri(z.workspaceId):"/",{replace:!0}))};if((z==null?void 0:z.id)!==A.current&&(A.current=z==null?void 0:z.id,ae!==void 0&&X(void 0),te!==""&&V("")),b.useEffect(()=>{if(!(z!=null&&z.id))return;const Te=z.id!==Y.current,ct=z.latestSessionId!==F.current;(Te||ct)&&(Y.current=z.id,F.current=z.latestSessionId,w(z.id))},[z==null?void 0:z.id,z==null?void 0:z.latestSessionId,w]),(z==null?void 0:z.status)!==U.current){const Te=U.current===void 0;U.current=z==null?void 0:z.status;const ct=(z==null?void 0:z.status)==="not_started"?"overview":(z==null?void 0:z.status)==="working"||(z==null?void 0:z.status)==="paused"?"stream":(z==null?void 0:z.status)==="complete"?"findings":void 0;ct&&ct!==Z&&!(Te&&O!=="overview")&&ee(ct)}const ot=b.useMemo(()=>new Map(d.map(Te=>[Te.id,Te])),[d]),$t=b.useMemo(()=>{const Te=fe?r.filter(ct=>ct.sessionId===fe):[];return Fh($h(Te))},[r,fe]),Rn=z?z.dependsOn.some(Te=>{const ct=ot.get(Te);return ct!==void 0&&ct.status!=="complete"}):!1,Yn=b.useMemo(()=>ZO(n,N,ot),[n,N,ot]);b.useEffect(()=>{fe&&fe!==D.current&&(D.current=fe,g(fe))},[fe,g]),b.useEffect(()=>{Z==="findings"&&re&&y(re)},[Z,re,y]);const Jt=Te=>{ee(Te),l(va(n,Te==="overview"?void 0:Te,a))};return c.jsxs("div",{className:I.panelContainer,children:[c.jsx(Yi,{segments:Yn}),c.jsxs("div",{className:I.header,children:[c.jsxs("span",{className:I.headerTitle,children:[c.jsx("span",{"data-testid":"task-title",children:(z==null?void 0:z.title)||n}),z&&c.jsx("span",{className:I.taskStatusBadge,"data-testid":"task-status",children:z.status}),(z==null?void 0:z.branch)&&c.jsx("span",{className:I.taskBranch,children:z.branch}),Rn&&c.jsx("span",{className:I.taskBlockedBadge,children:"blocked"})]}),z&&c.jsx(t4,{task:z,sessionId:fe,isBlocked:Rn,onStart:()=>x(z.id,void 0,te),onResume:()=>C(z.id),onStop:()=>S(z.id),onPause:()=>fe&&v(fe),onDelete:se,onEdit:()=>l(HC(z.id,a))})]}),c.jsxs("div",{className:I.tabBar,role:"tablist","aria-label":"Task view",children:[c.jsx("button",{role:"tab","aria-selected":Z==="overview",className:`${I.tab} ${Z==="overview"?I.active:""}`,onClick:()=>Jt("overview"),children:"Overview"}),c.jsx("button",{role:"tab","aria-selected":Z==="stream",className:`${I.tab} ${Z==="stream"?I.active:""}`,onClick:()=>Jt("stream"),children:"Stream"}),c.jsx("button",{role:"tab","aria-selected":Z==="findings",className:`${I.tab} ${Z==="findings"?I.active:""}`,onClick:()=>Jt("findings"),children:"Findings"})]}),c.jsxs(qn,{mode:"wait",children:[Z==="overview"&&c.jsx(St.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:I.overviewContent,"data-testid":"task-overview",children:z?c.jsx(e4,{task:z,tasksById:ot,environments:m,workspaces:N,taskSessions:oe,selectedEnvId:te}):c.jsx("div",{className:I.waitingMessage,children:"No additional details"})},"overview"),Z==="stream"&&c.jsxs(St.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(n4,{taskSessions:oe,selectedSessionId:fe,onSelect:Te=>X(Te)}),c.jsx(Ph,{events:$t,eventsDropped:f,emptyState:!fe&&z?c.jsxs("div",{className:I.emptyCta,children:[c.jsx("button",{className:I.ctaButton,onClick:()=>x(z.id,void 0,te),children:"Start Task"}),c.jsx("div",{className:I.ctaDescription,children:"Click to begin agent execution"})]}):fe&&$t.length===0?c.jsx("div",{className:I.waitingMessage,children:"Waiting for events..."}):void 0})]},"stream"),Z==="findings"&&c.jsx(St.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:I.tabContent,children:re?c.jsx(W6,{workspaceId:re}):c.jsx("div",{className:I.noContext,children:"Navigate to a task within a workspace to view findings"})},"findings")]}),(()=>{if(!z||z.status!=="working"&&z.status!=="paused")return;const Te=fe?p.find(ct=>ct.id===fe):void 0;if(!(!Te||["completed","failed","interrupted","hibernating"].includes(Te.status)))return c.jsx(ml,{mode:"send",sessionId:Te.id,environmentId:Te.environmentId})})(),z&&c.jsx(Nc,{isOpen:ie,title:"Delete Task?",description:`"${z.title}" will be permanently removed.`,onConfirm:Oe,onCancel:()=>R(!1)})]})}const a4="_container_legrg_1",s4="_header_legrg_8",i4="_headerTitle_legrg_35",o4="_badge_legrg_44",l4="_headerActions_legrg_54",r4="_body_legrg_61",c4="_formContent_legrg_73",u4="_section_legrg_85",d4="_label_legrg_91",f4="_nameInput_legrg_98",h4="_fieldInput_legrg_131",p4="_adapterSelect_legrg_164",m4="_readOnlyValue_legrg_198",g4="_codespaceSection_legrg_204",v4="_codespaceActions_legrg_210",y4="_creatingHint_legrg_216",b4="_errorHint_legrg_222",x4="_btnPrimary_legrg_235",_4="_btnGhost_legrg_266",ne={container:a4,header:s4,headerTitle:i4,badge:o4,headerActions:l4,body:r4,formContent:c4,section:u4,label:d4,nameInput:f4,fieldInput:h4,adapterSelect:p4,readOnlyValue:m4,codespaceSection:g4,codespaceActions:v4,creatingHint:y4,errorHint:b4,btnPrimary:x4,btnGhost:_4},nc=1,ac=65535;function pf(n){if(!n.trim())return!0;const a=Number(n);return Number.isInteger(a)&&a>=nc&&a<=ac}function mf(n){try{const a=JSON.parse(n);if(typeof a=="object"&&a!==null&&!Array.isArray(a))return a}catch{}return{}}function S4({codespaceName:n,onCodespaceNameChange:a,envName:i,onEnvNameChange:l}){const{codespaces:r,codespaceError:f,codespaceListError:d,codespaceCreating:p,createCodespace:m}=Je(),[g,y]=b.useState("pick"),[v,x]=b.useState(""),[S,C]=b.useState("");return g==="create"?c.jsxs("div",{className:ne.codespaceSection,children:[c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,children:"Repository"}),c.jsx("input",{type:"text",value:v,onChange:k=>x(k.target.value),placeholder:"owner/repo",className:ne.fieldInput,"data-testid":"env-codespace-repo"})]}),c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,children:"Machine Type"}),c.jsx("input",{type:"text",value:S,onChange:k=>C(k.target.value),placeholder:"Machine type (optional)...",className:ne.fieldInput,"data-testid":"env-codespace-machine"})]}),c.jsxs("div",{className:ne.codespaceActions,children:[c.jsx("button",{onClick:()=>{v.trim()&&(m(v.trim(),S.trim()||void 0),y("pick"),x(""),C(""))},disabled:!v.trim(),className:ne.btnPrimary,children:"Create"}),c.jsx("button",{onClick:()=>{y("pick"),x(""),C("")},className:ne.btnGhost,children:"Cancel"})]})]}):c.jsx("div",{className:ne.codespaceSection,children:c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,children:"Codespace"}),!d&&c.jsxs("select",{value:n,onChange:k=>{k.target.value==="__create__"?(y("create"),a("")):(a(k.target.value),k.target.value&&!i.trim()&&l(k.target.value))},disabled:p,className:ne.adapterSelect,"data-testid":"env-codespace-select",children:[c.jsx("option",{value:"",children:"Select a codespace..."}),r.map(k=>c.jsxs("option",{value:k.name,children:[k.name," (",k.repository,") — ",k.state]},k.name)),c.jsx("option",{value:"__create__",children:"Create new from repo..."})]}),p&&c.jsx("span",{className:ne.creatingHint,children:"Creating codespace..."}),d&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:ne.errorHint,children:d}),c.jsx("input",{type:"text",value:n,onChange:k=>a(k.target.value),placeholder:"Or enter codespace name manually...",className:ne.fieldInput,"data-testid":"env-codespace-manual"})]}),f&&!d&&c.jsx("span",{className:ne.errorHint,children:f})]})})}function b_({mode:n,environmentId:a}){const{environments:i,addEnvironment:l,updateEnvironment:r,listCodespaces:f}=Je(),{showToast:d}=Pi(),p=Ut(),m=n==="edit",g=m&&a?i.find(B=>B.id===a):void 0,[y,v]=b.useState(""),[x,S]=b.useState("local"),[C,k]=b.useState(""),[N,E]=b.useState(""),[w,D]=b.useState(""),[A,U]=b.useState(""),[Y,F]=b.useState(""),[O,Z]=b.useState(""),[ee,ie]=b.useState(""),[R,ae]=b.useState(null),X=b.useCallback(()=>{const B={};if(x==="local"){if(C.trim()&&(B.host=C.trim()),N.trim()){const oe=Number(N);Number.isInteger(oe)&&(B.port=oe)}}else if(x==="ssh"){if(B.host=C.trim(),w.trim()&&(B.user=w.trim()),N.trim()){const oe=Number(N);Number.isInteger(oe)&&(B.sshPort=oe)}A.trim()&&(B.identityFile=A.trim())}else x==="docker"?(Y.trim()&&(B.image=Y.trim()),O.trim()&&(B.repo=O.trim())):x==="codespace"&&(B.codespaceName=ee.trim());return B},[x,C,N,w,A,Y,O,ee]),te=()=>!(!y.trim()||x==="ssh"&&!C.trim()||x==="codespace"&&!ee.trim()||(x==="local"||x==="ssh")&&!pf(N)),V=()=>{te()&&(l(y.trim(),x,X()),d("Environment added successfully","success"),p(cl,{replace:!0}))},H=()=>{p(a?bf(a):cl)},z=b.useCallback((B,oe)=>{if(!g||!a)return;const fe=mf(g.adapterConfig),se=oe.trim();se?fe[B]=se:delete fe[B],r(a,{adapterConfig:fe})},[g,a,r]),re=b.useCallback((B,oe)=>{if(!g||!a)return;const fe=mf(g.adapterConfig);if(oe.trim()){const se=Number(oe);Number.isInteger(se)&&se>=nc&&se<=ac&&(fe[B]=se)}else delete fe[B];r(a,{adapterConfig:fe})},[g,a,r]);if(m){if(!g)return c.jsxs("div",{className:ne.container,children:[c.jsxs("div",{className:ne.header,children:[c.jsx("div",{className:ne.headerTitle,children:c.jsx("span",{className:ne.badge,children:"edit environment"})}),c.jsx("div",{className:ne.headerActions,children:c.jsx("button",{onClick:H,className:ne.btnGhost,children:"Back"})})]}),c.jsx("div",{className:ne.body,children:c.jsx("div",{className:ne.formContent,children:c.jsx("span",{className:ne.readOnlyValue,children:"Environment not found"})})})]});const B=mf(g.adapterConfig);return c.jsxs("div",{className:ne.container,"data-testid":"env-edit-panel",children:[c.jsxs("div",{className:ne.header,children:[c.jsx("div",{className:ne.headerTitle,children:c.jsx("span",{className:ne.badge,children:"edit environment"})}),c.jsx("div",{className:ne.headerActions,children:c.jsx("button",{onClick:H,className:ne.btnGhost,"data-testid":"env-edit-back",children:"Back"})})]}),c.jsx("div",{className:ne.body,children:c.jsxs("div",{className:ne.formContent,children:[c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,children:"Name"}),c.jsx(cn,{value:g.displayName,onSave:oe=>{a&&r(a,{displayName:oe})},validate:oe=>oe.trim()===""?"Name cannot be empty":void 0,mode:"edit",fieldId:"name",activeFieldId:R,onActivate:ae,placeholder:"Environment name",ariaLabel:"Environment name","data-testid":"env-edit-name"})]}),c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,children:"Adapter Type"}),c.jsx("span",{className:ne.readOnlyValue,"data-testid":"env-edit-adapter-type",children:g.adapterType})]}),g.adapterType==="local"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,children:"Host"}),c.jsx(cn,{value:String(B.host??""),onSave:oe=>z("host",oe),mode:"edit",fieldId:"host",activeFieldId:R,onActivate:ae,placeholder:"(default)",ariaLabel:"Host","data-testid":"env-edit-host"})]}),c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,children:"Port"}),c.jsx(cn,{value:String(B.port??""),onSave:oe=>re("port",oe),validate:oe=>pf(oe)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"port",activeFieldId:R,onActivate:ae,placeholder:"(default)",ariaLabel:"Port","data-testid":"env-edit-port"})]})]}),g.adapterType==="ssh"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,children:"Host"}),c.jsx(cn,{value:String(B.host??""),onSave:oe=>z("host",oe),validate:oe=>oe.trim()===""?"Host is required":void 0,mode:"edit",fieldId:"host",activeFieldId:R,onActivate:ae,placeholder:"hostname or IP",ariaLabel:"Host","data-testid":"env-edit-host"})]}),c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,children:"User"}),c.jsx(cn,{value:String(B.user??""),onSave:oe=>z("user",oe),mode:"edit",fieldId:"user",activeFieldId:R,onActivate:ae,placeholder:"(default)",ariaLabel:"User","data-testid":"env-edit-user"})]}),c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,children:"SSH Port"}),c.jsx(cn,{value:String(B.sshPort??""),onSave:oe=>re("sshPort",oe),validate:oe=>pf(oe)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"sshPort",activeFieldId:R,onActivate:ae,placeholder:"22",ariaLabel:"SSH Port","data-testid":"env-edit-ssh-port"})]}),c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,children:"Identity File"}),c.jsx(cn,{value:String(B.identityFile??""),onSave:oe=>z("identityFile",oe),mode:"edit",fieldId:"identityFile",activeFieldId:R,onActivate:ae,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:ne.section,children:[c.jsx("label",{className:ne.label,children:"Image"}),c.jsx(cn,{value:String(B.image??""),onSave:oe=>z("image",oe),mode:"edit",fieldId:"image",activeFieldId:R,onActivate:ae,placeholder:"(default)",ariaLabel:"Image","data-testid":"env-edit-image"})]}),c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,children:"Repo"}),c.jsx(cn,{value:String(B.repo??""),onSave:oe=>z("repo",oe),mode:"edit",fieldId:"repo",activeFieldId:R,onActivate:ae,placeholder:"(none)",ariaLabel:"Repo","data-testid":"env-edit-repo"})]})]}),g.adapterType==="codespace"&&c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,children:"Codespace Name"}),c.jsx(cn,{value:String(B.codespaceName??""),onSave:oe=>z("codespaceName",oe),validate:oe=>oe.trim()===""?"Codespace name is required":void 0,mode:"edit",fieldId:"codespaceName",activeFieldId:R,onActivate:ae,placeholder:"codespace-name",ariaLabel:"Codespace Name","data-testid":"env-edit-codespace-name"})]})]})})]})}return c.jsxs("div",{className:ne.container,"data-testid":"env-create-panel",children:[c.jsxs("div",{className:ne.header,children:[c.jsx("div",{className:ne.headerTitle,children:c.jsx("span",{className:ne.badge,children:"new environment"})}),c.jsxs("div",{className:ne.headerActions,children:[c.jsx("button",{onClick:V,disabled:!te(),className:ne.btnPrimary,"data-testid":"env-create-submit",children:"Create"}),c.jsx("button",{onClick:H,className:ne.btnGhost,children:"Cancel"})]})]}),c.jsx("div",{className:ne.body,children:c.jsxs("div",{className:ne.formContent,children:[c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,htmlFor:"env-create-name",children:"Name"}),c.jsx("input",{id:"env-create-name",type:"text",value:y,onChange:B=>v(B.target.value),placeholder:"Environment name...",autoFocus:!0,className:ne.nameInput,"data-testid":"env-create-name",onKeyDown:B=>{B.key==="Enter"&&te()&&V()}})]}),c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,htmlFor:"env-create-adapter",children:"Adapter Type"}),c.jsxs("select",{id:"env-create-adapter",value:x,onChange:B=>{S(B.target.value),B.target.value==="codespace"&&f()},className:ne.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"})]})]}),x==="local"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,htmlFor:"env-create-host",children:"Host"}),c.jsx("input",{id:"env-create-host",type:"text",value:C,onChange:B=>k(B.target.value),placeholder:"Host (optional)...",className:ne.fieldInput,"data-testid":"env-create-host"})]}),c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,htmlFor:"env-create-port",children:"Port"}),c.jsx("input",{id:"env-create-port",type:"number",min:nc,max:ac,value:N,onChange:B=>E(B.target.value),placeholder:"Port (optional)...",className:ne.fieldInput,"data-testid":"env-create-port"})]})]}),x==="ssh"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,htmlFor:"env-create-host",children:"Host"}),c.jsx("input",{id:"env-create-host",type:"text",value:C,onChange:B=>k(B.target.value),placeholder:"Host (required)...",className:ne.fieldInput,"data-testid":"env-create-host"})]}),c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,htmlFor:"env-create-user",children:"User"}),c.jsx("input",{id:"env-create-user",type:"text",value:w,onChange:B=>D(B.target.value),placeholder:"User (optional)...",className:ne.fieldInput,"data-testid":"env-create-user"})]}),c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,htmlFor:"env-create-port",children:"SSH Port"}),c.jsx("input",{id:"env-create-port",type:"number",min:nc,max:ac,value:N,onChange:B=>E(B.target.value),placeholder:"SSH port (optional)...",className:ne.fieldInput,"data-testid":"env-create-port"})]}),c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,htmlFor:"env-create-identity",children:"Identity File"}),c.jsx("input",{id:"env-create-identity",type:"text",value:A,onChange:B=>U(B.target.value),placeholder:"Identity file (optional)...",className:ne.fieldInput,"data-testid":"env-create-identity"})]})]}),x==="docker"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,htmlFor:"env-create-image",children:"Image"}),c.jsx("input",{id:"env-create-image",type:"text",value:Y,onChange:B=>F(B.target.value),placeholder:"Image (optional)...",className:ne.fieldInput,"data-testid":"env-create-image"})]}),c.jsxs("div",{className:ne.section,children:[c.jsx("label",{className:ne.label,htmlFor:"env-create-repo",children:"Repo"}),c.jsx("input",{id:"env-create-repo",type:"text",value:O,onChange:B=>Z(B.target.value),placeholder:"Repo (optional)...",className:ne.fieldInput,"data-testid":"env-create-repo"})]})]}),x==="codespace"&&c.jsx(S4,{codespaceName:ee,onCodespaceNameChange:ie,envName:y,onEnvNameChange:v})]})})]})}function T4(){return c.jsx(b_,{mode:"new"})}function C4(){const{environmentId:n}=Hi();return c.jsx(b_,{mode:"edit",environmentId:n})}const k4="_layout_11u79_1",E4="_content_11u79_8",N4="_tabPanel_11u79_14",il={layout:k4,content:E4,tabPanel:N4};function A4(){const n=qO();return c.jsxs("div",{className:il.layout,children:[c.jsx(Yi,{segments:n}),c.jsx("div",{className:il.content,children:c.jsx(eh,{})})]})}const w4="_container_13sb6_1",j4="_envHeader_13sb6_6",D4="_envTitleRow_13sb6_10",M4="_statusDot_13sb6_16",R4="_envName_13sb6_21",O4="_statusBadge_13sb6_27",B4="_envMeta_13sb6_33",I4="_metaTag_13sb6_39",L4="_actions_13sb6_51",z4="_provisionMessage_13sb6_59",U4="_errorMessage_13sb6_64",V4="_section_13sb6_69",H4="_sectionHeader_13sb6_73",G4="_createForm_13sb6_85",P4="_createInput_13sb6_92",$4="_cardList_13sb6_121",F4="_card_13sb6_121",q4="_cardHeader_13sb6_138",Y4="_cardName_13sb6_144",K4="_cardActions_13sb6_149",Z4="_cardDescription_13sb6_154",X4="_cardMeta_13sb6_160",Q4="_repoLink_13sb6_166",W4="_empty_13sb6_174",J4="_btnPrimary_13sb6_180",e5="_btnOutline_13sb6_214",t5="_btnSmall_13sb6_241",n5="_btnDanger_13sb6_267",Ee={container:w4,envHeader:j4,envTitleRow:D4,statusDot:M4,envName:R4,statusBadge:O4,envMeta:B4,metaTag:I4,actions:L4,provisionMessage:z4,errorMessage:U4,section:V4,sectionHeader:H4,createForm:G4,createInput:P4,cardList:$4,card:F4,cardHeader:q4,cardName:Y4,cardActions:K4,cardDescription:Z4,cardMeta:X4,repoLink:Q4,empty:W4,btnPrimary:J4,btnOutline:e5,btnSmall:t5,btnDanger:n5},a5={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function s5(){const{environmentId:n}=Hi(),a=Ut(),{environments:i,workspaces:l,sessions:r,provisionStatus:f,provisionEnvironment:d,stopEnvironment:p,removeEnvironment:m,createWorkspace:g,archiveWorkspace:y,workspaceCreating:v}=Je(),[x,S]=b.useState(!1),[C,k]=b.useState(void 0),[N,E]=b.useState(!1),[w,D]=b.useState(""),A=i.find(H=>H.id===n);if(!n||!A)return c.jsx(Ka,{to:cl,replace:!0});const U=l.filter(H=>H.environmentId===A.id),Y=r.filter(H=>H.environmentId===A.id),F=Y.reduce((H,z)=>H+(z.costUsd??0),0),O=a5[A.status]||"var(--text-tertiary)",Z=A.status==="connected",ee=A.status==="connecting",ie=A.status==="disconnected"||A.status==="error",R=A.id in f?f[A.id]:void 0,ae=()=>{m(A.id),S(!1),a(cl,{replace:!0})},X=()=>{!w.trim()||v||(g(w.trim(),void 0,void 0,A.id),D(""),E(!1))},te=H=>{H.key==="Enter"?X():H.key==="Escape"&&(E(!1),D(""))},V=H=>{y(H),k(void 0)};return c.jsxs("div",{className:Ee.container,children:[c.jsx(Nc,{isOpen:x,title:"Delete Environment?",description:`"${A.displayName||A.id}" will be permanently removed along with all its data.`,onConfirm:ae,onCancel:()=>S(!1)}),c.jsxs("div",{className:Ee.envHeader,children:[c.jsxs("div",{className:Ee.envTitleRow,children:[c.jsx("span",{className:Ee.statusDot,style:{color:O},children:"●"}),c.jsx("h2",{className:Ee.envName,children:A.displayName||A.id}),c.jsx("span",{className:Ee.statusBadge,style:{color:O},children:A.status})]}),c.jsxs("div",{className:Ee.envMeta,children:[c.jsxs("span",{className:Ee.metaTag,children:["Adapter: ",A.adapterType]}),Y.length>0&&c.jsxs("span",{className:Ee.metaTag,children:[Y.length," session",Y.length!==1?"s":""]}),F>0&&c.jsxs("span",{className:Ee.metaTag,children:["Cost: ",Li(F)]})]})]}),c.jsxs("div",{className:Ee.actions,children:[Z&&c.jsxs(c.Fragment,{children:[c.jsx("button",{className:Ee.btnPrimary,onClick:()=>a(hb(A.id)),children:"New Chat"}),c.jsx("button",{className:Ee.btnOutline,onClick:()=>p(A.id),children:"Stop"})]}),ie&&c.jsx("button",{className:Ee.btnPrimary,onClick:()=>d(A.id),children:A.status==="error"?"Retry":"Connect"}),ee&&R!==void 0&&c.jsx("span",{className:Ee.provisionMessage,children:R.message}),A.status==="error"&&(R==null?void 0:R.stage)==="error"&&c.jsx("span",{className:Ee.errorMessage,children:R.message}),c.jsx("button",{className:Ee.btnOutline,onClick:()=>a(PC(A.id)),"data-testid":"env-edit-btn",children:"Edit Config"}),c.jsx("button",{className:Ee.btnDanger,onClick:()=>S(!0),children:"Delete"})]}),c.jsxs("div",{className:Ee.section,children:[c.jsxs("div",{className:Ee.sectionHeader,children:[c.jsx("h3",{children:"Workspaces"}),c.jsx("button",{className:Ee.btnPrimary,onClick:()=>E(!0),disabled:v,children:"+ New Workspace"})]}),N&&c.jsxs("div",{className:Ee.createForm,children:[c.jsx("input",{type:"text",value:w,onChange:H=>D(H.target.value),onKeyDown:te,placeholder:"Workspace name...",autoFocus:!0,disabled:v,className:Ee.createInput,"data-testid":"workspace-create-input"}),c.jsx("button",{onClick:X,className:Ee.btnPrimary,disabled:v||!w.trim(),"data-testid":"workspace-create-submit",children:v?c.jsx(Gh,{size:"sm",label:"Creating"}):"Create"}),c.jsx("button",{onClick:()=>{E(!1),D("")},className:Ee.btnOutline,children:"Cancel"})]}),U.length===0&&!N&&c.jsx("p",{className:Ee.empty,children:"No workspaces yet. Create one to get started."}),c.jsx("div",{className:Ee.cardList,children:U.map(H=>c.jsx(i5,{workspace:H,confirmArchiveId:C,onOpen:()=>a(Ri(H.id)),onArchive:()=>k(H.id),onConfirmArchive:()=>V(H.id),onCancelArchive:()=>k(void 0)},H.id))})]})]})}function i5({workspace:n,confirmArchiveId:a,onOpen:i,onArchive:l,onConfirmArchive:r,onCancelArchive:f}){const d=a===n.id,p=n.repoUrl&&/^https?:\/\//.test(n.repoUrl);return c.jsxs("div",{className:Ee.card,"data-testid":"workspace-card",children:[c.jsxs("div",{className:Ee.cardHeader,children:[c.jsx("strong",{className:Ee.cardName,children:n.name}),c.jsxs("div",{className:Ee.cardActions,children:[c.jsx("button",{className:Ee.btnSmall,onClick:i,children:"Open"}),d?c.jsxs(c.Fragment,{children:[c.jsx("button",{className:Ee.btnDanger,onClick:r,children:"Confirm"}),c.jsx("button",{className:Ee.btnSmall,onClick:f,children:"Cancel"})]}):c.jsx("button",{className:Ee.btnSmall,onClick:l,children:"Archive"})]})]}),n.description&&c.jsx("p",{className:Ee.cardDescription,children:n.description}),n.repoUrl&&c.jsx("div",{className:Ee.cardMeta,children:p?c.jsx("a",{href:n.repoUrl,target:"_blank",rel:"noopener noreferrer",className:Ee.repoLink,children:n.repoUrl}):c.jsx("span",{children:n.repoUrl})})]})}const o5={credentials:"Credentials",personas:"Personas",appearance:"Appearance",about:"About"};function l5(){const a=At().pathname.replace(/^\/settings\/?/,"").split("/")[0],i=o5[a],l=FO(i);return c.jsxs("div",{className:il.layout,children:[c.jsx(Yi,{segments:l}),c.jsx("div",{className:il.content,children:c.jsx("div",{className:il.tabPanel,children:c.jsx(eh,{})},a)})]})}const r5="_section_1ingb_14",c5="_sectionTitle_1ingb_26",u5="_sectionDescription_1ingb_35",d5="_tokenList_1ingb_48",f5="_tokenRow_1ingb_55",h5="_tokenBadge_1ingb_68",p5="_tokenName_1ingb_83",m5="_tokenTarget_1ingb_90",g5="_deleteButton_1ingb_99",v5="_addForm_1ingb_113",y5="_formRow_1ingb_119",b5="_input_1ingb_125",x5="_select_1ingb_155",_5="_addButton_1ingb_187",S5="_emptyStateInfo_1ingb_221",T5="_themeOptions_1ingb_229",C5="_themeOption_1ingb_229",k5="_themeOptionSelected_1ingb_254",E5="_themeOptionHeader_1ingb_259",N5="_themeOptionLabel_1ingb_266",A5="_themeOptionDesc_1ingb_273",w5="_variantToggle_1ingb_279",j5="_variantButton_1ingb_286",D5="_variantActive_1ingb_305",M5="_themeSwatches_1ingb_311",R5="_themeSwatch_1ingb_311",O5="_systemToggle_1ingb_325",B5="_systemToggleHint_1ingb_341",I5="_themeActive_1ingb_348",L5="_aboutGrid_1ingb_354",z5="_aboutItem_1ingb_360",U5="_aboutLabel_1ingb_373",V5="_aboutValue_1ingb_379",H5="_aboutDot_1ingb_387",G5="_aboutDotConnected_1ingb_394",P5="_aboutDotDisconnected_1ingb_398",de={section:r5,sectionTitle:c5,sectionDescription:u5,tokenList:d5,tokenRow:f5,tokenBadge:h5,tokenName:p5,tokenTarget:m5,deleteButton:g5,addForm:v5,formRow:y5,input:b5,select:x5,addButton:_5,emptyStateInfo:S5,themeOptions:T5,themeOption:C5,themeOptionSelected:k5,themeOptionHeader:E5,themeOptionLabel:N5,themeOptionDesc:A5,variantToggle:w5,variantButton:j5,variantActive:D5,themeSwatches:M5,themeSwatch:R5,systemToggle:O5,systemToggleHint:B5,themeActive:I5,aboutGrid:L5,aboutItem:z5,aboutLabel:U5,aboutValue:V5,aboutDot:H5,aboutDotConnected:G5,aboutDotDisconnected:P5},$5=[{key:"claude",label:"Claude",description:"Forward Claude credentials for AI agent access.",options:[{value:"off",label:"Off"},{value:"subscription",label:"Subscription"},{value:"api_key",label:"API Key"}]},{key:"github",label:"GitHub",description:"Forward GITHUB_TOKEN and GH_TOKEN for git operations.",options:[{value:"off",label:"Off"},{value:"on",label:"On"}]},{key:"copilot",label:"Copilot",description:"Forward Copilot tokens (COPILOT_GITHUB_TOKEN, CLI config).",options:[{value:"off",label:"Off"},{value:"on",label:"On"}]},{key:"codex",label:"Codex",description:"Forward OPENAI_API_KEY for Codex/OpenAI access.",options:[{value:"off",label:"Off"},{value:"on",label:"On"}]}];function F5(){const{credentialProviders:n,updateCredentialProviders:a}=Je(),i=(l,r)=>{const f={...n};l==="claude"?f.claude=r:f[l]=r,a(f)};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:$5.map(l=>c.jsxs("div",{className:de.tokenRow,children:[c.jsx("span",{className:de.tokenName,children:l.label}),c.jsx("span",{className:de.tokenTarget,children:l.description}),c.jsx("select",{className:de.select,value:n[l.key],onChange:r=>i(l.key,r.target.value),children:l.options.map(r=>c.jsx("option",{value:r.value,children:r.label},r.value))})]},l.key))})]})}const q5=[{value:"env_var",label:"Environment Variable"},{value:"file",label:"File"}];function Y5(){const{tokens:n,setToken:a,deleteToken:i}=Je(),{showToast:l}=Pi(),[r,f]=b.useState(""),[d,p]=b.useState(""),[m,g]=b.useState("env_var"),[y,v]=b.useState(""),[x,S]=b.useState(null),C=E=>{if(E.preventDefault(),!r||!d)return;const w=m==="env_var"?y||r.toUpperCase()+"_TOKEN":"";a(r,d,m,w,m==="file"?y:""),l("Token saved successfully","success"),f(""),p(""),v("")},k=E=>{S(E)},N=()=>{x&&(i(x),l("Token deleted","info")),S(null)};return c.jsxs(c.Fragment,{children:[c.jsx(Nc,{isOpen:x!==null,title:"Delete Token?",description:x?`"${x}" 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."}),n.length===0?c.jsx("div",{className:de.emptyStateInfo,children:"Add your first API token to enable service integrations."}):c.jsx("div",{className:de.tokenList,children:n.map(E=>c.jsxs("div",{className:de.tokenRow,children:[c.jsx("span",{className:de.tokenBadge,children:E.tokenType}),c.jsx("span",{className:de.tokenName,children:E.name}),c.jsx("span",{className:de.tokenTarget,children:E.tokenType==="env_var"?E.envVar:E.filePath}),c.jsx("button",{className:de.deleteButton,onClick:()=>k(E.name),title:`Delete ${E.name}`,children:"×"})]},E.name))}),c.jsxs("form",{className:de.addForm,onSubmit:C,children:[c.jsxs("div",{className:de.formRow,children:[c.jsx("input",{className:de.input,type:"text",placeholder:"Token name",value:r,onChange:E=>f(E.target.value)}),c.jsx("input",{className:de.input,type:"password",placeholder:"Value",value:d,onChange:E=>p(E.target.value)})]}),c.jsxs("div",{className:de.formRow,children:[c.jsx("select",{className:de.select,value:m,onChange:E=>g(E.target.value),children:q5.map(E=>c.jsx("option",{value:E.value,children:E.label},E.value))}),c.jsx("input",{className:de.input,type:"text",placeholder:m==="env_var"?"Env var name (e.g. API_TOKEN)":"File path (e.g. /home/user/.token)",value:y,onChange:E=>v(E.target.value)}),c.jsx("button",{className:de.addButton,type:"submit",children:"Add Token"})]})]})]})]})}function K5(){return c.jsxs(c.Fragment,{children:[c.jsx(F5,{}),c.jsx(Y5,{})]})}const Z5="_container_xb7ms_1",X5="_header_xb7ms_7",Q5="_form_xb7ms_19",W5="_formActions_xb7ms_87",J5="_list_xb7ms_93",eI="_card_xb7ms_99",tI="_active_xb7ms_109",nI="_cardHeader_xb7ms_113",aI="_cardTitle_xb7ms_123",sI="_defaultBadge_xb7ms_129",iI="_cardActions_xb7ms_143",oI="_description_xb7ms_148",lI="_meta_xb7ms_154",rI="_promptDetails_xb7ms_171",cI="_promptText_xb7ms_183",uI="_empty_xb7ms_200",dI="_btnPrimary_xb7ms_206",fI="_btnSecondary_xb7ms_240",hI="_btnSmall_xb7ms_267",pI="_btnDanger_xb7ms_293",mI="_typeToggle_xb7ms_336",gI="_typeBadge_xb7ms_350",vI="_scriptEditor_xb7ms_364",yI="_optional_xb7ms_371",He={container:Z5,header:X5,form:Q5,formActions:W5,list:J5,card:eI,active:tI,cardHeader:nI,cardTitle:aI,defaultBadge:sI,cardActions:iI,description:oI,meta:lI,promptDetails:rI,promptText:cI,empty:uI,btnPrimary:dI,btnSecondary:fI,btnSmall:hI,btnDanger:pI,typeToggle:mI,typeBadge:gI,scriptEditor:vI,optional:yI};function bI(){const{personas:n,createPersona:a,updatePersona:i,deletePersona:l,appDefaultPersonaId:r,setAppDefaultPersonaId:f}=Je(),[d,p]=b.useState(null),[m,g]=b.useState(!1),[y,v]=b.useState(null),[x,S]=b.useState(""),[C,k]=b.useState(""),[N,E]=b.useState(""),[w,D]=b.useState("claude-code"),[A,U]=b.useState("sonnet"),[Y,F]=b.useState(0),[O,Z]=b.useState("agent"),[ee,ie]=b.useState(""),R=()=>{S(""),k(""),E(""),D("claude-code"),U("sonnet"),F(0),Z("agent"),ie("")},ae=()=>{R(),p(null),g(!0)},X=B=>{S(B.name),k(B.description),E(B.systemPrompt);const oe=B.type==="script"?"script":"agent";D(oe==="script"?B.runtime||"genaiscript":B.runtime),U(B.model),F(B.maxTurns),Z(oe),ie(B.script||""),p(B),g(!1)},te=B=>{Z(B),B==="script"?D("genaiscript"):w==="genaiscript"&&D("claude-code")},V=B=>{if(B.preventDefault(),!!x.trim()){if(O==="script"){if(!ee.trim())return}else if(!N.trim()||!w||!A)return;d?(i(d.id,x,C,N,w,A,Y,O,ee),p(null)):(a(x,C,N,w,A,Y,O,ee),g(!1)),R()}},H=B=>{l(B),v(null),(d==null?void 0:d.id)===B&&(p(null),R())},z=()=>{p(null),g(!1),R()},re=()=>c.jsxs("form",{onSubmit:V,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:O==="agent",onChange:()=>te("agent")}),"Agent"]}),c.jsxs("label",{children:[c.jsx("input",{type:"radio",name:"personaType",value:"script",checked:O==="script",onChange:()=>te("script")}),"Script"]})]}),c.jsxs("label",{children:["Name",c.jsx("input",{type:"text",value:x,onChange:B=>S(B.target.value),placeholder:O==="script"?"e.g. Nightly Report":"e.g. Frontend Engineer",required:!0})]}),c.jsxs("label",{children:["Description",c.jsx("input",{type:"text",value:C,onChange:B=>k(B.target.value),placeholder:"Brief description..."})]}),c.jsxs("label",{children:["Runtime",c.jsx("select",{value:w,onChange:B=>D(B.target.value),"data-testid":"persona-runtime-select",children:O==="script"?c.jsx("option",{value:"genaiscript",children:"genaiscript"}):c.jsxs(c.Fragment,{children:[c.jsx("option",{value:"claude-code",children:"claude-code"}),c.jsx("option",{value:"codex",children:"codex"}),c.jsx("option",{value:"copilot",children:"copilot"}),c.jsx("option",{value:"stub",children:"stub"}),c.jsx("option",{value:"claude-code-acp",children:"claude-code-acp (experimental)"}),c.jsx("option",{value:"codex-acp",children:"codex-acp (experimental)"}),c.jsx("option",{value:"copilot-acp",children:"copilot-acp (experimental)"})]})})]}),O==="agent"&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{children:["Model",c.jsx("input",{type:"text",value:A,onChange:B=>U(B.target.value),placeholder:"e.g. sonnet"})]}),c.jsxs("label",{children:["Max Turns",c.jsx("input",{type:"number",value:Y,onChange:B=>F(parseInt(B.target.value,10)||0),min:0})]}),c.jsxs("label",{children:["System Prompt",c.jsx("textarea",{value:N,onChange:B=>E(B.target.value),placeholder:"You are a senior frontend engineer...",rows:10,required:!0})]})]}),O==="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:A,onChange:B=>U(B.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:B=>E(B.target.value),placeholder:"Optional context for the script...",rows:4})]}),c.jsxs("label",{children:["Script",c.jsx("textarea",{value:ee,onChange:B=>ie(B.target.value),placeholder:`script({ model: "openai:gpt-4o" });
|
|
94
|
-
|
|
95
|
-
const grackle = await host.mcpServer({
|
|
96
|
-
id: "grackle",
|
|
97
|
-
url: env.vars.GRACKLE_MCP_URL,
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
$\`Summarize the current tasks.\`;`,rows:20,className: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:z,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:ae,className:He.btnPrimary,children:"+ New Persona"})]}),(m||d)&&re(),n.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:n.map(B=>{const oe=r===B.id,fe=B.type==="script";return c.jsxs("div",{className:`${He.card} ${(d==null?void 0:d.id)===B.id?He.active:""}`,"data-testid":`persona-card-${B.id}`,children:[c.jsxs("div",{className:He.cardHeader,children:[c.jsxs("span",{className:He.cardTitle,children:[c.jsx("strong",{children:B.name}),c.jsx("span",{className:He.typeBadge,"data-testid":`persona-type-badge-${B.id}`,children:fe?"Script":"Agent"}),oe&&c.jsx("span",{className:He.defaultBadge,"data-testid":`persona-default-badge-${B.id}`,children:"App Default"})]}),c.jsxs("div",{className:He.cardActions,children:[!oe&&c.jsx("button",{onClick:()=>f(B.id),className:He.btnSmall,"data-testid":`persona-set-default-${B.id}`,title:"Set as app default persona",children:"Set Default"}),c.jsx("button",{onClick:()=>X(B),className:He.btnSmall,children:"Edit"}),y===B.id?c.jsxs(c.Fragment,{children:[c.jsx("button",{onClick:()=>H(B.id),className:He.btnDanger,children:"Confirm"}),c.jsx("button",{onClick:()=>v(null),className:He.btnSmall,children:"Cancel"})]}):c.jsx("button",{onClick:()=>v(B.id),className:He.btnSmall,children:"Delete"})]})]}),B.description&&c.jsx("p",{className:He.description,children:B.description}),c.jsxs("div",{className:He.meta,children:[B.runtime&&c.jsxs("span",{children:["Runtime: ",B.runtime]}),B.model&&c.jsxs("span",{children:["Model: ",B.model]}),B.maxTurns>0&&c.jsxs("span",{children:["Max turns: ",B.maxTurns]})]}),fe?c.jsxs("details",{className:He.promptDetails,children:[c.jsx("summary",{children:"Script"}),c.jsx("pre",{className:He.promptText,children:B.script})]}):c.jsxs("details",{className:He.promptDetails,children:[c.jsx("summary",{children:"System Prompt"}),c.jsx("pre",{className:He.promptText,children:B.systemPrompt})]})]},B.id)})})]})}function xI(){return c.jsx(bI,{})}function _I(){const{themeId:n,resolvedThemeId:a,setTheme:i,preferSystem:l,setPreferSystem:r}=xb();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:xc.filter(f=>!f.hidden).map(f=>{const d=!!(f.variantLightId&&f.variantDarkId),p=d?n===f.id||n===f.variantLightId||n===f.variantDarkId:n===f.id,m=d&&a===f.variantLightId;return c.jsxs("button",{type:"button",className:`${de.themeOption} ${p?de.themeOptionSelected:""}`,"aria-pressed":p,onClick:()=>i(f.id),children:[c.jsxs("span",{className:de.themeOptionHeader,children:[c.jsxs("span",{children:[c.jsx("span",{className:de.themeOptionLabel,children:f.label}),c.jsx("span",{className:de.themeOptionDesc,children:f.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(f.variantLightId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(f.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(f.variantDarkId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(f.variantDarkId))},"aria-label":"Dark variant","aria-pressed":p&&!m,children:"☾"})]})]}),f.swatches&&c.jsx("span",{className:de.themeSwatches,children:f.swatches.map((g,y)=>c.jsx("span",{className:de.themeSwatch,style:{background:g}},y))})]},f.id)})}),c.jsxs("label",{className:de.systemToggle,children:[c.jsx("input",{type:"checkbox",checked:l,onChange:f=>r(f.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 SI(){return c.jsx(_I,{})}function TI(){const{connected:n,environments:a,sessions:i}=Je(),l=a.filter(d=>d.status==="connected").length,r=a.length,f=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} ${n?de.aboutDotConnected:de.aboutDotDisconnected}`}),n?"Connected":"Disconnected"]})]}),c.jsxs("div",{className:de.aboutItem,children:[c.jsx("span",{className:de.aboutLabel,children:"Environments"}),c.jsxs("span",{className:de.aboutValue,children:[l,"/",r," connected"]})]}),c.jsxs("div",{className:de.aboutItem,children:[c.jsx("span",{className:de.aboutLabel,children:"Active Sessions"}),c.jsx("span",{className:de.aboutValue,children:f})]}),c.jsxs("div",{className:de.aboutItem,children:[c.jsx("span",{className:de.aboutLabel,children:"Version"}),c.jsx("span",{className:de.aboutValue,children:"0.68.3"})]})]})]})}function CI(){return c.jsx(TI,{})}const kI="_wizard_1260s_1",EI="_container_1260s_10",NI="_stepContent_1260s_19",AI="_logoArea_1260s_28",wI="_logoImage_1260s_32",jI="_heading_1260s_41",DI="_tagline_1260s_49",MI="_subtitle_1260s_56",RI="_featureList_1260s_64",OI="_runtimeGrid_1260s_89",BI="_runtimeCard_1260s_101",II="_runtimeName_1260s_133",LI="_runtimeDescription_1260s_139",zI="_buttonRow_1260s_144",UI="_primaryButton_1260s_151",VI="_ghostButton_1260s_185",HI="_dots_1260s_213",GI="_dot_1260s_213",We={wizard:kI,container:EI,stepContent:NI,logoArea:AI,logoImage:wI,heading:jI,tagline:DI,subtitle:MI,featureList:RI,runtimeGrid:OI,runtimeCard:BI,runtimeName:II,runtimeDescription:LI,buttonRow:zI,primaryButton:UI,ghostButton:VI,dots:HI,dot:GI};function PI({onNext:n}){return c.jsxs("div",{className:We.stepContent,"data-testid":"setup-welcome",children:[c.jsx("div",{className:We.logoArea,children:c.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:We.logoImage})}),c.jsx("h1",{className:We.heading,children:"Welcome to Grackle"}),c.jsx("p",{className:We.tagline,children:"Multi-agent orchestration for software teams"}),c.jsx("button",{type:"button",className:We.primaryButton,onClick:n,"data-testid":"setup-get-started",children:"Get Started"})]})}function $I({onNext:n,onBack:a}){return c.jsxs("div",{className:We.stepContent,"data-testid":"setup-about",children:[c.jsx("h2",{className:We.heading,children:"What is Grackle?"}),c.jsxs("ul",{className:We.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:We.buttonRow,children:[c.jsx("button",{type:"button",className:We.ghostButton,onClick:a,children:"Back"}),c.jsx("button",{type:"button",className:We.primaryButton,onClick:n,"data-testid":"setup-about-next",children:"Next"})]})]})}const FI=[{id:"claude-code",name:"Claude Code",description:"Anthropic's agentic coding tool"},{id:"copilot",name:"Copilot Coding Agent",description:"GitHub's AI pair programmer"},{id:"codex",name:"Codex CLI",description:"OpenAI's coding agent"}];function qI({currentRuntime:n,onFinish:a,onBack:i,finishDisabled:l}){const[r,f]=b.useState(n||"claude-code");return b.useEffect(()=>{n&&f(n)},[n]),c.jsxs("div",{className:We.stepContent,"data-testid":"setup-runtime",children:[c.jsx("h2",{className:We.heading,children:"Choose Your Runtime"}),c.jsx("p",{className:We.subtitle,children:"Select the primary agent runtime for your workspace. You can change this later."}),c.jsx("div",{className:We.runtimeGrid,children:FI.map(d=>c.jsxs("button",{type:"button",className:We.runtimeCard,"data-selected":r===d.id,"aria-pressed":r===d.id,"data-testid":`runtime-card-${d.id}`,onClick:()=>f(d.id),children:[c.jsx("span",{className:We.runtimeName,children:d.name}),c.jsx("span",{className:We.runtimeDescription,children:d.description})]},d.id))}),c.jsxs("div",{className:We.buttonRow,children:[c.jsx("button",{type:"button",className:We.ghostButton,onClick:i,children:"Back"}),c.jsx("button",{type:"button",className:We.primaryButton,onClick:()=>a(r),disabled:l,"data-testid":"setup-finish",children:"Finish"})]})]})}const YI=3,q0={"claude-code":"sonnet",copilot:"gpt-4o",codex:"o3"};function KI(){const{personas:n,updatePersona:a,completeOnboarding:i,onboardingCompleted:l}=Je(),r=Ut(),[f,d]=b.useState(0),p=n.find(g=>g.id==="claude-code"),m=b.useCallback(g=>{if(p&&g!==p.runtime){const v=q0[g]??"sonnet";a(p.id,void 0,void 0,void 0,g,v)}const y=n.find(v=>v.id===E0);if(y&&g!==y.runtime){const v=q0[g]??"sonnet";a(E0,void 0,void 0,void 0,g,v)}i(),r("/",{replace:!0})},[p,n,a,i,r]);return l===!0?c.jsx(Ka,{to:"/",replace:!0}):c.jsx("div",{className:We.wizard,"data-testid":"setup-wizard",children:c.jsxs("div",{className:We.container,children:[c.jsx(qn,{mode:"wait",children:c.jsxs(St.div,{initial:{opacity:0,x:40},animate:{opacity:1,x:0},exit:{opacity:0,x:-40},transition:{duration:.2,ease:"easeInOut"},children:[f===0&&c.jsx(PI,{onNext:()=>d(1)}),f===1&&c.jsx($I,{onNext:()=>d(2),onBack:()=>d(0)}),f===2&&c.jsx(qI,{currentRuntime:(p==null?void 0:p.runtime)??"claude-code",onFinish:m,onBack:()=>d(1),finishDisabled:!p})]},f)}),c.jsx("div",{className:We.dots,children:Array.from({length:YI},(g,y)=>c.jsx("span",{className:We.dot,"data-active":y===f},y))})]})})}const ZI="_root_zndgp_1",XI="_body_zndgp_7",QI="_main_zndgp_19",WI="_sidebarWrapper_zndgp_26",JI="_overlay_zndgp_51",Yo={root:ZI,body:XI,main:QI,sidebarWrapper:WI,overlay:JI},eL=typeof window<"u"&&new URLSearchParams(window.location.search).has("mock");function tL(){const{lastSpawnedId:n,environments:a,connected:i,onboardingCompleted:l}=Je(),{showToast:r}=Pi();HM(a,r);const f=Ut(),d=At(),[p,m]=b.useState(!1),g=b.useCallback(()=>m(y=>!y),[]);return b.useEffect(()=>{m(!1)},[d.pathname]),b.useEffect(()=>{if(!p)return;const y=v=>{v.key==="Escape"&&m(!1)};return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[p]),b.useEffect(()=>{n&&!d.pathname.includes("/tasks/")&&f(fb(n),{replace:!0})},[n,f,d.pathname]),i&&l===!1?c.jsx(Ka,{to:"/setup",replace:!0}):c.jsxs("div",{className:Yo.root,children:[c.jsx(Rk,{onToggleSidebar:g,sidebarOpen:p}),c.jsx(Uk,{}),c.jsxs("div",{className:Yo.body,children:[c.jsx("div",{className:Yo.sidebarWrapper,"data-sidebar-open":p,children:c.jsx(aD,{})}),p&&c.jsx("div",{className:Yo.overlay,"data-testid":"drawer-overlay",onClick:()=>m(!1)}),c.jsxs("div",{className:Yo.main,children:[c.jsx(eh,{}),c.jsx(dD,{})]})]}),c.jsx(CD,{})]})}function nL(){return c.jsxs(oC,{children:[c.jsx(Be,{path:"setup",element:c.jsx(KI,{})}),c.jsxs(Be,{element:c.jsx(tL,{}),children:[c.jsx(Be,{index:!0,element:c.jsx(pO,{})}),c.jsx(Be,{path:"chat",element:c.jsx(PO,{})}),c.jsx(Be,{path:"tasks",element:c.jsx(fO,{})}),c.jsx(Be,{path:"tasks/new",element:c.jsx(V6,{})}),c.jsx(Be,{path:"tasks/:taskId",element:c.jsx(ki,{})}),c.jsx(Be,{path:"tasks/:taskId/stream",element:c.jsx(ki,{})}),c.jsx(Be,{path:"tasks/:taskId/findings",element:c.jsx(ki,{})}),c.jsx(Be,{path:"tasks/:taskId/edit",element:c.jsx(P0,{})}),c.jsx(Be,{path:"workspaces",element:c.jsx(Ka,{to:"/environments",replace:!0})}),c.jsx(Be,{path:"workspaces/:workspaceId",element:c.jsx(y6,{})}),c.jsx(Be,{path:"workspaces/:workspaceId/tasks/:taskId",element:c.jsx(ki,{})}),c.jsx(Be,{path:"workspaces/:workspaceId/tasks/:taskId/stream",element:c.jsx(ki,{})}),c.jsx(Be,{path:"workspaces/:workspaceId/tasks/:taskId/findings",element:c.jsx(ki,{})}),c.jsx(Be,{path:"workspaces/:workspaceId/tasks/:taskId/edit",element:c.jsx(P0,{})}),c.jsx(Be,{path:"sessions/new",element:c.jsx(XO,{})}),c.jsx(Be,{path:"sessions/:sessionId",element:c.jsx(JO,{})}),c.jsxs(Be,{path:"environments",element:c.jsx(A4,{}),children:[c.jsx(Be,{index:!0,element:c.jsx(hO,{})}),c.jsx(Be,{path:"new",element:c.jsx(T4,{})}),c.jsx(Be,{path:":environmentId",element:c.jsx(s5,{})}),c.jsx(Be,{path:":environmentId/edit",element:c.jsx(C4,{})})]}),c.jsxs(Be,{path:"settings",element:c.jsx(l5,{}),children:[c.jsx(Be,{index:!0,element:c.jsx(Ka,{to:"credentials",replace:!0})}),c.jsx(Be,{path:"environments",element:c.jsx(Ka,{to:"/environments",replace:!0})}),c.jsx(Be,{path:"credentials",element:c.jsx(K5,{})}),c.jsx(Be,{path:"tokens",element:c.jsx(Ka,{to:"../credentials",replace:!0})}),c.jsx(Be,{path:"personas",element:c.jsx(xI,{})}),c.jsx(Be,{path:"appearance",element:c.jsx(SI,{})}),c.jsx(Be,{path:"about",element:c.jsx(CI,{})})]}),c.jsx(Be,{path:"*",element:c.jsx(Ka,{to:"/",replace:!0})})]})]})}const aL=1e4;function sL(){const{onboardingCompleted:n}=Je(),[a,i]=b.useState(!1);b.useEffect(()=>{if(n!==void 0)return;const r=setTimeout(()=>i(!0),aL);return()=>clearTimeout(r)},[n]);const l=n===void 0&&!a;return c.jsx(qn,{mode:"wait",children:l?c.jsx(St.div,{initial:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:c.jsx(VM,{})},"splash"):c.jsx(St.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.25},style:{minHeight:"100vh"},children:c.jsx(DC,{children:c.jsx(nL,{})})},"app")})}function iL(){const n=eL?vk:rk;return c.jsx(Tk,{children:c.jsx(bk,{children:c.jsx(n,{children:c.jsx(sL,{})})})})}KS.createRoot(document.getElementById("root")).render(c.jsx(b.StrictMode,{children:c.jsx(iL,{})}));
|