@grackle-ai/web 0.31.1 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import{r as Z_,a as S,j as h,v as X_,b as Q_,t as Br,i as J_,f as W_,M as kf,c as Rf}from"./markdown-gcy1Jmzi.js";import{r as ex,d as hv,H as mv,P as pv,i as tx,B as nx,a as ax,C as sx,M as ix}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"]'))o(r);new MutationObserver(r=>{for(const u of r)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function l(r){const u={};return r.integrity&&(u.integrity=r.integrity),r.referrerPolicy&&(u.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?u.credentials="include":r.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(r){if(r.ep)return;r.ep=!0;const u=l(r);fetch(r.href,u)}})();var Nd={exports:{}},Pl={},wd={exports:{}},Dd={};/**
|
|
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 gv;function lx(){return gv||(gv=1,(function(n){function a(z,Y){var ee=z.length;z.push(Y);e:for(;0<ee;){var ke=ee-1>>>1,je=z[ke];if(0<r(je,Y))z[ke]=Y,z[ee]=je,ee=ke;else break e}}function l(z){return z.length===0?null:z[0]}function o(z){if(z.length===0)return null;var Y=z[0],ee=z.pop();if(ee!==Y){z[0]=ee;e:for(var ke=0,je=z.length,Pe=je>>>1;ke<Pe;){var we=2*(ke+1)-1,_e=z[we],Ce=we+1,Q=z[Ce];if(0>r(_e,ee))Ce<je&&0>r(Q,_e)?(z[ke]=Q,z[Ce]=ee,ke=Ce):(z[ke]=_e,z[we]=ee,ke=we);else if(Ce<je&&0>r(Q,ee))z[ke]=Q,z[Ce]=ee,ke=Ce;else break e}}return Y}function r(z,Y){var ee=z.sortIndex-Y.sortIndex;return ee!==0?ee:z.id-Y.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var d=Date,m=d.now();n.unstable_now=function(){return d.now()-m}}var p=[],g=[],v=1,b=null,x=3,T=!1,A=!1,j=!1,N=!1,C=typeof setTimeout=="function"?setTimeout:null,B=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function X(z){for(var Y=l(g);Y!==null;){if(Y.callback===null)o(g);else if(Y.startTime<=z)o(g),Y.sortIndex=Y.expirationTime,a(p,Y);else break;Y=l(g)}}function H(z){if(j=!1,X(z),!A)if(l(p)!==null)A=!0,J||(J=!0,pe());else{var Y=l(g);Y!==null&&q(H,Y.startTime-z)}}var J=!1,W=-1,F=5,ne=-1;function ge(){return N?!0:!(n.unstable_now()-ne<F)}function U(){if(N=!1,J){var z=n.unstable_now();ne=z;var Y=!0;try{e:{A=!1,j&&(j=!1,B(W),W=-1),T=!0;var ee=x;try{t:{for(X(z),b=l(p);b!==null&&!(b.expirationTime>z&&ge());){var ke=b.callback;if(typeof ke=="function"){b.callback=null,x=b.priorityLevel;var je=ke(b.expirationTime<=z);if(z=n.unstable_now(),typeof je=="function"){b.callback=je,X(z),Y=!0;break t}b===l(p)&&o(p),X(z)}else o(p);b=l(p)}if(b!==null)Y=!0;else{var Pe=l(g);Pe!==null&&q(H,Pe.startTime-z),Y=!1}}break e}finally{b=null,x=ee,T=!1}Y=void 0}}finally{Y?pe():J=!1}}}var pe;if(typeof R=="function")pe=function(){R(U)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,ye=te.port2;te.port1.onmessage=U,pe=function(){ye.postMessage(null)}}else pe=function(){C(U,0)};function q(z,Y){W=C(function(){z(n.unstable_now())},Y)}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(z){z.callback=null},n.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<z?Math.floor(1e3/z):5},n.unstable_getCurrentPriorityLevel=function(){return x},n.unstable_next=function(z){switch(x){case 1:case 2:case 3:var Y=3;break;default:Y=x}var ee=x;x=Y;try{return z()}finally{x=ee}},n.unstable_requestPaint=function(){N=!0},n.unstable_runWithPriority=function(z,Y){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var ee=x;x=z;try{return Y()}finally{x=ee}},n.unstable_scheduleCallback=function(z,Y,ee){var ke=n.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?ke+ee:ke):ee=ke,z){case 1:var je=-1;break;case 2:je=250;break;case 5:je=1073741823;break;case 4:je=1e4;break;default:je=5e3}return je=ee+je,z={id:v++,callback:Y,priorityLevel:z,startTime:ee,expirationTime:je,sortIndex:-1},ee>ke?(z.sortIndex=ee,a(g,z),l(p)===null&&z===l(g)&&(j?(B(W),W=-1):j=!0,q(H,ee-ke))):(z.sortIndex=je,a(p,z),A||T||(A=!0,J||(J=!0,pe()))),z},n.unstable_shouldYield=ge,n.unstable_wrapCallback=function(z){var Y=x;return function(){var ee=x;x=Y;try{return z.apply(this,arguments)}finally{x=ee}}}})(Dd)),Dd}var vv;function ox(){return vv||(vv=1,wd.exports=lx()),wd.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 yv;function rx(){if(yv)return Pl;yv=1;var n=ox(),a=Z_(),l=ex();function o(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 u(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function 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 m(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 p(e){if(u(e)!==e)throw Error(o(188))}function g(e){var t=e.alternate;if(!t){if(t=u(e),t===null)throw Error(o(188));return t!==e?null:e}for(var s=e,i=t;;){var c=s.return;if(c===null)break;var f=c.alternate;if(f===null){if(i=c.return,i!==null){s=i;continue}break}if(c.child===f.child){for(f=c.child;f;){if(f===s)return p(c),e;if(f===i)return p(c),t;f=f.sibling}throw Error(o(188))}if(s.return!==i.return)s=c,i=f;else{for(var y=!1,_=c.child;_;){if(_===s){y=!0,s=c,i=f;break}if(_===i){y=!0,i=c,s=f;break}_=_.sibling}if(!y){for(_=f.child;_;){if(_===s){y=!0,s=f,i=c;break}if(_===i){y=!0,i=f,s=c;break}_=_.sibling}if(!y)throw Error(o(189))}}if(s.alternate!==i)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,x=Symbol.for("react.element"),T=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),B=Symbol.for("react.consumer"),R=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),ne=Symbol.for("react.activity"),ge=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function pe(e){return e===null||typeof e!="object"?null:(e=U&&e[U]||e["@@iterator"],typeof e=="function"?e:null)}var te=Symbol.for("react.client.reference");function ye(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===te?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case j:return"Fragment";case C:return"Profiler";case N:return"StrictMode";case H:return"Suspense";case J:return"SuspenseList";case ne:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case A:return"Portal";case R:return e.displayName||"Context";case B:return(e._context.displayName||"Context")+".Consumer";case X:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case W:return t=e.displayName||null,t!==null?t:ye(e.type)||"Memo";case F:t=e._payload,e=e._init;try{return ye(e(t))}catch{}}return null}var q=Array.isArray,z=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},ke=[],je=-1;function Pe(e){return{current:e}}function we(e){0>je||(e.current=ke[je],ke[je]=null,je--)}function _e(e,t){je++,ke[je]=e.current,e.current=t}var Ce=Pe(null),Q=Pe(null),P=Pe(null),I=Pe(null);function De(e,t){switch(_e(P,t),_e(Q,e),_e(Ce,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Lg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Lg(t),e=zg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}we(Ce),_e(Ce,e)}function $e(){we(Ce),we(Q),we(P)}function vt(e){e.memoizedState!==null&&_e(I,e);var t=Ce.current,s=zg(t,e.type);t!==s&&(_e(Q,e),_e(Ce,s))}function xt(e){Q.current===e&&(we(Ce),we(Q)),I.current===e&&(we(I),Il._currentValue=ee)}var Gt,We;function Ze(e){if(Gt===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);Gt=t&&t[1]||"",We=-1<s.stack.indexOf(`
|
|
18
|
+
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
19
|
+
`+Gt+e+We}var ze=!1;function Sn(e,t){if(!e||ze)return"";ze=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var K=function(){throw Error()};if(Object.defineProperty(K.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(K,[])}catch(V){var L=V}Reflect.construct(e,[],K)}else{try{K.call()}catch(V){L=V}e.call(K.prototype)}}else{try{throw Error()}catch(V){L=V}(K=e())&&typeof K.catch=="function"&&K.catch(function(){})}}catch(V){if(V&&L&&typeof V.stack=="string")return[V.stack,L.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=i.DetermineComponentFrameRoot(),y=f[0],_=f[1];if(y&&_){var E=y.split(`
|
|
20
|
+
`),O=_.split(`
|
|
21
|
+
`);for(c=i=0;i<E.length&&!E[i].includes("DetermineComponentFrameRoot");)i++;for(;c<O.length&&!O[c].includes("DetermineComponentFrameRoot");)c++;if(i===E.length||c===O.length)for(i=E.length-1,c=O.length-1;1<=i&&0<=c&&E[i]!==O[c];)c--;for(;1<=i&&0<=c;i--,c--)if(E[i]!==O[c]){if(i!==1||c!==1)do if(i--,c--,0>c||E[i]!==O[c]){var G=`
|
|
22
|
+
`+E[i].replace(" at new "," at ");return e.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",e.displayName)),G}while(1<=i&&0<=c);break}}}finally{ze=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?Ze(s):""}function _n(e,t){switch(e.tag){case 26:case 27:case 5:return Ze(e.type);case 16:return Ze("Lazy");case 13:return e.child!==t&&t!==null?Ze("Suspense Fallback"):Ze("Suspense");case 19:return Ze("SuspenseList");case 0:case 15:return Sn(e.type,!1);case 11:return Sn(e.type.render,!1);case 1:return Sn(e.type,!0);case 31:return Ze("Activity");default:return""}}function Zn(e){try{var t="",s=null;do t+=_n(e,s),s=e,e=e.return;while(e);return t}catch(i){return`
|
|
23
|
+
Error generating stack: `+i.message+`
|
|
24
|
+
`+i.stack}}var an=Object.prototype.hasOwnProperty,Xn=n.unstable_scheduleCallback,Z=n.unstable_cancelCallback,le=n.unstable_shouldYield,ce=n.unstable_requestPaint,de=n.unstable_now,Te=n.unstable_getCurrentPriorityLevel,Ee=n.unstable_ImmediatePriority,et=n.unstable_UserBlockingPriority,Le=n.unstable_NormalPriority,ot=n.unstable_LowPriority,Dt=n.unstable_IdlePriority,Tt=n.log,Lt=n.unstable_setDisableYieldValue,rt=null,Et=null;function cn(e){if(typeof Tt=="function"&&Lt(e),Et&&typeof Et.setStrictMode=="function")try{Et.setStrictMode(rt,e)}catch{}}var yt=Math.clz32?Math.clz32:_s,$t=Math.log,Yt=Math.LN2;function _s(e){return e>>>=0,e===0?32:31-($t(e)/Yt|0)|0}var ae=256,Me=262144,be=4194304;function re(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 ie(e,t,s){var i=e.pendingLanes;if(i===0)return 0;var c=0,f=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var _=i&134217727;return _!==0?(i=_&~f,i!==0?c=re(i):(y&=_,y!==0?c=re(y):s||(s=_&~e,s!==0&&(c=re(s))))):(_=i&~f,_!==0?c=re(_):y!==0?c=re(y):s||(s=i&~e,s!==0&&(c=re(s)))),c===0?0:t!==0&&t!==c&&(t&f)===0&&(f=c&-c,s=t&-t,f>=s||f===32&&(s&4194048)!==0)?t:c}function se(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ct(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 Mn(){var e=be;return be<<=1,(be&62914560)===0&&(be=4194304),e}function Xs(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function Ia(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function _o(e,t,s,i,c,f){var y=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 _=e.entanglements,E=e.expirationTimes,O=e.hiddenUpdates;for(s=y&~s;0<s;){var G=31-yt(s),K=1<<G;_[G]=0,E[G]=-1;var L=O[G];if(L!==null)for(O[G]=null,G=0;G<L.length;G++){var V=L[G];V!==null&&(V.lane&=-536870913)}s&=~K}i!==0&&Ji(e,i,0),f!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=f&~(y&~t))}function Ji(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-yt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|s&261930}function Wi(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var i=31-yt(s),c=1<<i;c&t|e[i]&t&&(e[i]|=t),s&=~c}}function el(e,t){var s=t&-t;return s=(s&42)!==0?1:Qs(s),(s&(e.suspendedLanes|t))!==0?0:s}function Qs(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 Js(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function tl(){var e=Y.p;return e!==0?e:(e=window.event,e===void 0?32:lv(e.type))}function nl(e,t){var s=Y.p;try{return Y.p=e,t()}finally{Y.p=s}}var Qn=Math.random().toString(36).slice(2),zt="__reactFiber$"+Qn,Zt="__reactProps$"+Qn,ma="__reactContainer$"+Qn,Ws="__reactEvents$"+Qn,xo="__reactListeners$"+Qn,oe="__reactHandles$"+Qn,Fe="__reactResources$"+Qn,Be="__reactMarker$"+Qn;function Ie(e){delete e[zt],delete e[Zt],delete e[Ws],delete e[xo],delete e[oe]}function sn(e){var t=e[zt];if(t)return t;for(var s=e.parentNode;s;){if(t=s[ma]||s[zt]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=Pg(e);e!==null;){if(s=e[zt])return s;e=Pg(e)}return t}e=s,s=e.parentNode}return null}function Xt(e){if(e=e[zt]||e[ma]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function bt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function ht(e){var t=e[Fe];return t||(t=e[Fe]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function mt(e){e[Be]=!0}var Eh=new Set,Ch={};function xs(e,t){ei(e,t),ei(e+"Capture",t)}function ei(e,t){for(Ch[e]=t,e=0;e<t.length;e++)Eh.add(t[e])}var I1=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]*$"),Ah={},jh={};function H1(e){return an.call(jh,e)?!0:an.call(Ah,e)?!1:I1.test(e)?jh[e]=!0:(Ah[e]=!0,!1)}function To(e,t,s){if(H1(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+s)}}function Eo(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 pa(e,t,s,i){if(i===null)e.removeAttribute(s);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+i)}}function On(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Nh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function q1(e,t,s){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var c=i.get,f=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(y){s=""+y,f.call(this,y)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return s},setValue:function(y){s=""+y},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _c(e){if(!e._valueTracker){var t=Nh(e)?"checked":"value";e._valueTracker=q1(e,t,""+e[t])}}function wh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),i="";return e&&(i=Nh(e)?e.checked?"true":"false":e.value),e=i,e!==s?(t.setValue(e),!0):!1}function Co(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 G1=/[\n"\\]/g;function Bn(e){return e.replace(G1,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function xc(e,t,s,i,c,f,y,_){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),t!=null?y==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+On(t)):e.value!==""+On(t)&&(e.value=""+On(t)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),t!=null?Tc(e,y,On(t)):s!=null?Tc(e,y,On(s)):i!=null&&e.removeAttribute("value"),c==null&&f!=null&&(e.defaultChecked=!!f),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.name=""+On(_):e.removeAttribute("name")}function Dh(e,t,s,i,c,f,y,_){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||s!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){_c(e);return}s=s!=null?""+On(s):"",t=t!=null?""+On(t):s,_||t===e.value||(e.value=t),e.defaultValue=t}i=i??c,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=_?e.checked:!!i,e.defaultChecked=!!i,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y),_c(e)}function Tc(e,t,s){t==="number"&&Co(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function ti(e,t,s,i){if(e=e.options,t){t={};for(var c=0;c<s.length;c++)t["$"+s[c]]=!0;for(s=0;s<e.length;s++)c=t.hasOwnProperty("$"+e[s].value),e[s].selected!==c&&(e[s].selected=c),c&&i&&(e[s].defaultSelected=!0)}else{for(s=""+On(s),t=null,c=0;c<e.length;c++){if(e[c].value===s){e[c].selected=!0,i&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function kh(e,t,s){if(t!=null&&(t=""+On(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+On(s):""}function Rh(e,t,s,i){if(t==null){if(i!=null){if(s!=null)throw Error(o(92));if(q(i)){if(1<i.length)throw Error(o(93));i=i[0]}s=i}s==null&&(s=""),t=s}s=On(t),e.defaultValue=s,i=e.textContent,i===s&&i!==""&&i!==null&&(e.value=i),_c(e)}function ni(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var P1=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 Mh(e,t,s){var i=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,s):typeof s!="number"||s===0||P1.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function Oh(e,t,s){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,s!=null){for(var i in s)!s.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var c in t)i=t[c],t.hasOwnProperty(c)&&s[c]!==i&&Mh(e,c,i)}else for(var f in t)t.hasOwnProperty(f)&&Mh(e,f,t[f])}function Ec(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 F1=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"]]),$1=/^[\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 Ao(e){return $1.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ga(){}var Cc=null;function Ac(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ai=null,si=null;function Bh(e){var t=Xt(e);if(t&&(e=t.stateNode)){var s=e[Zt]||null;e:switch(e=t.stateNode,t.type){case"input":if(xc(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="'+Bn(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var i=s[t];if(i!==e&&i.form===e.form){var c=i[Zt]||null;if(!c)throw Error(o(90));xc(i,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<s.length;t++)i=s[t],i.form===e.form&&wh(i)}break e;case"textarea":kh(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&ti(e,!!s.multiple,t,!1)}}}var jc=!1;function Lh(e,t,s){if(jc)return e(t,s);jc=!0;try{var i=e(t);return i}finally{if(jc=!1,(ai!==null||si!==null)&&(hr(),ai&&(t=ai,e=si,si=ai=null,Bh(t),e)))for(t=0;t<e.length;t++)Bh(e[t])}}function al(e,t){var s=e.stateNode;if(s===null)return null;var i=s[Zt]||null;if(i===null)return null;s=i[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":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(o(231,t,typeof s));return s}var va=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Nc=!1;if(va)try{var sl={};Object.defineProperty(sl,"passive",{get:function(){Nc=!0}}),window.addEventListener("test",sl,sl),window.removeEventListener("test",sl,sl)}catch{Nc=!1}var Ha=null,wc=null,jo=null;function zh(){if(jo)return jo;var e,t=wc,s=t.length,i,c="value"in Ha?Ha.value:Ha.textContent,f=c.length;for(e=0;e<s&&t[e]===c[e];e++);var y=s-e;for(i=1;i<=y&&t[s-i]===c[f-i];i++);return jo=c.slice(e,1<i?1-i:void 0)}function No(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 wo(){return!0}function Uh(){return!1}function mn(e){function t(s,i,c,f,y){this._reactName=s,this._targetInst=c,this.type=i,this.nativeEvent=f,this.target=y,this.currentTarget=null;for(var _ in e)e.hasOwnProperty(_)&&(s=e[_],this[_]=s?s(f):f[_]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?wo:Uh,this.isPropagationStopped=Uh,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=wo)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=wo)},persist:function(){},isPersistent:wo}),t}var Ts={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Do=mn(Ts),il=b({},Ts,{view:0,detail:0}),Y1=mn(il),Dc,kc,ll,ko=b({},il,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mc,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!==ll&&(ll&&e.type==="mousemove"?(Dc=e.screenX-ll.screenX,kc=e.screenY-ll.screenY):kc=Dc=0,ll=e),Dc)},movementY:function(e){return"movementY"in e?e.movementY:kc}}),Vh=mn(ko),K1=b({},ko,{dataTransfer:0}),Z1=mn(K1),X1=b({},il,{relatedTarget:0}),Rc=mn(X1),Q1=b({},Ts,{animationName:0,elapsedTime:0,pseudoElement:0}),J1=mn(Q1),W1=b({},Ts,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),eS=mn(W1),tS=b({},Ts,{data:0}),Ih=mn(tS),nS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},aS={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"},sS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function iS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=sS[e])?!!t[e]:!1}function Mc(){return iS}var lS=b({},il,{key:function(e){if(e.key){var t=nS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=No(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?aS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mc,charCode:function(e){return e.type==="keypress"?No(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?No(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),oS=mn(lS),rS=b({},ko,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Hh=mn(rS),cS=b({},il,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mc}),uS=mn(cS),dS=b({},Ts,{propertyName:0,elapsedTime:0,pseudoElement:0}),fS=mn(dS),hS=b({},ko,{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}),mS=mn(hS),pS=b({},Ts,{newState:0,oldState:0}),gS=mn(pS),vS=[9,13,27,32],Oc=va&&"CompositionEvent"in window,ol=null;va&&"documentMode"in document&&(ol=document.documentMode);var yS=va&&"TextEvent"in window&&!ol,qh=va&&(!Oc||ol&&8<ol&&11>=ol),Gh=" ",Ph=!1;function Fh(e,t){switch(e){case"keyup":return vS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $h(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ii=!1;function bS(e,t){switch(e){case"compositionend":return $h(t);case"keypress":return t.which!==32?null:(Ph=!0,Gh);case"textInput":return e=t.data,e===Gh&&Ph?null:e;default:return null}}function SS(e,t){if(ii)return e==="compositionend"||!Oc&&Fh(e,t)?(e=zh(),jo=wc=Ha=null,ii=!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 qh&&t.locale!=="ko"?null:t.data;default:return null}}var _S={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 Yh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!_S[e.type]:t==="textarea"}function Kh(e,t,s,i){ai?si?si.push(i):si=[i]:ai=i,t=Sr(t,"onChange"),0<t.length&&(s=new Do("onChange","change",null,s,i),e.push({event:s,listeners:t}))}var rl=null,cl=null;function xS(e){Dg(e,0)}function Ro(e){var t=bt(e);if(wh(t))return e}function Zh(e,t){if(e==="change")return t}var Xh=!1;if(va){var Bc;if(va){var Lc="oninput"in document;if(!Lc){var Qh=document.createElement("div");Qh.setAttribute("oninput","return;"),Lc=typeof Qh.oninput=="function"}Bc=Lc}else Bc=!1;Xh=Bc&&(!document.documentMode||9<document.documentMode)}function Jh(){rl&&(rl.detachEvent("onpropertychange",Wh),cl=rl=null)}function Wh(e){if(e.propertyName==="value"&&Ro(cl)){var t=[];Kh(t,cl,e,Ac(e)),Lh(xS,t)}}function TS(e,t,s){e==="focusin"?(Jh(),rl=t,cl=s,rl.attachEvent("onpropertychange",Wh)):e==="focusout"&&Jh()}function ES(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ro(cl)}function CS(e,t){if(e==="click")return Ro(t)}function AS(e,t){if(e==="input"||e==="change")return Ro(t)}function jS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var xn=typeof Object.is=="function"?Object.is:jS;function ul(e,t){if(xn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),i=Object.keys(t);if(s.length!==i.length)return!1;for(i=0;i<s.length;i++){var c=s[i];if(!an.call(t,c)||!xn(e[c],t[c]))return!1}return!0}function em(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function tm(e,t){var s=em(e);e=0;for(var i;s;){if(s.nodeType===3){if(i=e+s.textContent.length,e<=t&&i>=t)return{node:s,offset:t-e};e=i}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=em(s)}}function nm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?nm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function am(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Co(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=Co(e.document)}return t}function zc(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 NS=va&&"documentMode"in document&&11>=document.documentMode,li=null,Uc=null,dl=null,Vc=!1;function sm(e,t,s){var i=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Vc||li==null||li!==Co(i)||(i=li,"selectionStart"in i&&zc(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),dl&&ul(dl,i)||(dl=i,i=Sr(Uc,"onSelect"),0<i.length&&(t=new Do("onSelect","select",null,t,s),e.push({event:t,listeners:i}),t.target=li)))}function Es(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var oi={animationend:Es("Animation","AnimationEnd"),animationiteration:Es("Animation","AnimationIteration"),animationstart:Es("Animation","AnimationStart"),transitionrun:Es("Transition","TransitionRun"),transitionstart:Es("Transition","TransitionStart"),transitioncancel:Es("Transition","TransitionCancel"),transitionend:Es("Transition","TransitionEnd")},Ic={},im={};va&&(im=document.createElement("div").style,"AnimationEvent"in window||(delete oi.animationend.animation,delete oi.animationiteration.animation,delete oi.animationstart.animation),"TransitionEvent"in window||delete oi.transitionend.transition);function Cs(e){if(Ic[e])return Ic[e];if(!oi[e])return e;var t=oi[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in im)return Ic[e]=t[s];return e}var lm=Cs("animationend"),om=Cs("animationiteration"),rm=Cs("animationstart"),wS=Cs("transitionrun"),DS=Cs("transitionstart"),kS=Cs("transitioncancel"),cm=Cs("transitionend"),um=new Map,Hc="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(" ");Hc.push("scrollEnd");function Jn(e,t){um.set(e,t),xs(t,[e])}var Mo=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)},Ln=[],ri=0,qc=0;function Oo(){for(var e=ri,t=qc=ri=0;t<e;){var s=Ln[t];Ln[t++]=null;var i=Ln[t];Ln[t++]=null;var c=Ln[t];Ln[t++]=null;var f=Ln[t];if(Ln[t++]=null,i!==null&&c!==null){var y=i.pending;y===null?c.next=c:(c.next=y.next,y.next=c),i.pending=c}f!==0&&dm(s,c,f)}}function Bo(e,t,s,i){Ln[ri++]=e,Ln[ri++]=t,Ln[ri++]=s,Ln[ri++]=i,qc|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function Gc(e,t,s,i){return Bo(e,t,s,i),Lo(e)}function As(e,t){return Bo(e,null,null,t),Lo(e)}function dm(e,t,s){e.lanes|=s;var i=e.alternate;i!==null&&(i.lanes|=s);for(var c=!1,f=e.return;f!==null;)f.childLanes|=s,i=f.alternate,i!==null&&(i.childLanes|=s),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(c=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,c&&t!==null&&(c=31-yt(s),e=f.hiddenUpdates,i=e[c],i===null?e[c]=[t]:i.push(t),t.lane=s|536870912),f):null}function Lo(e){if(50<Ml)throw Ml=0,Ju=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ci={};function RS(e,t,s,i){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=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tn(e,t,s,i){return new RS(e,t,s,i)}function Pc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ya(e,t){var s=e.alternate;return s===null?(s=Tn(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 fm(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 zo(e,t,s,i,c,f){var y=0;if(i=e,typeof e=="function")Pc(e)&&(y=1);else if(typeof e=="string")y=z_(e,s,Ce.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ne:return e=Tn(31,s,t,c),e.elementType=ne,e.lanes=f,e;case j:return js(s.children,c,f,t);case N:y=8,c|=24;break;case C:return e=Tn(12,s,t,c|2),e.elementType=C,e.lanes=f,e;case H:return e=Tn(13,s,t,c),e.elementType=H,e.lanes=f,e;case J:return e=Tn(19,s,t,c),e.elementType=J,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case R:y=10;break e;case B:y=9;break e;case X:y=11;break e;case W:y=14;break e;case F:y=16,i=null;break e}y=29,s=Error(o(130,e===null?"null":typeof e,"")),i=null}return t=Tn(y,s,t,c),t.elementType=e,t.type=i,t.lanes=f,t}function js(e,t,s,i){return e=Tn(7,e,i,t),e.lanes=s,e}function Fc(e,t,s){return e=Tn(6,e,null,t),e.lanes=s,e}function hm(e){var t=Tn(18,null,null,0);return t.stateNode=e,t}function $c(e,t,s){return t=Tn(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var mm=new WeakMap;function zn(e,t){if(typeof e=="object"&&e!==null){var s=mm.get(e);return s!==void 0?s:(t={value:e,source:t,stack:Zn(t)},mm.set(e,t),t)}return{value:e,source:t,stack:Zn(t)}}var ui=[],di=0,Uo=null,fl=0,Un=[],Vn=0,qa=null,aa=1,sa="";function ba(e,t){ui[di++]=fl,ui[di++]=Uo,Uo=e,fl=t}function pm(e,t,s){Un[Vn++]=aa,Un[Vn++]=sa,Un[Vn++]=qa,qa=e;var i=aa;e=sa;var c=32-yt(i)-1;i&=~(1<<c),s+=1;var f=32-yt(t)+c;if(30<f){var y=c-c%5;f=(i&(1<<y)-1).toString(32),i>>=y,c-=y,aa=1<<32-yt(t)+c|s<<c|i,sa=f+e}else aa=1<<f|s<<c|i,sa=e}function Yc(e){e.return!==null&&(ba(e,1),pm(e,1,0))}function Kc(e){for(;e===Uo;)Uo=ui[--di],ui[di]=null,fl=ui[--di],ui[di]=null;for(;e===qa;)qa=Un[--Vn],Un[Vn]=null,sa=Un[--Vn],Un[Vn]=null,aa=Un[--Vn],Un[Vn]=null}function gm(e,t){Un[Vn++]=aa,Un[Vn++]=sa,Un[Vn++]=qa,aa=t.id,sa=t.overflow,qa=e}var Qt=null,ct=null,Ge=!1,Ga=null,In=!1,Zc=Error(o(519));function Pa(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw hl(zn(t,e)),Zc}function vm(e){var t=e.stateNode,s=e.type,i=e.memoizedProps;switch(t[zt]=e,t[Zt]=i,s){case"dialog":Ve("cancel",t),Ve("close",t);break;case"iframe":case"object":case"embed":Ve("load",t);break;case"video":case"audio":for(s=0;s<Bl.length;s++)Ve(Bl[s],t);break;case"source":Ve("error",t);break;case"img":case"image":case"link":Ve("error",t),Ve("load",t);break;case"details":Ve("toggle",t);break;case"input":Ve("invalid",t),Dh(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":Ve("invalid",t);break;case"textarea":Ve("invalid",t),Rh(t,i.value,i.defaultValue,i.children)}s=i.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||i.suppressHydrationWarning===!0||Og(t.textContent,s)?(i.popover!=null&&(Ve("beforetoggle",t),Ve("toggle",t)),i.onScroll!=null&&Ve("scroll",t),i.onScrollEnd!=null&&Ve("scrollend",t),i.onClick!=null&&(t.onclick=ga),t=!0):t=!1,t||Pa(e,!0)}function ym(e){for(Qt=e.return;Qt;)switch(Qt.tag){case 5:case 31:case 13:In=!1;return;case 27:case 3:In=!0;return;default:Qt=Qt.return}}function fi(e){if(e!==Qt)return!1;if(!Ge)return ym(e),Ge=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||hd(e.type,e.memoizedProps)),s=!s),s&&ct&&Pa(e),ym(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));ct=Gg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));ct=Gg(e)}else t===27?(t=ct,ss(e.type)?(e=yd,yd=null,ct=e):ct=t):ct=Qt?qn(e.stateNode.nextSibling):null;return!0}function Ns(){ct=Qt=null,Ge=!1}function Xc(){var e=Ga;return e!==null&&(yn===null?yn=e:yn.push.apply(yn,e),Ga=null),e}function hl(e){Ga===null?Ga=[e]:Ga.push(e)}var Qc=Pe(null),ws=null,Sa=null;function Fa(e,t,s){_e(Qc,t._currentValue),t._currentValue=s}function _a(e){e._currentValue=Qc.current,we(Qc)}function Jc(e,t,s){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===s)break;e=e.return}}function Wc(e,t,s,i){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var f=c.dependencies;if(f!==null){var y=c.child;f=f.firstContext;e:for(;f!==null;){var _=f;f=c;for(var E=0;E<t.length;E++)if(_.context===t[E]){f.lanes|=s,_=f.alternate,_!==null&&(_.lanes|=s),Jc(f.return,s,e),i||(y=null);break e}f=_.next}}else if(c.tag===18){if(y=c.return,y===null)throw Error(o(341));y.lanes|=s,f=y.alternate,f!==null&&(f.lanes|=s),Jc(y,s,e),y=null}else y=c.child;if(y!==null)y.return=c;else for(y=c;y!==null;){if(y===e){y=null;break}if(c=y.sibling,c!==null){c.return=y.return,y=c;break}y=y.return}c=y}}function hi(e,t,s,i){e=null;for(var c=t,f=!1;c!==null;){if(!f){if((c.flags&524288)!==0)f=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var y=c.alternate;if(y===null)throw Error(o(387));if(y=y.memoizedProps,y!==null){var _=c.type;xn(c.pendingProps.value,y.value)||(e!==null?e.push(_):e=[_])}}else if(c===I.current){if(y=c.alternate,y===null)throw Error(o(387));y.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(Il):e=[Il])}c=c.return}e!==null&&Wc(t,e,s,i),t.flags|=262144}function Vo(e){for(e=e.firstContext;e!==null;){if(!xn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ds(e){ws=e,Sa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Jt(e){return bm(ws,e)}function Io(e,t){return ws===null&&Ds(e),bm(e,t)}function bm(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},Sa===null){if(e===null)throw Error(o(308));Sa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Sa=Sa.next=t;return s}var MS=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},OS=n.unstable_scheduleCallback,BS=n.unstable_NormalPriority,Ut={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function eu(){return{controller:new MS,data:new Map,refCount:0}}function ml(e){e.refCount--,e.refCount===0&&OS(BS,function(){e.controller.abort()})}var pl=null,tu=0,mi=0,pi=null;function LS(e,t){if(pl===null){var s=pl=[];tu=0,mi=sd(),pi={status:"pending",value:void 0,then:function(i){s.push(i)}}}return tu++,t.then(Sm,Sm),t}function Sm(){if(--tu===0&&pl!==null){pi!==null&&(pi.status="fulfilled");var e=pl;pl=null,mi=0,pi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function zS(e,t){var s=[],i={status:"pending",value:null,reason:null,then:function(c){s.push(c)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var c=0;c<s.length;c++)(0,s[c])(t)},function(c){for(i.status="rejected",i.reason=c,c=0;c<s.length;c++)(0,s[c])(void 0)}),i}var _m=z.S;z.S=function(e,t){sg=de(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&LS(e,t),_m!==null&&_m(e,t)};var ks=Pe(null);function nu(){var e=ks.current;return e!==null?e:lt.pooledCache}function Ho(e,t){t===null?_e(ks,ks.current):_e(ks,t.pool)}function xm(){var e=nu();return e===null?null:{parent:Ut._currentValue,pool:e}}var gi=Error(o(460)),au=Error(o(474)),qo=Error(o(542)),Go={then:function(){}};function Tm(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(ga,ga),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Am(e),e;default:if(typeof t.status=="string")t.then(ga,ga);else{if(e=lt,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=i}},function(i){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Am(e),e}throw Ms=t,gi}}function Rs(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Ms=s,gi):s}}var Ms=null;function Cm(){if(Ms===null)throw Error(o(459));var e=Ms;return Ms=null,e}function Am(e){if(e===gi||e===qo)throw Error(o(483))}var vi=null,gl=0;function Po(e){var t=gl;return gl+=1,vi===null&&(vi=[]),Em(vi,e,t)}function vl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Fo(e,t){throw t.$$typeof===x?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function jm(e){function t(k,w){if(e){var M=k.deletions;M===null?(k.deletions=[w],k.flags|=16):M.push(w)}}function s(k,w){if(!e)return null;for(;w!==null;)t(k,w),w=w.sibling;return null}function i(k){for(var w=new Map;k!==null;)k.key!==null?w.set(k.key,k):w.set(k.index,k),k=k.sibling;return w}function c(k,w){return k=ya(k,w),k.index=0,k.sibling=null,k}function f(k,w,M){return k.index=M,e?(M=k.alternate,M!==null?(M=M.index,M<w?(k.flags|=67108866,w):M):(k.flags|=67108866,w)):(k.flags|=1048576,w)}function y(k){return e&&k.alternate===null&&(k.flags|=67108866),k}function _(k,w,M,$){return w===null||w.tag!==6?(w=Fc(M,k.mode,$),w.return=k,w):(w=c(w,M),w.return=k,w)}function E(k,w,M,$){var ve=M.type;return ve===j?G(k,w,M.props.children,$,M.key):w!==null&&(w.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===F&&Rs(ve)===w.type)?(w=c(w,M.props),vl(w,M),w.return=k,w):(w=zo(M.type,M.key,M.props,null,k.mode,$),vl(w,M),w.return=k,w)}function O(k,w,M,$){return w===null||w.tag!==4||w.stateNode.containerInfo!==M.containerInfo||w.stateNode.implementation!==M.implementation?(w=$c(M,k.mode,$),w.return=k,w):(w=c(w,M.children||[]),w.return=k,w)}function G(k,w,M,$,ve){return w===null||w.tag!==7?(w=js(M,k.mode,$,ve),w.return=k,w):(w=c(w,M),w.return=k,w)}function K(k,w,M){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return w=Fc(""+w,k.mode,M),w.return=k,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case T:return M=zo(w.type,w.key,w.props,null,k.mode,M),vl(M,w),M.return=k,M;case A:return w=$c(w,k.mode,M),w.return=k,w;case F:return w=Rs(w),K(k,w,M)}if(q(w)||pe(w))return w=js(w,k.mode,M,null),w.return=k,w;if(typeof w.then=="function")return K(k,Po(w),M);if(w.$$typeof===R)return K(k,Io(k,w),M);Fo(k,w)}return null}function L(k,w,M,$){var ve=w!==null?w.key:null;if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return ve!==null?null:_(k,w,""+M,$);if(typeof M=="object"&&M!==null){switch(M.$$typeof){case T:return M.key===ve?E(k,w,M,$):null;case A:return M.key===ve?O(k,w,M,$):null;case F:return M=Rs(M),L(k,w,M,$)}if(q(M)||pe(M))return ve!==null?null:G(k,w,M,$,null);if(typeof M.then=="function")return L(k,w,Po(M),$);if(M.$$typeof===R)return L(k,w,Io(k,M),$);Fo(k,M)}return null}function V(k,w,M,$,ve){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return k=k.get(M)||null,_(w,k,""+$,ve);if(typeof $=="object"&&$!==null){switch($.$$typeof){case T:return k=k.get($.key===null?M:$.key)||null,E(w,k,$,ve);case A:return k=k.get($.key===null?M:$.key)||null,O(w,k,$,ve);case F:return $=Rs($),V(k,w,M,$,ve)}if(q($)||pe($))return k=k.get(M)||null,G(w,k,$,ve,null);if(typeof $.then=="function")return V(k,w,M,Po($),ve);if($.$$typeof===R)return V(k,w,M,Io(w,$),ve);Fo(w,$)}return null}function ue(k,w,M,$){for(var ve=null,Ye=null,me=w,Oe=w=0,qe=null;me!==null&&Oe<M.length;Oe++){me.index>Oe?(qe=me,me=null):qe=me.sibling;var Ke=L(k,me,M[Oe],$);if(Ke===null){me===null&&(me=qe);break}e&&me&&Ke.alternate===null&&t(k,me),w=f(Ke,w,Oe),Ye===null?ve=Ke:Ye.sibling=Ke,Ye=Ke,me=qe}if(Oe===M.length)return s(k,me),Ge&&ba(k,Oe),ve;if(me===null){for(;Oe<M.length;Oe++)me=K(k,M[Oe],$),me!==null&&(w=f(me,w,Oe),Ye===null?ve=me:Ye.sibling=me,Ye=me);return Ge&&ba(k,Oe),ve}for(me=i(me);Oe<M.length;Oe++)qe=V(me,k,Oe,M[Oe],$),qe!==null&&(e&&qe.alternate!==null&&me.delete(qe.key===null?Oe:qe.key),w=f(qe,w,Oe),Ye===null?ve=qe:Ye.sibling=qe,Ye=qe);return e&&me.forEach(function(cs){return t(k,cs)}),Ge&&ba(k,Oe),ve}function Se(k,w,M,$){if(M==null)throw Error(o(151));for(var ve=null,Ye=null,me=w,Oe=w=0,qe=null,Ke=M.next();me!==null&&!Ke.done;Oe++,Ke=M.next()){me.index>Oe?(qe=me,me=null):qe=me.sibling;var cs=L(k,me,Ke.value,$);if(cs===null){me===null&&(me=qe);break}e&&me&&cs.alternate===null&&t(k,me),w=f(cs,w,Oe),Ye===null?ve=cs:Ye.sibling=cs,Ye=cs,me=qe}if(Ke.done)return s(k,me),Ge&&ba(k,Oe),ve;if(me===null){for(;!Ke.done;Oe++,Ke=M.next())Ke=K(k,Ke.value,$),Ke!==null&&(w=f(Ke,w,Oe),Ye===null?ve=Ke:Ye.sibling=Ke,Ye=Ke);return Ge&&ba(k,Oe),ve}for(me=i(me);!Ke.done;Oe++,Ke=M.next())Ke=V(me,k,Oe,Ke.value,$),Ke!==null&&(e&&Ke.alternate!==null&&me.delete(Ke.key===null?Oe:Ke.key),w=f(Ke,w,Oe),Ye===null?ve=Ke:Ye.sibling=Ke,Ye=Ke);return e&&me.forEach(function(K_){return t(k,K_)}),Ge&&ba(k,Oe),ve}function it(k,w,M,$){if(typeof M=="object"&&M!==null&&M.type===j&&M.key===null&&(M=M.props.children),typeof M=="object"&&M!==null){switch(M.$$typeof){case T:e:{for(var ve=M.key;w!==null;){if(w.key===ve){if(ve=M.type,ve===j){if(w.tag===7){s(k,w.sibling),$=c(w,M.props.children),$.return=k,k=$;break e}}else if(w.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===F&&Rs(ve)===w.type){s(k,w.sibling),$=c(w,M.props),vl($,M),$.return=k,k=$;break e}s(k,w);break}else t(k,w);w=w.sibling}M.type===j?($=js(M.props.children,k.mode,$,M.key),$.return=k,k=$):($=zo(M.type,M.key,M.props,null,k.mode,$),vl($,M),$.return=k,k=$)}return y(k);case A:e:{for(ve=M.key;w!==null;){if(w.key===ve)if(w.tag===4&&w.stateNode.containerInfo===M.containerInfo&&w.stateNode.implementation===M.implementation){s(k,w.sibling),$=c(w,M.children||[]),$.return=k,k=$;break e}else{s(k,w);break}else t(k,w);w=w.sibling}$=$c(M,k.mode,$),$.return=k,k=$}return y(k);case F:return M=Rs(M),it(k,w,M,$)}if(q(M))return ue(k,w,M,$);if(pe(M)){if(ve=pe(M),typeof ve!="function")throw Error(o(150));return M=ve.call(M),Se(k,w,M,$)}if(typeof M.then=="function")return it(k,w,Po(M),$);if(M.$$typeof===R)return it(k,w,Io(k,M),$);Fo(k,M)}return typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint"?(M=""+M,w!==null&&w.tag===6?(s(k,w.sibling),$=c(w,M),$.return=k,k=$):(s(k,w),$=Fc(M,k.mode,$),$.return=k,k=$),y(k)):s(k,w)}return function(k,w,M,$){try{gl=0;var ve=it(k,w,M,$);return vi=null,ve}catch(me){if(me===gi||me===qo)throw me;var Ye=Tn(29,me,null,k.mode);return Ye.lanes=$,Ye.return=k,Ye}finally{}}}var Os=jm(!0),Nm=jm(!1),$a=!1;function su(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function iu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ya(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ka(e,t,s){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Xe&2)!==0){var c=i.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),i.pending=t,t=Lo(e),dm(e,null,s),t}return Bo(e,i,t,s),Lo(e)}function yl(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,s|=i,t.lanes=s,Wi(e,s)}}function lu(e,t){var s=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,s===i)){var c=null,f=null;if(s=s.firstBaseUpdate,s!==null){do{var y={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};f===null?c=f=y:f=f.next=y,s=s.next}while(s!==null);f===null?c=f=t:f=f.next=t}else c=f=t;s={baseState:i.baseState,firstBaseUpdate:c,lastBaseUpdate:f,shared:i.shared,callbacks:i.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var ou=!1;function bl(){if(ou){var e=pi;if(e!==null)throw e}}function Sl(e,t,s,i){ou=!1;var c=e.updateQueue;$a=!1;var f=c.firstBaseUpdate,y=c.lastBaseUpdate,_=c.shared.pending;if(_!==null){c.shared.pending=null;var E=_,O=E.next;E.next=null,y===null?f=O:y.next=O,y=E;var G=e.alternate;G!==null&&(G=G.updateQueue,_=G.lastBaseUpdate,_!==y&&(_===null?G.firstBaseUpdate=O:_.next=O,G.lastBaseUpdate=E))}if(f!==null){var K=c.baseState;y=0,G=O=E=null,_=f;do{var L=_.lane&-536870913,V=L!==_.lane;if(V?(He&L)===L:(i&L)===L){L!==0&&L===mi&&(ou=!0),G!==null&&(G=G.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var ue=e,Se=_;L=t;var it=s;switch(Se.tag){case 1:if(ue=Se.payload,typeof ue=="function"){K=ue.call(it,K,L);break e}K=ue;break e;case 3:ue.flags=ue.flags&-65537|128;case 0:if(ue=Se.payload,L=typeof ue=="function"?ue.call(it,K,L):ue,L==null)break e;K=b({},K,L);break e;case 2:$a=!0}}L=_.callback,L!==null&&(e.flags|=64,V&&(e.flags|=8192),V=c.callbacks,V===null?c.callbacks=[L]:V.push(L))}else V={lane:L,tag:_.tag,payload:_.payload,callback:_.callback,next:null},G===null?(O=G=V,E=K):G=G.next=V,y|=L;if(_=_.next,_===null){if(_=c.shared.pending,_===null)break;V=_,_=V.next,V.next=null,c.lastBaseUpdate=V,c.shared.pending=null}}while(!0);G===null&&(E=K),c.baseState=E,c.firstBaseUpdate=O,c.lastBaseUpdate=G,f===null&&(c.shared.lanes=0),Wa|=y,e.lanes=y,e.memoizedState=K}}function wm(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Dm(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)wm(s[e],t)}var yi=Pe(null),$o=Pe(0);function km(e,t){e=Da,_e($o,e),_e(yi,t),Da=e|t.baseLanes}function ru(){_e($o,Da),_e(yi,yi.current)}function cu(){Da=$o.current,we(yi),we($o)}var En=Pe(null),Hn=null;function Za(e){var t=e.alternate;_e(kt,kt.current&1),_e(En,e),Hn===null&&(t===null||yi.current!==null||t.memoizedState!==null)&&(Hn=e)}function uu(e){_e(kt,kt.current),_e(En,e),Hn===null&&(Hn=e)}function Rm(e){e.tag===22?(_e(kt,kt.current),_e(En,e),Hn===null&&(Hn=e)):Xa()}function Xa(){_e(kt,kt.current),_e(En,En.current)}function Cn(e){we(En),Hn===e&&(Hn=null),we(kt)}var kt=Pe(0);function Yo(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||gd(s)||vd(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 xa=0,Re=null,at=null,Vt=null,Ko=!1,bi=!1,Bs=!1,Zo=0,_l=0,Si=null,US=0;function At(){throw Error(o(321))}function du(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!xn(e[s],t[s]))return!1;return!0}function fu(e,t,s,i,c,f){return xa=f,Re=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,z.H=e===null||e.memoizedState===null?pp:ju,Bs=!1,f=s(i,c),Bs=!1,bi&&(f=Om(t,s,i,c)),Mm(e),f}function Mm(e){z.H=El;var t=at!==null&&at.next!==null;if(xa=0,Vt=at=Re=null,Ko=!1,_l=0,Si=null,t)throw Error(o(300));e===null||It||(e=e.dependencies,e!==null&&Vo(e)&&(It=!0))}function Om(e,t,s,i){Re=e;var c=0;do{if(bi&&(Si=null),_l=0,bi=!1,25<=c)throw Error(o(301));if(c+=1,Vt=at=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}z.H=gp,f=t(s,i)}while(bi);return f}function VS(){var e=z.H,t=e.useState()[0];return t=typeof t.then=="function"?xl(t):t,e=e.useState()[0],(at!==null?at.memoizedState:null)!==e&&(Re.flags|=1024),t}function hu(){var e=Zo!==0;return Zo=0,e}function mu(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function pu(e){if(Ko){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ko=!1}xa=0,Vt=at=Re=null,bi=!1,_l=Zo=0,Si=null}function un(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vt===null?Re.memoizedState=Vt=e:Vt=Vt.next=e,Vt}function Rt(){if(at===null){var e=Re.alternate;e=e!==null?e.memoizedState:null}else e=at.next;var t=Vt===null?Re.memoizedState:Vt.next;if(t!==null)Vt=t,at=e;else{if(e===null)throw Re.alternate===null?Error(o(467)):Error(o(310));at=e,e={memoizedState:at.memoizedState,baseState:at.baseState,baseQueue:at.baseQueue,queue:at.queue,next:null},Vt===null?Re.memoizedState=Vt=e:Vt=Vt.next=e}return Vt}function Xo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xl(e){var t=_l;return _l+=1,Si===null&&(Si=[]),e=Em(Si,e,t),t=Re,(Vt===null?t.memoizedState:Vt.next)===null&&(t=t.alternate,z.H=t===null||t.memoizedState===null?pp:ju),e}function Qo(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return xl(e);if(e.$$typeof===R)return Jt(e)}throw Error(o(438,String(e)))}function gu(e){var t=null,s=Re.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var i=Re.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=Xo(),Re.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),i=0;i<e;i++)s[i]=ge;return t.index++,s}function Ta(e,t){return typeof t=="function"?t(e):t}function Jo(e){var t=Rt();return vu(t,at,e)}function vu(e,t,s){var i=e.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=s;var c=e.baseQueue,f=i.pending;if(f!==null){if(c!==null){var y=c.next;c.next=f.next,f.next=y}t.baseQueue=c=f,i.pending=null}if(f=e.baseState,c===null)e.memoizedState=f;else{t=c.next;var _=y=null,E=null,O=t,G=!1;do{var K=O.lane&-536870913;if(K!==O.lane?(He&K)===K:(xa&K)===K){var L=O.revertLane;if(L===0)E!==null&&(E=E.next={lane:0,revertLane:0,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null}),K===mi&&(G=!0);else if((xa&L)===L){O=O.next,L===mi&&(G=!0);continue}else K={lane:0,revertLane:O.revertLane,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},E===null?(_=E=K,y=f):E=E.next=K,Re.lanes|=L,Wa|=L;K=O.action,Bs&&s(f,K),f=O.hasEagerState?O.eagerState:s(f,K)}else L={lane:K,revertLane:O.revertLane,gesture:O.gesture,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},E===null?(_=E=L,y=f):E=E.next=L,Re.lanes|=K,Wa|=K;O=O.next}while(O!==null&&O!==t);if(E===null?y=f:E.next=_,!xn(f,e.memoizedState)&&(It=!0,G&&(s=pi,s!==null)))throw s;e.memoizedState=f,e.baseState=y,e.baseQueue=E,i.lastRenderedState=f}return c===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function yu(e){var t=Rt(),s=t.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var i=s.dispatch,c=s.pending,f=t.memoizedState;if(c!==null){s.pending=null;var y=c=c.next;do f=e(f,y.action),y=y.next;while(y!==c);xn(f,t.memoizedState)||(It=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),s.lastRenderedState=f}return[f,i]}function Bm(e,t,s){var i=Re,c=Rt(),f=Ge;if(f){if(s===void 0)throw Error(o(407));s=s()}else s=t();var y=!xn((at||c).memoizedState,s);if(y&&(c.memoizedState=s,It=!0),c=c.queue,_u(Um.bind(null,i,c,e),[e]),c.getSnapshot!==t||y||Vt!==null&&Vt.memoizedState.tag&1){if(i.flags|=2048,_i(9,{destroy:void 0},zm.bind(null,i,c,s,t),null),lt===null)throw Error(o(349));f||(xa&127)!==0||Lm(i,t,s)}return s}function Lm(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=Re.updateQueue,t===null?(t=Xo(),Re.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function zm(e,t,s,i){t.value=s,t.getSnapshot=i,Vm(t)&&Im(e)}function Um(e,t,s){return s(function(){Vm(t)&&Im(e)})}function Vm(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!xn(e,s)}catch{return!0}}function Im(e){var t=As(e,2);t!==null&&bn(t,e,2)}function bu(e){var t=un();if(typeof e=="function"){var s=e;if(e=s(),Bs){cn(!0);try{s()}finally{cn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,lastRenderedState:e},t}function Hm(e,t,s,i){return e.baseState=s,vu(e,at,typeof i=="function"?i:Ta)}function IS(e,t,s,i,c){if(tr(e))throw Error(o(485));if(e=t.action,e!==null){var f={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){f.listeners.push(y)}};z.T!==null?s(!0):f.isTransition=!1,i(f),s=t.pending,s===null?(f.next=t.pending=f,qm(t,f)):(f.next=s.next,t.pending=s.next=f)}}function qm(e,t){var s=t.action,i=t.payload,c=e.state;if(t.isTransition){var f=z.T,y={};z.T=y;try{var _=s(c,i),E=z.S;E!==null&&E(y,_),Gm(e,t,_)}catch(O){Su(e,t,O)}finally{f!==null&&y.types!==null&&(f.types=y.types),z.T=f}}else try{f=s(c,i),Gm(e,t,f)}catch(O){Su(e,t,O)}}function Gm(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(i){Pm(e,t,i)},function(i){return Su(e,t,i)}):Pm(e,t,s)}function Pm(e,t,s){t.status="fulfilled",t.value=s,Fm(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,qm(e,s)))}function Su(e,t,s){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=s,Fm(t),t=t.next;while(t!==i)}e.action=null}function Fm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function $m(e,t){return t}function Ym(e,t){if(Ge){var s=lt.formState;if(s!==null){e:{var i=Re;if(Ge){if(ct){t:{for(var c=ct,f=In;c.nodeType!==8;){if(!f){c=null;break t}if(c=qn(c.nextSibling),c===null){c=null;break t}}f=c.data,c=f==="F!"||f==="F"?c:null}if(c){ct=qn(c.nextSibling),i=c.data==="F!";break e}}Pa(i)}i=!1}i&&(t=s[0])}}return s=un(),s.memoizedState=s.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$m,lastRenderedState:t},s.queue=i,s=fp.bind(null,Re,i),i.dispatch=s,i=bu(!1),f=Au.bind(null,Re,!1,i.queue),i=un(),c={state:t,dispatch:null,action:e,pending:null},i.queue=c,s=IS.bind(null,Re,c,f,s),c.dispatch=s,i.memoizedState=e,[t,s,!1]}function Km(e){var t=Rt();return Zm(t,at,e)}function Zm(e,t,s){if(t=vu(e,t,$m)[0],e=Jo(Ta)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=xl(t)}catch(y){throw y===gi?qo:y}else i=t;t=Rt();var c=t.queue,f=c.dispatch;return s!==t.memoizedState&&(Re.flags|=2048,_i(9,{destroy:void 0},HS.bind(null,c,s),null)),[i,f,e]}function HS(e,t){e.action=t}function Xm(e){var t=Rt(),s=at;if(s!==null)return Zm(t,s,e);Rt(),t=t.memoizedState,s=Rt();var i=s.queue.dispatch;return s.memoizedState=e,[t,i,!1]}function _i(e,t,s,i){return e={tag:e,create:s,deps:i,inst:t,next:null},t=Re.updateQueue,t===null&&(t=Xo(),Re.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(i=s.next,s.next=e,e.next=i,t.lastEffect=e),e}function Qm(){return Rt().memoizedState}function Wo(e,t,s,i){var c=un();Re.flags|=e,c.memoizedState=_i(1|t,{destroy:void 0},s,i===void 0?null:i)}function er(e,t,s,i){var c=Rt();i=i===void 0?null:i;var f=c.memoizedState.inst;at!==null&&i!==null&&du(i,at.memoizedState.deps)?c.memoizedState=_i(t,f,s,i):(Re.flags|=e,c.memoizedState=_i(1|t,f,s,i))}function Jm(e,t){Wo(8390656,8,e,t)}function _u(e,t){er(2048,8,e,t)}function qS(e){Re.flags|=4;var t=Re.updateQueue;if(t===null)t=Xo(),Re.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function Wm(e){var t=Rt().memoizedState;return qS({ref:t,nextImpl:e}),function(){if((Xe&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function ep(e,t){return er(4,2,e,t)}function tp(e,t){return er(4,4,e,t)}function np(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 ap(e,t,s){s=s!=null?s.concat([e]):null,er(4,4,np.bind(null,t,e),s)}function xu(){}function sp(e,t){var s=Rt();t=t===void 0?null:t;var i=s.memoizedState;return t!==null&&du(t,i[1])?i[0]:(s.memoizedState=[e,t],e)}function ip(e,t){var s=Rt();t=t===void 0?null:t;var i=s.memoizedState;if(t!==null&&du(t,i[1]))return i[0];if(i=e(),Bs){cn(!0);try{e()}finally{cn(!1)}}return s.memoizedState=[i,t],i}function Tu(e,t,s){return s===void 0||(xa&1073741824)!==0&&(He&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=lg(),Re.lanes|=e,Wa|=e,s)}function lp(e,t,s,i){return xn(s,t)?s:yi.current!==null?(e=Tu(e,s,i),xn(e,t)||(It=!0),e):(xa&42)===0||(xa&1073741824)!==0&&(He&261930)===0?(It=!0,e.memoizedState=s):(e=lg(),Re.lanes|=e,Wa|=e,t)}function op(e,t,s,i,c){var f=Y.p;Y.p=f!==0&&8>f?f:8;var y=z.T,_={};z.T=_,Au(e,!1,t,s);try{var E=c(),O=z.S;if(O!==null&&O(_,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var G=zS(E,i);Tl(e,t,G,Nn(e))}else Tl(e,t,i,Nn(e))}catch(K){Tl(e,t,{then:function(){},status:"rejected",reason:K},Nn())}finally{Y.p=f,y!==null&&_.types!==null&&(y.types=_.types),z.T=y}}function GS(){}function Eu(e,t,s,i){if(e.tag!==5)throw Error(o(476));var c=rp(e).queue;op(e,c,t,ee,s===null?GS:function(){return cp(e),s(i)})}function rp(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,lastRenderedState:ee},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function cp(e){var t=rp(e);t.next===null&&(t=e.alternate.memoizedState),Tl(e,t.next.queue,{},Nn())}function Cu(){return Jt(Il)}function up(){return Rt().memoizedState}function dp(){return Rt().memoizedState}function PS(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=Nn();e=Ya(s);var i=Ka(t,e,s);i!==null&&(bn(i,t,s),yl(i,t,s)),t={cache:eu()},e.payload=t;return}t=t.return}}function FS(e,t,s){var i=Nn();s={lane:i,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},tr(e)?hp(t,s):(s=Gc(e,t,s,i),s!==null&&(bn(s,e,i),mp(s,t,i)))}function fp(e,t,s){var i=Nn();Tl(e,t,s,i)}function Tl(e,t,s,i){var c={lane:i,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(tr(e))hp(t,c);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var y=t.lastRenderedState,_=f(y,s);if(c.hasEagerState=!0,c.eagerState=_,xn(_,y))return Bo(e,t,c,0),lt===null&&Oo(),!1}catch{}finally{}if(s=Gc(e,t,c,i),s!==null)return bn(s,e,i),mp(s,t,i),!0}return!1}function Au(e,t,s,i){if(i={lane:2,revertLane:sd(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},tr(e)){if(t)throw Error(o(479))}else t=Gc(e,s,i,2),t!==null&&bn(t,e,2)}function tr(e){var t=e.alternate;return e===Re||t!==null&&t===Re}function hp(e,t){bi=Ko=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function mp(e,t,s){if((s&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,s|=i,t.lanes=s,Wi(e,s)}}var El={readContext:Jt,use:Qo,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useLayoutEffect:At,useInsertionEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useSyncExternalStore:At,useId:At,useHostTransitionStatus:At,useFormState:At,useActionState:At,useOptimistic:At,useMemoCache:At,useCacheRefresh:At};El.useEffectEvent=At;var pp={readContext:Jt,use:Qo,useCallback:function(e,t){return un().memoizedState=[e,t===void 0?null:t],e},useContext:Jt,useEffect:Jm,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,Wo(4194308,4,np.bind(null,t,e),s)},useLayoutEffect:function(e,t){return Wo(4194308,4,e,t)},useInsertionEffect:function(e,t){Wo(4,2,e,t)},useMemo:function(e,t){var s=un();t=t===void 0?null:t;var i=e();if(Bs){cn(!0);try{e()}finally{cn(!1)}}return s.memoizedState=[i,t],i},useReducer:function(e,t,s){var i=un();if(s!==void 0){var c=s(t);if(Bs){cn(!0);try{s(t)}finally{cn(!1)}}}else c=t;return i.memoizedState=i.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},i.queue=e,e=e.dispatch=FS.bind(null,Re,e),[i.memoizedState,e]},useRef:function(e){var t=un();return e={current:e},t.memoizedState=e},useState:function(e){e=bu(e);var t=e.queue,s=fp.bind(null,Re,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:xu,useDeferredValue:function(e,t){var s=un();return Tu(s,e,t)},useTransition:function(){var e=bu(!1);return e=op.bind(null,Re,e.queue,!0,!1),un().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var i=Re,c=un();if(Ge){if(s===void 0)throw Error(o(407));s=s()}else{if(s=t(),lt===null)throw Error(o(349));(He&127)!==0||Lm(i,t,s)}c.memoizedState=s;var f={value:s,getSnapshot:t};return c.queue=f,Jm(Um.bind(null,i,f,e),[e]),i.flags|=2048,_i(9,{destroy:void 0},zm.bind(null,i,f,s,t),null),s},useId:function(){var e=un(),t=lt.identifierPrefix;if(Ge){var s=sa,i=aa;s=(i&~(1<<32-yt(i)-1)).toString(32)+s,t="_"+t+"R_"+s,s=Zo++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=US++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Cu,useFormState:Ym,useActionState:Ym,useOptimistic:function(e){var t=un();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Au.bind(null,Re,!0,s),s.dispatch=t,[e,t]},useMemoCache:gu,useCacheRefresh:function(){return un().memoizedState=PS.bind(null,Re)},useEffectEvent:function(e){var t=un(),s={impl:e};return t.memoizedState=s,function(){if((Xe&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},ju={readContext:Jt,use:Qo,useCallback:sp,useContext:Jt,useEffect:_u,useImperativeHandle:ap,useInsertionEffect:ep,useLayoutEffect:tp,useMemo:ip,useReducer:Jo,useRef:Qm,useState:function(){return Jo(Ta)},useDebugValue:xu,useDeferredValue:function(e,t){var s=Rt();return lp(s,at.memoizedState,e,t)},useTransition:function(){var e=Jo(Ta)[0],t=Rt().memoizedState;return[typeof e=="boolean"?e:xl(e),t]},useSyncExternalStore:Bm,useId:up,useHostTransitionStatus:Cu,useFormState:Km,useActionState:Km,useOptimistic:function(e,t){var s=Rt();return Hm(s,at,e,t)},useMemoCache:gu,useCacheRefresh:dp};ju.useEffectEvent=Wm;var gp={readContext:Jt,use:Qo,useCallback:sp,useContext:Jt,useEffect:_u,useImperativeHandle:ap,useInsertionEffect:ep,useLayoutEffect:tp,useMemo:ip,useReducer:yu,useRef:Qm,useState:function(){return yu(Ta)},useDebugValue:xu,useDeferredValue:function(e,t){var s=Rt();return at===null?Tu(s,e,t):lp(s,at.memoizedState,e,t)},useTransition:function(){var e=yu(Ta)[0],t=Rt().memoizedState;return[typeof e=="boolean"?e:xl(e),t]},useSyncExternalStore:Bm,useId:up,useHostTransitionStatus:Cu,useFormState:Xm,useActionState:Xm,useOptimistic:function(e,t){var s=Rt();return at!==null?Hm(s,at,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:gu,useCacheRefresh:dp};gp.useEffectEvent=Wm;function Nu(e,t,s,i){t=e.memoizedState,s=s(i,t),s=s==null?t:b({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var wu={enqueueSetState:function(e,t,s){e=e._reactInternals;var i=Nn(),c=Ya(i);c.payload=t,s!=null&&(c.callback=s),t=Ka(e,c,i),t!==null&&(bn(t,e,i),yl(t,e,i))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var i=Nn(),c=Ya(i);c.tag=1,c.payload=t,s!=null&&(c.callback=s),t=Ka(e,c,i),t!==null&&(bn(t,e,i),yl(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=Nn(),i=Ya(s);i.tag=2,t!=null&&(i.callback=t),t=Ka(e,i,s),t!==null&&(bn(t,e,s),yl(t,e,s))}};function vp(e,t,s,i,c,f,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,f,y):t.prototype&&t.prototype.isPureReactComponent?!ul(s,i)||!ul(c,f):!0}function yp(e,t,s,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,i),t.state!==e&&wu.enqueueReplaceState(t,t.state,null)}function Ls(e,t){var s=t;if("ref"in t){s={};for(var i in t)i!=="ref"&&(s[i]=t[i])}if(e=e.defaultProps){s===t&&(s=b({},s));for(var c in e)s[c]===void 0&&(s[c]=e[c])}return s}function bp(e){Mo(e)}function Sp(e){console.error(e)}function _p(e){Mo(e)}function nr(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function xp(e,t,s){try{var i=e.onCaughtError;i(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Du(e,t,s){return s=Ya(s),s.tag=3,s.payload={element:null},s.callback=function(){nr(e,t)},s}function Tp(e){return e=Ya(e),e.tag=3,e}function Ep(e,t,s,i){var c=s.type.getDerivedStateFromError;if(typeof c=="function"){var f=i.value;e.payload=function(){return c(f)},e.callback=function(){xp(t,s,i)}}var y=s.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){xp(t,s,i),typeof c!="function"&&(es===null?es=new Set([this]):es.add(this));var _=i.stack;this.componentDidCatch(i.value,{componentStack:_!==null?_:""})})}function $S(e,t,s,i,c){if(s.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=s.alternate,t!==null&&hi(t,s,c,!0),s=En.current,s!==null){switch(s.tag){case 31:case 13:return Hn===null?mr():s.alternate===null&&jt===0&&(jt=3),s.flags&=-257,s.flags|=65536,s.lanes=c,i===Go?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([i]):t.add(i),td(e,i,c)),!1;case 22:return s.flags|=65536,i===Go?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([i]):s.add(i)),td(e,i,c)),!1}throw Error(o(435,s.tag))}return td(e,i,c),mr(),!1}if(Ge)return t=En.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,i!==Zc&&(e=Error(o(422),{cause:i}),hl(zn(e,s)))):(i!==Zc&&(t=Error(o(423),{cause:i}),hl(zn(t,s))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,i=zn(i,s),c=Du(e.stateNode,i,c),lu(e,c),jt!==4&&(jt=2)),!1;var f=Error(o(520),{cause:i});if(f=zn(f,s),Rl===null?Rl=[f]:Rl.push(f),jt!==4&&(jt=2),t===null)return!0;i=zn(i,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=c&-c,s.lanes|=e,e=Du(s.stateNode,i,e),lu(s,e),!1;case 1:if(t=s.type,f=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(es===null||!es.has(f))))return s.flags|=65536,c&=-c,s.lanes|=c,c=Tp(c),Ep(c,e,s,i),lu(s,c),!1}s=s.return}while(s!==null);return!1}var ku=Error(o(461)),It=!1;function Wt(e,t,s,i){t.child=e===null?Nm(t,null,s,i):Os(t,e.child,s,i)}function Cp(e,t,s,i,c){s=s.render;var f=t.ref;if("ref"in i){var y={};for(var _ in i)_!=="ref"&&(y[_]=i[_])}else y=i;return Ds(t),i=fu(e,t,s,y,f,c),_=hu(),e!==null&&!It?(mu(e,t,c),Ea(e,t,c)):(Ge&&_&&Yc(t),t.flags|=1,Wt(e,t,i,c),t.child)}function Ap(e,t,s,i,c){if(e===null){var f=s.type;return typeof f=="function"&&!Pc(f)&&f.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=f,jp(e,t,f,i,c)):(e=zo(s.type,null,i,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!Vu(e,c)){var y=f.memoizedProps;if(s=s.compare,s=s!==null?s:ul,s(y,i)&&e.ref===t.ref)return Ea(e,t,c)}return t.flags|=1,e=ya(f,i),e.ref=t.ref,e.return=t,t.child=e}function jp(e,t,s,i,c){if(e!==null){var f=e.memoizedProps;if(ul(f,i)&&e.ref===t.ref)if(It=!1,t.pendingProps=i=f,Vu(e,c))(e.flags&131072)!==0&&(It=!0);else return t.lanes=e.lanes,Ea(e,t,c)}return Ru(e,t,s,i,c)}function Np(e,t,s,i){var c=i.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|s:s,e!==null){for(i=t.child=e.child,c=0;i!==null;)c=c|i.lanes|i.childLanes,i=i.sibling;i=c&~f}else i=0,t.child=null;return wp(e,t,f,s,i)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ho(t,f!==null?f.cachePool:null),f!==null?km(t,f):ru(),Rm(t);else return i=t.lanes=536870912,wp(e,t,f!==null?f.baseLanes|s:s,s,i)}else f!==null?(Ho(t,f.cachePool),km(t,f),Xa(),t.memoizedState=null):(e!==null&&Ho(t,null),ru(),Xa());return Wt(e,t,c,s),t.child}function Cl(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function wp(e,t,s,i,c){var f=nu();return f=f===null?null:{parent:Ut._currentValue,pool:f},t.memoizedState={baseLanes:s,cachePool:f},e!==null&&Ho(t,null),ru(),Rm(t),e!==null&&hi(e,t,i,!0),t.childLanes=c,null}function ar(e,t){return t=ir({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Dp(e,t,s){return Os(t,e.child,null,s),e=ar(t,t.pendingProps),e.flags|=2,Cn(t),t.memoizedState=null,e}function YS(e,t,s){var i=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ge){if(i.mode==="hidden")return e=ar(t,i),t.lanes=536870912,Cl(null,e);if(uu(t),(e=ct)?(e=qg(e,In),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:qa!==null?{id:aa,overflow:sa}:null,retryLane:536870912,hydrationErrors:null},s=hm(e),s.return=t,t.child=s,Qt=t,ct=null)):e=null,e===null)throw Pa(t);return t.lanes=536870912,null}return ar(t,i)}var f=e.memoizedState;if(f!==null){var y=f.dehydrated;if(uu(t),c)if(t.flags&256)t.flags&=-257,t=Dp(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(It||hi(e,t,s,!1),c=(s&e.childLanes)!==0,It||c){if(i=lt,i!==null&&(y=el(i,s),y!==0&&y!==f.retryLane))throw f.retryLane=y,As(e,y),bn(i,e,y),ku;mr(),t=Dp(e,t,s)}else e=f.treeContext,ct=qn(y.nextSibling),Qt=t,Ge=!0,Ga=null,In=!1,e!==null&&gm(t,e),t=ar(t,i),t.flags|=4096;return t}return e=ya(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function sr(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(o(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function Ru(e,t,s,i,c){return Ds(t),s=fu(e,t,s,i,void 0,c),i=hu(),e!==null&&!It?(mu(e,t,c),Ea(e,t,c)):(Ge&&i&&Yc(t),t.flags|=1,Wt(e,t,s,c),t.child)}function kp(e,t,s,i,c,f){return Ds(t),t.updateQueue=null,s=Om(t,i,s,c),Mm(e),i=hu(),e!==null&&!It?(mu(e,t,f),Ea(e,t,f)):(Ge&&i&&Yc(t),t.flags|=1,Wt(e,t,s,f),t.child)}function Rp(e,t,s,i,c){if(Ds(t),t.stateNode===null){var f=ci,y=s.contextType;typeof y=="object"&&y!==null&&(f=Jt(y)),f=new s(i,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=wu,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=i,f.state=t.memoizedState,f.refs={},su(t),y=s.contextType,f.context=typeof y=="object"&&y!==null?Jt(y):ci,f.state=t.memoizedState,y=s.getDerivedStateFromProps,typeof y=="function"&&(Nu(t,s,y,i),f.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(y=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),y!==f.state&&wu.enqueueReplaceState(f,f.state,null),Sl(t,i,f,c),bl(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){f=t.stateNode;var _=t.memoizedProps,E=Ls(s,_);f.props=E;var O=f.context,G=s.contextType;y=ci,typeof G=="object"&&G!==null&&(y=Jt(G));var K=s.getDerivedStateFromProps;G=typeof K=="function"||typeof f.getSnapshotBeforeUpdate=="function",_=t.pendingProps!==_,G||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(_||O!==y)&&yp(t,f,i,y),$a=!1;var L=t.memoizedState;f.state=L,Sl(t,i,f,c),bl(),O=t.memoizedState,_||L!==O||$a?(typeof K=="function"&&(Nu(t,s,K,i),O=t.memoizedState),(E=$a||vp(t,s,E,i,L,O,y))?(G||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=O),f.props=i,f.state=O,f.context=y,i=E):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{f=t.stateNode,iu(e,t),y=t.memoizedProps,G=Ls(s,y),f.props=G,K=t.pendingProps,L=f.context,O=s.contextType,E=ci,typeof O=="object"&&O!==null&&(E=Jt(O)),_=s.getDerivedStateFromProps,(O=typeof _=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(y!==K||L!==E)&&yp(t,f,i,E),$a=!1,L=t.memoizedState,f.state=L,Sl(t,i,f,c),bl();var V=t.memoizedState;y!==K||L!==V||$a||e!==null&&e.dependencies!==null&&Vo(e.dependencies)?(typeof _=="function"&&(Nu(t,s,_,i),V=t.memoizedState),(G=$a||vp(t,s,G,i,L,V,E)||e!==null&&e.dependencies!==null&&Vo(e.dependencies))?(O||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(i,V,E),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(i,V,E)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||y===e.memoizedProps&&L===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&L===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=V),f.props=i,f.state=V,f.context=E,i=G):(typeof f.componentDidUpdate!="function"||y===e.memoizedProps&&L===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&L===e.memoizedState||(t.flags|=1024),i=!1)}return f=i,sr(e,t),i=(t.flags&128)!==0,f||i?(f=t.stateNode,s=i&&typeof s.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&i?(t.child=Os(t,e.child,null,c),t.child=Os(t,null,s,c)):Wt(e,t,s,c),t.memoizedState=f.state,e=t.child):e=Ea(e,t,c),e}function Mp(e,t,s,i){return Ns(),t.flags|=256,Wt(e,t,s,i),t.child}var Mu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ou(e){return{baseLanes:e,cachePool:xm()}}function Bu(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=jn),e}function Op(e,t,s){var i=t.pendingProps,c=!1,f=(t.flags&128)!==0,y;if((y=f)||(y=e!==null&&e.memoizedState===null?!1:(kt.current&2)!==0),y&&(c=!0,t.flags&=-129),y=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ge){if(c?Za(t):Xa(),(e=ct)?(e=qg(e,In),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:qa!==null?{id:aa,overflow:sa}:null,retryLane:536870912,hydrationErrors:null},s=hm(e),s.return=t,t.child=s,Qt=t,ct=null)):e=null,e===null)throw Pa(t);return vd(e)?t.lanes=32:t.lanes=536870912,null}var _=i.children;return i=i.fallback,c?(Xa(),c=t.mode,_=ir({mode:"hidden",children:_},c),i=js(i,c,s,null),_.return=t,i.return=t,_.sibling=i,t.child=_,i=t.child,i.memoizedState=Ou(s),i.childLanes=Bu(e,y,s),t.memoizedState=Mu,Cl(null,i)):(Za(t),Lu(t,_))}var E=e.memoizedState;if(E!==null&&(_=E.dehydrated,_!==null)){if(f)t.flags&256?(Za(t),t.flags&=-257,t=zu(e,t,s)):t.memoizedState!==null?(Xa(),t.child=e.child,t.flags|=128,t=null):(Xa(),_=i.fallback,c=t.mode,i=ir({mode:"visible",children:i.children},c),_=js(_,c,s,null),_.flags|=2,i.return=t,_.return=t,i.sibling=_,t.child=i,Os(t,e.child,null,s),i=t.child,i.memoizedState=Ou(s),i.childLanes=Bu(e,y,s),t.memoizedState=Mu,t=Cl(null,i));else if(Za(t),vd(_)){if(y=_.nextSibling&&_.nextSibling.dataset,y)var O=y.dgst;y=O,i=Error(o(419)),i.stack="",i.digest=y,hl({value:i,source:null,stack:null}),t=zu(e,t,s)}else if(It||hi(e,t,s,!1),y=(s&e.childLanes)!==0,It||y){if(y=lt,y!==null&&(i=el(y,s),i!==0&&i!==E.retryLane))throw E.retryLane=i,As(e,i),bn(y,e,i),ku;gd(_)||mr(),t=zu(e,t,s)}else gd(_)?(t.flags|=192,t.child=e.child,t=null):(e=E.treeContext,ct=qn(_.nextSibling),Qt=t,Ge=!0,Ga=null,In=!1,e!==null&&gm(t,e),t=Lu(t,i.children),t.flags|=4096);return t}return c?(Xa(),_=i.fallback,c=t.mode,E=e.child,O=E.sibling,i=ya(E,{mode:"hidden",children:i.children}),i.subtreeFlags=E.subtreeFlags&65011712,O!==null?_=ya(O,_):(_=js(_,c,s,null),_.flags|=2),_.return=t,i.return=t,i.sibling=_,t.child=i,Cl(null,i),i=t.child,_=e.child.memoizedState,_===null?_=Ou(s):(c=_.cachePool,c!==null?(E=Ut._currentValue,c=c.parent!==E?{parent:E,pool:E}:c):c=xm(),_={baseLanes:_.baseLanes|s,cachePool:c}),i.memoizedState=_,i.childLanes=Bu(e,y,s),t.memoizedState=Mu,Cl(e.child,i)):(Za(t),s=e.child,e=s.sibling,s=ya(s,{mode:"visible",children:i.children}),s.return=t,s.sibling=null,e!==null&&(y=t.deletions,y===null?(t.deletions=[e],t.flags|=16):y.push(e)),t.child=s,t.memoizedState=null,s)}function Lu(e,t){return t=ir({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ir(e,t){return e=Tn(22,e,null,t),e.lanes=0,e}function zu(e,t,s){return Os(t,e.child,null,s),e=Lu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Bp(e,t,s){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Jc(e.return,t,s)}function Uu(e,t,s,i,c,f){var y=e.memoizedState;y===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:s,tailMode:c,treeForkCount:f}:(y.isBackwards=t,y.rendering=null,y.renderingStartTime=0,y.last=i,y.tail=s,y.tailMode=c,y.treeForkCount=f)}function Lp(e,t,s){var i=t.pendingProps,c=i.revealOrder,f=i.tail;i=i.children;var y=kt.current,_=(y&2)!==0;if(_?(y=y&1|2,t.flags|=128):y&=1,_e(kt,y),Wt(e,t,i,s),i=Ge?fl:0,!_&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Bp(e,s,t);else if(e.tag===19)Bp(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(c){case"forwards":for(s=t.child,c=null;s!==null;)e=s.alternate,e!==null&&Yo(e)===null&&(c=s),s=s.sibling;s=c,s===null?(c=t.child,t.child=null):(c=s.sibling,s.sibling=null),Uu(t,!1,c,s,f,i);break;case"backwards":case"unstable_legacy-backwards":for(s=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&Yo(e)===null){t.child=c;break}e=c.sibling,c.sibling=s,s=c,c=e}Uu(t,!0,s,null,f,i);break;case"together":Uu(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function Ea(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),Wa|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(hi(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,s=ya(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=ya(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function Vu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Vo(e)))}function KS(e,t,s){switch(t.tag){case 3:De(t,t.stateNode.containerInfo),Fa(t,Ut,e.memoizedState.cache),Ns();break;case 27:case 5:vt(t);break;case 4:De(t,t.stateNode.containerInfo);break;case 10:Fa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,uu(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(Za(t),t.flags|=128,null):(s&t.child.childLanes)!==0?Op(e,t,s):(Za(t),e=Ea(e,t,s),e!==null?e.sibling:null);Za(t);break;case 19:var c=(e.flags&128)!==0;if(i=(s&t.childLanes)!==0,i||(hi(e,t,s,!1),i=(s&t.childLanes)!==0),c){if(i)return Lp(e,t,s);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),_e(kt,kt.current),i)break;return null;case 22:return t.lanes=0,Np(e,t,s,t.pendingProps);case 24:Fa(t,Ut,e.memoizedState.cache)}return Ea(e,t,s)}function zp(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)It=!0;else{if(!Vu(e,s)&&(t.flags&128)===0)return It=!1,KS(e,t,s);It=(e.flags&131072)!==0}else It=!1,Ge&&(t.flags&1048576)!==0&&pm(t,fl,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=Rs(t.elementType),t.type=e,typeof e=="function")Pc(e)?(i=Ls(e,i),t.tag=1,t=Rp(null,t,e,i,s)):(t.tag=0,t=Ru(null,t,e,i,s));else{if(e!=null){var c=e.$$typeof;if(c===X){t.tag=11,t=Cp(null,t,e,i,s);break e}else if(c===W){t.tag=14,t=Ap(null,t,e,i,s);break e}}throw t=ye(e)||e,Error(o(306,t,""))}}return t;case 0:return Ru(e,t,t.type,t.pendingProps,s);case 1:return i=t.type,c=Ls(i,t.pendingProps),Rp(e,t,i,c,s);case 3:e:{if(De(t,t.stateNode.containerInfo),e===null)throw Error(o(387));i=t.pendingProps;var f=t.memoizedState;c=f.element,iu(e,t),Sl(t,i,null,s);var y=t.memoizedState;if(i=y.cache,Fa(t,Ut,i),i!==f.cache&&Wc(t,[Ut],s,!0),bl(),i=y.element,f.isDehydrated)if(f={element:i,isDehydrated:!1,cache:y.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=Mp(e,t,i,s);break e}else if(i!==c){c=zn(Error(o(424)),t),hl(c),t=Mp(e,t,i,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(ct=qn(e.firstChild),Qt=t,Ge=!0,Ga=null,In=!0,s=Nm(t,null,i,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Ns(),i===c){t=Ea(e,t,s);break e}Wt(e,t,i,s)}t=t.child}return t;case 26:return sr(e,t),e===null?(s=Kg(t.type,null,t.pendingProps,null))?t.memoizedState=s:Ge||(s=t.type,e=t.pendingProps,i=_r(P.current).createElement(s),i[zt]=t,i[Zt]=e,en(i,s,e),mt(i),t.stateNode=i):t.memoizedState=Kg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return vt(t),e===null&&Ge&&(i=t.stateNode=Fg(t.type,t.pendingProps,P.current),Qt=t,In=!0,c=ct,ss(t.type)?(yd=c,ct=qn(i.firstChild)):ct=c),Wt(e,t,t.pendingProps.children,s),sr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ge&&((c=i=ct)&&(i=E_(i,t.type,t.pendingProps,In),i!==null?(t.stateNode=i,Qt=t,ct=qn(i.firstChild),In=!1,c=!0):c=!1),c||Pa(t)),vt(t),c=t.type,f=t.pendingProps,y=e!==null?e.memoizedProps:null,i=f.children,hd(c,f)?i=null:y!==null&&hd(c,y)&&(t.flags|=32),t.memoizedState!==null&&(c=fu(e,t,VS,null,null,s),Il._currentValue=c),sr(e,t),Wt(e,t,i,s),t.child;case 6:return e===null&&Ge&&((e=s=ct)&&(s=C_(s,t.pendingProps,In),s!==null?(t.stateNode=s,Qt=t,ct=null,e=!0):e=!1),e||Pa(t)),null;case 13:return Op(e,t,s);case 4:return De(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Os(t,null,i,s):Wt(e,t,i,s),t.child;case 11:return Cp(e,t,t.type,t.pendingProps,s);case 7:return Wt(e,t,t.pendingProps,s),t.child;case 8:return Wt(e,t,t.pendingProps.children,s),t.child;case 12:return Wt(e,t,t.pendingProps.children,s),t.child;case 10:return i=t.pendingProps,Fa(t,t.type,i.value),Wt(e,t,i.children,s),t.child;case 9:return c=t.type._context,i=t.pendingProps.children,Ds(t),c=Jt(c),i=i(c),t.flags|=1,Wt(e,t,i,s),t.child;case 14:return Ap(e,t,t.type,t.pendingProps,s);case 15:return jp(e,t,t.type,t.pendingProps,s);case 19:return Lp(e,t,s);case 31:return YS(e,t,s);case 22:return Np(e,t,s,t.pendingProps);case 24:return Ds(t),i=Jt(Ut),e===null?(c=nu(),c===null&&(c=lt,f=eu(),c.pooledCache=f,f.refCount++,f!==null&&(c.pooledCacheLanes|=s),c=f),t.memoizedState={parent:i,cache:c},su(t),Fa(t,Ut,c)):((e.lanes&s)!==0&&(iu(e,t),Sl(t,null,null,s),bl()),c=e.memoizedState,f=t.memoizedState,c.parent!==i?(c={parent:i,cache:i},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),Fa(t,Ut,i)):(i=f.cache,Fa(t,Ut,i),i!==c.cache&&Wc(t,[Ut],s,!0))),Wt(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Ca(e){e.flags|=4}function Iu(e,t,s,i,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(ug())e.flags|=8192;else throw Ms=Go,au}else e.flags&=-16777217}function Up(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Wg(t))if(ug())e.flags|=8192;else throw Ms=Go,au}function lr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Mn():536870912,e.lanes|=t,Ci|=t)}function Al(e,t){if(!Ge)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 i=null;s!==null;)s.alternate!==null&&(i=s),s=s.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function ut(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,i=0;if(t)for(var c=e.child;c!==null;)s|=c.lanes|c.childLanes,i|=c.subtreeFlags&65011712,i|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)s|=c.lanes|c.childLanes,i|=c.subtreeFlags,i|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=i,e.childLanes=s,t}function ZS(e,t,s){var i=t.pendingProps;switch(Kc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ut(t),null;case 1:return ut(t),null;case 3:return s=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),_a(Ut),$e(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(fi(t)?Ca(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Xc())),ut(t),null;case 26:var c=t.type,f=t.memoizedState;return e===null?(Ca(t),f!==null?(ut(t),Up(t,f)):(ut(t),Iu(t,c,null,i,s))):f?f!==e.memoizedState?(Ca(t),ut(t),Up(t,f)):(ut(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&Ca(t),ut(t),Iu(t,c,e,i,s)),null;case 27:if(xt(t),s=P.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Ca(t);else{if(!i){if(t.stateNode===null)throw Error(o(166));return ut(t),null}e=Ce.current,fi(t)?vm(t):(e=Fg(c,i,s),t.stateNode=e,Ca(t))}return ut(t),null;case 5:if(xt(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Ca(t);else{if(!i){if(t.stateNode===null)throw Error(o(166));return ut(t),null}if(f=Ce.current,fi(t))vm(t);else{var y=_r(P.current);switch(f){case 1:f=y.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:f=y.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":f=y.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":f=y.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":f=y.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof i.is=="string"?y.createElement("select",{is:i.is}):y.createElement("select"),i.multiple?f.multiple=!0:i.size&&(f.size=i.size);break;default:f=typeof i.is=="string"?y.createElement(c,{is:i.is}):y.createElement(c)}}f[zt]=t,f[Zt]=i;e:for(y=t.child;y!==null;){if(y.tag===5||y.tag===6)f.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===t)break e;for(;y.sibling===null;){if(y.return===null||y.return===t)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}t.stateNode=f;e:switch(en(f,c,i),c){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Ca(t)}}return ut(t),Iu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Ca(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(o(166));if(e=P.current,fi(t)){if(e=t.stateNode,s=t.memoizedProps,i=null,c=Qt,c!==null)switch(c.tag){case 27:case 5:i=c.memoizedProps}e[zt]=t,e=!!(e.nodeValue===s||i!==null&&i.suppressHydrationWarning===!0||Og(e.nodeValue,s)),e||Pa(t,!0)}else e=_r(e).createTextNode(i),e[zt]=t,t.stateNode=e}return ut(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(i=fi(t),s!==null){if(e===null){if(!i)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[zt]=t}else Ns(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ut(t),e=!1}else s=Xc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(Cn(t),t):(Cn(t),null);if((t.flags&128)!==0)throw Error(o(558))}return ut(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=fi(t),i!==null&&i.dehydrated!==null){if(e===null){if(!c)throw Error(o(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(o(317));c[zt]=t}else Ns(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ut(t),c=!1}else c=Xc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(Cn(t),t):(Cn(t),null)}return Cn(t),(t.flags&128)!==0?(t.lanes=s,t):(s=i!==null,e=e!==null&&e.memoizedState!==null,s&&(i=t.child,c=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(c=i.alternate.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==c&&(i.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),lr(t,t.updateQueue),ut(t),null);case 4:return $e(),e===null&&rd(t.stateNode.containerInfo),ut(t),null;case 10:return _a(t.type),ut(t),null;case 19:if(we(kt),i=t.memoizedState,i===null)return ut(t),null;if(c=(t.flags&128)!==0,f=i.rendering,f===null)if(c)Al(i,!1);else{if(jt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=Yo(e),f!==null){for(t.flags|=128,Al(i,!1),e=f.updateQueue,t.updateQueue=e,lr(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)fm(s,e),s=s.sibling;return _e(kt,kt.current&1|2),Ge&&ba(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&de()>dr&&(t.flags|=128,c=!0,Al(i,!1),t.lanes=4194304)}else{if(!c)if(e=Yo(f),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,lr(t,e),Al(i,!0),i.tail===null&&i.tailMode==="hidden"&&!f.alternate&&!Ge)return ut(t),null}else 2*de()-i.renderingStartTime>dr&&s!==536870912&&(t.flags|=128,c=!0,Al(i,!1),t.lanes=4194304);i.isBackwards?(f.sibling=t.child,t.child=f):(e=i.last,e!==null?e.sibling=f:t.child=f,i.last=f)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=de(),e.sibling=null,s=kt.current,_e(kt,c?s&1|2:s&1),Ge&&ba(t,i.treeForkCount),e):(ut(t),null);case 22:case 23:return Cn(t),cu(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(s&536870912)!==0&&(t.flags&128)===0&&(ut(t),t.subtreeFlags&6&&(t.flags|=8192)):ut(t),s=t.updateQueue,s!==null&&lr(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==s&&(t.flags|=2048),e!==null&&we(ks),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),_a(Ut),ut(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function XS(e,t){switch(Kc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return _a(Ut),$e(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return xt(t),null;case 31:if(t.memoizedState!==null){if(Cn(t),t.alternate===null)throw Error(o(340));Ns()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Cn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Ns()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return we(kt),null;case 4:return $e(),null;case 10:return _a(t.type),null;case 22:case 23:return Cn(t),cu(),e!==null&&we(ks),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return _a(Ut),null;case 25:return null;default:return null}}function Vp(e,t){switch(Kc(t),t.tag){case 3:_a(Ut),$e();break;case 26:case 27:case 5:xt(t);break;case 4:$e();break;case 31:t.memoizedState!==null&&Cn(t);break;case 13:Cn(t);break;case 19:we(kt);break;case 10:_a(t.type);break;case 22:case 23:Cn(t),cu(),e!==null&&we(ks);break;case 24:_a(Ut)}}function jl(e,t){try{var s=t.updateQueue,i=s!==null?s.lastEffect:null;if(i!==null){var c=i.next;s=c;do{if((s.tag&e)===e){i=void 0;var f=s.create,y=s.inst;i=f(),y.destroy=i}s=s.next}while(s!==c)}}catch(_){nt(t,t.return,_)}}function Qa(e,t,s){try{var i=t.updateQueue,c=i!==null?i.lastEffect:null;if(c!==null){var f=c.next;i=f;do{if((i.tag&e)===e){var y=i.inst,_=y.destroy;if(_!==void 0){y.destroy=void 0,c=t;var E=s,O=_;try{O()}catch(G){nt(c,E,G)}}}i=i.next}while(i!==f)}}catch(G){nt(t,t.return,G)}}function Ip(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{Dm(t,s)}catch(i){nt(e,e.return,i)}}}function Hp(e,t,s){s.props=Ls(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(i){nt(e,t,i)}}function Nl(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof s=="function"?e.refCleanup=s(i):s.current=i}}catch(c){nt(e,t,c)}}function ia(e,t){var s=e.ref,i=e.refCleanup;if(s!==null)if(typeof i=="function")try{i()}catch(c){nt(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(c){nt(e,t,c)}else s.current=null}function qp(e){var t=e.type,s=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&i.focus();break e;case"img":s.src?i.src=s.src:s.srcSet&&(i.srcset=s.srcSet)}}catch(c){nt(e,e.return,c)}}function Hu(e,t,s){try{var i=e.stateNode;y_(i,e.type,s,t),i[Zt]=t}catch(c){nt(e,e.return,c)}}function Gp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ss(e.type)||e.tag===4}function qu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Gp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ss(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Gu(e,t,s){var i=e.tag;if(i===5||i===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=ga));else if(i!==4&&(i===27&&ss(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(Gu(e,t,s),e=e.sibling;e!==null;)Gu(e,t,s),e=e.sibling}function or(e,t,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(i!==4&&(i===27&&ss(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(or(e,t,s),e=e.sibling;e!==null;)or(e,t,s),e=e.sibling}function Pp(e){var t=e.stateNode,s=e.memoizedProps;try{for(var i=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);en(t,i,s),t[zt]=e,t[Zt]=s}catch(f){nt(e,e.return,f)}}var Aa=!1,Ht=!1,Pu=!1,Fp=typeof WeakSet=="function"?WeakSet:Set,Kt=null;function QS(e,t){if(e=e.containerInfo,dd=Nr,e=am(e),zc(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var i=s.getSelection&&s.getSelection();if(i&&i.rangeCount!==0){s=i.anchorNode;var c=i.anchorOffset,f=i.focusNode;i=i.focusOffset;try{s.nodeType,f.nodeType}catch{s=null;break e}var y=0,_=-1,E=-1,O=0,G=0,K=e,L=null;t:for(;;){for(var V;K!==s||c!==0&&K.nodeType!==3||(_=y+c),K!==f||i!==0&&K.nodeType!==3||(E=y+i),K.nodeType===3&&(y+=K.nodeValue.length),(V=K.firstChild)!==null;)L=K,K=V;for(;;){if(K===e)break t;if(L===s&&++O===c&&(_=y),L===f&&++G===i&&(E=y),(V=K.nextSibling)!==null)break;K=L,L=K.parentNode}K=V}s=_===-1||E===-1?null:{start:_,end:E}}else s=null}s=s||{start:0,end:0}}else s=null;for(fd={focusedElem:e,selectionRange:s},Nr=!1,Kt=t;Kt!==null;)if(t=Kt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Kt=e;else for(;Kt!==null;){switch(t=Kt,f=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++)c=e[s],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,s=t,c=f.memoizedProps,f=f.memoizedState,i=s.stateNode;try{var ue=Ls(s.type,c);e=i.getSnapshotBeforeUpdate(ue,f),i.__reactInternalSnapshotBeforeUpdate=e}catch(Se){nt(s,s.return,Se)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)pd(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":pd(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,Kt=e;break}Kt=t.return}}function $p(e,t,s){var i=s.flags;switch(s.tag){case 0:case 11:case 15:Na(e,s),i&4&&jl(5,s);break;case 1:if(Na(e,s),i&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(y){nt(s,s.return,y)}else{var c=Ls(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(y){nt(s,s.return,y)}}i&64&&Ip(s),i&512&&Nl(s,s.return);break;case 3:if(Na(e,s),i&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{Dm(e,t)}catch(y){nt(s,s.return,y)}}break;case 27:t===null&&i&4&&Pp(s);case 26:case 5:Na(e,s),t===null&&i&4&&qp(s),i&512&&Nl(s,s.return);break;case 12:Na(e,s);break;case 31:Na(e,s),i&4&&Zp(e,s);break;case 13:Na(e,s),i&4&&Xp(e,s),i&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=l_.bind(null,s),A_(e,s))));break;case 22:if(i=s.memoizedState!==null||Aa,!i){t=t!==null&&t.memoizedState!==null||Ht,c=Aa;var f=Ht;Aa=i,(Ht=t)&&!f?wa(e,s,(s.subtreeFlags&8772)!==0):Na(e,s),Aa=c,Ht=f}break;case 30:break;default:Na(e,s)}}function Yp(e){var t=e.alternate;t!==null&&(e.alternate=null,Yp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ie(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 pt=null,pn=!1;function ja(e,t,s){for(s=s.child;s!==null;)Kp(e,t,s),s=s.sibling}function Kp(e,t,s){if(Et&&typeof Et.onCommitFiberUnmount=="function")try{Et.onCommitFiberUnmount(rt,s)}catch{}switch(s.tag){case 26:Ht||ia(s,t),ja(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Ht||ia(s,t);var i=pt,c=pn;ss(s.type)&&(pt=s.stateNode,pn=!1),ja(e,t,s),zl(s.stateNode),pt=i,pn=c;break;case 5:Ht||ia(s,t);case 6:if(i=pt,c=pn,pt=null,ja(e,t,s),pt=i,pn=c,pt!==null)if(pn)try{(pt.nodeType===9?pt.body:pt.nodeName==="HTML"?pt.ownerDocument.body:pt).removeChild(s.stateNode)}catch(f){nt(s,t,f)}else try{pt.removeChild(s.stateNode)}catch(f){nt(s,t,f)}break;case 18:pt!==null&&(pn?(e=pt,Ig(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Mi(e)):Ig(pt,s.stateNode));break;case 4:i=pt,c=pn,pt=s.stateNode.containerInfo,pn=!0,ja(e,t,s),pt=i,pn=c;break;case 0:case 11:case 14:case 15:Qa(2,s,t),Ht||Qa(4,s,t),ja(e,t,s);break;case 1:Ht||(ia(s,t),i=s.stateNode,typeof i.componentWillUnmount=="function"&&Hp(s,t,i)),ja(e,t,s);break;case 21:ja(e,t,s);break;case 22:Ht=(i=Ht)||s.memoizedState!==null,ja(e,t,s),Ht=i;break;default:ja(e,t,s)}}function Zp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Mi(e)}catch(s){nt(t,t.return,s)}}}function Xp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Mi(e)}catch(s){nt(t,t.return,s)}}function JS(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Fp),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Fp),t;default:throw Error(o(435,e.tag))}}function rr(e,t){var s=JS(e);t.forEach(function(i){if(!s.has(i)){s.add(i);var c=o_.bind(null,e,i);i.then(c,c)}})}function gn(e,t){var s=t.deletions;if(s!==null)for(var i=0;i<s.length;i++){var c=s[i],f=e,y=t,_=y;e:for(;_!==null;){switch(_.tag){case 27:if(ss(_.type)){pt=_.stateNode,pn=!1;break e}break;case 5:pt=_.stateNode,pn=!1;break e;case 3:case 4:pt=_.stateNode.containerInfo,pn=!0;break e}_=_.return}if(pt===null)throw Error(o(160));Kp(f,y,c),pt=null,pn=!1,f=c.alternate,f!==null&&(f.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Qp(t,e),t=t.sibling}var Wn=null;function Qp(e,t){var s=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:gn(t,e),vn(e),i&4&&(Qa(3,e,e.return),jl(3,e),Qa(5,e,e.return));break;case 1:gn(t,e),vn(e),i&512&&(Ht||s===null||ia(s,s.return)),i&64&&Aa&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?i:s.concat(i))));break;case 26:var c=Wn;if(gn(t,e),vn(e),i&512&&(Ht||s===null||ia(s,s.return)),i&4){var f=s!==null?s.memoizedState:null;if(i=e.memoizedState,s===null)if(i===null)if(e.stateNode===null){e:{i=e.type,s=e.memoizedProps,c=c.ownerDocument||c;t:switch(i){case"title":f=c.getElementsByTagName("title")[0],(!f||f[Be]||f[zt]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=c.createElement(i),c.head.insertBefore(f,c.querySelector("head > title"))),en(f,i,s),f[zt]=e,mt(f),i=f;break e;case"link":var y=Qg("link","href",c).get(i+(s.href||""));if(y){for(var _=0;_<y.length;_++)if(f=y[_],f.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&f.getAttribute("rel")===(s.rel==null?null:s.rel)&&f.getAttribute("title")===(s.title==null?null:s.title)&&f.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){y.splice(_,1);break t}}f=c.createElement(i),en(f,i,s),c.head.appendChild(f);break;case"meta":if(y=Qg("meta","content",c).get(i+(s.content||""))){for(_=0;_<y.length;_++)if(f=y[_],f.getAttribute("content")===(s.content==null?null:""+s.content)&&f.getAttribute("name")===(s.name==null?null:s.name)&&f.getAttribute("property")===(s.property==null?null:s.property)&&f.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&f.getAttribute("charset")===(s.charSet==null?null:s.charSet)){y.splice(_,1);break t}}f=c.createElement(i),en(f,i,s),c.head.appendChild(f);break;default:throw Error(o(468,i))}f[zt]=e,mt(f),i=f}e.stateNode=i}else Jg(c,e.type,e.stateNode);else e.stateNode=Xg(c,i,e.memoizedProps);else f!==i?(f===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):f.count--,i===null?Jg(c,e.type,e.stateNode):Xg(c,i,e.memoizedProps)):i===null&&e.stateNode!==null&&Hu(e,e.memoizedProps,s.memoizedProps)}break;case 27:gn(t,e),vn(e),i&512&&(Ht||s===null||ia(s,s.return)),s!==null&&i&4&&Hu(e,e.memoizedProps,s.memoizedProps);break;case 5:if(gn(t,e),vn(e),i&512&&(Ht||s===null||ia(s,s.return)),e.flags&32){c=e.stateNode;try{ni(c,"")}catch(ue){nt(e,e.return,ue)}}i&4&&e.stateNode!=null&&(c=e.memoizedProps,Hu(e,c,s!==null?s.memoizedProps:c)),i&1024&&(Pu=!0);break;case 6:if(gn(t,e),vn(e),i&4){if(e.stateNode===null)throw Error(o(162));i=e.memoizedProps,s=e.stateNode;try{s.nodeValue=i}catch(ue){nt(e,e.return,ue)}}break;case 3:if(Er=null,c=Wn,Wn=xr(t.containerInfo),gn(t,e),Wn=c,vn(e),i&4&&s!==null&&s.memoizedState.isDehydrated)try{Mi(t.containerInfo)}catch(ue){nt(e,e.return,ue)}Pu&&(Pu=!1,Jp(e));break;case 4:i=Wn,Wn=xr(e.stateNode.containerInfo),gn(t,e),vn(e),Wn=i;break;case 12:gn(t,e),vn(e);break;case 31:gn(t,e),vn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,rr(e,i)));break;case 13:gn(t,e),vn(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(ur=de()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,rr(e,i)));break;case 22:c=e.memoizedState!==null;var E=s!==null&&s.memoizedState!==null,O=Aa,G=Ht;if(Aa=O||c,Ht=G||E,gn(t,e),Ht=G,Aa=O,vn(e),i&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(s===null||E||Aa||Ht||zs(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){E=s=t;try{if(f=E.stateNode,c)y=f.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{_=E.stateNode;var K=E.memoizedProps.style,L=K!=null&&K.hasOwnProperty("display")?K.display:null;_.style.display=L==null||typeof L=="boolean"?"":(""+L).trim()}}catch(ue){nt(E,E.return,ue)}}}else if(t.tag===6){if(s===null){E=t;try{E.stateNode.nodeValue=c?"":E.memoizedProps}catch(ue){nt(E,E.return,ue)}}}else if(t.tag===18){if(s===null){E=t;try{var V=E.stateNode;c?Hg(V,!0):Hg(E.stateNode,!1)}catch(ue){nt(E,E.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}i&4&&(i=e.updateQueue,i!==null&&(s=i.retryQueue,s!==null&&(i.retryQueue=null,rr(e,s))));break;case 19:gn(t,e),vn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,rr(e,i)));break;case 30:break;case 21:break;default:gn(t,e),vn(e)}}function vn(e){var t=e.flags;if(t&2){try{for(var s,i=e.return;i!==null;){if(Gp(i)){s=i;break}i=i.return}if(s==null)throw Error(o(160));switch(s.tag){case 27:var c=s.stateNode,f=qu(e);or(e,f,c);break;case 5:var y=s.stateNode;s.flags&32&&(ni(y,""),s.flags&=-33);var _=qu(e);or(e,_,y);break;case 3:case 4:var E=s.stateNode.containerInfo,O=qu(e);Gu(e,O,E);break;default:throw Error(o(161))}}catch(G){nt(e,e.return,G)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Jp(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Jp(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Na(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)$p(e,t.alternate,t),t=t.sibling}function zs(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Qa(4,t,t.return),zs(t);break;case 1:ia(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&Hp(t,t.return,s),zs(t);break;case 27:zl(t.stateNode);case 26:case 5:ia(t,t.return),zs(t);break;case 22:t.memoizedState===null&&zs(t);break;case 30:zs(t);break;default:zs(t)}e=e.sibling}}function wa(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,c=e,f=t,y=f.flags;switch(f.tag){case 0:case 11:case 15:wa(c,f,s),jl(4,f);break;case 1:if(wa(c,f,s),i=f,c=i.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(O){nt(i,i.return,O)}if(i=f,c=i.updateQueue,c!==null){var _=i.stateNode;try{var E=c.shared.hiddenCallbacks;if(E!==null)for(c.shared.hiddenCallbacks=null,c=0;c<E.length;c++)wm(E[c],_)}catch(O){nt(i,i.return,O)}}s&&y&64&&Ip(f),Nl(f,f.return);break;case 27:Pp(f);case 26:case 5:wa(c,f,s),s&&i===null&&y&4&&qp(f),Nl(f,f.return);break;case 12:wa(c,f,s);break;case 31:wa(c,f,s),s&&y&4&&Zp(c,f);break;case 13:wa(c,f,s),s&&y&4&&Xp(c,f);break;case 22:f.memoizedState===null&&wa(c,f,s),Nl(f,f.return);break;case 30:break;default:wa(c,f,s)}t=t.sibling}}function Fu(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&&ml(s))}function $u(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ml(e))}function ea(e,t,s,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Wp(e,t,s,i),t=t.sibling}function Wp(e,t,s,i){var c=t.flags;switch(t.tag){case 0:case 11:case 15:ea(e,t,s,i),c&2048&&jl(9,t);break;case 1:ea(e,t,s,i);break;case 3:ea(e,t,s,i),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ml(e)));break;case 12:if(c&2048){ea(e,t,s,i),e=t.stateNode;try{var f=t.memoizedProps,y=f.id,_=f.onPostCommit;typeof _=="function"&&_(y,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(E){nt(t,t.return,E)}}else ea(e,t,s,i);break;case 31:ea(e,t,s,i);break;case 13:ea(e,t,s,i);break;case 23:break;case 22:f=t.stateNode,y=t.alternate,t.memoizedState!==null?f._visibility&2?ea(e,t,s,i):wl(e,t):f._visibility&2?ea(e,t,s,i):(f._visibility|=2,xi(e,t,s,i,(t.subtreeFlags&10256)!==0||!1)),c&2048&&Fu(y,t);break;case 24:ea(e,t,s,i),c&2048&&$u(t.alternate,t);break;default:ea(e,t,s,i)}}function xi(e,t,s,i,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,y=t,_=s,E=i,O=y.flags;switch(y.tag){case 0:case 11:case 15:xi(f,y,_,E,c),jl(8,y);break;case 23:break;case 22:var G=y.stateNode;y.memoizedState!==null?G._visibility&2?xi(f,y,_,E,c):wl(f,y):(G._visibility|=2,xi(f,y,_,E,c)),c&&O&2048&&Fu(y.alternate,y);break;case 24:xi(f,y,_,E,c),c&&O&2048&&$u(y.alternate,y);break;default:xi(f,y,_,E,c)}t=t.sibling}}function wl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,i=t,c=i.flags;switch(i.tag){case 22:wl(s,i),c&2048&&Fu(i.alternate,i);break;case 24:wl(s,i),c&2048&&$u(i.alternate,i);break;default:wl(s,i)}t=t.sibling}}var Dl=8192;function Ti(e,t,s){if(e.subtreeFlags&Dl)for(e=e.child;e!==null;)eg(e,t,s),e=e.sibling}function eg(e,t,s){switch(e.tag){case 26:Ti(e,t,s),e.flags&Dl&&e.memoizedState!==null&&U_(s,Wn,e.memoizedState,e.memoizedProps);break;case 5:Ti(e,t,s);break;case 3:case 4:var i=Wn;Wn=xr(e.stateNode.containerInfo),Ti(e,t,s),Wn=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=Dl,Dl=16777216,Ti(e,t,s),Dl=i):Ti(e,t,s));break;default:Ti(e,t,s)}}function tg(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 kl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var i=t[s];Kt=i,ag(i,e)}tg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ng(e),e=e.sibling}function ng(e){switch(e.tag){case 0:case 11:case 15:kl(e),e.flags&2048&&Qa(9,e,e.return);break;case 3:kl(e);break;case 12:kl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,cr(e)):kl(e);break;default:kl(e)}}function cr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var i=t[s];Kt=i,ag(i,e)}tg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Qa(8,t,t.return),cr(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,cr(t));break;default:cr(t)}e=e.sibling}}function ag(e,t){for(;Kt!==null;){var s=Kt;switch(s.tag){case 0:case 11:case 15:Qa(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var i=s.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:ml(s.memoizedState.cache)}if(i=s.child,i!==null)i.return=s,Kt=i;else e:for(s=e;Kt!==null;){i=Kt;var c=i.sibling,f=i.return;if(Yp(i),i===s){Kt=null;break e}if(c!==null){c.return=f,Kt=c;break e}Kt=f}}}var WS={getCacheForType:function(e){var t=Jt(Ut),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Jt(Ut).controller.signal}},e_=typeof WeakMap=="function"?WeakMap:Map,Xe=0,lt=null,Ue=null,He=0,tt=0,An=null,Ja=!1,Ei=!1,Yu=!1,Da=0,jt=0,Wa=0,Us=0,Ku=0,jn=0,Ci=0,Rl=null,yn=null,Zu=!1,ur=0,sg=0,dr=1/0,fr=null,es=null,Pt=0,ts=null,Ai=null,ka=0,Xu=0,Qu=null,ig=null,Ml=0,Ju=null;function Nn(){return(Xe&2)!==0&&He!==0?He&-He:z.T!==null?sd():tl()}function lg(){if(jn===0)if((He&536870912)===0||Ge){var e=Me;Me<<=1,(Me&3932160)===0&&(Me=262144),jn=e}else jn=536870912;return e=En.current,e!==null&&(e.flags|=32),jn}function bn(e,t,s){(e===lt&&(tt===2||tt===9)||e.cancelPendingCommit!==null)&&(ji(e,0),ns(e,He,jn,!1)),Ia(e,s),((Xe&2)===0||e!==lt)&&(e===lt&&((Xe&2)===0&&(Us|=s),jt===4&&ns(e,He,jn,!1)),la(e))}function og(e,t,s){if((Xe&6)!==0)throw Error(o(327));var i=!s&&(t&127)===0&&(t&e.expiredLanes)===0||se(e,t),c=i?a_(e,t):ed(e,t,!0),f=i;do{if(c===0){Ei&&!i&&ns(e,t,0,!1);break}else{if(s=e.current.alternate,f&&!t_(s)){c=ed(e,t,!1),f=!1;continue}if(c===2){if(f=t,e.errorRecoveryDisabledLanes&f)var y=0;else y=e.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){t=y;e:{var _=e;c=Rl;var E=_.current.memoizedState.isDehydrated;if(E&&(ji(_,y).flags|=256),y=ed(_,y,!1),y!==2){if(Yu&&!E){_.errorRecoveryDisabledLanes|=f,Us|=f,c=4;break e}f=yn,yn=c,f!==null&&(yn===null?yn=f:yn.push.apply(yn,f))}c=y}if(f=!1,c!==2)continue}}if(c===1){ji(e,0),ns(e,t,0,!0);break}e:{switch(i=e,f=c,f){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:ns(i,t,jn,!Ja);break e;case 2:yn=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(c=ur+300-de(),10<c)){if(ns(i,t,jn,!Ja),ie(i,0,!0)!==0)break e;ka=t,i.timeoutHandle=Ug(rg.bind(null,i,s,yn,fr,Zu,t,jn,Us,Ci,Ja,f,"Throttled",-0,0),c);break e}rg(i,s,yn,fr,Zu,t,jn,Us,Ci,Ja,f,null,-0,0)}}break}while(!0);la(e)}function rg(e,t,s,i,c,f,y,_,E,O,G,K,L,V){if(e.timeoutHandle=-1,K=t.subtreeFlags,K&8192||(K&16785408)===16785408){K={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ga},eg(t,f,K);var ue=(f&62914560)===f?ur-de():(f&4194048)===f?sg-de():0;if(ue=V_(K,ue),ue!==null){ka=f,e.cancelPendingCommit=ue(gg.bind(null,e,t,f,s,i,c,y,_,E,G,K,null,L,V)),ns(e,f,y,!O);return}}gg(e,t,f,s,i,c,y,_,E)}function t_(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 i=0;i<s.length;i++){var c=s[i],f=c.getSnapshot;c=c.value;try{if(!xn(f(),c))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ns(e,t,s,i){t&=~Ku,t&=~Us,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var c=t;0<c;){var f=31-yt(c),y=1<<f;i[f]=-1,c&=~y}s!==0&&Ji(e,s,t)}function hr(){return(Xe&6)===0?(Ol(0),!1):!0}function Wu(){if(Ue!==null){if(tt===0)var e=Ue.return;else e=Ue,Sa=ws=null,pu(e),vi=null,gl=0,e=Ue;for(;e!==null;)Vp(e.alternate,e),e=e.return;Ue=null}}function ji(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,__(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),ka=0,Wu(),lt=e,Ue=s=ya(e.current,null),He=t,tt=0,An=null,Ja=!1,Ei=se(e,t),Yu=!1,Ci=jn=Ku=Us=Wa=jt=0,yn=Rl=null,Zu=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var c=31-yt(i),f=1<<c;t|=e[c],i&=~f}return Da=t,Oo(),s}function cg(e,t){Re=null,z.H=El,t===gi||t===qo?(t=Cm(),tt=3):t===au?(t=Cm(),tt=4):tt=t===ku?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,An=t,Ue===null&&(jt=1,nr(e,zn(t,e.current)))}function ug(){var e=En.current;return e===null?!0:(He&4194048)===He?Hn===null:(He&62914560)===He||(He&536870912)!==0?e===Hn:!1}function dg(){var e=z.H;return z.H=El,e===null?El:e}function fg(){var e=z.A;return z.A=WS,e}function mr(){jt=4,Ja||(He&4194048)!==He&&En.current!==null||(Ei=!0),(Wa&134217727)===0&&(Us&134217727)===0||lt===null||ns(lt,He,jn,!1)}function ed(e,t,s){var i=Xe;Xe|=2;var c=dg(),f=fg();(lt!==e||He!==t)&&(fr=null,ji(e,t)),t=!1;var y=jt;e:do try{if(tt!==0&&Ue!==null){var _=Ue,E=An;switch(tt){case 8:Wu(),y=6;break e;case 3:case 2:case 9:case 6:En.current===null&&(t=!0);var O=tt;if(tt=0,An=null,Ni(e,_,E,O),s&&Ei){y=0;break e}break;default:O=tt,tt=0,An=null,Ni(e,_,E,O)}}n_(),y=jt;break}catch(G){cg(e,G)}while(!0);return t&&e.shellSuspendCounter++,Sa=ws=null,Xe=i,z.H=c,z.A=f,Ue===null&&(lt=null,He=0,Oo()),y}function n_(){for(;Ue!==null;)hg(Ue)}function a_(e,t){var s=Xe;Xe|=2;var i=dg(),c=fg();lt!==e||He!==t?(fr=null,dr=de()+500,ji(e,t)):Ei=se(e,t);e:do try{if(tt!==0&&Ue!==null){t=Ue;var f=An;t:switch(tt){case 1:tt=0,An=null,Ni(e,t,f,1);break;case 2:case 9:if(Tm(f)){tt=0,An=null,mg(t);break}t=function(){tt!==2&&tt!==9||lt!==e||(tt=7),la(e)},f.then(t,t);break e;case 3:tt=7;break e;case 4:tt=5;break e;case 7:Tm(f)?(tt=0,An=null,mg(t)):(tt=0,An=null,Ni(e,t,f,7));break;case 5:var y=null;switch(Ue.tag){case 26:y=Ue.memoizedState;case 5:case 27:var _=Ue;if(y?Wg(y):_.stateNode.complete){tt=0,An=null;var E=_.sibling;if(E!==null)Ue=E;else{var O=_.return;O!==null?(Ue=O,pr(O)):Ue=null}break t}}tt=0,An=null,Ni(e,t,f,5);break;case 6:tt=0,An=null,Ni(e,t,f,6);break;case 8:Wu(),jt=6;break e;default:throw Error(o(462))}}s_();break}catch(G){cg(e,G)}while(!0);return Sa=ws=null,z.H=i,z.A=c,Xe=s,Ue!==null?0:(lt=null,He=0,Oo(),jt)}function s_(){for(;Ue!==null&&!le();)hg(Ue)}function hg(e){var t=zp(e.alternate,e,Da);e.memoizedProps=e.pendingProps,t===null?pr(e):Ue=t}function mg(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=kp(s,t,t.pendingProps,t.type,void 0,He);break;case 11:t=kp(s,t,t.pendingProps,t.type.render,t.ref,He);break;case 5:pu(t);default:Vp(s,t),t=Ue=fm(t,Da),t=zp(s,t,Da)}e.memoizedProps=e.pendingProps,t===null?pr(e):Ue=t}function Ni(e,t,s,i){Sa=ws=null,pu(t),vi=null,gl=0;var c=t.return;try{if($S(e,c,t,s,He)){jt=1,nr(e,zn(s,e.current)),Ue=null;return}}catch(f){if(c!==null)throw Ue=c,f;jt=1,nr(e,zn(s,e.current)),Ue=null;return}t.flags&32768?(Ge||i===1?e=!0:Ei||(He&536870912)!==0?e=!1:(Ja=e=!0,(i===2||i===9||i===3||i===6)&&(i=En.current,i!==null&&i.tag===13&&(i.flags|=16384))),pg(t,e)):pr(t)}function pr(e){var t=e;do{if((t.flags&32768)!==0){pg(t,Ja);return}e=t.return;var s=ZS(t.alternate,t,Da);if(s!==null){Ue=s;return}if(t=t.sibling,t!==null){Ue=t;return}Ue=t=e}while(t!==null);jt===0&&(jt=5)}function pg(e,t){do{var s=XS(e.alternate,e);if(s!==null){s.flags&=32767,Ue=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){Ue=e;return}Ue=e=s}while(e!==null);jt=6,Ue=null}function gg(e,t,s,i,c,f,y,_,E){e.cancelPendingCommit=null;do gr();while(Pt!==0);if((Xe&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(f=t.lanes|t.childLanes,f|=qc,_o(e,s,f,y,_,E),e===lt&&(Ue=lt=null,He=0),Ai=t,ts=e,ka=s,Xu=f,Qu=c,ig=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,r_(Le,function(){return _g(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=z.T,z.T=null,c=Y.p,Y.p=2,y=Xe,Xe|=4;try{QS(e,t,s)}finally{Xe=y,Y.p=c,z.T=i}}Pt=1,vg(),yg(),bg()}}function vg(){if(Pt===1){Pt=0;var e=ts,t=Ai,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=z.T,z.T=null;var i=Y.p;Y.p=2;var c=Xe;Xe|=4;try{Qp(t,e);var f=fd,y=am(e.containerInfo),_=f.focusedElem,E=f.selectionRange;if(y!==_&&_&&_.ownerDocument&&nm(_.ownerDocument.documentElement,_)){if(E!==null&&zc(_)){var O=E.start,G=E.end;if(G===void 0&&(G=O),"selectionStart"in _)_.selectionStart=O,_.selectionEnd=Math.min(G,_.value.length);else{var K=_.ownerDocument||document,L=K&&K.defaultView||window;if(L.getSelection){var V=L.getSelection(),ue=_.textContent.length,Se=Math.min(E.start,ue),it=E.end===void 0?Se:Math.min(E.end,ue);!V.extend&&Se>it&&(y=it,it=Se,Se=y);var k=tm(_,Se),w=tm(_,it);if(k&&w&&(V.rangeCount!==1||V.anchorNode!==k.node||V.anchorOffset!==k.offset||V.focusNode!==w.node||V.focusOffset!==w.offset)){var M=K.createRange();M.setStart(k.node,k.offset),V.removeAllRanges(),Se>it?(V.addRange(M),V.extend(w.node,w.offset)):(M.setEnd(w.node,w.offset),V.addRange(M))}}}}for(K=[],V=_;V=V.parentNode;)V.nodeType===1&&K.push({element:V,left:V.scrollLeft,top:V.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<K.length;_++){var $=K[_];$.element.scrollLeft=$.left,$.element.scrollTop=$.top}}Nr=!!dd,fd=dd=null}finally{Xe=c,Y.p=i,z.T=s}}e.current=t,Pt=2}}function yg(){if(Pt===2){Pt=0;var e=ts,t=Ai,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=z.T,z.T=null;var i=Y.p;Y.p=2;var c=Xe;Xe|=4;try{$p(e,t.alternate,t)}finally{Xe=c,Y.p=i,z.T=s}}Pt=3}}function bg(){if(Pt===4||Pt===3){Pt=0,ce();var e=ts,t=Ai,s=ka,i=ig;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Pt=5:(Pt=0,Ai=ts=null,Sg(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(es=null),Js(s),t=t.stateNode,Et&&typeof Et.onCommitFiberRoot=="function")try{Et.onCommitFiberRoot(rt,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=z.T,c=Y.p,Y.p=2,z.T=null;try{for(var f=e.onRecoverableError,y=0;y<i.length;y++){var _=i[y];f(_.value,{componentStack:_.stack})}}finally{z.T=t,Y.p=c}}(ka&3)!==0&&gr(),la(e),c=e.pendingLanes,(s&261930)!==0&&(c&42)!==0?e===Ju?Ml++:(Ml=0,Ju=e):Ml=0,Ol(0)}}function Sg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ml(t)))}function gr(){return vg(),yg(),bg(),_g()}function _g(){if(Pt!==5)return!1;var e=ts,t=Xu;Xu=0;var s=Js(ka),i=z.T,c=Y.p;try{Y.p=32>s?32:s,z.T=null,s=Qu,Qu=null;var f=ts,y=ka;if(Pt=0,Ai=ts=null,ka=0,(Xe&6)!==0)throw Error(o(331));var _=Xe;if(Xe|=4,ng(f.current),Wp(f,f.current,y,s),Xe=_,Ol(0,!1),Et&&typeof Et.onPostCommitFiberRoot=="function")try{Et.onPostCommitFiberRoot(rt,f)}catch{}return!0}finally{Y.p=c,z.T=i,Sg(e,t)}}function xg(e,t,s){t=zn(s,t),t=Du(e.stateNode,t,2),e=Ka(e,t,2),e!==null&&(Ia(e,2),la(e))}function nt(e,t,s){if(e.tag===3)xg(e,e,s);else for(;t!==null;){if(t.tag===3){xg(t,e,s);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(es===null||!es.has(i))){e=zn(s,e),s=Tp(2),i=Ka(t,s,2),i!==null&&(Ep(s,i,t,e),Ia(i,2),la(i));break}}t=t.return}}function td(e,t,s){var i=e.pingCache;if(i===null){i=e.pingCache=new e_;var c=new Set;i.set(t,c)}else c=i.get(t),c===void 0&&(c=new Set,i.set(t,c));c.has(s)||(Yu=!0,c.add(s),e=i_.bind(null,e,t,s),t.then(e,e))}function i_(e,t,s){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,lt===e&&(He&s)===s&&(jt===4||jt===3&&(He&62914560)===He&&300>de()-ur?(Xe&2)===0&&ji(e,0):Ku|=s,Ci===He&&(Ci=0)),la(e)}function Tg(e,t){t===0&&(t=Mn()),e=As(e,t),e!==null&&(Ia(e,t),la(e))}function l_(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Tg(e,s)}function o_(e,t){var s=0;switch(e.tag){case 31:case 13:var i=e.stateNode,c=e.memoizedState;c!==null&&(s=c.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(o(314))}i!==null&&i.delete(t),Tg(e,s)}function r_(e,t){return Xn(e,t)}var vr=null,wi=null,nd=!1,yr=!1,ad=!1,as=0;function la(e){e!==wi&&e.next===null&&(wi===null?vr=wi=e:wi=wi.next=e),yr=!0,nd||(nd=!0,u_())}function Ol(e,t){if(!ad&&yr){ad=!0;do for(var s=!1,i=vr;i!==null;){if(e!==0){var c=i.pendingLanes;if(c===0)var f=0;else{var y=i.suspendedLanes,_=i.pingedLanes;f=(1<<31-yt(42|e)+1)-1,f&=c&~(y&~_),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(s=!0,jg(i,f))}else f=He,f=ie(i,i===lt?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(f&3)===0||se(i,f)||(s=!0,jg(i,f));i=i.next}while(s);ad=!1}}function c_(){Eg()}function Eg(){yr=nd=!1;var e=0;as!==0&&S_()&&(e=as);for(var t=de(),s=null,i=vr;i!==null;){var c=i.next,f=Cg(i,t);f===0?(i.next=null,s===null?vr=c:s.next=c,c===null&&(wi=s)):(s=i,(e!==0||(f&3)!==0)&&(yr=!0)),i=c}Pt!==0&&Pt!==5||Ol(e),as!==0&&(as=0)}function Cg(e,t){for(var s=e.suspendedLanes,i=e.pingedLanes,c=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var y=31-yt(f),_=1<<y,E=c[y];E===-1?((_&s)===0||(_&i)!==0)&&(c[y]=Ct(_,t)):E<=t&&(e.expiredLanes|=_),f&=~_}if(t=lt,s=He,s=ie(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,s===0||e===t&&(tt===2||tt===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Z(i),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||se(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(i!==null&&Z(i),Js(s)){case 2:case 8:s=et;break;case 32:s=Le;break;case 268435456:s=Dt;break;default:s=Le}return i=Ag.bind(null,e),s=Xn(s,i),e.callbackPriority=t,e.callbackNode=s,t}return i!==null&&i!==null&&Z(i),e.callbackPriority=2,e.callbackNode=null,2}function Ag(e,t){if(Pt!==0&&Pt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(gr()&&e.callbackNode!==s)return null;var i=He;return i=ie(e,e===lt?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(og(e,i,t),Cg(e,de()),e.callbackNode!=null&&e.callbackNode===s?Ag.bind(null,e):null)}function jg(e,t){if(gr())return null;og(e,t,!0)}function u_(){x_(function(){(Xe&6)!==0?Xn(Ee,c_):Eg()})}function sd(){if(as===0){var e=mi;e===0&&(e=ae,ae<<=1,(ae&261888)===0&&(ae=256)),as=e}return as}function Ng(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ao(""+e)}function wg(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 d_(e,t,s,i,c){if(t==="submit"&&s&&s.stateNode===c){var f=Ng((c[Zt]||null).action),y=i.submitter;y&&(t=(t=y[Zt]||null)?Ng(t.formAction):y.getAttribute("formAction"),t!==null&&(f=t,y=null));var _=new Do("action","action",null,i,c);e.push({event:_,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(as!==0){var E=y?wg(c,y):new FormData(c);Eu(s,{pending:!0,data:E,method:c.method,action:f},null,E)}}else typeof f=="function"&&(_.preventDefault(),E=y?wg(c,y):new FormData(c),Eu(s,{pending:!0,data:E,method:c.method,action:f},f,E))},currentTarget:c}]})}}for(var id=0;id<Hc.length;id++){var ld=Hc[id],f_=ld.toLowerCase(),h_=ld[0].toUpperCase()+ld.slice(1);Jn(f_,"on"+h_)}Jn(lm,"onAnimationEnd"),Jn(om,"onAnimationIteration"),Jn(rm,"onAnimationStart"),Jn("dblclick","onDoubleClick"),Jn("focusin","onFocus"),Jn("focusout","onBlur"),Jn(wS,"onTransitionRun"),Jn(DS,"onTransitionStart"),Jn(kS,"onTransitionCancel"),Jn(cm,"onTransitionEnd"),ei("onMouseEnter",["mouseout","mouseover"]),ei("onMouseLeave",["mouseout","mouseover"]),ei("onPointerEnter",["pointerout","pointerover"]),ei("onPointerLeave",["pointerout","pointerover"]),xs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),xs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),xs("onBeforeInput",["compositionend","keypress","textInput","paste"]),xs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),xs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),xs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bl="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(" "),m_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Bl));function Dg(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var i=e[s],c=i.event;i=i.listeners;e:{var f=void 0;if(t)for(var y=i.length-1;0<=y;y--){var _=i[y],E=_.instance,O=_.currentTarget;if(_=_.listener,E!==f&&c.isPropagationStopped())break e;f=_,c.currentTarget=O;try{f(c)}catch(G){Mo(G)}c.currentTarget=null,f=E}else for(y=0;y<i.length;y++){if(_=i[y],E=_.instance,O=_.currentTarget,_=_.listener,E!==f&&c.isPropagationStopped())break e;f=_,c.currentTarget=O;try{f(c)}catch(G){Mo(G)}c.currentTarget=null,f=E}}}}function Ve(e,t){var s=t[Ws];s===void 0&&(s=t[Ws]=new Set);var i=e+"__bubble";s.has(i)||(kg(t,e,2,!1),s.add(i))}function od(e,t,s){var i=0;t&&(i|=4),kg(s,e,i,t)}var br="_reactListening"+Math.random().toString(36).slice(2);function rd(e){if(!e[br]){e[br]=!0,Eh.forEach(function(s){s!=="selectionchange"&&(m_.has(s)||od(s,!1,e),od(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[br]||(t[br]=!0,od("selectionchange",!1,t))}}function kg(e,t,s,i){switch(lv(t)){case 2:var c=q_;break;case 8:c=G_;break;default:c=Td}s=c.bind(null,t,s,e),c=void 0,!Nc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),i?c!==void 0?e.addEventListener(t,s,{capture:!0,passive:c}):e.addEventListener(t,s,!0):c!==void 0?e.addEventListener(t,s,{passive:c}):e.addEventListener(t,s,!1)}function cd(e,t,s,i,c){var f=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var y=i.tag;if(y===3||y===4){var _=i.stateNode.containerInfo;if(_===c)break;if(y===4)for(y=i.return;y!==null;){var E=y.tag;if((E===3||E===4)&&y.stateNode.containerInfo===c)return;y=y.return}for(;_!==null;){if(y=sn(_),y===null)return;if(E=y.tag,E===5||E===6||E===26||E===27){i=f=y;continue e}_=_.parentNode}}i=i.return}Lh(function(){var O=f,G=Ac(s),K=[];e:{var L=um.get(e);if(L!==void 0){var V=Do,ue=e;switch(e){case"keypress":if(No(s)===0)break e;case"keydown":case"keyup":V=oS;break;case"focusin":ue="focus",V=Rc;break;case"focusout":ue="blur",V=Rc;break;case"beforeblur":case"afterblur":V=Rc;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":V=Vh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":V=Z1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":V=uS;break;case lm:case om:case rm:V=J1;break;case cm:V=fS;break;case"scroll":case"scrollend":V=Y1;break;case"wheel":V=mS;break;case"copy":case"cut":case"paste":V=eS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":V=Hh;break;case"toggle":case"beforetoggle":V=gS}var Se=(t&4)!==0,it=!Se&&(e==="scroll"||e==="scrollend"),k=Se?L!==null?L+"Capture":null:L;Se=[];for(var w=O,M;w!==null;){var $=w;if(M=$.stateNode,$=$.tag,$!==5&&$!==26&&$!==27||M===null||k===null||($=al(w,k),$!=null&&Se.push(Ll(w,$,M))),it)break;w=w.return}0<Se.length&&(L=new V(L,ue,null,s,G),K.push({event:L,listeners:Se}))}}if((t&7)===0){e:{if(L=e==="mouseover"||e==="pointerover",V=e==="mouseout"||e==="pointerout",L&&s!==Cc&&(ue=s.relatedTarget||s.fromElement)&&(sn(ue)||ue[ma]))break e;if((V||L)&&(L=G.window===G?G:(L=G.ownerDocument)?L.defaultView||L.parentWindow:window,V?(ue=s.relatedTarget||s.toElement,V=O,ue=ue?sn(ue):null,ue!==null&&(it=u(ue),Se=ue.tag,ue!==it||Se!==5&&Se!==27&&Se!==6)&&(ue=null)):(V=null,ue=O),V!==ue)){if(Se=Vh,$="onMouseLeave",k="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(Se=Hh,$="onPointerLeave",k="onPointerEnter",w="pointer"),it=V==null?L:bt(V),M=ue==null?L:bt(ue),L=new Se($,w+"leave",V,s,G),L.target=it,L.relatedTarget=M,$=null,sn(G)===O&&(Se=new Se(k,w+"enter",ue,s,G),Se.target=M,Se.relatedTarget=it,$=Se),it=$,V&&ue)t:{for(Se=p_,k=V,w=ue,M=0,$=k;$;$=Se($))M++;$=0;for(var ve=w;ve;ve=Se(ve))$++;for(;0<M-$;)k=Se(k),M--;for(;0<$-M;)w=Se(w),$--;for(;M--;){if(k===w||w!==null&&k===w.alternate){Se=k;break t}k=Se(k),w=Se(w)}Se=null}else Se=null;V!==null&&Rg(K,L,V,Se,!1),ue!==null&&it!==null&&Rg(K,it,ue,Se,!0)}}e:{if(L=O?bt(O):window,V=L.nodeName&&L.nodeName.toLowerCase(),V==="select"||V==="input"&&L.type==="file")var Ye=Zh;else if(Yh(L))if(Xh)Ye=AS;else{Ye=ES;var me=TS}else V=L.nodeName,!V||V.toLowerCase()!=="input"||L.type!=="checkbox"&&L.type!=="radio"?O&&Ec(O.elementType)&&(Ye=Zh):Ye=CS;if(Ye&&(Ye=Ye(e,O))){Kh(K,Ye,s,G);break e}me&&me(e,L,O),e==="focusout"&&O&&L.type==="number"&&O.memoizedProps.value!=null&&Tc(L,"number",L.value)}switch(me=O?bt(O):window,e){case"focusin":(Yh(me)||me.contentEditable==="true")&&(li=me,Uc=O,dl=null);break;case"focusout":dl=Uc=li=null;break;case"mousedown":Vc=!0;break;case"contextmenu":case"mouseup":case"dragend":Vc=!1,sm(K,s,G);break;case"selectionchange":if(NS)break;case"keydown":case"keyup":sm(K,s,G)}var Oe;if(Oc)e:{switch(e){case"compositionstart":var qe="onCompositionStart";break e;case"compositionend":qe="onCompositionEnd";break e;case"compositionupdate":qe="onCompositionUpdate";break e}qe=void 0}else ii?Fh(e,s)&&(qe="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(qe="onCompositionStart");qe&&(qh&&s.locale!=="ko"&&(ii||qe!=="onCompositionStart"?qe==="onCompositionEnd"&&ii&&(Oe=zh()):(Ha=G,wc="value"in Ha?Ha.value:Ha.textContent,ii=!0)),me=Sr(O,qe),0<me.length&&(qe=new Ih(qe,e,null,s,G),K.push({event:qe,listeners:me}),Oe?qe.data=Oe:(Oe=$h(s),Oe!==null&&(qe.data=Oe)))),(Oe=yS?bS(e,s):SS(e,s))&&(qe=Sr(O,"onBeforeInput"),0<qe.length&&(me=new Ih("onBeforeInput","beforeinput",null,s,G),K.push({event:me,listeners:qe}),me.data=Oe)),d_(K,e,O,s,G)}Dg(K,t)})}function Ll(e,t,s){return{instance:e,listener:t,currentTarget:s}}function Sr(e,t){for(var s=t+"Capture",i=[];e!==null;){var c=e,f=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||f===null||(c=al(e,s),c!=null&&i.unshift(Ll(e,c,f)),c=al(e,t),c!=null&&i.push(Ll(e,c,f))),e.tag===3)return i;e=e.return}return[]}function p_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Rg(e,t,s,i,c){for(var f=t._reactName,y=[];s!==null&&s!==i;){var _=s,E=_.alternate,O=_.stateNode;if(_=_.tag,E!==null&&E===i)break;_!==5&&_!==26&&_!==27||O===null||(E=O,c?(O=al(s,f),O!=null&&y.unshift(Ll(s,O,E))):c||(O=al(s,f),O!=null&&y.push(Ll(s,O,E)))),s=s.return}y.length!==0&&e.push({event:t,listeners:y})}var g_=/\r\n?/g,v_=/\u0000|\uFFFD/g;function Mg(e){return(typeof e=="string"?e:""+e).replace(g_,`
|
|
25
|
+
`).replace(v_,"")}function Og(e,t){return t=Mg(t),Mg(e)===t}function st(e,t,s,i,c,f){switch(s){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||ni(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&ni(e,""+i);break;case"className":Eo(e,"class",i);break;case"tabIndex":Eo(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Eo(e,s,i);break;case"style":Oh(e,i,f);break;case"data":if(t!=="object"){Eo(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(s);break}i=Ao(""+i),e.setAttribute(s,i);break;case"action":case"formAction":if(typeof i=="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 f=="function"&&(s==="formAction"?(t!=="input"&&st(e,t,"name",c.name,c,null),st(e,t,"formEncType",c.formEncType,c,null),st(e,t,"formMethod",c.formMethod,c,null),st(e,t,"formTarget",c.formTarget,c,null)):(st(e,t,"encType",c.encType,c,null),st(e,t,"method",c.method,c,null),st(e,t,"target",c.target,c,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(s);break}i=Ao(""+i),e.setAttribute(s,i);break;case"onClick":i!=null&&(e.onclick=ga);break;case"onScroll":i!=null&&Ve("scroll",e);break;case"onScrollEnd":i!=null&&Ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(o(61));if(s=i.__html,s!=null){if(c.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}s=Ao(""+i),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":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,""+i):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":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":i===!0?e.setAttribute(s,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,i):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(s,i):e.removeAttribute(s);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(s):e.setAttribute(s,i);break;case"popover":Ve("beforetoggle",e),Ve("toggle",e),To(e,"popover",i);break;case"xlinkActuate":pa(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":pa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":pa(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":pa(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":pa(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":pa(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":pa(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":pa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":pa(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":To(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=F1.get(s)||s,To(e,s,i))}}function ud(e,t,s,i,c,f){switch(s){case"style":Oh(e,i,f);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(o(61));if(s=i.__html,s!=null){if(c.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"children":typeof i=="string"?ni(e,i):(typeof i=="number"||typeof i=="bigint")&&ni(e,""+i);break;case"onScroll":i!=null&&Ve("scroll",e);break;case"onScrollEnd":i!=null&&Ve("scrollend",e);break;case"onClick":i!=null&&(e.onclick=ga);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ch.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(c=s.endsWith("Capture"),t=s.slice(2,c?s.length-7:void 0),f=e[Zt]||null,f=f!=null?f[s]:null,typeof f=="function"&&e.removeEventListener(t,f,c),typeof i=="function")){typeof f!="function"&&f!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,i,c);break e}s in e?e[s]=i:i===!0?e.setAttribute(s,""):To(e,s,i)}}}function en(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ve("error",e),Ve("load",e);var i=!1,c=!1,f;for(f in s)if(s.hasOwnProperty(f)){var y=s[f];if(y!=null)switch(f){case"src":i=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:st(e,t,f,y,s,null)}}c&&st(e,t,"srcSet",s.srcSet,s,null),i&&st(e,t,"src",s.src,s,null);return;case"input":Ve("invalid",e);var _=f=y=c=null,E=null,O=null;for(i in s)if(s.hasOwnProperty(i)){var G=s[i];if(G!=null)switch(i){case"name":c=G;break;case"type":y=G;break;case"checked":E=G;break;case"defaultChecked":O=G;break;case"value":f=G;break;case"defaultValue":_=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(o(137,t));break;default:st(e,t,i,G,s,null)}}Dh(e,f,_,E,O,y,c,!1);return;case"select":Ve("invalid",e),i=y=f=null;for(c in s)if(s.hasOwnProperty(c)&&(_=s[c],_!=null))switch(c){case"value":f=_;break;case"defaultValue":y=_;break;case"multiple":i=_;default:st(e,t,c,_,s,null)}t=f,s=y,e.multiple=!!i,t!=null?ti(e,!!i,t,!1):s!=null&&ti(e,!!i,s,!0);return;case"textarea":Ve("invalid",e),f=c=i=null;for(y in s)if(s.hasOwnProperty(y)&&(_=s[y],_!=null))switch(y){case"value":i=_;break;case"defaultValue":c=_;break;case"children":f=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(o(91));break;default:st(e,t,y,_,s,null)}Rh(e,i,c,f);return;case"option":for(E in s)if(s.hasOwnProperty(E)&&(i=s[E],i!=null))switch(E){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:st(e,t,E,i,s,null)}return;case"dialog":Ve("beforetoggle",e),Ve("toggle",e),Ve("cancel",e),Ve("close",e);break;case"iframe":case"object":Ve("load",e);break;case"video":case"audio":for(i=0;i<Bl.length;i++)Ve(Bl[i],e);break;case"image":Ve("error",e),Ve("load",e);break;case"details":Ve("toggle",e);break;case"embed":case"source":case"link":Ve("error",e),Ve("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(O in s)if(s.hasOwnProperty(O)&&(i=s[O],i!=null))switch(O){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:st(e,t,O,i,s,null)}return;default:if(Ec(t)){for(G in s)s.hasOwnProperty(G)&&(i=s[G],i!==void 0&&ud(e,t,G,i,s,void 0));return}}for(_ in s)s.hasOwnProperty(_)&&(i=s[_],i!=null&&st(e,t,_,i,s,null))}function y_(e,t,s,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,f=null,y=null,_=null,E=null,O=null,G=null;for(V in s){var K=s[V];if(s.hasOwnProperty(V)&&K!=null)switch(V){case"checked":break;case"value":break;case"defaultValue":E=K;default:i.hasOwnProperty(V)||st(e,t,V,null,i,K)}}for(var L in i){var V=i[L];if(K=s[L],i.hasOwnProperty(L)&&(V!=null||K!=null))switch(L){case"type":f=V;break;case"name":c=V;break;case"checked":O=V;break;case"defaultChecked":G=V;break;case"value":y=V;break;case"defaultValue":_=V;break;case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(o(137,t));break;default:V!==K&&st(e,t,L,V,i,K)}}xc(e,y,_,E,O,G,f,c);return;case"select":V=y=_=L=null;for(f in s)if(E=s[f],s.hasOwnProperty(f)&&E!=null)switch(f){case"value":break;case"multiple":V=E;default:i.hasOwnProperty(f)||st(e,t,f,null,i,E)}for(c in i)if(f=i[c],E=s[c],i.hasOwnProperty(c)&&(f!=null||E!=null))switch(c){case"value":L=f;break;case"defaultValue":_=f;break;case"multiple":y=f;default:f!==E&&st(e,t,c,f,i,E)}t=_,s=y,i=V,L!=null?ti(e,!!s,L,!1):!!i!=!!s&&(t!=null?ti(e,!!s,t,!0):ti(e,!!s,s?[]:"",!1));return;case"textarea":V=L=null;for(_ in s)if(c=s[_],s.hasOwnProperty(_)&&c!=null&&!i.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:st(e,t,_,null,i,c)}for(y in i)if(c=i[y],f=s[y],i.hasOwnProperty(y)&&(c!=null||f!=null))switch(y){case"value":L=c;break;case"defaultValue":V=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(o(91));break;default:c!==f&&st(e,t,y,c,i,f)}kh(e,L,V);return;case"option":for(var ue in s)if(L=s[ue],s.hasOwnProperty(ue)&&L!=null&&!i.hasOwnProperty(ue))switch(ue){case"selected":e.selected=!1;break;default:st(e,t,ue,null,i,L)}for(E in i)if(L=i[E],V=s[E],i.hasOwnProperty(E)&&L!==V&&(L!=null||V!=null))switch(E){case"selected":e.selected=L&&typeof L!="function"&&typeof L!="symbol";break;default:st(e,t,E,L,i,V)}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 Se in s)L=s[Se],s.hasOwnProperty(Se)&&L!=null&&!i.hasOwnProperty(Se)&&st(e,t,Se,null,i,L);for(O in i)if(L=i[O],V=s[O],i.hasOwnProperty(O)&&L!==V&&(L!=null||V!=null))switch(O){case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(o(137,t));break;default:st(e,t,O,L,i,V)}return;default:if(Ec(t)){for(var it in s)L=s[it],s.hasOwnProperty(it)&&L!==void 0&&!i.hasOwnProperty(it)&&ud(e,t,it,void 0,i,L);for(G in i)L=i[G],V=s[G],!i.hasOwnProperty(G)||L===V||L===void 0&&V===void 0||ud(e,t,G,L,i,V);return}}for(var k in s)L=s[k],s.hasOwnProperty(k)&&L!=null&&!i.hasOwnProperty(k)&&st(e,t,k,null,i,L);for(K in i)L=i[K],V=s[K],!i.hasOwnProperty(K)||L===V||L==null&&V==null||st(e,t,K,L,i,V)}function Bg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function b_(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),i=0;i<s.length;i++){var c=s[i],f=c.transferSize,y=c.initiatorType,_=c.duration;if(f&&_&&Bg(y)){for(y=0,_=c.responseEnd,i+=1;i<s.length;i++){var E=s[i],O=E.startTime;if(O>_)break;var G=E.transferSize,K=E.initiatorType;G&&Bg(K)&&(E=E.responseEnd,y+=G*(E<_?1:(_-O)/(E-O)))}if(--i,t+=8*(f+y)/(c.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 dd=null,fd=null;function _r(e){return e.nodeType===9?e:e.ownerDocument}function Lg(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 zg(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 hd(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 md=null;function S_(){var e=window.event;return e&&e.type==="popstate"?e===md?!1:(md=e,!0):(md=null,!1)}var Ug=typeof setTimeout=="function"?setTimeout:void 0,__=typeof clearTimeout=="function"?clearTimeout:void 0,Vg=typeof Promise=="function"?Promise:void 0,x_=typeof queueMicrotask=="function"?queueMicrotask:typeof Vg<"u"?function(e){return Vg.resolve(null).then(e).catch(T_)}:Ug;function T_(e){setTimeout(function(){throw e})}function ss(e){return e==="head"}function Ig(e,t){var s=t,i=0;do{var c=s.nextSibling;if(e.removeChild(s),c&&c.nodeType===8)if(s=c.data,s==="/$"||s==="/&"){if(i===0){e.removeChild(c),Mi(t);return}i--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")i++;else if(s==="html")zl(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,zl(s);for(var f=s.firstChild;f;){var y=f.nextSibling,_=f.nodeName;f[Be]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&f.rel.toLowerCase()==="stylesheet"||s.removeChild(f),f=y}}else s==="body"&&zl(e.ownerDocument.body);s=c}while(s);Mi(t)}function Hg(e,t){var s=e;e=0;do{var i=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||""),i&&i.nodeType===8)if(s=i.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=i}while(s)}function pd(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":pd(s),Ie(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function E_(e,t,s,i){for(;e.nodeType===1;){var c=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[Be])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var f=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=qn(e.nextSibling),e===null)break}return null}function C_(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=qn(e.nextSibling),e===null))return null;return e}function qg(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=qn(e.nextSibling),e===null))return null;return e}function gd(e){return e.data==="$?"||e.data==="$~"}function vd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function A_(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var i=function(){t(),s.removeEventListener("DOMContentLoaded",i)};s.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function qn(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 yd=null;function Gg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return qn(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function Pg(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 Fg(e,t,s){switch(t=_r(s),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function zl(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ie(e)}var Gn=new Map,$g=new Set;function xr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ra=Y.d;Y.d={f:j_,r:N_,D:w_,C:D_,L:k_,m:R_,X:O_,S:M_,M:B_};function j_(){var e=Ra.f(),t=hr();return e||t}function N_(e){var t=Xt(e);t!==null&&t.tag===5&&t.type==="form"?cp(t):Ra.r(e)}var Di=typeof document>"u"?null:document;function Yg(e,t,s){var i=Di;if(i&&typeof t=="string"&&t){var c=Bn(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof s=="string"&&(c+='[crossorigin="'+s+'"]'),$g.has(c)||($g.add(c),e={rel:e,crossOrigin:s,href:t},i.querySelector(c)===null&&(t=i.createElement("link"),en(t,"link",e),mt(t),i.head.appendChild(t)))}}function w_(e){Ra.D(e),Yg("dns-prefetch",e,null)}function D_(e,t){Ra.C(e,t),Yg("preconnect",e,t)}function k_(e,t,s){Ra.L(e,t,s);var i=Di;if(i&&e&&t){var c='link[rel="preload"][as="'+Bn(t)+'"]';t==="image"&&s&&s.imageSrcSet?(c+='[imagesrcset="'+Bn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(c+='[imagesizes="'+Bn(s.imageSizes)+'"]')):c+='[href="'+Bn(e)+'"]';var f=c;switch(t){case"style":f=ki(e);break;case"script":f=Ri(e)}Gn.has(f)||(e=b({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),Gn.set(f,e),i.querySelector(c)!==null||t==="style"&&i.querySelector(Ul(f))||t==="script"&&i.querySelector(Vl(f))||(t=i.createElement("link"),en(t,"link",e),mt(t),i.head.appendChild(t)))}}function R_(e,t){Ra.m(e,t);var s=Di;if(s&&e){var i=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+Bn(i)+'"][href="'+Bn(e)+'"]',f=c;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Ri(e)}if(!Gn.has(f)&&(e=b({rel:"modulepreload",href:e},t),Gn.set(f,e),s.querySelector(c)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Vl(f)))return}i=s.createElement("link"),en(i,"link",e),mt(i),s.head.appendChild(i)}}}function M_(e,t,s){Ra.S(e,t,s);var i=Di;if(i&&e){var c=ht(i).hoistableStyles,f=ki(e);t=t||"default";var y=c.get(f);if(!y){var _={loading:0,preload:null};if(y=i.querySelector(Ul(f)))_.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},s),(s=Gn.get(f))&&bd(e,s);var E=y=i.createElement("link");mt(E),en(E,"link",e),E._p=new Promise(function(O,G){E.onload=O,E.onerror=G}),E.addEventListener("load",function(){_.loading|=1}),E.addEventListener("error",function(){_.loading|=2}),_.loading|=4,Tr(y,t,i)}y={type:"stylesheet",instance:y,count:1,state:_},c.set(f,y)}}}function O_(e,t){Ra.X(e,t);var s=Di;if(s&&e){var i=ht(s).hoistableScripts,c=Ri(e),f=i.get(c);f||(f=s.querySelector(Vl(c)),f||(e=b({src:e,async:!0},t),(t=Gn.get(c))&&Sd(e,t),f=s.createElement("script"),mt(f),en(f,"link",e),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(c,f))}}function B_(e,t){Ra.M(e,t);var s=Di;if(s&&e){var i=ht(s).hoistableScripts,c=Ri(e),f=i.get(c);f||(f=s.querySelector(Vl(c)),f||(e=b({src:e,async:!0,type:"module"},t),(t=Gn.get(c))&&Sd(e,t),f=s.createElement("script"),mt(f),en(f,"link",e),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(c,f))}}function Kg(e,t,s,i){var c=(c=P.current)?xr(c):null;if(!c)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=ki(s.href),s=ht(c).hoistableStyles,i=s.get(t),i||(i={type:"style",instance:null,count:0,state:null},s.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=ki(s.href);var f=ht(c).hoistableStyles,y=f.get(e);if(y||(c=c.ownerDocument||c,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,y),(f=c.querySelector(Ul(e)))&&!f._p&&(y.instance=f,y.state.loading=5),Gn.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},Gn.set(e,s),f||L_(c,e,s,y.state))),t&&i===null)throw Error(o(528,""));return y}if(t&&i!==null)throw Error(o(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ri(s),s=ht(c).hoistableScripts,i=s.get(t),i||(i={type:"script",instance:null,count:0,state:null},s.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function ki(e){return'href="'+Bn(e)+'"'}function Ul(e){return'link[rel="stylesheet"]['+e+"]"}function Zg(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function L_(e,t,s,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),en(t,"link",s),mt(t),e.head.appendChild(t))}function Ri(e){return'[src="'+Bn(e)+'"]'}function Vl(e){return"script[async]"+e}function Xg(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Bn(s.href)+'"]');if(i)return t.instance=i,mt(i),i;var c=b({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),mt(i),en(i,"style",c),Tr(i,s.precedence,e),t.instance=i;case"stylesheet":c=ki(s.href);var f=e.querySelector(Ul(c));if(f)return t.state.loading|=4,t.instance=f,mt(f),f;i=Zg(s),(c=Gn.get(c))&&bd(i,c),f=(e.ownerDocument||e).createElement("link"),mt(f);var y=f;return y._p=new Promise(function(_,E){y.onload=_,y.onerror=E}),en(f,"link",i),t.state.loading|=4,Tr(f,s.precedence,e),t.instance=f;case"script":return f=Ri(s.src),(c=e.querySelector(Vl(f)))?(t.instance=c,mt(c),c):(i=s,(c=Gn.get(f))&&(i=b({},s),Sd(i,c)),e=e.ownerDocument||e,c=e.createElement("script"),mt(c),en(c,"link",i),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,Tr(i,s.precedence,e));return t.instance}function Tr(e,t,s){for(var i=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=i.length?i[i.length-1]:null,f=c,y=0;y<i.length;y++){var _=i[y];if(_.dataset.precedence===t)f=_;else if(f!==c)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function bd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Sd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Er=null;function Qg(e,t,s){if(Er===null){var i=new Map,c=Er=new Map;c.set(s,i)}else c=Er,i=c.get(s),i||(i=new Map,c.set(s,i));if(i.has(e))return i;for(i.set(e,null),s=s.getElementsByTagName(e),c=0;c<s.length;c++){var f=s[c];if(!(f[Be]||f[zt]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var y=f.getAttribute(t)||"";y=e+y;var _=i.get(y);_?_.push(f):i.set(y,[f])}}return i}function Jg(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function z_(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 Wg(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function U_(e,t,s,i){if(s.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var c=ki(i.href),f=t.querySelector(Ul(c));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Cr.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=f,mt(f);return}f=t.ownerDocument||t,i=Zg(i),(c=Gn.get(c))&&bd(i,c),f=f.createElement("link"),mt(f);var y=f;y._p=new Promise(function(_,E){y.onload=_,y.onerror=E}),en(f,"link",i),s.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=Cr.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var _d=0;function V_(e,t){return e.stylesheets&&e.count===0&&jr(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var i=setTimeout(function(){if(e.stylesheets&&jr(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&_d===0&&(_d=62500*b_());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&jr(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>_d?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(c)}}:null}function Cr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)jr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ar=null;function jr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ar=new Map,t.forEach(I_,e),Ar=null,Cr.call(e))}function I_(e,t){if(!(t.state.loading&4)){var s=Ar.get(e);if(s)var i=s.get(null);else{s=new Map,Ar.set(e,s);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<c.length;f++){var y=c[f];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(s.set(y.dataset.precedence,y),i=y)}i&&s.set(null,i)}c=t.instance,y=c.getAttribute("data-precedence"),f=s.get(y)||i,f===i&&s.set(null,c),s.set(y,c),this.count++,i=Cr.bind(this),c.addEventListener("load",i),c.addEventListener("error",i),f?f.parentNode.insertBefore(c,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var Il={$$typeof:R,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function H_(e,t,s,i,c,f,y,_,E){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=Xs(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xs(0),this.hiddenUpdates=Xs(null),this.identifierPrefix=i,this.onUncaughtError=c,this.onCaughtError=f,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=E,this.incompleteTransitions=new Map}function ev(e,t,s,i,c,f,y,_,E,O,G,K){return e=new H_(e,t,s,y,E,O,G,K,_),t=1,f===!0&&(t|=24),f=Tn(3,null,null,t),e.current=f,f.stateNode=e,t=eu(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:i,isDehydrated:s,cache:t},su(f),e}function tv(e){return e?(e=ci,e):ci}function nv(e,t,s,i,c,f){c=tv(c),i.context===null?i.context=c:i.pendingContext=c,i=Ya(t),i.payload={element:s},f=f===void 0?null:f,f!==null&&(i.callback=f),s=Ka(e,i,t),s!==null&&(bn(s,e,t),yl(s,e,t))}function av(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function xd(e,t){av(e,t),(e=e.alternate)&&av(e,t)}function sv(e){if(e.tag===13||e.tag===31){var t=As(e,67108864);t!==null&&bn(t,e,67108864),xd(e,67108864)}}function iv(e){if(e.tag===13||e.tag===31){var t=Nn();t=Qs(t);var s=As(e,t);s!==null&&bn(s,e,t),xd(e,t)}}var Nr=!0;function q_(e,t,s,i){var c=z.T;z.T=null;var f=Y.p;try{Y.p=2,Td(e,t,s,i)}finally{Y.p=f,z.T=c}}function G_(e,t,s,i){var c=z.T;z.T=null;var f=Y.p;try{Y.p=8,Td(e,t,s,i)}finally{Y.p=f,z.T=c}}function Td(e,t,s,i){if(Nr){var c=Ed(i);if(c===null)cd(e,t,i,wr,s),ov(e,i);else if(F_(c,e,t,s,i))i.stopPropagation();else if(ov(e,i),t&4&&-1<P_.indexOf(e)){for(;c!==null;){var f=Xt(c);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var y=re(f.pendingLanes);if(y!==0){var _=f;for(_.pendingLanes|=2,_.entangledLanes|=2;y;){var E=1<<31-yt(y);_.entanglements[1]|=E,y&=~E}la(f),(Xe&6)===0&&(dr=de()+500,Ol(0))}}break;case 31:case 13:_=As(f,2),_!==null&&bn(_,f,2),hr(),xd(f,2)}if(f=Ed(i),f===null&&cd(e,t,i,wr,s),f===c)break;c=f}c!==null&&i.stopPropagation()}else cd(e,t,i,null,s)}}function Ed(e){return e=Ac(e),Cd(e)}var wr=null;function Cd(e){if(wr=null,e=sn(e),e!==null){var t=u(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=m(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 wr=e,null}function lv(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(Te()){case Ee:return 2;case et:return 8;case Le:case ot:return 32;case Dt:return 268435456;default:return 32}default:return 32}}var Ad=!1,is=null,ls=null,os=null,Hl=new Map,ql=new Map,rs=[],P_="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 ov(e,t){switch(e){case"focusin":case"focusout":is=null;break;case"dragenter":case"dragleave":ls=null;break;case"mouseover":case"mouseout":os=null;break;case"pointerover":case"pointerout":Hl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ql.delete(t.pointerId)}}function Gl(e,t,s,i,c,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:s,eventSystemFlags:i,nativeEvent:f,targetContainers:[c]},t!==null&&(t=Xt(t),t!==null&&sv(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function F_(e,t,s,i,c){switch(t){case"focusin":return is=Gl(is,e,t,s,i,c),!0;case"dragenter":return ls=Gl(ls,e,t,s,i,c),!0;case"mouseover":return os=Gl(os,e,t,s,i,c),!0;case"pointerover":var f=c.pointerId;return Hl.set(f,Gl(Hl.get(f)||null,e,t,s,i,c)),!0;case"gotpointercapture":return f=c.pointerId,ql.set(f,Gl(ql.get(f)||null,e,t,s,i,c)),!0}return!1}function rv(e){var t=sn(e.target);if(t!==null){var s=u(t);if(s!==null){if(t=s.tag,t===13){if(t=d(s),t!==null){e.blockedOn=t,nl(e.priority,function(){iv(s)});return}}else if(t===31){if(t=m(s),t!==null){e.blockedOn=t,nl(e.priority,function(){iv(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Ed(e.nativeEvent);if(s===null){s=e.nativeEvent;var i=new s.constructor(s.type,s);Cc=i,s.target.dispatchEvent(i),Cc=null}else return t=Xt(s),t!==null&&sv(t),e.blockedOn=s,!1;t.shift()}return!0}function cv(e,t,s){Dr(e)&&s.delete(t)}function $_(){Ad=!1,is!==null&&Dr(is)&&(is=null),ls!==null&&Dr(ls)&&(ls=null),os!==null&&Dr(os)&&(os=null),Hl.forEach(cv),ql.forEach(cv)}function kr(e,t){e.blockedOn===t&&(e.blockedOn=null,Ad||(Ad=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,$_)))}var Rr=null;function uv(e){Rr!==e&&(Rr=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Rr===e&&(Rr=null);for(var t=0;t<e.length;t+=3){var s=e[t],i=e[t+1],c=e[t+2];if(typeof i!="function"){if(Cd(i||s)===null)continue;break}var f=Xt(s);f!==null&&(e.splice(t,3),t-=3,Eu(f,{pending:!0,data:c,method:s.method,action:i},i,c))}}))}function Mi(e){function t(E){return kr(E,e)}is!==null&&kr(is,e),ls!==null&&kr(ls,e),os!==null&&kr(os,e),Hl.forEach(t),ql.forEach(t);for(var s=0;s<rs.length;s++){var i=rs[s];i.blockedOn===e&&(i.blockedOn=null)}for(;0<rs.length&&(s=rs[0],s.blockedOn===null);)rv(s),s.blockedOn===null&&rs.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(i=0;i<s.length;i+=3){var c=s[i],f=s[i+1],y=c[Zt]||null;if(typeof f=="function")y||uv(s);else if(y){var _=null;if(f&&f.hasAttribute("formAction")){if(c=f,y=f[Zt]||null)_=y.formAction;else if(Cd(c)!==null)continue}else _=y.action;typeof _=="function"?s[i+1]=_:(s.splice(i,3),i-=3),uv(s)}}}function dv(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(y){return c=y})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),i||setTimeout(s,20)}function s(){if(!i&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function jd(e){this._internalRoot=e}Mr.prototype.render=jd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var s=t.current,i=Nn();nv(s,i,e,t,null,null)},Mr.prototype.unmount=jd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;nv(e.current,2,null,e,null,null),hr(),t[ma]=null}};function Mr(e){this._internalRoot=e}Mr.prototype.unstable_scheduleHydration=function(e){if(e){var t=tl();e={blockedOn:null,target:e,priority:t};for(var s=0;s<rs.length&&t!==0&&t<rs[s].priority;s++);rs.splice(s,0,e),s===0&&rv(e)}};var fv=a.version;if(fv!=="19.2.4")throw Error(o(527,fv,"19.2.4"));Y.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=g(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var Y_={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Or=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Or.isDisabled&&Or.supportsFiber)try{rt=Or.inject(Y_),Et=Or}catch{}}return Pl.createRoot=function(e,t){if(!r(e))throw Error(o(299));var s=!1,i="",c=bp,f=Sp,y=_p;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(y=t.onRecoverableError)),t=ev(e,1,!1,null,null,s,i,null,c,f,y,dv),e[ma]=t.current,rd(e),new jd(t)},Pl.hydrateRoot=function(e,t,s){if(!r(e))throw Error(o(299));var i=!1,c="",f=bp,y=Sp,_=_p,E=null;return s!=null&&(s.unstable_strictMode===!0&&(i=!0),s.identifierPrefix!==void 0&&(c=s.identifierPrefix),s.onUncaughtError!==void 0&&(f=s.onUncaughtError),s.onCaughtError!==void 0&&(y=s.onCaughtError),s.onRecoverableError!==void 0&&(_=s.onRecoverableError),s.formState!==void 0&&(E=s.formState)),t=ev(e,1,!0,t,s??null,i,c,E,f,y,_,dv),t.context=tv(null),s=t.current,i=Nn(),i=Qs(i),c=Ya(i),c.callback=null,Ka(s,c,i),s=i,t.current.lanes=s,Ia(t,s),la(t),e[ma]=t.current,rd(e),new Mr(t)},Pl.version="19.2.4",Pl}var bv;function cx(){if(bv)return Nd.exports;bv=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(),Nd.exports=rx(),Nd.exports}var ux=cx();/**
|
|
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 Sv="popstate";function _v(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function dx(n={}){function a(o,r){var g;let u=(g=r.state)==null?void 0:g.masked,{pathname:d,search:m,hash:p}=u||o.location;return Wd("",{pathname:d,search:m,hash:p},r.state&&r.state.usr||null,r.state&&r.state.key||"default",u?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function l(o,r){return typeof r=="string"?r:io(r)}return hx(a,l,null,n)}function dt(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function Yn(n,a){if(!n){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function fx(){return Math.random().toString(36).substring(2,10)}function xv(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 Wd(n,a,l=null,o,r){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof a=="string"?$i(a):a,state:l,key:a&&a.key||o||fx(),unstable_mask:r}}function io({pathname:n="/",search:a="",hash:l=""}){return a&&a!=="?"&&(n+=a.charAt(0)==="?"?a:"?"+a),l&&l!=="#"&&(n+=l.charAt(0)==="#"?l:"#"+l),n}function $i(n){let a={};if(n){let l=n.indexOf("#");l>=0&&(a.hash=n.substring(l),n=n.substring(0,l));let o=n.indexOf("?");o>=0&&(a.search=n.substring(o),n=n.substring(0,o)),n&&(a.pathname=n)}return a}function hx(n,a,l,o={}){let{window:r=document.defaultView,v5Compat:u=!1}=o,d=r.history,m="POP",p=null,g=v();g==null&&(g=0,d.replaceState({...d.state,idx:g},""));function v(){return(d.state||{idx:null}).idx}function b(){m="POP";let N=v(),C=N==null?null:N-g;g=N,p&&p({action:m,location:j.location,delta:C})}function x(N,C){m="PUSH";let B=_v(N)?N:Wd(j.location,N,C);g=v()+1;let R=xv(B,g),X=j.createHref(B.unstable_mask||B);try{d.pushState(R,"",X)}catch(H){if(H instanceof DOMException&&H.name==="DataCloneError")throw H;r.location.assign(X)}u&&p&&p({action:m,location:j.location,delta:1})}function T(N,C){m="REPLACE";let B=_v(N)?N:Wd(j.location,N,C);g=v();let R=xv(B,g),X=j.createHref(B.unstable_mask||B);d.replaceState(R,"",X),u&&p&&p({action:m,location:j.location,delta:0})}function A(N){return mx(N)}let j={get action(){return m},get location(){return n(r,d)},listen(N){if(p)throw new Error("A history only accepts one active listener");return r.addEventListener(Sv,b),p=N,()=>{r.removeEventListener(Sv,b),p=null}},createHref(N){return a(r,N)},createURL:A,encodeLocation(N){let C=A(N);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:x,replace:T,go(N){return d.go(N)}};return j}function mx(n,a=!1){let l="http://localhost";typeof window<"u"&&(l=window.location.origin!=="null"?window.location.origin:window.location.href),dt(l,"No window.location.(origin|href) available to create URL");let o=typeof n=="string"?n:io(n);return o=o.replace(/ $/,"%20"),!a&&o.startsWith("//")&&(o=l+o),new URL(o,l)}function v0(n,a,l="/"){return px(n,a,l,!1)}function px(n,a,l,o){let r=typeof a=="string"?$i(a):a,u=za(r.pathname||"/",l);if(u==null)return null;let d=y0(n);gx(d);let m=null;for(let p=0;m==null&&p<d.length;++p){let g=S0(u);m=Cx(d[p],g,o)}return m}function y0(n,a=[],l=[],o="",r=!1){let u=(d,m,p=r,g)=>{let v={relativePath:g===void 0?d.path||"":g,caseSensitive:d.caseSensitive===!0,childrenIndex:m,route:d};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(o)&&p)return;dt(v.relativePath.startsWith(o),`Absolute route path "${v.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(o.length)}let b=da([o,v.relativePath]),x=l.concat(v);d.children&&d.children.length>0&&(dt(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),y0(d.children,a,x,b,p)),!(d.path==null&&!d.index)&&a.push({path:b,score:Tx(b,d.index),routesMeta:x})};return n.forEach((d,m)=>{var p;if(d.path===""||!((p=d.path)!=null&&p.includes("?")))u(d,m);else for(let g of b0(d.path))u(d,m,!0,g)}),a}function b0(n){let a=n.split("/");if(a.length===0)return[];let[l,...o]=a,r=l.endsWith("?"),u=l.replace(/\?$/,"");if(o.length===0)return r?[u,""]:[u];let d=b0(o.join("/")),m=[];return m.push(...d.map(p=>p===""?u:[u,p].join("/"))),r&&m.push(...d),m.map(p=>n.startsWith("/")&&p===""?"/":p)}function gx(n){n.sort((a,l)=>a.score!==l.score?l.score-a.score:Ex(a.routesMeta.map(o=>o.childrenIndex),l.routesMeta.map(o=>o.childrenIndex)))}var vx=/^:[\w-]+$/,yx=3,bx=2,Sx=1,_x=10,xx=-2,Tv=n=>n==="*";function Tx(n,a){let l=n.split("/"),o=l.length;return l.some(Tv)&&(o+=xx),a&&(o+=bx),l.filter(r=>!Tv(r)).reduce((r,u)=>r+(vx.test(u)?yx:u===""?Sx:_x),o)}function Ex(n,a){return n.length===a.length&&n.slice(0,-1).every((o,r)=>o===a[r])?n[n.length-1]-a[a.length-1]:0}function Cx(n,a,l=!1){let{routesMeta:o}=n,r={},u="/",d=[];for(let m=0;m<o.length;++m){let p=o[m],g=m===o.length-1,v=u==="/"?a:a.slice(u.length)||"/",b=lo({path:p.relativePath,caseSensitive:p.caseSensitive,end:g},v),x=p.route;if(!b&&g&&l&&!o[o.length-1].route.index&&(b=lo({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},v)),!b)return null;Object.assign(r,b.params),d.push({params:r,pathname:da([u,b.pathname]),pathnameBase:Dx(da([u,b.pathnameBase])),route:x}),b.pathnameBase!=="/"&&(u=da([u,b.pathnameBase]))}return d}function lo(n,a){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[l,o]=Ax(n.path,n.caseSensitive,n.end),r=a.match(l);if(!r)return null;let u=r[0],d=u.replace(/(.)\/+$/,"$1"),m=r.slice(1);return{params:o.reduce((g,{paramName:v,isOptional:b},x)=>{if(v==="*"){let A=m[x]||"";d=u.slice(0,u.length-A.length).replace(/(.)\/+$/,"$1")}const T=m[x];return b&&!T?g[v]=void 0:g[v]=(T||"").replace(/%2F/g,"/"),g},{}),pathname:u,pathnameBase:d,pattern:n}}function Ax(n,a=!1,l=!0){Yn(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 o=[],r="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,m,p,g,v)=>{if(o.push({paramName:m,isOptional:p!=null}),p){let b=v.charAt(g+d.length);return b&&b!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(o.push({paramName:"*"}),r+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?r+="\\/*$":n!==""&&n!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,a?void 0:"i"),o]}function S0(n){try{return n.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Yn(!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 za(n,a){if(a==="/")return n;if(!n.toLowerCase().startsWith(a.toLowerCase()))return null;let l=a.endsWith("/")?a.length-1:a.length,o=n.charAt(l);return o&&o!=="/"?null:n.slice(l)||"/"}var jx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Nx(n,a="/"){let{pathname:l,search:o="",hash:r=""}=typeof n=="string"?$i(n):n,u;return l?(l=l.replace(/\/\/+/g,"/"),l.startsWith("/")?u=Ev(l.substring(1),"/"):u=Ev(l,a)):u=a,{pathname:u,search:kx(o),hash:Rx(r)}}function Ev(n,a){let l=a.replace(/\/+$/,"").split("/");return n.split("/").forEach(r=>{r===".."?l.length>1&&l.pop():r!=="."&&l.push(r)}),l.length>1?l.join("/"):"/"}function kd(n,a,l,o){return`Cannot include a '${n}' character in a manually specified \`to.${a}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${l}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function wx(n){return n.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function Mf(n){let a=wx(n);return a.map((l,o)=>o===a.length-1?l.pathname:l.pathnameBase)}function rc(n,a,l,o=!1){let r;typeof n=="string"?r=$i(n):(r={...n},dt(!r.pathname||!r.pathname.includes("?"),kd("?","pathname","search",r)),dt(!r.pathname||!r.pathname.includes("#"),kd("#","pathname","hash",r)),dt(!r.search||!r.search.includes("#"),kd("#","search","hash",r)));let u=n===""||r.pathname==="",d=u?"/":r.pathname,m;if(d==null)m=l;else{let b=a.length-1;if(!o&&d.startsWith("..")){let x=d.split("/");for(;x[0]==="..";)x.shift(),b-=1;r.pathname=x.join("/")}m=b>=0?a[b]:"/"}let p=Nx(r,m),g=d&&d!=="/"&&d.endsWith("/"),v=(u||d===".")&&l.endsWith("/");return!p.pathname.endsWith("/")&&(g||v)&&(p.pathname+="/"),p}var da=n=>n.join("/").replace(/\/\/+/g,"/"),Dx=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),kx=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,Rx=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,Mx=class{constructor(n,a,l,o=!1){this.status=n,this.statusText=a||"",this.internal=o,l instanceof Error?(this.data=l.toString(),this.error=l):this.data=l}};function Ox(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function Bx(n){return n.map(a=>a.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var _0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function x0(n,a){let l=n;if(typeof l!="string"||!jx.test(l))return{absoluteURL:void 0,isExternal:!1,to:l};let o=l,r=!1;if(_0)try{let u=new URL(window.location.href),d=l.startsWith("//")?new URL(u.protocol+l):new URL(l),m=za(d.pathname,a);d.origin===u.origin&&m!=null?l=m+d.search+d.hash:r=!0}catch{Yn(!1,`<Link to="${l}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:r,to:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var T0=["POST","PUT","PATCH","DELETE"];new Set(T0);var Lx=["GET",...T0];new Set(Lx);var Yi=S.createContext(null);Yi.displayName="DataRouter";var cc=S.createContext(null);cc.displayName="DataRouterState";var zx=S.createContext(!1),E0=S.createContext({isTransitioning:!1});E0.displayName="ViewTransition";var Ux=S.createContext(new Map);Ux.displayName="Fetchers";var Vx=S.createContext(null);Vx.displayName="Await";var Rn=S.createContext(null);Rn.displayName="Navigation";var mo=S.createContext(null);mo.displayName="Location";var Kn=S.createContext({outlet:null,matches:[],isDataRoute:!1});Kn.displayName="Route";var Of=S.createContext(null);Of.displayName="RouteError";var C0="REACT_ROUTER_ERROR",Ix="REDIRECT",Hx="ROUTE_ERROR_RESPONSE";function qx(n){if(n.startsWith(`${C0}:${Ix}:{`))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 Gx(n){if(n.startsWith(`${C0}:${Hx}:{`))try{let a=JSON.parse(n.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new Mx(a.status,a.statusText,a.data)}catch{}}function Px(n,{relative:a}={}){dt(Ks(),"useHref() may be used only in the context of a <Router> component.");let{basename:l,navigator:o}=S.useContext(Rn),{hash:r,pathname:u,search:d}=po(n,{relative:a}),m=u;return l!=="/"&&(m=u==="/"?l:da([l,u])),o.createHref({pathname:m,search:d,hash:r})}function Ks(){return S.useContext(mo)!=null}function hn(){return dt(Ks(),"useLocation() may be used only in the context of a <Router> component."),S.useContext(mo).location}function dn(n){dt(Ks(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:a}=hn();return S.useMemo(()=>lo(n,S0(a)),[a,n])}var A0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function j0(n){S.useContext(Rn).static||S.useLayoutEffect(n)}function uc(){let{isDataRoute:n}=S.useContext(Kn);return n?iT():Fx()}function Fx(){dt(Ks(),"useNavigate() may be used only in the context of a <Router> component.");let n=S.useContext(Yi),{basename:a,navigator:l}=S.useContext(Rn),{matches:o}=S.useContext(Kn),{pathname:r}=hn(),u=JSON.stringify(Mf(o)),d=S.useRef(!1);return j0(()=>{d.current=!0}),S.useCallback((p,g={})=>{if(Yn(d.current,A0),!d.current)return;if(typeof p=="number"){l.go(p);return}let v=rc(p,JSON.parse(u),r,g.relative==="path");n==null&&a!=="/"&&(v.pathname=v.pathname==="/"?a:da([a,v.pathname])),(g.replace?l.replace:l.push)(v,g.state,g)},[a,l,u,r,n])}var $x=S.createContext(null);function Yx(n){let a=S.useContext(Kn).outlet;return S.useMemo(()=>a&&S.createElement($x.Provider,{value:n},a),[a,n])}function dc(){let{matches:n}=S.useContext(Kn),a=n[n.length-1];return a?a.params:{}}function po(n,{relative:a}={}){let{matches:l}=S.useContext(Kn),{pathname:o}=hn(),r=JSON.stringify(Mf(l));return S.useMemo(()=>rc(n,JSON.parse(r),o,a==="path"),[n,r,o,a])}function Kx(n,a){return N0(n,a)}function N0(n,a,l){var N;dt(Ks(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=S.useContext(Rn),{matches:r}=S.useContext(Kn),u=r[r.length-1],d=u?u.params:{},m=u?u.pathname:"/",p=u?u.pathnameBase:"/",g=u&&u.route;{let C=g&&g.path||"";D0(m,!g||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${C}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
35
|
+
|
|
36
|
+
Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let v=hn(),b;if(a){let C=typeof a=="string"?$i(a):a;dt(p==="/"||((N=C.pathname)==null?void 0:N.startsWith(p)),`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 "${p}" but pathname "${C.pathname}" was given in the \`location\` prop.`),b=C}else b=v;let x=b.pathname||"/",T=x;if(p!=="/"){let C=p.replace(/^\//,"").split("/");T="/"+x.replace(/^\//,"").split("/").slice(C.length).join("/")}let A=v0(n,{pathname:T});Yn(g||A!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Yn(A==null||A[A.length-1].route.element!==void 0||A[A.length-1].route.Component!==void 0||A[A.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let j=Wx(A&&A.map(C=>Object.assign({},C,{params:Object.assign({},d,C.params),pathname:da([p,o.encodeLocation?o.encodeLocation(C.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?p:da([p,o.encodeLocation?o.encodeLocation(C.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),r,l);return a&&j?S.createElement(mo.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...b},navigationType:"POP"}},j):j}function Zx(){let n=sT(),a=Ox(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),l=n instanceof Error?n.stack:null,o="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:o},u={padding:"2px 4px",backgroundColor:o},d=null;return console.error("Error handled by React Router default ErrorBoundary:",n),d=S.createElement(S.Fragment,null,S.createElement("p",null,"💿 Hey developer 👋"),S.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",S.createElement("code",{style:u},"ErrorBoundary")," or"," ",S.createElement("code",{style:u},"errorElement")," prop on your route.")),S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},a),l?S.createElement("pre",{style:r},l):null,d)}var Xx=S.createElement(Zx,null),w0=class extends S.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 l=Gx(n.digest);l&&(n=l)}let a=n!==void 0?S.createElement(Kn.Provider,{value:this.props.routeContext},S.createElement(Of.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?S.createElement(Qx,{error:n},a):a}};w0.contextType=zx;var Rd=new WeakMap;function Qx({children:n,error:a}){let{basename:l}=S.useContext(Rn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let o=qx(a.digest);if(o){let r=Rd.get(a);if(r)throw r;let u=x0(o.location,l);if(_0&&!Rd.get(a))if(u.isExternal||o.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:o.replace}));throw Rd.set(a,d),d}return S.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return n}function Jx({routeContext:n,match:a,children:l}){let o=S.useContext(Yi);return o&&o.static&&o.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=a.route.id),S.createElement(Kn.Provider,{value:n},l)}function Wx(n,a=[],l){let o=l==null?void 0:l.state;if(n==null){if(!o)return null;if(o.errors)n=o.matches;else if(a.length===0&&!o.initialized&&o.matches.length>0)n=o.matches;else return null}let r=n,u=o==null?void 0:o.errors;if(u!=null){let v=r.findIndex(b=>b.route.id&&(u==null?void 0:u[b.route.id])!==void 0);dt(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),r=r.slice(0,Math.min(r.length,v+1))}let d=!1,m=-1;if(l&&o){d=o.renderFallback;for(let v=0;v<r.length;v++){let b=r[v];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(m=v),b.route.id){let{loaderData:x,errors:T}=o,A=b.route.loader&&!x.hasOwnProperty(b.route.id)&&(!T||T[b.route.id]===void 0);if(b.route.lazy||A){l.isStatic&&(d=!0),m>=0?r=r.slice(0,m+1):r=[r[0]];break}}}}let p=l==null?void 0:l.onError,g=o&&p?(v,b)=>{var x,T;p(v,{location:o.location,params:((T=(x=o.matches)==null?void 0:x[0])==null?void 0:T.params)??{},unstable_pattern:Bx(o.matches),errorInfo:b})}:void 0;return r.reduceRight((v,b,x)=>{let T,A=!1,j=null,N=null;o&&(T=u&&b.route.id?u[b.route.id]:void 0,j=b.route.errorElement||Xx,d&&(m<0&&x===0?(D0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),A=!0,N=null):m===x&&(A=!0,N=b.route.hydrateFallbackElement||null)));let C=a.concat(r.slice(0,x+1)),B=()=>{let R;return T?R=j:A?R=N:b.route.Component?R=S.createElement(b.route.Component,null):b.route.element?R=b.route.element:R=v,S.createElement(Jx,{match:b,routeContext:{outlet:v,matches:C,isDataRoute:o!=null},children:R})};return o&&(b.route.ErrorBoundary||b.route.errorElement||x===0)?S.createElement(w0,{location:o.location,revalidation:o.revalidation,component:j,error:T,children:B(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:g}):B()},null)}function Bf(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function eT(n){let a=S.useContext(Yi);return dt(a,Bf(n)),a}function tT(n){let a=S.useContext(cc);return dt(a,Bf(n)),a}function nT(n){let a=S.useContext(Kn);return dt(a,Bf(n)),a}function Lf(n){let a=nT(n),l=a.matches[a.matches.length-1];return dt(l.route.id,`${n} can only be used on routes that contain a unique "id"`),l.route.id}function aT(){return Lf("useRouteId")}function sT(){var o;let n=S.useContext(Of),a=tT("useRouteError"),l=Lf("useRouteError");return n!==void 0?n:(o=a.errors)==null?void 0:o[l]}function iT(){let{router:n}=eT("useNavigate"),a=Lf("useNavigate"),l=S.useRef(!1);return j0(()=>{l.current=!0}),S.useCallback(async(r,u={})=>{Yn(l.current,A0),l.current&&(typeof r=="number"?await n.navigate(r):await n.navigate(r,{fromRouteId:a,...u}))},[n,a])}var Cv={};function D0(n,a,l){!a&&!Cv[n]&&(Cv[n]=!0,Yn(!1,l))}S.memo(lT);function lT({routes:n,future:a,state:l,isStatic:o,onError:r}){return N0(n,void 0,{state:l,isStatic:o,onError:r})}function Pr({to:n,replace:a,state:l,relative:o}){dt(Ks(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=S.useContext(Rn);Yn(!r,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=S.useContext(Kn),{pathname:d}=hn(),m=uc(),p=rc(n,Mf(u),d,o==="path"),g=JSON.stringify(p);return S.useEffect(()=>{m(JSON.parse(g),{replace:a,state:l,relative:o})},[m,g,o,a,l]),null}function k0(n){return Yx(n.context)}function Ot(n){dt(!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 oT({basename:n="/",children:a=null,location:l,navigationType:o="POP",navigator:r,static:u=!1,unstable_useTransitions:d}){dt(!Ks(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=n.replace(/^\/*/,"/"),p=S.useMemo(()=>({basename:m,navigator:r,static:u,unstable_useTransitions:d,future:{}}),[m,r,u,d]);typeof l=="string"&&(l=$i(l));let{pathname:g="/",search:v="",hash:b="",state:x=null,key:T="default",unstable_mask:A}=l,j=S.useMemo(()=>{let N=za(g,m);return N==null?null:{location:{pathname:N,search:v,hash:b,state:x,key:T,unstable_mask:A},navigationType:o}},[m,g,v,b,x,T,o,A]);return Yn(j!=null,`<Router basename="${m}"> is not able to match the URL "${g}${v}${b}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:S.createElement(Rn.Provider,{value:p},S.createElement(mo.Provider,{children:a,value:j}))}function rT({children:n,location:a}){return Kx(ef(n),a)}function ef(n,a=[]){let l=[];return S.Children.forEach(n,(o,r)=>{if(!S.isValidElement(o))return;let u=[...a,r];if(o.type===S.Fragment){l.push.apply(l,ef(o.props.children,u));return}dt(o.type===Ot,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),dt(!o.props.index||!o.props.children,"An index route cannot have child routes.");let d={id:o.props.id||u.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(d.children=ef(o.props.children,u)),l.push(d)}),l}var Fr="get",$r="application/x-www-form-urlencoded";function fc(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function cT(n){return fc(n)&&n.tagName.toLowerCase()==="button"}function uT(n){return fc(n)&&n.tagName.toLowerCase()==="form"}function dT(n){return fc(n)&&n.tagName.toLowerCase()==="input"}function fT(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function hT(n,a){return n.button===0&&(!a||a==="_self")&&!fT(n)}function tf(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((a,l)=>{let o=n[l];return a.concat(Array.isArray(o)?o.map(r=>[l,r]):[[l,o]])},[]))}function mT(n,a){let l=tf(n);return a&&a.forEach((o,r)=>{l.has(r)||a.getAll(r).forEach(u=>{l.append(r,u)})}),l}var Lr=null;function pT(){if(Lr===null)try{new FormData(document.createElement("form"),0),Lr=!1}catch{Lr=!0}return Lr}var gT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Md(n){return n!=null&&!gT.has(n)?(Yn(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${$r}"`),null):n}function vT(n,a){let l,o,r,u,d;if(uT(n)){let m=n.getAttribute("action");o=m?za(m,a):null,l=n.getAttribute("method")||Fr,r=Md(n.getAttribute("enctype"))||$r,u=new FormData(n)}else if(cT(n)||dT(n)&&(n.type==="submit"||n.type==="image")){let m=n.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=n.getAttribute("formaction")||m.getAttribute("action");if(o=p?za(p,a):null,l=n.getAttribute("formmethod")||m.getAttribute("method")||Fr,r=Md(n.getAttribute("formenctype"))||Md(m.getAttribute("enctype"))||$r,u=new FormData(m,n),!pT()){let{name:g,type:v,value:b}=n;if(v==="image"){let x=g?`${g}.`:"";u.append(`${x}x`,"0"),u.append(`${x}y`,"0")}else g&&u.append(g,b)}}else{if(fc(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');l=Fr,o=null,r=$r,d=n}return u&&r==="text/plain"&&(d=u,u=void 0),{action:o,method:l.toLowerCase(),encType:r,formData:u,body:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function zf(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function yT(n,a,l,o){let r=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return l?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${o}`:r.pathname=`${r.pathname}.${o}`:r.pathname==="/"?r.pathname=`_root.${o}`:a&&za(r.pathname,a)==="/"?r.pathname=`${a.replace(/\/$/,"")}/_root.${o}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${o}`,r}async function bT(n,a){if(n.id in a)return a[n.id];try{let l=await import(n.module);return a[n.id]=l,l}catch(l){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(l),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function ST(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 _T(n,a,l){let o=await Promise.all(n.map(async r=>{let u=a.routes[r.route.id];if(u){let d=await bT(u,l);return d.links?d.links():[]}return[]}));return CT(o.flat(1).filter(ST).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function Av(n,a,l,o,r,u){let d=(p,g)=>l[g]?p.route.id!==l[g].route.id:!0,m=(p,g)=>{var v;return l[g].pathname!==p.pathname||((v=l[g].route.path)==null?void 0:v.endsWith("*"))&&l[g].params["*"]!==p.params["*"]};return u==="assets"?a.filter((p,g)=>d(p,g)||m(p,g)):u==="data"?a.filter((p,g)=>{var b;let v=o.routes[p.route.id];if(!v||!v.hasLoader)return!1;if(d(p,g)||m(p,g))return!0;if(p.route.shouldRevalidate){let x=p.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:((b=l[0])==null?void 0:b.params)||{},nextUrl:new URL(n,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function xT(n,a,{includeHydrateFallback:l}={}){return TT(n.map(o=>{let r=a.routes[o.route.id];if(!r)return[];let u=[r.module];return r.clientActionModule&&(u=u.concat(r.clientActionModule)),r.clientLoaderModule&&(u=u.concat(r.clientLoaderModule)),l&&r.hydrateFallbackModule&&(u=u.concat(r.hydrateFallbackModule)),r.imports&&(u=u.concat(r.imports)),u}).flat(1))}function TT(n){return[...new Set(n)]}function ET(n){let a={},l=Object.keys(n).sort();for(let o of l)a[o]=n[o];return a}function CT(n,a){let l=new Set;return new Set(a),n.reduce((o,r)=>{let u=JSON.stringify(ET(r));return l.has(u)||(l.add(u),o.push({key:u,link:r})),o},[])}function R0(){let n=S.useContext(Yi);return zf(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function AT(){let n=S.useContext(cc);return zf(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Uf=S.createContext(void 0);Uf.displayName="FrameworkContext";function M0(){let n=S.useContext(Uf);return zf(n,"You must render this element inside a <HydratedRouter> element"),n}function jT(n,a){let l=S.useContext(Uf),[o,r]=S.useState(!1),[u,d]=S.useState(!1),{onFocus:m,onBlur:p,onMouseEnter:g,onMouseLeave:v,onTouchStart:b}=a,x=S.useRef(null);S.useEffect(()=>{if(n==="render"&&d(!0),n==="viewport"){let j=C=>{C.forEach(B=>{d(B.isIntersecting)})},N=new IntersectionObserver(j,{threshold:.5});return x.current&&N.observe(x.current),()=>{N.disconnect()}}},[n]),S.useEffect(()=>{if(o){let j=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(j)}}},[o]);let T=()=>{r(!0)},A=()=>{r(!1),d(!1)};return l?n!=="intent"?[u,x,{}]:[u,x,{onFocus:Fl(m,T),onBlur:Fl(p,A),onMouseEnter:Fl(g,T),onMouseLeave:Fl(v,A),onTouchStart:Fl(b,T)}]:[!1,x,{}]}function Fl(n,a){return l=>{n&&n(l),l.defaultPrevented||a(l)}}function NT({page:n,...a}){let{router:l}=R0(),o=S.useMemo(()=>v0(l.routes,n,l.basename),[l.routes,n,l.basename]);return o?S.createElement(DT,{page:n,matches:o,...a}):null}function wT(n){let{manifest:a,routeModules:l}=M0(),[o,r]=S.useState([]);return S.useEffect(()=>{let u=!1;return _T(n,a,l).then(d=>{u||r(d)}),()=>{u=!0}},[n,a,l]),o}function DT({page:n,matches:a,...l}){let o=hn(),{future:r,manifest:u,routeModules:d}=M0(),{basename:m}=R0(),{loaderData:p,matches:g}=AT(),v=S.useMemo(()=>Av(n,a,g,u,o,"data"),[n,a,g,u,o]),b=S.useMemo(()=>Av(n,a,g,u,o,"assets"),[n,a,g,u,o]),x=S.useMemo(()=>{if(n===o.pathname+o.search+o.hash)return[];let j=new Set,N=!1;if(a.forEach(B=>{var X;let R=u.routes[B.route.id];!R||!R.hasLoader||(!v.some(H=>H.route.id===B.route.id)&&B.route.id in p&&((X=d[B.route.id])!=null&&X.shouldRevalidate)||R.hasClientLoader?N=!0:j.add(B.route.id))}),j.size===0)return[];let C=yT(n,m,r.unstable_trailingSlashAwareDataRequests,"data");return N&&j.size>0&&C.searchParams.set("_routes",a.filter(B=>j.has(B.route.id)).map(B=>B.route.id).join(",")),[C.pathname+C.search]},[m,r.unstable_trailingSlashAwareDataRequests,p,o,u,v,a,n,d]),T=S.useMemo(()=>xT(b,u),[b,u]),A=wT(b);return S.createElement(S.Fragment,null,x.map(j=>S.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...l})),T.map(j=>S.createElement("link",{key:j,rel:"modulepreload",href:j,...l})),A.map(({key:j,link:N})=>S.createElement("link",{key:j,nonce:l.nonce,...N,crossOrigin:N.crossOrigin??l.crossOrigin})))}function kT(...n){return a=>{n.forEach(l=>{typeof l=="function"?l(a):l!=null&&(l.current=a)})}}var RT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{RT&&(window.__reactRouterVersion="7.13.1")}catch{}function MT({basename:n,children:a,unstable_useTransitions:l,window:o}){let r=S.useRef();r.current==null&&(r.current=dx({window:o,v5Compat:!0}));let u=r.current,[d,m]=S.useState({action:u.action,location:u.location}),p=S.useCallback(g=>{l===!1?m(g):S.startTransition(()=>m(g))},[l]);return S.useLayoutEffect(()=>u.listen(p),[u,p]),S.createElement(oT,{basename:n,children:a,location:d.location,navigationType:d.action,navigator:u,unstable_useTransitions:l})}var O0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Vf=S.forwardRef(function({onClick:a,discover:l="render",prefetch:o="none",relative:r,reloadDocument:u,replace:d,unstable_mask:m,state:p,target:g,to:v,preventScrollReset:b,viewTransition:x,unstable_defaultShouldRevalidate:T,...A},j){let{basename:N,navigator:C,unstable_useTransitions:B}=S.useContext(Rn),R=typeof v=="string"&&O0.test(v),X=x0(v,N);v=X.to;let H=Px(v,{relative:r}),J=hn(),W=null;if(m){let q=rc(m,[],J.unstable_mask?J.unstable_mask.pathname:"/",!0);N!=="/"&&(q.pathname=q.pathname==="/"?N:da([N,q.pathname])),W=C.createHref(q)}let[F,ne,ge]=jT(o,A),U=zT(v,{replace:d,unstable_mask:m,state:p,target:g,preventScrollReset:b,relative:r,viewTransition:x,unstable_defaultShouldRevalidate:T,unstable_useTransitions:B});function pe(q){a&&a(q),q.defaultPrevented||U(q)}let te=!(X.isExternal||u),ye=S.createElement("a",{...A,...ge,href:(te?W:void 0)||X.absoluteURL||H,onClick:te?pe:a,ref:kT(j,ne),target:g,"data-discover":!R&&l==="render"?"true":void 0});return F&&!R?S.createElement(S.Fragment,null,ye,S.createElement(NT,{page:H})):ye});Vf.displayName="Link";var OT=S.forwardRef(function({"aria-current":a="page",caseSensitive:l=!1,className:o="",end:r=!1,style:u,to:d,viewTransition:m,children:p,...g},v){let b=po(d,{relative:g.relative}),x=hn(),T=S.useContext(cc),{navigator:A,basename:j}=S.useContext(Rn),N=T!=null&&qT(b)&&m===!0,C=A.encodeLocation?A.encodeLocation(b).pathname:b.pathname,B=x.pathname,R=T&&T.navigation&&T.navigation.location?T.navigation.location.pathname:null;l||(B=B.toLowerCase(),R=R?R.toLowerCase():null,C=C.toLowerCase()),R&&j&&(R=za(R,j)||R);const X=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let H=B===C||!r&&B.startsWith(C)&&B.charAt(X)==="/",J=R!=null&&(R===C||!r&&R.startsWith(C)&&R.charAt(C.length)==="/"),W={isActive:H,isPending:J,isTransitioning:N},F=H?a:void 0,ne;typeof o=="function"?ne=o(W):ne=[o,H?"active":null,J?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let ge=typeof u=="function"?u(W):u;return S.createElement(Vf,{...g,"aria-current":F,className:ne,ref:v,style:ge,to:d,viewTransition:m},typeof p=="function"?p(W):p)});OT.displayName="NavLink";var BT=S.forwardRef(({discover:n="render",fetcherKey:a,navigate:l,reloadDocument:o,replace:r,state:u,method:d=Fr,action:m,onSubmit:p,relative:g,preventScrollReset:v,viewTransition:b,unstable_defaultShouldRevalidate:x,...T},A)=>{let{unstable_useTransitions:j}=S.useContext(Rn),N=IT(),C=HT(m,{relative:g}),B=d.toLowerCase()==="get"?"get":"post",R=typeof m=="string"&&O0.test(m),X=H=>{if(p&&p(H),H.defaultPrevented)return;H.preventDefault();let J=H.nativeEvent.submitter,W=(J==null?void 0:J.getAttribute("formmethod"))||d,F=()=>N(J||H.currentTarget,{fetcherKey:a,method:W,navigate:l,replace:r,state:u,relative:g,preventScrollReset:v,viewTransition:b,unstable_defaultShouldRevalidate:x});j&&l!==!1?S.startTransition(()=>F()):F()};return S.createElement("form",{ref:A,method:B,action:C,onSubmit:o?p:X,...T,"data-discover":!R&&n==="render"?"true":void 0})});BT.displayName="Form";function LT(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function B0(n){let a=S.useContext(Yi);return dt(a,LT(n)),a}function zT(n,{target:a,replace:l,unstable_mask:o,state:r,preventScrollReset:u,relative:d,viewTransition:m,unstable_defaultShouldRevalidate:p,unstable_useTransitions:g}={}){let v=uc(),b=hn(),x=po(n,{relative:d});return S.useCallback(T=>{if(hT(T,a)){T.preventDefault();let A=l!==void 0?l:io(b)===io(x),j=()=>v(n,{replace:A,unstable_mask:o,state:r,preventScrollReset:u,relative:d,viewTransition:m,unstable_defaultShouldRevalidate:p});g?S.startTransition(()=>j()):j()}},[b,v,x,l,o,r,a,n,u,d,m,p,g])}function If(n){Yn(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=S.useRef(tf(n)),l=S.useRef(!1),o=hn(),r=S.useMemo(()=>mT(o.search,l.current?null:a.current),[o.search]),u=uc(),d=S.useCallback((m,p)=>{const g=tf(typeof m=="function"?m(new URLSearchParams(r)):m);l.current=!0,u("?"+g,p)},[u,r]);return[r,d]}var UT=0,VT=()=>`__${String(++UT)}__`;function IT(){let{router:n}=B0("useSubmit"),{basename:a}=S.useContext(Rn),l=aT(),o=n.fetch,r=n.navigate;return S.useCallback(async(u,d={})=>{let{action:m,method:p,encType:g,formData:v,body:b}=vT(u,a);if(d.navigate===!1){let x=d.fetcherKey||VT();await o(x,l,d.action||m,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:v,body:b,formMethod:d.method||p,formEncType:d.encType||g,flushSync:d.flushSync})}else await r(d.action||m,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:v,body:b,formMethod:d.method||p,formEncType:d.encType||g,replace:d.replace,state:d.state,fromRouteId:l,flushSync:d.flushSync,viewTransition:d.viewTransition})},[o,r,a,l])}function HT(n,{relative:a}={}){let{basename:l}=S.useContext(Rn),o=S.useContext(Kn);dt(o,"useFormAction must be used inside a RouteContext");let[r]=o.matches.slice(-1),u={...po(n||".",{relative:a})},d=hn();if(n==null){u.search=d.search;let m=new URLSearchParams(u.search),p=m.getAll("index");if(p.some(v=>v==="")){m.delete("index"),p.filter(b=>b).forEach(b=>m.append("index",b));let v=m.toString();u.search=v?`?${v}`:""}}return(!n||n===".")&&r.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),l!=="/"&&(u.pathname=u.pathname==="/"?l:da([l,u.pathname])),io(u)}function qT(n,{relative:a}={}){let l=S.useContext(E0);dt(l!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=B0("useViewTransitionState"),r=po(n,{relative:a});if(!l.isTransitioning)return!1;let u=za(l.currentLocation.pathname,o)||l.currentLocation.pathname,d=za(l.nextLocation.pathname,o)||l.nextLocation.pathname;return lo(r.pathname,d)!=null||lo(r.pathname,u)!=null}function na(){const n=uc();return S.useCallback((a,l)=>{typeof a=="number"?n(a):n(a,l)},[n])}function L0(n){return`/sessions/${encodeURIComponent(n)}`}function oo(n){return`/projects/${encodeURIComponent(n)}`}function ms(n,a){const l=`/tasks/${encodeURIComponent(n)}`;return a?`${l}/${a}`:l}function GT(n){return`/tasks/${encodeURIComponent(n)}/edit`}function $s(n,a){const l=new URLSearchParams({project:n});return a&&l.set("parent",a),`/tasks/new?${l.toString()}`}function z0(n,a){return`/sessions/new?${new URLSearchParams({env:n,runtime:a}).toString()}`}const jv="/environments/new",qi="/settings",PT="/pair";function rn(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function Wl(n,a){return console.warn(`[ws] Malformed "${n}" message: ${a}`),!1}function FT(n){return rn(n)&&typeof n.id=="string"&&typeof n.displayName=="string"&&typeof n.adapterType=="string"&&typeof n.defaultRuntime=="string"&&typeof n.status=="string"&&typeof n.bootstrapped=="boolean"}function Nv(n){return rn(n)&&typeof n.id=="string"&&typeof n.environmentId=="string"&&typeof n.runtime=="string"&&typeof n.status=="string"&&typeof n.prompt=="string"&&typeof n.startedAt=="string"&&(n.endedAt===void 0||typeof n.endedAt=="string")&&(n.error===void 0||typeof n.error=="string")}function wv(n){return rn(n)&&typeof n.sessionId=="string"&&typeof n.eventType=="string"&&typeof n.timestamp=="string"&&typeof n.content=="string"&&(n.raw===void 0||typeof n.raw=="string")}function $T(n){return rn(n)&&typeof n.id=="string"&&typeof n.name=="string"&&typeof n.description=="string"&&typeof n.repoUrl=="string"&&typeof n.defaultEnvironmentId=="string"&&typeof n.status=="string"&&typeof n.createdAt=="string"&&typeof n.updatedAt=="string"}function YT(n){return rn(n)&&typeof n.id=="string"&&typeof n.projectId=="string"&&typeof n.title=="string"&&typeof n.status=="string"&&typeof n.branch=="string"&&typeof n.sortOrder=="number"&&typeof n.depth=="number"&&Array.isArray(n.dependsOn)&&Array.isArray(n.childTaskIds)}function KT(n){return rn(n)&&typeof n.id=="string"&&typeof n.projectId=="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 ZT(n){return rn(n)&&typeof n.name=="string"&&typeof n.tokenType=="string"&&typeof n.envVar=="string"&&typeof n.filePath=="string"&&typeof n.expiresAt=="string"}const XT=new Set(["off","subscription","api_key"]),Od=new Set(["off","on"]);function QT(n){return rn(n)&&XT.has(n.claude)&&Od.has(n.github)&&Od.has(n.copilot)&&Od.has(n.codex)}function JT(n){return rn(n)&&typeof n.environmentId=="string"&&typeof n.stage=="string"&&typeof n.message=="string"&&typeof n.progress=="number"}function WT(n){return rn(n)&&typeof n.name=="string"&&typeof n.repository=="string"&&typeof n.state=="string"&&typeof n.gitStatus=="string"}function eE(n){return rn(n)&&typeof n.id=="string"&&typeof n.name=="string"&&typeof n.description=="string"&&typeof n.systemPrompt=="string"&&typeof n.toolConfig=="string"&&typeof n.runtime=="string"&&typeof n.model=="string"&&typeof n.maxTurns=="number"&&typeof n.mcpServers=="string"&&typeof n.createdAt=="string"&&typeof n.updatedAt=="string"}function oa(n,a,l,o){return Array.isArray(n)?n.filter((r,u)=>a(r)?!0:(Wl(l,`item at index ${u} in "${o}" has unexpected shape`),!1)):(Wl(l,`expected "${o}" to be an array, got ${typeof n}`),[])}function tE(n){let a;try{a=JSON.parse(n)}catch{console.warn("[ws] Failed to parse WebSocket message as JSON");return}if(!rn(a)||typeof a.type!="string"){console.warn("[ws] Received WebSocket message without a string 'type' field:",a);return}return{type:a.type,payload:rn(a.payload)?a.payload:void 0}}function nE(n){switch(n){case"waiting_input":return"idle";case"killed":return"interrupted";default:return n}}const aE=3e3,Oi=5e3,sE=4001;function iE(n){const a=typeof window<"u"?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`:"ws://localhost:3000",l=S.useRef(void 0),[o,r]=S.useState(!1),[u,d]=S.useState([]),[m,p]=S.useState([]),[g,v]=S.useState([]),[b,x]=S.useState(0),[T,A]=S.useState(void 0),[j,N]=S.useState([]),[C,B]=S.useState([]),[R,X]=S.useState([]),[H,J]=S.useState([]),[W,F]=S.useState({claude:"off",github:"off",copilot:"off",codex:"off"}),[ne,ge]=S.useState({}),[U,pe]=S.useState([]),[te,ye]=S.useState(""),[q,z]=S.useState(""),[Y,ee]=S.useState(!1),[ke,je]=S.useState([]),[Pe,we]=S.useState({}),[_e,Ce]=S.useState(!1),[Q,P]=S.useState(void 0),I=S.useCallback(ae=>{var Me;((Me=l.current)==null?void 0:Me.readyState)===WebSocket.OPEN&&l.current.send(JSON.stringify(ae))},[]);S.useEffect(()=>{let ae,Me;function be(){ae=new WebSocket(a),l.current=ae,ae.onopen=()=>{r(!0),I({type:"list_environments"}),I({type:"list_sessions"}),I({type:"list_projects"}),I({type:"list_tokens"}),I({type:"get_credential_providers"}),I({type:"list_personas"}),I({type:"subscribe_all"})},ae.onmessage=re=>{var se,Ct,Mn,Xs,Ia,_o,Ji,Wi,el,Qs,Js,tl,nl,Qn,zt,Zt,ma,Ws,xo;if(typeof re.data!="string"){console.warn("[ws] Received non-string WebSocket message; ignoring");return}const ie=tE(re.data);if(ie)switch(ie.type){case"environments":d(oa((se=ie.payload)==null?void 0:se.environments,FT,"environments","environments"));break;case"sessions":p(oe=>{var Xt;const Fe=oa((Xt=ie.payload)==null?void 0:Xt.sessions,Nv,"sessions","sessions"),Be=new Map(oe.map(bt=>[bt.id,bt.status])),Ie=new Set(["pending","running","idle"]),sn=new Set(["completed","failed","interrupted"]);return Fe.map(bt=>{const ht=Be.get(bt.id);if(!ht||ht===bt.status)return bt;if(sn.has(ht)&&Ie.has(bt.status))return{...bt,status:ht};if(Ie.has(ht)&&Ie.has(bt.status)){const mt=["pending","running","idle"];if(mt.indexOf(ht)>mt.indexOf(bt.status))return{...bt,status:ht}}return bt})});break;case"session_event":{if(!wv(ie.payload)){Wl("session_event","payload is not a valid SessionEvent");break}const oe=ie.payload;let Fe=0;if(v(Be=>{const Ie=[...Be,oe];return Ie.length>Oi?(Fe=Ie.length-Oi,Ie.slice(-Oi)):Ie}),Fe>0&&x(Be=>Be+Fe),oe.eventType==="status"){const Be=nE(oe.content);p(Ie=>Ie.some(Xt=>Xt.id===oe.sessionId)?Ie.map(Xt=>Xt.id===oe.sessionId?{...Xt,status:Be}:Xt):[...Ie,{id:oe.sessionId,environmentId:"",runtime:"",status:Be,prompt:"",startedAt:oe.timestamp}])}break}case"session_events":{const oe=oa((Ct=ie.payload)==null?void 0:Ct.events,wv,"session_events","events"),Fe=(Mn=ie.payload)==null?void 0:Mn.sessionId;if(typeof Fe!="string"){Wl("session_events","missing or non-string sessionId");break}if(oe.length>0){let Be=0;v(Ie=>{const sn=new Set;for(const ht of Ie)ht.sessionId===Fe&&sn.add(`${ht.timestamp}|${ht.eventType}`);const Xt=oe.filter(ht=>!sn.has(`${ht.timestamp}|${ht.eventType}`)),bt=[...Ie,...Xt].sort((ht,mt)=>ht.sessionId!==mt.sessionId?0:ht.timestamp.localeCompare(mt.timestamp));return bt.length>Oi?(Be=bt.length-Oi,bt.slice(-Oi)):bt}),Be>0&&x(Ie=>Ie+Be)}break}case"spawned":{const oe=(Xs=ie.payload)==null?void 0:Xs.sessionId;typeof oe=="string"&&oe&&A(oe),I({type:"list_sessions"});break}case"projects":N(oa((Ia=ie.payload)==null?void 0:Ia.projects,$T,"projects","projects"));break;case"project_created":Ce(!1),I({type:"list_projects"});break;case"project_archived":I({type:"list_projects"});break;case"project_updated":I({type:"list_projects"});break;case"tasks":{const oe=oa((_o=ie.payload)==null?void 0:_o.tasks,YT,"tasks","tasks"),Fe=(typeof((Ji=ie.payload)==null?void 0:Ji.projectId)=="string"?ie.payload.projectId:"")||(oe.length>0?oe[0].projectId:"");if(!Fe){B(oe);break}B(Be=>[...Be.filter(Ie=>Ie.projectId!==Fe),...oe]);break}case"task_created":{const oe=(Wi=ie.payload)==null?void 0:Wi.task;if(rn(oe)){const Fe=typeof oe.project_id=="string"?oe.project_id:typeof oe.projectId=="string"?oe.projectId:"";Fe&&I({type:"list_tasks",payload:{projectId:Fe}})}break}case"task_started":{const oe=ie.payload;if(!rn(oe))break;P(Be=>oe.taskId&&Be===oe.taskId?void 0:Be),oe.sessionId&&(I({type:"list_sessions"}),typeof oe.taskId=="string"&&typeof oe.sessionId=="string"&&B(Be=>Be.map(Ie=>Ie.id===oe.taskId?{...Ie,latestSessionId:oe.sessionId}:Ie)));const Fe=typeof oe.projectId=="string"?oe.projectId:void 0;Fe?I({type:"list_tasks",payload:{projectId:Fe}}):oe.taskId&&B(Be=>{const Ie=Be.find(sn=>sn.id===oe.taskId);return Ie&&I({type:"list_tasks",payload:{projectId:Ie.projectId}}),Be});break}case"task_completed":case"task_deleted":case"task_updated":{const oe=ie.payload;if(!rn(oe))break;const Fe=typeof oe.projectId=="string"?oe.projectId:void 0;Fe?I({type:"list_tasks",payload:{projectId:Fe}}):oe.taskId&&B(Be=>{const Ie=Be.find(sn=>sn.id===oe.taskId);return Ie&&I({type:"list_tasks",payload:{projectId:Ie.projectId}}),Be});break}case"findings":X(oa((el=ie.payload)==null?void 0:el.findings,KT,"findings","findings"));break;case"finding_posted":typeof((Qs=ie.payload)==null?void 0:Qs.projectId)=="string"&&I({type:"list_findings",payload:{projectId:ie.payload.projectId}});break;case"tokens":J(oa((Js=ie.payload)==null?void 0:Js.tokens,ZT,"tokens","tokens"));break;case"token_changed":I({type:"list_tokens"});break;case"credential_providers":QT(ie.payload)&&F(ie.payload);break;case"provision_progress":{if(!JT(ie.payload)){Wl("provision_progress","payload is not a valid ProvisionStatus with environmentId");break}const oe=ie.payload;ge(Fe=>({...Fe,[oe.environmentId]:{stage:oe.stage,message:oe.message,progress:oe.progress}})),oe.stage==="ready"&&setTimeout(()=>{ge(Be=>{const Ie={...Be};return delete Ie[oe.environmentId],Ie})},5e3);break}case"environment_added":break;case"environment_removed":if(typeof((tl=ie.payload)==null?void 0:tl.environmentId)=="string"){const oe=ie.payload.environmentId;d(Fe=>Fe.filter(Be=>Be.id!==oe)),ge(Fe=>{const Be={...Fe};return delete Be[oe],Be})}I({type:"list_sessions"});break;case"codespaces_list":{const oe=oa((nl=ie.payload)==null?void 0:nl.codespaces,WT,"codespaces_list","codespaces"),Fe=typeof((Qn=ie.payload)==null?void 0:Qn.error)=="string"?ie.payload.error:"";pe(oe),z(Fe);break}case"codespace_created":{ee(!1),I({type:"list_codespaces"});break}case"codespace_create_error":{ee(!1);const oe=typeof((zt=ie.payload)==null?void 0:zt.message)=="string"?ie.payload.message:"Failed to create codespace";ye(oe);break}case"personas":{const oe=oa((Zt=ie.payload)==null?void 0:Zt.personas,eE,"personas","personas");je(oe);break}case"persona_created":case"persona_updated":case"persona_deleted":I({type:"list_personas"});break;case"task_sessions":{const oe=(ma=ie.payload)==null?void 0:ma.taskId;if(typeof oe!="string"||!oe)break;const Fe=oa((Ws=ie.payload)==null?void 0:Ws.sessions,Nv,"task_sessions","sessions");we(Be=>({...Be,[oe]:Fe}));break}case"error":console.error("[ws]",(xo=ie.payload)==null?void 0:xo.message);break}},ae.onclose=re=>{if(r(!1),l.current=void 0,Ce(!1),P(void 0),clearTimeout(Me),re.code===sE){window.location.href=PT;return}Me=setTimeout(be,aE)},ae.onerror=()=>{ae.close()}}return be(),()=>{clearTimeout(Me),ae==null||ae.close()}},[a,I]);const De=S.useCallback((ae,Me,be,re,ie,se)=>{I({type:"spawn",payload:{environmentId:ae,prompt:Me,model:be||"",runtime:re||"",personaId:ie||"",worktreeBasePath:se||""}})},[I]),$e=S.useCallback((ae,Me)=>{I({type:"send_input",payload:{sessionId:ae,text:Me}})},[I]),vt=S.useCallback(ae=>{I({type:"kill",payload:{sessionId:ae}})},[I]),xt=S.useCallback(()=>{I({type:"list_environments"}),I({type:"list_sessions"}),I({type:"list_projects"}),I({type:"list_tokens"})},[I]),Gt=S.useCallback(ae=>{I({type:"get_session_events",payload:{sessionId:ae}})},[I]),We=S.useCallback(()=>{v([]),x(0)},[]),Ze=S.useCallback((ae,Me,be,re)=>{Ce(!0),I({type:"create_project",payload:{name:ae,description:Me||"",repoUrl:be||"",defaultEnvironmentId:re||""}})},[I]),ze=S.useCallback(ae=>{I({type:"archive_project",payload:{projectId:ae}})},[I]),Sn=S.useCallback((ae,Me)=>{I({type:"update_project",payload:{projectId:ae,...Me}})},[I]),_n=S.useCallback(ae=>{I({type:"list_tasks",payload:{projectId:ae}})},[I]),Zn=S.useCallback((ae,Me,be,re,ie)=>{I({type:"create_task",payload:{projectId:ae,title:Me,description:be||"",dependsOn:re||[],parentTaskId:ie||""}})},[I]),an=S.useCallback((ae,Me,be,re,ie,se)=>{P(ae),I({type:"start_task",payload:{taskId:ae,runtime:Me||"",model:be||"",personaId:re||"",environmentId:ie||"",notes:se||""}})},[I]),Xn=S.useCallback(ae=>{I({type:"complete_task",payload:{taskId:ae}})},[I]),Z=S.useCallback(ae=>{I({type:"resume_task",payload:{taskId:ae}})},[I]),le=S.useCallback((ae,Me,be,re)=>{I({type:"update_task",payload:{taskId:ae,title:Me,description:be,dependsOn:re}})},[I]),ce=S.useCallback(ae=>{I({type:"delete_task",payload:{taskId:ae}})},[I]),de=S.useCallback(ae=>{I({type:"list_findings",payload:{projectId:ae}})},[I]),Te=S.useCallback((ae,Me,be,re,ie)=>{I({type:"post_finding",payload:{projectId:ae,title:Me,content:be,category:re||"general",tags:ie||[]}})},[I]),Ee=S.useCallback(()=>{I({type:"list_tokens"})},[I]),et=S.useCallback((ae,Me,be,re,ie)=>{I({type:"set_token",payload:{name:ae,value:Me,tokenType:be,envVar:re,filePath:ie}})},[I]),Le=S.useCallback(ae=>{I({type:"delete_token",payload:{name:ae}})},[I]),ot=S.useCallback(ae=>{I({type:"set_credential_providers",payload:ae})},[I]),Dt=S.useCallback((ae,Me,be,re)=>{const ie={displayName:ae,adapterType:Me,adapterConfig:be||{}};re&&(ie.defaultRuntime=re),I({type:"add_environment",payload:ie})},[I]),Tt=S.useCallback(ae=>{I({type:"provision_environment",payload:{environmentId:ae}})},[I]),Lt=S.useCallback(ae=>{I({type:"stop_environment",payload:{environmentId:ae}})},[I]),rt=S.useCallback(ae=>{I({type:"remove_environment",payload:{environmentId:ae}})},[I]),Et=S.useCallback(()=>{I({type:"list_codespaces"})},[I]),cn=S.useCallback((ae,Me)=>{if(!o){ye("Not connected to server. Please try again once the connection is restored.");return}ee(!0),ye("");const be={repo:ae};Me&&(be.machine=Me),I({type:"create_codespace",payload:be})},[I,o]),yt=S.useCallback((ae,Me,be,re,ie,se)=>{I({type:"create_persona",payload:{name:ae,description:Me,systemPrompt:be,runtime:re||"",model:ie||"",maxTurns:se||0}})},[I]),$t=S.useCallback((ae,Me,be,re,ie,se,Ct)=>{I({type:"update_persona",payload:{personaId:ae,name:Me||"",description:be||"",systemPrompt:re||"",runtime:ie||"",model:se||"",maxTurns:Ct||0}})},[I]),Yt=S.useCallback(ae=>{I({type:"delete_persona",payload:{personaId:ae}})},[I]),_s=S.useCallback(ae=>{I({type:"get_task_sessions",payload:{taskId:ae}})},[I]);return{connected:o,environments:u,sessions:m,events:g,eventsDropped:b,lastSpawnedId:T,projects:j,tasks:C,findings:R,tokens:H,spawn:De,sendInput:$e,kill:vt,refresh:xt,loadSessionEvents:Gt,clearEvents:We,createProject:Ze,archiveProject:ze,updateProject:Sn,loadTasks:_n,createTask:Zn,startTask:an,completeTask:Xn,resumeTask:Z,updateTask:le,deleteTask:ce,loadFindings:de,postFinding:Te,addEnvironment:Dt,loadTokens:Ee,setToken:et,deleteToken:Le,credentialProviders:W,updateCredentialProviders:ot,provisionStatus:ne,provisionEnvironment:Tt,stopEnvironment:Lt,removeEnvironment:rt,codespaces:U,codespaceError:te,codespaceListError:q,codespaceCreating:Y,listCodespaces:Et,createCodespace:cn,projectCreating:_e,taskStartingId:Q,personas:ke,createPersona:yt,updatePersona:$t,deletePersona:Yt,taskSessions:Pe,loadTaskSessions:_s}}const Hf=S.createContext(void 0);function lE({children:n}){const a=iE();return h.jsx(Hf.Provider,{value:a,children:n})}function nn(){const n=S.useContext(Hf);if(!n)throw new Error("useGrackle must be used within GrackleProvider");return n}const oE=[{id:"env-local-01",displayName:"Local Dev",adapterType:"local",defaultRuntime:"claude-code",status:"connected",bootstrapped:!0},{id:"env-docker-01",displayName:"Docker Sandbox",adapterType:"docker",defaultRuntime:"claude-code",status:"connected",bootstrapped:!0},{id:"env-cs-01",displayName:"GitHub Codespace",adapterType:"codespace",defaultRuntime:"claude-code",status:"connected",bootstrapped:!0},{id:"env-remote-01",displayName:"Staging (SSH)",adapterType:"ssh",defaultRuntime:"claude-code",status:"disconnected",bootstrapped:!1}],rE=[{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"}],cE=[{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"}],uE=[{id:"proj-alpha",name:"Project Alpha",description:"Core platform API and authentication services",repoUrl:"https://github.com/acme/alpha",defaultEnvironmentId:"env-local-01",status:"active",worktreeBasePath:"",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",defaultEnvironmentId:"env-docker-01",status:"active",worktreeBasePath:"",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:"",defaultEnvironmentId:"env-local-01",status:"archived",worktreeBasePath:"",createdAt:"2025-11-20T09:00:00Z",updatedAt:"2025-11-20T09:00:00Z"}],dE=[{id:"task-001",projectId:"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},{id:"task-001a",projectId:"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},{id:"task-001b",projectId:"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},{id:"task-001c",projectId:"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},{id:"task-002",projectId:"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},{id:"task-003",projectId:"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},{id:"task-004",projectId:"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},{id:"task-005",projectId:"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},{id:"task-006",projectId:"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},{id:"task-006a",projectId:"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},{id:"task-006b",projectId:"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},{id:"task-006c",projectId:"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},{id:"task-006d",projectId:"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},{id:"task-007",projectId:"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},{id:"task-007a",projectId:"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},{id:"task-007b",projectId:"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},{id:"task-008",projectId:"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}],Dv=[{id:"find-001",projectId:"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",projectId:"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",projectId:"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",projectId:"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",projectId:"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",projectId:"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",projectId:"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"}],fE=[{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:""}],hE=[{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"},{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"},{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"},{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"}],mE={"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 Ft(n){return new Date(Date.now()+n).toISOString()}const kv=[{label:"API Refactor",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Ft(0),content:"running"}},{delayMs:800,event:{eventType:"output",timestamp:Ft(800),content:"Analyzing current API structure in src/routes/..."}},{delayMs:1600,event:{eventType:"output",timestamp:Ft(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:Ft(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:Ft(4e3),content:"Running test suite... 22 tests passed, 3 updated, 0 failed."}},{delayMs:5e3,event:{eventType:"status",timestamp:Ft(5e3),content:"completed"}}]},{label:"Database Migration",pauseForInput:!0,pauseAfterStep:3,steps:[{delayMs:0,event:{eventType:"status",timestamp:Ft(0),content:"running"}},{delayMs:600,event:{eventType:"output",timestamp:Ft(600),content:"Scanning current schema for migration targets..."}},{delayMs:1400,event:{eventType:"output",timestamp:Ft(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:Ft(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:Ft(0),content:"Proceeding with migration..."}},{delayMs:1500,event:{eventType:"output",timestamp:Ft(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:Ft(2e3),content:"All 3 migrations applied. Running verification queries... OK."}},{delayMs:3200,event:{eventType:"status",timestamp:Ft(2700),content:"completed"}}]},{label:"Test Writer",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Ft(0),content:"running"}},{delayMs:700,event:{eventType:"output",timestamp:Ft(700),content:"Generating test scaffolding for src/services/billing.ts..."}},{delayMs:1800,event:{eventType:"output",timestamp:Ft(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:Ft(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:Ft(3500),content:"failed"}}]}],Rv=400;function pE({children:n}){const[a,l]=S.useState(rE),[o,r]=S.useState(cE),[u,d]=S.useState(void 0),[m,p]=S.useState(uE),[g,v]=S.useState(dE),[b,x]=S.useState(Dv),[T,A]=S.useState(fE),[j,N]=S.useState({claude:"off",github:"off",copilot:"off",codex:"off"}),[C,B]=S.useState(hE),[R]=S.useState(mE),X=S.useRef(0),H=S.useRef(0),J=S.useRef(new Set),W=S.useRef(new Map),F=S.useRef(g);F.current=g;const ne=S.useRef(new Map),ge=S.useRef(new Map),U=S.useCallback(Z=>(X.current+=1,`mock-${Z}-${String(X.current).padStart(3,"0")}`),[]),pe=S.useCallback(()=>{const Z=kv[H.current%kv.length];return H.current+=1,Z},[]),te=S.useCallback((Z,le,ce)=>{const de=setTimeout(()=>{var Te;J.current.delete(de),ce&&((Te=W.current.get(ce))==null||Te.delete(de)),Z()},le);J.current.add(de),ce&&(W.current.has(ce)||W.current.set(ce,new Set),W.current.get(ce).add(de))},[]),ye=S.useCallback(Z=>{const le=W.current.get(Z);le&&(le.forEach(ce=>{clearTimeout(ce),J.current.delete(ce)}),W.current.delete(Z))},[]),q=S.useCallback((Z,le)=>{l(ce=>ce.map(de=>de.id===Z?{...de,status:le}:de))},[]),z=S.useCallback(Z=>{r(le=>[...le,Z])},[]),Y=S.useCallback((Z,le,ce)=>{le.forEach((de,Te)=>{te(()=>{const Ee={sessionId:Z,...de.event,timestamp:new Date().toISOString()};z(Ee),de.event.eventType==="status"&&q(Z,de.event.content),Te===le.length-1&&ce&&ce()},de.delayMs,Z)})},[te,z,q]),ee=S.useCallback((Z,le,ce,de)=>{console.log("[MockGrackle] spawn",{environmentId:Z,prompt:le,runtime:de});const Te=U("sess"),Ee={id:Te,environmentId:Z,runtime:de||"claude-code",status:"running",prompt:le,startedAt:new Date().toISOString()};l(Le=>[...Le,Ee]),d(Te);const et=pe();if(console.log(`[MockGrackle] Playing scenario: ${et.label}`),et.pauseForInput){const Le=et.pauseAfterStep??et.steps.length-1,ot=et.steps.slice(0,Le+1),Dt=ot.length>0?ot[ot.length-1].delayMs:0;Y(Te,ot),te(()=>{q(Te,"idle"),z({sessionId:Te,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},Dt+Rv,Te),et.resumeSteps&&ne.current.set(Te,et.resumeSteps)}else Y(Te,et.steps)},[U,pe,Y,te,q,z]),ke=S.useCallback(Z=>{console.log("[MockGrackle] kill",Z),ye(Z),ne.current.delete(Z),q(Z,"interrupted"),z({sessionId:Z,eventType:"status",timestamp:new Date().toISOString(),content:"interrupted"}),v(le=>le.map(ce=>ce.latestSessionId===Z&&ce.status==="working"?{...ce,status:"not_started"}:ce))},[ye,q,z]),je=S.useCallback(()=>{console.log("[MockGrackle] refresh")},[]),Pe=S.useCallback(Z=>{console.log("[MockGrackle] loadSessionEvents",Z)},[]),we=S.useCallback(()=>{console.log("[MockGrackle] clearEvents"),r([])},[]),_e=S.useCallback((Z,le,ce,de)=>{console.log("[MockGrackle] createProject",{name:Z,description:le});const Te={id:U("proj"),name:Z,description:le||"",repoUrl:ce||"",defaultEnvironmentId:de||"",status:"active",worktreeBasePath:"",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};p(Ee=>[...Ee,Te])},[U]),Ce=S.useCallback(Z=>{console.log("[MockGrackle] archiveProject",Z),p(le=>le.map(ce=>ce.id===Z?{...ce,status:"archived"}:ce))},[]),Q=S.useCallback(Z=>{console.log("[MockGrackle] loadTasks",Z)},[]),P=S.useCallback((Z,le,ce,de,Te)=>{console.log("[MockGrackle] createTask",{projectId:Z,title:le,parentTaskId:Te}),v(Ee=>{const Le=Ee.filter(Lt=>Lt.projectId===Z).reduce((Lt,rt)=>Math.max(Lt,rt.sortOrder),0),ot=Te?Ee.find(Lt=>Lt.id===Te):void 0;if(Te&&!ot)return console.warn("[MockGrackle] Parent task not found:",Te),Ee;if(ot&&!ot.canDecompose)return console.warn("[MockGrackle] Parent task does not have decomposition rights:",Te),Ee;const Dt=ot?ot.depth+1:0,Tt={id:U("task"),projectId:Z,title:le,description:ce||"",status:"not_started",branch:"",latestSessionId:"",dependsOn:de||[],reviewNotes:void 0,sortOrder:Le+1,createdAt:new Date().toISOString(),parentTaskId:Te||"",depth:Dt,childTaskIds:[],canDecompose:!Te};return[...Ee,Tt]})},[U]),I=S.useCallback((Z,le,ce)=>{var ot;console.log("[MockGrackle] startTask",{taskId:Z,runtime:le});const de=F.current.find(Dt=>Dt.id===Z),Te=(de==null?void 0:de.title)??"",Ee=U("sess"),et={id:Ee,environmentId:"env-local-01",runtime:le||"claude-code",status:"running",prompt:Te||Z,startedAt:new Date().toISOString()};l(Dt=>[...Dt,et]),v(Dt=>Dt.map(Tt=>Tt.id===Z?{...Tt,status:"working",latestSessionId:Ee,branch:`mock/${Z.slice(0,8)}`}:Tt));const Le=pe();if(console.log(`[MockGrackle] Playing task scenario: ${Le.label}`),Le.pauseForInput){const Dt=Le.pauseAfterStep??Le.steps.length-1,Tt=Le.steps.slice(0,Dt+1),Lt=Tt.length>0?Tt[Tt.length-1].delayMs:0;if(Y(Ee,Tt),te(()=>{q(Ee,"idle"),z({sessionId:Ee,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},Lt+Rv,Ee),Le.resumeSteps){const rt=[...Le.resumeSteps];ne.current.set(Ee,rt);const Et=rt.reduce((cn,yt)=>Math.max(cn,yt.delayMs),0);ge.current.set(Ee,{taskId:Z,delayAfterResume:Et+200})}}else{const Dt=Le.steps.length>0?Le.steps[Le.steps.length-1].delayMs:0;Y(Ee,Le.steps);const Tt=(ot=Le.steps[Le.steps.length-1])==null?void 0:ot.event.content;te(()=>{Tt==="completed"?v(Lt=>Lt.map(rt=>rt.id===Z&&rt.status==="working"?{...rt,status:"paused"}:rt)):Tt==="failed"&&v(Lt=>Lt.map(rt=>rt.id===Z&&rt.status==="working"?{...rt,status:"failed"}:rt))},Dt+100,Ee)}},[U,pe,Y,te,q,z]),De=S.useCallback((Z,le)=>{console.log("[MockGrackle] sendInput",{sessionId:Z,text:le}),z({sessionId:Z,eventType:"output",timestamp:new Date().toISOString(),content:`User input: ${le}`}),q(Z,"running"),z({sessionId:Z,eventType:"status",timestamp:new Date().toISOString(),content:"running"});const ce=ne.current.get(Z);if(ce)ne.current.delete(Z),Y(Z,ce);else{const Te=[{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"}}];Y(Z,Te)}const de=ge.current.get(Z);de&&(ge.current.delete(Z),te(()=>{v(Te=>Te.map(Ee=>Ee.id===de.taskId&&Ee.status==="working"?{...Ee,status:"paused"}:Ee))},de.delayAfterResume,Z))},[z,q,Y,te]),$e=S.useCallback(Z=>{console.log("[MockGrackle] completeTask",Z),v(le=>le.map(ce=>ce.id===Z?{...ce,status:"complete"}:ce))},[]),vt=S.useCallback(Z=>{console.log("[MockGrackle] resumeTask",Z)},[]),xt=S.useCallback((Z,le,ce,de)=>{console.log("[MockGrackle] updateTask",{taskId:Z,title:le}),v(Te=>Te.map(Ee=>Ee.id===Z?{...Ee,title:le.trim()||Ee.title,description:ce,dependsOn:de}:Ee))},[]),Gt=S.useCallback(Z=>{console.log("[MockGrackle] deleteTask",Z),v(le=>le.filter(ce=>ce.id!==Z))},[]),We=S.useCallback(Z=>{console.log("[MockGrackle] loadFindings",Z),x(Dv.filter(le=>le.projectId===Z))},[]),Ze=S.useCallback((Z,le,ce,de,Te)=>{console.log("[MockGrackle] postFinding",{projectId:Z,title:le});const Ee={id:U("find"),projectId:Z,taskId:"",sessionId:"",category:de||"general",title:le,content:ce,tags:Te||[],createdAt:new Date().toISOString()};x(et=>[...et,Ee])},[U]),ze=S.useCallback((Z,le,ce,de)=>{console.log("[MockGrackle] addEnvironment",{displayName:Z,adapterType:le,adapterConfig:ce,defaultRuntime:de})},[]),Sn=S.useCallback(()=>{console.log("[MockGrackle] loadTokens")},[]),_n=S.useCallback((Z,le,ce,de,Te)=>{console.log("[MockGrackle] setToken",{name:Z,tokenType:ce}),A(Ee=>[...Ee.filter(Le=>Le.name!==Z),{name:Z,tokenType:ce,envVar:de,filePath:Te,expiresAt:""}])},[]),Zn=S.useCallback(Z=>{console.log("[MockGrackle] deleteToken",Z),A(le=>le.filter(ce=>ce.name!==Z))},[]),an=S.useCallback(Z=>{console.log("[MockGrackle] updateCredentialProviders",Z),N(Z)},[]);S.useEffect(()=>()=>{J.current.forEach(clearTimeout),J.current.clear()},[]);const Xn=S.useMemo(()=>({connected:!0,environments:oE,sessions:a,events:o,eventsDropped:0,lastSpawnedId:u,projects:m,tasks:g,findings:b,tokens:T,credentialProviders:j,spawn:ee,sendInput:De,kill:ke,refresh:je,loadSessionEvents:Pe,clearEvents:we,createProject:_e,archiveProject:Ce,updateProject:(Z,le)=>{console.log("[MockGrackle] updateProject",{projectId:Z,...le}),p(ce=>ce.map(de=>de.id!==Z?de:{...de,...le.name!==void 0?{name:le.name}:{},...le.description!==void 0?{description:le.description}:{},...le.repoUrl!==void 0?{repoUrl:le.repoUrl}:{},...le.defaultEnvironmentId!==void 0?{defaultEnvironmentId:le.defaultEnvironmentId}:{},updatedAt:new Date().toISOString()}))},loadTasks:Q,createTask:P,startTask:I,completeTask:$e,resumeTask:vt,updateTask:xt,deleteTask:Gt,loadFindings:We,postFinding:Ze,addEnvironment:ze,loadTokens:Sn,setToken:_n,deleteToken:Zn,updateCredentialProviders:an,provisionStatus:{},provisionEnvironment:()=>{},stopEnvironment:()=>{},removeEnvironment:()=>{},codespaces:[],codespaceError:"",codespaceListError:"",codespaceCreating:!1,listCodespaces:()=>{},createCodespace:()=>{},projectCreating:!1,taskStartingId:void 0,personas:C,createPersona:(Z,le,ce,de,Te,Ee)=>{console.log("[MockGrackle] createPersona",{name:Z});const et={id:`mock-persona-${Date.now()}`,name:Z,description:le,systemPrompt:ce,toolConfig:"{}",runtime:de??"claude-code",model:Te||"",maxTurns:Ee||0,mcpServers:"[]",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};B(Le=>[...Le,et])},updatePersona:(Z,le,ce,de,Te,Ee,et)=>{console.log("[MockGrackle] updatePersona",{personaId:Z,name:le}),B(Le=>Le.map(ot=>ot.id!==Z?ot:{...ot,...le!==void 0?{name:le}:{},...ce!==void 0?{description:ce}:{},...de!==void 0?{systemPrompt:de}:{},...Te!==void 0?{runtime:Te}:{},...Ee!==void 0?{model:Ee}:{},...et!==void 0?{maxTurns:et}:{},updatedAt:new Date().toISOString()}))},deletePersona:Z=>{console.log("[MockGrackle] deletePersona",Z),B(le=>le.filter(ce=>ce.id!==Z))},taskSessions:R,loadTaskSessions:Z=>{console.log("[MockGrackle] loadTaskSessions",Z)}}),[a,o,u,m,g,b,T,j,C,R,ee,De,ke,je,Pe,we,_e,Ce,Q,P,I,$e,vt,xt,Gt,We,Ze,ze,Sn,_n,Zn,an]);return h.jsx(Hf.Provider,{value:Xn,children:n})}const U0=S.createContext(void 0),gE=4e3;function vE({children:n}){const[a,l]=S.useState([]),o=S.useRef(0),r=S.useCallback(d=>{l(m=>m.filter(p=>p.id!==d))},[]),u=S.useCallback((d,m="info",p=gE)=>{const g=`toast-${++o.current}`;l(v=>[...v,{id:g,message:d,variant:m,duration:p}])},[]);return h.jsx(U0.Provider,{value:{toasts:a,showToast:u,dismissToast:r},children:n})}function go(){const n=S.useContext(U0);if(!n)throw new Error("useToast must be used within ToastProvider");return n}const hc=[{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"]}],V0=new Set(hc.map(n=>n.id)),Mv="grackle";function nf(n){return hc.find(a=>a.id===n)}const af="grackle-theme",I0="grackle-prefer-system",H0="(prefers-color-scheme: dark)";let Zl=[],Yr;function Bd(){Yr=void 0;for(const n of Zl)n()}function sf(){return typeof window>"u"?!1:window.matchMedia(H0).matches}function eo(){if(typeof localStorage>"u")return Mv;try{const n=localStorage.getItem(af);if(n!==null&&V0.has(n))return n}catch{}return Mv}function Qr(){if(typeof localStorage>"u")return!1;try{return localStorage.getItem(I0)==="true"}catch{return!1}}function lf(n){return hc.find(a=>a.variantLightId===n||a.variantDarkId===n)}function q0(n,a){const l=nf(n);if(l!=null&&l.variantDarkId)return a&&l.variantLightId?sf()?l.variantDarkId:l.variantLightId:l.variantDarkId;if(l!=null&&l.hidden&&a){const o=lf(n);if(o!=null&&o.variantLightId&&o.variantDarkId)return sf()?o.variantDarkId:o.variantLightId}return n}function Li(n,a,l=!1){l&&document.documentElement.classList.add("no-transitions"),document.documentElement.dataset.theme=q0(n,a),l&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove("no-transitions")}))}typeof document<"u"&&Li(eo(),Qr());function yE(){return Yr===void 0&&(Yr={themeId:eo(),systemDark:sf(),preferSystem:Qr()}),Yr}function bE(n){return Zl=[...Zl,n],()=>{Zl=Zl.filter(a=>a!==n)}}function SE(){const n=S.useSyncExternalStore(bE,yE),{themeId:a,preferSystem:l}=n,o=q0(a,l),r=S.useCallback(d=>{if(V0.has(d)){try{localStorage.setItem(af,d)}catch{}Li(d,Qr(),!0),Bd()}},[]),u=S.useCallback(d=>{try{localStorage.setItem(I0,d?"true":"false")}catch{}if(d){const m=eo(),p=nf(m);if(p!=null&&p.hidden){const g=lf(m);if(g)try{localStorage.setItem(af,g.id)}catch{}}}Li(eo(),d,!0),Bd()},[]);return S.useEffect(()=>{Li(a,l)},[a,l]),S.useEffect(()=>{if(typeof window>"u")return;const d=window.matchMedia(H0),m=()=>{const p=eo(),g=Qr();if(g){const v=nf(p);if(v!=null&&v.variantDarkId&&v.variantLightId&&Li(p,g),v!=null&&v.hidden){const b=lf(p);b!=null&&b.variantDarkId&&b.variantLightId&&Li(p,g)}}Bd()};return d.addEventListener("change",m),()=>{d.removeEventListener("change",m)}},[]),{themeId:a,setTheme:r,resolvedThemeId:o,preferSystem:l,setPreferSystem:u}}const G0=S.createContext(void 0);function _E({children:n}){const a=SE();return h.jsx(G0.Provider,{value:a,children:n})}function P0(){const n=S.useContext(G0);if(!n)throw new Error("useThemeContext must be used within ThemeProvider");return n}const xE="_container_eix8p_1",TE="_hamburger_eix8p_33",EE="_brand_eix8p_49",CE="_info_eix8p_65",AE="_connectionLabel_eix8p_80",jE="_connectionDot_eix8p_93",NE="_connected_eix8p_96",wE="_disconnected_eix8p_100",DE="_settingsButton_eix8p_104",Ma={container:xE,hamburger:TE,brand:EE,info:CE,connectionLabel:AE,connectionDot:jE,connected:NE,disconnected:wE,settingsButton:DE};function kE({onToggleSidebar:n,sidebarOpen:a}){const{connected:l,environments:o,sessions:r}=nn(),u=na(),d=o.length,m=o.filter(g=>g.status==="connected").length,p=r.filter(g=>["running","idle"].includes(g.status)).length;return h.jsxs("div",{className:Ma.container,children:[n&&h.jsx("button",{type:"button",className:Ma.hamburger,onClick:n,"aria-label":"Toggle sidebar","aria-expanded":a,children:"☰"}),h.jsx("button",{type:"button",className:Ma.brand,onClick:()=>u("/"),title:"Home",children:"Grackle"}),h.jsxs("div",{className:Ma.info,children:[h.jsxs("span",{"aria-label":l?"Connected":"Disconnected",children:[h.jsx("span",{className:`${Ma.connectionDot} ${l?Ma.connected:Ma.disconnected}`,"aria-hidden":"true",children:"●"})," ",h.jsx("span",{className:Ma.connectionLabel,"aria-hidden":"true",children:l?"Connected":"Disconnected"})]}),h.jsxs("span",{children:[m,"/",d," env",d!==1?"s":""]}),h.jsxs("span",{children:[p," active"]}),h.jsx("button",{className:Ma.settingsButton,onClick:()=>u(qi),title:"Settings",children:"⚙"})]})]})}const qf=S.createContext({});function Gf(n){const a=S.useRef(null);return a.current===null&&(a.current=n()),a.current}const mc=S.createContext(null),Pf=S.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"});class RE extends S.Component{getSnapshotBeforeUpdate(a){const l=this.props.childRef.current;if(l&&a.isPresent&&!this.props.isPresent){const o=this.props.sizeRef.current;o.height=l.offsetHeight||0,o.width=l.offsetWidth||0,o.top=l.offsetTop,o.left=l.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function ME({children:n,isPresent:a}){const l=S.useId(),o=S.useRef(null),r=S.useRef({width:0,height:0,top:0,left:0}),{nonce:u}=S.useContext(Pf);return S.useInsertionEffect(()=>{const{width:d,height:m,top:p,left:g}=r.current;if(a||!o.current||!d||!m)return;o.current.dataset.motionPopId=l;const v=document.createElement("style");return u&&(v.nonce=u),document.head.appendChild(v),v.sheet&&v.sheet.insertRule(`
|
|
79
|
+
[data-motion-pop-id="${l}"] {
|
|
80
|
+
position: absolute !important;
|
|
81
|
+
width: ${d}px !important;
|
|
82
|
+
height: ${m}px !important;
|
|
83
|
+
top: ${p}px !important;
|
|
84
|
+
left: ${g}px !important;
|
|
85
|
+
}
|
|
86
|
+
`),()=>{document.head.removeChild(v)}},[a]),h.jsx(RE,{isPresent:a,childRef:o,sizeRef:r,children:S.cloneElement(n,{ref:o})})}const OE=({children:n,initial:a,isPresent:l,onExitComplete:o,custom:r,presenceAffectsLayout:u,mode:d})=>{const m=Gf(BE),p=S.useId(),g=S.useCallback(b=>{m.set(b,!0);for(const x of m.values())if(!x)return;o&&o()},[m,o]),v=S.useMemo(()=>({id:p,initial:a,isPresent:l,custom:r,onExitComplete:g,register:b=>(m.set(b,!1),()=>m.delete(b))}),u?[Math.random(),g]:[l,g]);return S.useMemo(()=>{m.forEach((b,x)=>m.set(x,!1))},[l]),S.useEffect(()=>{!l&&!m.size&&o&&o()},[l]),d==="popLayout"&&(n=h.jsx(ME,{isPresent:l,children:n})),h.jsx(mc.Provider,{value:v,children:n})};function BE(){return new Map}function F0(n=!0){const a=S.useContext(mc);if(a===null)return[!0,null];const{isPresent:l,onExitComplete:o,register:r}=a,u=S.useId();S.useEffect(()=>{n&&r(u)},[n]);const d=S.useCallback(()=>n&&o&&o(u),[u,o,n]);return!l&&o?[!1,d]:[!0]}const zr=n=>n.key||"";function Ov(n){const a=[];return S.Children.forEach(n,l=>{S.isValidElement(l)&&a.push(l)}),a}const Ff=typeof window<"u",$0=Ff?S.useLayoutEffect:S.useEffect,ys=({children:n,custom:a,initial:l=!0,onExitComplete:o,presenceAffectsLayout:r=!0,mode:u="sync",propagate:d=!1})=>{const[m,p]=F0(d),g=S.useMemo(()=>Ov(n),[n]),v=d&&!m?[]:g.map(zr),b=S.useRef(!0),x=S.useRef(g),T=Gf(()=>new Map),[A,j]=S.useState(g),[N,C]=S.useState(g);$0(()=>{b.current=!1,x.current=g;for(let X=0;X<N.length;X++){const H=zr(N[X]);v.includes(H)?T.delete(H):T.get(H)!==!0&&T.set(H,!1)}},[N,v.length,v.join("-")]);const B=[];if(g!==A){let X=[...g];for(let H=0;H<N.length;H++){const J=N[H],W=zr(J);v.includes(W)||(X.splice(H,0,J),B.push(J))}u==="wait"&&B.length&&(X=B),C(Ov(X)),j(g);return}const{forceRender:R}=S.useContext(qf);return h.jsx(h.Fragment,{children:N.map(X=>{const H=zr(X),J=d&&!m?!1:g===N||v.includes(H),W=()=>{if(T.has(H))T.set(H,!0);else return;let F=!0;T.forEach(ne=>{ne||(F=!1)}),F&&(R==null||R(),C(x.current),d&&(p==null||p()),o&&o())};return h.jsx(OE,{isPresent:J,initial:!b.current||l?void 0:!1,custom:J?void 0:a,presenceAffectsLayout:r,mode:u,onExitComplete:J?void 0:W,children:X},H)})})},Dn=n=>n;let Y0=Dn;const LE={useManualTiming:!1};function zE(n){let a=new Set,l=new Set,o=!1,r=!1;const u=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1};function m(g){u.has(g)&&(p.schedule(g),n()),g(d)}const p={schedule:(g,v=!1,b=!1)=>{const T=b&&o?a:l;return v&&u.add(g),T.has(g)||T.add(g),g},cancel:g=>{l.delete(g),u.delete(g)},process:g=>{if(d=g,o){r=!0;return}o=!0,[a,l]=[l,a],a.forEach(m),a.clear(),o=!1,r&&(r=!1,p.process(g))}};return p}const Ur=["read","resolveKeyframes","update","preRender","render","postRender"],UE=40;function K0(n,a){let l=!1,o=!0;const r={delta:0,timestamp:0,isProcessing:!1},u=()=>l=!0,d=Ur.reduce((C,B)=>(C[B]=zE(u),C),{}),{read:m,resolveKeyframes:p,update:g,preRender:v,render:b,postRender:x}=d,T=()=>{const C=performance.now();l=!1,r.delta=o?1e3/60:Math.max(Math.min(C-r.timestamp,UE),1),r.timestamp=C,r.isProcessing=!0,m.process(r),p.process(r),g.process(r),v.process(r),b.process(r),x.process(r),r.isProcessing=!1,l&&a&&(o=!1,n(T))},A=()=>{l=!0,o=!0,r.isProcessing||n(T)};return{schedule:Ur.reduce((C,B)=>{const R=d[B];return C[B]=(X,H=!1,J=!1)=>(l||A(),R.schedule(X,H,J)),C},{}),cancel:C=>{for(let B=0;B<Ur.length;B++)d[Ur[B]].cancel(C)},state:r,steps:d}}const{schedule:ft,cancel:ps,state:tn,steps:Ld}=K0(typeof requestAnimationFrame<"u"?requestAnimationFrame:Dn,!0),Z0=S.createContext({strict:!1}),Bv={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"]},Gi={};for(const n in Bv)Gi[n]={isEnabled:a=>Bv[n].some(l=>!!a[l])};function VE(n){for(const a in n)Gi[a]={...Gi[a],...n[a]}}const IE=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 Jr(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||IE.has(n)}let X0=n=>!Jr(n);function HE(n){n&&(X0=a=>a.startsWith("on")?!Jr(a):n(a))}try{HE(require("@emotion/is-prop-valid").default)}catch{}function qE(n,a,l){const o={};for(const r in n)r==="values"&&typeof n.values=="object"||(X0(r)||l===!0&&Jr(r)||!a&&!Jr(r)||n.draggable&&r.startsWith("onDrag"))&&(o[r]=n[r]);return o}function GE(n){if(typeof Proxy>"u")return n;const a=new Map,l=(...o)=>n(...o);return new Proxy(l,{get:(o,r)=>r==="create"?n:(a.has(r)||a.set(r,n(r)),a.get(r))})}const pc=S.createContext({});function ro(n){return typeof n=="string"||Array.isArray(n)}function gc(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}const $f=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Yf=["initial",...$f];function vc(n){return gc(n.animate)||Yf.some(a=>ro(n[a]))}function Q0(n){return!!(vc(n)||n.variants)}function PE(n,a){if(vc(n)){const{initial:l,animate:o}=n;return{initial:l===!1||ro(l)?l:void 0,animate:ro(o)?o:void 0}}return n.inherit!==!1?a:{}}function FE(n){const{initial:a,animate:l}=PE(n,S.useContext(pc));return S.useMemo(()=>({initial:a,animate:l}),[Lv(a),Lv(l)])}function Lv(n){return Array.isArray(n)?n.join(" "):n}const $E=Symbol.for("motionComponentSymbol");function zi(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function YE(n,a,l){return S.useCallback(o=>{o&&n.onMount&&n.onMount(o),a&&(o?a.mount(o):a.unmount()),l&&(typeof l=="function"?l(o):zi(l)&&(l.current=o))},[a])}const Kf=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),KE="framerAppearId",J0="data-"+Kf(KE),{schedule:Zf}=K0(queueMicrotask,!1),W0=S.createContext({});function ZE(n,a,l,o,r){var u,d;const{visualElement:m}=S.useContext(pc),p=S.useContext(Z0),g=S.useContext(mc),v=S.useContext(Pf).reducedMotion,b=S.useRef(null);o=o||p.renderer,!b.current&&o&&(b.current=o(n,{visualState:a,parent:m,props:l,presenceContext:g,blockInitialAnimation:g?g.initial===!1:!1,reducedMotionConfig:v}));const x=b.current,T=S.useContext(W0);x&&!x.projection&&r&&(x.type==="html"||x.type==="svg")&&XE(b.current,l,r,T);const A=S.useRef(!1);S.useInsertionEffect(()=>{x&&A.current&&x.update(l,g)});const j=l[J0],N=S.useRef(!!j&&!(!((u=window.MotionHandoffIsComplete)===null||u===void 0)&&u.call(window,j))&&((d=window.MotionHasOptimisedAnimation)===null||d===void 0?void 0:d.call(window,j)));return $0(()=>{x&&(A.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),Zf.render(x.render),N.current&&x.animationState&&x.animationState.animateChanges())}),S.useEffect(()=>{x&&(!N.current&&x.animationState&&x.animationState.animateChanges(),N.current&&(queueMicrotask(()=>{var C;(C=window.MotionHandoffMarkAsComplete)===null||C===void 0||C.call(window,j)}),N.current=!1))}),x}function XE(n,a,l,o){const{layoutId:r,layout:u,drag:d,dragConstraints:m,layoutScroll:p,layoutRoot:g}=a;n.projection=new l(n.latestValues,a["data-framer-portal-id"]?void 0:eb(n.parent)),n.projection.setOptions({layoutId:r,layout:u,alwaysMeasureLayout:!!d||m&&zi(m),visualElement:n,animationType:typeof u=="string"?u:"both",initialPromotionConfig:o,layoutScroll:p,layoutRoot:g})}function eb(n){if(n)return n.options.allowProjection!==!1?n.projection:eb(n.parent)}function QE({preloadedFeatures:n,createVisualElement:a,useRender:l,useVisualState:o,Component:r}){var u,d;n&&VE(n);function m(g,v){let b;const x={...S.useContext(Pf),...g,layoutId:JE(g)},{isStatic:T}=x,A=FE(g),j=o(g,T);if(!T&&Ff){WE();const N=e2(x);b=N.MeasureLayout,A.visualElement=ZE(r,j,x,a,N.ProjectionNode)}return h.jsxs(pc.Provider,{value:A,children:[b&&A.visualElement?h.jsx(b,{visualElement:A.visualElement,...x}):null,l(r,g,YE(j,A.visualElement,v),j,T,A.visualElement)]})}m.displayName=`motion.${typeof r=="string"?r:`create(${(d=(u=r.displayName)!==null&&u!==void 0?u:r.name)!==null&&d!==void 0?d:""})`}`;const p=S.forwardRef(m);return p[$E]=r,p}function JE({layoutId:n}){const a=S.useContext(qf).id;return a&&n!==void 0?a+"-"+n:n}function WE(n,a){S.useContext(Z0).strict}function e2(n){const{drag:a,layout:l}=Gi;if(!a&&!l)return{};const o={...a,...l};return{MeasureLayout:a!=null&&a.isEnabled(n)||l!=null&&l.isEnabled(n)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}const t2=["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 Xf(n){return typeof n!="string"||n.includes("-")?!1:!!(t2.indexOf(n)>-1||/[A-Z]/u.test(n))}function zv(n){const a=[{},{}];return n==null||n.values.forEach((l,o)=>{a[0][o]=l.get(),a[1][o]=l.getVelocity()}),a}function Qf(n,a,l,o){if(typeof a=="function"){const[r,u]=zv(o);a=a(l!==void 0?l:n.custom,r,u)}if(typeof a=="string"&&(a=n.variants&&n.variants[a]),typeof a=="function"){const[r,u]=zv(o);a=a(l!==void 0?l:n.custom,r,u)}return a}const of=n=>Array.isArray(n),n2=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),a2=n=>of(n)?n[n.length-1]||0:n,on=n=>!!(n&&n.getVelocity);function Kr(n){const a=on(n)?n.get():n;return n2(a)?a.toValue():a}function s2({scrapeMotionValuesFromProps:n,createRenderState:a,onUpdate:l},o,r,u){const d={latestValues:i2(o,r,u,n),renderState:a()};return l&&(d.onMount=m=>l({props:o,current:m,...d}),d.onUpdate=m=>l(m)),d}const tb=n=>(a,l)=>{const o=S.useContext(pc),r=S.useContext(mc),u=()=>s2(n,a,o,r);return l?u():Gf(u)};function i2(n,a,l,o){const r={},u=o(n,{});for(const x in u)r[x]=Kr(u[x]);let{initial:d,animate:m}=n;const p=vc(n),g=Q0(n);a&&g&&!p&&n.inherit!==!1&&(d===void 0&&(d=a.initial),m===void 0&&(m=a.animate));let v=l?l.initial===!1:!1;v=v||d===!1;const b=v?m:d;if(b&&typeof b!="boolean"&&!gc(b)){const x=Array.isArray(b)?b:[b];for(let T=0;T<x.length;T++){const A=Qf(n,x[T]);if(A){const{transitionEnd:j,transition:N,...C}=A;for(const B in C){let R=C[B];if(Array.isArray(R)){const X=v?R.length-1:0;R=R[X]}R!==null&&(r[B]=R)}for(const B in j)r[B]=j[B]}}}return r}const Ki=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Zs=new Set(Ki),nb=n=>a=>typeof a=="string"&&a.startsWith(n),ab=nb("--"),l2=nb("var(--"),Jf=n=>l2(n)?o2.test(n.split("/*")[0].trim()):!1,o2=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,sb=(n,a)=>a&&typeof n=="number"?a.transform(n):n,Ua=(n,a,l)=>l>a?a:l<n?n:l,Zi={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},co={...Zi,transform:n=>Ua(0,1,n)},Vr={...Zi,default:1},vo=n=>({test:a=>typeof a=="string"&&a.endsWith(n)&&a.split(" ").length===1,parse:parseFloat,transform:a=>`${a}${n}`}),us=vo("deg"),fa=vo("%"),xe=vo("px"),r2=vo("vh"),c2=vo("vw"),Uv={...fa,parse:n=>fa.parse(n)/100,transform:n=>fa.transform(n*100)},u2={borderWidth:xe,borderTopWidth:xe,borderRightWidth:xe,borderBottomWidth:xe,borderLeftWidth:xe,borderRadius:xe,radius:xe,borderTopLeftRadius:xe,borderTopRightRadius:xe,borderBottomRightRadius:xe,borderBottomLeftRadius:xe,width:xe,maxWidth:xe,height:xe,maxHeight:xe,top:xe,right:xe,bottom:xe,left:xe,padding:xe,paddingTop:xe,paddingRight:xe,paddingBottom:xe,paddingLeft:xe,margin:xe,marginTop:xe,marginRight:xe,marginBottom:xe,marginLeft:xe,backgroundPositionX:xe,backgroundPositionY:xe},d2={rotate:us,rotateX:us,rotateY:us,rotateZ:us,scale:Vr,scaleX:Vr,scaleY:Vr,scaleZ:Vr,skew:us,skewX:us,skewY:us,distance:xe,translateX:xe,translateY:xe,translateZ:xe,x:xe,y:xe,z:xe,perspective:xe,transformPerspective:xe,opacity:co,originX:Uv,originY:Uv,originZ:xe},Vv={...Zi,transform:Math.round},Wf={...u2,...d2,zIndex:Vv,size:xe,fillOpacity:co,strokeOpacity:co,numOctaves:Vv},f2={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},h2=Ki.length;function m2(n,a,l){let o="",r=!0;for(let u=0;u<h2;u++){const d=Ki[u],m=n[d];if(m===void 0)continue;let p=!0;if(typeof m=="number"?p=m===(d.startsWith("scale")?1:0):p=parseFloat(m)===0,!p||l){const g=sb(m,Wf[d]);if(!p){r=!1;const v=f2[d]||d;o+=`${v}(${g}) `}l&&(a[d]=g)}}return o=o.trim(),l?o=l(a,r?"":o):r&&(o="none"),o}function eh(n,a,l){const{style:o,vars:r,transformOrigin:u}=n;let d=!1,m=!1;for(const p in a){const g=a[p];if(Zs.has(p)){d=!0;continue}else if(ab(p)){r[p]=g;continue}else{const v=sb(g,Wf[p]);p.startsWith("origin")?(m=!0,u[p]=v):o[p]=v}}if(a.transform||(d||l?o.transform=m2(a,n.transform,l):o.transform&&(o.transform="none")),m){const{originX:p="50%",originY:g="50%",originZ:v=0}=u;o.transformOrigin=`${p} ${g} ${v}`}}const p2={offset:"stroke-dashoffset",array:"stroke-dasharray"},g2={offset:"strokeDashoffset",array:"strokeDasharray"};function v2(n,a,l=1,o=0,r=!0){n.pathLength=1;const u=r?p2:g2;n[u.offset]=xe.transform(-o);const d=xe.transform(a),m=xe.transform(l);n[u.array]=`${d} ${m}`}function Iv(n,a,l){return typeof n=="string"?n:xe.transform(a+l*n)}function y2(n,a,l){const o=Iv(a,n.x,n.width),r=Iv(l,n.y,n.height);return`${o} ${r}`}function th(n,{attrX:a,attrY:l,attrScale:o,originX:r,originY:u,pathLength:d,pathSpacing:m=1,pathOffset:p=0,...g},v,b){if(eh(n,g,b),v){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:x,style:T,dimensions:A}=n;x.transform&&(A&&(T.transform=x.transform),delete x.transform),A&&(r!==void 0||u!==void 0||T.transform)&&(T.transformOrigin=y2(A,r!==void 0?r:.5,u!==void 0?u:.5)),a!==void 0&&(x.x=a),l!==void 0&&(x.y=l),o!==void 0&&(x.scale=o),d!==void 0&&v2(x,d,m,p,!1)}const nh=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),ib=()=>({...nh(),attrs:{}}),ah=n=>typeof n=="string"&&n.toLowerCase()==="svg";function lb(n,{style:a,vars:l},o,r){Object.assign(n.style,a,r&&r.getProjectionStyles(o));for(const u in l)n.style.setProperty(u,l[u])}const ob=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 rb(n,a,l,o){lb(n,a,void 0,o);for(const r in a.attrs)n.setAttribute(ob.has(r)?r:Kf(r),a.attrs[r])}const Wr={};function b2(n){Object.assign(Wr,n)}function cb(n,{layout:a,layoutId:l}){return Zs.has(n)||n.startsWith("origin")||(a||l!==void 0)&&(!!Wr[n]||n==="opacity")}function sh(n,a,l){var o;const{style:r}=n,u={};for(const d in r)(on(r[d])||a.style&&on(a.style[d])||cb(d,n)||((o=l==null?void 0:l.getValue(d))===null||o===void 0?void 0:o.liveStyle)!==void 0)&&(u[d]=r[d]);return u}function ub(n,a,l){const o=sh(n,a,l);for(const r in n)if(on(n[r])||on(a[r])){const u=Ki.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;o[u]=n[r]}return o}function S2(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 Hv=["x","y","width","height","cx","cy","r"],_2={useVisualState:tb({scrapeMotionValuesFromProps:ub,createRenderState:ib,onUpdate:({props:n,prevProps:a,current:l,renderState:o,latestValues:r})=>{if(!l)return;let u=!!n.drag;if(!u){for(const m in r)if(Zs.has(m)){u=!0;break}}if(!u)return;let d=!a;if(a)for(let m=0;m<Hv.length;m++){const p=Hv[m];n[p]!==a[p]&&(d=!0)}d&&ft.read(()=>{S2(l,o),ft.render(()=>{th(o,r,ah(l.tagName),n.transformTemplate),rb(l,o)})})}})},x2={useVisualState:tb({scrapeMotionValuesFromProps:sh,createRenderState:nh})};function db(n,a,l){for(const o in a)!on(a[o])&&!cb(o,l)&&(n[o]=a[o])}function T2({transformTemplate:n},a){return S.useMemo(()=>{const l=nh();return eh(l,a,n),Object.assign({},l.vars,l.style)},[a])}function E2(n,a){const l=n.style||{},o={};return db(o,l,n),Object.assign(o,T2(n,a)),o}function C2(n,a){const l={},o=E2(n,a);return n.drag&&n.dragListener!==!1&&(l.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(l.tabIndex=0),l.style=o,l}function A2(n,a,l,o){const r=S.useMemo(()=>{const u=ib();return th(u,a,ah(o),n.transformTemplate),{...u.attrs,style:{...u.style}}},[a]);if(n.style){const u={};db(u,n.style,n),r.style={...u,...r.style}}return r}function j2(n=!1){return(l,o,r,{latestValues:u},d)=>{const p=(Xf(l)?A2:C2)(o,u,d,l),g=qE(o,typeof l=="string",n),v=l!==S.Fragment?{...g,...p,ref:r}:{},{children:b}=o,x=S.useMemo(()=>on(b)?b.get():b,[b]);return S.createElement(l,{...v,children:x})}}function N2(n,a){return function(o,{forwardMotionProps:r}={forwardMotionProps:!1}){const d={...Xf(o)?_2:x2,preloadedFeatures:n,useRender:j2(r),createVisualElement:a,Component:o};return QE(d)}}function fb(n,a){if(!Array.isArray(a))return!1;const l=a.length;if(l!==n.length)return!1;for(let o=0;o<l;o++)if(a[o]!==n[o])return!1;return!0}function yc(n,a,l){const o=n.getProps();return Qf(o,a,l!==void 0?l:o.custom,n)}function ih(n,a){return n?n[a]||n.default||n:void 0}const hb=new Set(["width","height","top","left","right","bottom",...Ki]);let Zr;function w2(){Zr=void 0}const ha={now:()=>(Zr===void 0&&ha.set(tn.isProcessing||LE.useManualTiming?tn.timestamp:performance.now()),Zr),set:n=>{Zr=n,queueMicrotask(w2)}};function lh(n,a){n.indexOf(a)===-1&&n.push(a)}function oh(n,a){const l=n.indexOf(a);l>-1&&n.splice(l,1)}class rh{constructor(){this.subscriptions=[]}add(a){return lh(this.subscriptions,a),()=>oh(this.subscriptions,a)}notify(a,l,o){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](a,l,o);else for(let u=0;u<r;u++){const d=this.subscriptions[u];d&&d(a,l,o)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function mb(n,a){return a?n*(1e3/a):0}const qv=30,D2=n=>!isNaN(parseFloat(n));class k2{constructor(a,l={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(o,r=!0)=>{const u=ha.now();this.updatedAt!==u&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(a),this.owner=l.owner}setCurrent(a){this.current=a,this.updatedAt=ha.now(),this.canTrackVelocity===null&&a!==void 0&&(this.canTrackVelocity=D2(this.current))}setPrevFrameValue(a=this.current){this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt}onChange(a){return this.on("change",a)}on(a,l){this.events[a]||(this.events[a]=new rh);const o=this.events[a].add(l);return a==="change"?()=>{o(),ft.read(()=>{this.events.change.getSize()||this.stop()})}:o}clearListeners(){for(const a in this.events)this.events[a].clear()}attach(a,l){this.passiveEffect=a,this.stopPassiveEffect=l}set(a,l=!0){!l||!this.passiveEffect?this.updateAndNotify(a,l):this.passiveEffect(a,this.updateAndNotify)}setWithVelocity(a,l,o){this.set(l),this.prev=void 0,this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt-o}jump(a,l=!0){this.updateAndNotify(a),this.prev=a,this.prevUpdatedAt=this.prevFrameValue=void 0,l&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const a=ha.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||a-this.updatedAt>qv)return 0;const l=Math.min(this.updatedAt-this.prevUpdatedAt,qv);return mb(parseFloat(this.current)-parseFloat(this.prevFrameValue),l)}start(a){return this.stop(),new Promise(l=>{this.hasAnimated=!0,this.animation=a(l),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 uo(n,a){return new k2(n,a)}function R2(n,a,l){n.hasValue(a)?n.getValue(a).set(l):n.addValue(a,uo(l))}function M2(n,a){const l=yc(n,a);let{transitionEnd:o={},transition:r={},...u}=l||{};u={...u,...o};for(const d in u){const m=a2(u[d]);R2(n,d,m)}}function O2(n){return!!(on(n)&&n.add)}function rf(n,a){const l=n.getValue("willChange");if(O2(l))return l.add(a)}function pb(n){return n.props[J0]}function ch(n){let a;return()=>(a===void 0&&(a=n()),a)}const B2=ch(()=>window.ScrollTimeline!==void 0);class L2{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,l){for(let o=0;o<this.animations.length;o++)this.animations[o][a]=l}attachTimeline(a,l){const o=this.animations.map(r=>{if(B2()&&r.attachTimeline)return r.attachTimeline(a);if(typeof l=="function")return l(r)});return()=>{o.forEach((r,u)=>{r&&r(),this.animations[u].stop()})}}get time(){return this.getAll("time")}set time(a){this.setAll("time",a)}get speed(){return this.getAll("speed")}set speed(a){this.setAll("speed",a)}get startTime(){return this.getAll("startTime")}get duration(){let a=0;for(let l=0;l<this.animations.length;l++)a=Math.max(a,this.animations[l].duration);return a}runAll(a){this.animations.forEach(l=>l[a]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class z2 extends L2{then(a,l){return Promise.all(this.animations).then(a).catch(l)}}const Ba=n=>n*1e3,La=n=>n/1e3;function uh(n){return typeof n=="function"}function Gv(n,a){n.timeline=a,n.onfinish=null}const dh=n=>Array.isArray(n)&&typeof n[0]=="number",U2={linearEasing:void 0};function V2(n,a){const l=ch(n);return()=>{var o;return(o=U2[a])!==null&&o!==void 0?o:l()}}const ec=V2(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Pi=(n,a,l)=>{const o=a-n;return o===0?1:(l-n)/o},gb=(n,a,l=10)=>{let o="";const r=Math.max(Math.round(a/l),2);for(let u=0;u<r;u++)o+=n(Pi(0,r-1,u))+", ";return`linear(${o.substring(0,o.length-2)})`};function vb(n){return!!(typeof n=="function"&&ec()||!n||typeof n=="string"&&(n in cf||ec())||dh(n)||Array.isArray(n)&&n.every(vb))}const Xl=([n,a,l,o])=>`cubic-bezier(${n}, ${a}, ${l}, ${o})`,cf={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Xl([0,.65,.55,1]),circOut:Xl([.55,0,1,.45]),backIn:Xl([.31,.01,.66,-.59]),backOut:Xl([.33,1.53,.69,.99])};function yb(n,a){if(n)return typeof n=="function"&&ec()?gb(n,a):dh(n)?Xl(n):Array.isArray(n)?n.map(l=>yb(l,a)||cf.easeOut):cf[n]}const bb=(n,a,l)=>(((1-3*l+3*a)*n+(3*l-6*a))*n+3*a)*n,I2=1e-7,H2=12;function q2(n,a,l,o,r){let u,d,m=0;do d=a+(l-a)/2,u=bb(d,o,r)-n,u>0?l=d:a=d;while(Math.abs(u)>I2&&++m<H2);return d}function yo(n,a,l,o){if(n===a&&l===o)return Dn;const r=u=>q2(u,0,1,n,l);return u=>u===0||u===1?u:bb(r(u),a,o)}const Sb=n=>a=>a<=.5?n(2*a)/2:(2-n(2*(1-a)))/2,_b=n=>a=>1-n(1-a),xb=yo(.33,1.53,.69,.99),fh=_b(xb),Tb=Sb(fh),Eb=n=>(n*=2)<1?.5*fh(n):.5*(2-Math.pow(2,-10*(n-1))),hh=n=>1-Math.sin(Math.acos(n)),Cb=_b(hh),Ab=Sb(hh),jb=n=>/^0[^.\s]+$/u.test(n);function G2(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||jb(n):!0}const to=n=>Math.round(n*1e5)/1e5,mh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function P2(n){return n==null}const F2=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ph=(n,a)=>l=>!!(typeof l=="string"&&F2.test(l)&&l.startsWith(n)||a&&!P2(l)&&Object.prototype.hasOwnProperty.call(l,a)),Nb=(n,a,l)=>o=>{if(typeof o!="string")return o;const[r,u,d,m]=o.match(mh);return{[n]:parseFloat(r),[a]:parseFloat(u),[l]:parseFloat(d),alpha:m!==void 0?parseFloat(m):1}},$2=n=>Ua(0,255,n),zd={...Zi,transform:n=>Math.round($2(n))},Ps={test:ph("rgb","red"),parse:Nb("red","green","blue"),transform:({red:n,green:a,blue:l,alpha:o=1})=>"rgba("+zd.transform(n)+", "+zd.transform(a)+", "+zd.transform(l)+", "+to(co.transform(o))+")"};function Y2(n){let a="",l="",o="",r="";return n.length>5?(a=n.substring(1,3),l=n.substring(3,5),o=n.substring(5,7),r=n.substring(7,9)):(a=n.substring(1,2),l=n.substring(2,3),o=n.substring(3,4),r=n.substring(4,5),a+=a,l+=l,o+=o,r+=r),{red:parseInt(a,16),green:parseInt(l,16),blue:parseInt(o,16),alpha:r?parseInt(r,16)/255:1}}const uf={test:ph("#"),parse:Y2,transform:Ps.transform},Ui={test:ph("hsl","hue"),parse:Nb("hue","saturation","lightness"),transform:({hue:n,saturation:a,lightness:l,alpha:o=1})=>"hsla("+Math.round(n)+", "+fa.transform(to(a))+", "+fa.transform(to(l))+", "+to(co.transform(o))+")"},ln={test:n=>Ps.test(n)||uf.test(n)||Ui.test(n),parse:n=>Ps.test(n)?Ps.parse(n):Ui.test(n)?Ui.parse(n):uf.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?Ps.transform(n):Ui.transform(n)},K2=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Z2(n){var a,l;return isNaN(n)&&typeof n=="string"&&(((a=n.match(mh))===null||a===void 0?void 0:a.length)||0)+(((l=n.match(K2))===null||l===void 0?void 0:l.length)||0)>0}const wb="number",Db="color",X2="var",Q2="var(",Pv="${}",J2=/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 fo(n){const a=n.toString(),l=[],o={color:[],number:[],var:[]},r=[];let u=0;const m=a.replace(J2,p=>(ln.test(p)?(o.color.push(u),r.push(Db),l.push(ln.parse(p))):p.startsWith(Q2)?(o.var.push(u),r.push(X2),l.push(p)):(o.number.push(u),r.push(wb),l.push(parseFloat(p))),++u,Pv)).split(Pv);return{values:l,split:m,indexes:o,types:r}}function kb(n){return fo(n).values}function Rb(n){const{split:a,types:l}=fo(n),o=a.length;return r=>{let u="";for(let d=0;d<o;d++)if(u+=a[d],r[d]!==void 0){const m=l[d];m===wb?u+=to(r[d]):m===Db?u+=ln.transform(r[d]):u+=r[d]}return u}}const W2=n=>typeof n=="number"?0:n;function eC(n){const a=kb(n);return Rb(n)(a.map(W2))}const gs={test:Z2,parse:kb,createTransformer:Rb,getAnimatableNone:eC},tC=new Set(["brightness","contrast","saturate","opacity"]);function nC(n){const[a,l]=n.slice(0,-1).split("(");if(a==="drop-shadow")return n;const[o]=l.match(mh)||[];if(!o)return n;const r=l.replace(o,"");let u=tC.has(a)?1:0;return o!==l&&(u*=100),a+"("+u+r+")"}const aC=/\b([a-z-]*)\(.*?\)/gu,df={...gs,getAnimatableNone:n=>{const a=n.match(aC);return a?a.map(nC).join(" "):n}},sC={...Wf,color:ln,backgroundColor:ln,outlineColor:ln,fill:ln,stroke:ln,borderColor:ln,borderTopColor:ln,borderRightColor:ln,borderBottomColor:ln,borderLeftColor:ln,filter:df,WebkitFilter:df},gh=n=>sC[n];function Mb(n,a){let l=gh(n);return l!==df&&(l=gs),l.getAnimatableNone?l.getAnimatableNone(a):void 0}const iC=new Set(["auto","none","0"]);function lC(n,a,l){let o=0,r;for(;o<n.length&&!r;){const u=n[o];typeof u=="string"&&!iC.has(u)&&fo(u).values.length&&(r=n[o]),o++}if(r&&l)for(const u of a)n[u]=Mb(l,r)}const Fv=n=>n===Zi||n===xe,$v=(n,a)=>parseFloat(n.split(", ")[a]),Yv=(n,a)=>(l,{transform:o})=>{if(o==="none"||!o)return 0;const r=o.match(/^matrix3d\((.+)\)$/u);if(r)return $v(r[1],a);{const u=o.match(/^matrix\((.+)\)$/u);return u?$v(u[1],n):0}},oC=new Set(["x","y","z"]),rC=Ki.filter(n=>!oC.has(n));function cC(n){const a=[];return rC.forEach(l=>{const o=n.getValue(l);o!==void 0&&(a.push([l,o.get()]),o.set(l.startsWith("scale")?1:0))}),a}const Fi={width:({x:n},{paddingLeft:a="0",paddingRight:l="0"})=>n.max-n.min-parseFloat(a)-parseFloat(l),height:({y:n},{paddingTop:a="0",paddingBottom:l="0"})=>n.max-n.min-parseFloat(a)-parseFloat(l),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:Yv(4,13),y:Yv(5,14)};Fi.translateX=Fi.x;Fi.translateY=Fi.y;const Fs=new Set;let ff=!1,hf=!1;function Ob(){if(hf){const n=Array.from(Fs).filter(o=>o.needsMeasurement),a=new Set(n.map(o=>o.element)),l=new Map;a.forEach(o=>{const r=cC(o);r.length&&(l.set(o,r),o.render())}),n.forEach(o=>o.measureInitialState()),a.forEach(o=>{o.render();const r=l.get(o);r&&r.forEach(([u,d])=>{var m;(m=o.getValue(u))===null||m===void 0||m.set(d)})}),n.forEach(o=>o.measureEndState()),n.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}hf=!1,ff=!1,Fs.forEach(n=>n.complete()),Fs.clear()}function Bb(){Fs.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(hf=!0)})}function uC(){Bb(),Ob()}class vh{constructor(a,l,o,r,u,d=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...a],this.onComplete=l,this.name=o,this.motionValue=r,this.element=u,this.isAsync=d}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Fs.add(this),ff||(ff=!0,ft.read(Bb),ft.resolveKeyframes(Ob))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:a,name:l,element:o,motionValue:r}=this;for(let u=0;u<a.length;u++)if(a[u]===null)if(u===0){const d=r==null?void 0:r.get(),m=a[a.length-1];if(d!==void 0)a[0]=d;else if(o&&l){const p=o.readValue(l,m);p!=null&&(a[0]=p)}a[0]===void 0&&(a[0]=m),r&&d===void 0&&r.set(a[0])}else a[u]=a[u-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Fs.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Fs.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Lb=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),dC=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function fC(n){const a=dC.exec(n);if(!a)return[,];const[,l,o,r]=a;return[`--${l??o}`,r]}function zb(n,a,l=1){const[o,r]=fC(n);if(!o)return;const u=window.getComputedStyle(a).getPropertyValue(o);if(u){const d=u.trim();return Lb(d)?parseFloat(d):d}return Jf(r)?zb(r,a,l+1):r}const Ub=n=>a=>a.test(n),hC={test:n=>n==="auto",parse:n=>n},Vb=[Zi,xe,fa,us,c2,r2,hC],Kv=n=>Vb.find(Ub(n));class Ib extends vh{constructor(a,l,o,r,u){super(a,l,o,r,u,!0)}readKeyframes(){const{unresolvedKeyframes:a,element:l,name:o}=this;if(!l||!l.current)return;super.readKeyframes();for(let p=0;p<a.length;p++){let g=a[p];if(typeof g=="string"&&(g=g.trim(),Jf(g))){const v=zb(g,l.current);v!==void 0&&(a[p]=v),p===a.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!hb.has(o)||a.length!==2)return;const[r,u]=a,d=Kv(r),m=Kv(u);if(d!==m)if(Fv(d)&&Fv(m))for(let p=0;p<a.length;p++){const g=a[p];typeof g=="string"&&(a[p]=parseFloat(g))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:a,name:l}=this,o=[];for(let r=0;r<a.length;r++)G2(a[r])&&o.push(r);o.length&&lC(a,o,l)}measureInitialState(){const{element:a,unresolvedKeyframes:l,name:o}=this;if(!a||!a.current)return;o==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Fi[o](a.measureViewportBox(),window.getComputedStyle(a.current)),l[0]=this.measuredOrigin;const r=l[l.length-1];r!==void 0&&a.getValue(o,r).jump(r,!1)}measureEndState(){var a;const{element:l,name:o,unresolvedKeyframes:r}=this;if(!l||!l.current)return;const u=l.getValue(o);u&&u.jump(this.measuredOrigin,!1);const d=r.length-1,m=r[d];r[d]=Fi[o](l.measureViewportBox(),window.getComputedStyle(l.current)),m!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=m),!((a=this.removedTransforms)===null||a===void 0)&&a.length&&this.removedTransforms.forEach(([p,g])=>{l.getValue(p).set(g)}),this.resolveNoneKeyframes()}}const Zv=(n,a)=>a==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(gs.test(n)||n==="0")&&!n.startsWith("url("));function mC(n){const a=n[0];if(n.length===1)return!0;for(let l=0;l<n.length;l++)if(n[l]!==a)return!0}function pC(n,a,l,o){const r=n[0];if(r===null)return!1;if(a==="display"||a==="visibility")return!0;const u=n[n.length-1],d=Zv(r,a),m=Zv(u,a);return!d||!m?!1:mC(n)||(l==="spring"||uh(l))&&o}const gC=n=>n!==null;function bc(n,{repeat:a,repeatType:l="loop"},o){const r=n.filter(gC),u=a&&l!=="loop"&&a%2===1?0:r.length-1;return!u||o===void 0?r[u]:o}const vC=40;class Hb{constructor({autoplay:a=!0,delay:l=0,type:o="keyframes",repeat:r=0,repeatDelay:u=0,repeatType:d="loop",...m}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=ha.now(),this.options={autoplay:a,delay:l,type:o,repeat:r,repeatDelay:u,repeatType:d,...m},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>vC?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&uC(),this._resolved}onKeyframesResolved(a,l){this.resolvedAt=ha.now(),this.hasAttemptedResolve=!0;const{name:o,type:r,velocity:u,delay:d,onComplete:m,onUpdate:p,isGenerator:g}=this.options;if(!g&&!pC(a,o,r,u))if(d)this.options.duration=0;else{p&&p(bc(a,this.options,l)),m&&m(),this.resolveFinishedPromise();return}const v=this.initPlayback(a,l);v!==!1&&(this._resolved={keyframes:a,finalKeyframe:l,...v},this.onPostResolved())}onPostResolved(){}then(a,l){return this.currentFinishedPromise.then(a,l)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(a=>{this.resolveFinishedPromise=a})}}const mf=2e4;function qb(n){let a=0;const l=50;let o=n.next(a);for(;!o.done&&a<mf;)a+=l,o=n.next(a);return a>=mf?1/0:a}const _t=(n,a,l)=>n+(a-n)*l;function Ud(n,a,l){return l<0&&(l+=1),l>1&&(l-=1),l<1/6?n+(a-n)*6*l:l<1/2?a:l<2/3?n+(a-n)*(2/3-l)*6:n}function yC({hue:n,saturation:a,lightness:l,alpha:o}){n/=360,a/=100,l/=100;let r=0,u=0,d=0;if(!a)r=u=d=l;else{const m=l<.5?l*(1+a):l+a-l*a,p=2*l-m;r=Ud(p,m,n+1/3),u=Ud(p,m,n),d=Ud(p,m,n-1/3)}return{red:Math.round(r*255),green:Math.round(u*255),blue:Math.round(d*255),alpha:o}}function tc(n,a){return l=>l>0?a:n}const Vd=(n,a,l)=>{const o=n*n,r=l*(a*a-o)+o;return r<0?0:Math.sqrt(r)},bC=[uf,Ps,Ui],SC=n=>bC.find(a=>a.test(n));function Xv(n){const a=SC(n);if(!a)return!1;let l=a.parse(n);return a===Ui&&(l=yC(l)),l}const Qv=(n,a)=>{const l=Xv(n),o=Xv(a);if(!l||!o)return tc(n,a);const r={...l};return u=>(r.red=Vd(l.red,o.red,u),r.green=Vd(l.green,o.green,u),r.blue=Vd(l.blue,o.blue,u),r.alpha=_t(l.alpha,o.alpha,u),Ps.transform(r))},_C=(n,a)=>l=>a(n(l)),bo=(...n)=>n.reduce(_C),pf=new Set(["none","hidden"]);function xC(n,a){return pf.has(n)?l=>l<=0?n:a:l=>l>=1?a:n}function TC(n,a){return l=>_t(n,a,l)}function yh(n){return typeof n=="number"?TC:typeof n=="string"?Jf(n)?tc:ln.test(n)?Qv:AC:Array.isArray(n)?Gb:typeof n=="object"?ln.test(n)?Qv:EC:tc}function Gb(n,a){const l=[...n],o=l.length,r=n.map((u,d)=>yh(u)(u,a[d]));return u=>{for(let d=0;d<o;d++)l[d]=r[d](u);return l}}function EC(n,a){const l={...n,...a},o={};for(const r in l)n[r]!==void 0&&a[r]!==void 0&&(o[r]=yh(n[r])(n[r],a[r]));return r=>{for(const u in o)l[u]=o[u](r);return l}}function CC(n,a){var l;const o=[],r={color:0,var:0,number:0};for(let u=0;u<a.values.length;u++){const d=a.types[u],m=n.indexes[d][r[d]],p=(l=n.values[m])!==null&&l!==void 0?l:0;o[u]=p,r[d]++}return o}const AC=(n,a)=>{const l=gs.createTransformer(a),o=fo(n),r=fo(a);return o.indexes.var.length===r.indexes.var.length&&o.indexes.color.length===r.indexes.color.length&&o.indexes.number.length>=r.indexes.number.length?pf.has(n)&&!r.values.length||pf.has(a)&&!o.values.length?xC(n,a):bo(Gb(CC(o,r),r.values),l):tc(n,a)};function Pb(n,a,l){return typeof n=="number"&&typeof a=="number"&&typeof l=="number"?_t(n,a,l):yh(n)(n,a)}const jC=5;function Fb(n,a,l){const o=Math.max(a-jC,0);return mb(l-n(o),a-o)}const Nt={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},Id=.001;function NC({duration:n=Nt.duration,bounce:a=Nt.bounce,velocity:l=Nt.velocity,mass:o=Nt.mass}){let r,u,d=1-a;d=Ua(Nt.minDamping,Nt.maxDamping,d),n=Ua(Nt.minDuration,Nt.maxDuration,La(n)),d<1?(r=g=>{const v=g*d,b=v*n,x=v-l,T=gf(g,d),A=Math.exp(-b);return Id-x/T*A},u=g=>{const b=g*d*n,x=b*l+l,T=Math.pow(d,2)*Math.pow(g,2)*n,A=Math.exp(-b),j=gf(Math.pow(g,2),d);return(-r(g)+Id>0?-1:1)*((x-T)*A)/j}):(r=g=>{const v=Math.exp(-g*n),b=(g-l)*n+1;return-Id+v*b},u=g=>{const v=Math.exp(-g*n),b=(l-g)*(n*n);return v*b});const m=5/n,p=DC(r,u,m);if(n=Ba(n),isNaN(p))return{stiffness:Nt.stiffness,damping:Nt.damping,duration:n};{const g=Math.pow(p,2)*o;return{stiffness:g,damping:d*2*Math.sqrt(o*g),duration:n}}}const wC=12;function DC(n,a,l){let o=l;for(let r=1;r<wC;r++)o=o-n(o)/a(o);return o}function gf(n,a){return n*Math.sqrt(1-a*a)}const kC=["duration","bounce"],RC=["stiffness","damping","mass"];function Jv(n,a){return a.some(l=>n[l]!==void 0)}function MC(n){let a={velocity:Nt.velocity,stiffness:Nt.stiffness,damping:Nt.damping,mass:Nt.mass,isResolvedFromDuration:!1,...n};if(!Jv(n,RC)&&Jv(n,kC))if(n.visualDuration){const l=n.visualDuration,o=2*Math.PI/(l*1.2),r=o*o,u=2*Ua(.05,1,1-(n.bounce||0))*Math.sqrt(r);a={...a,mass:Nt.mass,stiffness:r,damping:u}}else{const l=NC(n);a={...a,...l,mass:Nt.mass},a.isResolvedFromDuration=!0}return a}function $b(n=Nt.visualDuration,a=Nt.bounce){const l=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:a}:n;let{restSpeed:o,restDelta:r}=l;const u=l.keyframes[0],d=l.keyframes[l.keyframes.length-1],m={done:!1,value:u},{stiffness:p,damping:g,mass:v,duration:b,velocity:x,isResolvedFromDuration:T}=MC({...l,velocity:-La(l.velocity||0)}),A=x||0,j=g/(2*Math.sqrt(p*v)),N=d-u,C=La(Math.sqrt(p/v)),B=Math.abs(N)<5;o||(o=B?Nt.restSpeed.granular:Nt.restSpeed.default),r||(r=B?Nt.restDelta.granular:Nt.restDelta.default);let R;if(j<1){const H=gf(C,j);R=J=>{const W=Math.exp(-j*C*J);return d-W*((A+j*C*N)/H*Math.sin(H*J)+N*Math.cos(H*J))}}else if(j===1)R=H=>d-Math.exp(-C*H)*(N+(A+C*N)*H);else{const H=C*Math.sqrt(j*j-1);R=J=>{const W=Math.exp(-j*C*J),F=Math.min(H*J,300);return d-W*((A+j*C*N)*Math.sinh(F)+H*N*Math.cosh(F))/H}}const X={calculatedDuration:T&&b||null,next:H=>{const J=R(H);if(T)m.done=H>=b;else{let W=0;j<1&&(W=H===0?Ba(A):Fb(R,H,J));const F=Math.abs(W)<=o,ne=Math.abs(d-J)<=r;m.done=F&&ne}return m.value=m.done?d:J,m},toString:()=>{const H=Math.min(qb(X),mf),J=gb(W=>X.next(H*W).value,H,30);return H+"ms "+J}};return X}function Wv({keyframes:n,velocity:a=0,power:l=.8,timeConstant:o=325,bounceDamping:r=10,bounceStiffness:u=500,modifyTarget:d,min:m,max:p,restDelta:g=.5,restSpeed:v}){const b=n[0],x={done:!1,value:b},T=F=>m!==void 0&&F<m||p!==void 0&&F>p,A=F=>m===void 0?p:p===void 0||Math.abs(m-F)<Math.abs(p-F)?m:p;let j=l*a;const N=b+j,C=d===void 0?N:d(N);C!==N&&(j=C-b);const B=F=>-j*Math.exp(-F/o),R=F=>C+B(F),X=F=>{const ne=B(F),ge=R(F);x.done=Math.abs(ne)<=g,x.value=x.done?C:ge};let H,J;const W=F=>{T(x.value)&&(H=F,J=$b({keyframes:[x.value,A(x.value)],velocity:Fb(R,F,x.value),damping:r,stiffness:u,restDelta:g,restSpeed:v}))};return W(0),{calculatedDuration:null,next:F=>{let ne=!1;return!J&&H===void 0&&(ne=!0,X(F),W(F)),H!==void 0&&F>=H?J.next(F-H):(!ne&&X(F),x)}}}const OC=yo(.42,0,1,1),BC=yo(0,0,.58,1),Yb=yo(.42,0,.58,1),LC=n=>Array.isArray(n)&&typeof n[0]!="number",zC={linear:Dn,easeIn:OC,easeInOut:Yb,easeOut:BC,circIn:hh,circInOut:Ab,circOut:Cb,backIn:fh,backInOut:Tb,backOut:xb,anticipate:Eb},ey=n=>{if(dh(n)){Y0(n.length===4);const[a,l,o,r]=n;return yo(a,l,o,r)}else if(typeof n=="string")return zC[n];return n};function UC(n,a,l){const o=[],r=l||Pb,u=n.length-1;for(let d=0;d<u;d++){let m=r(n[d],n[d+1]);if(a){const p=Array.isArray(a)?a[d]||Dn:a;m=bo(p,m)}o.push(m)}return o}function VC(n,a,{clamp:l=!0,ease:o,mixer:r}={}){const u=n.length;if(Y0(u===a.length),u===1)return()=>a[0];if(u===2&&a[0]===a[1])return()=>a[1];const d=n[0]===n[1];n[0]>n[u-1]&&(n=[...n].reverse(),a=[...a].reverse());const m=UC(a,o,r),p=m.length,g=v=>{if(d&&v<n[0])return a[0];let b=0;if(p>1)for(;b<n.length-2&&!(v<n[b+1]);b++);const x=Pi(n[b],n[b+1],v);return m[b](x)};return l?v=>g(Ua(n[0],n[u-1],v)):g}function IC(n,a){const l=n[n.length-1];for(let o=1;o<=a;o++){const r=Pi(0,a,o);n.push(_t(l,1,r))}}function HC(n){const a=[0];return IC(a,n.length-1),a}function qC(n,a){return n.map(l=>l*a)}function GC(n,a){return n.map(()=>a||Yb).splice(0,n.length-1)}function nc({duration:n=300,keyframes:a,times:l,ease:o="easeInOut"}){const r=LC(o)?o.map(ey):ey(o),u={done:!1,value:a[0]},d=qC(l&&l.length===a.length?l:HC(a),n),m=VC(d,a,{ease:Array.isArray(r)?r:GC(a,r)});return{calculatedDuration:n,next:p=>(u.value=m(p),u.done=p>=n,u)}}const PC=n=>{const a=({timestamp:l})=>n(l);return{start:()=>ft.update(a,!0),stop:()=>ps(a),now:()=>tn.isProcessing?tn.timestamp:ha.now()}},FC={decay:Wv,inertia:Wv,tween:nc,keyframes:nc,spring:$b},$C=n=>n/100;class bh extends Hb{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:p}=this.options;p&&p()};const{name:l,motionValue:o,element:r,keyframes:u}=this.options,d=(r==null?void 0:r.KeyframeResolver)||vh,m=(p,g)=>this.onKeyframesResolved(p,g);this.resolver=new d(u,m,l,o,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(a){const{type:l="keyframes",repeat:o=0,repeatDelay:r=0,repeatType:u,velocity:d=0}=this.options,m=uh(l)?l:FC[l]||nc;let p,g;m!==nc&&typeof a[0]!="number"&&(p=bo($C,Pb(a[0],a[1])),a=[0,100]);const v=m({...this.options,keyframes:a});u==="mirror"&&(g=m({...this.options,keyframes:[...a].reverse(),velocity:-d})),v.calculatedDuration===null&&(v.calculatedDuration=qb(v));const{calculatedDuration:b}=v,x=b+r,T=x*(o+1)-r;return{generator:v,mirroredGenerator:g,mapPercentToKeyframes:p,calculatedDuration:b,resolvedDuration:x,totalDuration:T}}onPostResolved(){const{autoplay:a=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!a?this.pause():this.state=this.pendingPlayState}tick(a,l=!1){const{resolved:o}=this;if(!o){const{keyframes:F}=this.options;return{done:!0,value:F[F.length-1]}}const{finalKeyframe:r,generator:u,mirroredGenerator:d,mapPercentToKeyframes:m,keyframes:p,calculatedDuration:g,totalDuration:v,resolvedDuration:b}=o;if(this.startTime===null)return u.next(0);const{delay:x,repeat:T,repeatType:A,repeatDelay:j,onUpdate:N}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,a):this.speed<0&&(this.startTime=Math.min(a-v/this.speed,this.startTime)),l?this.currentTime=a:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(a-this.startTime)*this.speed;const C=this.currentTime-x*(this.speed>=0?1:-1),B=this.speed>=0?C<0:C>v;this.currentTime=Math.max(C,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=v);let R=this.currentTime,X=u;if(T){const F=Math.min(this.currentTime,v)/b;let ne=Math.floor(F),ge=F%1;!ge&&F>=1&&(ge=1),ge===1&&ne--,ne=Math.min(ne,T+1),!!(ne%2)&&(A==="reverse"?(ge=1-ge,j&&(ge-=j/b)):A==="mirror"&&(X=d)),R=Ua(0,1,ge)*b}const H=B?{done:!1,value:p[0]}:X.next(R);m&&(H.value=m(H.value));let{done:J}=H;!B&&g!==null&&(J=this.speed>=0?this.currentTime>=v:this.currentTime<=0);const W=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&J);return W&&r!==void 0&&(H.value=bc(p,this.options,r)),N&&N(H.value),W&&this.finish(),H}get duration(){const{resolved:a}=this;return a?La(a.calculatedDuration):0}get time(){return La(this.currentTime)}set time(a){a=Ba(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 l=this.playbackSpeed!==a;this.playbackSpeed=a,l&&(this.time=La(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:a=PC,onPlay:l,startTime:o}=this.options;this.driver||(this.driver=a(u=>this.tick(u))),l&&l();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=o??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var a;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(a=this.currentTime)!==null&&a!==void 0?a:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:a}=this.options;a&&a()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(a){return this.startTime=0,this.tick(a,!0)}}const YC=new Set(["opacity","clipPath","filter","transform"]);function KC(n,a,l,{delay:o=0,duration:r=300,repeat:u=0,repeatType:d="loop",ease:m="easeInOut",times:p}={}){const g={[a]:l};p&&(g.offset=p);const v=yb(m,r);return Array.isArray(v)&&(g.easing=v),n.animate(g,{delay:o,duration:r,easing:Array.isArray(v)?"linear":v,fill:"both",iterations:u+1,direction:d==="reverse"?"alternate":"normal"})}const ZC=ch(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),ac=10,XC=2e4;function QC(n){return uh(n.type)||n.type==="spring"||!vb(n.ease)}function JC(n,a){const l=new bh({...a,keyframes:n,repeat:0,delay:0,isGenerator:!0});let o={done:!1,value:n[0]};const r=[];let u=0;for(;!o.done&&u<XC;)o=l.sample(u),r.push(o.value),u+=ac;return{times:void 0,keyframes:r,duration:u-ac,ease:"linear"}}const Kb={anticipate:Eb,backInOut:Tb,circInOut:Ab};function WC(n){return n in Kb}class ty extends Hb{constructor(a){super(a);const{name:l,motionValue:o,element:r,keyframes:u}=this.options;this.resolver=new Ib(u,(d,m)=>this.onKeyframesResolved(d,m),l,o,r),this.resolver.scheduleResolve()}initPlayback(a,l){let{duration:o=300,times:r,ease:u,type:d,motionValue:m,name:p,startTime:g}=this.options;if(!m.owner||!m.owner.current)return!1;if(typeof u=="string"&&ec()&&WC(u)&&(u=Kb[u]),QC(this.options)){const{onComplete:b,onUpdate:x,motionValue:T,element:A,...j}=this.options,N=JC(a,j);a=N.keyframes,a.length===1&&(a[1]=a[0]),o=N.duration,r=N.times,u=N.ease,d="keyframes"}const v=KC(m.owner.current,p,a,{...this.options,duration:o,times:r,ease:u});return v.startTime=g??this.calcStartTime(),this.pendingTimeline?(Gv(v,this.pendingTimeline),this.pendingTimeline=void 0):v.onfinish=()=>{const{onComplete:b}=this.options;m.set(bc(a,this.options,l)),b&&b(),this.cancel(),this.resolveFinishedPromise()},{animation:v,duration:o,times:r,type:d,ease:u,keyframes:a}}get duration(){const{resolved:a}=this;if(!a)return 0;const{duration:l}=a;return La(l)}get time(){const{resolved:a}=this;if(!a)return 0;const{animation:l}=a;return La(l.currentTime||0)}set time(a){const{resolved:l}=this;if(!l)return;const{animation:o}=l;o.currentTime=Ba(a)}get speed(){const{resolved:a}=this;if(!a)return 1;const{animation:l}=a;return l.playbackRate}set speed(a){const{resolved:l}=this;if(!l)return;const{animation:o}=l;o.playbackRate=a}get state(){const{resolved:a}=this;if(!a)return"idle";const{animation:l}=a;return l.playState}get startTime(){const{resolved:a}=this;if(!a)return null;const{animation:l}=a;return l.startTime}attachTimeline(a){if(!this._resolved)this.pendingTimeline=a;else{const{resolved:l}=this;if(!l)return Dn;const{animation:o}=l;Gv(o,a)}return Dn}play(){if(this.isStopped)return;const{resolved:a}=this;if(!a)return;const{animation:l}=a;l.playState==="finished"&&this.updateFinishedPromise(),l.play()}pause(){const{resolved:a}=this;if(!a)return;const{animation:l}=a;l.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:l,keyframes:o,duration:r,type:u,ease:d,times:m}=a;if(l.playState==="idle"||l.playState==="finished")return;if(this.time){const{motionValue:g,onUpdate:v,onComplete:b,element:x,...T}=this.options,A=new bh({...T,keyframes:o,duration:r,type:u,ease:d,times:m,isGenerator:!0}),j=Ba(this.time);g.setWithVelocity(A.sample(j-ac).value,A.sample(j).value,ac)}const{onStop:p}=this.options;p&&p(),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:l,name:o,repeatDelay:r,repeatType:u,damping:d,type:m}=a;if(!l||!l.owner||!(l.owner.current instanceof HTMLElement))return!1;const{onUpdate:p,transformTemplate:g}=l.owner.getProps();return ZC()&&o&&YC.has(o)&&!p&&!g&&!r&&u!=="mirror"&&d!==0&&m!=="inertia"}}const eA={type:"spring",stiffness:500,damping:25,restSpeed:10},tA=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),nA={type:"keyframes",duration:.8},aA={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},sA=(n,{keyframes:a})=>a.length>2?nA:Zs.has(n)?n.startsWith("scale")?tA(a[1]):eA:aA;function iA({when:n,delay:a,delayChildren:l,staggerChildren:o,staggerDirection:r,repeat:u,repeatType:d,repeatDelay:m,from:p,elapsed:g,...v}){return!!Object.keys(v).length}const Sh=(n,a,l,o={},r,u)=>d=>{const m=ih(o,n)||{},p=m.delay||o.delay||0;let{elapsed:g=0}=o;g=g-Ba(p);let v={keyframes:Array.isArray(l)?l:[null,l],ease:"easeOut",velocity:a.getVelocity(),...m,delay:-g,onUpdate:x=>{a.set(x),m.onUpdate&&m.onUpdate(x)},onComplete:()=>{d(),m.onComplete&&m.onComplete()},name:n,motionValue:a,element:u?void 0:r};iA(m)||(v={...v,...sA(n,v)}),v.duration&&(v.duration=Ba(v.duration)),v.repeatDelay&&(v.repeatDelay=Ba(v.repeatDelay)),v.from!==void 0&&(v.keyframes[0]=v.from);let b=!1;if((v.type===!1||v.duration===0&&!v.repeatDelay)&&(v.duration=0,v.delay===0&&(b=!0)),b&&!u&&a.get()!==void 0){const x=bc(v.keyframes,m);if(x!==void 0)return ft.update(()=>{v.onUpdate(x),v.onComplete()}),new z2([])}return!u&&ty.supports(v)?new ty(v):new bh(v)};function lA({protectedKeys:n,needsAnimating:a},l){const o=n.hasOwnProperty(l)&&a[l]!==!0;return a[l]=!1,o}function Zb(n,a,{delay:l=0,transitionOverride:o,type:r}={}){var u;let{transition:d=n.getDefaultTransition(),transitionEnd:m,...p}=a;o&&(d=o);const g=[],v=r&&n.animationState&&n.animationState.getState()[r];for(const b in p){const x=n.getValue(b,(u=n.latestValues[b])!==null&&u!==void 0?u:null),T=p[b];if(T===void 0||v&&lA(v,b))continue;const A={delay:l,...ih(d||{},b)};let j=!1;if(window.MotionHandoffAnimation){const C=pb(n);if(C){const B=window.MotionHandoffAnimation(C,b,ft);B!==null&&(A.startTime=B,j=!0)}}rf(n,b),x.start(Sh(b,x,T,n.shouldReduceMotion&&hb.has(b)?{type:!1}:A,n,j));const N=x.animation;N&&g.push(N)}return m&&Promise.all(g).then(()=>{ft.update(()=>{m&&M2(n,m)})}),g}function vf(n,a,l={}){var o;const r=yc(n,a,l.type==="exit"?(o=n.presenceContext)===null||o===void 0?void 0:o.custom:void 0);let{transition:u=n.getDefaultTransition()||{}}=r||{};l.transitionOverride&&(u=l.transitionOverride);const d=r?()=>Promise.all(Zb(n,r,l)):()=>Promise.resolve(),m=n.variantChildren&&n.variantChildren.size?(g=0)=>{const{delayChildren:v=0,staggerChildren:b,staggerDirection:x}=u;return oA(n,a,v+g,b,x,l)}:()=>Promise.resolve(),{when:p}=u;if(p){const[g,v]=p==="beforeChildren"?[d,m]:[m,d];return g().then(()=>v())}else return Promise.all([d(),m(l.delay)])}function oA(n,a,l=0,o=0,r=1,u){const d=[],m=(n.variantChildren.size-1)*o,p=r===1?(g=0)=>g*o:(g=0)=>m-g*o;return Array.from(n.variantChildren).sort(rA).forEach((g,v)=>{g.notify("AnimationStart",a),d.push(vf(g,a,{...u,delay:l+p(v)}).then(()=>g.notify("AnimationComplete",a)))}),Promise.all(d)}function rA(n,a){return n.sortNodePosition(a)}function cA(n,a,l={}){n.notify("AnimationStart",a);let o;if(Array.isArray(a)){const r=a.map(u=>vf(n,u,l));o=Promise.all(r)}else if(typeof a=="string")o=vf(n,a,l);else{const r=typeof a=="function"?yc(n,a,l.custom):a;o=Promise.all(Zb(n,r,l))}return o.then(()=>{n.notify("AnimationComplete",a)})}const uA=Yf.length;function Xb(n){if(!n)return;if(!n.isControllingVariants){const l=n.parent?Xb(n.parent)||{}:{};return n.props.initial!==void 0&&(l.initial=n.props.initial),l}const a={};for(let l=0;l<uA;l++){const o=Yf[l],r=n.props[o];(ro(r)||r===!1)&&(a[o]=r)}return a}const dA=[...$f].reverse(),fA=$f.length;function hA(n){return a=>Promise.all(a.map(({animation:l,options:o})=>cA(n,l,o)))}function mA(n){let a=hA(n),l=ny(),o=!0;const r=p=>(g,v)=>{var b;const x=yc(n,v,p==="exit"?(b=n.presenceContext)===null||b===void 0?void 0:b.custom:void 0);if(x){const{transition:T,transitionEnd:A,...j}=x;g={...g,...j,...A}}return g};function u(p){a=p(n)}function d(p){const{props:g}=n,v=Xb(n.parent)||{},b=[],x=new Set;let T={},A=1/0;for(let N=0;N<fA;N++){const C=dA[N],B=l[C],R=g[C]!==void 0?g[C]:v[C],X=ro(R),H=C===p?B.isActive:null;H===!1&&(A=N);let J=R===v[C]&&R!==g[C]&&X;if(J&&o&&n.manuallyAnimateOnMount&&(J=!1),B.protectedKeys={...T},!B.isActive&&H===null||!R&&!B.prevProp||gc(R)||typeof R=="boolean")continue;const W=pA(B.prevProp,R);let F=W||C===p&&B.isActive&&!J&&X||N>A&&X,ne=!1;const ge=Array.isArray(R)?R:[R];let U=ge.reduce(r(C),{});H===!1&&(U={});const{prevResolvedValues:pe={}}=B,te={...pe,...U},ye=Y=>{F=!0,x.has(Y)&&(ne=!0,x.delete(Y)),B.needsAnimating[Y]=!0;const ee=n.getValue(Y);ee&&(ee.liveStyle=!1)};for(const Y in te){const ee=U[Y],ke=pe[Y];if(T.hasOwnProperty(Y))continue;let je=!1;of(ee)&&of(ke)?je=!fb(ee,ke):je=ee!==ke,je?ee!=null?ye(Y):x.add(Y):ee!==void 0&&x.has(Y)?ye(Y):B.protectedKeys[Y]=!0}B.prevProp=R,B.prevResolvedValues=U,B.isActive&&(T={...T,...U}),o&&n.blockInitialAnimation&&(F=!1),F&&(!(J&&W)||ne)&&b.push(...ge.map(Y=>({animation:Y,options:{type:C}})))}if(x.size){const N={};x.forEach(C=>{const B=n.getBaseTarget(C),R=n.getValue(C);R&&(R.liveStyle=!0),N[C]=B??null}),b.push({animation:N})}let j=!!b.length;return o&&(g.initial===!1||g.initial===g.animate)&&!n.manuallyAnimateOnMount&&(j=!1),o=!1,j?a(b):Promise.resolve()}function m(p,g){var v;if(l[p].isActive===g)return Promise.resolve();(v=n.variantChildren)===null||v===void 0||v.forEach(x=>{var T;return(T=x.animationState)===null||T===void 0?void 0:T.setActive(p,g)}),l[p].isActive=g;const b=d(p);for(const x in l)l[x].protectedKeys={};return b}return{animateChanges:d,setActive:m,setAnimateFunction:u,getState:()=>l,reset:()=>{l=ny(),o=!0}}}function pA(n,a){return typeof a=="string"?a!==n:Array.isArray(a)?!fb(a,n):!1}function Vs(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ny(){return{animate:Vs(!0),whileInView:Vs(),whileHover:Vs(),whileTap:Vs(),whileDrag:Vs(),whileFocus:Vs(),exit:Vs()}}class bs{constructor(a){this.isMounted=!1,this.node=a}update(){}}class gA extends bs{constructor(a){super(a),a.animationState||(a.animationState=mA(a))}updateAnimationControlsSubscription(){const{animate:a}=this.node.getProps();gc(a)&&(this.unmountControls=a.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:a}=this.node.getProps(),{animate:l}=this.node.prevProps||{};a!==l&&this.updateAnimationControlsSubscription()}unmount(){var a;this.node.animationState.reset(),(a=this.unmountControls)===null||a===void 0||a.call(this)}}let vA=0;class yA extends bs{constructor(){super(...arguments),this.id=vA++}update(){if(!this.node.presenceContext)return;const{isPresent:a,onExitComplete:l}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||a===o)return;const r=this.node.animationState.setActive("exit",!a);l&&!a&&r.then(()=>l(this.id))}mount(){const{register:a}=this.node.presenceContext||{};a&&(this.unmount=a(this.id))}unmount(){}}const bA={animation:{Feature:gA},exit:{Feature:yA}},ta={x:!1,y:!1};function Qb(){return ta.x||ta.y}function SA(n){return n==="x"||n==="y"?ta[n]?null:(ta[n]=!0,()=>{ta[n]=!1}):ta.x||ta.y?null:(ta.x=ta.y=!0,()=>{ta.x=ta.y=!1})}const _h=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1;function ho(n,a,l,o={passive:!0}){return n.addEventListener(a,l,o),()=>n.removeEventListener(a,l)}function So(n){return{point:{x:n.pageX,y:n.pageY}}}const _A=n=>a=>_h(a)&&n(a,So(a));function no(n,a,l,o){return ho(n,a,_A(l),o)}const ay=(n,a)=>Math.abs(n-a);function xA(n,a){const l=ay(n.x,a.x),o=ay(n.y,a.y);return Math.sqrt(l**2+o**2)}class Jb{constructor(a,l,{transformPagePoint:o,contextWindow:r,dragSnapToOrigin:u=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=qd(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,T=xA(b.offset,{x:0,y:0})>=3;if(!x&&!T)return;const{point:A}=b,{timestamp:j}=tn;this.history.push({...A,timestamp:j});const{onStart:N,onMove:C}=this.handlers;x||(N&&N(this.lastMoveEvent,b),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,b)},this.handlePointerMove=(b,x)=>{this.lastMoveEvent=b,this.lastMoveEventInfo=Hd(x,this.transformPagePoint),ft.update(this.updatePoint,!0)},this.handlePointerUp=(b,x)=>{this.end();const{onEnd:T,onSessionEnd:A,resumeAnimation:j}=this.handlers;if(this.dragSnapToOrigin&&j&&j(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const N=qd(b.type==="pointercancel"?this.lastMoveEventInfo:Hd(x,this.transformPagePoint),this.history);this.startEvent&&T&&T(b,N),A&&A(b,N)},!_h(a))return;this.dragSnapToOrigin=u,this.handlers=l,this.transformPagePoint=o,this.contextWindow=r||window;const d=So(a),m=Hd(d,this.transformPagePoint),{point:p}=m,{timestamp:g}=tn;this.history=[{...p,timestamp:g}];const{onSessionStart:v}=l;v&&v(a,qd(m,this.history)),this.removeListeners=bo(no(this.contextWindow,"pointermove",this.handlePointerMove),no(this.contextWindow,"pointerup",this.handlePointerUp),no(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(a){this.handlers=a}end(){this.removeListeners&&this.removeListeners(),ps(this.updatePoint)}}function Hd(n,a){return a?{point:a(n.point)}:n}function sy(n,a){return{x:n.x-a.x,y:n.y-a.y}}function qd({point:n},a){return{point:n,delta:sy(n,Wb(a)),offset:sy(n,TA(a)),velocity:EA(a,.1)}}function TA(n){return n[0]}function Wb(n){return n[n.length-1]}function EA(n,a){if(n.length<2)return{x:0,y:0};let l=n.length-1,o=null;const r=Wb(n);for(;l>=0&&(o=n[l],!(r.timestamp-o.timestamp>Ba(a)));)l--;if(!o)return{x:0,y:0};const u=La(r.timestamp-o.timestamp);if(u===0)return{x:0,y:0};const d={x:(r.x-o.x)/u,y:(r.y-o.y)/u};return d.x===1/0&&(d.x=0),d.y===1/0&&(d.y=0),d}const e1=1e-4,CA=1-e1,AA=1+e1,t1=.01,jA=0-t1,NA=0+t1;function kn(n){return n.max-n.min}function wA(n,a,l){return Math.abs(n-a)<=l}function iy(n,a,l,o=.5){n.origin=o,n.originPoint=_t(a.min,a.max,n.origin),n.scale=kn(l)/kn(a),n.translate=_t(l.min,l.max,n.origin)-n.originPoint,(n.scale>=CA&&n.scale<=AA||isNaN(n.scale))&&(n.scale=1),(n.translate>=jA&&n.translate<=NA||isNaN(n.translate))&&(n.translate=0)}function ao(n,a,l,o){iy(n.x,a.x,l.x,o?o.originX:void 0),iy(n.y,a.y,l.y,o?o.originY:void 0)}function ly(n,a,l){n.min=l.min+a.min,n.max=n.min+kn(a)}function DA(n,a,l){ly(n.x,a.x,l.x),ly(n.y,a.y,l.y)}function oy(n,a,l){n.min=a.min-l.min,n.max=n.min+kn(a)}function so(n,a,l){oy(n.x,a.x,l.x),oy(n.y,a.y,l.y)}function kA(n,{min:a,max:l},o){return a!==void 0&&n<a?n=o?_t(a,n,o.min):Math.max(n,a):l!==void 0&&n>l&&(n=o?_t(l,n,o.max):Math.min(n,l)),n}function ry(n,a,l){return{min:a!==void 0?n.min+a:void 0,max:l!==void 0?n.max+l-(n.max-n.min):void 0}}function RA(n,{top:a,left:l,bottom:o,right:r}){return{x:ry(n.x,l,r),y:ry(n.y,a,o)}}function cy(n,a){let l=a.min-n.min,o=a.max-n.max;return a.max-a.min<n.max-n.min&&([l,o]=[o,l]),{min:l,max:o}}function MA(n,a){return{x:cy(n.x,a.x),y:cy(n.y,a.y)}}function OA(n,a){let l=.5;const o=kn(n),r=kn(a);return r>o?l=Pi(a.min,a.max-o,n.min):o>r&&(l=Pi(n.min,n.max-r,a.min)),Ua(0,1,l)}function BA(n,a){const l={};return a.min!==void 0&&(l.min=a.min-n.min),a.max!==void 0&&(l.max=a.max-n.min),l}const yf=.35;function LA(n=yf){return n===!1?n=0:n===!0&&(n=yf),{x:uy(n,"left","right"),y:uy(n,"top","bottom")}}function uy(n,a,l){return{min:dy(n,a),max:dy(n,l)}}function dy(n,a){return typeof n=="number"?n:n[a]||0}const fy=()=>({translate:0,scale:1,origin:0,originPoint:0}),Vi=()=>({x:fy(),y:fy()}),hy=()=>({min:0,max:0}),Bt=()=>({x:hy(),y:hy()});function Fn(n){return[n("x"),n("y")]}function n1({top:n,left:a,right:l,bottom:o}){return{x:{min:a,max:l},y:{min:n,max:o}}}function zA({x:n,y:a}){return{top:a.min,right:n.max,bottom:a.max,left:n.min}}function UA(n,a){if(!a)return n;const l=a({x:n.left,y:n.top}),o=a({x:n.right,y:n.bottom});return{top:l.y,left:l.x,bottom:o.y,right:o.x}}function Gd(n){return n===void 0||n===1}function bf({scale:n,scaleX:a,scaleY:l}){return!Gd(n)||!Gd(a)||!Gd(l)}function Hs(n){return bf(n)||a1(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function a1(n){return my(n.x)||my(n.y)}function my(n){return n&&n!=="0%"}function sc(n,a,l){const o=n-l,r=a*o;return l+r}function py(n,a,l,o,r){return r!==void 0&&(n=sc(n,r,o)),sc(n,l,o)+a}function Sf(n,a=0,l=1,o,r){n.min=py(n.min,a,l,o,r),n.max=py(n.max,a,l,o,r)}function s1(n,{x:a,y:l}){Sf(n.x,a.translate,a.scale,a.originPoint),Sf(n.y,l.translate,l.scale,l.originPoint)}const gy=.999999999999,vy=1.0000000000001;function VA(n,a,l,o=!1){const r=l.length;if(!r)return;a.x=a.y=1;let u,d;for(let m=0;m<r;m++){u=l[m],d=u.projectionDelta;const{visualElement:p}=u.options;p&&p.props.style&&p.props.style.display==="contents"||(o&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Hi(n,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),d&&(a.x*=d.x.scale,a.y*=d.y.scale,s1(n,d)),o&&Hs(u.latestValues)&&Hi(n,u.latestValues))}a.x<vy&&a.x>gy&&(a.x=1),a.y<vy&&a.y>gy&&(a.y=1)}function Ii(n,a){n.min=n.min+a,n.max=n.max+a}function yy(n,a,l,o,r=.5){const u=_t(n.min,n.max,r);Sf(n,a,l,u,o)}function Hi(n,a){yy(n.x,a.x,a.scaleX,a.scale,a.originX),yy(n.y,a.y,a.scaleY,a.scale,a.originY)}function i1(n,a){return n1(UA(n.getBoundingClientRect(),a))}function IA(n,a,l){const o=i1(n,l),{scroll:r}=a;return r&&(Ii(o.x,r.offset.x),Ii(o.y,r.offset.y)),o}const l1=({current:n})=>n?n.ownerDocument.defaultView:null,HA=new WeakMap;class qA{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=Bt(),this.visualElement=a}start(a,{snapToCursor:l=!1}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const r=v=>{const{dragSnapToOrigin:b}=this.getProps();b?this.pauseAnimation():this.stopAnimation(),l&&this.snapToCursor(So(v).point)},u=(v,b)=>{const{drag:x,dragPropagation:T,onDragStart:A}=this.getProps();if(x&&!T&&(this.openDragLock&&this.openDragLock(),this.openDragLock=SA(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),Fn(N=>{let C=this.getAxisMotionValue(N).get()||0;if(fa.test(C)){const{projection:B}=this.visualElement;if(B&&B.layout){const R=B.layout.layoutBox[N];R&&(C=kn(R)*(parseFloat(C)/100))}}this.originPoint[N]=C}),A&&ft.postRender(()=>A(v,b)),rf(this.visualElement,"transform");const{animationState:j}=this.visualElement;j&&j.setActive("whileDrag",!0)},d=(v,b)=>{const{dragPropagation:x,dragDirectionLock:T,onDirectionLock:A,onDrag:j}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:N}=b;if(T&&this.currentDirection===null){this.currentDirection=GA(N),this.currentDirection!==null&&A&&A(this.currentDirection);return}this.updateAxis("x",b.point,N),this.updateAxis("y",b.point,N),this.visualElement.render(),j&&j(v,b)},m=(v,b)=>this.stop(v,b),p=()=>Fn(v=>{var b;return this.getAnimationState(v)==="paused"&&((b=this.getAxisMotionValue(v).animation)===null||b===void 0?void 0:b.play())}),{dragSnapToOrigin:g}=this.getProps();this.panSession=new Jb(a,{onSessionStart:r,onStart:u,onMove:d,onSessionEnd:m,resumeAnimation:p},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,contextWindow:l1(this.visualElement)})}stop(a,l){const o=this.isDragging;if(this.cancel(),!o)return;const{velocity:r}=l;this.startAnimation(r);const{onDragEnd:u}=this.getProps();u&&ft.postRender(()=>u(a,l))}cancel(){this.isDragging=!1;const{projection:a,animationState:l}=this.visualElement;a&&(a.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),l&&l.setActive("whileDrag",!1)}updateAxis(a,l,o){const{drag:r}=this.getProps();if(!o||!Ir(a,r,this.currentDirection))return;const u=this.getAxisMotionValue(a);let d=this.originPoint[a]+o[a];this.constraints&&this.constraints[a]&&(d=kA(d,this.constraints[a],this.elastic[a])),u.set(d)}resolveConstraints(){var a;const{dragConstraints:l,dragElastic:o}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)===null||a===void 0?void 0:a.layout,u=this.constraints;l&&zi(l)?this.constraints||(this.constraints=this.resolveRefConstraints()):l&&r?this.constraints=RA(r.layoutBox,l):this.constraints=!1,this.elastic=LA(o),u!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Fn(d=>{this.constraints!==!1&&this.getAxisMotionValue(d)&&(this.constraints[d]=BA(r.layoutBox[d],this.constraints[d]))})}resolveRefConstraints(){const{dragConstraints:a,onMeasureDragConstraints:l}=this.getProps();if(!a||!zi(a))return!1;const o=a.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const u=IA(o,r.root,this.visualElement.getTransformPagePoint());let d=MA(r.layout.layoutBox,u);if(l){const m=l(zA(d));this.hasMutatedConstraints=!!m,m&&(d=n1(m))}return d}startAnimation(a){const{drag:l,dragMomentum:o,dragElastic:r,dragTransition:u,dragSnapToOrigin:d,onDragTransitionEnd:m}=this.getProps(),p=this.constraints||{},g=Fn(v=>{if(!Ir(v,l,this.currentDirection))return;let b=p&&p[v]||{};d&&(b={min:0,max:0});const x=r?200:1e6,T=r?40:1e7,A={type:"inertia",velocity:o?a[v]:0,bounceStiffness:x,bounceDamping:T,timeConstant:750,restDelta:1,restSpeed:10,...u,...b};return this.startAxisValueAnimation(v,A)});return Promise.all(g).then(m)}startAxisValueAnimation(a,l){const o=this.getAxisMotionValue(a);return rf(this.visualElement,a),o.start(Sh(a,o,0,l,this.visualElement,!1))}stopAnimation(){Fn(a=>this.getAxisMotionValue(a).stop())}pauseAnimation(){Fn(a=>{var l;return(l=this.getAxisMotionValue(a).animation)===null||l===void 0?void 0:l.pause()})}getAnimationState(a){var l;return(l=this.getAxisMotionValue(a).animation)===null||l===void 0?void 0:l.state}getAxisMotionValue(a){const l=`_drag${a.toUpperCase()}`,o=this.visualElement.getProps(),r=o[l];return r||this.visualElement.getValue(a,(o.initial?o.initial[a]:void 0)||0)}snapToCursor(a){Fn(l=>{const{drag:o}=this.getProps();if(!Ir(l,o,this.currentDirection))return;const{projection:r}=this.visualElement,u=this.getAxisMotionValue(l);if(r&&r.layout){const{min:d,max:m}=r.layout.layoutBox[l];u.set(a[l]-_t(d,m,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:a,dragConstraints:l}=this.getProps(),{projection:o}=this.visualElement;if(!zi(l)||!o||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Fn(d=>{const m=this.getAxisMotionValue(d);if(m&&this.constraints!==!1){const p=m.get();r[d]=OA({min:p,max:p},this.constraints[d])}});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.resolveConstraints(),Fn(d=>{if(!Ir(d,a,null))return;const m=this.getAxisMotionValue(d),{min:p,max:g}=this.constraints[d];m.set(_t(p,g,r[d]))})}addListeners(){if(!this.visualElement.current)return;HA.set(this.visualElement,this);const a=this.visualElement.current,l=no(a,"pointerdown",p=>{const{drag:g,dragListener:v=!0}=this.getProps();g&&v&&this.start(p)}),o=()=>{const{dragConstraints:p}=this.getProps();zi(p)&&p.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,u=r.addEventListener("measure",o);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),ft.read(o);const d=ho(window,"resize",()=>this.scalePositionWithinConstraints()),m=r.addEventListener("didUpdate",(({delta:p,hasLayoutChanged:g})=>{this.isDragging&&g&&(Fn(v=>{const b=this.getAxisMotionValue(v);b&&(this.originPoint[v]+=p[v].translate,b.set(b.get()+p[v].translate))}),this.visualElement.render())}));return()=>{d(),l(),u(),m&&m()}}getProps(){const a=this.visualElement.getProps(),{drag:l=!1,dragDirectionLock:o=!1,dragPropagation:r=!1,dragConstraints:u=!1,dragElastic:d=yf,dragMomentum:m=!0}=a;return{...a,drag:l,dragDirectionLock:o,dragPropagation:r,dragConstraints:u,dragElastic:d,dragMomentum:m}}}function Ir(n,a,l){return(a===!0||a===n)&&(l===null||l===n)}function GA(n,a=10){let l=null;return Math.abs(n.y)>a?l="y":Math.abs(n.x)>a&&(l="x"),l}class PA extends bs{constructor(a){super(a),this.removeGroupControls=Dn,this.removeListeners=Dn,this.controls=new qA(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 by=n=>(a,l)=>{n&&ft.postRender(()=>n(a,l))};class FA extends bs{constructor(){super(...arguments),this.removePointerDownListener=Dn}onPointerDown(a){this.session=new Jb(a,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:l1(this.node)})}createPanHandlers(){const{onPanSessionStart:a,onPanStart:l,onPan:o,onPanEnd:r}=this.node.getProps();return{onSessionStart:by(a),onStart:by(l),onMove:o,onEnd:(u,d)=>{delete this.session,r&&ft.postRender(()=>r(u,d))}}}mount(){this.removePointerDownListener=no(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 Xr={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Sy(n,a){return a.max===a.min?0:n/(a.max-a.min)*100}const $l={correct:(n,a)=>{if(!a.target)return n;if(typeof n=="string")if(xe.test(n))n=parseFloat(n);else return n;const l=Sy(n,a.target.x),o=Sy(n,a.target.y);return`${l}% ${o}%`}},$A={correct:(n,{treeScale:a,projectionDelta:l})=>{const o=n,r=gs.parse(n);if(r.length>5)return o;const u=gs.createTransformer(n),d=typeof r[0]!="number"?1:0,m=l.x.scale*a.x,p=l.y.scale*a.y;r[0+d]/=m,r[1+d]/=p;const g=_t(m,p,.5);return typeof r[2+d]=="number"&&(r[2+d]/=g),typeof r[3+d]=="number"&&(r[3+d]/=g),u(r)}};class YA extends S.Component{componentDidMount(){const{visualElement:a,layoutGroup:l,switchLayoutGroup:o,layoutId:r}=this.props,{projection:u}=a;b2(KA),u&&(l.group&&l.group.add(u),o&&o.register&&r&&o.register(u),u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,onExitComplete:()=>this.safeToRemove()})),Xr.hasEverUpdated=!0}getSnapshotBeforeUpdate(a){const{layoutDependency:l,visualElement:o,drag:r,isPresent:u}=this.props,d=o.projection;return d&&(d.isPresent=u,r||a.layoutDependency!==l||l===void 0?d.willUpdate():this.safeToRemove(),a.isPresent!==u&&(u?d.promote():d.relegate()||ft.postRender(()=>{const m=d.getStack();(!m||!m.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:a}=this.props.visualElement;a&&(a.root.didUpdate(),Zf.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:a,layoutGroup:l,switchLayoutGroup:o}=this.props,{projection:r}=a;r&&(r.scheduleCheckAfterUnmount(),l&&l.group&&l.group.remove(r),o&&o.deregister&&o.deregister(r))}safeToRemove(){const{safeToRemove:a}=this.props;a&&a()}render(){return null}}function o1(n){const[a,l]=F0(),o=S.useContext(qf);return h.jsx(YA,{...n,layoutGroup:o,switchLayoutGroup:S.useContext(W0),isPresent:a,safeToRemove:l})}const KA={borderRadius:{...$l,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:$l,borderTopRightRadius:$l,borderBottomLeftRadius:$l,borderBottomRightRadius:$l,boxShadow:$A};function ZA(n,a,l){const o=on(n)?n:uo(n);return o.start(Sh("",o,a,l)),o.animation}function XA(n){return n instanceof SVGElement&&n.tagName!=="svg"}const QA=(n,a)=>n.depth-a.depth;class JA{constructor(){this.children=[],this.isDirty=!1}add(a){lh(this.children,a),this.isDirty=!0}remove(a){oh(this.children,a),this.isDirty=!0}forEach(a){this.isDirty&&this.children.sort(QA),this.isDirty=!1,this.children.forEach(a)}}function WA(n,a){const l=ha.now(),o=({timestamp:r})=>{const u=r-l;u>=a&&(ps(o),n(u-a))};return ft.read(o,!0),()=>ps(o)}const r1=["TopLeft","TopRight","BottomLeft","BottomRight"],ej=r1.length,_y=n=>typeof n=="string"?parseFloat(n):n,xy=n=>typeof n=="number"||xe.test(n);function tj(n,a,l,o,r,u){r?(n.opacity=_t(0,l.opacity!==void 0?l.opacity:1,nj(o)),n.opacityExit=_t(a.opacity!==void 0?a.opacity:1,0,aj(o))):u&&(n.opacity=_t(a.opacity!==void 0?a.opacity:1,l.opacity!==void 0?l.opacity:1,o));for(let d=0;d<ej;d++){const m=`border${r1[d]}Radius`;let p=Ty(a,m),g=Ty(l,m);if(p===void 0&&g===void 0)continue;p||(p=0),g||(g=0),p===0||g===0||xy(p)===xy(g)?(n[m]=Math.max(_t(_y(p),_y(g),o),0),(fa.test(g)||fa.test(p))&&(n[m]+="%")):n[m]=g}(a.rotate||l.rotate)&&(n.rotate=_t(a.rotate||0,l.rotate||0,o))}function Ty(n,a){return n[a]!==void 0?n[a]:n.borderRadius}const nj=c1(0,.5,Cb),aj=c1(.5,.95,Dn);function c1(n,a,l){return o=>o<n?0:o>a?1:l(Pi(n,a,o))}function Ey(n,a){n.min=a.min,n.max=a.max}function Pn(n,a){Ey(n.x,a.x),Ey(n.y,a.y)}function Cy(n,a){n.translate=a.translate,n.scale=a.scale,n.originPoint=a.originPoint,n.origin=a.origin}function Ay(n,a,l,o,r){return n-=a,n=sc(n,1/l,o),r!==void 0&&(n=sc(n,1/r,o)),n}function sj(n,a=0,l=1,o=.5,r,u=n,d=n){if(fa.test(a)&&(a=parseFloat(a),a=_t(d.min,d.max,a/100)-d.min),typeof a!="number")return;let m=_t(u.min,u.max,o);n===u&&(m-=a),n.min=Ay(n.min,a,l,m,r),n.max=Ay(n.max,a,l,m,r)}function jy(n,a,[l,o,r],u,d){sj(n,a[l],a[o],a[r],a.scale,u,d)}const ij=["x","scaleX","originX"],lj=["y","scaleY","originY"];function Ny(n,a,l,o){jy(n.x,a,ij,l?l.x:void 0,o?o.x:void 0),jy(n.y,a,lj,l?l.y:void 0,o?o.y:void 0)}function wy(n){return n.translate===0&&n.scale===1}function u1(n){return wy(n.x)&&wy(n.y)}function Dy(n,a){return n.min===a.min&&n.max===a.max}function oj(n,a){return Dy(n.x,a.x)&&Dy(n.y,a.y)}function ky(n,a){return Math.round(n.min)===Math.round(a.min)&&Math.round(n.max)===Math.round(a.max)}function d1(n,a){return ky(n.x,a.x)&&ky(n.y,a.y)}function Ry(n){return kn(n.x)/kn(n.y)}function My(n,a){return n.translate===a.translate&&n.scale===a.scale&&n.originPoint===a.originPoint}class rj{constructor(){this.members=[]}add(a){lh(this.members,a),a.scheduleRender()}remove(a){if(oh(this.members,a),a===this.prevLead&&(this.prevLead=void 0),a===this.lead){const l=this.members[this.members.length-1];l&&this.promote(l)}}relegate(a){const l=this.members.findIndex(r=>a===r);if(l===0)return!1;let o;for(let r=l;r>=0;r--){const u=this.members[r];if(u.isPresent!==!1){o=u;break}}return o?(this.promote(o),!0):!1}promote(a,l){const o=this.lead;if(a!==o&&(this.prevLead=o,this.lead=a,a.show(),o)){o.instance&&o.scheduleRender(),a.scheduleRender(),a.resumeFrom=o,l&&(a.resumeFrom.preserveOpacity=!0),o.snapshot&&(a.snapshot=o.snapshot,a.snapshot.latestValues=o.animationValues||o.latestValues),a.root&&a.root.isUpdating&&(a.isLayoutDirty=!0);const{crossfade:r}=a.options;r===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(a=>{const{options:l,resumingFrom:o}=a;l.onExitComplete&&l.onExitComplete(),o&&o.options.onExitComplete&&o.options.onExitComplete()})}scheduleRender(){this.members.forEach(a=>{a.instance&&a.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function cj(n,a,l){let o="";const r=n.x.translate/a.x,u=n.y.translate/a.y,d=(l==null?void 0:l.z)||0;if((r||u||d)&&(o=`translate3d(${r}px, ${u}px, ${d}px) `),(a.x!==1||a.y!==1)&&(o+=`scale(${1/a.x}, ${1/a.y}) `),l){const{transformPerspective:g,rotate:v,rotateX:b,rotateY:x,skewX:T,skewY:A}=l;g&&(o=`perspective(${g}px) ${o}`),v&&(o+=`rotate(${v}deg) `),b&&(o+=`rotateX(${b}deg) `),x&&(o+=`rotateY(${x}deg) `),T&&(o+=`skewX(${T}deg) `),A&&(o+=`skewY(${A}deg) `)}const m=n.x.scale*a.x,p=n.y.scale*a.y;return(m!==1||p!==1)&&(o+=`scale(${m}, ${p})`),o||"none"}const qs={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Ql=typeof window<"u"&&window.MotionDebug!==void 0,Pd=["","X","Y","Z"],uj={visibility:"hidden"},Oy=1e3;let dj=0;function Fd(n,a,l,o){const{latestValues:r}=a;r[n]&&(l[n]=r[n],a.setStaticValue(n,0),o&&(o[n]=0))}function f1(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:a}=n.options;if(!a)return;const l=pb(a);if(window.MotionHasOptimisedAnimation(l,"transform")){const{layout:r,layoutId:u}=n.options;window.MotionCancelOptimisedAnimation(l,"transform",ft,!(r||u))}const{parent:o}=n;o&&!o.hasCheckedOptimisedAppear&&f1(o)}function h1({attachResizeListener:n,defaultParent:a,measureScroll:l,checkIsScrollRoot:o,resetTransform:r}){return class{constructor(d={},m=a==null?void 0:a()){this.id=dj++,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,Ql&&(qs.totalNodes=qs.resolvedTargetDeltas=qs.recalculatedProjection=0),this.nodes.forEach(mj),this.nodes.forEach(bj),this.nodes.forEach(Sj),this.nodes.forEach(pj),Ql&&window.MotionDebug.record(qs)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=d,this.root=m?m.root||m:this,this.path=m?[...m.path,m]:[],this.parent=m,this.depth=m?m.depth+1:0;for(let p=0;p<this.path.length;p++)this.path[p].shouldResetTransform=!0;this.root===this&&(this.nodes=new JA)}addEventListener(d,m){return this.eventHandlers.has(d)||this.eventHandlers.set(d,new rh),this.eventHandlers.get(d).add(m)}notifyListeners(d,...m){const p=this.eventHandlers.get(d);p&&p.notify(...m)}hasListeners(d){return this.eventHandlers.has(d)}mount(d,m=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=XA(d),this.instance=d;const{layoutId:p,layout:g,visualElement:v}=this.options;if(v&&!v.current&&v.mount(d),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),m&&(g||p)&&(this.isLayoutDirty=!0),n){let b;const x=()=>this.root.updateBlockedByResize=!1;n(d,()=>{this.root.updateBlockedByResize=!0,b&&b(),b=WA(x,250),Xr.hasAnimatedSinceResize&&(Xr.hasAnimatedSinceResize=!1,this.nodes.forEach(Ly))})}p&&this.root.registerSharedNode(p,this),this.options.animate!==!1&&v&&(p||g)&&this.addEventListener("didUpdate",({delta:b,hasLayoutChanged:x,hasRelativeTargetChanged:T,layout:A})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const j=this.options.transition||v.getDefaultTransition()||Cj,{onLayoutAnimationStart:N,onLayoutAnimationComplete:C}=v.getProps(),B=!this.targetLayout||!d1(this.targetLayout,A)||T,R=!x&&T;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||R||x&&(B||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(b,R);const X={...ih(j,"layout"),onPlay:N,onComplete:C};(v.shouldReduceMotion||this.options.layoutRoot)&&(X.delay=0,X.type=!1),this.startAnimation(X)}else x||Ly(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=A})}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,ps(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(_j),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&&f1(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let v=0;v<this.path.length;v++){const b=this.path[v];b.shouldResetTransform=!0,b.updateScroll("snapshot"),b.options.layoutRoot&&b.willUpdate(!1)}const{layoutId:m,layout:p}=this.options;if(m===void 0&&!p)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(By);return}this.isUpdating||this.nodes.forEach(vj),this.isUpdating=!1,this.nodes.forEach(yj),this.nodes.forEach(fj),this.nodes.forEach(hj),this.clearAllSnapshots();const m=ha.now();tn.delta=Ua(0,1e3/60,m-tn.timestamp),tn.timestamp=m,tn.isProcessing=!0,Ld.update.process(tn),Ld.preRender.process(tn),Ld.render.process(tn),tn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Zf.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(gj),this.sharedNodes.forEach(xj)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ft.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ft.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 p=0;p<this.path.length;p++)this.path[p].updateScroll();const d=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Bt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:m}=this.options;m&&m.notify("LayoutMeasure",this.layout.layoutBox,d?d.layoutBox:void 0)}updateScroll(d="measure"){let m=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===d&&(m=!1),m){const p=o(this.instance);this.scroll={animationId:this.root.animationId,phase:d,isRoot:p,offset:l(this.instance),wasRoot:this.scroll?this.scroll.isRoot:p}}}resetTransform(){if(!r)return;const d=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,m=this.projectionDelta&&!u1(this.projectionDelta),p=this.getTransformTemplate(),g=p?p(this.latestValues,""):void 0,v=g!==this.prevTransformTemplateValue;d&&(m||Hs(this.latestValues)||v)&&(r(this.instance,g),this.shouldResetTransform=!1,this.scheduleRender())}measure(d=!0){const m=this.measurePageBox();let p=this.removeElementScroll(m);return d&&(p=this.removeTransform(p)),Aj(p),{animationId:this.root.animationId,measuredBox:m,layoutBox:p,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:m}=this.options;if(!m)return Bt();const p=m.measureViewportBox();if(!(((d=this.scroll)===null||d===void 0?void 0:d.wasRoot)||this.path.some(jj))){const{scroll:v}=this.root;v&&(Ii(p.x,v.offset.x),Ii(p.y,v.offset.y))}return p}removeElementScroll(d){var m;const p=Bt();if(Pn(p,d),!((m=this.scroll)===null||m===void 0)&&m.wasRoot)return p;for(let g=0;g<this.path.length;g++){const v=this.path[g],{scroll:b,options:x}=v;v!==this.root&&b&&x.layoutScroll&&(b.wasRoot&&Pn(p,d),Ii(p.x,b.offset.x),Ii(p.y,b.offset.y))}return p}applyTransform(d,m=!1){const p=Bt();Pn(p,d);for(let g=0;g<this.path.length;g++){const v=this.path[g];!m&&v.options.layoutScroll&&v.scroll&&v!==v.root&&Hi(p,{x:-v.scroll.offset.x,y:-v.scroll.offset.y}),Hs(v.latestValues)&&Hi(p,v.latestValues)}return Hs(this.latestValues)&&Hi(p,this.latestValues),p}removeTransform(d){const m=Bt();Pn(m,d);for(let p=0;p<this.path.length;p++){const g=this.path[p];if(!g.instance||!Hs(g.latestValues))continue;bf(g.latestValues)&&g.updateSnapshot();const v=Bt(),b=g.measurePageBox();Pn(v,b),Ny(m,g.latestValues,g.snapshot?g.snapshot.layoutBox:void 0,v)}return Hs(this.latestValues)&&Ny(m,this.latestValues),m}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!==tn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(d=!1){var m;const p=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=p.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=p.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=p.isSharedProjectionDirty);const g=!!this.resumingFrom||this!==p;if(!(d||g&&this.isSharedProjectionDirty||this.isProjectionDirty||!((m=this.parent)===null||m===void 0)&&m.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:b,layoutId:x}=this.options;if(!(!this.layout||!(b||x))){if(this.resolvedRelativeTargetAt=tn.timestamp,!this.targetDelta&&!this.relativeTarget){const T=this.getClosestProjectingParent();T&&T.layout&&this.animationProgress!==1?(this.relativeParent=T,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Bt(),this.relativeTargetOrigin=Bt(),so(this.relativeTargetOrigin,this.layout.layoutBox,T.layout.layoutBox),Pn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Bt(),this.targetWithTransforms=Bt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),DA(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Pn(this.target,this.layout.layoutBox),s1(this.target,this.targetDelta)):Pn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const T=this.getClosestProjectingParent();T&&!!T.resumingFrom==!!this.resumingFrom&&!T.options.layoutScroll&&T.target&&this.animationProgress!==1?(this.relativeParent=T,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Bt(),this.relativeTargetOrigin=Bt(),so(this.relativeTargetOrigin,this.target,T.target),Pn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Ql&&qs.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||bf(this.parent.latestValues)||a1(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 m=this.getLead(),p=!!this.resumingFrom||this!==m;let g=!0;if((this.isProjectionDirty||!((d=this.parent)===null||d===void 0)&&d.isProjectionDirty)&&(g=!1),p&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(g=!1),this.resolvedRelativeTargetAt===tn.timestamp&&(g=!1),g)return;const{layout:v,layoutId:b}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(v||b))return;Pn(this.layoutCorrected,this.layout.layoutBox);const x=this.treeScale.x,T=this.treeScale.y;VA(this.layoutCorrected,this.treeScale,this.path,p),m.layout&&!m.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(m.target=m.layout.layoutBox,m.targetWithTransforms=Bt());const{target:A}=m;if(!A){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Cy(this.prevProjectionDelta.x,this.projectionDelta.x),Cy(this.prevProjectionDelta.y,this.projectionDelta.y)),ao(this.projectionDelta,this.layoutCorrected,A,this.latestValues),(this.treeScale.x!==x||this.treeScale.y!==T||!My(this.projectionDelta.x,this.prevProjectionDelta.x)||!My(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",A)),Ql&&qs.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(d=!0){var m;if((m=this.options.visualElement)===null||m===void 0||m.scheduleRender(),d){const p=this.getStack();p&&p.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Vi(),this.projectionDelta=Vi(),this.projectionDeltaWithTransform=Vi()}setAnimationOrigin(d,m=!1){const p=this.snapshot,g=p?p.latestValues:{},v={...this.latestValues},b=Vi();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!m;const x=Bt(),T=p?p.source:void 0,A=this.layout?this.layout.source:void 0,j=T!==A,N=this.getStack(),C=!N||N.members.length<=1,B=!!(j&&!C&&this.options.crossfade===!0&&!this.path.some(Ej));this.animationProgress=0;let R;this.mixTargetDelta=X=>{const H=X/1e3;zy(b.x,d.x,H),zy(b.y,d.y,H),this.setTargetDelta(b),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(so(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Tj(this.relativeTarget,this.relativeTargetOrigin,x,H),R&&oj(this.relativeTarget,R)&&(this.isProjectionDirty=!1),R||(R=Bt()),Pn(R,this.relativeTarget)),j&&(this.animationValues=v,tj(v,g,this.latestValues,H,B,C)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=H},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&&(ps(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ft.update(()=>{Xr.hasAnimatedSinceResize=!0,this.currentAnimation=ZA(0,Oy,{...d,onUpdate:m=>{this.mixTargetDelta(m),d.onUpdate&&d.onUpdate(m)},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(Oy),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const d=this.getLead();let{targetWithTransforms:m,target:p,layout:g,latestValues:v}=d;if(!(!m||!p||!g)){if(this!==d&&this.layout&&g&&m1(this.options.animationType,this.layout.layoutBox,g.layoutBox)){p=this.target||Bt();const b=kn(this.layout.layoutBox.x);p.x.min=d.target.x.min,p.x.max=p.x.min+b;const x=kn(this.layout.layoutBox.y);p.y.min=d.target.y.min,p.y.max=p.y.min+x}Pn(m,p),Hi(m,v),ao(this.projectionDeltaWithTransform,this.layoutCorrected,m,v)}}registerSharedNode(d,m){this.sharedNodes.has(d)||this.sharedNodes.set(d,new rj),this.sharedNodes.get(d).add(m);const g=m.options.initialPromotionConfig;m.promote({transition:g?g.transition:void 0,preserveFollowOpacity:g&&g.shouldPreserveFollowOpacity?g.shouldPreserveFollowOpacity(m):void 0})}isLead(){const d=this.getStack();return d?d.lead===this:!0}getLead(){var d;const{layoutId:m}=this.options;return m?((d=this.getStack())===null||d===void 0?void 0:d.lead)||this:this}getPrevLead(){var d;const{layoutId:m}=this.options;return m?(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:m,preserveFollowOpacity:p}={}){const g=this.getStack();g&&g.promote(this,p),d&&(this.projectionDelta=void 0,this.needsReset=!0),m&&this.setOptions({transition:m})}relegate(){const d=this.getStack();return d?d.relegate(this):!1}resetSkewAndRotation(){const{visualElement:d}=this.options;if(!d)return;let m=!1;const{latestValues:p}=d;if((p.z||p.rotate||p.rotateX||p.rotateY||p.rotateZ||p.skewX||p.skewY)&&(m=!0),!m)return;const g={};p.z&&Fd("z",d,g,this.animationValues);for(let v=0;v<Pd.length;v++)Fd(`rotate${Pd[v]}`,d,g,this.animationValues),Fd(`skew${Pd[v]}`,d,g,this.animationValues);d.render();for(const v in g)d.setStaticValue(v,g[v]),this.animationValues&&(this.animationValues[v]=g[v]);d.scheduleRender()}getProjectionStyles(d){var m,p;if(!this.instance||this.isSVG)return;if(!this.isVisible)return uj;const g={visibility:""},v=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,g.opacity="",g.pointerEvents=Kr(d==null?void 0:d.pointerEvents)||"",g.transform=v?v(this.latestValues,""):"none",g;const b=this.getLead();if(!this.projectionDelta||!this.layout||!b.target){const j={};return this.options.layoutId&&(j.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,j.pointerEvents=Kr(d==null?void 0:d.pointerEvents)||""),this.hasProjected&&!Hs(this.latestValues)&&(j.transform=v?v({},""):"none",this.hasProjected=!1),j}const x=b.animationValues||b.latestValues;this.applyTransformsToTarget(),g.transform=cj(this.projectionDeltaWithTransform,this.treeScale,x),v&&(g.transform=v(x,g.transform));const{x:T,y:A}=this.projectionDelta;g.transformOrigin=`${T.origin*100}% ${A.origin*100}% 0`,b.animationValues?g.opacity=b===this?(p=(m=x.opacity)!==null&&m!==void 0?m:this.latestValues.opacity)!==null&&p!==void 0?p:1:this.preserveOpacity?this.latestValues.opacity:x.opacityExit:g.opacity=b===this?x.opacity!==void 0?x.opacity:"":x.opacityExit!==void 0?x.opacityExit:0;for(const j in Wr){if(x[j]===void 0)continue;const{correct:N,applyTo:C}=Wr[j],B=g.transform==="none"?x[j]:N(x[j],b);if(C){const R=C.length;for(let X=0;X<R;X++)g[C[X]]=B}else g[j]=B}return this.options.layoutId&&(g.pointerEvents=b===this?Kr(d==null?void 0:d.pointerEvents)||"":"none"),g}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(d=>{var m;return(m=d.currentAnimation)===null||m===void 0?void 0:m.stop()}),this.root.nodes.forEach(By),this.root.sharedNodes.clear()}}}function fj(n){n.updateLayout()}function hj(n){var a;const l=((a=n.resumeFrom)===null||a===void 0?void 0:a.snapshot)||n.snapshot;if(n.isLead()&&n.layout&&l&&n.hasListeners("didUpdate")){const{layoutBox:o,measuredBox:r}=n.layout,{animationType:u}=n.options,d=l.source!==n.layout.source;u==="size"?Fn(b=>{const x=d?l.measuredBox[b]:l.layoutBox[b],T=kn(x);x.min=o[b].min,x.max=x.min+T}):m1(u,l.layoutBox,o)&&Fn(b=>{const x=d?l.measuredBox[b]:l.layoutBox[b],T=kn(o[b]);x.max=x.min+T,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[b].max=n.relativeTarget[b].min+T)});const m=Vi();ao(m,o,l.layoutBox);const p=Vi();d?ao(p,n.applyTransform(r,!0),l.measuredBox):ao(p,o,l.layoutBox);const g=!u1(m);let v=!1;if(!n.resumeFrom){const b=n.getClosestProjectingParent();if(b&&!b.resumeFrom){const{snapshot:x,layout:T}=b;if(x&&T){const A=Bt();so(A,l.layoutBox,x.layoutBox);const j=Bt();so(j,o,T.layoutBox),d1(A,j)||(v=!0),b.options.layoutRoot&&(n.relativeTarget=j,n.relativeTargetOrigin=A,n.relativeParent=b)}}}n.notifyListeners("didUpdate",{layout:o,snapshot:l,delta:p,layoutDelta:m,hasLayoutChanged:g,hasRelativeTargetChanged:v})}else if(n.isLead()){const{onExitComplete:o}=n.options;o&&o()}n.options.transition=void 0}function mj(n){Ql&&qs.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 pj(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function gj(n){n.clearSnapshot()}function By(n){n.clearMeasurements()}function vj(n){n.isLayoutDirty=!1}function yj(n){const{visualElement:a}=n.options;a&&a.getProps().onBeforeLayoutMeasure&&a.notify("BeforeLayoutMeasure"),n.resetTransform()}function Ly(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function bj(n){n.resolveTargetDelta()}function Sj(n){n.calcProjection()}function _j(n){n.resetSkewAndRotation()}function xj(n){n.removeLeadSnapshot()}function zy(n,a,l){n.translate=_t(a.translate,0,l),n.scale=_t(a.scale,1,l),n.origin=a.origin,n.originPoint=a.originPoint}function Uy(n,a,l,o){n.min=_t(a.min,l.min,o),n.max=_t(a.max,l.max,o)}function Tj(n,a,l,o){Uy(n.x,a.x,l.x,o),Uy(n.y,a.y,l.y,o)}function Ej(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const Cj={duration:.45,ease:[.4,0,.1,1]},Vy=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),Iy=Vy("applewebkit/")&&!Vy("chrome/")?Math.round:Dn;function Hy(n){n.min=Iy(n.min),n.max=Iy(n.max)}function Aj(n){Hy(n.x),Hy(n.y)}function m1(n,a,l){return n==="position"||n==="preserve-aspect"&&!wA(Ry(a),Ry(l),.2)}function jj(n){var a;return n!==n.root&&((a=n.scroll)===null||a===void 0?void 0:a.wasRoot)}const Nj=h1({attachResizeListener:(n,a)=>ho(n,"resize",a),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),$d={current:void 0},p1=h1({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!$d.current){const n=new Nj({});n.mount(window),n.setOptions({layoutScroll:!0}),$d.current=n}return $d.current},resetTransform:(n,a)=>{n.style.transform=a!==void 0?a:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),wj={pan:{Feature:FA},drag:{Feature:PA,ProjectionNode:p1,MeasureLayout:o1}};function Dj(n,a,l){var o;if(n instanceof Element)return[n];if(typeof n=="string"){let r=document;const u=(o=void 0)!==null&&o!==void 0?o:r.querySelectorAll(n);return u?Array.from(u):[]}return Array.from(n)}function g1(n,a){const l=Dj(n),o=new AbortController,r={passive:!0,...a,signal:o.signal};return[l,r,()=>o.abort()]}function qy(n){return a=>{a.pointerType==="touch"||Qb()||n(a)}}function kj(n,a,l={}){const[o,r,u]=g1(n,l),d=qy(m=>{const{target:p}=m,g=a(m);if(typeof g!="function"||!p)return;const v=qy(b=>{g(b),p.removeEventListener("pointerleave",v)});p.addEventListener("pointerleave",v,r)});return o.forEach(m=>{m.addEventListener("pointerenter",d,r)}),u}function Gy(n,a,l){const{props:o}=n;n.animationState&&o.whileHover&&n.animationState.setActive("whileHover",l==="Start");const r="onHover"+l,u=o[r];u&&ft.postRender(()=>u(a,So(a)))}class Rj extends bs{mount(){const{current:a}=this.node;a&&(this.unmount=kj(a,l=>(Gy(this.node,l,"Start"),o=>Gy(this.node,o,"End"))))}unmount(){}}class Mj extends bs{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=bo(ho(this.node.current,"focus",()=>this.onFocus()),ho(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const v1=(n,a)=>a?n===a?!0:v1(n,a.parentElement):!1,Oj=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Bj(n){return Oj.has(n.tagName)||n.tabIndex!==-1}const Jl=new WeakSet;function Py(n){return a=>{a.key==="Enter"&&n(a)}}function Yd(n,a){n.dispatchEvent(new PointerEvent("pointer"+a,{isPrimary:!0,bubbles:!0}))}const Lj=(n,a)=>{const l=n.currentTarget;if(!l)return;const o=Py(()=>{if(Jl.has(l))return;Yd(l,"down");const r=Py(()=>{Yd(l,"up")}),u=()=>Yd(l,"cancel");l.addEventListener("keyup",r,a),l.addEventListener("blur",u,a)});l.addEventListener("keydown",o,a),l.addEventListener("blur",()=>l.removeEventListener("keydown",o),a)};function Fy(n){return _h(n)&&!Qb()}function zj(n,a,l={}){const[o,r,u]=g1(n,l),d=m=>{const p=m.currentTarget;if(!Fy(m)||Jl.has(p))return;Jl.add(p);const g=a(m),v=(T,A)=>{window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",x),!(!Fy(T)||!Jl.has(p))&&(Jl.delete(p),typeof g=="function"&&g(T,{success:A}))},b=T=>{v(T,l.useGlobalTarget||v1(p,T.target))},x=T=>{v(T,!1)};window.addEventListener("pointerup",b,r),window.addEventListener("pointercancel",x,r)};return o.forEach(m=>{!Bj(m)&&m.getAttribute("tabindex")===null&&(m.tabIndex=0),(l.useGlobalTarget?window:m).addEventListener("pointerdown",d,r),m.addEventListener("focus",g=>Lj(g,r),r)}),u}function $y(n,a,l){const{props:o}=n;n.animationState&&o.whileTap&&n.animationState.setActive("whileTap",l==="Start");const r="onTap"+(l==="End"?"":l),u=o[r];u&&ft.postRender(()=>u(a,So(a)))}class Uj extends bs{mount(){const{current:a}=this.node;a&&(this.unmount=zj(a,l=>($y(this.node,l,"Start"),(o,{success:r})=>$y(this.node,o,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const _f=new WeakMap,Kd=new WeakMap,Vj=n=>{const a=_f.get(n.target);a&&a(n)},Ij=n=>{n.forEach(Vj)};function Hj({root:n,...a}){const l=n||document;Kd.has(l)||Kd.set(l,{});const o=Kd.get(l),r=JSON.stringify(a);return o[r]||(o[r]=new IntersectionObserver(Ij,{root:n,...a})),o[r]}function qj(n,a,l){const o=Hj(a);return _f.set(n,l),o.observe(n),()=>{_f.delete(n),o.unobserve(n)}}const Gj={some:0,all:1};class Pj extends bs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:a={}}=this.node.getProps(),{root:l,margin:o,amount:r="some",once:u}=a,d={root:l?l.current:void 0,rootMargin:o,threshold:typeof r=="number"?r:Gj[r]},m=p=>{const{isIntersecting:g}=p;if(this.isInView===g||(this.isInView=g,u&&!g&&this.hasEnteredView))return;g&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",g);const{onViewportEnter:v,onViewportLeave:b}=this.node.getProps(),x=g?v:b;x&&x(p)};return qj(this.node.current,d,m)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:a,prevProps:l}=this.node;["amount","margin","root"].some(Fj(a,l))&&this.startObserver()}unmount(){}}function Fj({viewport:n={}},{viewport:a={}}={}){return l=>n[l]!==a[l]}const $j={inView:{Feature:Pj},tap:{Feature:Uj},focus:{Feature:Mj},hover:{Feature:Rj}},Yj={layout:{ProjectionNode:p1,MeasureLayout:o1}},xf={current:null},y1={current:!1};function Kj(){if(y1.current=!0,!!Ff)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),a=()=>xf.current=n.matches;n.addListener(a),a()}else xf.current=!1}const Zj=[...Vb,ln,gs],Xj=n=>Zj.find(Ub(n)),Yy=new WeakMap;function Qj(n,a,l){for(const o in a){const r=a[o],u=l[o];if(on(r))n.addValue(o,r);else if(on(u))n.addValue(o,uo(r,{owner:n}));else if(u!==r)if(n.hasValue(o)){const d=n.getValue(o);d.liveStyle===!0?d.jump(r):d.hasAnimated||d.set(r)}else{const d=n.getStaticValue(o);n.addValue(o,uo(d!==void 0?d:r,{owner:n}))}}for(const o in l)a[o]===void 0&&n.removeValue(o);return a}const Ky=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Jj{scrapeMotionValuesFromProps(a,l,o){return{}}constructor({parent:a,props:l,presenceContext:o,reducedMotionConfig:r,blockInitialAnimation:u,visualState:d},m={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=vh,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 T=ha.now();this.renderScheduledAt<T&&(this.renderScheduledAt=T,ft.render(this.render,!1,!0))};const{latestValues:p,renderState:g,onUpdate:v}=d;this.onUpdate=v,this.latestValues=p,this.baseTarget={...p},this.initialValues=l.initial?{...p}:{},this.renderState=g,this.parent=a,this.props=l,this.presenceContext=o,this.depth=a?a.depth+1:0,this.reducedMotionConfig=r,this.options=m,this.blockInitialAnimation=!!u,this.isControllingVariants=vc(l),this.isVariantNode=Q0(l),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(a&&a.current);const{willChange:b,...x}=this.scrapeMotionValuesFromProps(l,{},this);for(const T in x){const A=x[T];p[T]!==void 0&&on(A)&&A.set(p[T],!1)}}mount(a){this.current=a,Yy.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((l,o)=>this.bindToMotionValue(o,l)),y1.current||Kj(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:xf.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Yy.delete(this.current),this.projection&&this.projection.unmount(),ps(this.notifyUpdate),ps(this.render),this.valueSubscriptions.forEach(a=>a()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const a in this.events)this.events[a].clear();for(const a in this.features){const l=this.features[a];l&&(l.unmount(),l.isMounted=!1)}this.current=null}bindToMotionValue(a,l){this.valueSubscriptions.has(a)&&this.valueSubscriptions.get(a)();const o=Zs.has(a),r=l.on("change",m=>{this.latestValues[a]=m,this.props.onUpdate&&ft.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0)}),u=l.on("renderRequest",this.scheduleRender);let d;window.MotionCheckAppearSync&&(d=window.MotionCheckAppearSync(this,a,l)),this.valueSubscriptions.set(a,()=>{r(),u(),d&&d(),l.owner&&l.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 Gi){const l=Gi[a];if(!l)continue;const{isEnabled:o,Feature:r}=l;if(!this.features[a]&&r&&o(this.props)&&(this.features[a]=new r(this)),this.features[a]){const u=this.features[a];u.isMounted?u.update():(u.mount(),u.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Bt()}getStaticValue(a){return this.latestValues[a]}setStaticValue(a,l){this.latestValues[a]=l}update(a,l){(a.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=a,this.prevPresenceContext=this.presenceContext,this.presenceContext=l;for(let o=0;o<Ky.length;o++){const r=Ky[o];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const u="on"+r,d=a[u];d&&(this.propEventSubscriptions[r]=this.on(r,d))}this.prevMotionValues=Qj(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 l=this.getClosestVariantNode();if(l)return l.variantChildren&&l.variantChildren.add(a),()=>l.variantChildren.delete(a)}addValue(a,l){const o=this.values.get(a);l!==o&&(o&&this.removeValue(a),this.bindToMotionValue(a,l),this.values.set(a,l),this.latestValues[a]=l.get())}removeValue(a){this.values.delete(a);const l=this.valueSubscriptions.get(a);l&&(l(),this.valueSubscriptions.delete(a)),delete this.latestValues[a],this.removeValueFromRenderState(a,this.renderState)}hasValue(a){return this.values.has(a)}getValue(a,l){if(this.props.values&&this.props.values[a])return this.props.values[a];let o=this.values.get(a);return o===void 0&&l!==void 0&&(o=uo(l===null?void 0:l,{owner:this}),this.addValue(a,o)),o}readValue(a,l){var o;let r=this.latestValues[a]!==void 0||!this.current?this.latestValues[a]:(o=this.getBaseTargetFromProps(this.props,a))!==null&&o!==void 0?o:this.readValueFromInstance(this.current,a,this.options);return r!=null&&(typeof r=="string"&&(Lb(r)||jb(r))?r=parseFloat(r):!Xj(r)&&gs.test(l)&&(r=Mb(a,l)),this.setBaseTarget(a,on(r)?r.get():r)),on(r)?r.get():r}setBaseTarget(a,l){this.baseTarget[a]=l}getBaseTarget(a){var l;const{initial:o}=this.props;let r;if(typeof o=="string"||typeof o=="object"){const d=Qf(this.props,o,(l=this.presenceContext)===null||l===void 0?void 0:l.custom);d&&(r=d[a])}if(o&&r!==void 0)return r;const u=this.getBaseTargetFromProps(this.props,a);return u!==void 0&&!on(u)?u:this.initialValues[a]!==void 0&&r===void 0?void 0:this.baseTarget[a]}on(a,l){return this.events[a]||(this.events[a]=new rh),this.events[a].add(l)}notify(a,...l){this.events[a]&&this.events[a].notify(...l)}}class b1 extends Jj{constructor(){super(...arguments),this.KeyframeResolver=Ib}sortInstanceNodePosition(a,l){return a.compareDocumentPosition(l)&2?1:-1}getBaseTargetFromProps(a,l){return a.style?a.style[l]:void 0}removeValueFromRenderState(a,{vars:l,style:o}){delete l[a],delete o[a]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:a}=this.props;on(a)&&(this.childSubscription=a.on("change",l=>{this.current&&(this.current.textContent=`${l}`)}))}}function Wj(n){return window.getComputedStyle(n)}class eN extends b1{constructor(){super(...arguments),this.type="html",this.renderInstance=lb}readValueFromInstance(a,l){if(Zs.has(l)){const o=gh(l);return o&&o.default||0}else{const o=Wj(a),r=(ab(l)?o.getPropertyValue(l):o[l])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(a,{transformPagePoint:l}){return i1(a,l)}build(a,l,o){eh(a,l,o.transformTemplate)}scrapeMotionValuesFromProps(a,l,o){return sh(a,l,o)}}class tN extends b1{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Bt}getBaseTargetFromProps(a,l){return a[l]}readValueFromInstance(a,l){if(Zs.has(l)){const o=gh(l);return o&&o.default||0}return l=ob.has(l)?l:Kf(l),a.getAttribute(l)}scrapeMotionValuesFromProps(a,l,o){return ub(a,l,o)}build(a,l,o){th(a,l,this.isSVGTag,o.transformTemplate)}renderInstance(a,l,o,r){rb(a,l,o,r)}mount(a){this.isSVGTag=ah(a.tagName),super.mount(a)}}const nN=(n,a)=>Xf(n)?new tN(a):new eN(a,{allowProjection:n!==S.Fragment}),aN=N2({...bA,...$j,...wj,...Yj},nN),$n=GE(aN);var wt;(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"})(wt||(wt={}));var qt;(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"})(qt||(qt={}));var ds;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.ACTIVE=1]="ACTIVE",n[n.ARCHIVED=2]="ARCHIVED"})(ds||(ds={}));var fs;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.OPEN=1]="OPEN",n[n.CLOSED=2]="CLOSED"})(fs||(fs={}));var ca;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.OFF=1]="OFF",n[n.SUBSCRIPTION=2]="SUBSCRIPTION",n[n.API_KEY=3]="API_KEY"})(ca||(ca={}));var hs;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.OFF=1]="OFF",n[n.ON=2]="ON"})(hs||(hs={}));const sN=8;Object.assign(Object.create(null),{"":wt.UNSPECIFIED,text:wt.TEXT,tool_use:wt.TOOL_USE,tool_result:wt.TOOL_RESULT,error:wt.ERROR,status:wt.STATUS,system:wt.SYSTEM,finding:wt.FINDING,subtask_create:wt.SUBTASK_CREATE,user_input:wt.USER_INPUT});wt.UNSPECIFIED+"",wt.TEXT+"",wt.TOOL_USE+"",wt.TOOL_RESULT+"",wt.ERROR+"",wt.STATUS+"",wt.SYSTEM+"",wt.FINDING+"",wt.SUBTASK_CREATE+"",wt.USER_INPUT+"";Object.assign(Object.create(null),{"":qt.UNSPECIFIED,not_started:qt.NOT_STARTED,working:qt.WORKING,paused:qt.PAUSED,complete:qt.COMPLETE,failed:qt.FAILED,pending:qt.NOT_STARTED,assigned:qt.NOT_STARTED,in_progress:qt.WORKING,waiting_input:qt.PAUSED,review:qt.PAUSED,done:qt.COMPLETE});qt.UNSPECIFIED+"",qt.NOT_STARTED+"",qt.WORKING+"",qt.PAUSED+"",qt.COMPLETE+"",qt.FAILED+"";Object.assign(Object.create(null),{"":ds.UNSPECIFIED,active:ds.ACTIVE,archived:ds.ARCHIVED});ds.UNSPECIFIED+"",ds.ACTIVE+"",ds.ARCHIVED+"";Object.assign(Object.create(null),{"":fs.UNSPECIFIED,open:fs.OPEN,closed:fs.CLOSED});fs.UNSPECIFIED+"",fs.OPEN+"",fs.CLOSED+"";Object.assign(Object.create(null),{"":ca.UNSPECIFIED,off:ca.OFF,subscription:ca.SUBSCRIPTION,api_key:ca.API_KEY});ca.UNSPECIFIED+"",ca.OFF+"",ca.SUBSCRIPTION+"",ca.API_KEY+"";Object.assign(Object.create(null),{"":hs.UNSPECIFIED,off:hs.OFF,on:hs.ON});hs.UNSPECIFIED+"",hs.OFF+"",hs.ON+"";function Va(n){return Array.isArray?Array.isArray(n):x1(n)==="[object Array]"}function iN(n){if(typeof n=="string")return n;let a=n+"";return a=="0"&&1/n==-1/0?"-0":a}function lN(n){return n==null?"":iN(n)}function ua(n){return typeof n=="string"}function S1(n){return typeof n=="number"}function oN(n){return n===!0||n===!1||rN(n)&&x1(n)=="[object Boolean]"}function _1(n){return typeof n=="object"}function rN(n){return _1(n)&&n!==null}function wn(n){return n!=null}function Zd(n){return!n.trim().length}function x1(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}const cN="Incorrect 'index' type",uN=n=>`Invalid value for key ${n}`,dN=n=>`Pattern length exceeds max of ${n}.`,fN=n=>`Missing ${n} property in key`,hN=n=>`Property 'weight' in key '${n}' must be a positive integer`,Zy=Object.prototype.hasOwnProperty;class mN{constructor(a){this._keys=[],this._keyMap={};let l=0;a.forEach(o=>{let r=T1(o);this._keys.push(r),this._keyMap[r.id]=r,l+=r.weight}),this._keys.forEach(o=>{o.weight/=l})}get(a){return this._keyMap[a]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function T1(n){let a=null,l=null,o=null,r=1,u=null;if(ua(n)||Va(n))o=n,a=Xy(n),l=Tf(n);else{if(!Zy.call(n,"name"))throw new Error(fN("name"));const d=n.name;if(o=d,Zy.call(n,"weight")&&(r=n.weight,r<=0))throw new Error(hN(d));a=Xy(d),l=Tf(d),u=n.getFn}return{path:a,id:l,weight:r,src:o,getFn:u}}function Xy(n){return Va(n)?n:n.split(".")}function Tf(n){return Va(n)?n.join("."):n}function pN(n,a){let l=[],o=!1;const r=(u,d,m)=>{if(wn(u))if(!d[m])l.push(u);else{let p=d[m];const g=u[p];if(!wn(g))return;if(m===d.length-1&&(ua(g)||S1(g)||oN(g)))l.push(lN(g));else if(Va(g)){o=!0;for(let v=0,b=g.length;v<b;v+=1)r(g[v],d,m+1)}else d.length&&r(g,d,m+1)}};return r(n,ua(a)?a.split("."):a,0),o?l:l[0]}const gN={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},vN={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},yN={location:0,threshold:.6,distance:100},bN={useExtendedSearch:!1,getFn:pN,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var Ae={...vN,...gN,...yN,...bN};const SN=/[^ ]+/g;function _N(n=1,a=3){const l=new Map,o=Math.pow(10,a);return{get(r){const u=r.match(SN).length;if(l.has(u))return l.get(u);const d=1/Math.pow(u,.5*n),m=parseFloat(Math.round(d*o)/o);return l.set(u,m),m},clear(){l.clear()}}}class xh{constructor({getFn:a=Ae.getFn,fieldNormWeight:l=Ae.fieldNormWeight}={}){this.norm=_N(l,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((l,o)=>{this._keysMap[l.id]=o})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,ua(this.docs[0])?this.docs.forEach((a,l)=>{this._addString(a,l)}):this.docs.forEach((a,l)=>{this._addObject(a,l)}),this.norm.clear())}add(a){const l=this.size();ua(a)?this._addString(a,l):this._addObject(a,l)}removeAt(a){this.records.splice(a,1);for(let l=a,o=this.size();l<o;l+=1)this.records[l].i-=1}getValueForItemAtKeyId(a,l){return a[this._keysMap[l]]}size(){return this.records.length}_addString(a,l){if(!wn(a)||Zd(a))return;let o={v:a,i:l,n:this.norm.get(a)};this.records.push(o)}_addObject(a,l){let o={i:l,$:{}};this.keys.forEach((r,u)=>{let d=r.getFn?r.getFn(a):this.getFn(a,r.path);if(wn(d)){if(Va(d)){let m=[];const p=[{nestedArrIndex:-1,value:d}];for(;p.length;){const{nestedArrIndex:g,value:v}=p.pop();if(wn(v))if(ua(v)&&!Zd(v)){let b={v,i:g,n:this.norm.get(v)};m.push(b)}else Va(v)&&v.forEach((b,x)=>{p.push({nestedArrIndex:x,value:b})})}o.$[u]=m}else if(ua(d)&&!Zd(d)){let m={v:d,n:this.norm.get(d)};o.$[u]=m}}}),this.records.push(o)}toJSON(){return{keys:this.keys,records:this.records}}}function E1(n,a,{getFn:l=Ae.getFn,fieldNormWeight:o=Ae.fieldNormWeight}={}){const r=new xh({getFn:l,fieldNormWeight:o});return r.setKeys(n.map(T1)),r.setSources(a),r.create(),r}function xN(n,{getFn:a=Ae.getFn,fieldNormWeight:l=Ae.fieldNormWeight}={}){const{keys:o,records:r}=n,u=new xh({getFn:a,fieldNormWeight:l});return u.setKeys(o),u.setIndexRecords(r),u}function Hr(n,{errors:a=0,currentLocation:l=0,expectedLocation:o=0,distance:r=Ae.distance,ignoreLocation:u=Ae.ignoreLocation}={}){const d=a/n.length;if(u)return d;const m=Math.abs(o-l);return r?d+m/r:m?1:d}function TN(n=[],a=Ae.minMatchCharLength){let l=[],o=-1,r=-1,u=0;for(let d=n.length;u<d;u+=1){let m=n[u];m&&o===-1?o=u:!m&&o!==-1&&(r=u-1,r-o+1>=a&&l.push([o,r]),o=-1)}return n[u-1]&&u-o>=a&&l.push([o,u-1]),l}const Gs=32;function EN(n,a,l,{location:o=Ae.location,distance:r=Ae.distance,threshold:u=Ae.threshold,findAllMatches:d=Ae.findAllMatches,minMatchCharLength:m=Ae.minMatchCharLength,includeMatches:p=Ae.includeMatches,ignoreLocation:g=Ae.ignoreLocation}={}){if(a.length>Gs)throw new Error(dN(Gs));const v=a.length,b=n.length,x=Math.max(0,Math.min(o,b));let T=u,A=x;const j=m>1||p,N=j?Array(b):[];let C;for(;(C=n.indexOf(a,A))>-1;){let W=Hr(a,{currentLocation:C,expectedLocation:x,distance:r,ignoreLocation:g});if(T=Math.min(W,T),A=C+v,j){let F=0;for(;F<v;)N[C+F]=1,F+=1}}A=-1;let B=[],R=1,X=v+b;const H=1<<v-1;for(let W=0;W<v;W+=1){let F=0,ne=X;for(;F<ne;)Hr(a,{errors:W,currentLocation:x+ne,expectedLocation:x,distance:r,ignoreLocation:g})<=T?F=ne:X=ne,ne=Math.floor((X-F)/2+F);X=ne;let ge=Math.max(1,x-ne+1),U=d?b:Math.min(x+ne,b)+v,pe=Array(U+2);pe[U+1]=(1<<W)-1;for(let ye=U;ye>=ge;ye-=1){let q=ye-1,z=l[n.charAt(q)];if(j&&(N[q]=+!!z),pe[ye]=(pe[ye+1]<<1|1)&z,W&&(pe[ye]|=(B[ye+1]|B[ye])<<1|1|B[ye+1]),pe[ye]&H&&(R=Hr(a,{errors:W,currentLocation:q,expectedLocation:x,distance:r,ignoreLocation:g}),R<=T)){if(T=R,A=q,A<=x)break;ge=Math.max(1,2*x-A)}}if(Hr(a,{errors:W+1,currentLocation:x,expectedLocation:x,distance:r,ignoreLocation:g})>T)break;B=pe}const J={isMatch:A>=0,score:Math.max(.001,R)};if(j){const W=TN(N,m);W.length?p&&(J.indices=W):J.isMatch=!1}return J}function CN(n){let a={};for(let l=0,o=n.length;l<o;l+=1){const r=n.charAt(l);a[r]=(a[r]||0)|1<<o-l-1}return a}const ic=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 C1{constructor(a,{location:l=Ae.location,threshold:o=Ae.threshold,distance:r=Ae.distance,includeMatches:u=Ae.includeMatches,findAllMatches:d=Ae.findAllMatches,minMatchCharLength:m=Ae.minMatchCharLength,isCaseSensitive:p=Ae.isCaseSensitive,ignoreDiacritics:g=Ae.ignoreDiacritics,ignoreLocation:v=Ae.ignoreLocation}={}){if(this.options={location:l,threshold:o,distance:r,includeMatches:u,findAllMatches:d,minMatchCharLength:m,isCaseSensitive:p,ignoreDiacritics:g,ignoreLocation:v},a=p?a:a.toLowerCase(),a=g?ic(a):a,this.pattern=a,this.chunks=[],!this.pattern.length)return;const b=(T,A)=>{this.chunks.push({pattern:T,alphabet:CN(T),startIndex:A})},x=this.pattern.length;if(x>Gs){let T=0;const A=x%Gs,j=x-A;for(;T<j;)b(this.pattern.substr(T,Gs),T),T+=Gs;if(A){const N=x-Gs;b(this.pattern.substr(N),N)}}else b(this.pattern,0)}searchIn(a){const{isCaseSensitive:l,ignoreDiacritics:o,includeMatches:r}=this.options;if(a=l?a:a.toLowerCase(),a=o?ic(a):a,this.pattern===a){let j={isMatch:!0,score:0};return r&&(j.indices=[[0,a.length-1]]),j}const{location:u,distance:d,threshold:m,findAllMatches:p,minMatchCharLength:g,ignoreLocation:v}=this.options;let b=[],x=0,T=!1;this.chunks.forEach(({pattern:j,alphabet:N,startIndex:C})=>{const{isMatch:B,score:R,indices:X}=EN(a,j,N,{location:u+C,distance:d,threshold:m,findAllMatches:p,minMatchCharLength:g,includeMatches:r,ignoreLocation:v});B&&(T=!0),x+=R,B&&X&&(b=[...b,...X])});let A={isMatch:T,score:T?x/this.chunks.length:1};return T&&r&&(A.indices=b),A}}class Ss{constructor(a){this.pattern=a}static isMultiMatch(a){return Qy(a,this.multiRegex)}static isSingleMatch(a){return Qy(a,this.singleRegex)}search(){}}function Qy(n,a){const l=n.match(a);return l?l[1]:null}class AN extends Ss{constructor(a){super(a)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(a){const l=a===this.pattern;return{isMatch:l,score:l?0:1,indices:[0,this.pattern.length-1]}}}class jN extends Ss{constructor(a){super(a)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(a){const o=a.indexOf(this.pattern)===-1;return{isMatch:o,score:o?0:1,indices:[0,a.length-1]}}}class NN extends Ss{constructor(a){super(a)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(a){const l=a.startsWith(this.pattern);return{isMatch:l,score:l?0:1,indices:[0,this.pattern.length-1]}}}class wN extends Ss{constructor(a){super(a)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(a){const l=!a.startsWith(this.pattern);return{isMatch:l,score:l?0:1,indices:[0,a.length-1]}}}class DN extends Ss{constructor(a){super(a)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(a){const l=a.endsWith(this.pattern);return{isMatch:l,score:l?0:1,indices:[a.length-this.pattern.length,a.length-1]}}}class kN extends Ss{constructor(a){super(a)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(a){const l=!a.endsWith(this.pattern);return{isMatch:l,score:l?0:1,indices:[0,a.length-1]}}}class A1 extends Ss{constructor(a,{location:l=Ae.location,threshold:o=Ae.threshold,distance:r=Ae.distance,includeMatches:u=Ae.includeMatches,findAllMatches:d=Ae.findAllMatches,minMatchCharLength:m=Ae.minMatchCharLength,isCaseSensitive:p=Ae.isCaseSensitive,ignoreDiacritics:g=Ae.ignoreDiacritics,ignoreLocation:v=Ae.ignoreLocation}={}){super(a),this._bitapSearch=new C1(a,{location:l,threshold:o,distance:r,includeMatches:u,findAllMatches:d,minMatchCharLength:m,isCaseSensitive:p,ignoreDiacritics:g,ignoreLocation:v})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(a){return this._bitapSearch.searchIn(a)}}class j1 extends Ss{constructor(a){super(a)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(a){let l=0,o;const r=[],u=this.pattern.length;for(;(o=a.indexOf(this.pattern,l))>-1;)l=o+u,r.push([o,l-1]);const d=!!r.length;return{isMatch:d,score:d?0:1,indices:r}}}const Ef=[AN,j1,NN,wN,kN,DN,jN,A1],Jy=Ef.length,RN=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,MN="|";function ON(n,a={}){return n.split(MN).map(l=>{let o=l.trim().split(RN).filter(u=>u&&!!u.trim()),r=[];for(let u=0,d=o.length;u<d;u+=1){const m=o[u];let p=!1,g=-1;for(;!p&&++g<Jy;){const v=Ef[g];let b=v.isMultiMatch(m);b&&(r.push(new v(b,a)),p=!0)}if(!p)for(g=-1;++g<Jy;){const v=Ef[g];let b=v.isSingleMatch(m);if(b){r.push(new v(b,a));break}}}return r})}const BN=new Set([A1.type,j1.type]);class LN{constructor(a,{isCaseSensitive:l=Ae.isCaseSensitive,ignoreDiacritics:o=Ae.ignoreDiacritics,includeMatches:r=Ae.includeMatches,minMatchCharLength:u=Ae.minMatchCharLength,ignoreLocation:d=Ae.ignoreLocation,findAllMatches:m=Ae.findAllMatches,location:p=Ae.location,threshold:g=Ae.threshold,distance:v=Ae.distance}={}){this.query=null,this.options={isCaseSensitive:l,ignoreDiacritics:o,includeMatches:r,minMatchCharLength:u,findAllMatches:m,ignoreLocation:d,location:p,threshold:g,distance:v},a=l?a:a.toLowerCase(),a=o?ic(a):a,this.pattern=a,this.query=ON(this.pattern,this.options)}static condition(a,l){return l.useExtendedSearch}searchIn(a){const l=this.query;if(!l)return{isMatch:!1,score:1};const{includeMatches:o,isCaseSensitive:r,ignoreDiacritics:u}=this.options;a=r?a:a.toLowerCase(),a=u?ic(a):a;let d=0,m=[],p=0;for(let g=0,v=l.length;g<v;g+=1){const b=l[g];m.length=0,d=0;for(let x=0,T=b.length;x<T;x+=1){const A=b[x],{isMatch:j,indices:N,score:C}=A.search(a);if(j){if(d+=1,p+=C,o){const B=A.constructor.type;BN.has(B)?m=[...m,...N]:m.push(N)}}else{p=0,d=0,m.length=0;break}}if(d){let x={isMatch:!0,score:p/d};return o&&(x.indices=m),x}}return{isMatch:!1,score:1}}}const Cf=[];function zN(...n){Cf.push(...n)}function Af(n,a){for(let l=0,o=Cf.length;l<o;l+=1){let r=Cf[l];if(r.condition(n,a))return new r(n,a)}return new C1(n,a)}const lc={AND:"$and",OR:"$or"},jf={PATH:"$path",PATTERN:"$val"},Nf=n=>!!(n[lc.AND]||n[lc.OR]),UN=n=>!!n[jf.PATH],VN=n=>!Va(n)&&_1(n)&&!Nf(n),Wy=n=>({[lc.AND]:Object.keys(n).map(a=>({[a]:n[a]}))});function N1(n,a,{auto:l=!0}={}){const o=r=>{let u=Object.keys(r);const d=UN(r);if(!d&&u.length>1&&!Nf(r))return o(Wy(r));if(VN(r)){const p=d?r[jf.PATH]:u[0],g=d?r[jf.PATTERN]:r[p];if(!ua(g))throw new Error(uN(p));const v={keyId:Tf(p),pattern:g};return l&&(v.searcher=Af(g,a)),v}let m={children:[],operator:u[0]};return u.forEach(p=>{const g=r[p];Va(g)&&g.forEach(v=>{m.children.push(o(v))})}),m};return Nf(n)||(n=Wy(n)),o(n)}function IN(n,{ignoreFieldNorm:a=Ae.ignoreFieldNorm}){n.forEach(l=>{let o=1;l.matches.forEach(({key:r,norm:u,score:d})=>{const m=r?r.weight:null;o*=Math.pow(d===0&&m?Number.EPSILON:d,(m||1)*(a?1:u))}),l.score=o})}function HN(n,a){const l=n.matches;a.matches=[],wn(l)&&l.forEach(o=>{if(!wn(o.indices)||!o.indices.length)return;const{indices:r,value:u}=o;let d={indices:r,value:u};o.key&&(d.key=o.key.src),o.idx>-1&&(d.refIndex=o.idx),a.matches.push(d)})}function qN(n,a){a.score=n.score}function GN(n,a,{includeMatches:l=Ae.includeMatches,includeScore:o=Ae.includeScore}={}){const r=[];return l&&r.push(HN),o&&r.push(qN),n.map(u=>{const{idx:d}=u,m={item:a[d],refIndex:d};return r.length&&r.forEach(p=>{p(u,m)}),m})}class Xi{constructor(a,l={},o){this.options={...Ae,...l},this.options.useExtendedSearch,this._keyStore=new mN(this.options.keys),this.setCollection(a,o)}setCollection(a,l){if(this._docs=a,l&&!(l instanceof xh))throw new Error(cN);this._myIndex=l||E1(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(a){wn(a)&&(this._docs.push(a),this._myIndex.add(a))}remove(a=()=>!1){const l=[];for(let o=0,r=this._docs.length;o<r;o+=1){const u=this._docs[o];a(u,o)&&(this.removeAt(o),o-=1,r-=1,l.push(u))}return l}removeAt(a){this._docs.splice(a,1),this._myIndex.removeAt(a)}getIndex(){return this._myIndex}search(a,{limit:l=-1}={}){const{includeMatches:o,includeScore:r,shouldSort:u,sortFn:d,ignoreFieldNorm:m}=this.options;let p=ua(a)?ua(this._docs[0])?this._searchStringList(a):this._searchObjectList(a):this._searchLogical(a);return IN(p,{ignoreFieldNorm:m}),u&&p.sort(d),S1(l)&&l>-1&&(p=p.slice(0,l)),GN(p,this._docs,{includeMatches:o,includeScore:r})}_searchStringList(a){const l=Af(a,this.options),{records:o}=this._myIndex,r=[];return o.forEach(({v:u,i:d,n:m})=>{if(!wn(u))return;const{isMatch:p,score:g,indices:v}=l.searchIn(u);p&&r.push({item:u,idx:d,matches:[{score:g,value:u,norm:m,indices:v}]})}),r}_searchLogical(a){const l=N1(a,this.options),o=(m,p,g)=>{if(!m.children){const{keyId:b,searcher:x}=m,T=this._findMatches({key:this._keyStore.get(b),value:this._myIndex.getValueForItemAtKeyId(p,b),searcher:x});return T&&T.length?[{idx:g,item:p,matches:T}]:[]}const v=[];for(let b=0,x=m.children.length;b<x;b+=1){const T=m.children[b],A=o(T,p,g);if(A.length)v.push(...A);else if(m.operator===lc.AND)return[]}return v},r=this._myIndex.records,u={},d=[];return r.forEach(({$:m,i:p})=>{if(wn(m)){let g=o(l,m,p);g.length&&(u[p]||(u[p]={idx:p,item:m,matches:[]},d.push(u[p])),g.forEach(({matches:v})=>{u[p].matches.push(...v)}))}}),d}_searchObjectList(a){const l=Af(a,this.options),{keys:o,records:r}=this._myIndex,u=[];return r.forEach(({$:d,i:m})=>{if(!wn(d))return;let p=[];o.forEach((g,v)=>{p.push(...this._findMatches({key:g,value:d[v],searcher:l}))}),p.length&&u.push({idx:m,item:d,matches:p})}),u}_findMatches({key:a,value:l,searcher:o}){if(!wn(l))return[];let r=[];if(Va(l))l.forEach(({v:u,i:d,n:m})=>{if(!wn(u))return;const{isMatch:p,score:g,indices:v}=o.searchIn(u);p&&r.push({score:g,key:a,value:u,idx:d,norm:m,indices:v})});else{const{v:u,n:d}=l,{isMatch:m,score:p,indices:g}=o.searchIn(u);m&&r.push({score:p,key:a,value:u,norm:d,indices:g})}return r}}Xi.version="7.1.0";Xi.createIndex=E1;Xi.parseIndex=xN;Xi.config=Ae;Xi.parseQuery=N1;zN(LN);function e0(n,a,l,o){if(!a.trim())return[];const r=.3;return new Xi(n,{keys:l,threshold:r,ignoreLocation:!0,includeScore:!0,includeMatches:!0,minMatchCharLength:2}).search(a).map(p=>({item:p.item,score:p.score??1,matches:(p.matches??[]).map(g=>({key:g.key??"",indices:g.indices}))}))}const PN="_breadcrumbs_17or2_1",FN="_list_17or2_11",$N="_item_17or2_21",YN="_separator_17or2_28",KN="_link_17or2_34",ZN="_current_17or2_57",Bi={breadcrumbs:PN,list:FN,item:$N,separator:YN,link:KN,current:ZN},XN="›";function Qi({segments:n}){return h.jsx("nav",{className:Bi.breadcrumbs,"aria-label":"Breadcrumb","data-testid":"breadcrumbs",children:h.jsx("ol",{className:Bi.list,children:n.map((a,l)=>{const o=l===n.length-1;return h.jsxs("li",{className:Bi.item,children:[l>0&&h.jsx("span",{className:Bi.separator,"aria-hidden":"true",children:XN}),a.url&&!o?h.jsx(Vf,{className:Bi.link,to:a.url,title:a.label,children:a.label}):h.jsx("span",{className:Bi.current,"aria-current":"page",title:a.label,children:a.label})]},l)})})})}function wf(){wf=function(r,u){return new l(r,void 0,u)};var n=RegExp.prototype,a=new WeakMap;function l(r,u,d){var m=new RegExp(r,u);return a.set(m,d||a.get(r)),oc(m,l.prototype)}function o(r,u){var d=a.get(u);return Object.keys(d).reduce(function(m,p){var g=d[p];if(typeof g=="number")m[p]=r[g];else{for(var v=0;r[g[v]]===void 0&&v+1<g.length;)v++;m[p]=r[g[v]]}return m},Object.create(null))}return(function(r,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(u&&u.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),u&&oc(r,u)})(l,RegExp),l.prototype.exec=function(r){var u=n.exec.call(this,r);if(u){u.groups=o(u,this);var d=u.indices;d&&(d.groups=o(d,this))}return u},l.prototype[Symbol.replace]=function(r,u){if(typeof u=="string"){var d=a.get(this);return n[Symbol.replace].call(this,r,u.replace(/\$<([^>]+)>/g,function(p,g){var v=d[g];return"$"+(Array.isArray(v)?v.join("$"):v)}))}if(typeof u=="function"){var m=this;return n[Symbol.replace].call(this,r,function(){var p=arguments;return typeof p[p.length-1]!="object"&&(p=[].slice.call(p)).push(o(p,m)),u.apply(this,p)})}return n[Symbol.replace].call(this,r,u)},wf.apply(this,arguments)}function oc(n,a){return oc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(l,o){return l.__proto__=o,l},oc(n,a)}function t0(n,a){(a==null||a>n.length)&&(a=n.length);for(var l=0,o=new Array(a);l<a;l++)o[l]=n[l];return o}function Xd(n,a){var l=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(l)return(l=l.call(n)).next.bind(l);if(Array.isArray(n)||(l=(function(r,u){if(r){if(typeof r=="string")return t0(r,u);var d=Object.prototype.toString.call(r).slice(8,-1);return d==="Object"&&r.constructor&&(d=r.constructor.name),d==="Map"||d==="Set"?Array.from(r):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?t0(r,u):void 0}})(n))||a){l&&(n=l);var o=0;return function(){return o>=n.length?{done:!0}:{done:!1,value:n[o++]}}}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 QN=(function(n){return function(a){return a===void 0&&(a={}),(function(o,r){if(r&&!o.registered(r))throw new Error('The default language "'+r+'" is not registered with refractor.')})(n,a.defaultLanguage),function(o){X_(o,"element",l)};function l(o,r,u){var d,m;if(u&&u.tagName==="pre"&&o.tagName==="code"){var p=(o==null||(d=o.data)==null?void 0:d.meta)||(o==null||(m=o.properties)==null?void 0:m.metastring)||"";o.properties.className?typeof o.properties.className=="boolean"?o.properties.className=[]:Array.isArray(o.properties.className)||(o.properties.className=[o.properties.className]):o.properties.className=[];var g,v,b=(function(H){for(var J,W=Xd(H.properties.className);!(J=W()).done;){var F=J.value;if(F.slice(0,9)==="language-")return F.slice(9).toLowerCase()}return null})(o);if(!b&&a.defaultLanguage&&o.properties.className.push("language-"+(b=a.defaultLanguage)),o.properties.className.push("code-highlight"),b)try{var x,T;T=(x=b)!=null&&x.includes("diff-")?b.split("-")[1]:b,g=n.highlight(Br(o),T),u.properties.className=(u.properties.className||[]).concat("language-"+T)}catch(H){if(!a.ignoreMissing||!/Unknown language/.test(H.message))throw H;g=o}else g=o;g.children=(v=1,function H(J){return J.reduce(function(W,F){if(F.type==="text"){var ne=F.value,ge=(ne.match(/\n/g)||"").length;if(ge===0)F.position={start:{line:v,column:1},end:{line:v,column:1}},W.push(F);else for(var U,pe=ne.split(`
|
|
88
|
+
`),te=Xd(pe.entries());!(U=te()).done;){var ye=U.value,q=ye[0],z=ye[1];W.push({type:"text",value:q===pe.length-1?z:z+`
|
|
89
|
+
`,position:{start:{line:v+q,column:1},end:{line:v+q,column:1}}})}return v+=ge,W}if(Object.prototype.hasOwnProperty.call(F,"children")){var Y=v;return F.children=H(F.children),W.push(F),F.position={start:{line:Y,column:1},end:{line:v,column:1}},W}return W.push(F),W},[])})(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 A,j=(function(H){var J=/{([\d,-]+)}/,W=H.split(",").map(function(ge){return ge.trim()}).join();if(J.test(W)){var F=J.exec(W)[1],ne=J_(F);return function(ge){return ne.includes(ge+1)}}return function(){return!1}})(p),N=(function(H){var J=wf(/showLineNumbers=(\d+)/i,{lines:1});if(J.test(H)){var W=J.exec(H);return Number(W.groups.lines)}return 1})(p),C=(function(H){for(var J=new Array(H),W=0;W<H;W++)J[W]={type:"element",tagName:"span",properties:{className:[]},children:[]};return J})(g.position.end.line),B=["showlinenumbers=false",'showlinenumbers="false"',"showlinenumbers={false}"],R=function(){var H,J,W=A.value,F=W[0],ne=W[1];ne.properties.className=["code-line"];var ge=W_(g,function(U){return U.position.start.line<=F+1&&U.position.end.line>=F+1});ne.children=ge.children,(p.toLowerCase().includes("showLineNumbers".toLowerCase())||a.showLineNumbers===!0||typeof a.showLineNumbers=="object"&&a.showLineNumbers.includes(b))&&!B.some(function(U){return p.toLowerCase().includes(U)})&&(ne.properties.line=[(F+N).toString()],ne.properties.className.push("line-number")),j(F)&&ne.properties.className.push("highlight-line"),(b==="diff"||(H=b)!=null&&H.includes("diff-"))&&Br(ne).substring(0,1)==="-"?ne.properties.className.push("deleted"):(b==="diff"||(J=b)!=null&&J.includes("diff-"))&&Br(ne).substring(0,1)==="+"&&ne.properties.className.push("inserted")},X=Xd(C.entries());!(A=X()).done;)R();C.length>0&&Br(C[C.length-1]).trim()===""&&C.pop(),o.children=C}}}})(Q_);const JN="_systemEvent_qvd33_1",WN="_systemTimestamp_qvd33_9",ew="_textEvent_qvd33_13",tw="_toolUseEvent_qvd33_100",nw="_toolUseHeader_qvd33_121",aw="_toolUsePrefix_qvd33_128",sw="_toolUseName_qvd33_133",iw="_toolUseArgs_qvd33_138",lw="_toolResultEvent_qvd33_149",ow="_toolResultHeader_qvd33_155",rw="_toolResultIndicatorOk_qvd33_179",cw="_toolResultIndicatorError_qvd33_186",uw="_toolResultLabel_qvd33_193",dw="_toolResultToggle_qvd33_197",fw="_toolResultCommand_qvd33_203",hw="_toolResultEllipsis_qvd33_213",mw="_toolResultPre_qvd33_217",pw="_errorEvent_qvd33_238",gw="_statusEvent_qvd33_247",vw="_userInputEvent_qvd33_257",yw="_userInputContent_qvd33_264",bw="_defaultEvent_qvd33_281",St={systemEvent:JN,systemTimestamp:WN,textEvent:ew,toolUseEvent:tw,toolUseHeader:nw,toolUsePrefix:aw,toolUseName:sw,toolUseArgs:iw,toolResultEvent:lw,toolResultHeader:ow,toolResultIndicatorOk:rw,toolResultIndicatorError:cw,toolResultLabel:uw,toolResultToggle:dw,toolResultCommand:fw,toolResultEllipsis:hw,toolResultPre:mw,errorEvent:pw,statusEvent:gw,userInputEvent:vw,userInputContent:yw,defaultEvent:bw};function Sw({time:n,content:a}){return h.jsxs("div",{className:St.systemEvent,children:[h.jsxs("span",{className:St.systemTimestamp,children:["[",n,"]"]})," ",a]})}function _w({content:n}){return h.jsx("div",{className:St.textEvent,children:h.jsx(kf,{remarkPlugins:[Rf],rehypePlugins:[QN],children:n})})}function xw({content:n}){let a="",l=n;try{const o=JSON.parse(n);a=o.tool||"",l=JSON.stringify(o.args,null,2)}catch{}return h.jsxs("div",{className:St.toolUseEvent,children:[h.jsxs("div",{className:St.toolUseHeader,children:[h.jsx("span",{className:St.toolUsePrefix,children:">"}),a?h.jsx("span",{className:St.toolUseName,children:a}):null]}),h.jsx("pre",{className:St.toolUseArgs,children:l})]})}const n0=5;function Tw(n,a){if(a==null)return"";if(typeof a!="object")return String(a);const l=a;if(typeof l.command=="string")return l.command;if(typeof l.file_path=="string")return l.file_path;if(typeof l.pattern=="string"){const o=typeof l.path=="string"?` in ${l.path}`:"";return`${l.pattern}${o}`}if(typeof l.path=="string")return l.path;if(typeof l.query=="string")return l.query;try{const o=JSON.stringify(a);return o.length>150?`${o.slice(0,150)}…`:o}catch{return""}}function Ew({content:n,raw:a,toolUseCtx:l}){const[o,r]=S.useState(!1);let u=!1;if(a)try{u=JSON.parse(a).is_error===!0}catch{}const d=n.split(`
|
|
90
|
+
`),m=d.length>n0,p=o?n:d.slice(0,n0).join(`
|
|
91
|
+
`),v=((l==null?void 0:l.tool)??"")||(u?"Tool error":"Tool output"),b=l?Tw(l.tool,l.args):"",x=h.jsxs(h.Fragment,{children:[h.jsx("span",{className:u?St.toolResultIndicatorError:St.toolResultIndicatorOk,"aria-label":u?"error":"success",children:u?"✗":"✓"}),h.jsx("span",{className:St.toolResultLabel,children:v}),m&&h.jsx("span",{className:St.toolResultToggle,"aria-hidden":"true",children:o?"▾":"▸"})]});return h.jsxs("div",{className:St.toolResultEvent,children:[m?h.jsx("button",{className:St.toolResultHeader,onClick:()=>{r(T=>!T)},"aria-expanded":o,children:x}):h.jsx("div",{className:St.toolResultHeader,children:x}),b&&h.jsx("div",{className:St.toolResultCommand,children:b}),h.jsxs("pre",{className:St.toolResultPre,children:[p,!o&&m&&h.jsx("span",{className:St.toolResultEllipsis,children:"…"})]})]})}function Cw({content:n}){return h.jsxs("div",{className:St.errorEvent,children:["Error: ",n]})}function Aw({content:n}){return h.jsxs("div",{className:St.statusEvent,children:["--- ",n," ---"]})}function jw({content:n}){return h.jsx("div",{className:St.userInputEvent,children:h.jsx("span",{className:St.userInputContent,children:n})})}function Nw({content:n}){return h.jsx("div",{className:St.defaultEvent,children:n})}function w1({event:n,toolUseCtx:a}){const l=new Date(n.timestamp).toLocaleTimeString();switch(n.eventType){case"system":return h.jsx(Sw,{time:l,content:n.content});case"text":case"output":return h.jsx(_w,{content:n.content});case"tool_use":return h.jsx(xw,{content:n.content});case"tool_result":return h.jsx(Ew,{content:n.content,raw:n.raw,toolUseCtx:a});case"error":return h.jsx(Cw,{content:n.content});case"status":return h.jsx(Aw,{content:n.content});case"user_input":return h.jsx(jw,{content:n.content});default:return h.jsx(Nw,{content:n.content})}}const ww="_overlay_cmicx_1",Dw="_dialog_cmicx_11",kw="_title_cmicx_30",Rw="_description_cmicx_38",Mw="_actions_cmicx_45",Ow="_cancelButton_cmicx_52",Bw="_confirmButton_cmicx_79",Is={overlay:ww,dialog:Dw,title:kw,description:Rw,actions:Mw,cancelButton:Ow,confirmButton:Bw};function Sc({isOpen:n,title:a,description:l,confirmLabel:o="Delete",onConfirm:r,onCancel:u}){const d=S.useId(),m=S.useId();return h.jsx(ys,{children:n&&h.jsx($n.div,{className:Is.overlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},onClick:u,onKeyDown:p=>{p.key==="Escape"&&u()},role:"dialog","aria-modal":"true","aria-labelledby":d,"aria-describedby":l?m:void 0,children:h.jsxs($n.div,{className:Is.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:p=>p.stopPropagation(),children:[h.jsx("h3",{id:d,className:Is.title,children:a}),l&&h.jsx("p",{id:m,className:Is.description,children:l}),h.jsxs("div",{className:Is.actions,children:[h.jsx("button",{type:"button",className:Is.cancelButton,onClick:u,autoFocus:!0,children:"Cancel"}),h.jsx("button",{type:"button",className:Is.confirmButton,onClick:r,children:o})]})]})})})}const Lw="_spinner_13c8l_1",zw="_spin_13c8l_1",Uw="_sm_13c8l_14",Vw="_md_13c8l_20",Iw="_lg_13c8l_26",a0={spinner:Lw,spin:zw,sm:Uw,md:Vw,lg:Iw};function s0({size:n="md",className:a,label:l="Loading",liveRegion:o=!1}){return h.jsx("span",{className:`${a0.spinner} ${a0[n]} ${a??""}`,role:o?"status":void 0,"aria-label":l,"aria-hidden":o?void 0:!0})}const Df={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 vs(n){return n==="blocked"?Df.blocked:Df[Th(n)]}const Hw={not_started:"statusPending",working:"statusInProgress",paused:"statusWaitingInput",complete:"statusDone",failed:"statusFailed"};function qw(n){return Hw[Th(n)]??"statusPending"}const Gw=["working","paused","failed","not_started","blocked","complete"],i0=["not_started","working","paused","complete","failed"],Pw={pending:"not_started",assigned:"not_started",in_progress:"working",waiting_input:"paused",review:"paused",done:"complete"};function Th(n){return n in Df&&n!=="blocked"?n:Pw[n]??"not_started"}const Fw={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"},$w="_container_15oob_1",Yw="_header_15oob_5",Kw="_searchInput_15oob_17",Zw="_searchHighlight_15oob_50",Xw="_addButton_15oob_56",Qw="_createForm_15oob_83",Jw="_createInput_15oob_89",Ww="_createButton_15oob_120",eD="_creatingHint_15oob_161",tD="_projectRow_15oob_170",nD="_selected_15oob_188",aD="_expandArrow_15oob_193",sD="_expanded_15oob_200",iD="_projectName_15oob_204",lD="_taskCount_15oob_208",oD="_newTaskButton_15oob_214",rD="_taskRow_15oob_241",cD="_taskStatusIcon_15oob_271",uD="_taskTitle_15oob_275",dD="_dependencyBadge_15oob_282",fD="_blockedBadge_15oob_294",hD="_leafSpacer_15oob_299",mD="_childCountBadge_15oob_304",pD="_addChildButton_15oob_317",gD="_emptyCta_15oob_366",vD="_ctaDescription_15oob_379",yD="_ctaButton_15oob_385",bD="_emptyTaskCta_15oob_420",SD="_headerActions_15oob_425",_D="_groupToggle_15oob_431",xD="_groupToggleActive_15oob_458",TD="_statusGroupHeader_15oob_462",ED="_statusGroupIcon_15oob_481",CD="_statusGroupLabel_15oob_485",AD="_statusGroupCount_15oob_490",jD="_createTaskLink_15oob_503",Ne={container:$w,header:Yw,searchInput:Kw,searchHighlight:Zw,addButton:Xw,createForm:Qw,createInput:Jw,createButton:Ww,creatingHint:eD,projectRow:tD,selected:nD,expandArrow:aD,expanded:sD,projectName:iD,taskCount:lD,newTaskButton:oD,taskRow:rD,taskStatusIcon:cD,taskTitle:uD,dependencyBadge:dD,blockedBadge:fD,leafSpacer:hD,childCountBadge:mD,addChildButton:pD,emptyCta:gD,ctaDescription:vD,ctaButton:yD,emptyTaskCta:bD,headerActions:SD,groupToggle:_D,groupToggleActive:xD,statusGroupHeader:TD,statusGroupIcon:ED,statusGroupLabel:CD,statusGroupCount:AD,createTaskLink:jD};function ND(n){if(n.length===0)return[];const a=[...n].sort((o,r)=>o[0]-r[0]),l=[[a[0][0],a[0][1]]];for(let o=1;o<a.length;o++){const r=l[l.length-1],[u,d]=a[o];u<=r[1]+1?r[1]=Math.max(r[1],d):l.push([u,d])}return l}function D1({text:n,indices:a}){if(!a||a.length===0)return h.jsx(h.Fragment,{children:n});const l=ND(a),o=[];let r=0;for(const[u,d]of l)u>r&&o.push(h.jsx("span",{children:n.slice(r,u)},`p${r}`)),o.push(h.jsx("mark",{className:Ne.searchHighlight,children:n.slice(u,d+1)},`m${u}`)),r=d+1;return r<n.length&&o.push(h.jsx("span",{children:n.slice(r)},`p${r}`)),h.jsx(h.Fragment,{children:o})}const wD=[{name:"name",weight:2},{name:"description",weight:1}],DD=[{name:"title",weight:2},{name:"description",weight:1}],k1=34,kD=16,R1="grackle-group-by-status";function l0(){try{return localStorage.getItem(R1)==="true"}catch{return!1}}function RD(n){try{localStorage.setItem(R1,String(n))}catch{}}function MD(n,a){const l=new Map;for(const u of n){const m=u.dependsOn.length>0&&u.dependsOn.some(g=>a.get(g)!=="complete")?"blocked":u.status,p=l.get(m);p?p.push(u):l.set(m,[u])}const o=[],r=new Set;for(const u of Gw){r.add(u);const d=l.get(u);if(d&&d.length>0){d.sort((p,g)=>p.sortOrder-g.sortOrder);const m=vs(u);o.push({status:u,label:m.label,style:m,tasks:d})}}for(const[u,d]of l)if(!r.has(u)&&d.length>0){d.sort((p,g)=>p.sortOrder-g.sortOrder);const m=vs(u);o.push({status:u,label:m.label,style:m,tasks:d})}return o}function OD({group:n,isExpanded:a,onToggle:l,selectedTaskId:o,navigate:r,titleHighlights:u}){return h.jsxs("div",{"data-testid":`status-group-${n.status}`,children:[h.jsxs("div",{className:Ne.statusGroupHeader,role:"button",tabIndex:0,"aria-expanded":a,onClick:l,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),l())},children:[h.jsx("span",{className:`${Ne.expandArrow} ${a?Ne.expanded:""}`,children:"▸"}),h.jsx("span",{className:Ne.statusGroupIcon,style:{color:n.style.color},children:n.style.icon}),h.jsx("span",{className:Ne.statusGroupLabel,children:n.label}),h.jsx("span",{className:Ne.statusGroupCount,children:n.tasks.length})]}),h.jsx(ys,{children:a&&h.jsx($n.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(d=>{const m=vs(d.status),p=o===d.id;return h.jsxs("div",{onClick:()=>r(ms(d.id)),className:`${Ne.taskRow} ${p?Ne.selected:""}`,style:{"--task-indent":`${k1}px`},"data-task-id":d.id,children:[h.jsx("span",{className:Ne.leafSpacer}),h.jsx("span",{className:Ne.taskStatusIcon,style:{color:m.color},children:m.icon}),h.jsx("span",{className:Ne.taskTitle,title:d.title,children:h.jsx(D1,{text:d.title,indices:u.get(d.id)})})]},d.id)})})})]})}function BD(n){const a=new Map(n.map(o=>[o.id,{...o,children:[]}])),l=[];for(const o of a.values())o.parentTaskId&&a.has(o.parentTaskId)?a.get(o.parentTaskId).children.push(o):l.push(o);for(const o of a.values())o.children.sort((r,u)=>r.sortOrder-u.sortOrder);return l.sort((o,r)=>o.sortOrder-r.sortOrder)}function M1({node:n,depth:a,expandedTasks:l,toggleTask:o,selectedTaskId:r,navigate:u,projectId:d,taskStatusById:m,titleHighlights:p}){const g=vs(n.status),v=n.dependsOn.length>0&&n.dependsOn.some(j=>m.get(j)!=="complete"),b=l.has(n.id),x=n.children.length>0,T=r===n.id,A=k1+a*kD;return h.jsxs(h.Fragment,{children:[h.jsxs("div",{onClick:()=>u(ms(n.id)),className:`${Ne.taskRow} ${T?Ne.selected:""}`,style:{"--task-indent":`${A}px`},"data-task-id":n.id,children:[x&&h.jsx("span",{className:`${Ne.expandArrow} ${b?Ne.expanded:""}`,role:"button",tabIndex:0,"aria-label":b?"Collapse task":"Expand task",onClick:j=>{j.stopPropagation(),o(n.id)},onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),j.stopPropagation(),o(n.id))},children:"▸"}),!x&&h.jsx("span",{className:Ne.leafSpacer}),h.jsx("span",{className:Ne.taskStatusIcon,style:{color:g.color},children:g.icon}),h.jsx("span",{className:Ne.taskTitle,title:n.title,children:h.jsx(D1,{text:n.title,indices:p.get(n.id)})}),x&&h.jsxs("span",{className:Ne.childCountBadge,children:[n.children.filter(j=>j.status==="complete").length,"/",n.children.length]}),n.dependsOn.length>0&&h.jsx("span",{className:`${Ne.dependencyBadge} ${v?Ne.blockedBadge:""}`,title:`Depends on: ${n.dependsOn.join(", ")}`,children:v?"blocked":"dep"}),a<sN&&h.jsx("button",{onClick:j=>{j.stopPropagation(),u($s(d,n.id))},title:"Add child task","aria-label":"Add child task",className:Ne.addChildButton,children:"+"})]}),h.jsx(ys,{children:x&&b&&h.jsx($n.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(j=>h.jsx(M1,{node:j,depth:a+1,expandedTasks:l,toggleTask:o,selectedTaskId:r,navigate:u,projectId:d,taskStatusById:m,titleHighlights:p},j.id))})})]})}function LD(){const{projects:n,tasks:a,loadTasks:l,createProject:o,projectCreating:r}=nn(),u=na(),[d,m]=S.useState(new Set),[p,g]=S.useState(new Set),[v,b]=S.useState(new Set),[x,T]=S.useState(!1),[A,j]=S.useState(""),[N,C]=S.useState(l0),[B,R]=S.useState(l0),[X,H]=S.useState(new Map),J=()=>{const P=!N;RD(P),C(P),P&&(R(!0),H(new Map))},W=(P,I)=>{const De=`${P}:${I}`;H($e=>{const vt=new Map($e),xt=vt.has(De)?vt.get(De):B;return vt.set(De,!xt),vt})},F=(P,I)=>{const De=`${P}:${I}`;return X.has(De)?X.get(De):B},ne=dn("/tasks/:taskId/*"),ge=dn("/projects/:projectId"),U=(ne==null?void 0:ne.params.taskId)!=="new"?ne==null?void 0:ne.params.taskId:void 0,pe=ge==null?void 0:ge.params.projectId,te=S.useRef(d);te.current=d;const ye=S.useMemo(()=>new Map(a.map(P=>[P.id,P.status])),[a]),q=P=>{m(I=>{const De=new Set(I);return De.has(P)?De.delete(P):(De.add(P),l(P)),De})},z=P=>{g(I=>{const De=new Set(I);return De.has(P)?(De.delete(P),b($e=>new Set($e).add(P))):(De.add(P),b($e=>{const vt=new Set($e);return vt.delete(P),vt})),De})};S.useEffect(()=>{const P=new Set(a.filter(I=>I.parentTaskId).map(I=>I.parentTaskId));P.size>0&&g(I=>{const De=new Set(I);for(const $e of P)v.has($e)||De.add($e);return De})},[a,v]),S.useEffect(()=>{pe&&!te.current.has(pe)&&(m(P=>new Set(P).add(pe)),l(pe))},[pe,l]);const Y=()=>{!A.trim()||r||(o(A.trim()),j(""),T(!1))},[ee,ke]=S.useState(""),{directMatchTaskIds:je,treeMatchTaskIds:Pe,visibleProjectIds:we,matchedProjectIds:_e,titleHighlights:Ce}=S.useMemo(()=>{if(!ee.trim())return{directMatchTaskIds:null,treeMatchTaskIds:null,visibleProjectIds:null,matchedProjectIds:null,titleHighlights:new Map};const P=e0(n,ee,wD),I=e0(a,ee,DD),De=new Set(P.map(Ze=>Ze.item.id)),$e=new Set(I.map(Ze=>Ze.item.id)),vt=new Map;for(const Ze of I){const ze=Ze.matches.find(Sn=>Sn.key==="title");ze&&vt.set(Ze.item.id,ze.indices)}const xt=new Set(De);for(const Ze of I)xt.add(Ze.item.projectId);const Gt=new Set($e),We=new Map(a.map(Ze=>[Ze.id,Ze]));for(const Ze of[...$e]){let ze=We.get(Ze);for(;ze!=null&&ze.parentTaskId;)Gt.add(ze.parentTaskId),ze=We.get(ze.parentTaskId)}return{directMatchTaskIds:$e,treeMatchTaskIds:Gt,visibleProjectIds:xt,matchedProjectIds:De,titleHighlights:vt}},[ee,n,a]),Q=S.useRef(new Set);return S.useEffect(()=>{if(ee.trim())for(const P of n)!d.has(P.id)&&!Q.current.has(P.id)&&(Q.current.add(P.id),l(P.id))},[ee,n,d,l]),h.jsxs("div",{className:Ne.container,children:[h.jsxs("div",{className:Ne.header,children:[h.jsx("span",{children:"Projects"}),h.jsxs("div",{className:Ne.headerActions,children:[h.jsx("button",{className:`${Ne.groupToggle} ${N?Ne.groupToggleActive:""}`,onClick:J,"aria-label":N?"Switch to tree view":"Group tasks by status","aria-pressed":N,title:N?"Switch to tree view":"Group tasks by status","data-testid":"group-by-status-toggle",children:"≡"}),h.jsx("button",{className:Ne.addButton,onClick:()=>T(!x),"aria-label":"Create project",title:"Create project",children:"+"})]})]}),n.length>0&&h.jsx("input",{type:"text",value:ee,onChange:P=>ke(P.target.value),placeholder:"Filter...","aria-label":"Filter projects and tasks",className:Ne.searchInput,"data-testid":"sidebar-search"}),x&&h.jsxs("div",{className:Ne.createForm,children:[h.jsx("input",{type:"text",value:A,onChange:P=>j(P.target.value),onKeyDown:P=>P.key==="Enter"&&Y(),placeholder:"Project name...",autoFocus:!0,disabled:r,className:Ne.createInput}),h.jsx("button",{onClick:Y,className:Ne.createButton,disabled:r,children:r?h.jsx(s0,{size:"sm",label:"Creating project"}):"OK"})]}),r&&h.jsxs("div",{className:Ne.creatingHint,children:[h.jsx(s0,{size:"sm",label:"Creating project"}),"Creating project…"]}),n.length===0&&!x&&h.jsxs("div",{className:Ne.emptyCta,children:[h.jsx("button",{className:Ne.ctaButton,onClick:()=>T(!0),children:"Create Project"}),h.jsx("div",{className:Ne.ctaDescription,children:"Organize your work into projects"})]}),n.map(P=>{if(we&&!we.has(P.id))return null;const I=je!==null,De=d.has(P.id)||I,$e=a.filter(ze=>ze.projectId===P.id),vt=(_e==null?void 0:_e.has(P.id))??!1,xt=I&&!vt?N?je:Pe:null,Gt=xt?$e.filter(ze=>xt.has(ze.id)):$e,We=pe===P.id,Ze=De&&!N?BD(Gt):[];return h.jsxs("div",{children:[h.jsxs("div",{onClick:()=>{We?q(P.id):(De||q(P.id),u(oo(P.id)))},className:`${Ne.projectRow} ${We?Ne.selected:""}`,children:[h.jsx("span",{className:`${Ne.expandArrow} ${De?Ne.expanded:""}`,children:"▸"}),h.jsx("span",{className:Ne.projectName,title:P.name,children:P.name}),h.jsx("span",{className:Ne.taskCount,children:$e.length>0&&`${$e.filter(ze=>ze.status==="complete").length}/${$e.length}`}),h.jsx("button",{onClick:ze=>{ze.stopPropagation(),u($s(P.id))},title:"New task",className:Ne.newTaskButton,children:"+"})]}),h.jsx(ys,{children:De&&h.jsxs($n.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeInOut"},style:{overflow:"hidden"},children:[N?MD(Gt,ye).map(ze=>h.jsx(OD,{group:ze,isExpanded:F(P.id,ze.status),onToggle:()=>W(P.id,ze.status),selectedTaskId:U,navigate:u,titleHighlights:Ce},ze.status)):Ze.map(ze=>h.jsx(M1,{node:ze,depth:0,expandedTasks:p,toggleTask:z,selectedTaskId:U,navigate:u,projectId:P.id,taskStatusById:ye,titleHighlights:Ce},ze.id)),Gt.length===0&&h.jsx("div",{className:Ne.emptyTaskCta,children:h.jsx("button",{className:Ne.createTaskLink,onClick:()=>u($s(P.id)),children:"+ Create Task"})})]})})]},P.id)})]})}const zD="_container_lovia_1",UD="_content_lovia_40",o0={container:zD,content:UD},VD=320,O1=220,B1=600,L1="grackle-sidebar-width";function ID(){try{const n=localStorage.getItem(L1);if(n!==null){const a=Number(n);if(Number.isFinite(a)&&a>=O1&&a<=B1)return a}}catch{}return VD}function HD(n){try{localStorage.setItem(L1,String(n))}catch{}}function qD(){const[n]=S.useState(ID),a=S.useRef(null);return S.useEffect(()=>{const l=a.current;if(!l)return;const o=new ResizeObserver(r=>{for(const u of r){const d=u.borderBoxSize[0];if(d){const m=Math.round(d.inlineSize);m>=O1&&m<=B1&&HD(m)}}});return o.observe(l),()=>{o.disconnect()}},[]),h.jsx("div",{className:o0.container,ref:a,"data-testid":"sidebar",style:{width:n},children:h.jsx("div",{className:o0.content,children:h.jsx(LD,{})})})}const GD="_bar_8ghh5_1",PD="_barColumn_8ghh5_32",FD="_barRow_8ghh5_63",$D="_input_8ghh5_74",YD="_inputSmall_8ghh5_109",KD="_select_8ghh5_178",ZD="_btnPrimary_8ghh5_214",XD="_btnDanger_8ghh5_245",QD="_btnGhost_8ghh5_284",JD="_badge_8ghh5_312",WD="_statusText_8ghh5_322",ek="_statusCompleted_8ghh5_327",tk="_statusFailed_8ghh5_331",nk="_statusBlocked_8ghh5_335",ak="_hintText_8ghh5_340",sk="_creatingHint_8ghh5_345",ik="_errorHint_8ghh5_353",lk="_disconnectHint_8ghh5_359",fe={bar:GD,barColumn:PD,barRow:FD,input:$D,inputSmall:YD,select:KD,btnPrimary:ZD,btnDanger:XD,btnGhost:QD,badge:JD,statusText:WD,statusCompleted:ek,statusFailed:tk,statusBlocked:nk,hintText:ak,creatingHint:sk,errorHint:ik,disconnectHint:lk};function r0({value:n,onChange:a,testId:l}){return h.jsxs("select",{"data-testid":l,value:n,onChange:o=>a(o.target.value),className:fe.select,children:[h.jsx("option",{value:"claude-code",children:"claude-code"}),h.jsx("option",{value:"codex",children:"codex"}),h.jsx("option",{value:"copilot",children:"copilot"}),h.jsx("option",{value:"stub",children:"stub"})]})}function c0(n,a){if(!n)return!1;const l=a.find(o=>o.id===n);return l!==void 0&&(l.status==="disconnected"||l.status==="error")}function u0({environmentId:n,onReconnect:a}){return h.jsxs(h.Fragment,{children:[h.jsx("span",{className:fe.disconnectHint,"data-testid":"env-disconnect-hint",children:"Environment unavailable"}),h.jsx("button",{type:"button",onClick:()=>a(n),className:fe.btnGhost,"data-testid":"reconnect-btn",title:"Reconnect the environment to resume messaging",children:"Reconnect"})]})}function ok(){const{spawn:n,sendInput:a,kill:l,sessions:o,tasks:r,environments:u,personas:d,addEnvironment:m,provisionEnvironment:p,codespaces:g,codespaceError:v,codespaceListError:b,codespaceCreating:x,listCodespaces:T,createCodespace:A}=nn(),{showToast:j}=go(),N=na(),[C]=If(),B=dn("/sessions/:sessionId"),R=dn("/tasks/:taskId"),X=dn("/tasks/:taskId/stream"),H=dn("/tasks/:taskId/findings"),J=dn("/tasks/:taskId/edit"),W=dn("/sessions/new"),F=dn("/environments/new"),ne=dn("/projects/:projectId"),ge=dn("/tasks/new"),U=dn("/"),pe=dn("/settings/*"),te=B==null?void 0:B.params.sessionId,ye=(R==null?void 0:R.params.taskId)??(X==null?void 0:X.params.taskId)??(H==null?void 0:H.params.taskId),q=!!W,z=!!F,Y=!!ne,ee=!!ge,ke=!!J,je=!!U&&!q&&!z&&!Y&&!ee,Pe=!!pe,we=q?C.get("env")??"":"",_e=q?C.get("runtime")??"claude-code":"claude-code",[Ce,Q]=S.useState(""),[P,I]=S.useState(q?_e:"claude-code"),[De,$e]=S.useState(""),vt=be=>{if($e(be),be){const re=d.find(ie=>ie.id===be);re!=null&&re.runtime&&I(re.runtime)}},[xt,Gt]=S.useState(""),[We,Ze]=S.useState("local"),[ze,Sn]=S.useState("claude-code"),[_n,Zn]=S.useState(""),[an,Xn]=S.useState(""),[Z,le]=S.useState(""),[ce,de]=S.useState(""),[Te,Ee]=S.useState(""),[et,Le]=S.useState(""),[ot,Dt]=S.useState(""),[Tt,Lt]=S.useState(""),[rt,Et]=S.useState(""),[cn,yt]=S.useState("pick");S.useEffect(()=>{q&&I(_e)},[q,_e]);const $t=te?o.find(be=>be.id===te):void 0,Yt=ye?r.find(be=>be.id===ye):void 0,_s=(Yt==null?void 0:Yt.latestSessionId)||void 0,ae=_s?o.find(be=>be.id===_s):void 0,Me=Yt?Yt.dependsOn.some(be=>{const re=r.find(ie=>ie.id===be);return re&&re.status!=="complete"}):!1;if(je||Pe)return h.jsx("div",{className:fe.bar,children:h.jsx("span",{className:fe.hintText,children:"Select a session or click + to start"})});if(ke||ee)return h.jsx(h.Fragment,{});if(z){const be=se=>{if(!se.trim())return!0;const Ct=Number(se);return Number.isInteger(Ct)&&Ct>=1&&Ct<=65535},re=()=>!(!xt.trim()||We==="ssh"&&!_n.trim()||We==="codespace"&&!et.trim()||(We==="local"||We==="ssh")&&!be(an)),ie=()=>{if(!re())return;const se={};if(We==="local"){if(_n.trim()&&(se.host=_n.trim()),an.trim()){const Ct=Number(an);Number.isInteger(Ct)&&(se.port=Ct)}}else if(We==="ssh"){if(se.host=_n.trim(),Z.trim()&&(se.user=Z.trim()),an.trim()){const Ct=Number(an);Number.isInteger(Ct)&&(se.sshPort=Ct)}ot.trim()&&(se.identityFile=ot.trim())}else We==="docker"?(ce.trim()&&(se.image=ce.trim()),Te.trim()&&(se.repo=Te.trim())):We==="codespace"&&(se.codespaceName=et.trim());m(xt.trim(),We,se,ze),j("Environment added successfully","success"),Gt(""),Ze("local"),Sn("claude-code"),Zn(""),Xn(""),le(""),de(""),Ee(""),Le(""),Dt(""),Lt(""),Et(""),yt("pick"),N(qi,{replace:!0})};return h.jsxs("div",{className:fe.barColumn,children:[h.jsxs("div",{className:fe.barRow,children:[h.jsx("span",{className:fe.badge,children:"new env"}),h.jsx("input",{type:"text",value:xt,onChange:se=>Gt(se.target.value),placeholder:"Environment name...",autoFocus:!0,className:fe.input}),h.jsxs("select",{value:We,onChange:se=>{Ze(se.target.value),se.target.value==="codespace"&&(T(),yt("pick"),Le(""))},className:fe.select,children:[h.jsx("option",{value:"local",children:"local"}),h.jsx("option",{value:"ssh",children:"ssh"}),h.jsx("option",{value:"docker",children:"docker"}),h.jsx("option",{value:"codespace",children:"codespace"})]}),h.jsx(r0,{value:ze,onChange:Sn,testId:"new-environment-runtime-select"}),h.jsx("button",{onClick:ie,disabled:!re(),className:fe.btnPrimary,children:"Add"})]}),h.jsxs("div",{className:fe.barRow,children:[We==="local"&&h.jsxs(h.Fragment,{children:[h.jsx("input",{type:"text",value:_n,onChange:se=>Zn(se.target.value),placeholder:"Host (optional)...",className:fe.inputSmall}),h.jsx("input",{type:"number",min:1,max:65535,value:an,onChange:se=>Xn(se.target.value),placeholder:"Port (optional)...",className:fe.inputSmall})]}),We==="ssh"&&h.jsxs(h.Fragment,{children:[h.jsx("input",{type:"text",value:_n,onChange:se=>Zn(se.target.value),placeholder:"Host (required)...",className:fe.inputSmall}),h.jsx("input",{type:"text",value:Z,onChange:se=>le(se.target.value),placeholder:"User (optional)...",className:fe.inputSmall}),h.jsx("input",{type:"number",min:1,max:65535,value:an,onChange:se=>Xn(se.target.value),placeholder:"SSH port (optional)...",className:fe.inputSmall}),h.jsx("input",{type:"text",value:ot,onChange:se=>Dt(se.target.value),placeholder:"Identity file (optional)...",className:fe.inputSmall})]}),We==="docker"&&h.jsxs(h.Fragment,{children:[h.jsx("input",{type:"text",value:ce,onChange:se=>de(se.target.value),placeholder:"Image (optional)...",className:fe.inputSmall}),h.jsx("input",{type:"text",value:Te,onChange:se=>Ee(se.target.value),placeholder:"Repo (optional)...",className:fe.inputSmall})]}),We==="codespace"&&cn==="pick"&&h.jsxs(h.Fragment,{children:[!b&&h.jsxs("select",{value:et,onChange:se=>{se.target.value==="__create__"?(yt("create"),Le("")):(Le(se.target.value),se.target.value&&!xt.trim()&&Gt(se.target.value))},disabled:x,className:fe.select,children:[h.jsx("option",{value:"",children:"Select a codespace..."}),g.map(se=>h.jsxs("option",{value:se.name,children:[se.name," (",se.repository,") — ",se.state]},se.name)),h.jsx("option",{value:"__create__",children:"Create new from repo..."})]}),x&&h.jsx("span",{className:fe.creatingHint,children:"Creating codespace..."}),b&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:fe.errorHint,children:b}),h.jsx("input",{type:"text",value:et,onChange:se=>Le(se.target.value),placeholder:"Or enter codespace name manually...",className:fe.inputSmall})]}),v&&!b&&h.jsx("span",{className:fe.errorHint,children:v})]}),We==="codespace"&&cn==="create"&&h.jsxs(h.Fragment,{children:[h.jsx("input",{type:"text",value:Tt,onChange:se=>Lt(se.target.value),placeholder:"owner/repo",className:fe.inputSmall}),h.jsx("input",{type:"text",value:rt,onChange:se=>Et(se.target.value),placeholder:"Machine type (optional)...",className:fe.inputSmall}),h.jsx("button",{onClick:()=>{Tt.trim()&&(A(Tt.trim(),rt.trim()||void 0),yt("pick"),Lt(""),Et(""))},disabled:!Tt.trim(),className:fe.btnPrimary,children:"Create"}),h.jsx("button",{onClick:()=>{yt("pick"),Lt(""),Et("")},className:fe.btnGhost,children:"Cancel"})]})]})]})}if(Y)return h.jsx("div",{className:fe.bar,children:h.jsx("span",{className:fe.hintText,children:"Select a task or click + to create one"})});if(ye&&Yt){if(Yt.status==="not_started"){const be=Me?Yt.dependsOn.map(re=>r.find(ie=>ie.id===re)).filter(re=>re&&re.status!=="complete").map(re=>re.title):[];return h.jsx("div",{className:fe.bar,children:Me?h.jsxs("span",{className:fe.statusBlocked,children:["Blocked by: ",be.join(", ")]}):h.jsx("span",{className:fe.hintText,children:"Use the buttons above to start or manage this task"})})}if(Yt.status==="working"||Yt.status==="paused"){if((ae==null?void 0:ae.status)==="idle"){const re=ae.environmentId,ie=c0(re,u),se=Ct=>{Ct.preventDefault();const Mn=Yt.latestSessionId||_s;!Ce.trim()||!Mn||ie||(a(Mn,Ce),Q(""))};return h.jsxs("form",{onSubmit:se,className:fe.bar,children:[ie&&re&&h.jsx(u0,{environmentId:re,onReconnect:p}),h.jsx("input",{type:"text",value:Ce,onChange:Ct=>Q(Ct.target.value),placeholder:"Type a message...",autoFocus:!ie,disabled:ie,className:fe.input}),h.jsx("span",{title:ie?"Environment is unavailable — reconnect first":void 0,children:h.jsx("button",{type:"submit",disabled:!Ce.trim()||ie,className:fe.btnPrimary,children:"Send"})})]})}return h.jsx("div",{className:fe.bar,children:h.jsx("input",{type:"text",disabled:!0,placeholder:"Agent is working...",className:fe.input})})}if(Yt.status==="complete")return h.jsxs("div",{className:fe.bar,children:[h.jsx("span",{className:`${fe.statusText} ${fe.statusCompleted}`,children:"Task completed"}),h.jsx("button",{onClick:()=>N($s(Yt.projectId)),className:fe.btnPrimary,children:"+ New Task"})]});if(Yt.status==="failed")return h.jsx("div",{className:fe.bar,children:h.jsx("span",{className:`${fe.statusText} ${fe.statusFailed}`,children:"Task failed"})})}if(q){const be=re=>{re.preventDefault(),!(!Ce.trim()||!we)&&(n(we,Ce,void 0,P,De),j("Session started","success"),Q(""),$e(""))};return h.jsxs("form",{onSubmit:be,className:fe.bar,children:[h.jsx("span",{className:fe.badge,children:"new chat"}),h.jsx("input",{type:"text",value:Ce,onChange:re=>Q(re.target.value),placeholder:"Enter prompt...",autoFocus:!0,className:fe.input}),h.jsx(r0,{value:P,onChange:I,testId:"new-chat-runtime-select"}),h.jsxs("select",{value:De,onChange:re=>vt(re.target.value),className:fe.select,children:[h.jsx("option",{value:"",children:"No persona"}),d.map(re=>h.jsx("option",{value:re.id,children:re.name},re.id))]}),h.jsx("button",{type:"submit",disabled:!Ce.trim()||!we,className:fe.btnPrimary,children:"Go"})]})}if(te){const be=($t==null?void 0:$t.status)==="running",re=($t==null?void 0:$t.status)==="idle",ie=$t!==void 0&&["completed","failed","interrupted"].includes($t.status);if(be)return h.jsxs("div",{className:fe.bar,children:[h.jsx("input",{type:"text",disabled:!0,placeholder:"Agent is working...",className:fe.input}),h.jsx("button",{onClick:()=>l(te),className:fe.btnDanger,title:"Stop session",children:"Stop"})]});if(re){const se=c0($t.environmentId,u),Ct=Mn=>{Mn.preventDefault(),!(!Ce.trim()||se)&&(a(te,Ce),Q(""))};return h.jsxs("form",{onSubmit:Ct,className:fe.bar,children:[se&&$t.environmentId&&h.jsx(u0,{environmentId:$t.environmentId,onReconnect:p}),h.jsx("input",{type:"text",value:Ce,onChange:Mn=>Q(Mn.target.value),placeholder:"Type a message...",autoFocus:!se,disabled:se,className:fe.input}),h.jsx("span",{title:se?"Environment is unavailable — reconnect first":void 0,children:h.jsx("button",{type:"submit",disabled:!Ce.trim()||se,className:fe.btnPrimary,children:"Send"})}),h.jsx("button",{type:"button",onClick:()=>l(te),className:fe.btnDanger,title:"Stop session",children:"Stop"})]})}if(ie)return h.jsxs("div",{className:fe.bar,children:[h.jsxs("span",{className:`${fe.statusText} ${fe.hintText}`,children:["Session ",$t.status]}),h.jsx("button",{onClick:()=>N(z0($t.environmentId,$t.runtime)),className:fe.btnPrimary,children:"+ New Chat"})]})}return h.jsx("div",{className:fe.bar,children:h.jsx("span",{className:fe.hintText,children:"Loading..."})})}const rk="_toast_da8ll_1",ck="_success_da8ll_18",uk="_icon_da8ll_22",dk="_error_da8ll_25",fk="_warning_da8ll_32",hk="_info_da8ll_38",mk="_message_da8ll_53",pk="_close_da8ll_60",Yl={toast:rk,success:ck,icon:uk,error:dk,warning:fk,info:hk,message:mk,close:pk},gk={success:"✓",error:"✕",warning:"⚠",info:"ℹ"};function vk({toast:n,onDismiss:a}){return S.useEffect(()=>{const l=setTimeout(()=>a(n.id),n.duration);return()=>clearTimeout(l)},[n.id,n.duration,a]),h.jsxs($n.div,{className:`${Yl.toast} ${Yl[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:[h.jsx("span",{className:Yl.icon,"aria-hidden":"true",children:gk[n.variant]}),h.jsx("span",{className:Yl.message,children:n.message}),h.jsx("button",{type:"button",className:Yl.close,onClick:()=>a(n.id),"aria-label":"Dismiss notification",children:"×"})]})}const yk="_container_qqse2_1",bk={container:yk};function Sk(){const{toasts:n,dismissToast:a}=go();return h.jsx("div",{className:bk.container,"data-testid":"toast-container",children:h.jsx(ys,{children:n.map(l=>h.jsx(vk,{toast:l,onDismiss:a},l.id))})})}function _k(n,a){const l=S.useRef(null);S.useEffect(()=>{const o=l.current;if(l.current=n,o===null)return;const r=new Map;for(const d of o)r.set(d.id,d);const u=new Set;for(const d of n){u.add(d.id);const m=r.get(d.id);m&&m.status!==d.status&&(d.status==="connecting"||d.status==="sleeping"||(d.status==="connected"?a("Environment connected","success"):d.status==="error"?a("Environment provision failed","error"):d.status==="disconnected"&&(m.status==="connected"?a("Environment disconnected","warning"):a("Environment stopped","info"))))}for(const d of o)u.has(d.id)||a("Environment removed","info")},[n,a])}const xk="_panelContainer_2zqh5_1",Tk="_emptyState_2zqh5_8",Ek="_fadeIn_2zqh5_1",Ck="_projectSummary_2zqh5_17",Ak="_projectSummaryTitle_2zqh5_28",jk="_projectSummarySubtitle_2zqh5_32",Nk="_header_2zqh5_36",wk="_headerInfo_2zqh5_69",Dk="_killButton_2zqh5_75",kk="_headerTitle_2zqh5_104",Rk="_headerActions_2zqh5_119",Mk="_taskStatusBadge_2zqh5_126",Ok="_taskBranch_2zqh5_135",Bk="_taskBlockedBadge_2zqh5_141",Lk="_btnPrimary_2zqh5_149",zk="_btnDanger_2zqh5_180",Uk="_btnGhost_2zqh5_219",Vk="_rejectInput_2zqh5_245",Ik="_tabBar_2zqh5_275",Hk="_tab_2zqh5_275",qk="_active_2zqh5_301",Gk="_eventScroll_2zqh5_306",Pk="_tabContent_2zqh5_312",Fk="_noContext_2zqh5_317",$k="_overviewContent_2zqh5_323",Yk="_overviewDashboard_2zqh5_332",Kk="_overviewHero_2zqh5_338",Zk="_statusBadge_2zqh5_345",Xk="_statusPending_2zqh5_357",Qk="_statusAssigned_2zqh5_362",Jk="_statusInProgress_2zqh5_367",Wk="_statusReview_2zqh5_372",eR="_statusDone_2zqh5_377",tR="_statusFailed_2zqh5_382",nR="_statusWaitingInput_2zqh5_387",aR="_overviewBranchPill_2zqh5_392",sR="_branchLink_2zqh5_407",iR="_overviewSection_2zqh5_418",lR="_overviewLabel_2zqh5_424",oR="_overviewValue_2zqh5_431",rR="_overviewMuted_2zqh5_436",cR="_overviewMarkdown_2zqh5_442",uR="_envRow_2zqh5_511",dR="_envDot_2zqh5_517",fR="_envDotGreen_2zqh5_524",hR="_envDotYellow_2zqh5_528",mR="_envDotRed_2zqh5_532",pR="_envDotGray_2zqh5_536",gR="_depList_2zqh5_540",vR="_depItem_2zqh5_546",yR="_depBlocked_2zqh5_553",bR="_depDone_2zqh5_557",SR="_timeline_2zqh5_561",_R="_timelineRow_2zqh5_567",xR="_timelineKey_2zqh5_574",TR="_timelineValue_2zqh5_580",ER="_timelineDelta_2zqh5_584",CR="_reviewNotes_2zqh5_595",AR="_overviewDescription_2zqh5_606",jR="_waitingMessage_2zqh5_612",NR="_errorMessage_2zqh5_616",wR="_eventOverflowWarning_2zqh5_620",DR="_attemptSelector_2zqh5_634",kR="_attemptLabel_2zqh5_650",RR="_attemptButton_2zqh5_654",MR="_attemptActive_2zqh5_671",OR="_attemptStatus_2zqh5_677",BR="_emptyCta_2zqh5_683",LR="_ctaTitle_2zqh5_695",zR="_ctaDescription_2zqh5_701",UR="_ctaButton_2zqh5_708",VR="_ctaLink_2zqh5_743",IR="_projectHeader_2zqh5_757",HR="_projectName_2zqh5_782",qR="_projectMeta_2zqh5_795",GR="_metaRow_2zqh5_803",PR="_metaLabel_2zqh5_816",FR="_metaValue_2zqh5_831",$R="_metaPlaceholder_2zqh5_841",YR="_editButton_2zqh5_846",KR="_editInput_2zqh5_862",ZR="_editTextarea_2zqh5_894",XR="_editSelect_2zqh5_930",QR="_archiveButton_2zqh5_963",JR="_repoLink_2zqh5_993",WR="_metaValueClickable_2zqh5_1003",eM="_editHint_2zqh5_1022",tM="_editError_2zqh5_1031",nM="_editInputInvalid_2zqh5_1038",aM="_unsavedDot_2zqh5_1043",sM="_metaToggle_2zqh5_1051",iM="_metaToggleArrow_2zqh5_1072",lM="_metaToggleArrowOpen_2zqh5_1077",oM="_progressBarContainer_2zqh5_1081",rM="_progressBar_2zqh5_1081",cM="_progressFill_2zqh5_1097",uM="_progressLabel_2zqh5_1104",dM="_metaTimestamps_2zqh5_1111",fM="_metaTimestamp_2zqh5_1111",hM="_editFieldWrapper_2zqh5_1133",D={panelContainer:xk,emptyState:Tk,fadeIn:Ek,projectSummary:Ck,projectSummaryTitle:Ak,projectSummarySubtitle:jk,header:Nk,headerInfo:wk,killButton:Dk,headerTitle:kk,headerActions:Rk,taskStatusBadge:Mk,taskBranch:Ok,taskBlockedBadge:Bk,btnPrimary:Lk,btnDanger:zk,btnGhost:Uk,rejectInput:Vk,tabBar:Ik,tab:Hk,active:qk,eventScroll:Gk,tabContent:Pk,noContext:Fk,overviewContent:$k,overviewDashboard:Yk,overviewHero:Kk,statusBadge:Zk,statusPending:Xk,statusAssigned:Qk,statusInProgress:Jk,statusReview:Wk,statusDone:eR,statusFailed:tR,statusWaitingInput:nR,overviewBranchPill:aR,branchLink:sR,overviewSection:iR,overviewLabel:lR,overviewValue:oR,overviewMuted:rR,overviewMarkdown:cR,envRow:uR,envDot:dR,envDotGreen:fR,envDotYellow:hR,envDotRed:mR,envDotGray:pR,depList:gR,depItem:vR,depBlocked:yR,depDone:bR,timeline:SR,timelineRow:_R,timelineKey:xR,timelineValue:TR,timelineDelta:ER,reviewNotes:CR,overviewDescription:AR,waitingMessage:jR,errorMessage:NR,eventOverflowWarning:wR,attemptSelector:DR,attemptLabel:kR,attemptButton:RR,attemptActive:MR,attemptStatus:OR,emptyCta:BR,ctaTitle:LR,ctaDescription:zR,ctaButton:UR,ctaLink:VR,projectHeader:IR,projectName:HR,projectMeta:qR,metaRow:GR,metaLabel:PR,metaValue:FR,metaPlaceholder:$R,editButton:YR,editInput:KR,editTextarea:ZR,editSelect:XR,archiveButton:QR,repoLink:JR,metaValueClickable:WR,editHint:eM,editError:tM,editInputInvalid:nM,unsavedDot:aM,metaToggle:sM,metaToggleArrow:iM,metaToggleArrowOpen:lM,progressBarContainer:oM,progressBar:rM,progressFill:cM,progressLabel:uM,metaTimestamps:dM,metaTimestamp:fM,editFieldWrapper:hM};function mM(){const{projects:n,createProject:a}=nn();return n.length===0?h.jsxs("div",{className:D.emptyCta,children:[h.jsx("div",{className:D.ctaTitle,children:"Welcome to Grackle"}),h.jsx("div",{className:D.ctaDescription,children:"Organize your work into projects and let agents tackle the tasks."}),h.jsx("button",{className:D.ctaButton,onClick:()=>{const l=window.prompt("Project name:");l!=null&&l.trim()&&a(l.trim())},children:"Create Your First Project"})]}):h.jsx("div",{className:D.emptyState,children:"Select a project or task to get started"})}function pM(n,a){const l=[];let o=n;const r=new Set;for(;o&&a.has(o)&&!r.has(o);){r.add(o);const u=a.get(o);l.unshift(u),o=u.parentTaskId||void 0}return l}const Ys={label:"Home",url:"/"};function gM(n){return n?[Ys,{label:"Settings",url:"/settings"},{label:n,url:void 0}]:[Ys,{label:"Settings",url:void 0}]}function vM(){return[Ys,{label:"New Environment",url:void 0}]}function yM(){return[Ys,{label:"New Chat",url:void 0}]}function bM(n){return[Ys,{label:`Session ${n.slice(0,8)}`,url:void 0}]}function SM(n,a){const l=a.find(o=>o.id===n);return[Ys,{label:(l==null?void 0:l.name)??"Project",url:void 0}]}function _M(n,a,l){const o=pM(n,l),r=l.get(n),u=r==null?void 0:r.projectId,d=u?a.find(g=>g.id===u):void 0,m=[Ys];d&&m.push({label:d.name,url:oo(d.id)});for(let g=0;g<o.length-1;g++)m.push({label:o[g].title,url:ms(o[g].id)});const p=o[o.length-1];return m.push({label:(p==null?void 0:p.title)??n,url:void 0}),m}function xM(){const n=yM();return h.jsxs("div",{className:D.panelContainer,children:[h.jsx(Qi,{segments:n}),h.jsx("div",{className:D.emptyState,children:"Enter a prompt below to start a new session"})]})}function z1(n){const a=[];for(const l of n){const o=a[a.length-1];l.eventType==="text"&&(o==null?void 0:o.eventType)==="text"?a[a.length-1]={...o,content:o.content+l.content}:a.push(l)}return a}function U1(n){const a=new Map;for(const u of n)if(u.raw)try{a.set(u,JSON.parse(u.raw))}catch{}const l=new Map;for(const u of n){if(u.eventType!=="tool_use")continue;const d=a.get(u);if(!(!d||typeof d.id!="string"))try{const m=JSON.parse(u.content);l.set(d.id,{tool:m.tool,args:m.args})}catch{}}const o=new Set;return n.map(u=>{if(u.eventType!=="tool_result")return u;const d=a.get(u);if(!d||typeof d.tool_use_id!="string")return u;const m=l.get(d.tool_use_id);return m?(o.add(d.tool_use_id),{...u,toolUseCtx:m}):u}).filter(u=>{if(u.eventType!=="tool_use")return!0;const d=a.get(u);return d&&typeof d.id=="string"?!o.has(d.id):!0})}function TM({sessionId:n,session:a,isActive:l,onKill:o}){return h.jsxs("div",{className:D.header,children:[h.jsxs("span",{children:["Session: ",n.slice(0,8),a&&` | ${a.runtime} | ${a.status}`]}),h.jsxs("span",{className:D.headerInfo,children:[a&&h.jsx("span",{children:a.prompt.length>60?a.prompt.slice(0,60)+"...":a.prompt}),l&&h.jsx("button",{onClick:()=>o(n),title:"Stop session",className:D.killButton,children:"×"})]})]})}function EM({eventsDropped:n}){return n<=0?h.jsx(h.Fragment,{}):h.jsxs("div",{className:D.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 CM({sessionEvents:n,session:a,eventsDropped:l,scrollRef:o}){const r=a&&["completed","failed","interrupted"].includes(a.status),u=r?`Session ${a.status} with no events recorded.`:"Waiting for events...";return h.jsxs("div",{ref:o,className:D.eventScroll,children:[n.length===0&&h.jsx("div",{className:r?D.errorMessage:D.waitingMessage,children:u}),h.jsx(EM,{eventsDropped:l}),n.map((d,m)=>h.jsx(w1,{event:d,toolUseCtx:d.toolUseCtx},`${d.sessionId}-${d.timestamp}-${m}`))]})}function AM(){const{sessionId:n}=dc(),{events:a,eventsDropped:l,sessions:o,kill:r,loadSessionEvents:u}=nn(),d=S.useRef(null),m=S.useRef(void 0),p=bM(n),g=o.find(x=>x.id===n)??void 0,v=S.useMemo(()=>{const x=n?a.filter(T=>T.sessionId===n):[];return U1(z1(x))},[a,n]);if(S.useEffect(()=>{n&&n!==m.current&&(m.current=n,u(n))},[n,u]),S.useEffect(()=>{d.current&&(d.current.scrollTop=d.current.scrollHeight)},[v.length]),!n)return h.jsx("div",{className:D.emptyState,children:"No session selected"});const b=(g==null?void 0:g.status)==="running"||(g==null?void 0:g.status)==="idle";return h.jsxs("div",{className:D.panelContainer,children:[h.jsx(Qi,{segments:p}),h.jsx(TM,{sessionId:n,session:g,isActive:b,onKill:r}),h.jsx(CM,{sessionEvents:v,session:g,eventsDropped:l,scrollRef:d})]})}const d0=220,f0=70,jM=40,NM=60,wM="hierarchy",DM="dependency";function kM(n){return S.useMemo(()=>{if(n.length===0)return{nodes:[],edges:[]};const a=new hv.graphlib.Graph({multigraph:!0});a.setDefaultEdgeLabel(()=>({})),a.setGraph({rankdir:"TB",nodesep:jM,ranksep:NM});const l=new Map(n.map(d=>[d.id,d])),o=new Map;for(const d of n)if(d.parentTaskId&&l.has(d.parentTaskId)){const m=o.get(d.parentTaskId)||[];m.push(d),o.set(d.parentTaskId,m)}for(const d of n)a.setNode(d.id,{width:d0,height:f0});const r=[];for(const d of n){if(d.parentTaskId&&l.has(d.parentTaskId)){const m=`hierarchy-${d.parentTaskId}-${d.id}`;a.setEdge(d.parentTaskId,d.id,{},m),r.push({id:m,source:d.parentTaskId,target:d.id,type:"smoothstep",data:{edgeType:wM},style:{stroke:"var(--accent-green)",strokeWidth:2},animated:!1})}for(const m of d.dependsOn)if(l.has(m)){const p=`dependency-${m}-${d.id}`;a.setEdge(m,d.id,{},p),r.push({id:p,source:m,target:d.id,type:"smoothstep",data:{edgeType:DM},style:{stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeDasharray:"6 3"},animated:!1})}}return hv.layout(a),{nodes:n.map(d=>{const m=a.node(d.id),p=o.get(d.id)||[];return{id:d.id,type:"task",position:{x:m.x-d0/2,y:m.y-f0/2},data:{task:d,childCount:p.length,doneChildCount:p.filter(g=>g.status==="complete").length,hasDependencies:d.dependsOn.length>0}}}),edges:r}},[n])}const RM="_dagContainer_js4w6_1",MM="_taskNode_js4w6_26",OM="_taskNodeBorder_js4w6_54",BM="_taskNodeContent_js4w6_60",LM="_taskNodeHeader_js4w6_70",zM="_taskNodeIcon_js4w6_77",UM="_taskNodeTitle_js4w6_82",VM="_taskNodeBadges_js4w6_90",IM="_childBadge_js4w6_95",HM="_depBadge_js4w6_107",qM="_handle_js4w6_119",GM="_emptyCta_js4w6_126",PM="_ctaDescription_js4w6_137",FM="_ctaButton_js4w6_144",fn={dagContainer:RM,taskNode:MM,taskNodeBorder:OM,taskNodeContent:BM,taskNodeHeader:LM,taskNodeIcon:zM,taskNodeTitle:UM,taskNodeBadges:VM,childBadge:IM,depBadge:HM,handle:qM,emptyCta:GM,ctaDescription:PM,ctaButton:FM};function $M({data:n}){const{task:a,childCount:l,doneChildCount:o,hasDependencies:r}=n,u=vs(a.status);return h.jsxs("div",{className:fn.taskNode,"data-task-id":a.id,"data-task-title":a.title,children:[h.jsx(mv,{type:"target",position:pv.Top,className:fn.handle}),h.jsx("div",{className:fn.taskNodeBorder,style:{backgroundColor:u.color}}),h.jsxs("div",{className:fn.taskNodeContent,children:[h.jsxs("div",{className:fn.taskNodeHeader,children:[h.jsx("span",{className:fn.taskNodeIcon,style:{color:u.color},children:u.icon}),h.jsx("span",{className:fn.taskNodeTitle,children:a.title})]}),h.jsxs("div",{className:fn.taskNodeBadges,children:[l>0&&h.jsxs("span",{className:fn.childBadge,children:[o,"/",l]}),r&&h.jsx("span",{className:fn.depBadge,children:"dep"})]})]}),h.jsx(mv,{type:"source",position:pv.Bottom,className:fn.handle})]})}const YM=Fw,KM={task:$M};function ZM({projectId:n}){const{tasks:a}=nn(),l=na(),{resolvedThemeId:o}=P0(),r=S.useMemo(()=>a.filter(v=>v.projectId===n),[a,n]),{nodes:u,edges:d}=kM(r),m=S.useMemo(()=>{const v=getComputedStyle(document.documentElement),b={};for(const[x,T]of Object.entries(YM))b[x]=v.getPropertyValue(T).trim()||"#6b7a8d";return b},[o]),p=S.useCallback((v,b)=>{l(ms(b.id))},[l]),g=S.useCallback(v=>{const b=v.data;return m[b.task.status]||m.pending},[m]);return r.length===0?h.jsxs("div",{className:fn.emptyCta,children:[h.jsx("button",{className:fn.ctaButton,onClick:()=>l($s(n)),children:"Create Task"}),h.jsx("div",{className:fn.ctaDescription,children:"Create tasks to see the dependency graph"})]}):h.jsx("div",{className:fn.dagContainer,children:h.jsxs(tx,{nodes:u,edges:d,nodeTypes:KM,onNodeClick:p,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,children:[h.jsx(nx,{variant:ax.Dots,gap:24,size:1,color:"var(--text-disabled)"}),h.jsx(sx,{showInteractive:!1}),h.jsx(ix,{nodeColor:g,maskColor:"var(--bg-overlay)",style:{background:"var(--bg-inset)"}})]})})}function XM({tasks:n,taskStatusById:a,sessionStatusByTaskId:l}){const o=new Map;for(const u of n)if(u.parentTaskId){const d=o.get(u.parentTaskId);d?d.push(u):o.set(u.parentTaskId,[u])}const r=new Map(i0.map(u=>[u,[]]));for(const u of n){const d=Th(u.status),m=u.dependsOn.length>0&&u.dependsOn.some(A=>a.get(A)!=="complete"),p=o.get(u.id)??[],g=p.length,v=p.filter(A=>A.status==="complete").length;let b;if(d==="paused"&&l){const A=l.get(u.id);A==="idle"?b="Needs input":A==="completed"&&(b="Ready to complete")}const x={task:u,isBlocked:m,childCount:g,doneChildCount:v,pausedSubBadge:b},T=r.get(d);T?T.push(x):r.get("not_started").push(x)}for(const u of r.values())u.sort((d,m)=>d.task.sortOrder-m.task.sortOrder);return i0.map(u=>{const d=vs(u);return{status:u,label:d.label,style:d,tasks:r.get(u)??[]}})}const QM="_boardContainer_1c4y1_1",JM="_column_1c4y1_17",WM="_columnHeader_1c4y1_34",e3="_columnIcon_1c4y1_47",t3="_columnLabel_1c4y1_52",n3="_columnCount_1c4y1_57",a3="_cardList_1c4y1_67",s3="_emptyPlaceholder_1c4y1_76",i3="_card_1c4y1_67",l3="_cardHeader_1c4y1_107",o3="_cardStatusIcon_1c4y1_113",r3="_cardTitle_1c4y1_119",c3="_cardBadges_1c4y1_127",u3="_badge_1c4y1_134",d3="_blockedBadge_1c4y1_146",f3="_childBadge_1c4y1_151",h3="_depBadge_1c4y1_155",m3="_parentBadge_1c4y1_159",p3="_pausedSubBadge_1c4y1_166",g3="_personaBadge_1c4y1_170",v3="_envBadge_1c4y1_174",y3="_emptyCta_1c4y1_178",b3="_ctaButton_1c4y1_188",S3="_ctaDescription_1c4y1_204",Je={boardContainer:QM,column:JM,columnHeader:WM,columnIcon:e3,columnLabel:t3,columnCount:n3,cardList:a3,emptyPlaceholder:s3,card:i3,cardHeader:l3,cardStatusIcon:o3,cardTitle:r3,cardBadges:c3,badge:u3,blockedBadge:d3,childBadge:f3,depBadge:h3,parentBadge:m3,pausedSubBadge:p3,personaBadge:g3,envBadge:v3,emptyCta:y3,ctaButton:b3,ctaDescription:S3};function _3({projectId:n}){const{tasks:a,sessions:l,personas:o,environments:r}=nn(),u=na(),d=S.useMemo(()=>a.filter(b=>b.projectId===n),[a,n]),m=S.useMemo(()=>new Map(a.map(b=>[b.id,b.status])),[a]),p=S.useMemo(()=>new Map(d.map(b=>[b.id,b])),[d]),g=S.useMemo(()=>{const b=new Map(l.map(C=>[C.id,C])),x=new Map(o.map(C=>[C.id,C])),T=new Map(r.map(C=>[C.id,C])),A=new Map,j=new Map,N=new Map;for(const C of d)if(C.latestSessionId){const B=b.get(C.latestSessionId);if(B){if(A.set(C.id,B.status),B.personaId){const R=x.get(B.personaId);R&&j.set(C.id,R.name)}if(B.environmentId){const R=T.get(B.environmentId);R&&N.set(C.id,R.displayName)}}}return{sessionStatusByTaskId:A,personaNameByTaskId:j,environmentNameByTaskId:N}},[d,l,o,r]),v=S.useMemo(()=>XM({tasks:d,taskStatusById:m,sessionStatusByTaskId:g.sessionStatusByTaskId}),[d,m,g]);return d.length===0?h.jsxs("div",{className:Je.emptyCta,"data-testid":"board-empty-cta",children:[h.jsx("button",{className:Je.ctaButton,onClick:()=>u($s(n)),children:"Create Task"}),h.jsx("div",{className:Je.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}):h.jsx("div",{className:Je.boardContainer,"data-testid":"board-container",children:v.map(b=>h.jsxs("section",{className:Je.column,"data-testid":`board-column-${b.status}`,"aria-label":`${b.label}, ${b.tasks.length} ${b.tasks.length===1?"task":"tasks"}`,children:[h.jsxs("div",{className:Je.columnHeader,children:[h.jsx("span",{className:Je.columnIcon,style:{color:b.style.color},children:b.style.icon}),h.jsx("span",{className:Je.columnLabel,children:b.label}),h.jsx("span",{className:Je.columnCount,"data-testid":`board-count-${b.status}`,children:b.tasks.length})]}),h.jsx("div",{className:Je.cardList,children:b.tasks.length===0?h.jsx("div",{className:Je.emptyPlaceholder,children:"No tasks"}):h.jsx(ys,{mode:"popLayout",children:b.tasks.map(x=>h.jsx($n.div,{layout:!0,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},children:h.jsx(x3,{boardTask:x,tasksById:p,personaName:g.personaNameByTaskId.get(x.task.id),envName:g.environmentNameByTaskId.get(x.task.id),onClick:()=>u(ms(x.task.id))})},x.task.id))})})]},b.status))})}function x3({boardTask:n,tasksById:a,personaName:l,envName:o,onClick:r}){const{task:u,isBlocked:d,childCount:m,doneChildCount:p,pausedSubBadge:g}=n,v=vs(u.status),b=u.parentTaskId?a.get(u.parentTaskId):void 0;return h.jsxs("div",{className:Je.card,tabIndex:0,role:"button","data-testid":`board-card-${u.id}`,onClick:r,onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),r())},children:[h.jsxs("div",{className:Je.cardHeader,children:[h.jsx("span",{className:Je.cardStatusIcon,style:{color:v.color},children:v.icon}),h.jsx("span",{className:Je.cardTitle,children:u.title})]}),h.jsxs("div",{className:Je.cardBadges,children:[b&&h.jsx("span",{className:`${Je.badge} ${Je.parentBadge}`,title:b.title,children:b.title}),m>0&&h.jsxs("span",{className:`${Je.badge} ${Je.childBadge}`,children:[p,"/",m]}),d&&h.jsx("span",{className:`${Je.badge} ${Je.blockedBadge}`,children:"blocked"}),u.dependsOn.length>0&&!d&&h.jsx("span",{className:`${Je.badge} ${Je.depBadge}`,children:"dep"}),g&&h.jsx("span",{className:`${Je.badge} ${Je.pausedSubBadge}`,children:g}),l&&h.jsx("span",{className:`${Je.badge} ${Je.personaBadge}`,children:l}),o&&h.jsx("span",{className:`${Je.badge} ${Je.envBadge}`,children:o})]})]})}function T3(n){const a=n.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?D.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?D.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?D.envDotRed:D.envDotGray}function h0(n){if(!n)return"";const a=new Date(n);if(isNaN(a.getTime()))return"";const o=Date.now()-a.getTime();if(o<0)return"just now";const r=Math.floor(o/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const u=Math.floor(r/60);if(u<24)return`${u}h ago`;const d=Math.floor(u/24);return d<30?`${d}d ago`:a.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function E3(){const{projectId:n}=dc(),a=na(),{tasks:l,environments:o,projects:r,archiveProject:u,updateProject:d}=nn(),[m,p]=S.useState("tasks"),[g,v]=S.useState(!1),[b,x]=S.useState(null),[T,A]=S.useState(""),[j,N]=S.useState(""),[C,B]=S.useState(!1),R=S.useRef(void 0),X=S.useRef(null),H=S.useRef(null),J=S.useRef(null),W=S.useRef(null),F=S.useRef(null),ne=S.useRef(null),ge=SM(n,r);S.useEffect(()=>{const Q=R.current;R.current=n,!(Q===void 0||Q===n)&&(b!==null||T!=="")&&(x(null),A(""))},[n,b,T]),S.useEffect(()=>{if(b===null)return;const Q=b==="name"?H.current:b==="description"?J.current:b==="repoUrl"?W.current:b==="worktreeBasePath"?ne.current:F.current;if(!Q)return;const P=window.setTimeout(()=>{Q.focus()},0);return()=>{window.clearTimeout(P)}},[b]);const U=r.find(Q=>Q.id===n),pe=l.filter(Q=>Q.projectId===n),te=pe.filter(Q=>Q.status==="complete").length,ye=pe.length,q=ye>0?Math.round(te/ye*100):0,z=100,Y=(Q,P)=>{X.current=Q,x(Q),A(P),N("")},ee=()=>{X.current=null,x(null),A(""),N("")},ke=(Q,P)=>{if(Q==="name"){const I=P.trim();if(!I)return"Name is required";if(I.length>z)return`Max ${z} characters`}if(Q==="repoUrl"){const I=P.trim();if(I&&!/^https?:\/\/.+/.test(I))return"Must be a valid http(s) URL"}return""},je=Q=>{if(!U)return;const P=T.trim(),I=ke(Q,T);if(I){N(I);return}if(Q==="name"){if(P===U.name){ee();return}d(U.id,{name:P})}else if(Q==="description"){const De=T;if(De===U.description){ee();return}d(U.id,{description:De})}else if(Q==="repoUrl"){if(P===U.repoUrl){ee();return}d(U.id,{repoUrl:P})}else if(Q==="defaultEnvironmentId"){if(T===U.defaultEnvironmentId){ee();return}d(U.id,{defaultEnvironmentId:T})}else{if(P===U.worktreeBasePath){ee();return}d(U.id,{worktreeBasePath:P})}ee()},Pe=(Q,P)=>{Q.key==="Escape"?ee():Q.key==="Enter"&&P!=="description"&&je(P)},we=Q=>U?Q==="name"?T.trim()!==U.name:Q==="description"?T!==U.description:Q==="repoUrl"?T.trim()!==U.repoUrl:Q==="defaultEnvironmentId"?T!==U.defaultEnvironmentId:T.trim()!==U.worktreeBasePath:!1,_e=o.find(Q=>Q.id===(U==null?void 0:U.defaultEnvironmentId)),Ce=b==="description"?"Tab to save · Esc to cancel":"Enter to save · Esc to cancel";return h.jsxs("div",{className:D.panelContainer,children:[h.jsx(Qi,{segments:ge}),h.jsxs("div",{className:D.projectHeader,children:[h.jsx("span",{className:D.projectName,"data-testid":"project-name",children:b==="name"?h.jsxs("div",{className:D.editFieldWrapper,children:[h.jsx("input",{ref:H,className:`${D.editInput} ${j?D.editInputInvalid:""}`,value:T,onChange:Q=>{A(Q.target.value),N("")},onBlur:Q=>{if(X.current==="name"){X.current=null;return}Q.relatedTarget instanceof HTMLElement&&Q.relatedTarget.dataset.editAction==="name"||je("name")},onKeyDown:Q=>Pe(Q,"name"),maxLength:z,"aria-label":"Project name","data-testid":"edit-name-input"}),we("name")&&h.jsx("span",{className:D.unsavedDot,title:"Unsaved changes"}),j&&h.jsx("span",{className:D.editError,"data-testid":"edit-error",children:j}),h.jsx("span",{className:D.editHint,children:Ce})]}):h.jsxs("button",{type:"button",className:D.metaValueClickable,onClick:()=>Y("name",(U==null?void 0:U.name)||""),title:"Click to edit name","aria-label":`Edit project name: ${(U==null?void 0:U.name)||n}`,"data-testid":"edit-name-button",children:[(U==null?void 0:U.name)||n,h.jsx("span",{className:D.editButton,"aria-hidden":"true",children:"✏️"})]})}),h.jsx("button",{className:D.archiveButton,onClick:()=>v(!0),title:"Archive project","data-testid":"archive-project-button",children:"Archive"})]}),h.jsxs("button",{className:D.metaToggle,onClick:()=>B(!C),"aria-expanded":!C,"aria-controls":"project-meta-panel","data-testid":"meta-toggle",children:[h.jsx("span",{className:`${D.metaToggleArrow} ${C?"":D.metaToggleArrowOpen}`,children:"▶"}),"Details"]}),!C&&h.jsxs("div",{className:D.projectMeta,"data-testid":"project-meta",id:"project-meta-panel",children:[h.jsxs("div",{className:D.metaRow,children:[h.jsx("span",{className:D.metaLabel,children:"Description"}),h.jsx("div",{className:D.metaValue,children:b==="description"?h.jsxs("div",{className:D.editFieldWrapper,children:[h.jsx("textarea",{ref:J,className:D.editTextarea,value:T,onChange:Q=>{A(Q.target.value),N("")},onBlur:Q=>{if(X.current==="description"){X.current=null;return}Q.relatedTarget instanceof HTMLElement&&Q.relatedTarget.dataset.editAction==="description"||je("description")},onKeyDown:Q=>Pe(Q,"description"),title:"Project description","aria-label":"Project description","data-testid":"edit-description-input"}),we("description")&&h.jsx("span",{className:D.unsavedDot,title:"Unsaved changes"}),h.jsx("span",{className:D.editHint,children:Ce})]}):h.jsxs("button",{type:"button",className:D.metaValueClickable,onClick:()=>Y("description",(U==null?void 0:U.description)||""),title:"Click to edit description","aria-label":"Edit project description","data-testid":"edit-description-button",children:[U!=null&&U.description?h.jsx("span",{className:D.overviewMarkdown,children:h.jsx(kf,{remarkPlugins:[Rf],children:U.description})}):h.jsx("span",{className:D.metaPlaceholder,children:"No description"}),h.jsx("span",{className:D.editButton,"aria-hidden":"true",children:"✏️"})]})})]}),h.jsxs("div",{className:D.metaRow,children:[h.jsx("span",{className:D.metaLabel,children:"Repository"}),h.jsx("div",{className:D.metaValue,children:b==="repoUrl"?h.jsxs("div",{className:D.editFieldWrapper,children:[h.jsx("input",{ref:W,className:`${D.editInput} ${j?D.editInputInvalid:""}`,value:T,onChange:Q=>{A(Q.target.value),N("")},onBlur:Q=>{if(X.current==="repoUrl"){X.current=null;return}Q.relatedTarget instanceof HTMLElement&&Q.relatedTarget.dataset.editAction==="repoUrl"||je("repoUrl")},onKeyDown:Q=>Pe(Q,"repoUrl"),placeholder:"https://github.com/...","aria-label":"Project repository URL","data-testid":"edit-repo-input"}),we("repoUrl")&&h.jsx("span",{className:D.unsavedDot,title:"Unsaved changes"}),j&&h.jsx("span",{className:D.editError,"data-testid":"edit-error",children:j}),h.jsx("span",{className:D.editHint,children:Ce})]}):h.jsxs("button",{type:"button",className:D.metaValueClickable,onClick:Q=>{Q.preventDefault(),Y("repoUrl",(U==null?void 0:U.repoUrl)||"")},title:"Click to edit repository URL","aria-label":"Edit project repository URL","data-testid":"edit-repo-button",children:[U!=null&&U.repoUrl&&/^https?:\/\//i.test(U.repoUrl)?h.jsx("a",{className:D.repoLink,href:U.repoUrl,target:"_blank",rel:"noopener noreferrer",onClick:Q=>Q.stopPropagation(),children:U.repoUrl}):U!=null&&U.repoUrl?h.jsx("span",{children:U.repoUrl}):h.jsx("span",{className:D.metaPlaceholder,children:"No repository"}),h.jsx("span",{className:D.editButton,"aria-hidden":"true",children:"✏️"})]})})]}),h.jsxs("div",{className:D.metaRow,children:[h.jsx("span",{className:D.metaLabel,children:"Environment"}),h.jsx("div",{className:D.metaValue,children:b==="defaultEnvironmentId"?h.jsxs("select",{ref:F,className:D.editSelect,value:T,onChange:Q=>{X.current=null,A(Q.target.value);const P=Q.target.value;U&&P!==U.defaultEnvironmentId&&d(U.id,{defaultEnvironmentId:P}),ee()},onBlur:Q=>{if(X.current==="defaultEnvironmentId"){X.current=null;return}Q.relatedTarget instanceof HTMLElement&&Q.relatedTarget.dataset.editAction==="defaultEnvironmentId"||ee()},title:"Default environment","aria-label":"Project default environment","data-testid":"edit-env-select",children:[h.jsx("option",{value:"",children:"None"}),o.map(Q=>h.jsx("option",{value:Q.id,children:Q.displayName},Q.id))]}):h.jsxs("button",{type:"button",className:D.metaValueClickable,onClick:()=>Y("defaultEnvironmentId",(U==null?void 0:U.defaultEnvironmentId)||""),title:"Click to change default environment","aria-label":"Edit project default environment","data-testid":"edit-env-button",children:[_e?h.jsxs("span",{className:D.envRow,children:[h.jsx("span",{className:`${D.envDot} ${T3(_e.status)}`}),_e.displayName]}):h.jsx("span",{className:D.metaPlaceholder,children:(U==null?void 0:U.defaultEnvironmentId)||"No default environment"}),h.jsx("span",{className:D.editButton,"aria-hidden":"true",children:"✏️"})]})})]}),h.jsxs("div",{className:D.metaRow,children:[h.jsx("span",{className:D.metaLabel,children:"Worktree Base"}),h.jsx("div",{className:D.metaValue,children:b==="worktreeBasePath"?h.jsxs("div",{className:D.editFieldWrapper,children:[h.jsx("input",{ref:ne,className:`${D.editInput} ${j?D.editInputInvalid:""}`,value:T,onChange:Q=>{A(Q.target.value),N("")},onBlur:Q=>{if(X.current==="worktreeBasePath"){X.current=null;return}Q.relatedTarget instanceof HTMLElement&&Q.relatedTarget.dataset.editAction==="worktreeBasePath"||je("worktreeBasePath")},onKeyDown:Q=>Pe(Q,"worktreeBasePath"),placeholder:"/workspaces/my-repo","aria-label":"Worktree base path","data-testid":"edit-worktree-base-path-input"}),we("worktreeBasePath")&&h.jsx("span",{className:D.unsavedDot,title:"Unsaved changes"}),j&&h.jsx("span",{className:D.editError,"data-testid":"edit-error",children:j}),h.jsx("span",{className:D.editHint,children:Ce})]}):h.jsxs("button",{type:"button",className:D.metaValueClickable,onClick:()=>Y("worktreeBasePath",(U==null?void 0:U.worktreeBasePath)||""),title:"Click to edit worktree base path","aria-label":"Edit worktree base path","data-testid":"edit-worktree-base-path-button",children:[U!=null&&U.worktreeBasePath?h.jsx("span",{children:U.worktreeBasePath}):h.jsx("span",{className:D.metaPlaceholder,children:"Default (server default)"}),h.jsx("span",{className:D.editButton,"aria-hidden":"true",children:"✏️"})]})})]}),U&&h.jsxs("div",{className:D.metaTimestamps,children:[h.jsxs("span",{className:D.metaTimestamp,children:["Created ",h0(U.createdAt)]}),U.updatedAt&&U.updatedAt!==U.createdAt&&h.jsxs("span",{className:D.metaTimestamp,children:["· Updated ",h0(U.updatedAt)]})]})]}),ye>0&&h.jsxs("div",{className:D.progressBarContainer,"data-testid":"progress-bar",children:[h.jsx("div",{className:D.progressBar,children:h.jsx("div",{className:D.progressFill,style:{width:`${q}%`}})}),h.jsxs("span",{className:D.progressLabel,children:[te,"/",ye]})]}),h.jsxs("div",{className:D.tabBar,role:"tablist","aria-label":"Project view",children:[h.jsx("button",{role:"tab","aria-selected":m==="graph",className:`${D.tab} ${m==="graph"?D.active:""}`,onClick:()=>p("graph"),children:"Graph"}),h.jsx("button",{role:"tab","aria-selected":m==="board",className:`${D.tab} ${m==="board"?D.active:""}`,onClick:()=>p("board"),"data-testid":"board-tab",children:"Board"}),h.jsx("button",{role:"tab","aria-selected":m==="tasks",className:`${D.tab} ${m==="tasks"?D.active:""}`,onClick:()=>p("tasks"),children:"Tasks"})]}),m==="tasks"&&ye>0&&h.jsxs("div",{className:D.projectSummary,children:[h.jsx("span",{className:D.projectSummaryTitle,children:`${te}/${ye} tasks complete`}),h.jsx("span",{className:D.projectSummarySubtitle,children:"Select a task or click + to create one"})]}),m==="tasks"&&ye===0&&h.jsxs("div",{className:D.emptyCta,children:[h.jsx("button",{className:D.ctaButton,onClick:()=>a($s(n)),children:"Create Task"}),h.jsx("div",{className:D.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}),m==="board"&&h.jsx(_3,{projectId:n}),m==="graph"&&h.jsx(ZM,{projectId:n}),h.jsx(Sc,{isOpen:g,title:"Archive Project?",description:"This will hide the project from the sidebar. Tasks will not be deleted.",confirmLabel:"Archive",onConfirm:()=>{U&&(u(U.id),a("/",{replace:!0})),v(!1)},onCancel:()=>v(!1)})]})}const C3="_container_cddyd_1",A3="_header_cddyd_8",j3="_headerTitle_cddyd_35",N3="_badge_cddyd_44",w3="_headerActions_cddyd_54",D3="_body_cddyd_61",k3="_formContent_cddyd_73",R3="_section_cddyd_85",M3="_label_cddyd_91",O3="_titleInput_cddyd_98",B3="_descriptionTextarea_cddyd_131",L3="_parentContext_cddyd_167",z3="_parentLabel_cddyd_175",U3="_parentName_cddyd_182",V3="_depList_cddyd_220",I3="_depItem_cddyd_226",H3="_depItemSelected_cddyd_248",q3="_noDeps_cddyd_252",G3="_btnPrimary_cddyd_258",P3="_btnGhost_cddyd_289",gt={container:C3,header:A3,headerTitle:j3,badge:N3,headerActions:w3,body:D3,formContent:k3,section:R3,label:M3,titleInput:O3,descriptionTextarea:B3,parentContext:L3,parentLabel:z3,parentName:U3,depList:V3,depItem:I3,depItemSelected:H3,noDeps:q3,btnPrimary:G3,btnGhost:P3};function V1({mode:n,taskId:a,projectId:l,parentTaskId:o}){const{tasks:r,createTask:u,updateTask:d}=nn(),{showToast:m}=go(),p=na(),g=n==="edit",v=g&&a?r.find(U=>U.id===a):void 0,b=g?(v==null?void 0:v.projectId)??"":l??"",x=g?(v==null?void 0:v.parentTaskId)??"":o??"",T=x?r.find(U=>U.id===x):void 0,[A,j]=S.useState((v==null?void 0:v.title)??""),[N,C]=S.useState((v==null?void 0:v.description)??""),[B,R]=S.useState((v==null?void 0:v.dependsOn)??[]),X=S.useRef(!1);S.useEffect(()=>{g&&v&&!X.current&&(X.current=!0,j(v.title),C(v.description),R(v.dependsOn))},[g,v]);const H=r.filter(U=>U.projectId===b&&(!g||U.id!==a)&&U.id!==x),J=A.trim().length>0&&(!g||v!==void 0)&&(g||b.length>0),W=U=>{R(pe=>pe.includes(U)?pe.filter(te=>te!==U):[...pe,U])},F=()=>{J&&(g&&v===void 0||(g&&a?(d(a,A.trim(),N,B),m("Task updated","success"),p(ms(a),{replace:!0})):(u(b,A.trim(),N,B.length>0?B:void 0,x||void 0),m("Task created","success"),p(oo(b),{replace:!0}))))},ne=()=>{p(g&&a?ms(a):oo(b))},ge=g?"edit task":x?"child task":"new task";return h.jsxs("div",{className:gt.container,children:[h.jsxs("div",{className:gt.header,children:[h.jsxs("div",{className:gt.headerTitle,children:[h.jsx("span",{className:gt.badge,children:ge}),T&&h.jsxs("span",{className:gt.parentContext,children:[h.jsx("span",{className:gt.parentLabel,children:"Child of"}),h.jsx("span",{className:gt.parentName,children:T.title})]})]}),h.jsxs("div",{className:gt.headerActions,children:[h.jsx("button",{onClick:F,disabled:!J,className:gt.btnPrimary,"data-testid":"task-edit-save",children:g?"Save Changes":"Create"}),h.jsx("button",{onClick:ne,className:gt.btnGhost,children:"Cancel"})]})]}),h.jsx("div",{className:gt.body,children:h.jsxs("div",{className:gt.formContent,children:[h.jsxs("div",{className:gt.section,children:[h.jsx("label",{className:gt.label,htmlFor:"task-edit-title",children:"Title"}),h.jsx("input",{id:"task-edit-title",type:"text",value:A,onChange:U=>j(U.target.value),placeholder:"Task title...",autoFocus:!0,className:gt.titleInput,"data-testid":"task-edit-title",onKeyDown:U=>{U.key==="Enter"&&J&&F()}})]}),h.jsxs("div",{className:gt.section,children:[h.jsx("label",{className:gt.label,htmlFor:"task-edit-description",children:"Description"}),h.jsx("textarea",{id:"task-edit-description",value:N,onChange:U=>C(U.target.value),placeholder:"Describe the task... (markdown supported)",className:gt.descriptionTextarea,"data-testid":"task-edit-description",rows:8})]}),h.jsxs("div",{className:gt.section,children:[h.jsx("div",{className:gt.label,children:"Dependencies"}),H.length===0?h.jsx("div",{className:gt.noDeps,children:"No other tasks in this project"}):h.jsx("div",{className:gt.depList,children:H.map(U=>{const pe=B.includes(U.id);return h.jsxs("label",{className:`${gt.depItem} ${pe?gt.depItemSelected:""}`,"data-testid":`dep-option-${U.id}`,children:[h.jsx("input",{type:"checkbox",checked:pe,onChange:()=>W(U.id)}),U.title,h.jsxs("span",{style:{opacity:.5,fontSize:"11px",marginLeft:"4px"},children:["(",U.status,")"]})]},U.id)})})]})]})})]})}function F3(){const[n]=If(),a=n.get("project")??"",l=n.get("parent")??void 0;return a?h.jsx(V1,{mode:"new",projectId:a,parentTaskId:l}):h.jsx(Pr,{to:"/",replace:!0})}function $3(){const{taskId:n}=dc();return h.jsx(V1,{mode:"edit",taskId:n})}const Y3="_container_1pqxm_1",K3="_emptyState_1pqxm_8",Z3="_card_1pqxm_14",X3="_cardHeader_1pqxm_34",Q3="_categoryBadge_1pqxm_46",J3="_findingTitle_1pqxm_54",W3="_findingDate_1pqxm_60",e5="_findingContent_1pqxm_72",t5="_tags_1pqxm_78",n5="_tag_1pqxm_78",ra={container:Y3,emptyState:K3,card:Z3,cardHeader:X3,categoryBadge:Q3,findingTitle:J3,findingDate:W3,findingContent:e5,tags:t5,tag:n5};function a5(n){const a=new Date(n),l=new Date,o=l.getTime()-a.getTime(),r=Math.floor(o/1e3),u=Math.floor(r/60),d=Math.floor(u/60),m=Math.floor(d/24);if(r<60)return"just now";if(u<60)return`${u}m ago`;if(d<24)return`${d}h ago`;if(m===1)return"yesterday";if(m<7)return`${m} days ago`;const p=a.getFullYear()===l.getFullYear(),g=a.toLocaleString("en-US",{month:"short"}),v=a.getDate();return p?`${g} ${v}`:`${g} ${v} ${a.getFullYear()}`}const m0={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 s5({projectId:n}){const{findings:a}=nn(),l=a.filter(o=>o.projectId===n);return l.length===0?h.jsx("div",{className:ra.emptyState,children:"No findings yet. Agents will post discoveries here."}):h.jsx("div",{className:ra.container,children:l.map((o,r)=>{const u=m0[o.category]||m0.general;return h.jsxs($n.div,{className:ra.card,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:r*.05,duration:.2},children:[h.jsxs("div",{className:ra.cardHeader,children:[h.jsx("span",{className:ra.categoryBadge,style:{background:u.bg,color:u.text},children:o.category}),h.jsx("span",{className:ra.findingTitle,children:o.title}),h.jsx("span",{className:ra.findingDate,title:o.createdAt,children:a5(o.createdAt)})]}),h.jsx("div",{className:ra.findingContent,children:o.content.length>300?o.content.slice(0,300)+"...":o.content}),o.tags.length>0&&h.jsx("div",{className:ra.tags,children:o.tags.map(d=>h.jsx("span",{className:ra.tag,style:{color:u.text,textShadow:`0 0 8px ${u.text}`},children:d},d))})]},o.id)})})}function qr(n){if(!n)return"—";const a=new Date(n);return isNaN(a.getTime())?"—":a.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})}function Qd(n,a){if(!n||!a)return;const l=new Date(a).getTime()-new Date(n).getTime();if(isNaN(l)||l<0)return;const o=Math.floor(l/6e4),r=Math.floor(l%6e4/1e3);if(o===0)return`${r}s`;const u=Math.floor(o/60),d=o%60;return u===0?`${o}m ${r}s`:`${u}h ${d}m`}function i5(n){const a=n.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?D.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?D.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?D.envDotRed:D.envDotGray}function l5({status:n}){const a=vs(n),l=qw(n);return h.jsx("span",{className:`${D.statusBadge} ${D[l]??D.statusPending}`,children:a.label})}function o5({task:n,tasksById:a,environments:l,projects:o,taskSessions:r}){const u=r.length>0?r[r.length-1]:void 0,d=(u==null?void 0:u.environmentId)??"",m=d?l.find(v=>v.id===d):void 0,p=o.find(v=>v.id===n.projectId),g=n.branch&&(p!=null&&p.repoUrl)?`${p.repoUrl.replace(/\/$/,"")}/tree/${encodeURIComponent(n.branch)}`:void 0;return h.jsxs("div",{className:D.overviewDashboard,children:[h.jsxs("div",{className:D.overviewHero,children:[h.jsx(l5,{status:n.status}),n.branch&&h.jsx("span",{className:D.overviewBranchPill,children:g?h.jsxs("a",{href:g,target:"_blank",rel:"noreferrer noopener",className:D.branchLink,children:["🔗"," ",n.branch]}):h.jsxs("span",{children:["🔗"," ",n.branch]})})]}),typeof n.description=="string"&&n.description&&h.jsxs("div",{className:D.overviewSection,children:[h.jsx("div",{className:D.overviewLabel,children:"Description"}),h.jsx("div",{className:D.overviewMarkdown,children:h.jsx(kf,{remarkPlugins:[Rf],children:n.description})})]}),d&&h.jsxs("div",{className:D.overviewSection,children:[h.jsx("div",{className:D.overviewLabel,children:"Environment"}),h.jsxs("div",{className:D.envRow,children:[m&&h.jsx("span",{className:`${D.envDot} ${i5(m.status)}`,title:m.status,"aria-label":`Status: ${m.status}`,role:"img"}),h.jsx("span",{className:D.overviewValue,children:(m==null?void 0:m.displayName)??d})]})]}),h.jsxs("div",{className:D.overviewSection,children:[h.jsx("div",{className:D.overviewLabel,children:"Dependencies"}),n.dependsOn.length===0?h.jsx("div",{className:D.overviewMuted,children:"None"}):h.jsx("div",{className:D.depList,children:n.dependsOn.map(v=>{const b=a.get(v),x=(b==null?void 0:b.status)==="complete";return h.jsxs("div",{className:`${D.depItem} ${x?D.depDone:D.depBlocked}`,children:[h.jsx("span",{children:x?"✓":"○"}),h.jsx("span",{children:(b==null?void 0:b.title)??v})]},v)})})]}),h.jsxs("div",{className:D.overviewSection,children:[h.jsx("div",{className:D.overviewLabel,children:"Timeline"}),h.jsxs("div",{className:D.timeline,children:[n.createdAt&&h.jsxs("div",{className:D.timelineRow,children:[h.jsx("span",{className:D.timelineKey,children:"Created"}),h.jsx("span",{className:D.timelineValue,children:qr(n.createdAt)})]}),n.assignedAt&&(()=>{const v=Qd(n.createdAt,n.assignedAt);return h.jsxs("div",{className:D.timelineRow,children:[h.jsx("span",{className:D.timelineKey,children:"Assigned"}),h.jsx("span",{className:D.timelineValue,children:qr(n.assignedAt)}),v!==void 0&&h.jsx("span",{className:D.timelineDelta,children:v})]})})(),n.startedAt&&(()=>{const v=Qd(n.assignedAt??n.createdAt,n.startedAt);return h.jsxs("div",{className:D.timelineRow,children:[h.jsx("span",{className:D.timelineKey,children:"Started"}),h.jsx("span",{className:D.timelineValue,children:qr(n.startedAt)}),v!==void 0&&h.jsx("span",{className:D.timelineDelta,children:v})]})})(),n.completedAt&&(()=>{const v=Qd(n.startedAt,n.completedAt);return h.jsxs("div",{className:D.timelineRow,children:[h.jsx("span",{className:D.timelineKey,children:"Completed"}),h.jsx("span",{className:D.timelineValue,children:qr(n.completedAt)}),v!==void 0&&h.jsx("span",{className:D.timelineDelta,children:v})]})})(),!n.createdAt&&!n.assignedAt&&!n.startedAt&&!n.completedAt&&h.jsx("div",{className:D.overviewMuted,children:"No timing data"})]})]}),n.reviewNotes&&h.jsxs("div",{className:D.overviewSection,children:[h.jsx("div",{className:D.overviewLabel,children:"Review Notes"}),h.jsx("div",{className:D.reviewNotes,children:n.reviewNotes})]})]})}function r5({eventsDropped:n}){return n<=0?h.jsx(h.Fragment,{}):h.jsxs("div",{className:D.eventOverflowWarning,role:"alert",children:["⚠ ",n.toLocaleString()," older event",n===1?"":"s"," were dropped — only the most recent 5,000 are shown."]})}function c5({task:n,sessionId:a,isBlocked:l,onStart:o,onResume:r,onStop:u,onComplete:d,onDelete:m,onEdit:p}){if(n.status==="not_started")return l?h.jsxs("div",{className:D.headerActions,children:[h.jsx("button",{onClick:p,className:D.btnGhost,children:"Edit"}),h.jsx("button",{onClick:m,className:D.btnDanger,children:"Delete"})]}):h.jsxs("div",{className:D.headerActions,children:[h.jsx("button",{onClick:o,className:D.btnPrimary,children:"Start"}),h.jsx("button",{onClick:p,className:D.btnGhost,children:"Edit"}),h.jsx("button",{onClick:m,className:D.btnDanger,children:"Delete"})]});if(n.status==="working")return h.jsx("div",{className:D.headerActions,children:h.jsx("button",{onClick:u,disabled:!a,className:D.btnDanger,children:"Stop"})});if(n.status==="paused")return h.jsxs("div",{className:D.headerActions,children:[h.jsx("button",{onClick:d,className:D.btnPrimary,children:"Complete"}),h.jsx("button",{onClick:r,className:D.btnGhost,children:"Resume"}),h.jsx("button",{onClick:m,className:D.btnDanger,children:"Delete"})]});if(n.status==="complete")return h.jsx("div",{className:D.headerActions,children:h.jsx("button",{onClick:m,className:D.btnDanger,children:"Delete"})});if(n.status==="failed")return h.jsxs("div",{className:D.headerActions,children:[h.jsx("button",{onClick:o,className:D.btnPrimary,children:"Retry"}),h.jsx("button",{onClick:m,className:D.btnDanger,children:"Delete"})]})}function u5({taskSessions:n,selectedSessionId:a,onSelect:l}){if(!(n.length<2))return h.jsxs("div",{className:D.attemptSelector,"data-testid":"attempt-selector",children:[h.jsx("span",{className:D.attemptLabel,children:"Attempts:"}),n.map((o,r)=>{const u=o.id===a,d=o.status==="completed"?"✓":o.status==="failed"?"✗":o.status==="running"||o.status==="idle"?"●":"";return h.jsxs("button",{className:`${D.attemptButton} ${u?D.attemptActive:""}`,onClick:()=>l(o.id),title:`Attempt #${r+1} — ${o.status}`,"aria-label":`Attempt #${r+1}, ${o.status}`,"aria-pressed":u,"data-testid":`attempt-${r+1}`,children:["#",r+1,d&&h.jsx("span",{className:D.attemptStatus,children:d})]},o.id)})]})}function Jd(){const{taskId:n}=dc(),a=hn(),l=na(),{events:o,eventsDropped:r,tasks:u,environments:d,loadSessionEvents:m,loadFindings:p,kill:g,startTask:v,resumeTask:b,completeTask:x,deleteTask:T,projects:A,taskSessions:j,loadTaskSessions:N}=nn(),C=S.useRef(null),B=S.useRef(void 0),R=S.useRef(void 0),X=S.useRef(void 0),H=S.useRef(void 0),J=S.useRef(void 0),W=a.pathname.endsWith("/stream")?"stream":a.pathname.endsWith("/findings")?"findings":"overview",[F,ne]=S.useState(W),[ge,U]=S.useState(!1),[pe,te]=S.useState(void 0),ye=S.useRef(W);W!==ye.current&&(ye.current=W,W!==F&&ne(W));const q=u.find(P=>P.id===n),z=(q==null?void 0:q.projectId)||void 0,Y=q?j[q.id]??[]:[];let ee;pe&&Y.some(P=>P.id===pe)?ee=pe:ee=(q==null?void 0:q.latestSessionId)||void 0;const ke=()=>{U(!0)},je=()=>{q&&(T(q.id),U(!1),l(oo(q.projectId),{replace:!0}))};if((q==null?void 0:q.id)!==R.current&&(R.current=q==null?void 0:q.id,pe!==void 0&&te(void 0)),S.useEffect(()=>{if(!(q!=null&&q.id))return;const P=q.id!==H.current,I=q.latestSessionId!==J.current;(P||I)&&(H.current=q.id,J.current=q.latestSessionId,N(q.id))},[q==null?void 0:q.id,q==null?void 0:q.latestSessionId,N]),(q==null?void 0:q.status)!==X.current){X.current=q==null?void 0:q.status;const P=(q==null?void 0:q.status)==="not_started"?"overview":(q==null?void 0:q.status)==="working"||(q==null?void 0:q.status)==="paused"?"stream":(q==null?void 0:q.status)==="complete"?"findings":void 0;P&&P!==F&&ne(P)}const Pe=S.useMemo(()=>new Map(u.map(P=>[P.id,P])),[u]),we=S.useMemo(()=>{const P=ee?o.filter(I=>I.sessionId===ee):[];return U1(z1(P))},[o,ee]),_e=q?q.dependsOn.some(P=>{const I=Pe.get(P);return I!==void 0&&I.status!=="complete"}):!1,Ce=S.useMemo(()=>_M(n,A,Pe),[n,A,Pe]);S.useEffect(()=>{ee&&ee!==B.current&&(B.current=ee,m(ee))},[ee,m]),S.useEffect(()=>{F==="findings"&&z&&p(z)},[F,z,p]),S.useEffect(()=>{C.current&&F==="stream"&&(C.current.scrollTop=C.current.scrollHeight)},[we.length,F]);const Q=P=>{ne(P),l(ms(n,P==="overview"?void 0:P))};return h.jsxs("div",{className:D.panelContainer,children:[h.jsx(Qi,{segments:Ce}),h.jsxs("div",{className:D.header,children:[h.jsxs("span",{className:D.headerTitle,children:[h.jsx("span",{"data-testid":"task-title",children:(q==null?void 0:q.title)||n}),q&&h.jsx("span",{className:D.taskStatusBadge,"data-testid":"task-status",children:q.status}),(q==null?void 0:q.branch)&&h.jsx("span",{className:D.taskBranch,children:q.branch}),_e&&h.jsx("span",{className:D.taskBlockedBadge,children:"blocked"})]}),q&&h.jsx(c5,{task:q,sessionId:ee,isBlocked:_e,onStart:()=>v(q.id),onResume:()=>b(q.id),onStop:()=>ee&&g(ee),onComplete:()=>x(q.id),onDelete:ke,onEdit:()=>l(GT(q.id))})]}),h.jsxs("div",{className:D.tabBar,role:"tablist","aria-label":"Task view",children:[h.jsx("button",{role:"tab","aria-selected":F==="overview",className:`${D.tab} ${F==="overview"?D.active:""}`,onClick:()=>Q("overview"),children:"Overview"}),h.jsx("button",{role:"tab","aria-selected":F==="stream",className:`${D.tab} ${F==="stream"?D.active:""}`,onClick:()=>Q("stream"),children:"Stream"}),h.jsx("button",{role:"tab","aria-selected":F==="findings",className:`${D.tab} ${F==="findings"?D.active:""}`,onClick:()=>Q("findings"),children:"Findings"})]}),h.jsxs(ys,{mode:"wait",children:[F==="overview"&&h.jsx($n.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:D.overviewContent,children:q?h.jsx(o5,{task:q,tasksById:Pe,environments:d,projects:A,taskSessions:Y}):h.jsx("div",{className:D.waitingMessage,children:"No additional details"})},"overview"),F==="stream"&&h.jsxs($n.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:[h.jsx(u5,{taskSessions:Y,selectedSessionId:ee,onSelect:P=>te(P)}),h.jsxs("div",{ref:C,className:D.eventScroll,children:[!ee&&q&&h.jsxs("div",{className:D.emptyCta,children:[h.jsx("button",{className:D.ctaButton,onClick:()=>v(q.id),children:"Start Task"}),h.jsx("div",{className:D.ctaDescription,children:"Click to begin agent execution"})]}),ee&&we.length===0&&h.jsx("div",{className:D.waitingMessage,children:"Waiting for events..."}),h.jsx(r5,{eventsDropped:r}),we.map((P,I)=>h.jsx(w1,{event:P,toolUseCtx:P.toolUseCtx},`${P.sessionId}-${P.timestamp}-${I}`))]})]},"stream"),F==="findings"&&h.jsx($n.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:D.tabContent,children:z?h.jsx(s5,{projectId:z}):h.jsx("div",{className:D.noContext,children:"Navigate to a task within a project to view findings"})},"findings")]}),q&&h.jsx(Sc,{isOpen:ge,title:"Delete Task?",description:`"${q.title}" will be permanently removed.`,onConfirm:je,onCancel:()=>U(!1)})]})}function d5(){const n=vM();return h.jsxs("div",{className:D.panelContainer,children:[h.jsx(Qi,{segments:n}),h.jsx("div",{className:D.emptyState,children:"Configure the new environment below"})]})}const f5="_layout_1sbe4_1",h5="_content_1sbe4_8",p0={layout:f5,content:h5},m5={environments:"Environments",credentials:"Credentials",personas:"Personas",appearance:"Appearance",about:"About"};function p5(){const a=hn().pathname.replace(/^\/settings\/?/,"").split("/")[0],l=m5[a],o=gM(l);return h.jsxs("div",{className:p0.layout,children:[h.jsx(Qi,{segments:o}),h.jsx("div",{className:p0.content,children:h.jsx(k0,{})})]})}const g5="_nav_13n0b_1",v5="_tab_13n0b_44",y5="_tabIcon_13n0b_82",b5="_tabActive_13n0b_88",Gr={nav:g5,tab:v5,tabIcon:y5,tabActive:b5},Oa=[{path:"environments",label:"Environments",icon:"🖥️"},{path:"credentials",label:"Credentials",icon:"🔑"},{path:"personas",label:"Personas",icon:"👤"},{path:"appearance",label:"Appearance",icon:"🎨"},{path:"about",label:"About",icon:"ℹ️"}];function S5(){var d;const n=hn(),a=na(),l=S.useRef(null),o=((d=Oa.find(m=>n.pathname===`${qi}/${m.path}`))==null?void 0:d.path)??Oa[0].path,r=S.useCallback(m=>{a(`${qi}/${m}`)},[a]),u=S.useCallback(m=>{var T,A;const p=(T=l.current)==null?void 0:T.querySelectorAll('[role="tab"]');if(!p)return;const g=Array.from(p).findIndex(j=>j===document.activeElement),v=g>=0?g:Oa.findIndex(j=>j.path===o);let b=v;if(m.key==="ArrowDown")m.preventDefault(),b=(v+1)%Oa.length;else if(m.key==="ArrowUp")m.preventDefault(),b=(v-1+Oa.length)%Oa.length;else if(m.key==="Home")m.preventDefault(),b=0;else if(m.key==="End")m.preventDefault(),b=Oa.length-1;else return;const x=Oa[b].path;a(`${qi}/${x}`),(A=p[b])==null||A.focus()},[o,a]);return h.jsx("nav",{className:Gr.nav,ref:l,role:"tablist","aria-orientation":"vertical","aria-label":"Settings",onKeyDown:u,children:Oa.map(m=>{const p=m.path===o;return h.jsxs("button",{role:"tab",type:"button","aria-selected":p,tabIndex:p?0:-1,className:`${Gr.tab} ${p?Gr.tabActive:""}`,onClick:()=>r(m.path),children:[h.jsx("span",{className:Gr.tabIcon,"aria-hidden":"true",children:m.icon}),m.label]},m.path)})})}const _5="_container_1nk8c_1",x5="_header_1nk8c_5",T5="_headerLabel_1nk8c_12",E5="_addButton_1nk8c_20",C5="_envRow_1nk8c_55",A5="_targeted_1nk8c_69",j5="_expanded_1nk8c_72",N5="_statusDot_1nk8c_76",w5="_pulse_1nk8c_79",D5="_envName_1nk8c_83",k5="_envActions_1nk8c_87",R5="_idleLabel_1nk8c_94",M5="_newChatButton_1nk8c_99",O5="_envActionsRow_1nk8c_126",B5="_connectButton_1nk8c_134",L5="_stopButton_1nk8c_160",z5="_deleteButton_1nk8c_186",U5="_provisionMessage_1nk8c_213",V5="_errorMessage_1nk8c_220",I5="_sessionRow_1nk8c_227",H5="_selected_1nk8c_243",q5="_sessionDot_1nk8c_248",G5="_sessionSummaryRow_1nk8c_252",P5="_sessionExpandArrow_1nk8c_272",F5="_sessionSummaryText_1nk8c_283",$5="_sessionCountBadge_1nk8c_290",Y5="_emptyCta_1nk8c_313",K5="_ctaDescription_1nk8c_326",Z5="_ctaButton_1nk8c_332",Qe={container:_5,header:x5,headerLabel:T5,addButton:E5,envRow:C5,targeted:A5,expanded:j5,statusDot:N5,pulse:w5,envName:D5,envActions:k5,idleLabel:R5,newChatButton:M5,envActionsRow:O5,connectButton:B5,stopButton:L5,deleteButton:z5,provisionMessage:U5,errorMessage:V5,sessionRow:I5,selected:H5,sessionDot:q5,sessionSummaryRow:G5,sessionExpandArrow:P5,sessionSummaryText:F5,sessionCountBadge:$5,emptyCta:Y5,ctaDescription:K5,ctaButton:Z5},X5={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"},Q5={running:"running",idle:"awaiting input",failed:"failed",interrupted:"interrupted",completed:"completed"},g0=["running","idle","failed","interrupted","completed"],J5=.2;function W5(n){const a={};for(const u of n)a[u.status]=(a[u.status]||0)+1;const l=g0.filter(u=>a[u]>0).map(u=>`${a[u]} ${Q5[u]||u}`),o=new Set(g0),r=Object.keys(a).filter(u=>!o.has(u)).sort().map(u=>`${a[u]} ${u}`);return[...l,...r].join(", ")}function eO({status:n}){const a=n==="running"?"var(--accent-green)":n==="idle"?"var(--accent-yellow)":n==="completed"?"var(--text-secondary)":n==="failed"||n==="interrupted"?"var(--accent-red)":"var(--text-tertiary)";return h.jsx("span",{className:Qe.sessionDot,style:{color:a},children:"●"})}function tO({env:n,envSessions:a,selectedSessionId:l,isNewChatTarget:o,expanded:r,onToggleExpand:u,sessionsExpanded:d,onToggleSessionsExpand:m,provisionProgress:p,onProvision:g,onStop:v,onRemove:b,navigate:x}){const[T,A]=S.useState(!1),j=X5[n.status]||"var(--text-tertiary)",N=n.status==="connected",C=n.status==="connecting",B=n.status==="disconnected"||n.status==="error";return h.jsxs("div",{children:[h.jsx(Sc,{isOpen:T,title:"Delete Environment?",description:`"${n.displayName||n.id}" will be permanently removed. This destroys the workspace and removes all data.`,onConfirm:()=>{b(n.id),A(!1)},onCancel:()=>A(!1)}),h.jsxs("div",{className:`${Qe.envRow} ${o?Qe.targeted:""} ${r?Qe.expanded:""}`,"data-testid":"env-row",onClick:u,children:[h.jsx("span",{className:`${Qe.statusDot} ${N?Qe.pulse:""}`,style:{color:j},children:"●"}),h.jsx("span",{className:Qe.envName,title:n.displayName||n.id,children:n.displayName||n.id}),h.jsxs("span",{className:Qe.envActions,children:[a.length===0&&!o&&!r&&h.jsx("span",{className:Qe.idleLabel,children:"(idle)"}),N&&h.jsx("button",{onClick:R=>{R.stopPropagation(),x(z0(n.id,n.defaultRuntime||"claude-code"))},title:"New chat",className:Qe.newChatButton,children:"+"})]})]}),r&&h.jsxs("div",{className:Qe.envActionsRow,children:[C&&p&&h.jsx("span",{className:Qe.provisionMessage,children:p.message}),n.status==="error"&&(p==null?void 0:p.stage)==="error"&&h.jsx("span",{className:Qe.errorMessage,children:p.message}),B&&h.jsx("button",{onClick:R=>{R.stopPropagation(),g(n.id)},className:Qe.connectButton,children:n.status==="error"?"Retry":"Connect"}),N&&h.jsx("button",{onClick:R=>{R.stopPropagation(),v(n.id)},className:Qe.stopButton,children:"Stop"}),!C&&h.jsx("button",{onClick:R=>{R.stopPropagation(),A(!0)},className:Qe.deleteButton,children:"Delete"})]}),a.length>0&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:Qe.sessionSummaryRow,"data-testid":"session-summary-row",role:"button",tabIndex:0,"aria-expanded":d,"aria-label":d?"Collapse sessions":"Expand sessions",onClick:m,onKeyDown:R=>{(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),m())},children:[h.jsx("span",{className:`${Qe.sessionExpandArrow} ${d?Qe.expanded:""}`,children:"▸"}),h.jsx("span",{className:Qe.sessionSummaryText,children:W5(a)}),h.jsx("span",{className:Qe.sessionCountBadge,children:a.length})]}),h.jsx(ys,{children:d&&h.jsx($n.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:J5,ease:"easeInOut"},style:{overflow:"hidden"},children:a.map(R=>h.jsxs("div",{onClick:X=>{X.stopPropagation(),x(L0(R.id))},className:`${Qe.sessionRow} ${l===R.id?Qe.selected:""}`,title:R.prompt,"data-testid":"session-row",children:[h.jsx(eO,{status:R.status})," ",R.prompt.length>24?R.prompt.slice(0,24)+"...":R.prompt]},R.id))})})]})]})}function nO(){const{environments:n,sessions:a,provisionStatus:l,provisionEnvironment:o,stopEnvironment:r,removeEnvironment:u}=nn(),d=na(),[m,p]=S.useState(null),[g,v]=S.useState(new Set),b=dn("/sessions/:sessionId"),x=dn("/sessions/new"),T=(b==null?void 0:b.params.sessionId)!=="new"?b==null?void 0:b.params.sessionId:void 0,[A]=If(),j=x?A.get("env")??void 0:void 0;return h.jsxs("div",{className:Qe.container,children:[h.jsxs("div",{className:Qe.header,children:[h.jsx("span",{className:Qe.headerLabel,children:"Environments"}),h.jsx("button",{className:Qe.addButton,onClick:()=>d(jv),title:"Add environment",children:"+ Add Environment"})]}),n.length===0&&h.jsxs("div",{className:Qe.emptyCta,children:[h.jsx("button",{className:Qe.ctaButton,onClick:()=>d(jv),children:"Add Environment"}),h.jsx("div",{className:Qe.ctaDescription,children:"Connect an environment to run agents"})]}),n.map(N=>{const C=a.filter(B=>B.environmentId===N.id);return h.jsx(tO,{env:N,envSessions:C,selectedSessionId:T,isNewChatTarget:j===N.id,expanded:m===N.id,onToggleExpand:()=>p(m===N.id?null:N.id),sessionsExpanded:g.has(N.id),onToggleSessionsExpand:()=>{v(B=>{const R=new Set(B);return R.has(N.id)?R.delete(N.id):R.add(N.id),R})},provisionProgress:l[N.id],onProvision:o,onStop:r,onRemove:u,navigate:d},N.id)})]})}function aO(){return h.jsx(nO,{})}const sO="_section_1ingb_14",iO="_sectionTitle_1ingb_26",lO="_sectionDescription_1ingb_35",oO="_tokenList_1ingb_48",rO="_tokenRow_1ingb_55",cO="_tokenBadge_1ingb_68",uO="_tokenName_1ingb_83",dO="_tokenTarget_1ingb_90",fO="_deleteButton_1ingb_99",hO="_addForm_1ingb_113",mO="_formRow_1ingb_119",pO="_input_1ingb_125",gO="_select_1ingb_155",vO="_addButton_1ingb_187",yO="_emptyStateInfo_1ingb_221",bO="_themeOptions_1ingb_229",SO="_themeOption_1ingb_229",_O="_themeOptionSelected_1ingb_254",xO="_themeOptionHeader_1ingb_259",TO="_themeOptionLabel_1ingb_266",EO="_themeOptionDesc_1ingb_273",CO="_variantToggle_1ingb_279",AO="_variantButton_1ingb_286",jO="_variantActive_1ingb_305",NO="_themeSwatches_1ingb_311",wO="_themeSwatch_1ingb_311",DO="_systemToggle_1ingb_325",kO="_systemToggleHint_1ingb_341",RO="_themeActive_1ingb_348",MO="_aboutGrid_1ingb_354",OO="_aboutItem_1ingb_360",BO="_aboutLabel_1ingb_373",LO="_aboutValue_1ingb_379",zO="_aboutDot_1ingb_387",UO="_aboutDotConnected_1ingb_394",VO="_aboutDotDisconnected_1ingb_398",he={section:sO,sectionTitle:iO,sectionDescription:lO,tokenList:oO,tokenRow:rO,tokenBadge:cO,tokenName:uO,tokenTarget:dO,deleteButton:fO,addForm:hO,formRow:mO,input:pO,select:gO,addButton:vO,emptyStateInfo:yO,themeOptions:bO,themeOption:SO,themeOptionSelected:_O,themeOptionHeader:xO,themeOptionLabel:TO,themeOptionDesc:EO,variantToggle:CO,variantButton:AO,variantActive:jO,themeSwatches:NO,themeSwatch:wO,systemToggle:DO,systemToggleHint:kO,themeActive:RO,aboutGrid:MO,aboutItem:OO,aboutLabel:BO,aboutValue:LO,aboutDot:zO,aboutDotConnected:UO,aboutDotDisconnected:VO},IO=[{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 HO(){const{credentialProviders:n,updateCredentialProviders:a}=nn(),l=(o,r)=>{const u={...n};o==="claude"?u.claude=r:u[o]=r,a(u)};return h.jsxs("section",{className:he.section,children:[h.jsx("h3",{className:he.sectionTitle,children:"Credential Providers"}),h.jsx("p",{className:he.sectionDescription,children:"Enable providers to automatically forward credentials to environments at task start. Credentials are read fresh from the host each time."}),h.jsx("div",{className:he.tokenList,children:IO.map(o=>h.jsxs("div",{className:he.tokenRow,children:[h.jsx("span",{className:he.tokenName,children:o.label}),h.jsx("span",{className:he.tokenTarget,children:o.description}),h.jsx("select",{className:he.select,value:n[o.key],onChange:r=>l(o.key,r.target.value),children:o.options.map(r=>h.jsx("option",{value:r.value,children:r.label},r.value))})]},o.key))})]})}const qO=[{value:"env_var",label:"Environment Variable"},{value:"file",label:"File"}];function GO(){const{tokens:n,setToken:a,deleteToken:l}=nn(),{showToast:o}=go(),[r,u]=S.useState(""),[d,m]=S.useState(""),[p,g]=S.useState("env_var"),[v,b]=S.useState(""),[x,T]=S.useState(null),A=C=>{if(C.preventDefault(),!r||!d)return;const B=p==="env_var"?v||r.toUpperCase()+"_TOKEN":"";a(r,d,p,B,p==="file"?v:""),o("Token saved successfully","success"),u(""),m(""),b("")},j=C=>{T(C)},N=()=>{x&&(l(x),o("Token deleted","info")),T(null)};return h.jsxs(h.Fragment,{children:[h.jsx(Sc,{isOpen:x!==null,title:"Delete Token?",description:x?`"${x}" will be permanently removed.`:void 0,onConfirm:N,onCancel:()=>T(null)}),h.jsxs("section",{className:he.section,children:[h.jsx("h3",{className:he.sectionTitle,children:"Tokens"}),h.jsx("p",{className:he.sectionDescription,children:"API tokens are auto-pushed to environments when set or updated. Values are write-only."}),n.length===0?h.jsx("div",{className:he.emptyStateInfo,children:"Add your first API token to enable service integrations."}):h.jsx("div",{className:he.tokenList,children:n.map(C=>h.jsxs("div",{className:he.tokenRow,children:[h.jsx("span",{className:he.tokenBadge,children:C.tokenType}),h.jsx("span",{className:he.tokenName,children:C.name}),h.jsx("span",{className:he.tokenTarget,children:C.tokenType==="env_var"?C.envVar:C.filePath}),h.jsx("button",{className:he.deleteButton,onClick:()=>j(C.name),title:`Delete ${C.name}`,children:"×"})]},C.name))}),h.jsxs("form",{className:he.addForm,onSubmit:A,children:[h.jsxs("div",{className:he.formRow,children:[h.jsx("input",{className:he.input,type:"text",placeholder:"Token name",value:r,onChange:C=>u(C.target.value)}),h.jsx("input",{className:he.input,type:"password",placeholder:"Value",value:d,onChange:C=>m(C.target.value)})]}),h.jsxs("div",{className:he.formRow,children:[h.jsx("select",{className:he.select,value:p,onChange:C=>g(C.target.value),children:qO.map(C=>h.jsx("option",{value:C.value,children:C.label},C.value))}),h.jsx("input",{className:he.input,type:"text",placeholder:p==="env_var"?"Env var name (e.g. API_TOKEN)":"File path (e.g. /home/user/.token)",value:v,onChange:C=>b(C.target.value)}),h.jsx("button",{className:he.addButton,type:"submit",children:"Add Token"})]})]})]})]})}function PO(){return h.jsxs(h.Fragment,{children:[h.jsx(HO,{}),h.jsx(GO,{})]})}const FO="_container_1xcp7_1",$O="_header_1xcp7_7",YO="_form_1xcp7_19",KO="_formActions_1xcp7_87",ZO="_list_1xcp7_93",XO="_card_1xcp7_99",QO="_active_1xcp7_109",JO="_cardHeader_1xcp7_113",WO="_cardActions_1xcp7_123",eB="_description_1xcp7_128",tB="_meta_1xcp7_134",nB="_promptDetails_1xcp7_151",aB="_promptText_1xcp7_163",sB="_empty_1xcp7_180",iB="_btnPrimary_1xcp7_186",lB="_btnSecondary_1xcp7_220",oB="_btnSmall_1xcp7_247",rB="_btnDanger_1xcp7_273",Mt={container:FO,header:$O,form:YO,formActions:KO,list:ZO,card:XO,active:QO,cardHeader:JO,cardActions:WO,description:eB,meta:tB,promptDetails:nB,promptText:aB,empty:sB,btnPrimary:iB,btnSecondary:lB,btnSmall:oB,btnDanger:rB};function cB(){const{personas:n,createPersona:a,updatePersona:l,deletePersona:o}=nn(),[r,u]=S.useState(null),[d,m]=S.useState(!1),[p,g]=S.useState(null),[v,b]=S.useState(""),[x,T]=S.useState(""),[A,j]=S.useState(""),[N,C]=S.useState(""),[B,R]=S.useState(""),[X,H]=S.useState(0),J=()=>{b(""),T(""),j(""),C(""),R(""),H(0)},W=()=>{J(),u(null),m(!0)},F=te=>{b(te.name),T(te.description),j(te.systemPrompt),C(te.runtime),R(te.model),H(te.maxTurns),u(te),m(!1)},ne=te=>{te.preventDefault(),!(!v.trim()||!A.trim())&&(r?(l(r.id,v,x,A,N,B,X),u(null)):(a(v,x,A,N,B,X),m(!1)),J())},ge=te=>{o(te),g(null),(r==null?void 0:r.id)===te&&(u(null),J())},U=()=>{u(null),m(!1),J()},pe=()=>h.jsxs("form",{onSubmit:ne,className:Mt.form,children:[h.jsx("h3",{children:r?"Edit Persona":"Create Persona"}),h.jsxs("label",{children:["Name",h.jsx("input",{type:"text",value:v,onChange:te=>b(te.target.value),placeholder:"e.g. Frontend Engineer",required:!0})]}),h.jsxs("label",{children:["Description",h.jsx("input",{type:"text",value:x,onChange:te=>T(te.target.value),placeholder:"Brief description..."})]}),h.jsxs("label",{children:["Runtime",h.jsxs("select",{value:N,onChange:te=>C(te.target.value),children:[h.jsx("option",{value:"",children:"Default"}),h.jsx("option",{value:"claude-code",children:"claude-code"}),h.jsx("option",{value:"codex",children:"codex"}),h.jsx("option",{value:"copilot",children:"copilot"})]})]}),h.jsxs("label",{children:["Model",h.jsx("input",{type:"text",value:B,onChange:te=>R(te.target.value),placeholder:"e.g. sonnet"})]}),h.jsxs("label",{children:["Max Turns",h.jsx("input",{type:"number",value:X,onChange:te=>H(parseInt(te.target.value,10)||0),min:0})]}),h.jsxs("label",{children:["System Prompt",h.jsx("textarea",{value:A,onChange:te=>j(te.target.value),placeholder:"You are a senior frontend engineer...",rows:10,required:!0})]}),h.jsxs("div",{className:Mt.formActions,children:[h.jsx("button",{type:"submit",className:Mt.btnPrimary,children:r?"Save":"Create"}),h.jsx("button",{type:"button",onClick:U,className:Mt.btnSecondary,children:"Cancel"})]})]});return h.jsxs("div",{className:Mt.container,children:[h.jsxs("div",{className:Mt.header,children:[h.jsx("h2",{children:"Personas"}),h.jsx("button",{onClick:W,className:Mt.btnPrimary,children:"+ New Persona"})]}),(d||r)&&pe(),n.length===0&&!d?h.jsx("p",{className:Mt.empty,children:"No personas yet. Create one to get started."}):h.jsx("div",{className:Mt.list,children:n.map(te=>h.jsxs("div",{className:`${Mt.card} ${(r==null?void 0:r.id)===te.id?Mt.active:""}`,children:[h.jsxs("div",{className:Mt.cardHeader,children:[h.jsx("strong",{children:te.name}),h.jsxs("div",{className:Mt.cardActions,children:[h.jsx("button",{onClick:()=>F(te),className:Mt.btnSmall,children:"Edit"}),p===te.id?h.jsxs(h.Fragment,{children:[h.jsx("button",{onClick:()=>ge(te.id),className:Mt.btnDanger,children:"Confirm"}),h.jsx("button",{onClick:()=>g(null),className:Mt.btnSmall,children:"Cancel"})]}):h.jsx("button",{onClick:()=>g(te.id),className:Mt.btnSmall,children:"Delete"})]})]}),te.description&&h.jsx("p",{className:Mt.description,children:te.description}),h.jsxs("div",{className:Mt.meta,children:[te.runtime&&h.jsxs("span",{children:["Runtime: ",te.runtime]}),te.model&&h.jsxs("span",{children:["Model: ",te.model]}),te.maxTurns>0&&h.jsxs("span",{children:["Max turns: ",te.maxTurns]})]}),h.jsxs("details",{className:Mt.promptDetails,children:[h.jsx("summary",{children:"System Prompt"}),h.jsx("pre",{className:Mt.promptText,children:te.systemPrompt})]})]},te.id))})]})}function uB(){return h.jsx(cB,{})}function dB(){const{themeId:n,resolvedThemeId:a,setTheme:l,preferSystem:o,setPreferSystem:r}=P0();return h.jsxs("section",{className:he.section,children:[h.jsx("h3",{className:he.sectionTitle,children:"Appearance"}),h.jsx("p",{className:he.sectionDescription,children:"Choose how Grackle looks across the app."}),h.jsx("div",{className:he.themeOptions,children:hc.filter(u=>!u.hidden).map(u=>{const d=!!(u.variantLightId&&u.variantDarkId),m=d?n===u.id||n===u.variantLightId||n===u.variantDarkId:n===u.id,p=d&&a===u.variantLightId;return h.jsxs("button",{type:"button",className:`${he.themeOption} ${m?he.themeOptionSelected:""}`,"aria-pressed":m,onClick:()=>l(u.id),children:[h.jsxs("span",{className:he.themeOptionHeader,children:[h.jsxs("span",{children:[h.jsx("span",{className:he.themeOptionLabel,children:u.label}),h.jsx("span",{className:he.themeOptionDesc,children:u.description})]}),d&&h.jsxs("span",{className:he.variantToggle,children:[h.jsx("span",{role:"button",tabIndex:0,className:`${he.variantButton} ${m&&p?he.variantActive:""}`,onClick:g=>{g.stopPropagation(),r(!1),l(u.variantLightId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),l(u.variantLightId))},"aria-label":"Light variant","aria-pressed":m&&p,children:"☼"}),h.jsx("span",{role:"button",tabIndex:0,className:`${he.variantButton} ${m&&!p?he.variantActive:""}`,onClick:g=>{g.stopPropagation(),r(!1),l(u.variantDarkId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),l(u.variantDarkId))},"aria-label":"Dark variant","aria-pressed":m&&!p,children:"☾"})]})]}),u.swatches&&h.jsx("span",{className:he.themeSwatches,children:u.swatches.map((g,v)=>h.jsx("span",{className:he.themeSwatch,style:{background:g}},v))})]},u.id)})}),h.jsxs("label",{className:he.systemToggle,children:[h.jsx("input",{type:"checkbox",checked:o,onChange:u=>r(u.target.checked)}),h.jsx("span",{children:"Match system light/dark preference"})]}),h.jsx("p",{className:he.systemToggleHint,children:"Automatically switches between light and dark variants when available."}),h.jsxs("p",{className:he.themeActive,children:["Active theme: ",h.jsx("strong",{children:a})]})]})}function fB(){return h.jsx(dB,{})}function hB(){const{connected:n,environments:a,sessions:l}=nn(),o=a.filter(d=>d.status==="connected").length,r=a.length,u=l.filter(d=>["running","idle"].includes(d.status)).length;return h.jsxs("section",{className:he.section,"data-testid":"about-panel",children:[h.jsx("h3",{className:he.sectionTitle,children:"About"}),h.jsx("p",{className:he.sectionDescription,children:"Connection status and application information."}),h.jsxs("div",{className:he.aboutGrid,children:[h.jsxs("div",{className:he.aboutItem,children:[h.jsx("span",{className:he.aboutLabel,children:"Connection"}),h.jsxs("span",{className:he.aboutValue,children:[h.jsx("span",{className:`${he.aboutDot} ${n?he.aboutDotConnected:he.aboutDotDisconnected}`}),n?"Connected":"Disconnected"]})]}),h.jsxs("div",{className:he.aboutItem,children:[h.jsx("span",{className:he.aboutLabel,children:"Environments"}),h.jsxs("span",{className:he.aboutValue,children:[o,"/",r," connected"]})]}),h.jsxs("div",{className:he.aboutItem,children:[h.jsx("span",{className:he.aboutLabel,children:"Active Sessions"}),h.jsx("span",{className:he.aboutValue,children:u})]}),h.jsxs("div",{className:he.aboutItem,children:[h.jsx("span",{className:he.aboutLabel,children:"Version"}),h.jsx("span",{className:he.aboutValue,children:"0.31.2"})]})]})]})}function mB(){return h.jsx(hB,{})}const pB="_root_h353j_1",gB="_body_h353j_7",vB="_main_h353j_19",yB="_sidebarWrapper_h353j_26",bB="_overlay_h353j_56",Kl={root:pB,body:gB,main:vB,sidebarWrapper:yB,overlay:bB},SB=typeof window<"u"&&new URLSearchParams(window.location.search).has("mock");function _B(){const{lastSpawnedId:n,environments:a}=nn(),{showToast:l}=go();_k(a,l);const o=na(),r=hn(),u=r.pathname.startsWith(qi),[d,m]=S.useState(!1),p=S.useCallback(()=>m(g=>!g),[]);return S.useEffect(()=>{m(!1)},[r.pathname]),S.useEffect(()=>{if(!d)return;const g=v=>{v.key==="Escape"&&m(!1)};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[d]),S.useEffect(()=>{n&&!r.pathname.startsWith("/tasks/")&&o(L0(n),{replace:!0})},[n,o,r.pathname]),h.jsxs("div",{className:Kl.root,children:[h.jsx(kE,{onToggleSidebar:u?void 0:p,sidebarOpen:d}),h.jsxs("div",{className:Kl.body,children:[h.jsx("div",{className:Kl.sidebarWrapper,"data-sidebar-open":d,"data-settings":u,children:u?h.jsx(S5,{}):h.jsx(qD,{})}),d&&!u&&h.jsx("div",{className:Kl.overlay,"data-testid":"drawer-overlay",onClick:()=>m(!1)}),h.jsxs("div",{className:Kl.main,children:[h.jsx(k0,{}),h.jsx(ok,{})]})]}),h.jsx(Sk,{})]})}function xB(){return h.jsx(rT,{children:h.jsxs(Ot,{element:h.jsx(_B,{}),children:[h.jsx(Ot,{index:!0,element:h.jsx(mM,{})}),h.jsx(Ot,{path:"sessions/new",element:h.jsx(xM,{})}),h.jsx(Ot,{path:"sessions/:sessionId",element:h.jsx(AM,{})}),h.jsx(Ot,{path:"projects/:projectId",element:h.jsx(E3,{})}),h.jsx(Ot,{path:"tasks/new",element:h.jsx(F3,{})}),h.jsx(Ot,{path:"tasks/:taskId",element:h.jsx(Jd,{})}),h.jsx(Ot,{path:"tasks/:taskId/stream",element:h.jsx(Jd,{})}),h.jsx(Ot,{path:"tasks/:taskId/findings",element:h.jsx(Jd,{})}),h.jsx(Ot,{path:"tasks/:taskId/edit",element:h.jsx($3,{})}),h.jsx(Ot,{path:"environments/new",element:h.jsx(d5,{})}),h.jsxs(Ot,{path:"settings",element:h.jsx(p5,{}),children:[h.jsx(Ot,{index:!0,element:h.jsx(Pr,{to:"environments",replace:!0})}),h.jsx(Ot,{path:"environments",element:h.jsx(aO,{})}),h.jsx(Ot,{path:"credentials",element:h.jsx(PO,{})}),h.jsx(Ot,{path:"tokens",element:h.jsx(Pr,{to:"../credentials",replace:!0})}),h.jsx(Ot,{path:"personas",element:h.jsx(uB,{})}),h.jsx(Ot,{path:"appearance",element:h.jsx(fB,{})}),h.jsx(Ot,{path:"about",element:h.jsx(mB,{})})]}),h.jsx(Ot,{path:"*",element:h.jsx(Pr,{to:"/",replace:!0})})]})})}function TB(){const n=SB?pE:lE;return h.jsx(_E,{children:h.jsx(vE,{children:h.jsx(n,{children:h.jsx(MT,{children:h.jsx(xB,{})})})})})}ux.createRoot(document.getElementById("root")).render(h.jsx(S.StrictMode,{children:h.jsx(TB,{})}));
|