@jaato/web-coder-ui 0.1.9 → 0.1.12
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,33 @@
|
|
|
1
|
+
(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))i(u);new MutationObserver(u=>{for(const d of u)if(d.type==="childList")for(const p of d.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&i(p)}).observe(document,{childList:!0,subtree:!0});function s(u){const d={};return u.integrity&&(d.integrity=u.integrity),u.referrerPolicy&&(d.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?d.credentials="include":u.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function i(u){if(u.ep)return;u.ep=!0;const d=s(u);fetch(u.href,d)}})();function D_(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var Xo={exports:{}},Yl={};var Tm;function z_(){if(Tm)return Yl;Tm=1;var l=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function s(i,u,d){var p=null;if(d!==void 0&&(p=""+d),u.key!==void 0&&(p=""+u.key),"key"in u){d={};for(var h in u)h!=="key"&&(d[h]=u[h])}else d=u;return u=d.ref,{$$typeof:l,type:i,key:p,ref:u!==void 0?u:null,props:d}}return Yl.Fragment=r,Yl.jsx=s,Yl.jsxs=s,Yl}var km;function U_(){return km||(km=1,Xo.exports=z_()),Xo.exports}var f=U_(),$o={exports:{}},re={};var jm;function L_(){if(jm)return re;jm=1;var l=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),p=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),w=Symbol.iterator;function j(S){return S===null||typeof S!="object"?null:(S=w&&S[w]||S["@@iterator"],typeof S=="function"?S:null)}var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},z=Object.assign,Y={};function V(S,L,I){this.props=S,this.context=L,this.refs=Y,this.updater=I||B}V.prototype.isReactComponent={},V.prototype.setState=function(S,L){if(typeof S!="object"&&typeof S!="function"&&S!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,S,L,"setState")},V.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function ee(){}ee.prototype=V.prototype;function te(S,L,I){this.props=S,this.context=L,this.refs=Y,this.updater=I||B}var K=te.prototype=new ee;K.constructor=te,z(K,V.prototype),K.isPureReactComponent=!0;var W=Array.isArray;function de(){}var Z={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function se(S,L,I){var F=I.ref;return{$$typeof:l,type:S,key:L,ref:F!==void 0?F:null,props:I}}function fe(S,L){return se(S.type,L,S.props)}function ie(S){return typeof S=="object"&&S!==null&&S.$$typeof===l}function X(S){var L={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(I){return L[I]})}var Te=/\/+/g;function ze(S,L){return typeof S=="object"&&S!==null&&S.key!=null?X(""+S.key):L.toString(36)}function Ce(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(de,de):(S.status="pending",S.then(function(L){S.status==="pending"&&(S.status="fulfilled",S.value=L)},function(L){S.status==="pending"&&(S.status="rejected",S.reason=L)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function R(S,L,I,F,oe){var me=typeof S;(me==="undefined"||me==="boolean")&&(S=null);var Ee=!1;if(S===null)Ee=!0;else switch(me){case"bigint":case"string":case"number":Ee=!0;break;case"object":switch(S.$$typeof){case l:case r:Ee=!0;break;case b:return Ee=S._init,R(Ee(S._payload),L,I,F,oe)}}if(Ee)return oe=oe(S),Ee=F===""?"."+ze(S,0):F,W(oe)?(I="",Ee!=null&&(I=Ee.replace(Te,"$&/")+"/"),R(oe,L,I,"",function(Za){return Za})):oe!=null&&(ie(oe)&&(oe=fe(oe,I+(oe.key==null||S&&S.key===oe.key?"":(""+oe.key).replace(Te,"$&/")+"/")+Ee)),L.push(oe)),1;Ee=0;var lt=F===""?".":F+":";if(W(S))for(var Be=0;Be<S.length;Be++)F=S[Be],me=lt+ze(F,Be),Ee+=R(F,L,I,me,oe);else if(Be=j(S),typeof Be=="function")for(S=Be.call(S),Be=0;!(F=S.next()).done;)F=F.value,me=lt+ze(F,Be++),Ee+=R(F,L,I,me,oe);else if(me==="object"){if(typeof S.then=="function")return R(Ce(S),L,I,F,oe);throw L=String(S),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.")}return Ee}function $(S,L,I){if(S==null)return S;var F=[],oe=0;return R(S,F,"","",function(me){return L.call(I,me,oe++)}),F}function le(S){if(S._status===-1){var L=S._result;L=L(),L.then(function(I){(S._status===0||S._status===-1)&&(S._status=1,S._result=I)},function(I){(S._status===0||S._status===-1)&&(S._status=2,S._result=I)}),S._status===-1&&(S._status=0,S._result=L)}if(S._status===1)return S._result.default;throw S._result}var Se=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var L=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(L))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},Q={map:$,forEach:function(S,L,I){$(S,function(){L.apply(this,arguments)},I)},count:function(S){var L=0;return $(S,function(){L++}),L},toArray:function(S){return $(S,function(L){return L})||[]},only:function(S){if(!ie(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return re.Activity=x,re.Children=Q,re.Component=V,re.Fragment=s,re.Profiler=u,re.PureComponent=te,re.StrictMode=i,re.Suspense=y,re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Z,re.__COMPILER_RUNTIME={__proto__:null,c:function(S){return Z.H.useMemoCache(S)}},re.cache=function(S){return function(){return S.apply(null,arguments)}},re.cacheSignal=function(){return null},re.cloneElement=function(S,L,I){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var F=z({},S.props),oe=S.key;if(L!=null)for(me in L.key!==void 0&&(oe=""+L.key),L)!U.call(L,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&L.ref===void 0||(F[me]=L[me]);var me=arguments.length-2;if(me===1)F.children=I;else if(1<me){for(var Ee=Array(me),lt=0;lt<me;lt++)Ee[lt]=arguments[lt+2];F.children=Ee}return se(S.type,oe,F)},re.createContext=function(S){return S={$$typeof:p,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:d,_context:S},S},re.createElement=function(S,L,I){var F,oe={},me=null;if(L!=null)for(F in L.key!==void 0&&(me=""+L.key),L)U.call(L,F)&&F!=="key"&&F!=="__self"&&F!=="__source"&&(oe[F]=L[F]);var Ee=arguments.length-2;if(Ee===1)oe.children=I;else if(1<Ee){for(var lt=Array(Ee),Be=0;Be<Ee;Be++)lt[Be]=arguments[Be+2];oe.children=lt}if(S&&S.defaultProps)for(F in Ee=S.defaultProps,Ee)oe[F]===void 0&&(oe[F]=Ee[F]);return se(S,me,oe)},re.createRef=function(){return{current:null}},re.forwardRef=function(S){return{$$typeof:h,render:S}},re.isValidElement=ie,re.lazy=function(S){return{$$typeof:b,_payload:{_status:-1,_result:S},_init:le}},re.memo=function(S,L){return{$$typeof:g,type:S,compare:L===void 0?null:L}},re.startTransition=function(S){var L=Z.T,I={};Z.T=I;try{var F=S(),oe=Z.S;oe!==null&&oe(I,F),typeof F=="object"&&F!==null&&typeof F.then=="function"&&F.then(de,Se)}catch(me){Se(me)}finally{L!==null&&I.types!==null&&(L.types=I.types),Z.T=L}},re.unstable_useCacheRefresh=function(){return Z.H.useCacheRefresh()},re.use=function(S){return Z.H.use(S)},re.useActionState=function(S,L,I){return Z.H.useActionState(S,L,I)},re.useCallback=function(S,L){return Z.H.useCallback(S,L)},re.useContext=function(S){return Z.H.useContext(S)},re.useDebugValue=function(){},re.useDeferredValue=function(S,L){return Z.H.useDeferredValue(S,L)},re.useEffect=function(S,L){return Z.H.useEffect(S,L)},re.useEffectEvent=function(S){return Z.H.useEffectEvent(S)},re.useId=function(){return Z.H.useId()},re.useImperativeHandle=function(S,L,I){return Z.H.useImperativeHandle(S,L,I)},re.useInsertionEffect=function(S,L){return Z.H.useInsertionEffect(S,L)},re.useLayoutEffect=function(S,L){return Z.H.useLayoutEffect(S,L)},re.useMemo=function(S,L){return Z.H.useMemo(S,L)},re.useOptimistic=function(S,L){return Z.H.useOptimistic(S,L)},re.useReducer=function(S,L,I){return Z.H.useReducer(S,L,I)},re.useRef=function(S){return Z.H.useRef(S)},re.useState=function(S){return Z.H.useState(S)},re.useSyncExternalStore=function(S,L,I){return Z.H.useSyncExternalStore(S,L,I)},re.useTransition=function(){return Z.H.useTransition()},re.version="19.2.8",re}var Am;function gc(){return Am||(Am=1,$o.exports=L_()),$o.exports}var q=gc();const Kl=D_(q);var Ko={exports:{}},Ql={},Io={exports:{}},Zo={};var Om;function H_(){return Om||(Om=1,(function(l){function r(R,$){var le=R.length;R.push($);e:for(;0<le;){var Se=le-1>>>1,Q=R[Se];if(0<u(Q,$))R[Se]=$,R[le]=Q,le=Se;else break e}}function s(R){return R.length===0?null:R[0]}function i(R){if(R.length===0)return null;var $=R[0],le=R.pop();if(le!==$){R[0]=le;e:for(var Se=0,Q=R.length,S=Q>>>1;Se<S;){var L=2*(Se+1)-1,I=R[L],F=L+1,oe=R[F];if(0>u(I,le))F<Q&&0>u(oe,I)?(R[Se]=oe,R[F]=le,Se=F):(R[Se]=I,R[L]=le,Se=L);else if(F<Q&&0>u(oe,le))R[Se]=oe,R[F]=le,Se=F;else break e}}return $}function u(R,$){var le=R.sortIndex-$.sortIndex;return le!==0?le:R.id-$.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;l.unstable_now=function(){return d.now()}}else{var p=Date,h=p.now();l.unstable_now=function(){return p.now()-h}}var y=[],g=[],b=1,x=null,w=3,j=!1,B=!1,z=!1,Y=!1,V=typeof setTimeout=="function"?setTimeout:null,ee=typeof clearTimeout=="function"?clearTimeout:null,te=typeof setImmediate<"u"?setImmediate:null;function K(R){for(var $=s(g);$!==null;){if($.callback===null)i(g);else if($.startTime<=R)i(g),$.sortIndex=$.expirationTime,r(y,$);else break;$=s(g)}}function W(R){if(z=!1,K(R),!B)if(s(y)!==null)B=!0,de||(de=!0,X());else{var $=s(g);$!==null&&Ce(W,$.startTime-R)}}var de=!1,Z=-1,U=5,se=-1;function fe(){return Y?!0:!(l.unstable_now()-se<U)}function ie(){if(Y=!1,de){var R=l.unstable_now();se=R;var $=!0;try{e:{B=!1,z&&(z=!1,ee(Z),Z=-1),j=!0;var le=w;try{t:{for(K(R),x=s(y);x!==null&&!(x.expirationTime>R&&fe());){var Se=x.callback;if(typeof Se=="function"){x.callback=null,w=x.priorityLevel;var Q=Se(x.expirationTime<=R);if(R=l.unstable_now(),typeof Q=="function"){x.callback=Q,K(R),$=!0;break t}x===s(y)&&i(y),K(R)}else i(y);x=s(y)}if(x!==null)$=!0;else{var S=s(g);S!==null&&Ce(W,S.startTime-R),$=!1}}break e}finally{x=null,w=le,j=!1}$=void 0}}finally{$?X():de=!1}}}var X;if(typeof te=="function")X=function(){te(ie)};else if(typeof MessageChannel<"u"){var Te=new MessageChannel,ze=Te.port2;Te.port1.onmessage=ie,X=function(){ze.postMessage(null)}}else X=function(){V(ie,0)};function Ce(R,$){Z=V(function(){R(l.unstable_now())},$)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(R){R.callback=null},l.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<R?Math.floor(1e3/R):5},l.unstable_getCurrentPriorityLevel=function(){return w},l.unstable_next=function(R){switch(w){case 1:case 2:case 3:var $=3;break;default:$=w}var le=w;w=$;try{return R()}finally{w=le}},l.unstable_requestPaint=function(){Y=!0},l.unstable_runWithPriority=function(R,$){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var le=w;w=R;try{return $()}finally{w=le}},l.unstable_scheduleCallback=function(R,$,le){var Se=l.unstable_now();switch(typeof le=="object"&&le!==null?(le=le.delay,le=typeof le=="number"&&0<le?Se+le:Se):le=Se,R){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=le+Q,R={id:b++,callback:$,priorityLevel:R,startTime:le,expirationTime:Q,sortIndex:-1},le>Se?(R.sortIndex=le,r(g,R),s(y)===null&&R===s(g)&&(z?(ee(Z),Z=-1):z=!0,Ce(W,le-Se))):(R.sortIndex=Q,r(y,R),B||j||(B=!0,de||(de=!0,X()))),R},l.unstable_shouldYield=fe,l.unstable_wrapCallback=function(R){var $=w;return function(){var le=w;w=$;try{return R.apply(this,arguments)}finally{w=le}}}})(Zo)),Zo}var Cm;function q_(){return Cm||(Cm=1,Io.exports=H_()),Io.exports}var Jo={exports:{}},at={};var Rm;function B_(){if(Rm)return at;Rm=1;var l=gc();function r(y){var g="https://react.dev/errors/"+y;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)g+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+y+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var i={d:{f:s,r:function(){throw Error(r(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},u=Symbol.for("react.portal");function d(y,g,b){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:x==null?null:""+x,children:y,containerInfo:g,implementation:b}}var p=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(y,g){if(y==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return at.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,at.createPortal=function(y,g){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(r(299));return d(y,g,null,b)},at.flushSync=function(y){var g=p.T,b=i.p;try{if(p.T=null,i.p=2,y)return y()}finally{p.T=g,i.p=b,i.d.f()}},at.preconnect=function(y,g){typeof y=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,i.d.C(y,g))},at.prefetchDNS=function(y){typeof y=="string"&&i.d.D(y)},at.preinit=function(y,g){if(typeof y=="string"&&g&&typeof g.as=="string"){var b=g.as,x=h(b,g.crossOrigin),w=typeof g.integrity=="string"?g.integrity:void 0,j=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;b==="style"?i.d.S(y,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:x,integrity:w,fetchPriority:j}):b==="script"&&i.d.X(y,{crossOrigin:x,integrity:w,fetchPriority:j,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},at.preinitModule=function(y,g){if(typeof y=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var b=h(g.as,g.crossOrigin);i.d.M(y,{crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&i.d.M(y)},at.preload=function(y,g){if(typeof y=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var b=g.as,x=h(b,g.crossOrigin);i.d.L(y,b,{crossOrigin:x,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},at.preloadModule=function(y,g){if(typeof y=="string")if(g){var b=h(g.as,g.crossOrigin);i.d.m(y,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else i.d.m(y)},at.requestFormReset=function(y){i.d.r(y)},at.unstable_batchedUpdates=function(y,g){return y(g)},at.useFormState=function(y,g,b){return p.H.useFormState(y,g,b)},at.useFormStatus=function(){return p.H.useHostTransitionStatus()},at.version="19.2.8",at}var Mm;function Tp(){if(Mm)return Jo.exports;Mm=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(r){console.error(r)}}return l(),Jo.exports=B_(),Jo.exports}var Dm;function G_(){if(Dm)return Ql;Dm=1;var l=q_(),r=gc(),s=Tp();function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}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 u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function p(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 h(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 y(e){if(d(e)!==e)throw Error(i(188))}function g(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(i(188));return t!==e?null:e}for(var n=e,a=t;;){var o=n.return;if(o===null)break;var c=o.alternate;if(c===null){if(a=o.return,a!==null){n=a;continue}break}if(o.child===c.child){for(c=o.child;c;){if(c===n)return y(o),e;if(c===a)return y(o),t;c=c.sibling}throw Error(i(188))}if(n.return!==a.return)n=o,a=c;else{for(var m=!1,_=o.child;_;){if(_===n){m=!0,n=o,a=c;break}if(_===a){m=!0,a=o,n=c;break}_=_.sibling}if(!m){for(_=c.child;_;){if(_===n){m=!0,n=c,a=o;break}if(_===a){m=!0,a=c,n=o;break}_=_.sibling}if(!m)throw Error(i(189))}}if(n.alternate!==a)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function b(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=b(e),t!==null)return t;e=e.sibling}return null}var x=Object.assign,w=Symbol.for("react.element"),j=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),z=Symbol.for("react.fragment"),Y=Symbol.for("react.strict_mode"),V=Symbol.for("react.profiler"),ee=Symbol.for("react.consumer"),te=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),de=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),se=Symbol.for("react.activity"),fe=Symbol.for("react.memo_cache_sentinel"),ie=Symbol.iterator;function X(e){return e===null||typeof e!="object"?null:(e=ie&&e[ie]||e["@@iterator"],typeof e=="function"?e:null)}var Te=Symbol.for("react.client.reference");function ze(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 z:return"Fragment";case V:return"Profiler";case Y:return"StrictMode";case W:return"Suspense";case de:return"SuspenseList";case se:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case B:return"Portal";case te:return e.displayName||"Context";case ee:return(e._context.displayName||"Context")+".Consumer";case K:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Z:return t=e.displayName||null,t!==null?t:ze(e.type)||"Memo";case U:t=e._payload,e=e._init;try{return ze(e(t))}catch{}}return null}var Ce=Array.isArray,R=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le={pending:!1,data:null,method:null,action:null},Se=[],Q=-1;function S(e){return{current:e}}function L(e){0>Q||(e.current=Se[Q],Se[Q]=null,Q--)}function I(e,t){Q++,Se[Q]=e.current,e.current=t}var F=S(null),oe=S(null),me=S(null),Ee=S(null);function lt(e,t){switch(I(me,t),I(oe,e),I(F,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Zd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Zd(t),e=Jd(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}L(F),I(F,e)}function Be(){L(F),L(oe),L(me)}function Za(e){e.memoizedState!==null&&I(Ee,e);var t=F.current,n=Jd(t,e.type);t!==n&&(I(oe,e),I(F,n))}function Fl(e){oe.current===e&&(L(F),L(oe)),Ee.current===e&&(L(Ee),Hl._currentValue=le)}var Ti,wc;function Un(e){if(Ti===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ti=t&&t[1]||"",wc=-1<n.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+Ti+e+wc}var ki=!1;function ji(e,t){if(!e||ki)return"";ki=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var H=function(){throw Error()};if(Object.defineProperty(H.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(H,[])}catch(O){var A=O}Reflect.construct(e,[],H)}else{try{H.call()}catch(O){A=O}e.call(H.prototype)}}else{try{throw Error()}catch(O){A=O}(H=e())&&typeof H.catch=="function"&&H.catch(function(){})}}catch(O){if(O&&A&&typeof O.stack=="string")return[O.stack,A.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=a.DetermineComponentFrameRoot(),m=c[0],_=c[1];if(m&&_){var v=m.split(`
|
|
4
|
+
`),k=_.split(`
|
|
5
|
+
`);for(o=a=0;a<v.length&&!v[a].includes("DetermineComponentFrameRoot");)a++;for(;o<k.length&&!k[o].includes("DetermineComponentFrameRoot");)o++;if(a===v.length||o===k.length)for(a=v.length-1,o=k.length-1;1<=a&&0<=o&&v[a]!==k[o];)o--;for(;1<=a&&0<=o;a--,o--)if(v[a]!==k[o]){if(a!==1||o!==1)do if(a--,o--,0>o||v[a]!==k[o]){var C=`
|
|
6
|
+
`+v[a].replace(" at new "," at ");return e.displayName&&C.includes("<anonymous>")&&(C=C.replace("<anonymous>",e.displayName)),C}while(1<=a&&0<=o);break}}}finally{ki=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Un(n):""}function fh(e,t){switch(e.tag){case 26:case 27:case 5:return Un(e.type);case 16:return Un("Lazy");case 13:return e.child!==t&&t!==null?Un("Suspense Fallback"):Un("Suspense");case 19:return Un("SuspenseList");case 0:case 15:return ji(e.type,!1);case 11:return ji(e.type.render,!1);case 1:return ji(e.type,!0);case 31:return Un("Activity");default:return""}}function Nc(e){try{var t="",n=null;do t+=fh(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
|
|
7
|
+
Error generating stack: `+a.message+`
|
|
8
|
+
`+a.stack}}var Ai=Object.prototype.hasOwnProperty,Oi=l.unstable_scheduleCallback,Ci=l.unstable_cancelCallback,dh=l.unstable_shouldYield,mh=l.unstable_requestPaint,pt=l.unstable_now,ph=l.unstable_getCurrentPriorityLevel,Tc=l.unstable_ImmediatePriority,kc=l.unstable_UserBlockingPriority,Pl=l.unstable_NormalPriority,hh=l.unstable_LowPriority,jc=l.unstable_IdlePriority,gh=l.log,_h=l.unstable_setDisableYieldValue,Ja=null,ht=null;function fn(e){if(typeof gh=="function"&&_h(e),ht&&typeof ht.setStrictMode=="function")try{ht.setStrictMode(Ja,e)}catch{}}var gt=Math.clz32?Math.clz32:xh,yh=Math.log,bh=Math.LN2;function xh(e){return e>>>=0,e===0?32:31-(yh(e)/bh|0)|0}var es=256,ts=262144,ns=4194304;function Ln(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 as(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var o=0,c=e.suspendedLanes,m=e.pingedLanes;e=e.warmLanes;var _=a&134217727;return _!==0?(a=_&~c,a!==0?o=Ln(a):(m&=_,m!==0?o=Ln(m):n||(n=_&~e,n!==0&&(o=Ln(n))))):(_=a&~c,_!==0?o=Ln(_):m!==0?o=Ln(m):n||(n=a&~e,n!==0&&(o=Ln(n)))),o===0?0:t!==0&&t!==o&&(t&c)===0&&(c=o&-o,n=t&-t,c>=n||c===32&&(n&4194048)!==0)?t:o}function Wa(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function vh(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 Ac(){var e=ns;return ns<<=1,(ns&62914560)===0&&(ns=4194304),e}function Ri(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Fa(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Sh(e,t,n,a,o,c){var m=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var _=e.entanglements,v=e.expirationTimes,k=e.hiddenUpdates;for(n=m&~n;0<n;){var C=31-gt(n),H=1<<C;_[C]=0,v[C]=-1;var A=k[C];if(A!==null)for(k[C]=null,C=0;C<A.length;C++){var O=A[C];O!==null&&(O.lane&=-536870913)}n&=~H}a!==0&&Oc(e,a,0),c!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=c&~(m&~t))}function Oc(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-gt(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function Cc(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-gt(n),o=1<<a;o&t|e[a]&t&&(e[a]|=t),n&=~o}}function Rc(e,t){var n=t&-t;return n=(n&42)!==0?1:Mi(n),(n&(e.suspendedLanes|t))!==0?0:n}function Mi(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 Di(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Mc(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:bm(e.type))}function Dc(e,t){var n=$.p;try{return $.p=e,t()}finally{$.p=n}}var dn=Math.random().toString(36).slice(2),Fe="__reactFiber$"+dn,rt="__reactProps$"+dn,ia="__reactContainer$"+dn,zi="__reactEvents$"+dn,Eh="__reactListeners$"+dn,wh="__reactHandles$"+dn,zc="__reactResources$"+dn,Pa="__reactMarker$"+dn;function Ui(e){delete e[Fe],delete e[rt],delete e[zi],delete e[Eh],delete e[wh]}function ra(e){var t=e[Fe];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ia]||n[Fe]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=am(e);e!==null;){if(n=e[Fe])return n;e=am(e)}return t}e=n,n=e.parentNode}return null}function oa(e){if(e=e[Fe]||e[ia]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function el(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function ca(e){var t=e[zc];return t||(t=e[zc]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ze(e){e[Pa]=!0}var Uc=new Set,Lc={};function Hn(e,t){ua(e,t),ua(e+"Capture",t)}function ua(e,t){for(Lc[e]=t,e=0;e<t.length;e++)Uc.add(t[e])}var Nh=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]*$"),Hc={},qc={};function Th(e){return Ai.call(qc,e)?!0:Ai.call(Hc,e)?!1:Nh.test(e)?qc[e]=!0:(Hc[e]=!0,!1)}function ls(e,t,n){if(Th(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function ss(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Xt(e,t,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+a)}}function Tt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Bc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function kh(e,t,n){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var o=a.get,c=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(m){n=""+m,c.call(this,m)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(m){n=""+m},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Li(e){if(!e._valueTracker){var t=Bc(e)?"checked":"value";e._valueTracker=kh(e,t,""+e[t])}}function Gc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=Bc(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function is(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 jh=/[\n"\\]/g;function kt(e){return e.replace(jh,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Hi(e,t,n,a,o,c,m,_){e.name="",m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.type=m:e.removeAttribute("type"),t!=null?m==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Tt(t)):e.value!==""+Tt(t)&&(e.value=""+Tt(t)):m!=="submit"&&m!=="reset"||e.removeAttribute("value"),t!=null?qi(e,m,Tt(t)):n!=null?qi(e,m,Tt(n)):a!=null&&e.removeAttribute("value"),o==null&&c!=null&&(e.defaultChecked=!!c),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.name=""+Tt(_):e.removeAttribute("name")}function Yc(e,t,n,a,o,c,m,_){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||n!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){Li(e);return}n=n!=null?""+Tt(n):"",t=t!=null?""+Tt(t):n,_||t===e.value||(e.value=t),e.defaultValue=t}a=a??o,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=_?e.checked:!!a,e.defaultChecked=!!a,m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.name=m),Li(e)}function qi(e,t,n){t==="number"&&is(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function fa(e,t,n,a){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&a&&(e[n].defaultSelected=!0)}else{for(n=""+Tt(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,a&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Qc(e,t,n){if(t!=null&&(t=""+Tt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Tt(n):""}function Vc(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(i(92));if(Ce(a)){if(1<a.length)throw Error(i(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=Tt(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),Li(e)}function da(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ah=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 Xc(e,t,n){var a=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,n):typeof n!="number"||n===0||Ah.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function $c(e,t,n){if(t!=null&&typeof t!="object")throw Error(i(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var o in t)a=t[o],t.hasOwnProperty(o)&&n[o]!==a&&Xc(e,o,a)}else for(var c in t)t.hasOwnProperty(c)&&Xc(e,c,t[c])}function Bi(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 Oh=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"]]),Ch=/^[\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 rs(e){return Ch.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function $t(){}var Gi=null;function Yi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ma=null,pa=null;function Kc(e){var t=oa(e);if(t&&(e=t.stateNode)){var n=e[rt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Hi(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+kt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var o=a[rt]||null;if(!o)throw Error(i(90));Hi(a,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&Gc(a)}break e;case"textarea":Qc(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&fa(e,!!n.multiple,t,!1)}}}var Qi=!1;function Ic(e,t,n){if(Qi)return e(t,n);Qi=!0;try{var a=e(t);return a}finally{if(Qi=!1,(ma!==null||pa!==null)&&(Is(),ma&&(t=ma,e=pa,pa=ma=null,Kc(t),e)))for(t=0;t<e.length;t++)Kc(e[t])}}function tl(e,t){var n=e.stateNode;if(n===null)return null;var a=n[rt]||null;if(a===null)return null;n=a[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":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(i(231,t,typeof n));return n}var Kt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vi=!1;if(Kt)try{var nl={};Object.defineProperty(nl,"passive",{get:function(){Vi=!0}}),window.addEventListener("test",nl,nl),window.removeEventListener("test",nl,nl)}catch{Vi=!1}var mn=null,Xi=null,os=null;function Zc(){if(os)return os;var e,t=Xi,n=t.length,a,o="value"in mn?mn.value:mn.textContent,c=o.length;for(e=0;e<n&&t[e]===o[e];e++);var m=n-e;for(a=1;a<=m&&t[n-a]===o[c-a];a++);return os=o.slice(e,1<a?1-a:void 0)}function cs(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 us(){return!0}function Jc(){return!1}function ot(e){function t(n,a,o,c,m){this._reactName=n,this._targetInst=o,this.type=a,this.nativeEvent=c,this.target=m,this.currentTarget=null;for(var _ in e)e.hasOwnProperty(_)&&(n=e[_],this[_]=n?n(c):c[_]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?us:Jc,this.isPropagationStopped=Jc,this}return x(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=us)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=us)},persist:function(){},isPersistent:us}),t}var qn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fs=ot(qn),al=x({},qn,{view:0,detail:0}),Rh=ot(al),$i,Ki,ll,ds=x({},al,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zi,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"?($i=e.screenX-ll.screenX,Ki=e.screenY-ll.screenY):Ki=$i=0,ll=e),$i)},movementY:function(e){return"movementY"in e?e.movementY:Ki}}),Wc=ot(ds),Mh=x({},ds,{dataTransfer:0}),Dh=ot(Mh),zh=x({},al,{relatedTarget:0}),Ii=ot(zh),Uh=x({},qn,{animationName:0,elapsedTime:0,pseudoElement:0}),Lh=ot(Uh),Hh=x({},qn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),qh=ot(Hh),Bh=x({},qn,{data:0}),Fc=ot(Bh),Gh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Yh={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"},Qh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Vh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Qh[e])?!!t[e]:!1}function Zi(){return Vh}var Xh=x({},al,{key:function(e){if(e.key){var t=Gh[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=cs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Yh[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zi,charCode:function(e){return e.type==="keypress"?cs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?cs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),$h=ot(Xh),Kh=x({},ds,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Pc=ot(Kh),Ih=x({},al,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zi}),Zh=ot(Ih),Jh=x({},qn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Wh=ot(Jh),Fh=x({},ds,{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}),Ph=ot(Fh),eg=x({},qn,{newState:0,oldState:0}),tg=ot(eg),ng=[9,13,27,32],Ji=Kt&&"CompositionEvent"in window,sl=null;Kt&&"documentMode"in document&&(sl=document.documentMode);var ag=Kt&&"TextEvent"in window&&!sl,eu=Kt&&(!Ji||sl&&8<sl&&11>=sl),tu=" ",nu=!1;function au(e,t){switch(e){case"keyup":return ng.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ha=!1;function lg(e,t){switch(e){case"compositionend":return lu(t);case"keypress":return t.which!==32?null:(nu=!0,tu);case"textInput":return e=t.data,e===tu&&nu?null:e;default:return null}}function sg(e,t){if(ha)return e==="compositionend"||!Ji&&au(e,t)?(e=Zc(),os=Xi=mn=null,ha=!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 eu&&t.locale!=="ko"?null:t.data;default:return null}}var ig={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 su(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ig[e.type]:t==="textarea"}function iu(e,t,n,a){ma?pa?pa.push(a):pa=[a]:ma=a,t=ti(t,"onChange"),0<t.length&&(n=new fs("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var il=null,rl=null;function rg(e){Qd(e,0)}function ms(e){var t=el(e);if(Gc(t))return e}function ru(e,t){if(e==="change")return t}var ou=!1;if(Kt){var Wi;if(Kt){var Fi="oninput"in document;if(!Fi){var cu=document.createElement("div");cu.setAttribute("oninput","return;"),Fi=typeof cu.oninput=="function"}Wi=Fi}else Wi=!1;ou=Wi&&(!document.documentMode||9<document.documentMode)}function uu(){il&&(il.detachEvent("onpropertychange",fu),rl=il=null)}function fu(e){if(e.propertyName==="value"&&ms(rl)){var t=[];iu(t,rl,e,Yi(e)),Ic(rg,t)}}function og(e,t,n){e==="focusin"?(uu(),il=t,rl=n,il.attachEvent("onpropertychange",fu)):e==="focusout"&&uu()}function cg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ms(rl)}function ug(e,t){if(e==="click")return ms(t)}function fg(e,t){if(e==="input"||e==="change")return ms(t)}function dg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _t=typeof Object.is=="function"?Object.is:dg;function ol(e,t){if(_t(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var o=n[a];if(!Ai.call(t,o)||!_t(e[o],t[o]))return!1}return!0}function du(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function mu(e,t){var n=du(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=du(n)}}function pu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?pu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function hu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=is(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=is(e.document)}return t}function Pi(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 mg=Kt&&"documentMode"in document&&11>=document.documentMode,ga=null,er=null,cl=null,tr=!1;function gu(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;tr||ga==null||ga!==is(a)||(a=ga,"selectionStart"in a&&Pi(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),cl&&ol(cl,a)||(cl=a,a=ti(er,"onSelect"),0<a.length&&(t=new fs("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=ga)))}function Bn(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var _a={animationend:Bn("Animation","AnimationEnd"),animationiteration:Bn("Animation","AnimationIteration"),animationstart:Bn("Animation","AnimationStart"),transitionrun:Bn("Transition","TransitionRun"),transitionstart:Bn("Transition","TransitionStart"),transitioncancel:Bn("Transition","TransitionCancel"),transitionend:Bn("Transition","TransitionEnd")},nr={},_u={};Kt&&(_u=document.createElement("div").style,"AnimationEvent"in window||(delete _a.animationend.animation,delete _a.animationiteration.animation,delete _a.animationstart.animation),"TransitionEvent"in window||delete _a.transitionend.transition);function Gn(e){if(nr[e])return nr[e];if(!_a[e])return e;var t=_a[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in _u)return nr[e]=t[n];return e}var yu=Gn("animationend"),bu=Gn("animationiteration"),xu=Gn("animationstart"),pg=Gn("transitionrun"),hg=Gn("transitionstart"),gg=Gn("transitioncancel"),vu=Gn("transitionend"),Su=new Map,ar="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(" ");ar.push("scrollEnd");function Ut(e,t){Su.set(e,t),Hn(t,[e])}var ps=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)},jt=[],ya=0,lr=0;function hs(){for(var e=ya,t=lr=ya=0;t<e;){var n=jt[t];jt[t++]=null;var a=jt[t];jt[t++]=null;var o=jt[t];jt[t++]=null;var c=jt[t];if(jt[t++]=null,a!==null&&o!==null){var m=a.pending;m===null?o.next=o:(o.next=m.next,m.next=o),a.pending=o}c!==0&&Eu(n,o,c)}}function gs(e,t,n,a){jt[ya++]=e,jt[ya++]=t,jt[ya++]=n,jt[ya++]=a,lr|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function sr(e,t,n,a){return gs(e,t,n,a),_s(e)}function Yn(e,t){return gs(e,null,null,t),_s(e)}function Eu(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var o=!1,c=e.return;c!==null;)c.childLanes|=n,a=c.alternate,a!==null&&(a.childLanes|=n),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(o=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,o&&t!==null&&(o=31-gt(n),e=c.hiddenUpdates,a=e[o],a===null?e[o]=[t]:a.push(t),t.lane=n|536870912),c):null}function _s(e){if(50<Cl)throw Cl=0,ho=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ba={};function _g(e,t,n,a){this.tag=e,this.key=n,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=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yt(e,t,n,a){return new _g(e,t,n,a)}function ir(e){return e=e.prototype,!(!e||!e.isReactComponent)}function It(e,t){var n=e.alternate;return n===null?(n=yt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function wu(e,t){e.flags&=65011714;var n=e.alternate;return n===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=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ys(e,t,n,a,o,c){var m=0;if(a=e,typeof e=="function")ir(e)&&(m=1);else if(typeof e=="string")m=S_(e,n,F.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case se:return e=yt(31,n,t,o),e.elementType=se,e.lanes=c,e;case z:return Qn(n.children,o,c,t);case Y:m=8,o|=24;break;case V:return e=yt(12,n,t,o|2),e.elementType=V,e.lanes=c,e;case W:return e=yt(13,n,t,o),e.elementType=W,e.lanes=c,e;case de:return e=yt(19,n,t,o),e.elementType=de,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case te:m=10;break e;case ee:m=9;break e;case K:m=11;break e;case Z:m=14;break e;case U:m=16,a=null;break e}m=29,n=Error(i(130,e===null?"null":typeof e,"")),a=null}return t=yt(m,n,t,o),t.elementType=e,t.type=a,t.lanes=c,t}function Qn(e,t,n,a){return e=yt(7,e,a,t),e.lanes=n,e}function rr(e,t,n){return e=yt(6,e,null,t),e.lanes=n,e}function Nu(e){var t=yt(18,null,null,0);return t.stateNode=e,t}function or(e,t,n){return t=yt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Tu=new WeakMap;function At(e,t){if(typeof e=="object"&&e!==null){var n=Tu.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Nc(t)},Tu.set(e,t),t)}return{value:e,source:t,stack:Nc(t)}}var xa=[],va=0,bs=null,ul=0,Ot=[],Ct=0,pn=null,Bt=1,Gt="";function Zt(e,t){xa[va++]=ul,xa[va++]=bs,bs=e,ul=t}function ku(e,t,n){Ot[Ct++]=Bt,Ot[Ct++]=Gt,Ot[Ct++]=pn,pn=e;var a=Bt;e=Gt;var o=32-gt(a)-1;a&=~(1<<o),n+=1;var c=32-gt(t)+o;if(30<c){var m=o-o%5;c=(a&(1<<m)-1).toString(32),a>>=m,o-=m,Bt=1<<32-gt(t)+o|n<<o|a,Gt=c+e}else Bt=1<<c|n<<o|a,Gt=e}function cr(e){e.return!==null&&(Zt(e,1),ku(e,1,0))}function ur(e){for(;e===bs;)bs=xa[--va],xa[va]=null,ul=xa[--va],xa[va]=null;for(;e===pn;)pn=Ot[--Ct],Ot[Ct]=null,Gt=Ot[--Ct],Ot[Ct]=null,Bt=Ot[--Ct],Ot[Ct]=null}function ju(e,t){Ot[Ct++]=Bt,Ot[Ct++]=Gt,Ot[Ct++]=pn,Bt=t.id,Gt=t.overflow,pn=e}var Pe=null,Me=null,ye=!1,hn=null,Rt=!1,fr=Error(i(519));function gn(e){var t=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw fl(At(t,e)),fr}function Au(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[Fe]=e,t[rt]=a,n){case"dialog":he("cancel",t),he("close",t);break;case"iframe":case"object":case"embed":he("load",t);break;case"video":case"audio":for(n=0;n<Ml.length;n++)he(Ml[n],t);break;case"source":he("error",t);break;case"img":case"image":case"link":he("error",t),he("load",t);break;case"details":he("toggle",t);break;case"input":he("invalid",t),Yc(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":he("invalid",t);break;case"textarea":he("invalid",t),Vc(t,a.value,a.defaultValue,a.children)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||Kd(t.textContent,n)?(a.popover!=null&&(he("beforetoggle",t),he("toggle",t)),a.onScroll!=null&&he("scroll",t),a.onScrollEnd!=null&&he("scrollend",t),a.onClick!=null&&(t.onclick=$t),t=!0):t=!1,t||gn(e,!0)}function Ou(e){for(Pe=e.return;Pe;)switch(Pe.tag){case 5:case 31:case 13:Rt=!1;return;case 27:case 3:Rt=!0;return;default:Pe=Pe.return}}function Sa(e){if(e!==Pe)return!1;if(!ye)return Ou(e),ye=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Oo(e.type,e.memoizedProps)),n=!n),n&&Me&&gn(e),Ou(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Me=nm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Me=nm(e)}else t===27?(t=Me,On(e.type)?(e=zo,zo=null,Me=e):Me=t):Me=Pe?Dt(e.stateNode.nextSibling):null;return!0}function Vn(){Me=Pe=null,ye=!1}function dr(){var e=hn;return e!==null&&(dt===null?dt=e:dt.push.apply(dt,e),hn=null),e}function fl(e){hn===null?hn=[e]:hn.push(e)}var mr=S(null),Xn=null,Jt=null;function _n(e,t,n){I(mr,t._currentValue),t._currentValue=n}function Wt(e){e._currentValue=mr.current,L(mr)}function pr(e,t,n){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===n)break;e=e.return}}function hr(e,t,n,a){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var c=o.dependencies;if(c!==null){var m=o.child;c=c.firstContext;e:for(;c!==null;){var _=c;c=o;for(var v=0;v<t.length;v++)if(_.context===t[v]){c.lanes|=n,_=c.alternate,_!==null&&(_.lanes|=n),pr(c.return,n,e),a||(m=null);break e}c=_.next}}else if(o.tag===18){if(m=o.return,m===null)throw Error(i(341));m.lanes|=n,c=m.alternate,c!==null&&(c.lanes|=n),pr(m,n,e),m=null}else m=o.child;if(m!==null)m.return=o;else for(m=o;m!==null;){if(m===e){m=null;break}if(o=m.sibling,o!==null){o.return=m.return,m=o;break}m=m.return}o=m}}function Ea(e,t,n,a){e=null;for(var o=t,c=!1;o!==null;){if(!c){if((o.flags&524288)!==0)c=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var m=o.alternate;if(m===null)throw Error(i(387));if(m=m.memoizedProps,m!==null){var _=o.type;_t(o.pendingProps.value,m.value)||(e!==null?e.push(_):e=[_])}}else if(o===Ee.current){if(m=o.alternate,m===null)throw Error(i(387));m.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(Hl):e=[Hl])}o=o.return}e!==null&&hr(t,e,n,a),t.flags|=262144}function xs(e){for(e=e.firstContext;e!==null;){if(!_t(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function $n(e){Xn=e,Jt=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function et(e){return Cu(Xn,e)}function vs(e,t){return Xn===null&&$n(e),Cu(e,t)}function Cu(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Jt===null){if(e===null)throw Error(i(308));Jt=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Jt=Jt.next=t;return n}var yg=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},bg=l.unstable_scheduleCallback,xg=l.unstable_NormalPriority,Qe={$$typeof:te,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function gr(){return{controller:new yg,data:new Map,refCount:0}}function dl(e){e.refCount--,e.refCount===0&&bg(xg,function(){e.controller.abort()})}var ml=null,_r=0,wa=0,Na=null;function vg(e,t){if(ml===null){var n=ml=[];_r=0,wa=vo(),Na={status:"pending",value:void 0,then:function(a){n.push(a)}}}return _r++,t.then(Ru,Ru),t}function Ru(){if(--_r===0&&ml!==null){Na!==null&&(Na.status="fulfilled");var e=ml;ml=null,wa=0,Na=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Sg(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(o){n.push(o)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var o=0;o<n.length;o++)(0,n[o])(t)},function(o){for(a.status="rejected",a.reason=o,o=0;o<n.length;o++)(0,n[o])(void 0)}),a}var Mu=R.S;R.S=function(e,t){_d=pt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&vg(e,t),Mu!==null&&Mu(e,t)};var Kn=S(null);function yr(){var e=Kn.current;return e!==null?e:Oe.pooledCache}function Ss(e,t){t===null?I(Kn,Kn.current):I(Kn,t.pool)}function Du(){var e=yr();return e===null?null:{parent:Qe._currentValue,pool:e}}var Ta=Error(i(460)),br=Error(i(474)),Es=Error(i(542)),ws={then:function(){}};function zu(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Uu(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then($t,$t),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Hu(e),e;default:if(typeof t.status=="string")t.then($t,$t);else{if(e=Oe,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=a}},function(a){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Hu(e),e}throw Zn=t,Ta}}function In(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Zn=n,Ta):n}}var Zn=null;function Lu(){if(Zn===null)throw Error(i(459));var e=Zn;return Zn=null,e}function Hu(e){if(e===Ta||e===Es)throw Error(i(483))}var ka=null,pl=0;function Ns(e){var t=pl;return pl+=1,ka===null&&(ka=[]),Uu(ka,e,t)}function hl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ts(e,t){throw t.$$typeof===w?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function qu(e){function t(N,E){if(e){var T=N.deletions;T===null?(N.deletions=[E],N.flags|=16):T.push(E)}}function n(N,E){if(!e)return null;for(;E!==null;)t(N,E),E=E.sibling;return null}function a(N){for(var E=new Map;N!==null;)N.key!==null?E.set(N.key,N):E.set(N.index,N),N=N.sibling;return E}function o(N,E){return N=It(N,E),N.index=0,N.sibling=null,N}function c(N,E,T){return N.index=T,e?(T=N.alternate,T!==null?(T=T.index,T<E?(N.flags|=67108866,E):T):(N.flags|=67108866,E)):(N.flags|=1048576,E)}function m(N){return e&&N.alternate===null&&(N.flags|=67108866),N}function _(N,E,T,D){return E===null||E.tag!==6?(E=rr(T,N.mode,D),E.return=N,E):(E=o(E,T),E.return=N,E)}function v(N,E,T,D){var ne=T.type;return ne===z?C(N,E,T.props.children,D,T.key):E!==null&&(E.elementType===ne||typeof ne=="object"&&ne!==null&&ne.$$typeof===U&&In(ne)===E.type)?(E=o(E,T.props),hl(E,T),E.return=N,E):(E=ys(T.type,T.key,T.props,null,N.mode,D),hl(E,T),E.return=N,E)}function k(N,E,T,D){return E===null||E.tag!==4||E.stateNode.containerInfo!==T.containerInfo||E.stateNode.implementation!==T.implementation?(E=or(T,N.mode,D),E.return=N,E):(E=o(E,T.children||[]),E.return=N,E)}function C(N,E,T,D,ne){return E===null||E.tag!==7?(E=Qn(T,N.mode,D,ne),E.return=N,E):(E=o(E,T),E.return=N,E)}function H(N,E,T){if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return E=rr(""+E,N.mode,T),E.return=N,E;if(typeof E=="object"&&E!==null){switch(E.$$typeof){case j:return T=ys(E.type,E.key,E.props,null,N.mode,T),hl(T,E),T.return=N,T;case B:return E=or(E,N.mode,T),E.return=N,E;case U:return E=In(E),H(N,E,T)}if(Ce(E)||X(E))return E=Qn(E,N.mode,T,null),E.return=N,E;if(typeof E.then=="function")return H(N,Ns(E),T);if(E.$$typeof===te)return H(N,vs(N,E),T);Ts(N,E)}return null}function A(N,E,T,D){var ne=E!==null?E.key:null;if(typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint")return ne!==null?null:_(N,E,""+T,D);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case j:return T.key===ne?v(N,E,T,D):null;case B:return T.key===ne?k(N,E,T,D):null;case U:return T=In(T),A(N,E,T,D)}if(Ce(T)||X(T))return ne!==null?null:C(N,E,T,D,null);if(typeof T.then=="function")return A(N,E,Ns(T),D);if(T.$$typeof===te)return A(N,E,vs(N,T),D);Ts(N,T)}return null}function O(N,E,T,D,ne){if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return N=N.get(T)||null,_(E,N,""+D,ne);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case j:return N=N.get(D.key===null?T:D.key)||null,v(E,N,D,ne);case B:return N=N.get(D.key===null?T:D.key)||null,k(E,N,D,ne);case U:return D=In(D),O(N,E,T,D,ne)}if(Ce(D)||X(D))return N=N.get(T)||null,C(E,N,D,ne,null);if(typeof D.then=="function")return O(N,E,T,Ns(D),ne);if(D.$$typeof===te)return O(N,E,T,vs(E,D),ne);Ts(E,D)}return null}function J(N,E,T,D){for(var ne=null,be=null,P=E,ue=E=0,_e=null;P!==null&&ue<T.length;ue++){P.index>ue?(_e=P,P=null):_e=P.sibling;var xe=A(N,P,T[ue],D);if(xe===null){P===null&&(P=_e);break}e&&P&&xe.alternate===null&&t(N,P),E=c(xe,E,ue),be===null?ne=xe:be.sibling=xe,be=xe,P=_e}if(ue===T.length)return n(N,P),ye&&Zt(N,ue),ne;if(P===null){for(;ue<T.length;ue++)P=H(N,T[ue],D),P!==null&&(E=c(P,E,ue),be===null?ne=P:be.sibling=P,be=P);return ye&&Zt(N,ue),ne}for(P=a(P);ue<T.length;ue++)_e=O(P,N,ue,T[ue],D),_e!==null&&(e&&_e.alternate!==null&&P.delete(_e.key===null?ue:_e.key),E=c(_e,E,ue),be===null?ne=_e:be.sibling=_e,be=_e);return e&&P.forEach(function(zn){return t(N,zn)}),ye&&Zt(N,ue),ne}function ae(N,E,T,D){if(T==null)throw Error(i(151));for(var ne=null,be=null,P=E,ue=E=0,_e=null,xe=T.next();P!==null&&!xe.done;ue++,xe=T.next()){P.index>ue?(_e=P,P=null):_e=P.sibling;var zn=A(N,P,xe.value,D);if(zn===null){P===null&&(P=_e);break}e&&P&&zn.alternate===null&&t(N,P),E=c(zn,E,ue),be===null?ne=zn:be.sibling=zn,be=zn,P=_e}if(xe.done)return n(N,P),ye&&Zt(N,ue),ne;if(P===null){for(;!xe.done;ue++,xe=T.next())xe=H(N,xe.value,D),xe!==null&&(E=c(xe,E,ue),be===null?ne=xe:be.sibling=xe,be=xe);return ye&&Zt(N,ue),ne}for(P=a(P);!xe.done;ue++,xe=T.next())xe=O(P,N,ue,xe.value,D),xe!==null&&(e&&xe.alternate!==null&&P.delete(xe.key===null?ue:xe.key),E=c(xe,E,ue),be===null?ne=xe:be.sibling=xe,be=xe);return e&&P.forEach(function(M_){return t(N,M_)}),ye&&Zt(N,ue),ne}function Ae(N,E,T,D){if(typeof T=="object"&&T!==null&&T.type===z&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case j:e:{for(var ne=T.key;E!==null;){if(E.key===ne){if(ne=T.type,ne===z){if(E.tag===7){n(N,E.sibling),D=o(E,T.props.children),D.return=N,N=D;break e}}else if(E.elementType===ne||typeof ne=="object"&&ne!==null&&ne.$$typeof===U&&In(ne)===E.type){n(N,E.sibling),D=o(E,T.props),hl(D,T),D.return=N,N=D;break e}n(N,E);break}else t(N,E);E=E.sibling}T.type===z?(D=Qn(T.props.children,N.mode,D,T.key),D.return=N,N=D):(D=ys(T.type,T.key,T.props,null,N.mode,D),hl(D,T),D.return=N,N=D)}return m(N);case B:e:{for(ne=T.key;E!==null;){if(E.key===ne)if(E.tag===4&&E.stateNode.containerInfo===T.containerInfo&&E.stateNode.implementation===T.implementation){n(N,E.sibling),D=o(E,T.children||[]),D.return=N,N=D;break e}else{n(N,E);break}else t(N,E);E=E.sibling}D=or(T,N.mode,D),D.return=N,N=D}return m(N);case U:return T=In(T),Ae(N,E,T,D)}if(Ce(T))return J(N,E,T,D);if(X(T)){if(ne=X(T),typeof ne!="function")throw Error(i(150));return T=ne.call(T),ae(N,E,T,D)}if(typeof T.then=="function")return Ae(N,E,Ns(T),D);if(T.$$typeof===te)return Ae(N,E,vs(N,T),D);Ts(N,T)}return typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint"?(T=""+T,E!==null&&E.tag===6?(n(N,E.sibling),D=o(E,T),D.return=N,N=D):(n(N,E),D=rr(T,N.mode,D),D.return=N,N=D),m(N)):n(N,E)}return function(N,E,T,D){try{pl=0;var ne=Ae(N,E,T,D);return ka=null,ne}catch(P){if(P===Ta||P===Es)throw P;var be=yt(29,P,null,N.mode);return be.lanes=D,be.return=N,be}}}var Jn=qu(!0),Bu=qu(!1),yn=!1;function xr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vr(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 bn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function xn(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(ve&2)!==0){var o=a.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),a.pending=t,t=_s(e),Eu(e,null,n),t}return gs(e,a,t,n),_s(e)}function gl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Cc(e,n)}}function Sr(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var o=null,c=null;if(n=n.firstBaseUpdate,n!==null){do{var m={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};c===null?o=c=m:c=c.next=m,n=n.next}while(n!==null);c===null?o=c=t:c=c.next=t}else o=c=t;n={baseState:a.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Er=!1;function _l(){if(Er){var e=Na;if(e!==null)throw e}}function yl(e,t,n,a){Er=!1;var o=e.updateQueue;yn=!1;var c=o.firstBaseUpdate,m=o.lastBaseUpdate,_=o.shared.pending;if(_!==null){o.shared.pending=null;var v=_,k=v.next;v.next=null,m===null?c=k:m.next=k,m=v;var C=e.alternate;C!==null&&(C=C.updateQueue,_=C.lastBaseUpdate,_!==m&&(_===null?C.firstBaseUpdate=k:_.next=k,C.lastBaseUpdate=v))}if(c!==null){var H=o.baseState;m=0,C=k=v=null,_=c;do{var A=_.lane&-536870913,O=A!==_.lane;if(O?(ge&A)===A:(a&A)===A){A!==0&&A===wa&&(Er=!0),C!==null&&(C=C.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var J=e,ae=_;A=t;var Ae=n;switch(ae.tag){case 1:if(J=ae.payload,typeof J=="function"){H=J.call(Ae,H,A);break e}H=J;break e;case 3:J.flags=J.flags&-65537|128;case 0:if(J=ae.payload,A=typeof J=="function"?J.call(Ae,H,A):J,A==null)break e;H=x({},H,A);break e;case 2:yn=!0}}A=_.callback,A!==null&&(e.flags|=64,O&&(e.flags|=8192),O=o.callbacks,O===null?o.callbacks=[A]:O.push(A))}else O={lane:A,tag:_.tag,payload:_.payload,callback:_.callback,next:null},C===null?(k=C=O,v=H):C=C.next=O,m|=A;if(_=_.next,_===null){if(_=o.shared.pending,_===null)break;O=_,_=O.next,O.next=null,o.lastBaseUpdate=O,o.shared.pending=null}}while(!0);C===null&&(v=H),o.baseState=v,o.firstBaseUpdate=k,o.lastBaseUpdate=C,c===null&&(o.shared.lanes=0),Nn|=m,e.lanes=m,e.memoizedState=H}}function Gu(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function Yu(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Gu(n[e],t)}var ja=S(null),ks=S(0);function Qu(e,t){e=rn,I(ks,e),I(ja,t),rn=e|t.baseLanes}function wr(){I(ks,rn),I(ja,ja.current)}function Nr(){rn=ks.current,L(ja),L(ks)}var bt=S(null),Mt=null;function vn(e){var t=e.alternate;I(Ge,Ge.current&1),I(bt,e),Mt===null&&(t===null||ja.current!==null||t.memoizedState!==null)&&(Mt=e)}function Tr(e){I(Ge,Ge.current),I(bt,e),Mt===null&&(Mt=e)}function Vu(e){e.tag===22?(I(Ge,Ge.current),I(bt,e),Mt===null&&(Mt=e)):Sn()}function Sn(){I(Ge,Ge.current),I(bt,bt.current)}function xt(e){L(bt),Mt===e&&(Mt=null),L(Ge)}var Ge=S(0);function js(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Mo(n)||Do(n)))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 Ft=0,ce=null,ke=null,Ve=null,As=!1,Aa=!1,Wn=!1,Os=0,bl=0,Oa=null,Eg=0;function Le(){throw Error(i(321))}function kr(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!_t(e[n],t[n]))return!1;return!0}function jr(e,t,n,a,o,c){return Ft=c,ce=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,R.H=e===null||e.memoizedState===null?jf:Qr,Wn=!1,c=n(a,o),Wn=!1,Aa&&(c=$u(t,n,a,o)),Xu(e),c}function Xu(e){R.H=Sl;var t=ke!==null&&ke.next!==null;if(Ft=0,Ve=ke=ce=null,As=!1,bl=0,Oa=null,t)throw Error(i(300));e===null||Xe||(e=e.dependencies,e!==null&&xs(e)&&(Xe=!0))}function $u(e,t,n,a){ce=e;var o=0;do{if(Aa&&(Oa=null),bl=0,Aa=!1,25<=o)throw Error(i(301));if(o+=1,Ve=ke=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}R.H=Af,c=t(n,a)}while(Aa);return c}function wg(){var e=R.H,t=e.useState()[0];return t=typeof t.then=="function"?xl(t):t,e=e.useState()[0],(ke!==null?ke.memoizedState:null)!==e&&(ce.flags|=1024),t}function Ar(){var e=Os!==0;return Os=0,e}function Or(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Cr(e){if(As){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}As=!1}Ft=0,Ve=ke=ce=null,Aa=!1,bl=Os=0,Oa=null}function st(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ve===null?ce.memoizedState=Ve=e:Ve=Ve.next=e,Ve}function Ye(){if(ke===null){var e=ce.alternate;e=e!==null?e.memoizedState:null}else e=ke.next;var t=Ve===null?ce.memoizedState:Ve.next;if(t!==null)Ve=t,ke=e;else{if(e===null)throw ce.alternate===null?Error(i(467)):Error(i(310));ke=e,e={memoizedState:ke.memoizedState,baseState:ke.baseState,baseQueue:ke.baseQueue,queue:ke.queue,next:null},Ve===null?ce.memoizedState=Ve=e:Ve=Ve.next=e}return Ve}function Cs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xl(e){var t=bl;return bl+=1,Oa===null&&(Oa=[]),e=Uu(Oa,e,t),t=ce,(Ve===null?t.memoizedState:Ve.next)===null&&(t=t.alternate,R.H=t===null||t.memoizedState===null?jf:Qr),e}function Rs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return xl(e);if(e.$$typeof===te)return et(e)}throw Error(i(438,String(e)))}function Rr(e){var t=null,n=ce.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=ce.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Cs(),ce.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=fe;return t.index++,n}function Pt(e,t){return typeof t=="function"?t(e):t}function Ms(e){var t=Ye();return Mr(t,ke,e)}function Mr(e,t,n){var a=e.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=n;var o=e.baseQueue,c=a.pending;if(c!==null){if(o!==null){var m=o.next;o.next=c.next,c.next=m}t.baseQueue=o=c,a.pending=null}if(c=e.baseState,o===null)e.memoizedState=c;else{t=o.next;var _=m=null,v=null,k=t,C=!1;do{var H=k.lane&-536870913;if(H!==k.lane?(ge&H)===H:(Ft&H)===H){var A=k.revertLane;if(A===0)v!==null&&(v=v.next={lane:0,revertLane:0,gesture:null,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null}),H===wa&&(C=!0);else if((Ft&A)===A){k=k.next,A===wa&&(C=!0);continue}else H={lane:0,revertLane:k.revertLane,gesture:null,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null},v===null?(_=v=H,m=c):v=v.next=H,ce.lanes|=A,Nn|=A;H=k.action,Wn&&n(c,H),c=k.hasEagerState?k.eagerState:n(c,H)}else A={lane:H,revertLane:k.revertLane,gesture:k.gesture,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null},v===null?(_=v=A,m=c):v=v.next=A,ce.lanes|=H,Nn|=H;k=k.next}while(k!==null&&k!==t);if(v===null?m=c:v.next=_,!_t(c,e.memoizedState)&&(Xe=!0,C&&(n=Na,n!==null)))throw n;e.memoizedState=c,e.baseState=m,e.baseQueue=v,a.lastRenderedState=c}return o===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Dr(e){var t=Ye(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var a=n.dispatch,o=n.pending,c=t.memoizedState;if(o!==null){n.pending=null;var m=o=o.next;do c=e(c,m.action),m=m.next;while(m!==o);_t(c,t.memoizedState)||(Xe=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),n.lastRenderedState=c}return[c,a]}function Ku(e,t,n){var a=ce,o=Ye(),c=ye;if(c){if(n===void 0)throw Error(i(407));n=n()}else n=t();var m=!_t((ke||o).memoizedState,n);if(m&&(o.memoizedState=n,Xe=!0),o=o.queue,Lr(Ju.bind(null,a,o,e),[e]),o.getSnapshot!==t||m||Ve!==null&&Ve.memoizedState.tag&1){if(a.flags|=2048,Ca(9,{destroy:void 0},Zu.bind(null,a,o,n,t),null),Oe===null)throw Error(i(349));c||(Ft&127)!==0||Iu(a,t,n)}return n}function Iu(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ce.updateQueue,t===null?(t=Cs(),ce.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Zu(e,t,n,a){t.value=n,t.getSnapshot=a,Wu(t)&&Fu(e)}function Ju(e,t,n){return n(function(){Wu(t)&&Fu(e)})}function Wu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_t(e,n)}catch{return!0}}function Fu(e){var t=Yn(e,2);t!==null&&mt(t,e,2)}function zr(e){var t=st();if(typeof e=="function"){var n=e;if(e=n(),Wn){fn(!0);try{n()}finally{fn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pt,lastRenderedState:e},t}function Pu(e,t,n,a){return e.baseState=n,Mr(e,ke,typeof a=="function"?a:Pt)}function Ng(e,t,n,a,o){if(Us(e))throw Error(i(485));if(e=t.action,e!==null){var c={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(m){c.listeners.push(m)}};R.T!==null?n(!0):c.isTransition=!1,a(c),n=t.pending,n===null?(c.next=t.pending=c,ef(t,c)):(c.next=n.next,t.pending=n.next=c)}}function ef(e,t){var n=t.action,a=t.payload,o=e.state;if(t.isTransition){var c=R.T,m={};R.T=m;try{var _=n(o,a),v=R.S;v!==null&&v(m,_),tf(e,t,_)}catch(k){Ur(e,t,k)}finally{c!==null&&m.types!==null&&(c.types=m.types),R.T=c}}else try{c=n(o,a),tf(e,t,c)}catch(k){Ur(e,t,k)}}function tf(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){nf(e,t,a)},function(a){return Ur(e,t,a)}):nf(e,t,n)}function nf(e,t,n){t.status="fulfilled",t.value=n,af(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,ef(e,n)))}function Ur(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,af(t),t=t.next;while(t!==a)}e.action=null}function af(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function lf(e,t){return t}function sf(e,t){if(ye){var n=Oe.formState;if(n!==null){e:{var a=ce;if(ye){if(Me){t:{for(var o=Me,c=Rt;o.nodeType!==8;){if(!c){o=null;break t}if(o=Dt(o.nextSibling),o===null){o=null;break t}}c=o.data,o=c==="F!"||c==="F"?o:null}if(o){Me=Dt(o.nextSibling),a=o.data==="F!";break e}}gn(a)}a=!1}a&&(t=n[0])}}return n=st(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:lf,lastRenderedState:t},n.queue=a,n=Nf.bind(null,ce,a),a.dispatch=n,a=zr(!1),c=Yr.bind(null,ce,!1,a.queue),a=st(),o={state:t,dispatch:null,action:e,pending:null},a.queue=o,n=Ng.bind(null,ce,o,c,n),o.dispatch=n,a.memoizedState=e,[t,n,!1]}function rf(e){var t=Ye();return of(t,ke,e)}function of(e,t,n){if(t=Mr(e,t,lf)[0],e=Ms(Pt)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=xl(t)}catch(m){throw m===Ta?Es:m}else a=t;t=Ye();var o=t.queue,c=o.dispatch;return n!==t.memoizedState&&(ce.flags|=2048,Ca(9,{destroy:void 0},Tg.bind(null,o,n),null)),[a,c,e]}function Tg(e,t){e.action=t}function cf(e){var t=Ye(),n=ke;if(n!==null)return of(t,n,e);Ye(),t=t.memoizedState,n=Ye();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function Ca(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=ce.updateQueue,t===null&&(t=Cs(),ce.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function uf(){return Ye().memoizedState}function Ds(e,t,n,a){var o=st();ce.flags|=e,o.memoizedState=Ca(1|t,{destroy:void 0},n,a===void 0?null:a)}function zs(e,t,n,a){var o=Ye();a=a===void 0?null:a;var c=o.memoizedState.inst;ke!==null&&a!==null&&kr(a,ke.memoizedState.deps)?o.memoizedState=Ca(t,c,n,a):(ce.flags|=e,o.memoizedState=Ca(1|t,c,n,a))}function ff(e,t){Ds(8390656,8,e,t)}function Lr(e,t){zs(2048,8,e,t)}function kg(e){ce.flags|=4;var t=ce.updateQueue;if(t===null)t=Cs(),ce.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function df(e){var t=Ye().memoizedState;return kg({ref:t,nextImpl:e}),function(){if((ve&2)!==0)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function mf(e,t){return zs(4,2,e,t)}function pf(e,t){return zs(4,4,e,t)}function hf(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function gf(e,t,n){n=n!=null?n.concat([e]):null,zs(4,4,hf.bind(null,t,e),n)}function Hr(){}function _f(e,t){var n=Ye();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&kr(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function yf(e,t){var n=Ye();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&kr(t,a[1]))return a[0];if(a=e(),Wn){fn(!0);try{e()}finally{fn(!1)}}return n.memoizedState=[a,t],a}function qr(e,t,n){return n===void 0||(Ft&1073741824)!==0&&(ge&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=bd(),ce.lanes|=e,Nn|=e,n)}function bf(e,t,n,a){return _t(n,t)?n:ja.current!==null?(e=qr(e,n,a),_t(e,t)||(Xe=!0),e):(Ft&42)===0||(Ft&1073741824)!==0&&(ge&261930)===0?(Xe=!0,e.memoizedState=n):(e=bd(),ce.lanes|=e,Nn|=e,t)}function xf(e,t,n,a,o){var c=$.p;$.p=c!==0&&8>c?c:8;var m=R.T,_={};R.T=_,Yr(e,!1,t,n);try{var v=o(),k=R.S;if(k!==null&&k(_,v),v!==null&&typeof v=="object"&&typeof v.then=="function"){var C=Sg(v,a);vl(e,t,C,Et(e))}else vl(e,t,a,Et(e))}catch(H){vl(e,t,{then:function(){},status:"rejected",reason:H},Et())}finally{$.p=c,m!==null&&_.types!==null&&(m.types=_.types),R.T=m}}function jg(){}function Br(e,t,n,a){if(e.tag!==5)throw Error(i(476));var o=vf(e).queue;xf(e,o,t,le,n===null?jg:function(){return Sf(e),n(a)})}function vf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:le,baseState:le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pt,lastRenderedState:le},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pt,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Sf(e){var t=vf(e);t.next===null&&(t=e.alternate.memoizedState),vl(e,t.next.queue,{},Et())}function Gr(){return et(Hl)}function Ef(){return Ye().memoizedState}function wf(){return Ye().memoizedState}function Ag(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Et();e=bn(n);var a=xn(t,e,n);a!==null&&(mt(a,t,n),gl(a,t,n)),t={cache:gr()},e.payload=t;return}t=t.return}}function Og(e,t,n){var a=Et();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Us(e)?Tf(t,n):(n=sr(e,t,n,a),n!==null&&(mt(n,e,a),kf(n,t,a)))}function Nf(e,t,n){var a=Et();vl(e,t,n,a)}function vl(e,t,n,a){var o={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Us(e))Tf(t,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var m=t.lastRenderedState,_=c(m,n);if(o.hasEagerState=!0,o.eagerState=_,_t(_,m))return gs(e,t,o,0),Oe===null&&hs(),!1}catch{}if(n=sr(e,t,o,a),n!==null)return mt(n,e,a),kf(n,t,a),!0}return!1}function Yr(e,t,n,a){if(a={lane:2,revertLane:vo(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Us(e)){if(t)throw Error(i(479))}else t=sr(e,n,a,2),t!==null&&mt(t,e,2)}function Us(e){var t=e.alternate;return e===ce||t!==null&&t===ce}function Tf(e,t){Aa=As=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function kf(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Cc(e,n)}}var Sl={readContext:et,use:Rs,useCallback:Le,useContext:Le,useEffect:Le,useImperativeHandle:Le,useLayoutEffect:Le,useInsertionEffect:Le,useMemo:Le,useReducer:Le,useRef:Le,useState:Le,useDebugValue:Le,useDeferredValue:Le,useTransition:Le,useSyncExternalStore:Le,useId:Le,useHostTransitionStatus:Le,useFormState:Le,useActionState:Le,useOptimistic:Le,useMemoCache:Le,useCacheRefresh:Le};Sl.useEffectEvent=Le;var jf={readContext:et,use:Rs,useCallback:function(e,t){return st().memoizedState=[e,t===void 0?null:t],e},useContext:et,useEffect:ff,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Ds(4194308,4,hf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ds(4194308,4,e,t)},useInsertionEffect:function(e,t){Ds(4,2,e,t)},useMemo:function(e,t){var n=st();t=t===void 0?null:t;var a=e();if(Wn){fn(!0);try{e()}finally{fn(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=st();if(n!==void 0){var o=n(t);if(Wn){fn(!0);try{n(t)}finally{fn(!1)}}}else o=t;return a.memoizedState=a.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},a.queue=e,e=e.dispatch=Og.bind(null,ce,e),[a.memoizedState,e]},useRef:function(e){var t=st();return e={current:e},t.memoizedState=e},useState:function(e){e=zr(e);var t=e.queue,n=Nf.bind(null,ce,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Hr,useDeferredValue:function(e,t){var n=st();return qr(n,e,t)},useTransition:function(){var e=zr(!1);return e=xf.bind(null,ce,e.queue,!0,!1),st().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=ce,o=st();if(ye){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Oe===null)throw Error(i(349));(ge&127)!==0||Iu(a,t,n)}o.memoizedState=n;var c={value:n,getSnapshot:t};return o.queue=c,ff(Ju.bind(null,a,c,e),[e]),a.flags|=2048,Ca(9,{destroy:void 0},Zu.bind(null,a,c,n,t),null),n},useId:function(){var e=st(),t=Oe.identifierPrefix;if(ye){var n=Gt,a=Bt;n=(a&~(1<<32-gt(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Os++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Eg++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Gr,useFormState:sf,useActionState:sf,useOptimistic:function(e){var t=st();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Yr.bind(null,ce,!0,n),n.dispatch=t,[e,t]},useMemoCache:Rr,useCacheRefresh:function(){return st().memoizedState=Ag.bind(null,ce)},useEffectEvent:function(e){var t=st(),n={impl:e};return t.memoizedState=n,function(){if((ve&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Qr={readContext:et,use:Rs,useCallback:_f,useContext:et,useEffect:Lr,useImperativeHandle:gf,useInsertionEffect:mf,useLayoutEffect:pf,useMemo:yf,useReducer:Ms,useRef:uf,useState:function(){return Ms(Pt)},useDebugValue:Hr,useDeferredValue:function(e,t){var n=Ye();return bf(n,ke.memoizedState,e,t)},useTransition:function(){var e=Ms(Pt)[0],t=Ye().memoizedState;return[typeof e=="boolean"?e:xl(e),t]},useSyncExternalStore:Ku,useId:Ef,useHostTransitionStatus:Gr,useFormState:rf,useActionState:rf,useOptimistic:function(e,t){var n=Ye();return Pu(n,ke,e,t)},useMemoCache:Rr,useCacheRefresh:wf};Qr.useEffectEvent=df;var Af={readContext:et,use:Rs,useCallback:_f,useContext:et,useEffect:Lr,useImperativeHandle:gf,useInsertionEffect:mf,useLayoutEffect:pf,useMemo:yf,useReducer:Dr,useRef:uf,useState:function(){return Dr(Pt)},useDebugValue:Hr,useDeferredValue:function(e,t){var n=Ye();return ke===null?qr(n,e,t):bf(n,ke.memoizedState,e,t)},useTransition:function(){var e=Dr(Pt)[0],t=Ye().memoizedState;return[typeof e=="boolean"?e:xl(e),t]},useSyncExternalStore:Ku,useId:Ef,useHostTransitionStatus:Gr,useFormState:cf,useActionState:cf,useOptimistic:function(e,t){var n=Ye();return ke!==null?Pu(n,ke,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Rr,useCacheRefresh:wf};Af.useEffectEvent=df;function Vr(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:x({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Xr={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=Et(),o=bn(a);o.payload=t,n!=null&&(o.callback=n),t=xn(e,o,a),t!==null&&(mt(t,e,a),gl(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=Et(),o=bn(a);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=xn(e,o,a),t!==null&&(mt(t,e,a),gl(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Et(),a=bn(n);a.tag=2,t!=null&&(a.callback=t),t=xn(e,a,n),t!==null&&(mt(t,e,n),gl(t,e,n))}};function Of(e,t,n,a,o,c,m){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,c,m):t.prototype&&t.prototype.isPureReactComponent?!ol(n,a)||!ol(o,c):!0}function Cf(e,t,n,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&Xr.enqueueReplaceState(t,t.state,null)}function Fn(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=x({},n));for(var o in e)n[o]===void 0&&(n[o]=e[o])}return n}function Rf(e){ps(e)}function Mf(e){console.error(e)}function Df(e){ps(e)}function Ls(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function zf(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function $r(e,t,n){return n=bn(n),n.tag=3,n.payload={element:null},n.callback=function(){Ls(e,t)},n}function Uf(e){return e=bn(e),e.tag=3,e}function Lf(e,t,n,a){var o=n.type.getDerivedStateFromError;if(typeof o=="function"){var c=a.value;e.payload=function(){return o(c)},e.callback=function(){zf(t,n,a)}}var m=n.stateNode;m!==null&&typeof m.componentDidCatch=="function"&&(e.callback=function(){zf(t,n,a),typeof o!="function"&&(Tn===null?Tn=new Set([this]):Tn.add(this));var _=a.stack;this.componentDidCatch(a.value,{componentStack:_!==null?_:""})})}function Cg(e,t,n,a,o){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&Ea(t,n,o,!0),n=bt.current,n!==null){switch(n.tag){case 31:case 13:return Mt===null?Zs():n.alternate===null&&He===0&&(He=3),n.flags&=-257,n.flags|=65536,n.lanes=o,a===ws?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),yo(e,a,o)),!1;case 22:return n.flags|=65536,a===ws?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([a]):n.add(a)),yo(e,a,o)),!1}throw Error(i(435,n.tag))}return yo(e,a,o),Zs(),!1}if(ye)return t=bt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,a!==fr&&(e=Error(i(422),{cause:a}),fl(At(e,n)))):(a!==fr&&(t=Error(i(423),{cause:a}),fl(At(t,n))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,a=At(a,n),o=$r(e.stateNode,a,o),Sr(e,o),He!==4&&(He=2)),!1;var c=Error(i(520),{cause:a});if(c=At(c,n),Ol===null?Ol=[c]:Ol.push(c),He!==4&&(He=2),t===null)return!0;a=At(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=o&-o,n.lanes|=e,e=$r(n.stateNode,a,e),Sr(n,e),!1;case 1:if(t=n.type,c=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(Tn===null||!Tn.has(c))))return n.flags|=65536,o&=-o,n.lanes|=o,o=Uf(o),Lf(o,e,n,a),Sr(n,o),!1}n=n.return}while(n!==null);return!1}var Kr=Error(i(461)),Xe=!1;function tt(e,t,n,a){t.child=e===null?Bu(t,null,n,a):Jn(t,e.child,n,a)}function Hf(e,t,n,a,o){n=n.render;var c=t.ref;if("ref"in a){var m={};for(var _ in a)_!=="ref"&&(m[_]=a[_])}else m=a;return $n(t),a=jr(e,t,n,m,c,o),_=Ar(),e!==null&&!Xe?(Or(e,t,o),en(e,t,o)):(ye&&_&&cr(t),t.flags|=1,tt(e,t,a,o),t.child)}function qf(e,t,n,a,o){if(e===null){var c=n.type;return typeof c=="function"&&!ir(c)&&c.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=c,Bf(e,t,c,a,o)):(e=ys(n.type,null,a,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!to(e,o)){var m=c.memoizedProps;if(n=n.compare,n=n!==null?n:ol,n(m,a)&&e.ref===t.ref)return en(e,t,o)}return t.flags|=1,e=It(c,a),e.ref=t.ref,e.return=t,t.child=e}function Bf(e,t,n,a,o){if(e!==null){var c=e.memoizedProps;if(ol(c,a)&&e.ref===t.ref)if(Xe=!1,t.pendingProps=a=c,to(e,o))(e.flags&131072)!==0&&(Xe=!0);else return t.lanes=e.lanes,en(e,t,o)}return Ir(e,t,n,a,o)}function Gf(e,t,n,a){var o=a.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|n:n,e!==null){for(a=t.child=e.child,o=0;a!==null;)o=o|a.lanes|a.childLanes,a=a.sibling;a=o&~c}else a=0,t.child=null;return Yf(e,t,c,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ss(t,c!==null?c.cachePool:null),c!==null?Qu(t,c):wr(),Vu(t);else return a=t.lanes=536870912,Yf(e,t,c!==null?c.baseLanes|n:n,n,a)}else c!==null?(Ss(t,c.cachePool),Qu(t,c),Sn(),t.memoizedState=null):(e!==null&&Ss(t,null),wr(),Sn());return tt(e,t,o,n),t.child}function El(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Yf(e,t,n,a,o){var c=yr();return c=c===null?null:{parent:Qe._currentValue,pool:c},t.memoizedState={baseLanes:n,cachePool:c},e!==null&&Ss(t,null),wr(),Vu(t),e!==null&&Ea(e,t,a,!0),t.childLanes=o,null}function Hs(e,t){return t=Bs({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Qf(e,t,n){return Jn(t,e.child,null,n),e=Hs(t,t.pendingProps),e.flags|=2,xt(t),t.memoizedState=null,e}function Rg(e,t,n){var a=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ye){if(a.mode==="hidden")return e=Hs(t,a),t.lanes=536870912,El(null,e);if(Tr(t),(e=Me)?(e=tm(e,Rt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:pn!==null?{id:Bt,overflow:Gt}:null,retryLane:536870912,hydrationErrors:null},n=Nu(e),n.return=t,t.child=n,Pe=t,Me=null)):e=null,e===null)throw gn(t);return t.lanes=536870912,null}return Hs(t,a)}var c=e.memoizedState;if(c!==null){var m=c.dehydrated;if(Tr(t),o)if(t.flags&256)t.flags&=-257,t=Qf(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Xe||Ea(e,t,n,!1),o=(n&e.childLanes)!==0,Xe||o){if(a=Oe,a!==null&&(m=Rc(a,n),m!==0&&m!==c.retryLane))throw c.retryLane=m,Yn(e,m),mt(a,e,m),Kr;Zs(),t=Qf(e,t,n)}else e=c.treeContext,Me=Dt(m.nextSibling),Pe=t,ye=!0,hn=null,Rt=!1,e!==null&&ju(t,e),t=Hs(t,a),t.flags|=4096;return t}return e=It(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function qs(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Ir(e,t,n,a,o){return $n(t),n=jr(e,t,n,a,void 0,o),a=Ar(),e!==null&&!Xe?(Or(e,t,o),en(e,t,o)):(ye&&a&&cr(t),t.flags|=1,tt(e,t,n,o),t.child)}function Vf(e,t,n,a,o,c){return $n(t),t.updateQueue=null,n=$u(t,a,n,o),Xu(e),a=Ar(),e!==null&&!Xe?(Or(e,t,c),en(e,t,c)):(ye&&a&&cr(t),t.flags|=1,tt(e,t,n,c),t.child)}function Xf(e,t,n,a,o){if($n(t),t.stateNode===null){var c=ba,m=n.contextType;typeof m=="object"&&m!==null&&(c=et(m)),c=new n(a,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Xr,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=a,c.state=t.memoizedState,c.refs={},xr(t),m=n.contextType,c.context=typeof m=="object"&&m!==null?et(m):ba,c.state=t.memoizedState,m=n.getDerivedStateFromProps,typeof m=="function"&&(Vr(t,n,m,a),c.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(m=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),m!==c.state&&Xr.enqueueReplaceState(c,c.state,null),yl(t,a,c,o),_l(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){c=t.stateNode;var _=t.memoizedProps,v=Fn(n,_);c.props=v;var k=c.context,C=n.contextType;m=ba,typeof C=="object"&&C!==null&&(m=et(C));var H=n.getDerivedStateFromProps;C=typeof H=="function"||typeof c.getSnapshotBeforeUpdate=="function",_=t.pendingProps!==_,C||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(_||k!==m)&&Cf(t,c,a,m),yn=!1;var A=t.memoizedState;c.state=A,yl(t,a,c,o),_l(),k=t.memoizedState,_||A!==k||yn?(typeof H=="function"&&(Vr(t,n,H,a),k=t.memoizedState),(v=yn||Of(t,n,v,a,A,k,m))?(C||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=k),c.props=a,c.state=k,c.context=m,a=v):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{c=t.stateNode,vr(e,t),m=t.memoizedProps,C=Fn(n,m),c.props=C,H=t.pendingProps,A=c.context,k=n.contextType,v=ba,typeof k=="object"&&k!==null&&(v=et(k)),_=n.getDerivedStateFromProps,(k=typeof _=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(m!==H||A!==v)&&Cf(t,c,a,v),yn=!1,A=t.memoizedState,c.state=A,yl(t,a,c,o),_l();var O=t.memoizedState;m!==H||A!==O||yn||e!==null&&e.dependencies!==null&&xs(e.dependencies)?(typeof _=="function"&&(Vr(t,n,_,a),O=t.memoizedState),(C=yn||Of(t,n,C,a,A,O,v)||e!==null&&e.dependencies!==null&&xs(e.dependencies))?(k||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(a,O,v),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(a,O,v)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||m===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=O),c.props=a,c.state=O,c.context=v,a=C):(typeof c.componentDidUpdate!="function"||m===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),a=!1)}return c=a,qs(e,t),a=(t.flags&128)!==0,c||a?(c=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&a?(t.child=Jn(t,e.child,null,o),t.child=Jn(t,null,n,o)):tt(e,t,n,o),t.memoizedState=c.state,e=t.child):e=en(e,t,o),e}function $f(e,t,n,a){return Vn(),t.flags|=256,tt(e,t,n,a),t.child}var Zr={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Jr(e){return{baseLanes:e,cachePool:Du()}}function Wr(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=St),e}function Kf(e,t,n){var a=t.pendingProps,o=!1,c=(t.flags&128)!==0,m;if((m=c)||(m=e!==null&&e.memoizedState===null?!1:(Ge.current&2)!==0),m&&(o=!0,t.flags&=-129),m=(t.flags&32)!==0,t.flags&=-33,e===null){if(ye){if(o?vn(t):Sn(),(e=Me)?(e=tm(e,Rt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:pn!==null?{id:Bt,overflow:Gt}:null,retryLane:536870912,hydrationErrors:null},n=Nu(e),n.return=t,t.child=n,Pe=t,Me=null)):e=null,e===null)throw gn(t);return Do(e)?t.lanes=32:t.lanes=536870912,null}var _=a.children;return a=a.fallback,o?(Sn(),o=t.mode,_=Bs({mode:"hidden",children:_},o),a=Qn(a,o,n,null),_.return=t,a.return=t,_.sibling=a,t.child=_,a=t.child,a.memoizedState=Jr(n),a.childLanes=Wr(e,m,n),t.memoizedState=Zr,El(null,a)):(vn(t),Fr(t,_))}var v=e.memoizedState;if(v!==null&&(_=v.dehydrated,_!==null)){if(c)t.flags&256?(vn(t),t.flags&=-257,t=Pr(e,t,n)):t.memoizedState!==null?(Sn(),t.child=e.child,t.flags|=128,t=null):(Sn(),_=a.fallback,o=t.mode,a=Bs({mode:"visible",children:a.children},o),_=Qn(_,o,n,null),_.flags|=2,a.return=t,_.return=t,a.sibling=_,t.child=a,Jn(t,e.child,null,n),a=t.child,a.memoizedState=Jr(n),a.childLanes=Wr(e,m,n),t.memoizedState=Zr,t=El(null,a));else if(vn(t),Do(_)){if(m=_.nextSibling&&_.nextSibling.dataset,m)var k=m.dgst;m=k,a=Error(i(419)),a.stack="",a.digest=m,fl({value:a,source:null,stack:null}),t=Pr(e,t,n)}else if(Xe||Ea(e,t,n,!1),m=(n&e.childLanes)!==0,Xe||m){if(m=Oe,m!==null&&(a=Rc(m,n),a!==0&&a!==v.retryLane))throw v.retryLane=a,Yn(e,a),mt(m,e,a),Kr;Mo(_)||Zs(),t=Pr(e,t,n)}else Mo(_)?(t.flags|=192,t.child=e.child,t=null):(e=v.treeContext,Me=Dt(_.nextSibling),Pe=t,ye=!0,hn=null,Rt=!1,e!==null&&ju(t,e),t=Fr(t,a.children),t.flags|=4096);return t}return o?(Sn(),_=a.fallback,o=t.mode,v=e.child,k=v.sibling,a=It(v,{mode:"hidden",children:a.children}),a.subtreeFlags=v.subtreeFlags&65011712,k!==null?_=It(k,_):(_=Qn(_,o,n,null),_.flags|=2),_.return=t,a.return=t,a.sibling=_,t.child=a,El(null,a),a=t.child,_=e.child.memoizedState,_===null?_=Jr(n):(o=_.cachePool,o!==null?(v=Qe._currentValue,o=o.parent!==v?{parent:v,pool:v}:o):o=Du(),_={baseLanes:_.baseLanes|n,cachePool:o}),a.memoizedState=_,a.childLanes=Wr(e,m,n),t.memoizedState=Zr,El(e.child,a)):(vn(t),n=e.child,e=n.sibling,n=It(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(m=t.deletions,m===null?(t.deletions=[e],t.flags|=16):m.push(e)),t.child=n,t.memoizedState=null,n)}function Fr(e,t){return t=Bs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Bs(e,t){return e=yt(22,e,null,t),e.lanes=0,e}function Pr(e,t,n){return Jn(t,e.child,null,n),e=Fr(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function If(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),pr(e.return,t,n)}function eo(e,t,n,a,o,c){var m=e.memoizedState;m===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:o,treeForkCount:c}:(m.isBackwards=t,m.rendering=null,m.renderingStartTime=0,m.last=a,m.tail=n,m.tailMode=o,m.treeForkCount=c)}function Zf(e,t,n){var a=t.pendingProps,o=a.revealOrder,c=a.tail;a=a.children;var m=Ge.current,_=(m&2)!==0;if(_?(m=m&1|2,t.flags|=128):m&=1,I(Ge,m),tt(e,t,a,n),a=ye?ul:0,!_&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&If(e,n,t);else if(e.tag===19)If(e,n,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(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&js(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),eo(t,!1,o,n,c,a);break;case"backwards":case"unstable_legacy-backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&js(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}eo(t,!0,n,null,c,a);break;case"together":eo(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function en(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Nn|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ea(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=It(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=It(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function to(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&xs(e)))}function Mg(e,t,n){switch(t.tag){case 3:lt(t,t.stateNode.containerInfo),_n(t,Qe,e.memoizedState.cache),Vn();break;case 27:case 5:Za(t);break;case 4:lt(t,t.stateNode.containerInfo);break;case 10:_n(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Tr(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(vn(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Kf(e,t,n):(vn(t),e=en(e,t,n),e!==null?e.sibling:null);vn(t);break;case 19:var o=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(Ea(e,t,n,!1),a=(n&t.childLanes)!==0),o){if(a)return Zf(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),I(Ge,Ge.current),a)break;return null;case 22:return t.lanes=0,Gf(e,t,n,t.pendingProps);case 24:_n(t,Qe,e.memoizedState.cache)}return en(e,t,n)}function Jf(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Xe=!0;else{if(!to(e,n)&&(t.flags&128)===0)return Xe=!1,Mg(e,t,n);Xe=(e.flags&131072)!==0}else Xe=!1,ye&&(t.flags&1048576)!==0&&ku(t,ul,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=In(t.elementType),t.type=e,typeof e=="function")ir(e)?(a=Fn(e,a),t.tag=1,t=Xf(null,t,e,a,n)):(t.tag=0,t=Ir(null,t,e,a,n));else{if(e!=null){var o=e.$$typeof;if(o===K){t.tag=11,t=Hf(null,t,e,a,n);break e}else if(o===Z){t.tag=14,t=qf(null,t,e,a,n);break e}}throw t=ze(e)||e,Error(i(306,t,""))}}return t;case 0:return Ir(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,o=Fn(a,t.pendingProps),Xf(e,t,a,o,n);case 3:e:{if(lt(t,t.stateNode.containerInfo),e===null)throw Error(i(387));a=t.pendingProps;var c=t.memoizedState;o=c.element,vr(e,t),yl(t,a,null,n);var m=t.memoizedState;if(a=m.cache,_n(t,Qe,a),a!==c.cache&&hr(t,[Qe],n,!0),_l(),a=m.element,c.isDehydrated)if(c={element:a,isDehydrated:!1,cache:m.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=$f(e,t,a,n);break e}else if(a!==o){o=At(Error(i(424)),t),fl(o),t=$f(e,t,a,n);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Me=Dt(e.firstChild),Pe=t,ye=!0,hn=null,Rt=!0,n=Bu(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Vn(),a===o){t=en(e,t,n);break e}tt(e,t,a,n)}t=t.child}return t;case 26:return qs(e,t),e===null?(n=rm(t.type,null,t.pendingProps,null))?t.memoizedState=n:ye||(n=t.type,e=t.pendingProps,a=ni(me.current).createElement(n),a[Fe]=t,a[rt]=e,nt(a,n,e),Ze(a),t.stateNode=a):t.memoizedState=rm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Za(t),e===null&&ye&&(a=t.stateNode=lm(t.type,t.pendingProps,me.current),Pe=t,Rt=!0,o=Me,On(t.type)?(zo=o,Me=Dt(a.firstChild)):Me=o),tt(e,t,t.pendingProps.children,n),qs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ye&&((o=a=Me)&&(a=c_(a,t.type,t.pendingProps,Rt),a!==null?(t.stateNode=a,Pe=t,Me=Dt(a.firstChild),Rt=!1,o=!0):o=!1),o||gn(t)),Za(t),o=t.type,c=t.pendingProps,m=e!==null?e.memoizedProps:null,a=c.children,Oo(o,c)?a=null:m!==null&&Oo(o,m)&&(t.flags|=32),t.memoizedState!==null&&(o=jr(e,t,wg,null,null,n),Hl._currentValue=o),qs(e,t),tt(e,t,a,n),t.child;case 6:return e===null&&ye&&((e=n=Me)&&(n=u_(n,t.pendingProps,Rt),n!==null?(t.stateNode=n,Pe=t,Me=null,e=!0):e=!1),e||gn(t)),null;case 13:return Kf(e,t,n);case 4:return lt(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Jn(t,null,a,n):tt(e,t,a,n),t.child;case 11:return Hf(e,t,t.type,t.pendingProps,n);case 7:return tt(e,t,t.pendingProps,n),t.child;case 8:return tt(e,t,t.pendingProps.children,n),t.child;case 12:return tt(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,_n(t,t.type,a.value),tt(e,t,a.children,n),t.child;case 9:return o=t.type._context,a=t.pendingProps.children,$n(t),o=et(o),a=a(o),t.flags|=1,tt(e,t,a,n),t.child;case 14:return qf(e,t,t.type,t.pendingProps,n);case 15:return Bf(e,t,t.type,t.pendingProps,n);case 19:return Zf(e,t,n);case 31:return Rg(e,t,n);case 22:return Gf(e,t,n,t.pendingProps);case 24:return $n(t),a=et(Qe),e===null?(o=yr(),o===null&&(o=Oe,c=gr(),o.pooledCache=c,c.refCount++,c!==null&&(o.pooledCacheLanes|=n),o=c),t.memoizedState={parent:a,cache:o},xr(t),_n(t,Qe,o)):((e.lanes&n)!==0&&(vr(e,t),yl(t,null,null,n),_l()),o=e.memoizedState,c=t.memoizedState,o.parent!==a?(o={parent:a,cache:a},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),_n(t,Qe,a)):(a=c.cache,_n(t,Qe,a),a!==o.cache&&hr(t,[Qe],n,!0))),tt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function tn(e){e.flags|=4}function no(e,t,n,a,o){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(o&335544128)===o)if(e.stateNode.complete)e.flags|=8192;else if(Ed())e.flags|=8192;else throw Zn=ws,br}else e.flags&=-16777217}function Wf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!dm(t))if(Ed())e.flags|=8192;else throw Zn=ws,br}function Gs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ac():536870912,e.lanes|=t,za|=t)}function wl(e,t){if(!ye)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function De(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,a|=o.subtreeFlags&65011712,a|=o.flags&65011712,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,a|=o.subtreeFlags,a|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function Dg(e,t,n){var a=t.pendingProps;switch(ur(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return De(t),null;case 1:return De(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Wt(Qe),Be(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Sa(t)?tn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,dr())),De(t),null;case 26:var o=t.type,c=t.memoizedState;return e===null?(tn(t),c!==null?(De(t),Wf(t,c)):(De(t),no(t,o,null,a,n))):c?c!==e.memoizedState?(tn(t),De(t),Wf(t,c)):(De(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&tn(t),De(t),no(t,o,e,a,n)),null;case 27:if(Fl(t),n=me.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&tn(t);else{if(!a){if(t.stateNode===null)throw Error(i(166));return De(t),null}e=F.current,Sa(t)?Au(t):(e=lm(o,a,n),t.stateNode=e,tn(t))}return De(t),null;case 5:if(Fl(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&tn(t);else{if(!a){if(t.stateNode===null)throw Error(i(166));return De(t),null}if(c=F.current,Sa(t))Au(t);else{var m=ni(me.current);switch(c){case 1:c=m.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:c=m.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":c=m.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":c=m.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":c=m.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof a.is=="string"?m.createElement("select",{is:a.is}):m.createElement("select"),a.multiple?c.multiple=!0:a.size&&(c.size=a.size);break;default:c=typeof a.is=="string"?m.createElement(o,{is:a.is}):m.createElement(o)}}c[Fe]=t,c[rt]=a;e:for(m=t.child;m!==null;){if(m.tag===5||m.tag===6)c.appendChild(m.stateNode);else if(m.tag!==4&&m.tag!==27&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===t)break e;for(;m.sibling===null;){if(m.return===null||m.return===t)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}t.stateNode=c;e:switch(nt(c,o,a),o){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&tn(t)}}return De(t),no(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&tn(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(i(166));if(e=me.current,Sa(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,o=Pe,o!==null)switch(o.tag){case 27:case 5:a=o.memoizedProps}e[Fe]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||Kd(e.nodeValue,n)),e||gn(t,!0)}else e=ni(e).createTextNode(a),e[Fe]=t,t.stateNode=e}return De(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Sa(t),n!==null){if(e===null){if(!a)throw Error(i(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[Fe]=t}else Vn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;De(t),e=!1}else n=dr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(xt(t),t):(xt(t),null);if((t.flags&128)!==0)throw Error(i(558))}return De(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=Sa(t),a!==null&&a.dehydrated!==null){if(e===null){if(!o)throw Error(i(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(i(317));o[Fe]=t}else Vn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;De(t),o=!1}else o=dr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(xt(t),t):(xt(t),null)}return xt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,o=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(o=a.alternate.memoizedState.cachePool.pool),c=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),c!==o&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Gs(t,t.updateQueue),De(t),null);case 4:return Be(),e===null&&No(t.stateNode.containerInfo),De(t),null;case 10:return Wt(t.type),De(t),null;case 19:if(L(Ge),a=t.memoizedState,a===null)return De(t),null;if(o=(t.flags&128)!==0,c=a.rendering,c===null)if(o)wl(a,!1);else{if(He!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=js(e),c!==null){for(t.flags|=128,wl(a,!1),e=c.updateQueue,t.updateQueue=e,Gs(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)wu(n,e),n=n.sibling;return I(Ge,Ge.current&1|2),ye&&Zt(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&pt()>$s&&(t.flags|=128,o=!0,wl(a,!1),t.lanes=4194304)}else{if(!o)if(e=js(c),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,Gs(t,e),wl(a,!0),a.tail===null&&a.tailMode==="hidden"&&!c.alternate&&!ye)return De(t),null}else 2*pt()-a.renderingStartTime>$s&&n!==536870912&&(t.flags|=128,o=!0,wl(a,!1),t.lanes=4194304);a.isBackwards?(c.sibling=t.child,t.child=c):(e=a.last,e!==null?e.sibling=c:t.child=c,a.last=c)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=pt(),e.sibling=null,n=Ge.current,I(Ge,o?n&1|2:n&1),ye&&Zt(t,a.treeForkCount),e):(De(t),null);case 22:case 23:return xt(t),Nr(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&(De(t),t.subtreeFlags&6&&(t.flags|=8192)):De(t),n=t.updateQueue,n!==null&&Gs(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&L(Kn),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Wt(Qe),De(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function zg(e,t){switch(ur(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wt(Qe),Be(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Fl(t),null;case 31:if(t.memoizedState!==null){if(xt(t),t.alternate===null)throw Error(i(340));Vn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(xt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Vn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return L(Ge),null;case 4:return Be(),null;case 10:return Wt(t.type),null;case 22:case 23:return xt(t),Nr(),e!==null&&L(Kn),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Wt(Qe),null;case 25:return null;default:return null}}function Ff(e,t){switch(ur(t),t.tag){case 3:Wt(Qe),Be();break;case 26:case 27:case 5:Fl(t);break;case 4:Be();break;case 31:t.memoizedState!==null&&xt(t);break;case 13:xt(t);break;case 19:L(Ge);break;case 10:Wt(t.type);break;case 22:case 23:xt(t),Nr(),e!==null&&L(Kn);break;case 24:Wt(Qe)}}function Nl(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var o=a.next;n=o;do{if((n.tag&e)===e){a=void 0;var c=n.create,m=n.inst;a=c(),m.destroy=a}n=n.next}while(n!==o)}}catch(_){Ne(t,t.return,_)}}function En(e,t,n){try{var a=t.updateQueue,o=a!==null?a.lastEffect:null;if(o!==null){var c=o.next;a=c;do{if((a.tag&e)===e){var m=a.inst,_=m.destroy;if(_!==void 0){m.destroy=void 0,o=t;var v=n,k=_;try{k()}catch(C){Ne(o,v,C)}}}a=a.next}while(a!==c)}}catch(C){Ne(t,t.return,C)}}function Pf(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Yu(t,n)}catch(a){Ne(e,e.return,a)}}}function ed(e,t,n){n.props=Fn(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){Ne(e,t,a)}}function Tl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(o){Ne(e,t,o)}}function Yt(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(o){Ne(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(o){Ne(e,t,o)}else n.current=null}function td(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(o){Ne(e,e.return,o)}}function ao(e,t,n){try{var a=e.stateNode;a_(a,e.type,n,t),a[rt]=t}catch(o){Ne(e,e.return,o)}}function nd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&On(e.type)||e.tag===4}function lo(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||nd(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&&On(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 so(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=$t));else if(a!==4&&(a===27&&On(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(so(e,t,n),e=e.sibling;e!==null;)so(e,t,n),e=e.sibling}function Ys(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(a!==4&&(a===27&&On(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Ys(e,t,n),e=e.sibling;e!==null;)Ys(e,t,n),e=e.sibling}function ad(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);nt(t,a,n),t[Fe]=e,t[rt]=n}catch(c){Ne(e,e.return,c)}}var nn=!1,$e=!1,io=!1,ld=typeof WeakSet=="function"?WeakSet:Set,Je=null;function Ug(e,t){if(e=e.containerInfo,jo=ci,e=hu(e),Pi(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var o=a.anchorOffset,c=a.focusNode;a=a.focusOffset;try{n.nodeType,c.nodeType}catch{n=null;break e}var m=0,_=-1,v=-1,k=0,C=0,H=e,A=null;t:for(;;){for(var O;H!==n||o!==0&&H.nodeType!==3||(_=m+o),H!==c||a!==0&&H.nodeType!==3||(v=m+a),H.nodeType===3&&(m+=H.nodeValue.length),(O=H.firstChild)!==null;)A=H,H=O;for(;;){if(H===e)break t;if(A===n&&++k===o&&(_=m),A===c&&++C===a&&(v=m),(O=H.nextSibling)!==null)break;H=A,A=H.parentNode}H=O}n=_===-1||v===-1?null:{start:_,end:v}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ao={focusedElem:e,selectionRange:n},ci=!1,Je=t;Je!==null;)if(t=Je,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Je=e;else for(;Je!==null;){switch(t=Je,c=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(n=0;n<e.length;n++)o=e[n],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&c!==null){e=void 0,n=t,o=c.memoizedProps,c=c.memoizedState,a=n.stateNode;try{var J=Fn(n.type,o);e=a.getSnapshotBeforeUpdate(J,c),a.__reactInternalSnapshotBeforeUpdate=e}catch(ae){Ne(n,n.return,ae)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Ro(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Ro(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(i(163))}if(e=t.sibling,e!==null){e.return=t.return,Je=e;break}Je=t.return}}function sd(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:ln(e,n),a&4&&Nl(5,n);break;case 1:if(ln(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(m){Ne(n,n.return,m)}else{var o=Fn(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(m){Ne(n,n.return,m)}}a&64&&Pf(n),a&512&&Tl(n,n.return);break;case 3:if(ln(e,n),a&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Yu(e,t)}catch(m){Ne(n,n.return,m)}}break;case 27:t===null&&a&4&&ad(n);case 26:case 5:ln(e,n),t===null&&a&4&&td(n),a&512&&Tl(n,n.return);break;case 12:ln(e,n);break;case 31:ln(e,n),a&4&&od(e,n);break;case 13:ln(e,n),a&4&&cd(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Xg.bind(null,n),f_(e,n))));break;case 22:if(a=n.memoizedState!==null||nn,!a){t=t!==null&&t.memoizedState!==null||$e,o=nn;var c=$e;nn=a,($e=t)&&!c?sn(e,n,(n.subtreeFlags&8772)!==0):ln(e,n),nn=o,$e=c}break;case 30:break;default:ln(e,n)}}function id(e){var t=e.alternate;t!==null&&(e.alternate=null,id(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ui(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 Ue=null,ct=!1;function an(e,t,n){for(n=n.child;n!==null;)rd(e,t,n),n=n.sibling}function rd(e,t,n){if(ht&&typeof ht.onCommitFiberUnmount=="function")try{ht.onCommitFiberUnmount(Ja,n)}catch{}switch(n.tag){case 26:$e||Yt(n,t),an(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$e||Yt(n,t);var a=Ue,o=ct;On(n.type)&&(Ue=n.stateNode,ct=!1),an(e,t,n),zl(n.stateNode),Ue=a,ct=o;break;case 5:$e||Yt(n,t);case 6:if(a=Ue,o=ct,Ue=null,an(e,t,n),Ue=a,ct=o,Ue!==null)if(ct)try{(Ue.nodeType===9?Ue.body:Ue.nodeName==="HTML"?Ue.ownerDocument.body:Ue).removeChild(n.stateNode)}catch(c){Ne(n,t,c)}else try{Ue.removeChild(n.stateNode)}catch(c){Ne(n,t,c)}break;case 18:Ue!==null&&(ct?(e=Ue,Pd(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Qa(e)):Pd(Ue,n.stateNode));break;case 4:a=Ue,o=ct,Ue=n.stateNode.containerInfo,ct=!0,an(e,t,n),Ue=a,ct=o;break;case 0:case 11:case 14:case 15:En(2,n,t),$e||En(4,n,t),an(e,t,n);break;case 1:$e||(Yt(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&ed(n,t,a)),an(e,t,n);break;case 21:an(e,t,n);break;case 22:$e=(a=$e)||n.memoizedState!==null,an(e,t,n),$e=a;break;default:an(e,t,n)}}function od(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Qa(e)}catch(n){Ne(t,t.return,n)}}}function cd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Qa(e)}catch(n){Ne(t,t.return,n)}}function Lg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ld),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ld),t;default:throw Error(i(435,e.tag))}}function Qs(e,t){var n=Lg(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var o=$g.bind(null,e,a);a.then(o,o)}})}function ut(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var o=n[a],c=e,m=t,_=m;e:for(;_!==null;){switch(_.tag){case 27:if(On(_.type)){Ue=_.stateNode,ct=!1;break e}break;case 5:Ue=_.stateNode,ct=!1;break e;case 3:case 4:Ue=_.stateNode.containerInfo,ct=!0;break e}_=_.return}if(Ue===null)throw Error(i(160));rd(c,m,o),Ue=null,ct=!1,c=o.alternate,c!==null&&(c.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ud(t,e),t=t.sibling}var Lt=null;function ud(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ut(t,e),ft(e),a&4&&(En(3,e,e.return),Nl(3,e),En(5,e,e.return));break;case 1:ut(t,e),ft(e),a&512&&($e||n===null||Yt(n,n.return)),a&64&&nn&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?a:n.concat(a))));break;case 26:var o=Lt;if(ut(t,e),ft(e),a&512&&($e||n===null||Yt(n,n.return)),a&4){var c=n!==null?n.memoizedState:null;if(a=e.memoizedState,n===null)if(a===null)if(e.stateNode===null){e:{a=e.type,n=e.memoizedProps,o=o.ownerDocument||o;t:switch(a){case"title":c=o.getElementsByTagName("title")[0],(!c||c[Pa]||c[Fe]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=o.createElement(a),o.head.insertBefore(c,o.querySelector("head > title"))),nt(c,a,n),c[Fe]=e,Ze(c),a=c;break e;case"link":var m=um("link","href",o).get(a+(n.href||""));if(m){for(var _=0;_<m.length;_++)if(c=m[_],c.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&c.getAttribute("rel")===(n.rel==null?null:n.rel)&&c.getAttribute("title")===(n.title==null?null:n.title)&&c.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){m.splice(_,1);break t}}c=o.createElement(a),nt(c,a,n),o.head.appendChild(c);break;case"meta":if(m=um("meta","content",o).get(a+(n.content||""))){for(_=0;_<m.length;_++)if(c=m[_],c.getAttribute("content")===(n.content==null?null:""+n.content)&&c.getAttribute("name")===(n.name==null?null:n.name)&&c.getAttribute("property")===(n.property==null?null:n.property)&&c.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&c.getAttribute("charset")===(n.charSet==null?null:n.charSet)){m.splice(_,1);break t}}c=o.createElement(a),nt(c,a,n),o.head.appendChild(c);break;default:throw Error(i(468,a))}c[Fe]=e,Ze(c),a=c}e.stateNode=a}else fm(o,e.type,e.stateNode);else e.stateNode=cm(o,a,e.memoizedProps);else c!==a?(c===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):c.count--,a===null?fm(o,e.type,e.stateNode):cm(o,a,e.memoizedProps)):a===null&&e.stateNode!==null&&ao(e,e.memoizedProps,n.memoizedProps)}break;case 27:ut(t,e),ft(e),a&512&&($e||n===null||Yt(n,n.return)),n!==null&&a&4&&ao(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ut(t,e),ft(e),a&512&&($e||n===null||Yt(n,n.return)),e.flags&32){o=e.stateNode;try{da(o,"")}catch(J){Ne(e,e.return,J)}}a&4&&e.stateNode!=null&&(o=e.memoizedProps,ao(e,o,n!==null?n.memoizedProps:o)),a&1024&&(io=!0);break;case 6:if(ut(t,e),ft(e),a&4){if(e.stateNode===null)throw Error(i(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(J){Ne(e,e.return,J)}}break;case 3:if(si=null,o=Lt,Lt=ai(t.containerInfo),ut(t,e),Lt=o,ft(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{Qa(t.containerInfo)}catch(J){Ne(e,e.return,J)}io&&(io=!1,fd(e));break;case 4:a=Lt,Lt=ai(e.stateNode.containerInfo),ut(t,e),ft(e),Lt=a;break;case 12:ut(t,e),ft(e);break;case 31:ut(t,e),ft(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Qs(e,a)));break;case 13:ut(t,e),ft(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Xs=pt()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Qs(e,a)));break;case 22:o=e.memoizedState!==null;var v=n!==null&&n.memoizedState!==null,k=nn,C=$e;if(nn=k||o,$e=C||v,ut(t,e),$e=C,nn=k,ft(e),a&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(n===null||v||nn||$e||Pn(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){v=n=t;try{if(c=v.stateNode,o)m=c.style,typeof m.setProperty=="function"?m.setProperty("display","none","important"):m.display="none";else{_=v.stateNode;var H=v.memoizedProps.style,A=H!=null&&H.hasOwnProperty("display")?H.display:null;_.style.display=A==null||typeof A=="boolean"?"":(""+A).trim()}}catch(J){Ne(v,v.return,J)}}}else if(t.tag===6){if(n===null){v=t;try{v.stateNode.nodeValue=o?"":v.memoizedProps}catch(J){Ne(v,v.return,J)}}}else if(t.tag===18){if(n===null){v=t;try{var O=v.stateNode;o?em(O,!0):em(v.stateNode,!1)}catch(J){Ne(v,v.return,J)}}}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;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(n=a.retryQueue,n!==null&&(a.retryQueue=null,Qs(e,n))));break;case 19:ut(t,e),ft(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Qs(e,a)));break;case 30:break;case 21:break;default:ut(t,e),ft(e)}}function ft(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(nd(a)){n=a;break}a=a.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var o=n.stateNode,c=lo(e);Ys(e,c,o);break;case 5:var m=n.stateNode;n.flags&32&&(da(m,""),n.flags&=-33);var _=lo(e);Ys(e,_,m);break;case 3:case 4:var v=n.stateNode.containerInfo,k=lo(e);so(e,k,v);break;default:throw Error(i(161))}}catch(C){Ne(e,e.return,C)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function fd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;fd(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ln(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)sd(e,t.alternate,t),t=t.sibling}function Pn(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:En(4,t,t.return),Pn(t);break;case 1:Yt(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&ed(t,t.return,n),Pn(t);break;case 27:zl(t.stateNode);case 26:case 5:Yt(t,t.return),Pn(t);break;case 22:t.memoizedState===null&&Pn(t);break;case 30:Pn(t);break;default:Pn(t)}e=e.sibling}}function sn(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,o=e,c=t,m=c.flags;switch(c.tag){case 0:case 11:case 15:sn(o,c,n),Nl(4,c);break;case 1:if(sn(o,c,n),a=c,o=a.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(k){Ne(a,a.return,k)}if(a=c,o=a.updateQueue,o!==null){var _=a.stateNode;try{var v=o.shared.hiddenCallbacks;if(v!==null)for(o.shared.hiddenCallbacks=null,o=0;o<v.length;o++)Gu(v[o],_)}catch(k){Ne(a,a.return,k)}}n&&m&64&&Pf(c),Tl(c,c.return);break;case 27:ad(c);case 26:case 5:sn(o,c,n),n&&a===null&&m&4&&td(c),Tl(c,c.return);break;case 12:sn(o,c,n);break;case 31:sn(o,c,n),n&&m&4&&od(o,c);break;case 13:sn(o,c,n),n&&m&4&&cd(o,c);break;case 22:c.memoizedState===null&&sn(o,c,n),Tl(c,c.return);break;case 30:break;default:sn(o,c,n)}t=t.sibling}}function ro(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&dl(n))}function oo(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&dl(e))}function Ht(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)dd(e,t,n,a),t=t.sibling}function dd(e,t,n,a){var o=t.flags;switch(t.tag){case 0:case 11:case 15:Ht(e,t,n,a),o&2048&&Nl(9,t);break;case 1:Ht(e,t,n,a);break;case 3:Ht(e,t,n,a),o&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&dl(e)));break;case 12:if(o&2048){Ht(e,t,n,a),e=t.stateNode;try{var c=t.memoizedProps,m=c.id,_=c.onPostCommit;typeof _=="function"&&_(m,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(v){Ne(t,t.return,v)}}else Ht(e,t,n,a);break;case 31:Ht(e,t,n,a);break;case 13:Ht(e,t,n,a);break;case 23:break;case 22:c=t.stateNode,m=t.alternate,t.memoizedState!==null?c._visibility&2?Ht(e,t,n,a):kl(e,t):c._visibility&2?Ht(e,t,n,a):(c._visibility|=2,Ra(e,t,n,a,(t.subtreeFlags&10256)!==0||!1)),o&2048&&ro(m,t);break;case 24:Ht(e,t,n,a),o&2048&&oo(t.alternate,t);break;default:Ht(e,t,n,a)}}function Ra(e,t,n,a,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,m=t,_=n,v=a,k=m.flags;switch(m.tag){case 0:case 11:case 15:Ra(c,m,_,v,o),Nl(8,m);break;case 23:break;case 22:var C=m.stateNode;m.memoizedState!==null?C._visibility&2?Ra(c,m,_,v,o):kl(c,m):(C._visibility|=2,Ra(c,m,_,v,o)),o&&k&2048&&ro(m.alternate,m);break;case 24:Ra(c,m,_,v,o),o&&k&2048&&oo(m.alternate,m);break;default:Ra(c,m,_,v,o)}t=t.sibling}}function kl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,o=a.flags;switch(a.tag){case 22:kl(n,a),o&2048&&ro(a.alternate,a);break;case 24:kl(n,a),o&2048&&oo(a.alternate,a);break;default:kl(n,a)}t=t.sibling}}var jl=8192;function Ma(e,t,n){if(e.subtreeFlags&jl)for(e=e.child;e!==null;)md(e,t,n),e=e.sibling}function md(e,t,n){switch(e.tag){case 26:Ma(e,t,n),e.flags&jl&&e.memoizedState!==null&&E_(n,Lt,e.memoizedState,e.memoizedProps);break;case 5:Ma(e,t,n);break;case 3:case 4:var a=Lt;Lt=ai(e.stateNode.containerInfo),Ma(e,t,n),Lt=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=jl,jl=16777216,Ma(e,t,n),jl=a):Ma(e,t,n));break;default:Ma(e,t,n)}}function pd(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 Al(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Je=a,gd(a,e)}pd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)hd(e),e=e.sibling}function hd(e){switch(e.tag){case 0:case 11:case 15:Al(e),e.flags&2048&&En(9,e,e.return);break;case 3:Al(e);break;case 12:Al(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Vs(e)):Al(e);break;default:Al(e)}}function Vs(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Je=a,gd(a,e)}pd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:En(8,t,t.return),Vs(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Vs(t));break;default:Vs(t)}e=e.sibling}}function gd(e,t){for(;Je!==null;){var n=Je;switch(n.tag){case 0:case 11:case 15:En(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:dl(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,Je=a;else e:for(n=e;Je!==null;){a=Je;var o=a.sibling,c=a.return;if(id(a),a===n){Je=null;break e}if(o!==null){o.return=c,Je=o;break e}Je=c}}}var Hg={getCacheForType:function(e){var t=et(Qe),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return et(Qe).controller.signal}},qg=typeof WeakMap=="function"?WeakMap:Map,ve=0,Oe=null,pe=null,ge=0,we=0,vt=null,wn=!1,Da=!1,co=!1,rn=0,He=0,Nn=0,ea=0,uo=0,St=0,za=0,Ol=null,dt=null,fo=!1,Xs=0,_d=0,$s=1/0,Ks=null,Tn=null,Ie=0,kn=null,Ua=null,on=0,mo=0,po=null,yd=null,Cl=0,ho=null;function Et(){return(ve&2)!==0&&ge!==0?ge&-ge:R.T!==null?vo():Mc()}function bd(){if(St===0)if((ge&536870912)===0||ye){var e=ts;ts<<=1,(ts&3932160)===0&&(ts=262144),St=e}else St=536870912;return e=bt.current,e!==null&&(e.flags|=32),St}function mt(e,t,n){(e===Oe&&(we===2||we===9)||e.cancelPendingCommit!==null)&&(La(e,0),jn(e,ge,St,!1)),Fa(e,n),((ve&2)===0||e!==Oe)&&(e===Oe&&((ve&2)===0&&(ea|=n),He===4&&jn(e,ge,St,!1)),Qt(e))}function xd(e,t,n){if((ve&6)!==0)throw Error(i(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Wa(e,t),o=a?Yg(e,t):_o(e,t,!0),c=a;do{if(o===0){Da&&!a&&jn(e,t,0,!1);break}else{if(n=e.current.alternate,c&&!Bg(n)){o=_o(e,t,!1),c=!1;continue}if(o===2){if(c=t,e.errorRecoveryDisabledLanes&c)var m=0;else m=e.pendingLanes&-536870913,m=m!==0?m:m&536870912?536870912:0;if(m!==0){t=m;e:{var _=e;o=Ol;var v=_.current.memoizedState.isDehydrated;if(v&&(La(_,m).flags|=256),m=_o(_,m,!1),m!==2){if(co&&!v){_.errorRecoveryDisabledLanes|=c,ea|=c,o=4;break e}c=dt,dt=o,c!==null&&(dt===null?dt=c:dt.push.apply(dt,c))}o=m}if(c=!1,o!==2)continue}}if(o===1){La(e,0),jn(e,t,0,!0);break}e:{switch(a=e,c=o,c){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:jn(a,t,St,!wn);break e;case 2:dt=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(o=Xs+300-pt(),10<o)){if(jn(a,t,St,!wn),as(a,0,!0)!==0)break e;on=t,a.timeoutHandle=Wd(vd.bind(null,a,n,dt,Ks,fo,t,St,ea,za,wn,c,"Throttled",-0,0),o);break e}vd(a,n,dt,Ks,fo,t,St,ea,za,wn,c,null,-0,0)}}break}while(!0);Qt(e)}function vd(e,t,n,a,o,c,m,_,v,k,C,H,A,O){if(e.timeoutHandle=-1,H=t.subtreeFlags,H&8192||(H&16785408)===16785408){H={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:$t},md(t,c,H);var J=(c&62914560)===c?Xs-pt():(c&4194048)===c?_d-pt():0;if(J=w_(H,J),J!==null){on=c,e.cancelPendingCommit=J(Ad.bind(null,e,t,c,n,a,o,m,_,v,C,H,null,A,O)),jn(e,c,m,!k);return}}Ad(e,t,c,n,a,o,m,_,v)}function Bg(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var o=n[a],c=o.getSnapshot;o=o.value;try{if(!_t(c(),o))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 jn(e,t,n,a){t&=~uo,t&=~ea,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var o=t;0<o;){var c=31-gt(o),m=1<<c;a[c]=-1,o&=~m}n!==0&&Oc(e,n,t)}function Is(){return(ve&6)===0?(Rl(0),!1):!0}function go(){if(pe!==null){if(we===0)var e=pe.return;else e=pe,Jt=Xn=null,Cr(e),ka=null,pl=0,e=pe;for(;e!==null;)Ff(e.alternate,e),e=e.return;pe=null}}function La(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,i_(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),on=0,go(),Oe=e,pe=n=It(e.current,null),ge=t,we=0,vt=null,wn=!1,Da=Wa(e,t),co=!1,za=St=uo=ea=Nn=He=0,dt=Ol=null,fo=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var o=31-gt(a),c=1<<o;t|=e[o],a&=~c}return rn=t,hs(),n}function Sd(e,t){ce=null,R.H=Sl,t===Ta||t===Es?(t=Lu(),we=3):t===br?(t=Lu(),we=4):we=t===Kr?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,vt=t,pe===null&&(He=1,Ls(e,At(t,e.current)))}function Ed(){var e=bt.current;return e===null?!0:(ge&4194048)===ge?Mt===null:(ge&62914560)===ge||(ge&536870912)!==0?e===Mt:!1}function wd(){var e=R.H;return R.H=Sl,e===null?Sl:e}function Nd(){var e=R.A;return R.A=Hg,e}function Zs(){He=4,wn||(ge&4194048)!==ge&&bt.current!==null||(Da=!0),(Nn&134217727)===0&&(ea&134217727)===0||Oe===null||jn(Oe,ge,St,!1)}function _o(e,t,n){var a=ve;ve|=2;var o=wd(),c=Nd();(Oe!==e||ge!==t)&&(Ks=null,La(e,t)),t=!1;var m=He;e:do try{if(we!==0&&pe!==null){var _=pe,v=vt;switch(we){case 8:go(),m=6;break e;case 3:case 2:case 9:case 6:bt.current===null&&(t=!0);var k=we;if(we=0,vt=null,Ha(e,_,v,k),n&&Da){m=0;break e}break;default:k=we,we=0,vt=null,Ha(e,_,v,k)}}Gg(),m=He;break}catch(C){Sd(e,C)}while(!0);return t&&e.shellSuspendCounter++,Jt=Xn=null,ve=a,R.H=o,R.A=c,pe===null&&(Oe=null,ge=0,hs()),m}function Gg(){for(;pe!==null;)Td(pe)}function Yg(e,t){var n=ve;ve|=2;var a=wd(),o=Nd();Oe!==e||ge!==t?(Ks=null,$s=pt()+500,La(e,t)):Da=Wa(e,t);e:do try{if(we!==0&&pe!==null){t=pe;var c=vt;t:switch(we){case 1:we=0,vt=null,Ha(e,t,c,1);break;case 2:case 9:if(zu(c)){we=0,vt=null,kd(t);break}t=function(){we!==2&&we!==9||Oe!==e||(we=7),Qt(e)},c.then(t,t);break e;case 3:we=7;break e;case 4:we=5;break e;case 7:zu(c)?(we=0,vt=null,kd(t)):(we=0,vt=null,Ha(e,t,c,7));break;case 5:var m=null;switch(pe.tag){case 26:m=pe.memoizedState;case 5:case 27:var _=pe;if(m?dm(m):_.stateNode.complete){we=0,vt=null;var v=_.sibling;if(v!==null)pe=v;else{var k=_.return;k!==null?(pe=k,Js(k)):pe=null}break t}}we=0,vt=null,Ha(e,t,c,5);break;case 6:we=0,vt=null,Ha(e,t,c,6);break;case 8:go(),He=6;break e;default:throw Error(i(462))}}Qg();break}catch(C){Sd(e,C)}while(!0);return Jt=Xn=null,R.H=a,R.A=o,ve=n,pe!==null?0:(Oe=null,ge=0,hs(),He)}function Qg(){for(;pe!==null&&!dh();)Td(pe)}function Td(e){var t=Jf(e.alternate,e,rn);e.memoizedProps=e.pendingProps,t===null?Js(e):pe=t}function kd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Vf(n,t,t.pendingProps,t.type,void 0,ge);break;case 11:t=Vf(n,t,t.pendingProps,t.type.render,t.ref,ge);break;case 5:Cr(t);default:Ff(n,t),t=pe=wu(t,rn),t=Jf(n,t,rn)}e.memoizedProps=e.pendingProps,t===null?Js(e):pe=t}function Ha(e,t,n,a){Jt=Xn=null,Cr(t),ka=null,pl=0;var o=t.return;try{if(Cg(e,o,t,n,ge)){He=1,Ls(e,At(n,e.current)),pe=null;return}}catch(c){if(o!==null)throw pe=o,c;He=1,Ls(e,At(n,e.current)),pe=null;return}t.flags&32768?(ye||a===1?e=!0:Da||(ge&536870912)!==0?e=!1:(wn=e=!0,(a===2||a===9||a===3||a===6)&&(a=bt.current,a!==null&&a.tag===13&&(a.flags|=16384))),jd(t,e)):Js(t)}function Js(e){var t=e;do{if((t.flags&32768)!==0){jd(t,wn);return}e=t.return;var n=Dg(t.alternate,t,rn);if(n!==null){pe=n;return}if(t=t.sibling,t!==null){pe=t;return}pe=t=e}while(t!==null);He===0&&(He=5)}function jd(e,t){do{var n=zg(e.alternate,e);if(n!==null){n.flags&=32767,pe=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){pe=e;return}pe=e=n}while(e!==null);He=6,pe=null}function Ad(e,t,n,a,o,c,m,_,v){e.cancelPendingCommit=null;do Ws();while(Ie!==0);if((ve&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(c=t.lanes|t.childLanes,c|=lr,Sh(e,n,c,m,_,v),e===Oe&&(pe=Oe=null,ge=0),Ua=t,kn=e,on=n,mo=c,po=o,yd=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Kg(Pl,function(){return Dd(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=R.T,R.T=null,o=$.p,$.p=2,m=ve,ve|=4;try{Ug(e,t,n)}finally{ve=m,$.p=o,R.T=a}}Ie=1,Od(),Cd(),Rd()}}function Od(){if(Ie===1){Ie=0;var e=kn,t=Ua,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=R.T,R.T=null;var a=$.p;$.p=2;var o=ve;ve|=4;try{ud(t,e);var c=Ao,m=hu(e.containerInfo),_=c.focusedElem,v=c.selectionRange;if(m!==_&&_&&_.ownerDocument&&pu(_.ownerDocument.documentElement,_)){if(v!==null&&Pi(_)){var k=v.start,C=v.end;if(C===void 0&&(C=k),"selectionStart"in _)_.selectionStart=k,_.selectionEnd=Math.min(C,_.value.length);else{var H=_.ownerDocument||document,A=H&&H.defaultView||window;if(A.getSelection){var O=A.getSelection(),J=_.textContent.length,ae=Math.min(v.start,J),Ae=v.end===void 0?ae:Math.min(v.end,J);!O.extend&&ae>Ae&&(m=Ae,Ae=ae,ae=m);var N=mu(_,ae),E=mu(_,Ae);if(N&&E&&(O.rangeCount!==1||O.anchorNode!==N.node||O.anchorOffset!==N.offset||O.focusNode!==E.node||O.focusOffset!==E.offset)){var T=H.createRange();T.setStart(N.node,N.offset),O.removeAllRanges(),ae>Ae?(O.addRange(T),O.extend(E.node,E.offset)):(T.setEnd(E.node,E.offset),O.addRange(T))}}}}for(H=[],O=_;O=O.parentNode;)O.nodeType===1&&H.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<H.length;_++){var D=H[_];D.element.scrollLeft=D.left,D.element.scrollTop=D.top}}ci=!!jo,Ao=jo=null}finally{ve=o,$.p=a,R.T=n}}e.current=t,Ie=2}}function Cd(){if(Ie===2){Ie=0;var e=kn,t=Ua,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=R.T,R.T=null;var a=$.p;$.p=2;var o=ve;ve|=4;try{sd(e,t.alternate,t)}finally{ve=o,$.p=a,R.T=n}}Ie=3}}function Rd(){if(Ie===4||Ie===3){Ie=0,mh();var e=kn,t=Ua,n=on,a=yd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ie=5:(Ie=0,Ua=kn=null,Md(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(Tn=null),Di(n),t=t.stateNode,ht&&typeof ht.onCommitFiberRoot=="function")try{ht.onCommitFiberRoot(Ja,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=R.T,o=$.p,$.p=2,R.T=null;try{for(var c=e.onRecoverableError,m=0;m<a.length;m++){var _=a[m];c(_.value,{componentStack:_.stack})}}finally{R.T=t,$.p=o}}(on&3)!==0&&Ws(),Qt(e),o=e.pendingLanes,(n&261930)!==0&&(o&42)!==0?e===ho?Cl++:(Cl=0,ho=e):Cl=0,Rl(0)}}function Md(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,dl(t)))}function Ws(){return Od(),Cd(),Rd(),Dd()}function Dd(){if(Ie!==5)return!1;var e=kn,t=mo;mo=0;var n=Di(on),a=R.T,o=$.p;try{$.p=32>n?32:n,R.T=null,n=po,po=null;var c=kn,m=on;if(Ie=0,Ua=kn=null,on=0,(ve&6)!==0)throw Error(i(331));var _=ve;if(ve|=4,hd(c.current),dd(c,c.current,m,n),ve=_,Rl(0,!1),ht&&typeof ht.onPostCommitFiberRoot=="function")try{ht.onPostCommitFiberRoot(Ja,c)}catch{}return!0}finally{$.p=o,R.T=a,Md(e,t)}}function zd(e,t,n){t=At(n,t),t=$r(e.stateNode,t,2),e=xn(e,t,2),e!==null&&(Fa(e,2),Qt(e))}function Ne(e,t,n){if(e.tag===3)zd(e,e,n);else for(;t!==null;){if(t.tag===3){zd(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Tn===null||!Tn.has(a))){e=At(n,e),n=Uf(2),a=xn(t,n,2),a!==null&&(Lf(n,a,t,e),Fa(a,2),Qt(a));break}}t=t.return}}function yo(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new qg;var o=new Set;a.set(t,o)}else o=a.get(t),o===void 0&&(o=new Set,a.set(t,o));o.has(n)||(co=!0,o.add(n),e=Vg.bind(null,e,t,n),t.then(e,e))}function Vg(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Oe===e&&(ge&n)===n&&(He===4||He===3&&(ge&62914560)===ge&&300>pt()-Xs?(ve&2)===0&&La(e,0):uo|=n,za===ge&&(za=0)),Qt(e)}function Ud(e,t){t===0&&(t=Ac()),e=Yn(e,t),e!==null&&(Fa(e,t),Qt(e))}function Xg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ud(e,n)}function $g(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(i(314))}a!==null&&a.delete(t),Ud(e,n)}function Kg(e,t){return Oi(e,t)}var Fs=null,qa=null,bo=!1,Ps=!1,xo=!1,An=0;function Qt(e){e!==qa&&e.next===null&&(qa===null?Fs=qa=e:qa=qa.next=e),Ps=!0,bo||(bo=!0,Zg())}function Rl(e,t){if(!xo&&Ps){xo=!0;do for(var n=!1,a=Fs;a!==null;){if(e!==0){var o=a.pendingLanes;if(o===0)var c=0;else{var m=a.suspendedLanes,_=a.pingedLanes;c=(1<<31-gt(42|e)+1)-1,c&=o&~(m&~_),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(n=!0,Bd(a,c))}else c=ge,c=as(a,a===Oe?c:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(c&3)===0||Wa(a,c)||(n=!0,Bd(a,c));a=a.next}while(n);xo=!1}}function Ig(){Ld()}function Ld(){Ps=bo=!1;var e=0;An!==0&&s_()&&(e=An);for(var t=pt(),n=null,a=Fs;a!==null;){var o=a.next,c=Hd(a,t);c===0?(a.next=null,n===null?Fs=o:n.next=o,o===null&&(qa=n)):(n=a,(e!==0||(c&3)!==0)&&(Ps=!0)),a=o}Ie!==0&&Ie!==5||Rl(e),An!==0&&(An=0)}function Hd(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var m=31-gt(c),_=1<<m,v=o[m];v===-1?((_&n)===0||(_&a)!==0)&&(o[m]=vh(_,t)):v<=t&&(e.expiredLanes|=_),c&=~_}if(t=Oe,n=ge,n=as(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(we===2||we===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Ci(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Wa(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&Ci(a),Di(n)){case 2:case 8:n=kc;break;case 32:n=Pl;break;case 268435456:n=jc;break;default:n=Pl}return a=qd.bind(null,e),n=Oi(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&Ci(a),e.callbackPriority=2,e.callbackNode=null,2}function qd(e,t){if(Ie!==0&&Ie!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ws()&&e.callbackNode!==n)return null;var a=ge;return a=as(e,e===Oe?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(xd(e,a,t),Hd(e,pt()),e.callbackNode!=null&&e.callbackNode===n?qd.bind(null,e):null)}function Bd(e,t){if(Ws())return null;xd(e,t,!0)}function Zg(){r_(function(){(ve&6)!==0?Oi(Tc,Ig):Ld()})}function vo(){if(An===0){var e=wa;e===0&&(e=es,es<<=1,(es&261888)===0&&(es=256)),An=e}return An}function Gd(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:rs(""+e)}function Yd(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Jg(e,t,n,a,o){if(t==="submit"&&n&&n.stateNode===o){var c=Gd((o[rt]||null).action),m=a.submitter;m&&(t=(t=m[rt]||null)?Gd(t.formAction):m.getAttribute("formAction"),t!==null&&(c=t,m=null));var _=new fs("action","action",null,a,o);e.push({event:_,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(An!==0){var v=m?Yd(o,m):new FormData(o);Br(n,{pending:!0,data:v,method:o.method,action:c},null,v)}}else typeof c=="function"&&(_.preventDefault(),v=m?Yd(o,m):new FormData(o),Br(n,{pending:!0,data:v,method:o.method,action:c},c,v))},currentTarget:o}]})}}for(var So=0;So<ar.length;So++){var Eo=ar[So],Wg=Eo.toLowerCase(),Fg=Eo[0].toUpperCase()+Eo.slice(1);Ut(Wg,"on"+Fg)}Ut(yu,"onAnimationEnd"),Ut(bu,"onAnimationIteration"),Ut(xu,"onAnimationStart"),Ut("dblclick","onDoubleClick"),Ut("focusin","onFocus"),Ut("focusout","onBlur"),Ut(pg,"onTransitionRun"),Ut(hg,"onTransitionStart"),Ut(gg,"onTransitionCancel"),Ut(vu,"onTransitionEnd"),ua("onMouseEnter",["mouseout","mouseover"]),ua("onMouseLeave",["mouseout","mouseover"]),ua("onPointerEnter",["pointerout","pointerover"]),ua("onPointerLeave",["pointerout","pointerover"]),Hn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Hn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Hn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Hn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Hn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Hn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ml="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(" "),Pg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ml));function Qd(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],o=a.event;a=a.listeners;e:{var c=void 0;if(t)for(var m=a.length-1;0<=m;m--){var _=a[m],v=_.instance,k=_.currentTarget;if(_=_.listener,v!==c&&o.isPropagationStopped())break e;c=_,o.currentTarget=k;try{c(o)}catch(C){ps(C)}o.currentTarget=null,c=v}else for(m=0;m<a.length;m++){if(_=a[m],v=_.instance,k=_.currentTarget,_=_.listener,v!==c&&o.isPropagationStopped())break e;c=_,o.currentTarget=k;try{c(o)}catch(C){ps(C)}o.currentTarget=null,c=v}}}}function he(e,t){var n=t[zi];n===void 0&&(n=t[zi]=new Set);var a=e+"__bubble";n.has(a)||(Vd(t,e,2,!1),n.add(a))}function wo(e,t,n){var a=0;t&&(a|=4),Vd(n,e,a,t)}var ei="_reactListening"+Math.random().toString(36).slice(2);function No(e){if(!e[ei]){e[ei]=!0,Uc.forEach(function(n){n!=="selectionchange"&&(Pg.has(n)||wo(n,!1,e),wo(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ei]||(t[ei]=!0,wo("selectionchange",!1,t))}}function Vd(e,t,n,a){switch(bm(t)){case 2:var o=k_;break;case 8:o=j_;break;default:o=Bo}n=o.bind(null,t,n,e),o=void 0,!Vi||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),a?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function To(e,t,n,a,o){var c=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var m=a.tag;if(m===3||m===4){var _=a.stateNode.containerInfo;if(_===o)break;if(m===4)for(m=a.return;m!==null;){var v=m.tag;if((v===3||v===4)&&m.stateNode.containerInfo===o)return;m=m.return}for(;_!==null;){if(m=ra(_),m===null)return;if(v=m.tag,v===5||v===6||v===26||v===27){a=c=m;continue e}_=_.parentNode}}a=a.return}Ic(function(){var k=c,C=Yi(n),H=[];e:{var A=Su.get(e);if(A!==void 0){var O=fs,J=e;switch(e){case"keypress":if(cs(n)===0)break e;case"keydown":case"keyup":O=$h;break;case"focusin":J="focus",O=Ii;break;case"focusout":J="blur",O=Ii;break;case"beforeblur":case"afterblur":O=Ii;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":O=Wc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":O=Dh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":O=Zh;break;case yu:case bu:case xu:O=Lh;break;case vu:O=Wh;break;case"scroll":case"scrollend":O=Rh;break;case"wheel":O=Ph;break;case"copy":case"cut":case"paste":O=qh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":O=Pc;break;case"toggle":case"beforetoggle":O=tg}var ae=(t&4)!==0,Ae=!ae&&(e==="scroll"||e==="scrollend"),N=ae?A!==null?A+"Capture":null:A;ae=[];for(var E=k,T;E!==null;){var D=E;if(T=D.stateNode,D=D.tag,D!==5&&D!==26&&D!==27||T===null||N===null||(D=tl(E,N),D!=null&&ae.push(Dl(E,D,T))),Ae)break;E=E.return}0<ae.length&&(A=new O(A,J,null,n,C),H.push({event:A,listeners:ae}))}}if((t&7)===0){e:{if(A=e==="mouseover"||e==="pointerover",O=e==="mouseout"||e==="pointerout",A&&n!==Gi&&(J=n.relatedTarget||n.fromElement)&&(ra(J)||J[ia]))break e;if((O||A)&&(A=C.window===C?C:(A=C.ownerDocument)?A.defaultView||A.parentWindow:window,O?(J=n.relatedTarget||n.toElement,O=k,J=J?ra(J):null,J!==null&&(Ae=d(J),ae=J.tag,J!==Ae||ae!==5&&ae!==27&&ae!==6)&&(J=null)):(O=null,J=k),O!==J)){if(ae=Wc,D="onMouseLeave",N="onMouseEnter",E="mouse",(e==="pointerout"||e==="pointerover")&&(ae=Pc,D="onPointerLeave",N="onPointerEnter",E="pointer"),Ae=O==null?A:el(O),T=J==null?A:el(J),A=new ae(D,E+"leave",O,n,C),A.target=Ae,A.relatedTarget=T,D=null,ra(C)===k&&(ae=new ae(N,E+"enter",J,n,C),ae.target=T,ae.relatedTarget=Ae,D=ae),Ae=D,O&&J)t:{for(ae=e_,N=O,E=J,T=0,D=N;D;D=ae(D))T++;D=0;for(var ne=E;ne;ne=ae(ne))D++;for(;0<T-D;)N=ae(N),T--;for(;0<D-T;)E=ae(E),D--;for(;T--;){if(N===E||E!==null&&N===E.alternate){ae=N;break t}N=ae(N),E=ae(E)}ae=null}else ae=null;O!==null&&Xd(H,A,O,ae,!1),J!==null&&Ae!==null&&Xd(H,Ae,J,ae,!0)}}e:{if(A=k?el(k):window,O=A.nodeName&&A.nodeName.toLowerCase(),O==="select"||O==="input"&&A.type==="file")var be=ru;else if(su(A))if(ou)be=fg;else{be=cg;var P=og}else O=A.nodeName,!O||O.toLowerCase()!=="input"||A.type!=="checkbox"&&A.type!=="radio"?k&&Bi(k.elementType)&&(be=ru):be=ug;if(be&&(be=be(e,k))){iu(H,be,n,C);break e}P&&P(e,A,k),e==="focusout"&&k&&A.type==="number"&&k.memoizedProps.value!=null&&qi(A,"number",A.value)}switch(P=k?el(k):window,e){case"focusin":(su(P)||P.contentEditable==="true")&&(ga=P,er=k,cl=null);break;case"focusout":cl=er=ga=null;break;case"mousedown":tr=!0;break;case"contextmenu":case"mouseup":case"dragend":tr=!1,gu(H,n,C);break;case"selectionchange":if(mg)break;case"keydown":case"keyup":gu(H,n,C)}var ue;if(Ji)e:{switch(e){case"compositionstart":var _e="onCompositionStart";break e;case"compositionend":_e="onCompositionEnd";break e;case"compositionupdate":_e="onCompositionUpdate";break e}_e=void 0}else ha?au(e,n)&&(_e="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(_e="onCompositionStart");_e&&(eu&&n.locale!=="ko"&&(ha||_e!=="onCompositionStart"?_e==="onCompositionEnd"&&ha&&(ue=Zc()):(mn=C,Xi="value"in mn?mn.value:mn.textContent,ha=!0)),P=ti(k,_e),0<P.length&&(_e=new Fc(_e,e,null,n,C),H.push({event:_e,listeners:P}),ue?_e.data=ue:(ue=lu(n),ue!==null&&(_e.data=ue)))),(ue=ag?lg(e,n):sg(e,n))&&(_e=ti(k,"onBeforeInput"),0<_e.length&&(P=new Fc("onBeforeInput","beforeinput",null,n,C),H.push({event:P,listeners:_e}),P.data=ue)),Jg(H,e,k,n,C)}Qd(H,t)})}function Dl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ti(e,t){for(var n=t+"Capture",a=[];e!==null;){var o=e,c=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||c===null||(o=tl(e,n),o!=null&&a.unshift(Dl(e,o,c)),o=tl(e,t),o!=null&&a.push(Dl(e,o,c))),e.tag===3)return a;e=e.return}return[]}function e_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Xd(e,t,n,a,o){for(var c=t._reactName,m=[];n!==null&&n!==a;){var _=n,v=_.alternate,k=_.stateNode;if(_=_.tag,v!==null&&v===a)break;_!==5&&_!==26&&_!==27||k===null||(v=k,o?(k=tl(n,c),k!=null&&m.unshift(Dl(n,k,v))):o||(k=tl(n,c),k!=null&&m.push(Dl(n,k,v)))),n=n.return}m.length!==0&&e.push({event:t,listeners:m})}var t_=/\r\n?/g,n_=/\u0000|\uFFFD/g;function $d(e){return(typeof e=="string"?e:""+e).replace(t_,`
|
|
9
|
+
`).replace(n_,"")}function Kd(e,t){return t=$d(t),$d(e)===t}function je(e,t,n,a,o,c){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||da(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&da(e,""+a);break;case"className":ss(e,"class",a);break;case"tabIndex":ss(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":ss(e,n,a);break;case"style":$c(e,a,c);break;case"data":if(t!=="object"){ss(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=rs(""+a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(n,"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 c=="function"&&(n==="formAction"?(t!=="input"&&je(e,t,"name",o.name,o,null),je(e,t,"formEncType",o.formEncType,o,null),je(e,t,"formMethod",o.formMethod,o,null),je(e,t,"formTarget",o.formTarget,o,null)):(je(e,t,"encType",o.encType,o,null),je(e,t,"method",o.method,o,null),je(e,t,"target",o.target,o,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=rs(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=$t);break;case"onScroll":a!=null&&he("scroll",e);break;case"onScrollEnd":a!=null&&he("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(i(61));if(n=a.__html,n!=null){if(o.children!=null)throw Error(i(60));e.innerHTML=n}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}n=rs(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""+a):e.removeAttribute(n);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":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":a===!0?e.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(n,a):e.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(n):e.setAttribute(n,a);break;case"popover":he("beforetoggle",e),he("toggle",e),ls(e,"popover",a);break;case"xlinkActuate":Xt(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Xt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Xt(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Xt(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Xt(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Xt(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Xt(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Xt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Xt(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":ls(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Oh.get(n)||n,ls(e,n,a))}}function ko(e,t,n,a,o,c){switch(n){case"style":$c(e,a,c);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(i(61));if(n=a.__html,n!=null){if(o.children!=null)throw Error(i(60));e.innerHTML=n}}break;case"children":typeof a=="string"?da(e,a):(typeof a=="number"||typeof a=="bigint")&&da(e,""+a);break;case"onScroll":a!=null&&he("scroll",e);break;case"onScrollEnd":a!=null&&he("scrollend",e);break;case"onClick":a!=null&&(e.onclick=$t);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Lc.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(o=n.endsWith("Capture"),t=n.slice(2,o?n.length-7:void 0),c=e[rt]||null,c=c!=null?c[n]:null,typeof c=="function"&&e.removeEventListener(t,c,o),typeof a=="function")){typeof c!="function"&&c!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,a,o);break e}n in e?e[n]=a:a===!0?e.setAttribute(n,""):ls(e,n,a)}}}function nt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":he("error",e),he("load",e);var a=!1,o=!1,c;for(c in n)if(n.hasOwnProperty(c)){var m=n[c];if(m!=null)switch(c){case"src":a=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:je(e,t,c,m,n,null)}}o&&je(e,t,"srcSet",n.srcSet,n,null),a&&je(e,t,"src",n.src,n,null);return;case"input":he("invalid",e);var _=c=m=o=null,v=null,k=null;for(a in n)if(n.hasOwnProperty(a)){var C=n[a];if(C!=null)switch(a){case"name":o=C;break;case"type":m=C;break;case"checked":v=C;break;case"defaultChecked":k=C;break;case"value":c=C;break;case"defaultValue":_=C;break;case"children":case"dangerouslySetInnerHTML":if(C!=null)throw Error(i(137,t));break;default:je(e,t,a,C,n,null)}}Yc(e,c,_,v,k,m,o,!1);return;case"select":he("invalid",e),a=m=c=null;for(o in n)if(n.hasOwnProperty(o)&&(_=n[o],_!=null))switch(o){case"value":c=_;break;case"defaultValue":m=_;break;case"multiple":a=_;default:je(e,t,o,_,n,null)}t=c,n=m,e.multiple=!!a,t!=null?fa(e,!!a,t,!1):n!=null&&fa(e,!!a,n,!0);return;case"textarea":he("invalid",e),c=o=a=null;for(m in n)if(n.hasOwnProperty(m)&&(_=n[m],_!=null))switch(m){case"value":a=_;break;case"defaultValue":o=_;break;case"children":c=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(i(91));break;default:je(e,t,m,_,n,null)}Vc(e,a,o,c);return;case"option":for(v in n)n.hasOwnProperty(v)&&(a=n[v],a!=null)&&(v==="selected"?e.selected=a&&typeof a!="function"&&typeof a!="symbol":je(e,t,v,a,n,null));return;case"dialog":he("beforetoggle",e),he("toggle",e),he("cancel",e),he("close",e);break;case"iframe":case"object":he("load",e);break;case"video":case"audio":for(a=0;a<Ml.length;a++)he(Ml[a],e);break;case"image":he("error",e),he("load",e);break;case"details":he("toggle",e);break;case"embed":case"source":case"link":he("error",e),he("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(k in n)if(n.hasOwnProperty(k)&&(a=n[k],a!=null))switch(k){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:je(e,t,k,a,n,null)}return;default:if(Bi(t)){for(C in n)n.hasOwnProperty(C)&&(a=n[C],a!==void 0&&ko(e,t,C,a,n,void 0));return}}for(_ in n)n.hasOwnProperty(_)&&(a=n[_],a!=null&&je(e,t,_,a,n,null))}function a_(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,c=null,m=null,_=null,v=null,k=null,C=null;for(O in n){var H=n[O];if(n.hasOwnProperty(O)&&H!=null)switch(O){case"checked":break;case"value":break;case"defaultValue":v=H;default:a.hasOwnProperty(O)||je(e,t,O,null,a,H)}}for(var A in a){var O=a[A];if(H=n[A],a.hasOwnProperty(A)&&(O!=null||H!=null))switch(A){case"type":c=O;break;case"name":o=O;break;case"checked":k=O;break;case"defaultChecked":C=O;break;case"value":m=O;break;case"defaultValue":_=O;break;case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(i(137,t));break;default:O!==H&&je(e,t,A,O,a,H)}}Hi(e,m,_,v,k,C,c,o);return;case"select":O=m=_=A=null;for(c in n)if(v=n[c],n.hasOwnProperty(c)&&v!=null)switch(c){case"value":break;case"multiple":O=v;default:a.hasOwnProperty(c)||je(e,t,c,null,a,v)}for(o in a)if(c=a[o],v=n[o],a.hasOwnProperty(o)&&(c!=null||v!=null))switch(o){case"value":A=c;break;case"defaultValue":_=c;break;case"multiple":m=c;default:c!==v&&je(e,t,o,c,a,v)}t=_,n=m,a=O,A!=null?fa(e,!!n,A,!1):!!a!=!!n&&(t!=null?fa(e,!!n,t,!0):fa(e,!!n,n?[]:"",!1));return;case"textarea":O=A=null;for(_ in n)if(o=n[_],n.hasOwnProperty(_)&&o!=null&&!a.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:je(e,t,_,null,a,o)}for(m in a)if(o=a[m],c=n[m],a.hasOwnProperty(m)&&(o!=null||c!=null))switch(m){case"value":A=o;break;case"defaultValue":O=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(i(91));break;default:o!==c&&je(e,t,m,o,a,c)}Qc(e,A,O);return;case"option":for(var J in n)A=n[J],n.hasOwnProperty(J)&&A!=null&&!a.hasOwnProperty(J)&&(J==="selected"?e.selected=!1:je(e,t,J,null,a,A));for(v in a)A=a[v],O=n[v],a.hasOwnProperty(v)&&A!==O&&(A!=null||O!=null)&&(v==="selected"?e.selected=A&&typeof A!="function"&&typeof A!="symbol":je(e,t,v,A,a,O));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ae in n)A=n[ae],n.hasOwnProperty(ae)&&A!=null&&!a.hasOwnProperty(ae)&&je(e,t,ae,null,a,A);for(k in a)if(A=a[k],O=n[k],a.hasOwnProperty(k)&&A!==O&&(A!=null||O!=null))switch(k){case"children":case"dangerouslySetInnerHTML":if(A!=null)throw Error(i(137,t));break;default:je(e,t,k,A,a,O)}return;default:if(Bi(t)){for(var Ae in n)A=n[Ae],n.hasOwnProperty(Ae)&&A!==void 0&&!a.hasOwnProperty(Ae)&&ko(e,t,Ae,void 0,a,A);for(C in a)A=a[C],O=n[C],!a.hasOwnProperty(C)||A===O||A===void 0&&O===void 0||ko(e,t,C,A,a,O);return}}for(var N in n)A=n[N],n.hasOwnProperty(N)&&A!=null&&!a.hasOwnProperty(N)&&je(e,t,N,null,a,A);for(H in a)A=a[H],O=n[H],!a.hasOwnProperty(H)||A===O||A==null&&O==null||je(e,t,H,A,a,O)}function Id(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function l_(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var o=n[a],c=o.transferSize,m=o.initiatorType,_=o.duration;if(c&&_&&Id(m)){for(m=0,_=o.responseEnd,a+=1;a<n.length;a++){var v=n[a],k=v.startTime;if(k>_)break;var C=v.transferSize,H=v.initiatorType;C&&Id(H)&&(v=v.responseEnd,m+=C*(v<_?1:(_-k)/(v-k)))}if(--a,t+=8*(c+m)/(o.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 jo=null,Ao=null;function ni(e){return e.nodeType===9?e:e.ownerDocument}function Zd(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 Jd(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 Oo(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 Co=null;function s_(){var e=window.event;return e&&e.type==="popstate"?e===Co?!1:(Co=e,!0):(Co=null,!1)}var Wd=typeof setTimeout=="function"?setTimeout:void 0,i_=typeof clearTimeout=="function"?clearTimeout:void 0,Fd=typeof Promise=="function"?Promise:void 0,r_=typeof queueMicrotask=="function"?queueMicrotask:typeof Fd<"u"?function(e){return Fd.resolve(null).then(e).catch(o_)}:Wd;function o_(e){setTimeout(function(){throw e})}function On(e){return e==="head"}function Pd(e,t){var n=t,a=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"||n==="/&"){if(a===0){e.removeChild(o),Qa(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")zl(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,zl(n);for(var c=n.firstChild;c;){var m=c.nextSibling,_=c.nodeName;c[Pa]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&c.rel.toLowerCase()==="stylesheet"||n.removeChild(c),c=m}}else n==="body"&&zl(e.ownerDocument.body);n=o}while(n);Qa(t)}function em(e,t){var n=e;e=0;do{var a=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=a}while(n)}function Ro(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Ro(n),Ui(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function c_(e,t,n,a){for(;e.nodeType===1;){var o=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[Pa])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=Dt(e.nextSibling),e===null)break}return null}function u_(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Dt(e.nextSibling),e===null))return null;return e}function tm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Dt(e.nextSibling),e===null))return null;return e}function Mo(e){return e.data==="$?"||e.data==="$~"}function Do(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function f_(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var a=function(){t(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function Dt(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 zo=null;function nm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Dt(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function am(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function lm(e,t,n){switch(t=ni(n),e){case"html":if(e=t.documentElement,!e)throw Error(i(452));return e;case"head":if(e=t.head,!e)throw Error(i(453));return e;case"body":if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function zl(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ui(e)}var zt=new Map,sm=new Set;function ai(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var cn=$.d;$.d={f:d_,r:m_,D:p_,C:h_,L:g_,m:__,X:b_,S:y_,M:x_};function d_(){var e=cn.f(),t=Is();return e||t}function m_(e){var t=oa(e);t!==null&&t.tag===5&&t.type==="form"?Sf(t):cn.r(e)}var Ba=typeof document>"u"?null:document;function im(e,t,n){var a=Ba;if(a&&typeof t=="string"&&t){var o=kt(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof n=="string"&&(o+='[crossorigin="'+n+'"]'),sm.has(o)||(sm.add(o),e={rel:e,crossOrigin:n,href:t},a.querySelector(o)===null&&(t=a.createElement("link"),nt(t,"link",e),Ze(t),a.head.appendChild(t)))}}function p_(e){cn.D(e),im("dns-prefetch",e,null)}function h_(e,t){cn.C(e,t),im("preconnect",e,t)}function g_(e,t,n){cn.L(e,t,n);var a=Ba;if(a&&e&&t){var o='link[rel="preload"][as="'+kt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(o+='[imagesrcset="'+kt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(o+='[imagesizes="'+kt(n.imageSizes)+'"]')):o+='[href="'+kt(e)+'"]';var c=o;switch(t){case"style":c=Ga(e);break;case"script":c=Ya(e)}zt.has(c)||(e=x({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),zt.set(c,e),a.querySelector(o)!==null||t==="style"&&a.querySelector(Ul(c))||t==="script"&&a.querySelector(Ll(c))||(t=a.createElement("link"),nt(t,"link",e),Ze(t),a.head.appendChild(t)))}}function __(e,t){cn.m(e,t);var n=Ba;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+kt(a)+'"][href="'+kt(e)+'"]',c=o;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=Ya(e)}if(!zt.has(c)&&(e=x({rel:"modulepreload",href:e},t),zt.set(c,e),n.querySelector(o)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ll(c)))return}a=n.createElement("link"),nt(a,"link",e),Ze(a),n.head.appendChild(a)}}}function y_(e,t,n){cn.S(e,t,n);var a=Ba;if(a&&e){var o=ca(a).hoistableStyles,c=Ga(e);t=t||"default";var m=o.get(c);if(!m){var _={loading:0,preload:null};if(m=a.querySelector(Ul(c)))_.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":t},n),(n=zt.get(c))&&Uo(e,n);var v=m=a.createElement("link");Ze(v),nt(v,"link",e),v._p=new Promise(function(k,C){v.onload=k,v.onerror=C}),v.addEventListener("load",function(){_.loading|=1}),v.addEventListener("error",function(){_.loading|=2}),_.loading|=4,li(m,t,a)}m={type:"stylesheet",instance:m,count:1,state:_},o.set(c,m)}}}function b_(e,t){cn.X(e,t);var n=Ba;if(n&&e){var a=ca(n).hoistableScripts,o=Ya(e),c=a.get(o);c||(c=n.querySelector(Ll(o)),c||(e=x({src:e,async:!0},t),(t=zt.get(o))&&Lo(e,t),c=n.createElement("script"),Ze(c),nt(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},a.set(o,c))}}function x_(e,t){cn.M(e,t);var n=Ba;if(n&&e){var a=ca(n).hoistableScripts,o=Ya(e),c=a.get(o);c||(c=n.querySelector(Ll(o)),c||(e=x({src:e,async:!0,type:"module"},t),(t=zt.get(o))&&Lo(e,t),c=n.createElement("script"),Ze(c),nt(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},a.set(o,c))}}function rm(e,t,n,a){var o=(o=me.current)?ai(o):null;if(!o)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Ga(n.href),n=ca(o).hoistableStyles,a=n.get(t),a||(a={type:"style",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Ga(n.href);var c=ca(o).hoistableStyles,m=c.get(e);if(m||(o=o.ownerDocument||o,m={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,m),(c=o.querySelector(Ul(e)))&&!c._p&&(m.instance=c,m.state.loading=5),zt.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},zt.set(e,n),c||v_(o,e,n,m.state))),t&&a===null)throw Error(i(528,""));return m}if(t&&a!==null)throw Error(i(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ya(n),n=ca(o).hoistableScripts,a=n.get(t),a||(a={type:"script",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Ga(e){return'href="'+kt(e)+'"'}function Ul(e){return'link[rel="stylesheet"]['+e+"]"}function om(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function v_(e,t,n,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),nt(t,"link",n),Ze(t),e.head.appendChild(t))}function Ya(e){return'[src="'+kt(e)+'"]'}function Ll(e){return"script[async]"+e}function cm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+kt(n.href)+'"]');if(a)return t.instance=a,Ze(a),a;var o=x({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Ze(a),nt(a,"style",o),li(a,n.precedence,e),t.instance=a;case"stylesheet":o=Ga(n.href);var c=e.querySelector(Ul(o));if(c)return t.state.loading|=4,t.instance=c,Ze(c),c;a=om(n),(o=zt.get(o))&&Uo(a,o),c=(e.ownerDocument||e).createElement("link"),Ze(c);var m=c;return m._p=new Promise(function(_,v){m.onload=_,m.onerror=v}),nt(c,"link",a),t.state.loading|=4,li(c,n.precedence,e),t.instance=c;case"script":return c=Ya(n.src),(o=e.querySelector(Ll(c)))?(t.instance=o,Ze(o),o):(a=n,(o=zt.get(c))&&(a=x({},n),Lo(a,o)),e=e.ownerDocument||e,o=e.createElement("script"),Ze(o),nt(o,"link",a),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(i(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,li(a,n.precedence,e));return t.instance}function li(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=a.length?a[a.length-1]:null,c=o,m=0;m<a.length;m++){var _=a[m];if(_.dataset.precedence===t)c=_;else if(c!==o)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Uo(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Lo(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var si=null;function um(e,t,n){if(si===null){var a=new Map,o=si=new Map;o.set(n,a)}else o=si,a=o.get(n),a||(a=new Map,o.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),o=0;o<n.length;o++){var c=n[o];if(!(c[Pa]||c[Fe]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var m=c.getAttribute(t)||"";m=e+m;var _=a.get(m);_?_.push(c):a.set(m,[c])}}return a}function fm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function S_(e,t,n){if(n===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;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!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 dm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function E_(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var o=Ga(a.href),c=t.querySelector(Ul(o));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ii.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=c,Ze(c);return}c=t.ownerDocument||t,a=om(a),(o=zt.get(o))&&Uo(a,o),c=c.createElement("link"),Ze(c);var m=c;m._p=new Promise(function(_,v){m.onload=_,m.onerror=v}),nt(c,"link",a),n.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=ii.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Ho=0;function w_(e,t){return e.stylesheets&&e.count===0&&oi(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&oi(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&Ho===0&&(Ho=62500*l_());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&oi(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>Ho?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(o)}}:null}function ii(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)oi(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ri=null;function oi(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ri=new Map,t.forEach(N_,e),ri=null,ii.call(e))}function N_(e,t){if(!(t.state.loading&4)){var n=ri.get(e);if(n)var a=n.get(null);else{n=new Map,ri.set(e,n);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<o.length;c++){var m=o[c];(m.nodeName==="LINK"||m.getAttribute("media")!=="not all")&&(n.set(m.dataset.precedence,m),a=m)}a&&n.set(null,a)}o=t.instance,m=o.getAttribute("data-precedence"),c=n.get(m)||a,c===a&&n.set(null,o),n.set(m,o),this.count++,a=ii.bind(this),o.addEventListener("load",a),o.addEventListener("error",a),c?c.parentNode.insertBefore(o,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var Hl={$$typeof:te,Provider:null,Consumer:null,_currentValue:le,_currentValue2:le,_threadCount:0};function T_(e,t,n,a,o,c,m,_,v){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=Ri(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ri(0),this.hiddenUpdates=Ri(null),this.identifierPrefix=a,this.onUncaughtError=o,this.onCaughtError=c,this.onRecoverableError=m,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=v,this.incompleteTransitions=new Map}function mm(e,t,n,a,o,c,m,_,v,k,C,H){return e=new T_(e,t,n,m,v,k,C,H,_),t=1,c===!0&&(t|=24),c=yt(3,null,null,t),e.current=c,c.stateNode=e,t=gr(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:a,isDehydrated:n,cache:t},xr(c),e}function pm(e){return e?(e=ba,e):ba}function hm(e,t,n,a,o,c){o=pm(o),a.context===null?a.context=o:a.pendingContext=o,a=bn(t),a.payload={element:n},c=c===void 0?null:c,c!==null&&(a.callback=c),n=xn(e,a,t),n!==null&&(mt(n,e,t),gl(n,e,t))}function gm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function qo(e,t){gm(e,t),(e=e.alternate)&&gm(e,t)}function _m(e){if(e.tag===13||e.tag===31){var t=Yn(e,67108864);t!==null&&mt(t,e,67108864),qo(e,67108864)}}function ym(e){if(e.tag===13||e.tag===31){var t=Et();t=Mi(t);var n=Yn(e,t);n!==null&&mt(n,e,t),qo(e,t)}}var ci=!0;function k_(e,t,n,a){var o=R.T;R.T=null;var c=$.p;try{$.p=2,Bo(e,t,n,a)}finally{$.p=c,R.T=o}}function j_(e,t,n,a){var o=R.T;R.T=null;var c=$.p;try{$.p=8,Bo(e,t,n,a)}finally{$.p=c,R.T=o}}function Bo(e,t,n,a){if(ci){var o=Go(a);if(o===null)To(e,t,a,ui,n),xm(e,a);else if(O_(o,e,t,n,a))a.stopPropagation();else if(xm(e,a),t&4&&-1<A_.indexOf(e)){for(;o!==null;){var c=oa(o);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var m=Ln(c.pendingLanes);if(m!==0){var _=c;for(_.pendingLanes|=2,_.entangledLanes|=2;m;){var v=1<<31-gt(m);_.entanglements[1]|=v,m&=~v}Qt(c),(ve&6)===0&&($s=pt()+500,Rl(0))}}break;case 31:case 13:_=Yn(c,2),_!==null&&mt(_,c,2),Is(),qo(c,2)}if(c=Go(a),c===null&&To(e,t,a,ui,n),c===o)break;o=c}o!==null&&a.stopPropagation()}else To(e,t,a,null,n)}}function Go(e){return e=Yi(e),Yo(e)}var ui=null;function Yo(e){if(ui=null,e=ra(e),e!==null){var t=d(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=p(t),e!==null)return e;e=null}else if(n===31){if(e=h(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return ui=e,null}function bm(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(ph()){case Tc:return 2;case kc:return 8;case Pl:case hh:return 32;case jc:return 268435456;default:return 32}default:return 32}}var Qo=!1,Cn=null,Rn=null,Mn=null,ql=new Map,Bl=new Map,Dn=[],A_="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 xm(e,t){switch(e){case"focusin":case"focusout":Cn=null;break;case"dragenter":case"dragleave":Rn=null;break;case"mouseover":case"mouseout":Mn=null;break;case"pointerover":case"pointerout":ql.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bl.delete(t.pointerId)}}function Gl(e,t,n,a,o,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:c,targetContainers:[o]},t!==null&&(t=oa(t),t!==null&&_m(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function O_(e,t,n,a,o){switch(t){case"focusin":return Cn=Gl(Cn,e,t,n,a,o),!0;case"dragenter":return Rn=Gl(Rn,e,t,n,a,o),!0;case"mouseover":return Mn=Gl(Mn,e,t,n,a,o),!0;case"pointerover":var c=o.pointerId;return ql.set(c,Gl(ql.get(c)||null,e,t,n,a,o)),!0;case"gotpointercapture":return c=o.pointerId,Bl.set(c,Gl(Bl.get(c)||null,e,t,n,a,o)),!0}return!1}function vm(e){var t=ra(e.target);if(t!==null){var n=d(t);if(n!==null){if(t=n.tag,t===13){if(t=p(n),t!==null){e.blockedOn=t,Dc(e.priority,function(){ym(n)});return}}else if(t===31){if(t=h(n),t!==null){e.blockedOn=t,Dc(e.priority,function(){ym(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function fi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Go(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);Gi=a,n.target.dispatchEvent(a),Gi=null}else return t=oa(n),t!==null&&_m(t),e.blockedOn=n,!1;t.shift()}return!0}function Sm(e,t,n){fi(e)&&n.delete(t)}function C_(){Qo=!1,Cn!==null&&fi(Cn)&&(Cn=null),Rn!==null&&fi(Rn)&&(Rn=null),Mn!==null&&fi(Mn)&&(Mn=null),ql.forEach(Sm),Bl.forEach(Sm)}function di(e,t){e.blockedOn===t&&(e.blockedOn=null,Qo||(Qo=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,C_)))}var mi=null;function Em(e){mi!==e&&(mi=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){mi===e&&(mi=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],o=e[t+2];if(typeof a!="function"){if(Yo(a||n)===null)continue;break}var c=oa(n);c!==null&&(e.splice(t,3),t-=3,Br(c,{pending:!0,data:o,method:n.method,action:a},a,o))}}))}function Qa(e){function t(v){return di(v,e)}Cn!==null&&di(Cn,e),Rn!==null&&di(Rn,e),Mn!==null&&di(Mn,e),ql.forEach(t),Bl.forEach(t);for(var n=0;n<Dn.length;n++){var a=Dn[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Dn.length&&(n=Dn[0],n.blockedOn===null);)vm(n),n.blockedOn===null&&Dn.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var o=n[a],c=n[a+1],m=o[rt]||null;if(typeof c=="function")m||Em(n);else if(m){var _=null;if(c&&c.hasAttribute("formAction")){if(o=c,m=c[rt]||null)_=m.formAction;else if(Yo(o)!==null)continue}else _=m.action;typeof _=="function"?n[a+1]=_:(n.splice(a,3),a-=3),Em(n)}}}function wm(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(m){return o=m})},focusReset:"manual",scroll:"manual"})}function t(){o!==null&&(o(),o=null),a||setTimeout(n,20)}function n(){if(!a&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),o!==null&&(o(),o=null)}}}function Vo(e){this._internalRoot=e}pi.prototype.render=Vo.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current,a=Et();hm(n,a,e,t,null,null)},pi.prototype.unmount=Vo.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;hm(e.current,2,null,e,null,null),Is(),t[ia]=null}};function pi(e){this._internalRoot=e}pi.prototype.unstable_scheduleHydration=function(e){if(e){var t=Mc();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Dn.length&&t!==0&&t<Dn[n].priority;n++);Dn.splice(n,0,e),n===0&&vm(e)}};var Nm=r.version;if(Nm!=="19.2.8")throw Error(i(527,Nm,"19.2.8"));$.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=g(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var R_={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:R,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var hi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!hi.isDisabled&&hi.supportsFiber)try{Ja=hi.inject(R_),ht=hi}catch{}}return Ql.createRoot=function(e,t){if(!u(e))throw Error(i(299));var n=!1,a="",o=Rf,c=Mf,m=Df;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(m=t.onRecoverableError)),t=mm(e,1,!1,null,null,n,a,null,o,c,m,wm),e[ia]=t.current,No(e),new Vo(t)},Ql.hydrateRoot=function(e,t,n){if(!u(e))throw Error(i(299));var a=!1,o="",c=Rf,m=Mf,_=Df,v=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(c=n.onUncaughtError),n.onCaughtError!==void 0&&(m=n.onCaughtError),n.onRecoverableError!==void 0&&(_=n.onRecoverableError),n.formState!==void 0&&(v=n.formState)),t=mm(e,1,!0,t,n??null,a,o,v,c,m,_,wm),t.context=pm(null),n=t.current,a=Et(),a=Mi(a),o=bn(a),o.callback=null,xn(n,o,a),n=a,t.current.lanes=n,Fa(t,n),Qt(t),e[ia]=t.current,No(e),new pi(t)},Ql.version="19.2.8",Ql}var zm;function Y_(){if(zm)return Ko.exports;zm=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(r){console.error(r)}}return l(),Ko.exports=G_(),Ko.exports}var Q_=Y_();const Um=l=>{let r;const s=new Set,i=(g,b)=>{const x=typeof g=="function"?g(r):g;if(!Object.is(x,r)){const w=r;r=b??(typeof x!="object"||x===null)?x:Object.assign({},r,x),s.forEach(j=>j(r,w))}},u=()=>r,h={setState:i,getState:u,getInitialState:()=>y,subscribe:g=>(s.add(g),()=>s.delete(g))},y=r=l(i,u,h);return h},V_=(l=>l?Um(l):Um),X_=l=>l;function $_(l,r=X_){const s=Kl.useSyncExternalStore(l.subscribe,Kl.useCallback(()=>r(l.getState()),[l,r]),Kl.useCallback(()=>r(l.getInitialState()),[l,r]));return Kl.useDebugValue(s),s}const K_=l=>{const r=V_(l),s=i=>$_(r,i);return Object.assign(s,r),s},I_=(l=>K_),G={CONNECTED:"connected",DISCONNECTED:"disconnected",AGENT_CREATED:"agent.created",AGENT_OUTPUT:"agent.output",AGENT_STATUS_CHANGED:"agent.status_changed",AGENT_COMPLETED:"agent.completed",AGENT_ERROR:"agent.error",SESSION_TERMINATED:"session.terminated",TOOL_CALL_START:"tool.call_start",TOOL_CALL_END:"tool.call_end",TOOL_OUTPUT:"tool.output",PERMISSION_REQUESTED:"permission.requested",PERMISSION_INPUT_MODE:"permission.input_mode",PERMISSION_RESOLVED:"permission.resolved",PERMISSION_RESPONSE:"permission.response",PERMISSION_STATUS:"permission.status",CLARIFICATION_INPUT_MODE:"clarification.input_mode",CLARIFICATION_QUESTION:"clarification.question",CLARIFICATION_RESOLVED:"clarification.resolved",CLARIFICATION_RESPONSE:"clarification.response",CLARIFICATION_BATCH:"clarification.batch",CLARIFICATION_BATCH_RESPONSE:"clarification.batch_response",REFERENCE_SELECTION_REQUESTED:"reference_selection.requested",REFERENCE_SELECTION_RESOLVED:"reference_selection.resolved",REFERENCE_SELECTION_RESPONSE:"reference_selection.response",PLAN_UPDATED:"plan.updated",PLAN_STEP_UPDATED:"plan.step_updated",PLAN_CLEARED:"plan.cleared",CONTEXT_UPDATED:"context.updated",TURN_COMPLETED:"turn.completed",SYSTEM_MESSAGE:"system.message",HELP_TEXT:"help.text",ERROR:"error",INIT_PROGRESS:"init.progress",RETRY:"retry",SESSION_LIST:"session.list",SESSION_INFO:"session.info",SEND_MESSAGE:"message.send",STOP:"session.stop",COMMAND:"command.execute",COMMAND_LIST_REQUEST:"command.list_request",COMMAND_LIST:"command.list",COMMAND_LIST_REFRESH:"command.list_refresh",TOOL_DISABLE_REQUEST:"tools.disable",TOOLS_REGISTER_CLIENT:"tools.register_client",TOOL_EXECUTE_REQUEST:"tool.execute_request",TOOL_EXECUTE_RESULT:"tool.execute_result",HISTORY_REQUEST:"history.request",HISTORY:"history",CLIENT_CONFIG:"client.config",POST_AUTH_SETUP:"auth.setup",POST_AUTH_SETUP_RESPONSE:"auth.setup_response",WORKSPACE_LIST_REQUEST:"workspace.list",WORKSPACE_LIST:"workspace.list_response",WORKSPACE_CREATE_REQUEST:"workspace.create",WORKSPACE_CREATED:"workspace.created",WORKSPACE_SELECT_REQUEST:"workspace.select",WORKSPACE_DELETE_REQUEST:"workspace.delete",WORKSPACE_DELETED:"workspace.deleted",CONFIG_STATUS:"config.status",CONFIG_UPDATE_REQUEST:"config.update",CONFIG_UPDATED:"config.updated",WORKSPACE_FILES_STAGE_REQUEST:"workspace.files.stage_request",WORKSPACE_FILES_STAGED:"workspace.files.staged",SESSION_PROFILES:"session.profiles",WORKSPACE_FILES_CHANGED:"workspace.files_changed",WORKSPACE_FILES_SNAPSHOT:"workspace.files_snapshot",WORKSPACE_IGNORE_RESULT:"workspace.ignore.result",INJECT_PROMPT_REQUEST:"inject_prompt.request",REPLAY_MESSAGES_REQUEST:"replay_messages.request",RESOLVE_FORK_POINT_REQUEST:"resolve_fork_point.request",PERMISSION_ADD_WHITELIST_REQUEST:"permission.add_whitelist",PERMISSION_ADD_BLACKLIST_REQUEST:"permission.add_blacklist",PERMISSION_REMOVE_REQUEST:"permission.remove",PERMISSION_CLEAR_REQUEST:"permission.clear",PERMISSION_SET_DEFAULT_REQUEST:"permission.set_default",PERMISSION_POLICY_SNAPSHOT_REQUEST:"permission.policy_snapshot.request"};class wt extends Error{constructor(r){super(r),this.name="ConnectionError"}}class Wo extends Error{constructor(r="Client is reconnecting"){super(r),this.name="ReconnectingError"}}class gi extends Error{constructor(r="Connection is closed"){super(r),this.name="ConnectionClosedError"}}class Lm extends Error{serverProtocol;minProtocol;serverVersion;constructor(r,s,i){const u=i??"unknown",d=r.split(".").map(y=>parseInt(y,10)),p=s.split(".").map(y=>parseInt(y,10));let h="version mismatch";!Number.isNaN(d[0])&&!Number.isNaN(p[0])&&d[0]!==p[0]?h=`major-version mismatch (server speaks ${d[0]}.x, client needs ${p[0]}.x) — wire shapes are incompatible`:!Number.isNaN(d[1])&&!Number.isNaN(p[1])&&d[1]<p[1]&&(h=`server minor ${d[1]} is below client's required minor ${p[1]} — daemon is missing fields the client depends on`),super(`Server protocol ${r} is not supported by this client (requires >= ${s}): ${h}. Daemon package: ${u}.`),this.name="IncompatibleServerError",this.serverProtocol=r,this.minProtocol=s,this.serverVersion=u}get minVersion(){return this.minProtocol}}class Z_ extends Error{errorType;errorSummary;constructor(r,s){super(`${r??"AgentError"}: ${s??""}`.replace(/: $/,"")),this.name="AgentError",this.errorType=r,this.errorSummary=s}}class J_ extends Error{toolName;constructor(r){super(`tool ${JSON.stringify(r)} requested permission but no onPermission callback was set — pass onPermission to session(...) or use the low-level subscribe(PERMISSION_REQUESTED) API via s.client`),this.name="PermissionUnhandled",this.toolName=r}}class W_ extends Error{field;value;constructor(r,s){super(`${r}=${JSON.stringify(s)} is a relative path and cannot cross the daemon boundary: its meaning depends on the cwd of whichever process reads it, and the two sides do not share one. Resolve it to an absolute path in the process whose cwd it is relative to.`),this.name="RelativePathAcrossBoundaryError",this.field=r,this.value=s}}var qe=(l=>(l.DISCONNECTED="disconnected",l.CONNECTED="connected",l.RECONNECTING="reconnecting",l.CLOSED="closed",l))(qe||{});const F_={autoReconnect:!0,maxReconnectAttempts:null,initialBackoffSeconds:1,maxBackoffSeconds:30,jitterFactor:.1,autoReattachSessionId:!1};function P_(l){if(l.headers||l.token==null)return l.url;const r=new URL(l.url);return r.searchParams.set("token",l.token),r.toString()}function ey(l){const r=l.openTimeoutMs??5e3,s=P_(l),i=globalThis.WebSocket;if(i==null)return Promise.reject(new wt("No WebSocket implementation available. Ensure Node 21+ or a browser environment."));let u;try{l.headers?u=new i(s,{headers:l.headers}):u=new i(s)}catch(x){return Promise.reject(new wt(`WebSocket constructor failed: ${x.message}`))}u.binaryType="arraybuffer";const d=[],p=[];let h=!1,y=null;const g=[],b=()=>{for(h=!0;p.length;)p.shift()(null)};return new Promise((x,w)=>{let j=setTimeout(()=>{try{u.close()}catch{}w(new wt(`WebSocket open timed out after ${r}ms`))},r);u.onopen=()=>{j&&(clearTimeout(j),j=null),x({sendEvent(Y){if(h)throw new wt("Transport is closed");u.send(JSON.stringify(Y))},sendRawEvent(Y){if(h)throw new wt("Transport is closed");u.send(JSON.stringify(Y))},sendBinary(Y){if(h)throw new wt("Transport is closed");u.send(Y)},async*events(){for(;;){if(d.length>0){yield d.shift();continue}if(h)return;const Y=await new Promise(V=>{p.push(V)});if(Y==null)return;yield Y}},close(Y,V){try{u.close(Y??1e3,V??"")}catch{}},onClose(Y){y?Y(y):g.push(Y)},get isOpen(){return!h}})},u.onerror=()=>{j&&(clearTimeout(j),j=null,w(new wt("WebSocket error during open")))},u.onmessage=z=>{let Y;if(typeof z.data=="string")Y=z.data;else if(z.data instanceof ArrayBuffer)Y=new TextDecoder().decode(z.data);else if(z.data?.text){z.data.text().then(V=>{B(V)});return}else{try{u.close(1003,"unsupported frame type")}catch{}return}B(Y)},u.onclose=z=>{if(j){clearTimeout(j),j=null,w(new wt(`WebSocket closed before open (code=${z.code}, reason=${z.reason||"<empty>"})`));return}y={code:z.code,reason:z.reason||""},b();for(const Y of g)try{Y(y)}catch{}};function B(z){let Y;try{Y=JSON.parse(z)}catch{try{u.close(1003,"invalid JSON frame")}catch{}return}p.length>0?p.shift()(Y):d.push(Y)}})}Symbol.asyncDispose??=Symbol.for("Symbol.asyncDispose");const Hm=["model"];class ty{#e;#n;#t=null;#s;constructor(r,s,i){this.#e=r,this.#n=s,r.subscribe(G.PERMISSION_REQUESTED,u=>{this.#i(u)}),i&&i.size>0&&(this.#s=i,r.subscribe(G.TOOL_EXECUTE_REQUEST,u=>{this.#r(u)}))}get client(){return this.#e}get sessionId(){return this.#e.sessionId}async#i(r){const s=r,i=s?.request_id??"";if(this.#n){const u=await this.#n(r);await this.#e.respondToPermission(i,u||"n")}else this.#t=s?.tool_name??"?",await this.#e.respondToPermission(i,"n")}async#r(r){const s=r,i=s?.call_id??"",u=s?.tool_name?this.#s?.get(s.tool_name):void 0;if(!u){await this.#e.respondToToolExecution(i,"",`no handler for host tool ${JSON.stringify(s?.tool_name)}`);return}try{const d=await u(s?.tool_args??{}),p=typeof d=="string"?d:JSON.stringify(d);await this.#e.respondToToolExecution(i,p)}catch(d){await this.#e.respondToToolExecution(i,"",d instanceof Error?d.message:String(d))}}#a(r){if(this.#t!==null){const s=this.#t;throw this.#t=null,new J_(s)}if(r.reason==="error")throw new Z_(r.errorType,r.errorSummary)}#l(r,s){const i=s;r.reason??=i?.reason??"natural",i?.error_type&&(r.errorType=i.error_type),i?.error_summary&&(r.errorSummary=i.error_summary)}async ask(r,s={}){const i=s.sources===void 0?Hm:s.sources,u=[],d={};let p;const h=new Promise(j=>{p=j}),y=j=>{const B=j;(i===null||B?.source!=null&&i.includes(B.source))&&B?.text&&u.push(B.text)},g=j=>{this.#l(d,j),p()},b=this.#e.subscribe(G.AGENT_OUTPUT,y),x=this.#e.subscribeOnce(G.SESSION_TERMINATED,g),w=this.#e.subscribeOnce(G.TURN_COMPLETED,g);try{await this.#e.sendMessage(r,s.attachments,s.parallelTools),await h}finally{b(),x(),w()}return this.#a(d),u.join("")}async complete(r,s={}){const i={};let u=null,d;const p=new Promise(w=>{d=w}),h=w=>{u=w?.payload??null},y=w=>{this.#l(i,w),d()},g=this.#e.subscribeOnce(G.AGENT_COMPLETED,h),b=this.#e.subscribeOnce(G.SESSION_TERMINATED,y),x=this.#e.subscribeOnce(G.TURN_COMPLETED,y);try{await this.#e.sendMessage(r,s.attachments,s.parallelTools),await p}finally{g(),b(),x()}return this.#a(i),u}async*stream(r,s={}){const i=s.sources===void 0?Hm:s.sources,u=[],d={};let p=!1,h=null;const y=()=>{if(h){const B=h;h=null,B()}},g=B=>{const z=B;(i===null||z?.source!=null&&i.includes(z.source))&&z?.text&&(u.push(z.text),y())},b=B=>{this.#l(d,B),p=!0,y()},x=this.#e.subscribe(G.AGENT_OUTPUT,g),w=this.#e.subscribeOnce(G.SESSION_TERMINATED,b),j=this.#e.subscribeOnce(G.TURN_COMPLETED,b);try{for(await this.#e.sendMessage(r,s.attachments,s.parallelTools);;){if(u.length>0){yield u.shift();continue}if(p)break;await new Promise(B=>{h=B})}}finally{x(),w(),j()}this.#a(d)}async close(){await this.#e.close()}async[Symbol.asyncDispose](){await this.close()}}function ny(l,r){return l.sessionId?Promise.resolve(l.sessionId):new Promise(s=>{let i;const u=l.subscribe(G.SESSION_INFO,()=>{clearTimeout(i),u(),s(l.sessionId)});i=setTimeout(()=>{u(),s(null)},r)})}function ay(l){return l.startsWith("/")||l.startsWith("\\\\")||/^[A-Za-z]:[\\/]/.test(l)}function qm(l,r){if(r!==void 0&&r!==""&&!ay(r))throw new W_(l,r)}async function ly(l){const r={...l.presentation??{},client_type:l.clientType??"api"};qm("workspacePath",l.workspacePath),qm("configRoot",l.configRoot);const s={presentation:r};l.workspacePath!==void 0&&(s.working_dir=l.workspacePath),l.envFile!==void 0&&(s.env_file=l.envFile),l.configRoot!==void 0&&(s.config_root=l.configRoot),l.apparmor!==void 0&&(s.apparmor=l.apparmor);const i={url:l.url,token:l.token,headers:l.headers,minProtocolVersion:l.minProtocolVersion,recovery:l.recovery,openTimeoutMs:l.openTimeoutMs,clientConfig:s},u=new kp(i);l.onStatusChange&&u.onStatus(l.onStatusChange),await u.connect();const d=new Map;if(l.clientTools&&l.clientTools.length>0){const g=l.clientTools.map(b=>{const{handler:x,...w}=b;return x&&typeof b.name=="string"&&d.set(b.name,x),w});await u.registerClientTools(g)}const p=l.sessionTimeoutMs??6e4,h=ny(u,p);if(await u.createSession({profile:l.profile,agent:l.agent,agentParams:l.agentParams,cascadeDriverId:l.cascadeDriverId}),!await h)throw await u.close(),new Error(`session.new did not produce a session id within ${p}ms — check provider auth / the daemon log`);return new ty(u,l.onPermission,d)}const sy="1.0",Bm="1.5",Gm="1.6",Ym="1.11",Qm="1.12";function Vm(l){const r=l.split(".");if(r.length<2)return null;const s=parseInt(r[0],10),i=parseInt(r[1],10);return Number.isNaN(s)||Number.isNaN(i)?null:[s,i]}function Vl(l,r){const s=Vm(l),i=Vm(r);return s==null||i==null||s[0]!==i[0]?!1:s[1]>=i[1]}class kp{_options;_recovery;_transport=null;_state=qe.DISCONNECTED;_serverVersion=null;_serverProtocolVersion=null;_clientId=null;_sessionId=null;_statusHandlers=[];_typedHandlers=new Map;_catchallHandlers=[];_handlerIdCounter=0;_bufferedEvents=[];_eventLoopActive=!1;_reconnectAttempts=0;_reconnectTimer=null;_explicitClose=!1;constructor(r){if(this._options=r,this._recovery={...F_,...r.recovery??{}},this._recovery.autoReattachSessionId){let s=!1;this.onStatus(i=>{if(i.state===qe.RECONNECTING){s=!0;return}i.state===qe.CONNECTED&&s&&this._sessionId&&(s=!1,this.attachSession(this._sessionId))})}}get state(){return this._state}get isConnected(){return this._state===qe.CONNECTED}get serverVersion(){return this._serverVersion}get serverProtocolVersion(){return this._serverProtocolVersion}get clientId(){return this._clientId}get sessionId(){return this._sessionId}onStatus(r){return this._statusHandlers.push(r),()=>{const s=this._statusHandlers.indexOf(r);s>=0&&this._statusHandlers.splice(s,1)}}async connect(){if(this._state!==qe.CONNECTED){if(this._state===qe.CLOSED)throw new gi("Client was closed; construct a new instance");this._explicitClose=!1,await this._openOnce(),this._startEventLoop()}}async close(){this._explicitClose=!0,this._reconnectTimer&&(clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this._transport&&(this._transport.close(1e3,"client close"),this._transport=null),this._transition(qe.CLOSED)}subscribe(r,s){return this._addTypedHandler(r,s,!1)}subscribeOnce(r,s){return this._addTypedHandler(r,s,!0)}subscribeAll(r){return this._addCatchallHandler(r,!1)}subscribeMany(r){const s=[];for(const i of Object.keys(r)){const u=r[i];u&&s.push(this._addTypedHandler(i,u,!1))}return()=>{for(const i of s)i()}}_addTypedHandler(r,s,i){const u=++this._handlerIdCounter,d={handler:s,once:i,id:u};let p=this._typedHandlers.get(r);return p||(p=[],this._typedHandlers.set(r,p)),p.push(d),()=>this._removeTypedHandlerId(r,u)}_addCatchallHandler(r,s){const i=++this._handlerIdCounter,u={handler:r,once:s,id:i};return this._catchallHandlers.push(u),()=>this._removeCatchallHandlerId(i)}_removeTypedHandlerId(r,s){const i=this._typedHandlers.get(r);if(!i)return;const u=i.findIndex(d=>d.id===s);u>=0&&i.splice(u,1)}_removeCatchallHandlerId(r){const s=this._catchallHandlers.findIndex(i=>i.id===r);s>=0&&this._catchallHandlers.splice(s,1)}async sendMessage(r,s,i){await this._sendEvent({type:G.SEND_MESSAGE,text:r,attachments:s??[],parallel_tools:i??null})}async stop(r){await this._sendEvent({type:G.STOP,agent_id:r??null})}async respondToPermission(r,s,i){await this._sendEvent({type:G.PERMISSION_RESPONSE,request_id:r,response:s,edited_arguments:i??null})}async respondToPostAuthSetup(r,s){await this._sendEvent({type:G.POST_AUTH_SETUP_RESPONSE,request_id:r,connect:s.connect,model_name:s.modelName??"",persist_env:s.persistEnv??!1})}async respondToClarification(r,s,i=0){await this._sendEvent({type:G.CLARIFICATION_RESPONSE,request_id:r,question_index:i,response:s})}async respondToClarificationBatch(r,s,i=!1,u){const d=!i&&u!==void 0&&Object.keys(u).length>0;d&&this._requireClarificationAttachmentProtocol(),await this._sendEvent({type:G.CLARIFICATION_BATCH_RESPONSE,request_id:r,answers:s,cancelled:i,answer_attachments:d?u:{}})}_requireClarificationAttachmentProtocol(){if(!(this._serverProtocolVersion!==null&&Vl(this._serverProtocolVersion,Gm)))throw new Error(`respondToClarificationBatch: this daemon speaks protocol ${this._serverProtocolVersion??"unknown"} and would DROP the answer attachments (needs >= ${Gm}). Answer the clarification in text, or upgrade the daemon.`)}async respondToReferenceSelection(r,s){await this._sendEvent({type:G.REFERENCE_SELECTION_RESPONSE,request_id:r,response:s})}async respondToToolExecution(r,s="",i=""){await this._sendEvent({type:G.TOOL_EXECUTE_RESULT,call_id:r,result:s,error:i})}async createSession(r={}){const s=r.name?[r.name]:[];let i;if(typeof r.profile=="string")s.push("--profile",r.profile);else if(r.profile!==void 0&&r.profile!==null&&typeof r.profile=="object")i={spec:r.profile};else if(r.profile!==void 0&&r.profile!==null)throw new TypeError(`createSession: 'profile' must be string (name) or object (inline spec), got ${typeof r.profile}`);if(r.agent&&s.push("--agent",r.agent),r.agentParams)for(const[u,d]of Object.entries(r.agentParams))s.push(`${u}=${d}`);r.cascadeDriverId&&s.push("--cascade-driver-id",r.cascadeDriverId),await this._sendEvent({type:G.COMMAND,command:"session.new",args:s,payload:i})}static session(r){return ly(r)}async attachSession(r){await this._sendEvent({type:G.COMMAND,command:"session.attach",args:[r]}),this._sessionId=r}async getDefaultSession(){await this._sendEvent({type:G.COMMAND,command:"session.default",args:[]})}async listSessions(){await this._sendEvent({type:G.COMMAND,command:"session.list",args:[]})}async listProfiles(){await this._sendEvent({type:G.COMMAND,command:"session.profiles",args:[]})}async endSession(){await this._sendEvent({type:G.COMMAND,command:"session.end",args:[]})}async reloadSessionEnv(r){if(this._serverProtocolVersion===null||!Vl(this._serverProtocolVersion,Ym))throw new Error(`reloadSessionEnv: this daemon speaks protocol ${this._serverProtocolVersion??"unknown"} and does not serve session.reload_env (needs >= ${Ym}). It would ignore the command silently. Upgrade the daemon, or start a new session to pick up the credential.`);await this._sendEvent({type:G.COMMAND,command:"session.reload_env",args:r?[r]:[]})}async toggleWorkspaceIgnore(r){if(this._serverProtocolVersion===null||!Vl(this._serverProtocolVersion,Qm))throw new Error(`toggleWorkspaceIgnore: this daemon speaks protocol ${this._serverProtocolVersion??"unknown"} and does not serve workspace.ignore (needs >= ${Qm}). It would ignore the command silently. Upgrade the daemon, or edit the workspace's .gitignore directly.`);await this._sendEvent({type:G.COMMAND,command:"workspace.ignore",args:[r]})}async deleteSession(r){await this._sendEvent({type:G.COMMAND,command:"session.delete",args:[r]})}async executeCommand(r,s,i){await this._sendEvent({type:G.COMMAND,command:r,args:s??[],payload:i??null})}async sendRawEvent(r){if(this._state===qe.RECONNECTING)throw new Wo;if(this._state===qe.CLOSED)throw new gi;if(this._transport==null)throw new wt("No active transport — call connect() first");this._transport.sendRawEvent(r)}async disableTool(r){await this._sendEvent({type:G.TOOL_DISABLE_REQUEST,tool_name:r})}async requestCommandList(){await this._sendEvent({type:G.COMMAND_LIST_REQUEST})}async requestHistory(r="main"){await this._sendEvent({type:G.HISTORY_REQUEST,agent_id:r})}async registerClientTools(r,s){await this._sendEvent({type:G.TOOLS_REGISTER_CLIENT,tools:r,categories:s??{}})}async injectPrompt(r,s="user",i,u){u&&u.length>0&&this._requireAttachmentResumeProtocol("injectPrompt"),await this._sendEvent({type:G.INJECT_PROMPT_REQUEST,text:r,source_type:s,source_id:i??null,attachments:u??[]})}async wakeSession(r,s="",i){const u=i?.attachments??[];if(!s&&u.length===0)throw new Error("wakeSession requires text or attachments — a wake with no content drives a turn the model has nothing to answer");const d={session_id:r,text:s,source:i?.source??"user"};i?.eventId!==void 0&&(d.event_id=i.eventId),u.length>0&&(this._requireAttachmentResumeProtocol("wakeSession"),d.attachments=u),await this.executeCommand("session.wake",[],d)}_requireAttachmentResumeProtocol(r){if(!(this._serverProtocolVersion!==null&&Vl(this._serverProtocolVersion,Bm)))throw new Error(`${r}: this daemon speaks protocol ${this._serverProtocolVersion??"unknown"} and would DROP the attachments (needs >= ${Bm}). Send the content through sendMessage() on a live session, or upgrade the daemon.`)}async replayMessages(r,s,i=120){await this._sendEvent({type:G.REPLAY_MESSAGES_REQUEST,request_id:r,messages:s??null,timeout_seconds:i})}async resolveForkPoint(r,s={}){await this._sendEvent({type:G.RESOLVE_FORK_POINT_REQUEST,request_id:r,after_message:s.afterMessage??null,after_tool_call:s.afterToolCall??null,after_timestamp:s.afterTimestamp??null})}async addWhitelistTools(r,s){await this._sendEvent({type:G.PERMISSION_ADD_WHITELIST_REQUEST,tools:r??[],patterns:s??[]})}async addBlacklistTools(r,s){await this._sendEvent({type:G.PERMISSION_ADD_BLACKLIST_REQUEST,tools:r??[],patterns:s??[]})}async removePermissionRules(r,s,i){await this._sendEvent({type:G.PERMISSION_REMOVE_REQUEST,target:r,tools:s??[],patterns:i??[]})}async clearPermissionRules(r="all"){await this._sendEvent({type:G.PERMISSION_CLEAR_REQUEST,target:r})}async setDefaultPolicy(r){await this._sendEvent({type:G.PERMISSION_SET_DEFAULT_REQUEST,policy:r})}async requestPolicySnapshot(r=""){await this._sendEvent({type:G.PERMISSION_POLICY_SNAPSHOT_REQUEST,request_id:r})}async stageFiles(r,s){if(this._state!==qe.CONNECTED)throw this._state===qe.RECONNECTING?new Wo:new gi;if(this._transport==null)throw new wt("No active transport — call connect() first");const i=this._transport,u=s.map(p=>({name:p.name,size:(p.data instanceof ArrayBuffer,p.data.byteLength),content_type:p.contentType??null,mode:p.mode??null})),d=this._waitForNextEvent(p=>p.type===G.WORKSPACE_FILES_STAGED);i.sendEvent({type:G.WORKSPACE_FILES_STAGE_REQUEST,workspace_id:r,files:u});for(const p of s)i.sendBinary(p.data);return d}_waitForNextEvent(r){return new Promise(s=>{const i=this.subscribeAll(u=>{r(u)&&(i(),s(u))})})}async _sendEvent(r){if(this._state===qe.RECONNECTING)throw new Wo;if(this._state===qe.CLOSED)throw new gi;if(this._transport==null)throw new wt("No active transport — call connect() first");this._transport.sendEvent(r)}async _resolveToken(){const r=this._options.token;return typeof r=="function"?await r():r}async _openOnce(){const r=await this._resolveToken(),s=await ey({url:this._options.url,token:r,headers:this._options.headers,openTimeoutMs:this._options.openTimeoutMs});this._transport=s,s.onClose(g=>this._handleClose(g));const i=s.events(),u=await i.next();if(u.done)throw this._transport=null,new wt("Server closed connection before sending ConnectedEvent");const d=u.value;if(d.type!==G.CONNECTED)throw this._transport=null,s.close(),new wt(`Expected ConnectedEvent from server, got ${d.type}`);const p=d,h=p.server_info??{};this._serverVersion=h.server_version??null,this._clientId=h.client_id??null,this._serverProtocolVersion=p.protocol_version??null;const y=this._options.minProtocolVersion??sy;if(this._serverProtocolVersion==null||!Vl(this._serverProtocolVersion,y))throw this._transport=null,s.close(1002,"incompatible protocol version"),new Lm(this._serverProtocolVersion??"unknown",y,this._serverVersion??void 0);if(this._options.clientConfig){const g={type:G.CLIENT_CONFIG,timestamp:new Date().toISOString(),...this._options.clientConfig};s.sendEvent(g)}this._reconnectAttempts=0,this._transition(qe.CONNECTED,{serverVersion:this._serverVersion??void 0,clientId:this._clientId??void 0}),this._dispatchEvent(p),this._pumpFromIterator(i)}async _pumpFromIterator(r){try{for(;;){const s=await r.next();if(s.done)return;this._dispatchEvent(s.value)}}catch{}}_startEventLoop(){if(!this._eventLoopActive)for(this._eventLoopActive=!0;this._bufferedEvents.length>0;){const r=this._bufferedEvents.shift();this._dispatchEvent(r)}}_dispatchEvent(r){const s=r.session_id;s&&r.type===G.SESSION_INFO&&(this._sessionId=s);const i=this._typedHandlers.get(r.type),u=i?i.slice():[],d=this._catchallHandlers.slice();for(const p of u)p.once&&this._removeTypedHandlerId(r.type,p.id),this._invokeHandler(p.handler,r);for(const p of d)p.once&&this._removeCatchallHandlerId(p.id),this._invokeHandler(p.handler,r)}_invokeHandler(r,s){let i;try{i=r(s)}catch(u){console.error("[JaatoClient] subscriber threw:",u);return}i&&typeof i.then=="function"&&i.catch(u=>{console.error("[JaatoClient] async subscriber rejected:",u)})}_handleClose(r){if(this._transport=null,this._explicitClose||this._state===qe.CLOSED){this._transition(qe.CLOSED,{reason:r.reason||`code ${r.code}`});return}if(!this._recovery.autoReconnect){this._transition(qe.CLOSED,{reason:`connection lost (code ${r.code})`});return}this._scheduleReconnect()}_scheduleReconnect(){if(this._reconnectAttempts+=1,this._recovery.maxReconnectAttempts!=null&&this._reconnectAttempts>this._recovery.maxReconnectAttempts){this._transition(qe.CLOSED,{reason:`max reconnect attempts (${this._recovery.maxReconnectAttempts}) exceeded`});return}const r=Math.min(this._recovery.initialBackoffSeconds*Math.pow(2,this._reconnectAttempts-1),this._recovery.maxBackoffSeconds),s=r*this._recovery.jitterFactor*(Math.random()*2-1),i=Math.max(0,r+s);this._transition(qe.RECONNECTING,{reconnectAttempt:this._reconnectAttempts,reconnectDelaySeconds:i}),this._reconnectTimer=setTimeout(()=>{this._reconnectTimer=null,this._attemptReconnect().catch(()=>{})},i*1e3)}async _attemptReconnect(){try{await this._openOnce()}catch(r){if(r instanceof Lm){this._transition(qe.CLOSED,{reason:r.message});return}this._scheduleReconnect()}}_transition(r,s={}){if(r===this._state&&r!==qe.RECONNECTING)return;this._state=r;const i={state:r,...s};for(const u of this._statusHandlers)try{u(i)}catch(d){console.error("[JaatoClient] status handler threw:",d)}}}const jp=[{name:"help",description:"Show available commands"},{name:"history",description:"Show conversation history"},{name:"exit",description:"Detach from the session"},{name:"quit",description:"Detach from the session"},{name:"stop",description:"Stop current model generation"},{name:"clear",description:"Clear output display"},{name:"context",description:"Show context window usage"},{name:"reset",description:"Clear conversation history"},{name:"theme",description:"Switch the UI theme (theme <name>)"}],iy=new Set(jp.map(l=>l.name)),ry=new Set(["tools","session","permissions","model","mcp","save","resume","memory","lsp","todo","waypoint","background","prompt-library","clarification","multimodal","notebook","references","sandbox","workspace","reliability"]),oy=[{name:"tools",description:"Manage tools available to the model"},{name:"tools list",description:"List all tools with enabled/disabled status"},{name:"tools enable",description:"Enable a tool (tools enable <name>|all)"},{name:"tools disable",description:"Disable a tool (tools disable <name>|all)"},{name:"model",description:"Switch to a different model"},{name:"session",description:"Manage sessions"},{name:"session list",description:"List sessions"},{name:"session new",description:"Create a new session"},{name:"session attach",description:"Attach to an existing session"},{name:"permissions",description:"Manage tool permissions"},{name:"permissions status",description:"Show permission status"},{name:"permissions whitelist",description:"Whitelist tools or patterns"},{name:"permissions blacklist",description:"Blacklist tools or patterns"},{name:"save",description:"Save current session"},{name:"resume",description:"Resume a saved session"},{name:"sessions",description:"List saved sessions"},{name:"plan",description:"Show current plan status"}];function Ap(l,r={}){const s=l.trim();if(!s)return{action:"message",text:""};if(r.verbatim)return{action:"message",text:s};const i=s.toLowerCase(),u=s.split(/\s+/),d=(u[0]??"").toLowerCase(),p=u.slice(1);if(i==="exit"||i==="quit"||i==="q")return{action:"exit"};if(i==="stop")return{action:"stop"};if(i==="clear")return{action:"clear"};if(i==="help")return{action:"help"};if(i==="context")return{action:"context"};if(i==="history")return{action:"history"};if(d==="reset")return{action:"server",command:"reset",args:p};if(d==="tools"||d==="session"){const h=p[0]??"list";return{action:"server",command:`${d}.${h}`,args:p.slice(1)}}if(ry.has(d))return{action:"server",command:d,args:p};if(d==="theme")return{action:"server",command:"theme",args:p};for(const h of r.serverCommands??[]){const y=h.name.trim().toLowerCase().split(/\s+/)[0];if(!(!y||iy.has(y))&&(i===y||i.startsWith(y+" ")))return{action:"server",command:y,args:p}}return{action:"message",text:s}}function Xm(l,r){const s=Ap(l,{serverCommands:r});return s.action==="message"?null:s.action==="server"?s.command??"":s.action}function cy(l,r){const s=l.replace(/^\s+/,"");if(s.includes("@")||s.startsWith("/")||s.startsWith("%"))return[];if(s.includes(`
|
|
10
|
+
`))return[];const i=/\s$/.test(s),u=s.trim()===""?[]:s.trim().split(/\s+/),d=new Set,p=[],h=(b,x,w)=>{const j=b.toLowerCase();d.has(j)||(d.add(j),p.push({insert:b,label:x,description:w}))};if(u.length===0){for(const b of r){const x=b.name.split(/\s+/)[0];x===b.name?h(x,b.name,b.description):h(x,x,void 0)}return p}const y=u[0].toLowerCase();if(u.length===1&&!i){for(const b of r){const x=b.name.split(/\s+/)[0];x.toLowerCase().startsWith(y)&&(x===b.name?h(x,b.name,b.description):h(x,x,void 0))}return p}const g=u.length===1?"":(u[1]??"").toLowerCase();if(u.length>2||u.length===2&&i)return[];for(const b of r){const x=b.name.split(/\s+/);if(x.length<2||x[0].toLowerCase()!==y)continue;const w=x[1];w.toLowerCase().startsWith(g)&&h(`${x[0]} ${w}`,`${x[0]} ${w}`,b.description)}return p}function Op(l){const r=new Map;for(const s of[...jp,...oy])r.set(s.name,s);for(const s of l)s.name&&r.set(s.name,s);return[...r.values()]}function Il(l){return typeof l=="string"&&l?l:void 0}function uy(l,r){return typeof l=="string"?l:l&&typeof l=="object"?Il(l.text)??Il(l.label)??`choice ${r}`:`choice ${r}`}function $m(l){const r=l&&typeof l=="object"?l:{},s=Array.isArray(r.choices)?r.choices:Array.isArray(r.options)?r.options:[],i=s.map((y,g)=>uy(y,g+1));let u=null;const d=s.findIndex(y=>!!y&&typeof y=="object"&&y.default===!0);d>=0?u=d+1:typeof r.default_choice=="number"?u=r.default_choice:(typeof r.default=="number"||typeof r.default=="string"&&r.default)&&(u=r.default);const p=s.map(y=>!!y&&typeof y=="object"&&y.expects_attachment===!0),h=r.required===!1||r.optional===!0;return{...r,question_text:Il(r.question_text)??Il(r.text),question_type:Il(r.question_type),options:i,default:u,optional:h,expects_attachment:p.some(Boolean)?p:void 0}}function fy(l){return l.question_type==="multiple_choice"}function dy(l){if(l==null)return null;if(typeof l=="number")return Number.isFinite(l)?{count:l,byName:[]}:null;if(!Array.isArray(l))return null;const r=new Map;for(const s of l){const i=s&&typeof s=="object"&&typeof s.name=="string"?s.name:typeof s=="string"?s:"?";r.set(i,(r.get(i)??0)+1)}return{count:l.length,byName:[...r.entries()]}}function my(l){if(l.count===0)return"no tool calls";const r=`${l.count} tool call${l.count===1?"":"s"}`;if(l.byName.length===0)return r;const s=l.byName.map(([i,u])=>u>1?`${i} ×${u}`:i).join(", ");return`${r} (${s})`}function py(l){if(!l||typeof l!="object")return null;const r=l,s=String(r.id??r.session_id??"");return s?{id:s,name:String(r.name??""),description:String(r.description??""),provider:String(r.model_provider??""),model:String(r.model_name??""),isLoaded:r.is_loaded===!0,isCurrent:r.is_current===!0,clientCount:Number(r.client_count??0)||0,turnCount:Number(r.turn_count??0)||0,workspacePath:String(r.workspace_path??""),createdBy:r.created_by?String(r.created_by):void 0,awaiting:typeof r.awaiting=="string"&&r.awaiting?r.awaiting:void 0,awaitingSince:typeof r.awaiting_since=="string"&&r.awaiting_since?r.awaiting_since:void 0}:null}function Km(l){return Array.isArray(l)?l.map(py).filter(r=>r!==null):[]}function hy(l,r={}){if(l.length===0)return`No sessions available.
|
|
11
|
+
Use 'session new' to create one.`;const s=["Sessions:"," Use 'session attach <id>' to switch sessions",""];for(const i of l){const u=i.isCurrent?"▶":i.isLoaded?"●":"○",d=i.description||i.name,p=[` ${u} ${i.id}${d&&d!==i.id?` - ${d}`:""}`,i.awaiting?` [waiting: ${i.awaiting}]`:"",i.provider?` [${i.provider}/${i.model}]`:"",i.clientCount?`, ${i.clientCount} client(s)`:"",i.turnCount?`, ${i.turnCount} turns`:""];s.push(p.join("")),i.workspacePath&&s.push(` ${i.workspacePath}`);const h=r[i.id]?.text;if(h)for(const y of h.split(`
|
|
12
|
+
`))s.push(` ↳ ${y}`)}return s.push(""," ▶ current ● loaded ○ on disk"),s.join(`
|
|
13
|
+
`)}const Cp=["session attach","session delete","resume"];function gy(l,r){const s=l.replace(/^\s+/,""),i=s.toLowerCase();for(const u of Cp){if(!i.startsWith(u+" "))continue;const d=s.slice(u.length+1);if(/\s/.test(d.trim()))return null;const p=d.trim().toLowerCase();return r.filter(h=>h.id.toLowerCase().startsWith(p)).map(h=>({insert:`${u} ${h.id}`,label:h.id,description:[h.isCurrent?"current":h.isLoaded?"loaded":"on disk",h.description||h.name,h.provider?`${h.provider}/${h.model}`:"",h.workspacePath].filter(Boolean).join(" · ")}))}return null}function _y(l){const r=l.replace(/^\s+/,"").toLowerCase();return Cp.some(s=>r.startsWith(s+" "))}function yy(l,r){return r?l.filter(s=>s.workspacePath?r.path&&s.workspacePath.replace(/\/+$/,"")===r.path.replace(/\/+$/,"")?!0:s.workspacePath.replace(/\/+$/,"").split("/").pop()===r.name:!1):[]}function Rp(l){return typeof l.text=="string"?l.text:""}function by(l){const r=l.result??l.response;if(r==null)return"";if(typeof r=="string")return r;try{return JSON.stringify(r,null,2)}catch{return String(r)}}function xy(l,r,s,i){const u=[],d=new Map,p=Array.isArray(l)?l:[];for(const h of p){const y=String(h.role??"");let g="";for(const b of h.parts??[]){const x=String(b.type??"");if(x==="text")g+=Rp(b);else if(x==="function_call"){g.trim()&&(u.push(y==="user"?{id:s(),kind:"user",agentId:r,text:g}:{id:s(),kind:"text",agentId:r,source:"model",text:g}),g="");const w=String(b.id??b.call_id??s()),j={id:s(),kind:"tool",agentId:r,callId:w,toolName:String(b.name??"tool"),args:b.args??{},status:"success",startedAt:0,output:"",media:[],expanded:i};d.set(w,j),u.push(j)}else if(x==="function_response"){const w=String(b.call_id??b.id??""),j=d.get(w)??[...d.values()].reverse().find(B=>B.toolName===String(b.name??"")&&!B.output);j&&(j.output=by(b),b.is_error===!0&&(j.status="error"),d.delete(j.callId))}}g.trim()&&u.push(y==="user"?{id:s(),kind:"user",agentId:r,text:g}:{id:s(),kind:"text",agentId:r,source:"model",text:g})}return u}function vy(l,r){const s=Array.isArray(l)?l:[];if(s.length===0)return"No conversation history.";const i=Array.isArray(r)?r:[],u=[`Conversation History (${s.length} messages, ${i.length} turns):`,""];let d=0;return s.forEach((p,h)=>{const y=String(p.role??"unknown");u.push(y==="user"?"[User]":y==="model"?"[Model]":`[${y}]`);for(const x of p.parts??[]){const w=String(x.type??"");if(w==="text"){const j=Rp(x);u.push(` ${j.length>500?j.slice(0,500)+"...":j}`)}else w==="function_call"?u.push(` [Function Call: ${String(x.name??"unknown")}]`):w==="function_response"&&u.push(` [Function Response: ${String(x.name??"unknown")}]`)}const g=h===s.length-1,b=!g&&String(s[h+1]?.role)==="user";if(y==="model"&&(g||b)){const x=i[d];if(x){const w=Number(x.prompt??0),j=Number(x.output??0),B=Number(x.total??w+j);u.push(` --- Turn ${d+1}: ${B.toLocaleString()} tokens (in: ${w.toLocaleString()}, out: ${j.toLocaleString()}) ---`)}d+=1}}),u.join(`
|
|
14
|
+
`)}const rc=300,oc=220,cc=720,Mp="jaato.railWidth";function Dp(l){return Number.isFinite(l)?Math.min(cc,Math.max(oc,Math.round(l))):rc}function Sy(){try{const l=localStorage.getItem(Mp);return l==null?rc:Dp(Number(l))}catch{return rc}}function Ey(l){try{localStorage.setItem(Mp,String(l))}catch{}}const _c="active",wy={kind:"idle"};function Ny(l,r){let s=null,i=0;for(const u of l.blocks[r]??[])u.kind!=="tool"||u.status!=="running"||(i+=1,(!s||u.startedAt<s.startedAt)&&(s={toolName:u.toolName,startedAt:u.startedAt}));return s?{first:s,count:i}:null}function Ty(l,r){const s=l.permissions.find(u=>u.agentId===r);if(s)return{on:"permission",toolName:s.toolName};const i=l.clarifications.find(u=>u.agentId===r);return i?{on:"clarification",toolName:i.toolName||void 0}:l.referenceSelections.some(u=>u.agentId===r)?{on:"reference"}:null}function yc(l,r){const s=Ty(l,r);if(s)return{kind:"waiting",since:l.busySince[r]??Date.now(),...s};const i=l.busySince[r];if(i===void 0)return wy;const u=Ny(l,r);return u?{kind:"tool",since:u.first.startedAt,toolName:u.first.toolName,running:u.count}:l.agents[r]?.status===_c?{kind:"thinking",since:i}:{kind:"sending",since:i}}function zp(l,r){return yc(l,r).kind!=="idle"}function ky(l){return l.agentOrder.some(r=>zp(l,r))}function Up(l){switch(l.kind){case"sending":return"Sending";case"thinking":return"Thinking";case"tool":return l.running>1?`Running ${l.toolName} +${l.running-1} more`:`Running ${l.toolName}`;case"waiting":return l.on==="permission"?l.toolName?`Waiting for you — permission for ${l.toolName}`:"Waiting for you — permission":l.on==="clarification"?"Waiting for you — clarification":"Waiting for you — reference";default:return"Idle"}}const Vt="main";let jy=0;const We=()=>`b${++jy}`,Im=()=>({sessionId:null,session:{},initProgress:null,agents:{[Vt]:{id:Vt,name:"main",type:"main",status:"idle"}},agentOrder:[Vt],selectedAgentId:Vt,blocks:{[Vt]:[]},toolOwner:{},permissions:[],clarifications:[],referenceSelections:[],postAuth:null,plan:{},context:{},workspaceFiles:{},workspaceHidden:[],workspaceShowHidden:!1,workspaceIgnored:{},workspaceNotice:null,permissionStatus:null,busySince:{},exitChoice:null});function bi(l,r){if(!(r in l))return l;const s={...l};return delete s[r],s}function Lp(l,r){return r in l?l:{...l,[r]:Date.now()}}function Ke(l){const r=l.agent_id;return typeof r=="string"&&r?r:Vt}function qt(l,r){l.agents[r]||(l.agents={...l.agents,[r]:{id:r,name:r,type:"subagent",status:"idle"}},l.agentOrder=[...l.agentOrder,r]),l.blocks[r]||(l.blocks={...l.blocks,[r]:[]})}function it(l,r,s){l.blocks={...l.blocks,[r]:s}}function Hp(l,r,s){if(!r)return null;const i=l.toolOwner[r]??s,u=l.blocks[i]??[];for(let d=u.length-1;d>=0;d--){const p=u[d];if(p&&p.kind==="tool"&&p.callId===r)return{agentId:i,index:d}}return null}function Zm(l,r,s,i){const u=Hp(l,r,s);if(!u)return!1;const d=[...l.blocks[u.agentId]??[]];return d[u.index]=i(d[u.index]),it(l,u.agentId,d),!0}function Jm(l,r,s){const i=String(r.request_id??"");if(!i)return;const u=l.permissions.find(h=>h.requestId===i),d=Array.isArray(r.response_options)&&r.response_options.length?r.response_options:u?.options??[],p={requestId:i,agentId:Ke(r),toolName:String(r.tool_name??u?.toolName??""),callId:r.call_id??u?.callId??null,toolArgs:r.tool_args??u?.toolArgs??{},options:d,promptLines:r.prompt_lines??u?.promptLines??[],formatHint:r.format_hint??u?.formatHint??null,warnings:r.warnings??u?.warnings??null,warningLevel:r.warning_level??u?.warningLevel??null,editableMetadata:r.editable_metadata??u?.editableMetadata??null,focus:u?.focus??0,inputMode:s||(u?.inputMode??!1)};l.permissions=u?l.permissions.map(h=>h.requestId===i?p:h):[...l.permissions,p],qt(l,p.agentId)}function Ay(l,r){const s=r;switch(s.type){case G.CONNECTED:{const i=s.server_info??{};l.connection={...l.connection,phase:"connected",serverVersion:i.server_version??l.connection.serverVersion??null,protocolVersion:s.protocol_version??l.connection.protocolVersion??null};break}case G.AGENT_CREATED:{const i=Ke(s),u={id:i,name:String(s.agent_name??i),type:String(s.agent_type??(i===Vt?"main":"subagent")),parentId:s.parent_agent_id??null,profile:s.profile_name??null,status:l.agents[i]?.status??"idle"};l.agents={...l.agents,[i]:u},l.agentOrder.includes(i)||(l.agentOrder=[...l.agentOrder,i]),l.blocks[i]||(l.blocks={...l.blocks,[i]:[]});break}case G.AGENT_OUTPUT:{const i=Ke(s);qt(l,i);const u=String(s.text??""),d=String(s.source??"model"),p=[...l.blocks[i]??[]],h=p[p.length-1];if(d==="user"||d==="parent"){if(s.mode==="append"&&h&&h.kind==="user"&&h.echoed)p[p.length-1]={...h,text:h.text+u};else{let y=p.length-1;for(;y>=0&&p[y].kind!=="user";)y-=1;const g=y>=0?p[y]:void 0;g&&!g.echoed&&g.text===u?p[y]={...g,echoed:!0}:p.push({id:We(),kind:"user",agentId:i,text:u,echoed:!0})}it(l,i,p);break}s.mode==="append"&&h&&h.kind==="text"&&h.source===d?p[p.length-1]={...h,text:h.text+u}:p.push({id:We(),kind:"text",agentId:i,source:d,text:u}),it(l,i,p);break}case G.AGENT_STATUS_CHANGED:{const i=Ke(s);qt(l,i);const u=l.agents[i],d=String(s.status??u.status);l.agents={...l.agents,[i]:{...u,status:d,error:s.error??null}},l.busySince=d===_c?Lp(l.busySince,i):bi(l.busySince,i);break}case G.AGENT_COMPLETED:case G.AGENT_ERROR:{const i=Ke(s);qt(l,i);const u=l.agents[i],d=s.type===G.AGENT_ERROR;if(l.agents={...l.agents,[i]:{...u,status:d?"error":"done",error:d?String(s.error??""):null}},l.busySince=bi(l.busySince,i),d){const p=[...l.blocks[i]??[]];p.push({id:We(),kind:"system",agentId:i,text:String(s.error??"agent error"),style:"error"}),it(l,i,p)}break}case G.TOOL_CALL_START:{const i=Ke(s);qt(l,i);const u=String(s.call_id??We()),d={id:We(),kind:"tool",agentId:i,callId:u,toolName:String(s.tool_name??"tool"),args:s.tool_args??{},status:"running",startedAt:Date.now(),output:"",media:[],expanded:l.ui.showTools};it(l,i,[...l.blocks[i]??[],d]),l.toolOwner={...l.toolOwner,[u]:i};break}case G.TOOL_CALL_END:{const i=Ke(s),u=s.success!==!1&&s.is_error_result!==!0;if(!Zm(l,s.call_id,i,p=>({...p,status:u?"success":"error",durationSeconds:s.duration_seconds??null,errorMessage:s.error_message??null,resultStatus:s.result_status??null,isErrorResult:s.is_error_result===!0,backgrounded:s.backgrounded===!0,continuationId:s.continuation_id??null,showOutput:s.show_output===!0,showPopup:s.show_popup===!0,expanded:p.expanded||s.show_output===!0||!u}))){qt(l,i);const p=String(s.call_id??We());it(l,i,[...l.blocks[i]??[],{id:We(),kind:"tool",agentId:i,callId:p,toolName:String(s.tool_name??"tool"),args:{},status:u?"success":"error",startedAt:Date.now(),output:"",media:[],expanded:!u,errorMessage:s.error_message??null}])}l.ui.popupCallId&&l.ui.popupCallId===s.call_id&&!s.continuation_id&&(l.ui={...l.ui,popupCallId:null});break}case G.TOOL_OUTPUT:{const i=Ke(s),u=s.call_id,d=s.mime_type,p=s.data_b64,h=String(s.chunk??""),y=d&&p?{mimeType:d,dataB64:p,streamId:s.stream_id,sequence:s.sequence,final:s.final===!0}:null;if(u==="model-output"){qt(l,i);const b=[...l.blocks[i]??[]],x=b[b.length-1],w=s.final===!0?"success":"running";x&&x.kind==="tool"&&x.callId==="model-output"&&x.status==="running"?b[b.length-1]={...x,output:h?x.output+h:x.output,media:y?[...x.media,y]:x.media,status:w}:(y||h)&&b.push({id:We(),kind:"tool",agentId:i,callId:"model-output",toolName:"model output",args:{},status:w,startedAt:Date.now(),output:h,media:y?[y]:[],expanded:!0}),it(l,i,b);break}if(Zm(l,u,i,b=>({...b,output:h?b.output+h:b.output,media:y?[...b.media,y]:b.media}))&&h&&l.ui.popupCallId==null){const b=Hp(l,u,i),x=b?l.blocks[b.agentId]?.[b.index]:void 0;x&&x.status==="running"&&(l.ui={...l.ui,popupCallId:x.callId})}break}case G.PERMISSION_REQUESTED:Jm(l,s,!1);break;case G.PERMISSION_INPUT_MODE:Jm(l,s,!0);break;case G.PERMISSION_RESOLVED:{const i=String(s.request_id??"");l.permissions=l.permissions.filter(u=>u.requestId!==i);break}case G.PERMISSION_STATUS:l.permissionStatus={effectiveDefault:String(s.effective_default??"ask"),suspensionScope:s.suspension_scope??null};break;case G.SESSION_LIST:{const i=Km(s.sessions);if(l.sessions=i,l.sessionListSilent>0){l.sessionListSilent-=1;break}const u=l.selectedAgentId;it(l,u,[...l.blocks[u]??[],{id:We(),kind:"system",agentId:u,text:hy(i,l.notes),style:"help"}]);break}case G.HISTORY:{const i=String(s.agent_id??l.selectedAgentId);qt(l,i),l.historyMode==="replay"?(l.historyMode="listing",it(l,i,[...l.blocks[i]??[],...xy(s.history,i,We,l.ui.showTools)])):it(l,i,[...l.blocks[i]??[],{id:We(),kind:"system",agentId:i,text:vy(s.history,s.turn_accounting),style:"help"}]);break}case G.CLARIFICATION_BATCH:{const i=String(s.request_id??"");if(!i)break;const u=l.clarifications.find(p=>p.requestId===i),d={requestId:i,agentId:Ke(s),toolName:String(s.tool_name??""),context:s.context??null,questions:(Array.isArray(s.questions)?s.questions:[]).map($m),index:u?.index??0,answers:u?.answers??[],batchOnly:s.batch_only===!0,inputMode:u?.inputMode??s.batch_only===!0};l.clarifications=u?l.clarifications.map(p=>p.requestId===i?d:p):[...l.clarifications,d];break}case G.CLARIFICATION_QUESTION:{const i=String(s.request_id??"");if(!i)break;const u=Number(s.question_index??0),d=$m({question_text:s.question_text,question_type:s.question_type,options:s.options??[]}),p=l.clarifications.find(h=>h.requestId===i);if(p){const h=[...p.questions];h[u]={...h[u]??{},...d},l.clarifications=l.clarifications.map(y=>y.requestId===i?{...y,questions:h,index:u}:y)}else{const h=[];h[u]=d,l.clarifications=[...l.clarifications,{requestId:i,agentId:Ke(s),toolName:String(s.tool_name??""),questions:h,index:u,answers:[],batchOnly:!1,inputMode:!1}]}break}case G.CLARIFICATION_INPUT_MODE:{const i=String(s.request_id??""),u=Number(s.question_index??0);l.clarifications.find(p=>p.requestId===i)?l.clarifications=l.clarifications.map(p=>p.requestId===i?{...p,index:u,inputMode:!0}:p):l.clarifications=[...l.clarifications,{requestId:i,agentId:Ke(s),toolName:String(s.tool_name??""),questions:[],index:u,answers:[],batchOnly:!1,inputMode:!0}];break}case G.CLARIFICATION_RESOLVED:{const i=String(s.request_id??"");l.clarifications=l.clarifications.filter(u=>u.requestId!==i);break}case G.REFERENCE_SELECTION_REQUESTED:{const i=String(s.request_id??"");if(!i)break;l.referenceSelections=[...l.referenceSelections.filter(u=>u.requestId!==i),{requestId:i,agentId:Ke(s),prompt:String(s.prompt??s.message??"Select a reference"),options:s.options??[]}];break}case G.REFERENCE_SELECTION_RESOLVED:l.referenceSelections=l.referenceSelections.filter(i=>i.requestId!==String(s.request_id??""));break;case G.POST_AUTH_SETUP:{const i=(s.available_models??[]).filter(u=>u&&u.name).map(u=>({name:String(u.name),description:u.description?String(u.description):void 0}));l.postAuth={requestId:String(s.request_id??""),providerName:String(s.provider_name??""),providerDisplayName:String(s.provider_display_name??s.provider_name??""),models:i,hasActiveSession:s.has_active_session===!0,currentProvider:s.current_provider||void 0,currentModel:s.current_model||void 0,workspacePath:s.workspace_path||void 0};break}case G.PLAN_UPDATED:{const i=Ke(s);l.plan={...l.plan,[i]:{name:String(s.plan_name??"Plan"),steps:s.steps??[]}};break}case G.PLAN_STEP_UPDATED:{const i=Ke(s),u=l.plan[i]??{name:"Plan",steps:[]},d=s.step_id,p={step_id:d,sequence:s.sequence,content:s.content,status:s.status,result:s.result,error:s.error,blocked_by:s.blocked_by,depends_on:s.depends_on},h=u.steps.findIndex(g=>g.step_id===d),y=[...u.steps];h>=0?y[h]={...y[h],...p}:y.push(p),l.plan={...l.plan,[i]:{...u,steps:y}};break}case G.PLAN_CLEARED:{const i=Ke(s),{[i]:u,...d}=l.plan;l.plan=d;break}case G.CONTEXT_UPDATED:{const i=Ke(s),u=l.context[i];l.context={...l.context,[i]:{...u??{usage:{}},usage:s.usage??u?.usage??{},contextLimit:s.context_limit??u?.contextLimit??null,percentUsed:s.percent_used??u?.percentUsed??null,tokensRemaining:s.tokens_remaining??u?.tokensRemaining??null,turns:s.turns??u?.turns??null}};break}case G.TURN_COMPLETED:{const i=Ke(s),u=l.context[i]??{usage:{}};l.context={...l.context,[i]:{...u,lastTurn:{turnNumber:s.turn_number,durationSeconds:s.duration_seconds,toolCalls:dy(s.function_calls),finishReason:s.finish_reason,usage:s.usage}}},l.busySince=bi(l.busySince,i);break}case G.SYSTEM_MESSAGE:{const i=Ke(s);qt(l,i),it(l,i,[...l.blocks[i]??[],{id:We(),kind:"system",agentId:i,text:String(s.message??""),style:String(s.style??"info")}]);break}case G.HELP_TEXT:{const i=l.selectedAgentId,d=(s.lines??[]).map(p=>Array.isArray(p)?String(p[0]??""):String(p)).join(`
|
|
15
|
+
`)||String(s.text??"");it(l,i,[...l.blocks[i]??[],{id:We(),kind:"system",agentId:i,text:d,style:"help"}]);break}case G.ERROR:{if(String(s.error??"").toLowerCase().includes("workspace mode not enabled")){l.workspace={...l.workspace,mode:"disabled"};break}const i=Ke(s);qt(l,i),it(l,i,[...l.blocks[i]??[],{id:We(),kind:"system",agentId:i,text:`${s.error_type?`[${String(s.error_type)}] `:""}${String(s.error??"error")}`,style:"error"}]);break}case G.RETRY:{const i=Ke(s);qt(l,i),it(l,i,[...l.blocks[i]??[],{id:We(),kind:"system",agentId:i,text:`Retrying (${String(s.attempt??"?")}/${String(s.max_attempts??"?")}): ${String(s.reason??s.error??"")}`,style:"warning"}]);break}case G.INIT_PROGRESS:l.initProgress={step:s.step,status:s.status,message:s.message,stepNumber:s.step_number,totalSteps:s.total_steps},(s.status==="complete"||s.status==="done"||s.status==="ready")&&(l.initProgress=null);break;case G.SESSION_INFO:{const i=s.session_id;i&&(l.sessionId=i),Array.isArray(s.sessions)&&(l.sessions=Km(s.sessions)),l.session={...l.session,name:s.session_name??l.session.name??null,provider:s.model_provider??l.session.provider??null,model:s.model_name??l.session.model??null,profile:s.profile_name??l.session.profile??null,models:s.models??l.session.models};break}case G.SESSION_PROFILES:l.profiles=(s.profiles??[]).map(i=>({...i,name:String(i.name??"")}));break;case G.SESSION_TERMINATED:case G.DISCONNECTED:{const i=l.selectedAgentId;it(l,i,[...l.blocks[i]??[],{id:We(),kind:"system",agentId:i,text:s.type===G.SESSION_TERMINATED?`Session ended${s.reason?`: ${String(s.reason)}`:""}`:"Disconnected",style:"warning"}]);break}case G.COMMAND_LIST:l.commands=Op((s.commands??[]).map(i=>({name:String(i.name??""),description:i.description})));break;case G.WORKSPACE_LIST:l.workspace={...l.workspace,mode:"enabled",root:s.root,list:(s.workspaces??[]).map(i=>({...i,name:String(i.name??""),configured:i.configured===!0}))};break;case G.WORKSPACE_CREATED:{const i=s.workspace??{},u=String(i.name??s.name??"");if(!u)break;const d={...i,name:u,path:i.path??s.path??null,configured:i.configured===!0};l.workspace={...l.workspace,list:[...l.workspace.list.filter(p=>p.name!==u),d]};break}case G.WORKSPACE_DELETED:{const i=String(s.name??"");if(s.ok===!1){l.workspace={...l.workspace,notice:{text:String(s.error||`Could not delete workspace ${i}`),error:!0}};break}l.workspace={...l.workspace,list:l.workspace.list.filter(u=>u.name!==i),selected:l.workspace.selected===i?void 0:l.workspace.selected,config:l.workspace.config?.workspace===i?void 0:l.workspace.config,notice:{text:`Workspace ${i} deleted`}};break}case G.CONFIG_UPDATED:{const i=String(s.workspace??l.workspace.selected??"");if(s.success===!1){l.workspace={...l.workspace,notice:{text:String(s.error||`Could not save the configuration of ${i}`),error:!0}};break}const u=s.provider||null,d=s.model||null,p=l.workspace.config,h={workspace:i,configured:u!==null,provider:u,model:d,availableProviders:p?.availableProviders??[],missingFields:[...u?[]:["provider"],...d?[]:["model"]]};l.workspace={...l.workspace,config:h,selected:i||l.workspace.selected,list:l.workspace.list.map(y=>y.name===i?{...y,configured:h.configured,provider:u,model:d}:y)};break}case G.CONFIG_STATUS:{const i={workspace:String(s.workspace??l.workspace.selected??""),configured:s.configured===!0,provider:s.provider??null,model:s.model??null,availableProviders:s.available_providers??[],missingFields:s.missing_fields??[]};l.workspace={...l.workspace,config:i,selected:i.workspace||l.workspace.selected};break}case G.WORKSPACE_FILES_CHANGED:{const i={...l.workspaceFiles};for(const u of s.changes??[]){const d=u.path??u.file;if(!d)continue;const p=u.status??u.change??u.type??"modified";p==="deleted"?delete i[d]:i[d]=p}l.workspaceFiles=i;break}case G.WORKSPACE_FILES_SNAPSHOT:{const i={};for(const u of s.files??[])if(typeof u=="string")i[u]="modified";else if(u&&typeof u=="object"){const d=u,p=d.path??d.file,h=d.status??d.change??d.type??"modified";p&&h!=="deleted"&&(i[p]=h)}l.workspaceFiles=i;break}case G.WORKSPACE_IGNORE_RESULT:{const i=String(s.path??"");if(s.ok===!1){l.workspaceNotice={text:String(s.error||`Could not update .gitignore for ${i}`),error:!0};break}const u=s.ignored===!0;l.workspaceIgnored={...l.workspaceIgnored,[i]:u},l.workspaceNotice={text:`${i} ${u?"added to":"removed from"} .gitignore`};break}}return l}const M=I_()((l,r)=>({connection:{phase:"disconnected"},url:"",screen:"connect",credentialsUrl:null,notesUrl:null,notes:{},noteStatus:{},backend:null,workspace:{mode:"unknown",list:[]},profiles:[],sessions:[],sessionListSilent:0,historyMode:"listing",commands:Op([]),uploads:[],...Im(),ui:{showPlan:!1,showBudget:!1,showWorkspace:!1,showTools:!1,showSessions:!1,theme:"light",popupCallId:null,railWidth:Sy()},dispatch:s=>l(i=>{const u={...i};for(const d of s)Ay(u,d);return u}),setConnection:s=>l(i=>({connection:{...i.connection,...s}})),setUrl:s=>l({url:s}),setScreen:s=>l({screen:s}),setCredentialsUrl:s=>l({credentialsUrl:s}),setNotesUrl:s=>l({notesUrl:s}),setNotes:s=>l({notes:Object.fromEntries(s.map(i=>[i.sessionId,i]))}),setNote:(s,i)=>l(u=>{const d={...u.notes};return i?d[s]=i:delete d[s],{notes:d}}),setNoteStatus:(s,i)=>l(u=>({noteStatus:{...u.noteStatus,[s]:i}})),setBackend:s=>l({backend:s}),setWorkspaceMode:s=>l(i=>({workspace:{...i.workspace,mode:s}})),selectWorkspace:s=>l(i=>({workspace:{...i.workspace,selected:s}})),selectAgent:s=>l({selectedAgentId:s}),markSending:s=>l(i=>({busySince:Lp(i.busySince,s)})),clearSending:s=>l(i=>i.agents[s]?.status===_c?{}:{busySince:bi(i.busySince,s)}),addUserBlock:(s,i)=>l(u=>({blocks:{...u.blocks,[s]:[...u.blocks[s]??[],{id:We(),kind:"user",agentId:s,text:i}]}})),addSystemBlock:(s,i,u="info")=>l(d=>({blocks:{...d.blocks,[s]:[...d.blocks[s]??[],{id:We(),kind:"system",agentId:s,text:i,style:u}]}})),clearOutput:s=>l(i=>({blocks:{...i.blocks,[s]:[]}})),toggleTool:(s,i)=>l(u=>({blocks:{...u.blocks,[s]:(u.blocks[s]??[]).map(d=>d.id===i&&d.kind==="tool"?{...d,expanded:!d.expanded}:d)}})),setAllToolsExpanded:(s,i)=>l(u=>({blocks:{...u.blocks,[s]:(u.blocks[s]??[]).map(d=>d.kind==="tool"?{...d,expanded:i}:d)}})),resolvePermission:s=>l(i=>({permissions:i.permissions.filter(u=>u.requestId!==s)})),openExitChoice:(s,i)=>l({exitChoice:{running:s,options:i,focus:0}}),closeExitChoice:()=>l({exitChoice:null}),focusExitChoice:s=>l(i=>i.exitChoice?{exitChoice:{...i.exitChoice,focus:s}}:{}),focusPermission:(s,i)=>l(u=>({permissions:u.permissions.map(d=>d.requestId===s?{...d,focus:i}:d)})),answerClarification:(s,i)=>{const u=r().clarifications.find(h=>h.requestId===s);if(!u)return;const d=[...u.answers];d[u.index]=i;const p={...u,answers:d,index:u.index+1,inputMode:u.batchOnly};return l(h=>({clarifications:h.clarifications.map(y=>y.requestId===s?p:y)})),p},dismissClarification:s=>l(i=>({clarifications:i.clarifications.filter(u=>u.requestId!==s)})),dismissReferenceSelection:s=>l(i=>({referenceSelections:i.referenceSelections.filter(u=>u.requestId!==s)})),dismissPostAuth:()=>l({postAuth:null}),toggleUi:s=>l(i=>({ui:{...i.ui,[s]:!i.ui[s]}})),setToolsExpanded:s=>l(i=>({ui:{...i.ui,showTools:s},blocks:Object.fromEntries(Object.entries(i.blocks).map(([u,d])=>[u,d.map(p=>p.kind==="tool"?{...p,expanded:s}:p)]))})),setSessionListSilent:s=>l(i=>({sessionListSilent:Math.max(0,i.sessionListSilent+s)})),setHistoryMode:s=>l({historyMode:s}),toggleWorkspaceHidden:s=>l(i=>({workspaceHidden:i.workspaceHidden.includes(s)?i.workspaceHidden.filter(u=>u!==s):[...i.workspaceHidden,s]})),toggleWorkspaceShowHidden:()=>l(s=>({workspaceShowHidden:!s.workspaceShowHidden})),setWorkspaceNotice:s=>l(()=>({workspaceNotice:s})),setWorkspaceListNotice:s=>l(i=>({workspace:{...i.workspace,notice:s}})),setTheme:s=>l(i=>({ui:{...i.ui,theme:s}})),setPopup:s=>l(i=>({ui:{...i.ui,popupCallId:s}})),setRailWidth:s=>l(i=>{const u=Dp(s);return Ey(u),{ui:{...i.ui,railWidth:u}}}),addUploads:s=>l(i=>({uploads:[...i.uploads,...s]})),updateUpload:(s,i)=>l(u=>({uploads:u.uploads.map(d=>d.id===s?{...d,...i}:d)})),removeUpload:s=>l(i=>({uploads:i.uploads.filter(u=>u.id!==s)})),takeUploads:()=>{const s=r().uploads.filter(i=>i.status==="staged").map(i=>i.path);return l(i=>({uploads:i.uploads.filter(u=>u.status==="queued"||u.status==="staging")})),s},resetSessionState:()=>l(()=>({...Im()}))})),Oy=l=>r=>r.blocks[l]??Cy,Cy=[];class Jl extends Error{constructor(r){super("Sign in required"),this.loginUrl=r,this.name="SignInRequiredError"}loginUrl}function Ry(l){const r=l.fetchImpl??fetch;return async()=>{const s=await r(l.ticketUrl,{method:"POST",credentials:"same-origin",cache:"no-store",headers:{Accept:"application/json"}});if(s.status===401)throw new Jl(l.loginUrl);if(s.status===503)throw new Error("The sign-in backend cannot issue a ticket right now (daemon at capacity or unreachable); retrying.");if(!s.ok)throw new Error(`Ticket request failed: HTTP ${s.status}`);const i=await s.json();if(typeof i.ticket!="string"||!i.ticket)throw new Error("Ticket response carried no ticket");return i.ticket}}const uc=2e3,Wm="jaato.web-coder.notes.v1";function Fm(l,r){const[s,i=""]=l.split(/\?(.*)/s,2);return`${s}/${encodeURIComponent(r)}${i?`?${i}`:""}`}async function Fo(l,r){if(l.status===401)return new Jl("./auth/login");let s="";try{s=String((await l.json()).error??"")}catch{}return new Error(`${r}: HTTP ${l.status}${s?` (${s})`:""}`)}function Si(l){return l.replace(/\r\n?/g,`
|
|
16
|
+
`).replace(/[^\S\n\t]+$/gm,"").trim().slice(0,uc)}function My(l,r=fetch){const s={credentials:"same-origin",cache:"no-store"};return{scope:"backend",async list(){const i=await r(l,{...s,headers:{Accept:"application/json"}});if(!i.ok)throw await Fo(i,"Loading your notes failed");const u=await i.json();return Array.isArray(u.notes)?u.notes.filter(d=>d&&typeof d.sessionId=="string"):[]},async put(i,u){const d=await r(Fm(l,i),{...s,method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({text:Si(u)})});if(!d.ok)throw await Fo(d,"Saving the note failed");return(await d.json()).note??null},async remove(i){const u=await r(Fm(l,i),{...s,method:"DELETE"});if(!u.ok&&u.status!==404)throw await Fo(u,"Deleting the note failed")}}}function Dy(l=typeof localStorage>"u"?null:localStorage){const r=()=>{try{const i=l?.getItem(Wm),u=i?JSON.parse(i):null;return u&&typeof u=="object"?u:{}}catch{return{}}},s=i=>{if(!l)throw new Error("This browser is not storing notes (private window, or site data blocked)");try{l.setItem(Wm,JSON.stringify(i))}catch{throw new Error("This browser refused to store the note (private window, or storage full)")}};return{scope:"local",async list(){return Object.values(r()).filter(i=>i&&typeof i.sessionId=="string")},async put(i,u){const d=Si(u),p=r();if(!d)return delete p[i],s(p),null;const h={sessionId:i,text:d,updatedAt:new Date().toISOString()};return p[i]=h,s(p),h},async remove(i){const u=r();i in u&&(delete u[i],s(u))}}}function qp(l){return l?l.split(`
|
|
17
|
+
`).map(r=>r.trim()).find(r=>r.length>0)??"":""}const zy=800;function Bp(){const l=M(r=>r.notesUrl);return q.useMemo(()=>l?My(l):Dy(),[l])}function Uy(){const l=Bp(),r=M(s=>s.setNotes);q.useEffect(()=>{let s=!1;return l.list().then(i=>{s||r(i)},()=>{}),()=>{s=!0}},[l,r])}const Pm={state:"idle"};function bc(l){const r=Bp(),s=M(Y=>l?Y.notes[l]?.text:void 0),i=M(Y=>l?Y.noteStatus[l]:void 0)??Pm,u=M(Y=>Y.setNote),d=M(Y=>Y.setNoteStatus),[p,h]=q.useState(null),y=q.useRef(null),g=q.useRef(null),b=()=>{y.current!==null&&(window.clearTimeout(y.current),y.current=null)};q.useEffect(()=>b,[]),q.useEffect(()=>{h(null),g.current=null,b()},[l]);const x=q.useCallback(async Y=>{if(l){g.current=null,d(l,{state:"saving"});try{const V=await r.put(l,Y);u(l,V),h(null),d(l,{state:"saved",at:Date.now()})}catch(V){throw V instanceof Jl?d(l,{state:"signed-out",loginUrl:V.loginUrl}):d(l,{state:"error",message:V instanceof Error?V.message:String(V)}),V}}},[r,l,u,d]),w=q.useCallback(Y=>{const V=Y.slice(0,uc);h(V),g.current=V,b(),y.current=window.setTimeout(()=>{y.current=null,x(V).catch(()=>{})},zy)},[x]),j=q.useCallback(async()=>{b();const Y=g.current;if(Y===null||Si(Y)===Si(s??"")){g.current=null;return}await x(Y)},[x,s]),B=q.useCallback(async()=>{l&&(b(),g.current=null,await r.remove(l),u(l,null),h(null),d(l,Pm))},[r,l,u,d]),z=p??s??"";return{text:z,status:i,scope:r.scope,remaining:uc-z.length,change:w,flush:j,remove:B}}const Ly="dark",Hy="Default dark theme",qy="1.0",By={primary:"#5fd7ff",secondary:"#87d787",accent:"#d7af87",success:"#5fd75f",warning:"#ffff5f",error:"#ff5f5f",muted:"#808080",background:"#1a1a1a",surface:"#333333",text:"#ffffff",text_muted:"#aaaaaa"},Gy={agent_tab_selected:{fg:"primary",bold:!0,underline:!0},agent_tab_dim:{fg:"muted"},agent_tab_separator:{fg:"#404040"},agent_tab_hint:{fg:"#606060",italic:!0},agent_tab_scroll:{fg:"primary",bold:!0},agent_processing:{fg:"#5f87ff"},agent_awaiting:{fg:"primary"},agent_finished:{fg:"muted"},agent_error:{fg:"error"},agent_permission:{fg:"warning"},agent_popup_border:{fg:"primary"},agent_popup_icon:{fg:"primary"},agent_popup_name:{fg:"text",bold:!0},session_bar_bg:{bg:"background"},session_bar_label:{fg:"muted"},session_bar_id:{fg:"primary"},session_bar_separator:{fg:"#404040"},session_bar_description:{fg:"secondary"},session_bar_workspace:{fg:"accent"},status_bar_bg:{bg:"surface"},status_bar_label:{fg:"muted",bg:"surface"},status_bar_value:{fg:"text",bg:"surface",bold:!0},status_bar_separator:{fg:"#555555",bg:"surface"},status_bar_warning:{fg:"warning"},output_panel_bg:{bg:"background"},plan_pending:{fg:"muted",bg:"surface"},plan_in_progress:{fg:"#5f87ff",bg:"surface"},plan_completed:{fg:"success",bg:"surface"},plan_failed:{fg:"error",bg:"surface"},plan_skipped:{fg:"warning",bg:"surface"},plan_active:{fg:"primary",bg:"surface"},plan_cancelled:{fg:"warning",bg:"surface",dim:!0},plan_popup_border:{fg:"primary"},plan_popup_background:{bg:"background"},plan_result:{fg:"success",dim:!0},plan_error_text:{fg:"error",dim:!0},plan_popup_empty:{fg:"muted",dim:!0,italic:!0},plan_popup_empty_border:{fg:"muted",dim:!0},plan_popup_scroll_indicator:{fg:"muted",dim:!0,italic:!0},plan_popup_hint:{fg:"muted",dim:!0},plan_popup_step_number:{fg:"muted",dim:!0},plan_popup_step_description:{fg:"text"},plan_popup_step_active:{fg:"text",bold:!0},plan_popup_result_prefix:{fg:"muted",dim:!0},plan_popup_error_prefix:{fg:"muted",dim:!0},plan_popup_separator:{fg:"muted",dim:!0},plan_popup_progress:{fg:"text",bold:!0},plan_popup_progress_detail:{fg:"muted",dim:!0},plan_blocked:{fg:"#af87ff",bg:"surface"},plan_dependency:{fg:"#af87ff",dim:!0},plan_received_output:{fg:"#5fafaf",dim:!0},user_header:{fg:"success",bold:!0},user_header_separator:{fg:"success",dim:!0},model_header:{fg:"primary",bold:!0},model_header_separator:{fg:"primary",dim:!0},thinking_header:{fg:"primary",dim:!0},thinking_header_separator:{dim:!0},thinking_border:{fg:"primary",dim:!0},thinking_content:{dim:!0,italic:!0},thinking_footer:{fg:"primary",dim:!0},thinking_footer_separator:{dim:!0},tool_output:{fg:"#87D7D7",italic:!0},tool_source_label:{fg:"#808080",dim:!0},tool_name:{fg:"primary"},tool_border:{dim:!0},tool_success:{fg:"success"},tool_error:{fg:"error",dim:!0},tool_pending:{fg:"warning",bold:!0},tool_duration:{dim:!0},tool_selected:{fg:"text"},tool_unselected:{dim:!0},tool_indicator:{fg:"primary",dim:!0},workspace_popup_border:{fg:"primary"},workspace_popup_background:{bg:"background"},tool_output_popup_border:{fg:"#5fafaf"},tool_output_popup_background:{fg:"text",bg:"background"},tool_output_popup_header:{fg:"text",bold:!0},tool_output_popup_scroll:{fg:"muted",dim:!0},tool_output_popup_hint:{fg:"muted",dim:!0,italic:!0},file_output_header:{fg:"primary",bold:!0},notebook_input_label:{fg:"success",bold:!0},notebook_output_label:{fg:"primary",bold:!0},notebook_error_label:{fg:"error",bold:!0},inline_code:{fg:"#87d7d7",bg:"#2d2d3d"},markdown_link:{fg:"#5f87ff",underline:!0},line:{fg:"text"},permission_prompt:{fg:"warning",bold:!0},permission_text:{fg:"primary"},permission_denied:{fg:"error",dim:!0},clarification_label:{fg:"primary"},clarification_icon:{fg:"primary"},clarification_required:{fg:"warning"},clarification_answer:{fg:"success",dim:!0},clarification_question:{dim:!0},clarification_resolved:{fg:"success",bold:!0},security_error_header:{fg:"error",bold:!0},security_error_text:{fg:"error"},security_warning_header:{fg:"warning",bold:!0},security_warning_text:{fg:"warning"},security_info_header:{fg:"primary",bold:!0},security_info_text:{fg:"primary"},system_info:{dim:!0},system_highlight:{fg:"primary"},system_error:{fg:"error"},system_error_bold:{fg:"error",bold:!0},system_warning:{fg:"warning"},system_success:{fg:"success"},system_emphasis:{bold:!0},system_version:{fg:"primary",bold:!0},system_progress:{dim:!0,italic:!0},system_init_error:{fg:"error",dim:!0},pager_nav:{fg:"primary",bold:!0},spinner:{fg:"primary"},separator:{fg:"muted",dim:!0},pane_separator:{fg:"#808080"},pane_separator_focused:{fg:"#5f87ff",bold:!0},hint:{fg:"muted",italic:!0},scroll_indicator:{fg:"muted",dim:!0,italic:!0},scroll_arrow:{fg:"primary",dim:!0},muted:{dim:!0},emphasis:{bold:!0},warning_icon:{fg:"warning"},panel_border:{fg:"primary"},tree_connector:{dim:!0},truncation:{fg:"primary",dim:!0,italic:!0},debug_line_number:{fg:"muted",dim:!0},completion_bg:{bg:"surface",fg:"text"},completion_selected:{bg:"success",fg:"text"},completion_meta:{bg:"surface",fg:"muted"},pending_prompt:{fg:"primary"},pending_prompt_overflow:{fg:"muted",italic:!0},input_text:{fg:"text"},input_prompt:{fg:"primary",bold:!0},search_prompt:{fg:"warning",bold:!0},search_match:{bg:"warning",fg:"background",bold:!0},search_match_current:{bg:"primary",fg:"background",bold:!0},budget_panel_border:{fg:"primary"},budget_popup_background:{bg:"background"},budget_header:{bold:!0},budget_gc_locked:{fg:"error"},budget_gc_preservable:{fg:"warning"},budget_gc_partial:{fg:"#5f87ff"},budget_gc_ephemeral:{dim:!0}},Yy={name:Ly,description:Hy,version:qy,colors:By,semantic:Gy},Qy="light",Vy="Light theme for bright terminals",Xy="1.0",$y={primary:"#0077cc",secondary:"#006600",accent:"#996600",success:"#006600",warning:"#996600",error:"#cc0000",muted:"#666666",background:"#f5f5f5",surface:"#ffffff",text:"#000000",text_muted:"#666666"},Ky={agent_tab_selected:{fg:"primary",bold:!0,underline:!0},agent_tab_dim:{fg:"muted"},agent_tab_separator:{fg:"#aaaaaa"},agent_tab_hint:{fg:"#888888",italic:!0},agent_tab_scroll:{fg:"primary",bold:!0},agent_processing:{fg:"#0055cc"},agent_awaiting:{fg:"primary"},agent_finished:{fg:"muted"},agent_error:{fg:"error"},agent_permission:{fg:"warning"},agent_popup_border:{fg:"primary"},agent_popup_icon:{fg:"primary"},agent_popup_name:{fg:"text",bold:!0},session_bar_bg:{bg:"background"},session_bar_label:{fg:"muted"},session_bar_id:{fg:"primary"},session_bar_separator:{fg:"#aaaaaa"},session_bar_description:{fg:"secondary"},session_bar_workspace:{fg:"accent"},status_bar_bg:{bg:"surface"},status_bar_label:{fg:"muted",bg:"surface"},status_bar_value:{fg:"text",bg:"surface",bold:!0},status_bar_separator:{fg:"#bbbbbb",bg:"surface"},status_bar_warning:{fg:"warning"},output_panel_bg:{bg:"background"},plan_pending:{fg:"muted",bg:"surface"},plan_in_progress:{fg:"#0055cc",bg:"surface"},plan_completed:{fg:"success",bg:"surface"},plan_failed:{fg:"error",bg:"surface"},plan_skipped:{fg:"warning",bg:"surface"},plan_active:{fg:"primary",bg:"surface"},plan_cancelled:{fg:"warning",bg:"surface",dim:!0},plan_popup_border:{fg:"primary"},plan_popup_background:{bg:"background"},plan_result:{fg:"success",dim:!0},plan_error_text:{fg:"error",dim:!0},plan_popup_empty:{fg:"#666666",italic:!0},plan_popup_empty_border:{fg:"#888888"},plan_popup_scroll_indicator:{fg:"#666666",italic:!0},plan_popup_hint:{fg:"#666666"},plan_popup_step_number:{fg:"#555555"},plan_popup_step_description:{fg:"text"},plan_popup_step_active:{fg:"text",bold:!0},plan_popup_result_prefix:{fg:"#555555"},plan_popup_error_prefix:{fg:"#555555"},plan_popup_separator:{fg:"#888888"},plan_popup_progress:{fg:"text",bold:!0},plan_popup_progress_detail:{fg:"#555555"},plan_blocked:{fg:"#7744aa",bg:"surface"},plan_dependency:{fg:"#7744aa"},plan_received_output:{fg:"#227788"},user_header:{fg:"success",bold:!0},user_header_separator:{fg:"success",dim:!0},model_header:{fg:"primary",bold:!0},model_header_separator:{fg:"primary",dim:!0},thinking_header:{fg:"#555555"},thinking_header_separator:{fg:"#888888"},thinking_border:{fg:"#888888"},thinking_content:{fg:"#555555",italic:!0},thinking_footer:{fg:"#555555"},thinking_footer_separator:{fg:"#888888"},tool_output:{fg:"#006688",italic:!0},tool_source_label:{fg:"#555555",dim:!0},tool_name:{fg:"primary"},tool_border:{dim:!0},tool_success:{fg:"success"},tool_error:{fg:"error",dim:!0},tool_pending:{fg:"warning",bold:!0},tool_duration:{dim:!0},tool_selected:{fg:"text"},tool_unselected:{dim:!0},tool_indicator:{fg:"#0055cc",dim:!0},workspace_popup_border:{fg:"primary"},workspace_popup_background:{bg:"background"},tool_output_popup_border:{fg:"#006688"},tool_output_popup_background:{fg:"text",bg:"background"},tool_output_popup_header:{fg:"text",bold:!0},tool_output_popup_scroll:{fg:"#666666"},tool_output_popup_hint:{fg:"#666666",italic:!0},file_output_header:{fg:"primary",bold:!0},notebook_input_label:{fg:"success",bold:!0},notebook_output_label:{fg:"primary",bold:!0},notebook_error_label:{fg:"error",bold:!0},inline_code:{fg:"#0055aa",bg:"#e8e8f0"},markdown_link:{fg:"#0055aa",underline:!0},line:{fg:"text"},permission_prompt:{fg:"warning",bold:!0},permission_text:{fg:"primary"},permission_denied:{fg:"error",dim:!0},clarification_label:{fg:"primary"},clarification_icon:{fg:"primary"},clarification_required:{fg:"warning"},clarification_answer:{fg:"success",dim:!0},clarification_question:{dim:!0},clarification_resolved:{fg:"success",bold:!0},security_error_header:{fg:"error",bold:!0},security_error_text:{fg:"error"},security_warning_header:{fg:"warning",bold:!0},security_warning_text:{fg:"warning"},security_info_header:{fg:"primary",bold:!0},security_info_text:{fg:"primary"},system_info:{dim:!0},system_highlight:{fg:"primary"},system_error:{fg:"error"},system_error_bold:{fg:"error",bold:!0},system_warning:{fg:"warning"},system_success:{fg:"success"},system_emphasis:{bold:!0},system_version:{fg:"primary",bold:!0},system_progress:{dim:!0,italic:!0},system_init_error:{fg:"error",dim:!0},pager_nav:{fg:"primary",bold:!0},spinner:{fg:"primary"},separator:{fg:"muted",dim:!0},pane_separator:{fg:"#aaaaaa"},pane_separator_focused:{fg:"#0055cc",bold:!0},hint:{fg:"muted",italic:!0},scroll_indicator:{fg:"muted",dim:!0,italic:!0},scroll_arrow:{fg:"primary",dim:!0},muted:{dim:!0},emphasis:{bold:!0},warning_icon:{fg:"warning"},panel_border:{fg:"primary"},tree_connector:{dim:!0},truncation:{fg:"primary",dim:!0,italic:!0},debug_line_number:{fg:"muted",dim:!0},completion_bg:{bg:"surface",fg:"text"},completion_selected:{bg:"success",fg:"text"},completion_meta:{bg:"surface",fg:"muted"},pending_prompt:{fg:"primary"},pending_prompt_overflow:{fg:"muted",italic:!0},input_text:{fg:"text"},input_prompt:{fg:"primary",bold:!0},search_prompt:{fg:"warning",bold:!0},search_match:{bg:"warning",fg:"background",bold:!0},search_match_current:{bg:"primary",fg:"background",bold:!0},budget_panel_border:{fg:"primary"},budget_popup_background:{bg:"background"},budget_header:{bold:!0},budget_gc_locked:{fg:"error"},budget_gc_preservable:{fg:"warning"},budget_gc_partial:{fg:"#0055cc"},budget_gc_ephemeral:{fg:"#888888"}},Iy={name:Qy,description:Vy,version:Xy,colors:$y,semantic:Ky},Zy="high-contrast",Jy="High contrast theme for accessibility",Wy="1.0",Fy={primary:"#00ffff",secondary:"#00ff00",accent:"#ffaa00",success:"#00ff00",warning:"#ffff00",error:"#ff0000",muted:"#aaaaaa",background:"#000000",surface:"#1a1a1a",text:"#ffffff",text_muted:"#cccccc"},Py={agent_tab_selected:{fg:"primary",bold:!0,underline:!0},agent_tab_dim:{fg:"muted"},agent_tab_separator:{fg:"#404040"},agent_tab_hint:{fg:"#606060",italic:!0},agent_tab_scroll:{fg:"primary",bold:!0},agent_processing:{fg:"#5f87ff"},agent_awaiting:{fg:"primary"},agent_finished:{fg:"muted"},agent_error:{fg:"error"},agent_permission:{fg:"warning"},agent_popup_border:{fg:"primary"},agent_popup_icon:{fg:"primary"},agent_popup_name:{fg:"text",bold:!0},session_bar_bg:{bg:"background"},session_bar_label:{fg:"muted"},session_bar_id:{fg:"primary"},session_bar_separator:{fg:"#404040"},session_bar_description:{fg:"secondary"},session_bar_workspace:{fg:"accent"},status_bar_bg:{bg:"surface"},status_bar_label:{fg:"muted",bg:"surface"},status_bar_value:{fg:"text",bg:"surface",bold:!0},status_bar_separator:{fg:"#555555",bg:"surface"},status_bar_warning:{fg:"warning"},output_panel_bg:{bg:"background"},plan_pending:{fg:"muted",bg:"surface"},plan_in_progress:{fg:"#5f87ff",bg:"surface"},plan_completed:{fg:"success",bg:"surface"},plan_failed:{fg:"error",bg:"surface"},plan_skipped:{fg:"warning",bg:"surface"},plan_active:{fg:"primary",bg:"surface"},plan_cancelled:{fg:"warning",bg:"surface",dim:!0},plan_popup_border:{fg:"primary"},plan_popup_background:{bg:"background"},plan_result:{fg:"success",dim:!0},plan_error_text:{fg:"error",dim:!0},plan_popup_empty:{fg:"#aaaaaa",italic:!0},plan_popup_empty_border:{fg:"#aaaaaa"},plan_popup_scroll_indicator:{fg:"#cccccc",italic:!0},plan_popup_hint:{fg:"#cccccc"},plan_popup_step_number:{fg:"#aaaaaa"},plan_popup_step_description:{fg:"text"},plan_popup_step_active:{fg:"text",bold:!0},plan_popup_result_prefix:{fg:"#aaaaaa"},plan_popup_error_prefix:{fg:"#aaaaaa"},plan_popup_separator:{fg:"#aaaaaa"},plan_popup_progress:{fg:"text",bold:!0},plan_popup_progress_detail:{fg:"#cccccc"},plan_blocked:{fg:"#cc88ff",bg:"surface"},plan_dependency:{fg:"#cc88ff"},plan_received_output:{fg:"#66dddd"},user_header:{fg:"success",bold:!0},user_header_separator:{fg:"success",dim:!0},model_header:{fg:"primary",bold:!0},model_header_separator:{fg:"primary",dim:!0},thinking_header:{fg:"#cccccc"},thinking_header_separator:{fg:"#aaaaaa"},thinking_border:{fg:"#cccccc"},thinking_content:{fg:"#cccccc",italic:!0},thinking_footer:{fg:"#cccccc"},thinking_footer_separator:{fg:"#aaaaaa"},tool_output:{fg:"#87D7D7",italic:!0},tool_source_label:{fg:"#808080",dim:!0},tool_name:{fg:"primary"},tool_border:{dim:!0},tool_success:{fg:"success"},tool_error:{fg:"error",dim:!0},tool_pending:{fg:"warning",bold:!0},tool_duration:{dim:!0},tool_selected:{fg:"text"},tool_unselected:{dim:!0},tool_indicator:{fg:"primary",dim:!0},workspace_popup_border:{fg:"primary"},workspace_popup_background:{bg:"background"},tool_output_popup_border:{fg:"#66dddd"},tool_output_popup_background:{fg:"text",bg:"background"},tool_output_popup_header:{fg:"text",bold:!0},tool_output_popup_scroll:{fg:"#cccccc"},tool_output_popup_hint:{fg:"#cccccc",italic:!0},file_output_header:{fg:"primary",bold:!0},notebook_input_label:{fg:"success",bold:!0},notebook_output_label:{fg:"primary",bold:!0},notebook_error_label:{fg:"error",bold:!0},inline_code:{fg:"#00ffff",bg:"#1a1a2e"},markdown_link:{fg:"#66ccff",underline:!0},line:{fg:"text"},permission_prompt:{fg:"warning",bold:!0},permission_text:{fg:"primary"},permission_denied:{fg:"error",dim:!0},clarification_label:{fg:"primary"},clarification_icon:{fg:"primary"},clarification_required:{fg:"warning"},clarification_answer:{fg:"success",dim:!0},clarification_question:{dim:!0},clarification_resolved:{fg:"success",bold:!0},security_error_header:{fg:"error",bold:!0},security_error_text:{fg:"error"},security_warning_header:{fg:"warning",bold:!0},security_warning_text:{fg:"warning"},security_info_header:{fg:"primary",bold:!0},security_info_text:{fg:"primary"},system_info:{dim:!0},system_highlight:{fg:"primary"},system_error:{fg:"error"},system_error_bold:{fg:"error",bold:!0},system_warning:{fg:"warning"},system_success:{fg:"success"},system_emphasis:{bold:!0},system_version:{fg:"primary",bold:!0},system_progress:{dim:!0,italic:!0},system_init_error:{fg:"error",dim:!0},pager_nav:{fg:"primary",bold:!0},spinner:{fg:"primary"},separator:{fg:"#aaaaaa"},pane_separator:{fg:"#aaaaaa"},pane_separator_focused:{fg:"#00ffff",bold:!0},hint:{fg:"#cccccc",italic:!0},scroll_indicator:{fg:"muted",dim:!0,italic:!0},scroll_arrow:{fg:"primary",dim:!0},muted:{dim:!0},emphasis:{bold:!0},warning_icon:{fg:"warning"},panel_border:{fg:"primary"},tree_connector:{dim:!0},truncation:{fg:"primary",dim:!0,italic:!0},debug_line_number:{fg:"muted",dim:!0},completion_bg:{bg:"surface",fg:"text"},completion_selected:{bg:"success",fg:"text"},completion_meta:{bg:"surface",fg:"muted"},pending_prompt:{fg:"primary"},pending_prompt_overflow:{fg:"muted",italic:!0},input_text:{fg:"text"},input_prompt:{fg:"primary",bold:!0},search_prompt:{fg:"warning",bold:!0},search_match:{bg:"warning",fg:"background",bold:!0},search_match_current:{bg:"primary",fg:"background",bold:!0},budget_panel_border:{fg:"primary"},budget_popup_background:{bg:"background"},budget_header:{bold:!0},budget_gc_locked:{fg:"error"},budget_gc_preservable:{fg:"warning"},budget_gc_partial:{fg:"#5f87ff"},budget_gc_ephemeral:{fg:"#aaaaaa"}},eb={name:Zy,description:Jy,version:Wy,colors:Fy,semantic:Py},tb="dracula",nb="Dracula-inspired theme with pink accents and purple-tinted dark background",ab="1.0",lb={primary:"#ff79c6",secondary:"#50fa7b",accent:"#ffb86c",success:"#50fa7b",warning:"#f1fa8c",error:"#ff5555",muted:"#6272a4",background:"#282a36",surface:"#44475a",text:"#f8f8f2",text_muted:"#6272a4"},sb={agent_tab_selected:{fg:"primary",bold:!0,underline:!0},agent_tab_dim:{fg:"muted"},agent_tab_separator:{fg:"#44475a"},agent_tab_hint:{fg:"#6272a4",italic:!0},agent_tab_scroll:{fg:"primary",bold:!0},agent_processing:{fg:"#bd93f9"},agent_awaiting:{fg:"primary"},agent_finished:{fg:"muted"},agent_error:{fg:"error"},agent_permission:{fg:"warning"},agent_popup_border:{fg:"primary"},agent_popup_icon:{fg:"primary"},agent_popup_name:{fg:"text",bold:!0},session_bar_bg:{bg:"background"},session_bar_label:{fg:"muted"},session_bar_id:{fg:"primary"},session_bar_separator:{fg:"#44475a"},session_bar_description:{fg:"secondary"},session_bar_workspace:{fg:"accent"},status_bar_bg:{bg:"surface"},status_bar_label:{fg:"muted",bg:"surface"},status_bar_value:{fg:"text",bg:"surface",bold:!0},status_bar_separator:{fg:"#6272a4",bg:"surface"},status_bar_warning:{fg:"warning"},output_panel_bg:{bg:"background"},plan_pending:{fg:"muted",bg:"surface"},plan_in_progress:{fg:"#bd93f9",bg:"surface"},plan_completed:{fg:"success",bg:"surface"},plan_failed:{fg:"error",bg:"surface"},plan_skipped:{fg:"warning",bg:"surface"},plan_active:{fg:"primary",bg:"surface"},plan_cancelled:{fg:"warning",bg:"surface",dim:!0},plan_popup_border:{fg:"primary"},plan_popup_background:{bg:"background"},plan_result:{fg:"success",dim:!0},plan_error_text:{fg:"error",dim:!0},plan_popup_empty:{fg:"muted",dim:!0,italic:!0},plan_popup_empty_border:{fg:"muted",dim:!0},plan_popup_scroll_indicator:{fg:"muted",dim:!0,italic:!0},plan_popup_hint:{fg:"muted",dim:!0},plan_popup_step_number:{fg:"muted",dim:!0},plan_popup_step_description:{fg:"text"},plan_popup_step_active:{fg:"text",bold:!0},plan_popup_result_prefix:{fg:"muted",dim:!0},plan_popup_error_prefix:{fg:"muted",dim:!0},plan_popup_separator:{fg:"muted",dim:!0},plan_popup_progress:{fg:"text",bold:!0},plan_popup_progress_detail:{fg:"muted",dim:!0},plan_blocked:{fg:"#bd93f9",bg:"surface"},plan_dependency:{fg:"#bd93f9",dim:!0},plan_received_output:{fg:"#8be9fd",dim:!0},user_header:{fg:"secondary",bold:!0},user_header_separator:{fg:"secondary",dim:!0},model_header:{fg:"primary",bold:!0},model_header_separator:{fg:"primary",dim:!0},thinking_header:{fg:"#bd93f9",dim:!0},thinking_header_separator:{fg:"#bd93f9",dim:!0},thinking_border:{fg:"#bd93f9",dim:!0},thinking_content:{fg:"#6272a4",dim:!0,italic:!0},thinking_footer:{fg:"#bd93f9",dim:!0},thinking_footer_separator:{fg:"#bd93f9",dim:!0},tool_output:{fg:"#8be9fd",italic:!0},tool_source_label:{fg:"#6272a4",dim:!0},tool_name:{fg:"primary"},tool_border:{dim:!0},tool_success:{fg:"success"},tool_error:{fg:"error",dim:!0},tool_pending:{fg:"warning",bold:!0},tool_duration:{dim:!0},tool_selected:{fg:"text"},tool_unselected:{dim:!0},tool_indicator:{fg:"primary",dim:!0},workspace_popup_border:{fg:"primary"},workspace_popup_background:{bg:"background"},tool_output_popup_border:{fg:"#8be9fd"},tool_output_popup_background:{fg:"text",bg:"background"},tool_output_popup_header:{fg:"text",bold:!0},tool_output_popup_scroll:{fg:"muted",dim:!0},tool_output_popup_hint:{fg:"muted",dim:!0,italic:!0},file_output_header:{fg:"primary",bold:!0},notebook_input_label:{fg:"secondary",bold:!0},notebook_output_label:{fg:"#8be9fd",bold:!0},notebook_error_label:{fg:"error",bold:!0},inline_code:{fg:"#8be9fd",bg:"#383a59"},markdown_link:{fg:"#bd93f9",underline:!0},line:{fg:"text"},permission_prompt:{fg:"warning",bold:!0},permission_text:{fg:"primary"},permission_denied:{fg:"error",dim:!0},clarification_label:{fg:"primary"},clarification_icon:{fg:"primary"},clarification_required:{fg:"warning"},clarification_answer:{fg:"success",dim:!0},clarification_question:{dim:!0},clarification_resolved:{fg:"success",bold:!0},security_error_header:{fg:"error",bold:!0},security_error_text:{fg:"error"},security_warning_header:{fg:"warning",bold:!0},security_warning_text:{fg:"warning"},security_info_header:{fg:"primary",bold:!0},security_info_text:{fg:"primary"},system_info:{dim:!0},system_highlight:{fg:"primary"},system_error:{fg:"error"},system_error_bold:{fg:"error",bold:!0},system_warning:{fg:"warning"},system_success:{fg:"success"},system_emphasis:{bold:!0},system_version:{fg:"primary",bold:!0},system_progress:{dim:!0,italic:!0},system_init_error:{fg:"error",dim:!0},pager_nav:{fg:"primary",bold:!0},spinner:{fg:"primary"},separator:{fg:"muted",dim:!0},pane_separator:{fg:"#6272a4"},pane_separator_focused:{fg:"#8be9fd",bold:!0},hint:{fg:"muted",italic:!0},scroll_indicator:{fg:"muted",dim:!0,italic:!0},scroll_arrow:{fg:"primary",dim:!0},muted:{dim:!0},emphasis:{bold:!0},warning_icon:{fg:"warning"},panel_border:{fg:"primary"},tree_connector:{dim:!0},truncation:{fg:"primary",dim:!0,italic:!0},debug_line_number:{fg:"muted",dim:!0},completion_bg:{bg:"surface",fg:"text"},completion_selected:{bg:"#bd93f9",fg:"text"},completion_meta:{bg:"surface",fg:"muted"},pending_prompt:{fg:"primary"},pending_prompt_overflow:{fg:"muted",italic:!0},input_text:{fg:"text"},input_prompt:{fg:"primary",bold:!0},search_prompt:{fg:"warning",bold:!0},search_match:{bg:"warning",fg:"background",bold:!0},search_match_current:{bg:"primary",fg:"background",bold:!0},budget_panel_border:{fg:"primary"},budget_popup_background:{bg:"background"},budget_header:{bold:!0},budget_gc_locked:{fg:"error"},budget_gc_preservable:{fg:"warning"},budget_gc_partial:{fg:"#bd93f9"},budget_gc_ephemeral:{fg:"#6272a4"}},ib={name:tb,description:nb,version:ab,colors:lb,semantic:sb},rb="latte",ob="Light cream theme with orange accents",cb="1.0",ub={primary:"#e07040",secondary:"#40a040",accent:"#d08030",success:"#40a040",warning:"#c09020",error:"#c04040",muted:"#908070",background:"#f8f4f0",surface:"#ffffff",text:"#3d3530",text_muted:"#807060"},fb={agent_tab_selected:{fg:"primary",bold:!0,underline:!0},agent_tab_dim:{fg:"muted"},agent_tab_separator:{fg:"#d0c8c0"},agent_tab_hint:{fg:"#a09080",italic:!0},agent_tab_scroll:{fg:"primary",bold:!0},agent_processing:{fg:"#4080c0"},agent_awaiting:{fg:"primary"},agent_finished:{fg:"muted"},agent_error:{fg:"error"},agent_permission:{fg:"warning"},agent_popup_border:{fg:"primary"},agent_popup_icon:{fg:"primary"},agent_popup_name:{fg:"text",bold:!0},session_bar_bg:{bg:"background"},session_bar_label:{fg:"muted"},session_bar_id:{fg:"primary"},session_bar_separator:{fg:"#d0c8c0"},session_bar_description:{fg:"secondary"},session_bar_workspace:{fg:"accent"},status_bar_bg:{bg:"surface"},status_bar_label:{fg:"muted",bg:"surface"},status_bar_value:{fg:"text",bg:"surface",bold:!0},status_bar_separator:{fg:"#c0b8b0",bg:"surface"},status_bar_warning:{fg:"warning"},output_panel_bg:{bg:"background"},plan_pending:{fg:"muted",bg:"surface"},plan_in_progress:{fg:"#4080c0",bg:"surface"},plan_completed:{fg:"success",bg:"surface"},plan_failed:{fg:"error",bg:"surface"},plan_skipped:{fg:"warning",bg:"surface"},plan_active:{fg:"primary",bg:"surface"},plan_cancelled:{fg:"warning",bg:"surface",dim:!0},plan_popup_border:{fg:"primary"},plan_popup_background:{bg:"background"},plan_result:{fg:"success",dim:!0},plan_error_text:{fg:"error",dim:!0},plan_popup_empty:{fg:"muted",dim:!0,italic:!0},plan_popup_empty_border:{fg:"muted",dim:!0},plan_popup_scroll_indicator:{fg:"muted",dim:!0,italic:!0},plan_popup_hint:{fg:"muted",dim:!0},plan_popup_step_number:{fg:"muted",dim:!0},plan_popup_step_description:{fg:"text"},plan_popup_step_active:{fg:"text",bold:!0},plan_popup_result_prefix:{fg:"muted",dim:!0},plan_popup_error_prefix:{fg:"muted",dim:!0},plan_popup_separator:{fg:"muted",dim:!0},plan_popup_progress:{fg:"text",bold:!0},plan_popup_progress_detail:{fg:"muted",dim:!0},plan_blocked:{fg:"#8839ef",bg:"surface"},plan_dependency:{fg:"#8839ef"},plan_received_output:{fg:"#179299"},user_header:{fg:"secondary",bold:!0},user_header_separator:{fg:"secondary",dim:!0},model_header:{fg:"primary",bold:!0},model_header_separator:{fg:"primary",dim:!0},thinking_header:{fg:"#a08060",dim:!0},thinking_header_separator:{fg:"#a08060",dim:!0},thinking_border:{fg:"#a08060",dim:!0},thinking_content:{fg:"#807060",dim:!0,italic:!0},thinking_footer:{fg:"#a08060",dim:!0},thinking_footer_separator:{fg:"#a08060",dim:!0},tool_output:{fg:"#408080",italic:!0},tool_source_label:{fg:"#908070",dim:!0},tool_name:{fg:"primary"},tool_border:{dim:!0},tool_success:{fg:"success"},tool_error:{fg:"error",dim:!0},tool_pending:{fg:"warning",bold:!0},tool_duration:{dim:!0},tool_selected:{fg:"text"},tool_unselected:{dim:!0},tool_indicator:{fg:"primary",dim:!0},workspace_popup_border:{fg:"primary"},workspace_popup_background:{bg:"background"},tool_output_popup_border:{fg:"#179299"},tool_output_popup_background:{fg:"text",bg:"background"},tool_output_popup_header:{fg:"text",bold:!0},tool_output_popup_scroll:{fg:"muted",dim:!0},tool_output_popup_hint:{fg:"muted",dim:!0,italic:!0},file_output_header:{fg:"primary",bold:!0},notebook_input_label:{fg:"secondary",bold:!0},notebook_output_label:{fg:"primary",bold:!0},notebook_error_label:{fg:"error",bold:!0},inline_code:{fg:"#1e66f5",bg:"#f0ece8"},markdown_link:{fg:"#1e66f5",underline:!0},line:{fg:"text"},permission_prompt:{fg:"warning",bold:!0},permission_text:{fg:"primary"},permission_denied:{fg:"error",dim:!0},clarification_label:{fg:"primary"},clarification_icon:{fg:"primary"},clarification_required:{fg:"warning"},clarification_answer:{fg:"success",dim:!0},clarification_question:{dim:!0},clarification_resolved:{fg:"success",bold:!0},security_error_header:{fg:"error",bold:!0},security_error_text:{fg:"error"},security_warning_header:{fg:"warning",bold:!0},security_warning_text:{fg:"warning"},security_info_header:{fg:"primary",bold:!0},security_info_text:{fg:"primary"},system_info:{dim:!0},system_highlight:{fg:"primary"},system_error:{fg:"error"},system_error_bold:{fg:"error",bold:!0},system_warning:{fg:"warning"},system_success:{fg:"success"},system_emphasis:{bold:!0},system_version:{fg:"primary",bold:!0},system_progress:{dim:!0,italic:!0},system_init_error:{fg:"error",dim:!0},pager_nav:{fg:"primary",bold:!0},spinner:{fg:"primary"},separator:{fg:"muted",dim:!0},pane_separator:{fg:"#aaaaaa"},pane_separator_focused:{fg:"#0055cc",bold:!0},hint:{fg:"muted",italic:!0},scroll_indicator:{fg:"muted",dim:!0,italic:!0},scroll_arrow:{fg:"primary",dim:!0},muted:{dim:!0},emphasis:{bold:!0},warning_icon:{fg:"warning"},panel_border:{fg:"primary"},tree_connector:{dim:!0},truncation:{fg:"primary",dim:!0,italic:!0},debug_line_number:{fg:"muted",dim:!0},completion_bg:{bg:"surface",fg:"text"},completion_selected:{bg:"primary",fg:"#ffffff"},completion_meta:{bg:"surface",fg:"muted"},pending_prompt:{fg:"primary"},pending_prompt_overflow:{fg:"muted",italic:!0},input_text:{fg:"text"},input_prompt:{fg:"primary",bold:!0},search_prompt:{fg:"warning",bold:!0},search_match:{bg:"warning",fg:"background",bold:!0},search_match_current:{bg:"primary",fg:"background",bold:!0},budget_panel_border:{fg:"primary"},budget_popup_background:{bg:"background"},budget_header:{bold:!0},budget_gc_locked:{fg:"error"},budget_gc_preservable:{fg:"warning"},budget_gc_partial:{fg:"#4080c0"},budget_gc_ephemeral:{fg:"#a09080"}},db={name:rb,description:ob,version:cb,colors:ub,semantic:fb},mb="mocha",pb="Warm brownish theme with teal accents",hb="1.0",gb={primary:"#5fd7d7",secondary:"#87d787",accent:"#d7875f",success:"#87d787",warning:"#d7d75f",error:"#d75f5f",muted:"#8a7a6a",background:"#3d2b2b",surface:"#4a3838",text:"#e8e0d8",text_muted:"#a89888"},_b={agent_tab_selected:{fg:"primary",bold:!0,underline:!0},agent_tab_dim:{fg:"muted"},agent_tab_separator:{fg:"#5a4a4a"},agent_tab_hint:{fg:"#7a6a5a",italic:!0},agent_tab_scroll:{fg:"primary",bold:!0},agent_processing:{fg:"#87afff"},agent_awaiting:{fg:"primary"},agent_finished:{fg:"muted"},agent_error:{fg:"error"},agent_permission:{fg:"warning"},agent_popup_border:{fg:"primary"},agent_popup_icon:{fg:"primary"},agent_popup_name:{fg:"text",bold:!0},session_bar_bg:{bg:"background"},session_bar_label:{fg:"muted"},session_bar_id:{fg:"primary"},session_bar_separator:{fg:"#5a4a4a"},session_bar_description:{fg:"secondary"},session_bar_workspace:{fg:"accent"},status_bar_bg:{bg:"surface"},status_bar_label:{fg:"muted",bg:"surface"},status_bar_value:{fg:"text",bg:"surface",bold:!0},status_bar_separator:{fg:"#6a5a5a",bg:"surface"},status_bar_warning:{fg:"warning"},output_panel_bg:{bg:"background"},plan_pending:{fg:"muted",bg:"surface"},plan_in_progress:{fg:"#87afff",bg:"surface"},plan_completed:{fg:"success",bg:"surface"},plan_failed:{fg:"error",bg:"surface"},plan_skipped:{fg:"warning",bg:"surface"},plan_active:{fg:"primary",bg:"surface"},plan_cancelled:{fg:"warning",bg:"surface",dim:!0},plan_popup_border:{fg:"primary"},plan_popup_background:{bg:"background"},plan_result:{fg:"success",dim:!0},plan_error_text:{fg:"error",dim:!0},plan_popup_empty:{fg:"muted",dim:!0,italic:!0},plan_popup_empty_border:{fg:"muted",dim:!0},plan_popup_scroll_indicator:{fg:"muted",dim:!0,italic:!0},plan_popup_hint:{fg:"muted",dim:!0},plan_popup_step_number:{fg:"muted",dim:!0},plan_popup_step_description:{fg:"text"},plan_popup_step_active:{fg:"text",bold:!0},plan_popup_result_prefix:{fg:"muted",dim:!0},plan_popup_error_prefix:{fg:"muted",dim:!0},plan_popup_separator:{fg:"muted",dim:!0},plan_popup_progress:{fg:"text",bold:!0},plan_popup_progress_detail:{fg:"muted",dim:!0},plan_blocked:{fg:"#cba6f7",bg:"surface"},plan_dependency:{fg:"#cba6f7",dim:!0},plan_received_output:{fg:"#94e2d5",dim:!0},user_header:{fg:"secondary",bold:!0},user_header_separator:{fg:"secondary",dim:!0},model_header:{fg:"primary",bold:!0},model_header_separator:{fg:"primary",dim:!0},thinking_header:{fg:"accent",dim:!0},thinking_header_separator:{fg:"accent",dim:!0},thinking_border:{fg:"accent",dim:!0},thinking_content:{fg:"#a89888",dim:!0,italic:!0},thinking_footer:{fg:"accent",dim:!0},thinking_footer_separator:{fg:"accent",dim:!0},tool_output:{fg:"#87d7d7",italic:!0},tool_source_label:{fg:"#8a7a6a",dim:!0},tool_name:{fg:"primary"},tool_border:{dim:!0},tool_success:{fg:"success"},tool_error:{fg:"error",dim:!0},tool_pending:{fg:"warning",bold:!0},tool_duration:{dim:!0},tool_selected:{fg:"text"},tool_unselected:{dim:!0},tool_indicator:{fg:"primary",dim:!0},workspace_popup_border:{fg:"primary"},workspace_popup_background:{bg:"background"},tool_output_popup_border:{fg:"#94e2d5"},tool_output_popup_background:{fg:"text",bg:"background"},tool_output_popup_header:{fg:"text",bold:!0},tool_output_popup_scroll:{fg:"muted",dim:!0},tool_output_popup_hint:{fg:"muted",dim:!0,italic:!0},file_output_header:{fg:"primary",bold:!0},notebook_input_label:{fg:"secondary",bold:!0},notebook_output_label:{fg:"primary",bold:!0},notebook_error_label:{fg:"error",bold:!0},inline_code:{fg:"#94e2d5",bg:"#453838"},markdown_link:{fg:"#89b4fa",underline:!0},line:{fg:"text"},permission_prompt:{fg:"warning",bold:!0},permission_text:{fg:"primary"},permission_denied:{fg:"error",dim:!0},clarification_label:{fg:"primary"},clarification_icon:{fg:"primary"},clarification_required:{fg:"warning"},clarification_answer:{fg:"success",dim:!0},clarification_question:{dim:!0},clarification_resolved:{fg:"success",bold:!0},security_error_header:{fg:"error",bold:!0},security_error_text:{fg:"error"},security_warning_header:{fg:"warning",bold:!0},security_warning_text:{fg:"warning"},security_info_header:{fg:"primary",bold:!0},security_info_text:{fg:"primary"},system_info:{dim:!0},system_highlight:{fg:"primary"},system_error:{fg:"error"},system_error_bold:{fg:"error",bold:!0},system_warning:{fg:"warning"},system_success:{fg:"success"},system_emphasis:{bold:!0},system_version:{fg:"primary",bold:!0},system_progress:{dim:!0,italic:!0},system_init_error:{fg:"error",dim:!0},pager_nav:{fg:"primary",bold:!0},spinner:{fg:"primary"},separator:{fg:"muted",dim:!0},pane_separator:{fg:"#808080"},pane_separator_focused:{fg:"#5f87ff",bold:!0},hint:{fg:"muted",italic:!0},scroll_indicator:{fg:"muted",dim:!0,italic:!0},scroll_arrow:{fg:"primary",dim:!0},muted:{dim:!0},emphasis:{bold:!0},warning_icon:{fg:"warning"},panel_border:{fg:"primary"},tree_connector:{dim:!0},truncation:{fg:"primary",dim:!0,italic:!0},debug_line_number:{fg:"muted",dim:!0},completion_bg:{bg:"surface",fg:"text"},completion_selected:{bg:"primary",fg:"#3d2b2b"},completion_meta:{bg:"surface",fg:"muted"},pending_prompt:{fg:"primary"},pending_prompt_overflow:{fg:"muted",italic:!0},input_text:{fg:"text"},input_prompt:{fg:"primary",bold:!0},search_prompt:{fg:"warning",bold:!0},search_match:{bg:"warning",fg:"background",bold:!0},search_match_current:{bg:"primary",fg:"background",bold:!0},budget_panel_border:{fg:"primary"},budget_popup_background:{bg:"background"},budget_header:{bold:!0},budget_gc_locked:{fg:"error"},budget_gc_preservable:{fg:"warning"},budget_gc_partial:{fg:"#87afff"},budget_gc_ephemeral:{fg:"#8a7a6a"}},yb={name:mb,description:pb,version:hb,colors:gb,semantic:_b},bb=[Yy,Iy,eb,ib,db,yb],la=Object.fromEntries(bb.map(l=>[l.name,l])),ep=Object.keys(la),tp={light:"#5980a6",dark:"#94bce3"},xb={light:{background:"#f2f2f3",surface:"#ffffff",text:"#1d1f20",text_muted:"#5d5d60",muted:"#7a7a7d"},dark:{surface:"#202223"}};function vb(l){const r=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(l);if(!r)return 0;const[s,i,u]=[r[1],r[2],r[3]].map(d=>parseInt(d,16)/255);return .2126*s+.7152*i+.0722*u}function Gp(l){const r=la[l];return r?vb(r.colors.background)<.5:!0}function Sb(l){const r=la[l]??la.light;return{...{...r.colors,...xb[r.name]??{}},steel:Gp(r.name)?tp.dark:tp.light}}function Yp(l){const r=la[l]??la.light,s=document.documentElement,i=Sb(r.name),u={"--c-primary":i.primary,"--c-secondary":i.secondary,"--c-accent":i.accent??i.secondary,"--c-success":i.success,"--c-warning":i.warning,"--c-error":i.error,"--c-muted":i.muted,"--c-bg":i.background,"--c-surface":i.surface,"--c-text":i.text,"--c-text-muted":i.text_muted,"--c-steel":i.steel};for(const[d,p]of Object.entries(u))s.style.setProperty(d,p);s.dataset.theme=r.name,s.style.colorScheme=Gp(r.name)?"dark":"light"}const Qp="jaato.theme",Eb="light";function wb(){try{const l=localStorage.getItem(Qp);if(l&&la[l])return l}catch{}return Eb}function Nb(l){try{localStorage.setItem(Qp,l)}catch{}}let sa=null,xi=[],fc=!1;function np(){if(fc=!1,!xi.length)return;const l=xi;xi=[],M.getState().dispatch(l)}function Tb(l){xi.push(l),!fc&&(fc=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(np):setTimeout(np,16))}let vi=!1;function kb(l){const r={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected",RECONNECTING:"reconnecting",CLOSED:"closed"},s=String(l.state),i=r[s]??r[s.toUpperCase()]??"disconnected";M.getState().setConnection({phase:i,detail:l.reason,attempt:l.attempt,serverVersion:l.serverVersion??void 0}),i==="reconnecting"?vi=!0:i==="connected"&&vi&&(vi=!1,Vp())}function jb(){return{client_type:"web",content_width:typeof window<"u"?Math.max(40,Math.floor(window.innerWidth*.7/8)):120,content_height:null,supports_markdown:!0,supports_tables:!0,supports_code_blocks:!0,supports_images:!0,supports_rich_text:!0,supports_unicode:!0,supports_mermaid:!1,supports_expandable_content:!0,renderable_media:["image/*","audio/*"]}}async function Ab(l){await xc();const r=M.getState();r.setUrl(l.url),r.setConnection({phase:"connecting",detail:void 0});const s=new kp({url:l.url,token:l.token,clientConfig:{presentation:jb()}});vi=!1,s.onStatus(kb),s.subscribeAll(i=>Tb(i)),sa=s;try{await s.connect()}catch(i){throw sa=null,M.getState().setConnection({phase:"disconnected",detail:i instanceof Error?i.message:String(i)}),i}return s}async function xc(){const l=sa;sa=null,M.getState().resetSessionState(),l&&await l.close().catch(()=>{})}function Re(){if(!sa)throw new Error("Not connected");return sa}function Wl(){return sa!==null}async function Vp(){const l=M.getState(),r=l.workspace.selected,s=l.sessionId;if(!(!r&&!s))try{r&&await dc(r),s&&await Re().attachSession(s)}catch(i){const u=M.getState();u.addSystemBlock(u.selectedAgentId,`Reconnected, but this connection could not be restored: ${i instanceof Error?i.message:String(i)}`,"error")}}async function Xp(){await Re().sendRawEvent({type:G.WORKSPACE_LIST_REQUEST})}async function dc(l){await Re().sendRawEvent({type:G.WORKSPACE_SELECT_REQUEST,name:l})}async function Ob(l){await Re().sendRawEvent({type:G.WORKSPACE_CREATE_REQUEST,name:l})}async function Cb(l){await Re().sendRawEvent({type:G.WORKSPACE_DELETE_REQUEST,name:l})}async function Rb(l){await Re().sendRawEvent({type:G.CONFIG_UPDATE_REQUEST,...l})}function Mb(l=4e3){const r=Re();return new Promise(s=>{let i=!1;const u=y=>{i||(i=!0,d(),p(),clearTimeout(h),M.getState().setWorkspaceMode(y),s(y))},d=r.subscribe(G.WORKSPACE_LIST,()=>u("enabled")),p=r.subscribe(G.ERROR,y=>{String(y.error??"").toLowerCase().includes("workspace mode")&&u("disabled")}),h=setTimeout(()=>u("unknown"),l);Xp().catch(()=>u("unknown"))})}const mc="jaato.exited";function $p(l=Kp()){try{l?.setItem(mc,"1")}catch{}}function Db(l=Kp()){try{return!l||l.getItem(mc)!=="1"?!1:(l.removeItem(mc),!0)}catch{return!1}}function Kp(){try{return typeof sessionStorage>"u"?null:sessionStorage}catch{return null}}function zb(l){if(!l||typeof l!="object")return{};const r=l,s={};return typeof r.daemon=="string"&&r.daemon&&(s.daemon=r.daemon),typeof r.token=="string"&&r.token&&(s.token=r.token),typeof r.ticketUrl=="string"&&r.ticketUrl&&(s.ticketUrl=r.ticketUrl),typeof r.loginUrl=="string"&&r.loginUrl&&(s.loginUrl=r.loginUrl),typeof r.sessionUrl=="string"&&r.sessionUrl&&(s.sessionUrl=r.sessionUrl),typeof r.logoutUrl=="string"&&r.logoutUrl&&(s.logoutUrl=r.logoutUrl),typeof r.credentialsUrl=="string"&&r.credentialsUrl&&(s.credentialsUrl=r.credentialsUrl),typeof r.notesUrl=="string"&&r.notesUrl&&(s.notesUrl=r.notesUrl),typeof r.autoConnect=="boolean"&&(s.autoConnect=r.autoConnect),s}async function Ub(l=fetch){try{const r=await l("./config.json",{cache:"no-store"});return r.ok?(r.headers.get("content-type")??"").includes("application/json")?zb(await r.json()):{}:{}}catch{return{}}}function ap(l,r){const[s]=l.split(/[?#]/,1),i=(s??"").lastIndexOf("/");return i<0?r:`${(s??"").slice(0,i+1)}${r}`}async function Lb(l,r=fetch){try{const s=await r(l,{credentials:"same-origin",cache:"no-store",headers:{Accept:"application/json"}});if(!s.ok||!(s.headers.get("content-type")??"").includes("application/json"))return null;const i=await s.json();return typeof i.user=="string"&&i.user?{user:i.user}:null}catch{return null}}var lp={ui:"0.1.12",sdk:"0.7.3",protocolMin:"1.0",commit:"5281e74",builtAt:"2026-09-19T16:04:48.077Z"};const Hb={ui:"unknown",sdk:"unknown",protocolMin:"unknown",commit:"unknown",builtAt:""},$a=typeof lp<"u"?lp:Hb;function Ip(l=$a){return`jaato-web-coder-ui ${l.ui} · @jaato/sdk ${l.sdk} · protocol ≥ ${l.protocolMin} · ${l.commit}`}const qb={hairline:"",steel:"plate-steel",warning:"plate-warning",error:"plate-error"};function Nt({as:l,edge:r="hairline",ground:s=!1,corners:i="all",className:u="",children:d,...p}){const h=l??"div";return f.jsxs(h,{className:`plate ${qb[r]} ${s?"plate-ground":""} ${u}`,...p,children:[i!=="none"&&f.jsx("i",{className:"corner tl","aria-hidden":"true"}),i==="all"&&f.jsx("i",{className:"corner tr","aria-hidden":"true"}),i==="all"&&f.jsx("i",{className:"corner bl","aria-hidden":"true"}),i!=="none"&&f.jsx("i",{className:"corner br","aria-hidden":"true"}),d]})}function Bb(){try{const r=localStorage.getItem("jaato.url");if(r)return r}catch{}return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}/ws`}function Gb(l){if(!l.ticketUrl)return null;const r=l.loginUrl??"./auth/login";return{provider:Ry({ticketUrl:l.ticketUrl,loginUrl:r}),loginUrl:r,sessionUrl:l.sessionUrl??ap(l.ticketUrl,"session"),logoutUrl:l.logoutUrl??ap(l.ticketUrl,"logout")}}const sp=[["Sessions","Start from a profile, or pick up a session where you left it."],["Tools you approve","Shell, files and the web — each call asks before it runs."],["Plans and subagents","Watch the plan unfold; every subagent gets its own tab."]];function Yb(){const[l,r]=q.useState(Bb),[s,i]=q.useState(()=>{try{return sessionStorage.getItem("jaato.token")??""}catch{return""}}),[u,d]=q.useState(!1),[p,h]=q.useState(null),[y,g]=q.useState(null),[b,x]=q.useState(null),[w,j]=q.useState(null),[B,z]=q.useState(null),Y=M(Z=>Z.connection),V=M(Z=>Z.setScreen),ee=q.useRef(!1),te=async(Z,U)=>{Z?.preventDefault();const se=U?.url??l,fe=U?.token??b?.provider??s;d(!0),h(null),z(null);try{try{localStorage.setItem("jaato.url",se),typeof fe=="string"&&sessionStorage.setItem("jaato.token",fe)}catch{}await Ab({url:se,token:fe||void 0});const ie=await Mb();V(ie==="enabled"?"workspaces":"session")}catch(ie){ie instanceof Jl?z(ie.loginUrl):h(ie instanceof Error?ie.message:String(ie))}finally{d(!1)}};q.useEffect(()=>{let Z=!1;return Ub().then(U=>{if(Z||ee.current||(ee.current=!0,g(U),M.getState().setCredentialsUrl(U.credentialsUrl??null),M.getState().setNotesUrl(U.notesUrl??null),!U.daemon&&!U.token&&!U.ticketUrl))return;const se=U.daemon??l;r(se);let fe=U.token??s;const ie=Gb(U);ie?(x(ie),fe=ie.provider,M.getState().setBackend({logoutUrl:ie.logoutUrl,user:null}),Lb(ie.sessionUrl).then(X=>{Z||!X||(j(X.user),M.getState().setBackend({logoutUrl:ie.logoutUrl,user:X.user}))})):U.token&&i(U.token),U.autoConnect&&se&&!Db()&&te(void 0,{url:se,token:fe})}),()=>{Z=!0}},[]);const K=!!y&&!!(y.daemon||y.token||y.ticketUrl),W=!1,de=y===null?"Preparing":B?"Sign in to continue":b?w?"Welcome back":"Your environment":K?"Your environment":"Where is your daemon?";return f.jsx("div",{className:"h-full overflow-auto flex items-center justify-center p-6 sm:p-12",children:f.jsxs(Nt,{className:"w-full max-w-[860px] grid grid-cols-1 md:grid-cols-[1fr_1px_1fr]",children:[f.jsxs("div",{className:"p-7 flex flex-col gap-4",children:[f.jsxs("div",{className:"flex items-baseline gap-2.5",children:[f.jsx("span",{className:"display text-[40px] leading-none",children:"jaato"}),f.jsx("span",{className:"kicker tracking-[0.18em]",children:"web coding environment"})]}),f.jsx("h1",{className:"display text-[26px] leading-[1.15] m-0",children:"Your coding agent, in the browser."}),f.jsx("p",{className:"m-0 text-sm text-text-muted max-w-[34ch]",children:"Everything the terminal client does — sessions, tools, plans, permissions — from a tab, on any machine."}),f.jsx("ol",{className:"mt-auto pt-4 border-t hairline list-none m-0 p-0",children:sp.map(([Z,U],se)=>f.jsxs("li",{className:`flex gap-3 py-2 ${se<sp.length-1?"border-b hairline":""}`,children:[f.jsx("span",{className:"font-mono text-[11px] text-steel w-[22px] shrink-0 pt-0.5",children:String(se+1).padStart(2,"0")}),f.jsxs("div",{children:[f.jsx("div",{className:"chrome text-[13px] font-medium",children:Z}),f.jsx("div",{className:"text-[13px] text-text-muted",children:U})]})]},Z))})]}),f.jsx("div",{className:"hidden md:block bg-divider","aria-hidden":"true"}),f.jsxs("form",{onSubmit:te,className:"p-7 flex flex-col gap-4 border-t md:border-t-0 hairline",children:[f.jsx("div",{className:"kicker tracking-[0.16em]",children:de}),y===null?f.jsx("div",{className:"text-sm text-text-muted",children:"Preparing your environment…"}):B?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"text-sm text-text-muted max-w-[36ch]",children:"Sign in to open your coding environment. Sign in with your usual account; nothing to copy or paste."}),f.jsx(Nt,{edge:"steel",className:"p-0",style:{"--corner-color":"color-mix(in srgb, var(--c-bg) 60%, transparent)"},children:f.jsx("a",{href:B,className:"btn btn-primary w-full text-[16px] py-2.5 no-underline border-0",children:"Sign in"})}),f.jsx("div",{className:"text-xs text-text-muted",children:"Your sign-in backend issues a per-user ticket for each connection."})]}):w||u||K&&!p?f.jsxs("div",{className:"space-y-1",children:[w&&f.jsxs("div",{className:"text-base",children:["Welcome back, ",f.jsx("span",{className:"font-semibold",children:w}),"."]}),u?f.jsx("div",{className:"text-sm text-text-muted",children:Y.detail??"Opening your coding environment…"}):K&&!p?f.jsx("div",{className:"text-sm text-text-muted",children:"Ready when you are."}):null]}):null,p&&f.jsx("div",{className:"border border-error/40 p-3 text-sm text-error whitespace-pre-wrap",role:"alert",children:p}),y!==null&&!B&&f.jsx("button",{type:"submit",disabled:u||!l,className:"btn btn-primary text-[16px] py-2.5",children:u?"Connecting…":p?"Try again":K?"Open my environment":"Connect"}),y!==null&&!B&&f.jsxs("details",{open:!K,className:"group border-t hairline pt-3 text-sm",children:[f.jsxs("summary",{className:"cursor-pointer select-none list-none flex items-baseline gap-2.5 [&::-webkit-details-marker]:hidden",children:[f.jsx("span",{className:"text-text-muted transition-transform group-open:rotate-90",children:"▸"}),f.jsxs("span",{children:[f.jsx("span",{className:"kicker kicker-muted tracking-[0.12em] text-[12px] block",children:"Daemon settings"}),f.jsx("span",{className:"text-[13px] text-text-muted",children:K?"WebSocket URL and bearer token — only if the served target is wrong.":"Point the page at a jaato daemon started with --web-socket."})]})]}),f.jsxs("div",{className:"mt-3 space-y-3",children:[f.jsxs("label",{className:"block",children:[f.jsx("span",{className:"field-label",children:"WebSocket URL"}),f.jsx("input",{value:l,onChange:Z=>r(Z.target.value),className:"input input-mono",placeholder:"ws://host:8080",autoFocus:!K})]}),!b&&f.jsxs("label",{className:"block",children:[f.jsxs("span",{className:"field-label",children:["Bearer token ",f.jsxs("span",{className:"opacity-70",children:["(from ",f.jsx("code",{className:"font-mono",children:"~/.jaato/ws.token"}),"; leave empty for ",f.jsx("code",{className:"font-mono",children:"--ws-unsafe-no-auth"}),")"]})]}),f.jsx("input",{value:s,onChange:Z=>i(Z.target.value),type:"password",autoComplete:"off",className:"input input-mono"})]}),W]})]}),b&&w&&f.jsxs("div",{className:"text-xs text-text-muted",children:["Not ",w,"? ",f.jsx("a",{href:b.logoutUrl,className:"link",children:"Sign out"})]}),f.jsxs("dl",{className:"kv mt-auto pt-3 border-t hairline text-[11px] m-0","data-testid":"build-info",title:Ip(),children:[f.jsx("dt",{children:"ui"}),f.jsx("dd",{className:"text-text m-0",children:$a.ui}),f.jsx("dt",{children:"sdk"}),f.jsxs("dd",{className:"text-text m-0",children:["@jaato/sdk ",$a.sdk]}),f.jsx("dt",{children:"protocol"}),f.jsxs("dd",{className:"text-text m-0",children:["≥ ",$a.protocolMin]}),f.jsx("dt",{children:"commit"}),f.jsx("dd",{className:"text-text m-0",children:$a.commit})]})]})]})})}const ip=10*1024*1024,rp=50*1024*1024;function Qb(l){return l.trim().replace(/\\/g,"/").split("/").filter(r=>r&&r!==".").join("/")}function Vb(l,r,s){const i=(r||l).replace(/\\/g,"/"),u=i.split("/").filter(h=>h&&h!=="."),d=Qb(s);if(!u.length)return null;const p=[...d?d.split("/"):[],...u];return p.some(h=>h==="..")||i.startsWith("/")||/^[a-zA-Z]:/.test(i)?null:p.join("/")}function Xb(l){return l>=1024*1024?`${(l/(1024*1024)).toFixed(1)} MB`:l>=1024?`${Math.round(l/1024)} kB`:`${l} B`}function $b(l){const r=l.reduce((s,i)=>s+Math.max(i,0),0);if(r>rp){const s=`declared total ${r} bytes exceeds cap ${rp}`;return l.map(()=>({reason:s}))}return l.map(s=>({reason:s>ip?`declared size ${s} bytes exceeds per-file cap ${ip}`:null}))}function Kb(l){return l.length?`
|
|
18
|
+
|
|
19
|
+
Attached files, staged in the workspace: ${l.map(s=>/\s/.test(s)?`"${s}"`:s).join(", ")}`:""}function op(l,r,s=""){const[i,u=""]=l.split(/\?(.*)/s,2);return`${i}/${encodeURIComponent(r)}${s}${u?`?${u}`:""}`}function Ib(l,r){return`${l.includes("?")?`${l}&`:`${l}?`}provider=${encodeURIComponent(r)}`}async function _i(l,r){if(l.status===401)return new Jl("./auth/login");let s="";try{s=String((await l.json()).error??"")}catch{}return new Error(`${r}: HTTP ${l.status}${s?` (${s})`:""}`)}function vc(l,r=fetch){const s={credentials:"same-origin",cache:"no-store"},i={Accept:"application/json","Content-Type":"application/json"};return{async list(u){const d=await r(Ib(l,u),{...s,headers:{Accept:"application/json"}});if(!d.ok)throw await _i(d,"Listing stored keys failed");const p=await d.json();return Array.isArray(p.entries)?p.entries.filter(h=>h&&typeof h.id=="string"):[]},async add(u,d,p){const h=await r(l,{...s,method:"POST",headers:i,body:JSON.stringify({provider:u,secret:d,label:p||void 0})});if(!h.ok)throw await _i(h,"Storing the key failed");const y=await h.json();if(!y.entry||typeof y.entry.id!="string")throw new Error("Storing the key failed: no entry in the answer");return y.entry},async reveal(u){const d=await r(op(l,u,"/reveal"),{...s,method:"POST",headers:{Accept:"application/json"}});if(!d.ok)throw await _i(d,"Reading the stored key failed");const p=await d.json();if(typeof p.secret!="string"||!p.secret)throw new Error("Reading the stored key failed: no secret in the answer");return p.secret},async remove(u){const d=await r(op(l,u),{...s,method:"DELETE"});if(!d.ok&&d.status!==404)throw await _i(d,"Deleting the stored key failed")}}}function Zb(l){return!l.hint||l.label.endsWith(l.hint)?l.label:`${l.label} (…${l.hint})`}const Jb=/^[a-z0-9_-]+-auth$/i,Wb=12e4;let pc=null;function Fb(l,r,s=Date.now()){if(!l||!Jb.test(l)||(r?.[0]??"").toLowerCase()!=="key")return;const i=r?.[1];i&&(pc={secret:i,at:s},tx())}function Pb(l=Date.now()){const r=pc;return pc=null,r&&l-r.at<=Wb?r.secret:null}async function ex(l,r,s=Date.now()){if(!l||!l.providerName)return null;const i=Pb(s);if(!i||!r)return null;try{return await r.add(l.providerName,i),{provider:l.providerName}}catch{return null}}let cp=!1;function tx(){if(cp)return;cp=!0;let l=M.getState().postAuth;M.subscribe(r=>{r.postAuth!==l&&(l=r.postAuth,ex(r.postAuth,r.credentialsUrl?vc(r.credentialsUrl):null))})}const nx=4e3;function ax(l){const r=l?{key:"d",label:"Detach",description:"The task continues in the background; reconnect later"}:{key:"d",label:"Detach",description:"Keep the session on the daemon; reconnect later"},s=l?{key:"e",label:"End session",description:"Cancel the task and delete the session"}:{key:"e",label:"End session",description:"Delete the session from the daemon"},i={key:"r",label:"Return",description:"Return to the session"};return l?[{key:"c",label:"Cancel task and exit",description:"Stop the turn, keep the session on the daemon"},r,s,i]:[r,s,i]}function lx(l){return l==="enabled"?"workspaces":"connect"}async function Zp(){const l=M.getState();if(!l.sessionId)return Zl();const r=ky(l);l.openExitChoice(r,ax(r))}async function Jp(l){const r=M.getState(),s=r.exitChoice;if(!s)return;const i=l.trim().toLowerCase()||s.options[s.focus]?.key||"r";if(r.closeExitChoice(),!s.options.some(d=>d.key===i)||i==="r"){r.addSystemBlock(r.selectedAgentId,"Returning to session.","dim");return}if(i==="c"){try{await Re().stop()}catch{}return Zl()}return i==="d"?Zl():sx(s.running)}async function Zl(){$p(),await xc(),M.getState().setScreen("connect")}async function sx(l){const s=M.getState().sessionId;if(!s||!Wl())return Zl();const i=Re();if(l)try{await i.stop()}catch{}const u=ix(s);await i.deleteSession(s);const d=await u,p=M.getState();if(d.kind==="missing"&&p.addSystemBlock(p.selectedAgentId,d.text,"warning"),p.resetSessionState(),lx(p.workspace.mode)==="connect")return Zl();p.setScreen("workspaces")}function ix(l){return new Promise(r=>{const s=Re();let i=!1;const u=h=>{i||(i=!0,d(),clearTimeout(p),r(h))},d=s.subscribe(G.SYSTEM_MESSAGE,h=>{const y=String(h.message??"");y.includes(`'${l}' not found`)?u({kind:"missing",text:y}):(y.includes(`'${l}' deleted`)||y.startsWith("Session deleted:"))&&u({kind:"deleted",text:y})}),p=setTimeout(()=>u({kind:"silent",text:""}),nx)})}const Xa=[];function rx(l){l.trim()&&Xa[Xa.length-1]!==l&&(Xa.push(l),Xa.length>200&&Xa.shift())}async function Wp(l,r){M.getState().resolvePermission(l),await Re().respondToPermission(l,r)}async function Fp(l,r){const s=M.getState(),i=s.answerClarification(l.requestId,r);if(i){if(!l.batchOnly){await Re().respondToClarification(l.requestId,r,l.index),s.dismissClarification(l.requestId);return}i.index>=i.questions.length&&(await Re().respondToClarificationBatch(l.requestId,i.answers),s.dismissClarification(l.requestId))}}async function Pp(l){M.getState().dismissClarification(l.requestId),l.batchOnly?await Re().respondToClarificationBatch(l.requestId,[],!0):await Re().respondToClarification(l.requestId,"cancel",l.index)}async function up(l,r){M.getState().dismissPostAuth(),await Re().respondToPostAuthSetup(l,r)}async function ox(l){const r=M.getState();try{await Re().toggleWorkspaceIgnore(l)}catch(s){r.setWorkspaceNotice({text:String(s instanceof Error?s.message:s),error:!0})}}async function eh(l,r){M.getState().dismissReferenceSelection(l),await Re().respondToReferenceSelection(l,r)}function cx(){return["Commands are typed as plain words (no / prefix). The composer proposes matches as you type;","press Esc on the proposal to send the word verbatim instead.","",...M.getState().commands.map(s=>` ${s.name.padEnd(28)} ${s.description??""}`.trimEnd()),"","References: @path (file) @@path (sandbox) %name (prompt library) /name (.jaato/commands)","Keys: Ctrl+P plan · Ctrl+B budget · Alt+W files · Ctrl+T tools · Ctrl+A next agent · Ctrl+O next running tool"].join(`
|
|
20
|
+
`)}function ux(l){const r=M.getState().context[l];if(!r)return"No usage reported yet.";const s=r.usage;return[`Context usage for ${l}`,` prompt tokens: ${s.prompt_tokens??"–"}`,` output tokens: ${s.output_tokens??"–"}`,` total tokens: ${s.total_tokens??"–"}`,` limit: ${r.contextLimit??"–"}`,` percent used: ${r.percentUsed!=null?r.percentUsed.toFixed(1)+"%":"–"}`,` turns: ${r.turns??"–"}`].join(`
|
|
21
|
+
`)}async function Sc(){const l=M.getState();if(Wl()){l.setSessionListSilent(1);try{await Re().listSessions()}catch{l.setSessionListSilent(-1)}}}async function fx(l){M.getState().resetSessionState(),await Re().createSession(l?{profile:l}:{})}async function th(l){const r=M.getState();r.resetSessionState(),r.setHistoryMode("replay");const s=Re();try{await s.attachSession(l),await s.requestHistory(Vt)}catch(i){throw M.getState().setHistoryMode("listing"),i}}async function dx(){$p(),await xc(),M.getState().setScreen("connect")}async function fp(l,r){const s=M.getState(),i=s.selectedAgentId||Vt,u=l.trim();if(s.exitChoice){await Jp(u);return}const d=s.permissions.find(b=>b.agentId===i)??s.permissions[0];if(d){const b=u||(d.options[d.focus]?.key??"");if(!b)return;await Wp(d.requestId,b);return}const p=s.clarifications.find(b=>b.agentId===i&&b.inputMode)??s.clarifications.find(b=>b.inputMode);if(p){if(u.toLowerCase()==="cancel")return Pp(p);const b=p.questions[p.index],x=u||(b?.default!=null?String(b.default):"");await Fp(p,x);return}const h=s.referenceSelections.find(b=>b.agentId===i)??s.referenceSelections[0];if(h&&u){await eh(h.requestId,u);return}if(!u)return;rx(l);const y=Ap(l,{serverCommands:s.commands,verbatim:r}),g=Re();switch(y.action){case"exit":await Zp();return;case"stop":await g.stop();return;case"clear":s.clearOutput(i);return;case"help":s.addSystemBlock(i,cx(),"help");return;case"context":s.addSystemBlock(i,ux(i),"help");return;case"history":s.setHistoryMode("listing"),await g.requestHistory(i);return;case"server":{if(y.command==="theme"){const b=y.args?.[0];b&&ep.includes(b)?(Yp(b),Nb(b),s.setTheme(b),s.addSystemBlock(i,`Theme: ${b}`,"info")):s.addSystemBlock(i,`Themes: ${ep.join(", ")}`,"info");return}if(y.command==="session.attach"&&y.args?.[0]){await th(y.args[0]);return}Fb(y.command,y.args),s.addUserBlock(i,l),await g.executeCommand(y.command??"",y.args??[]);return}case"message":{const b=(y.text??l)+Kb(s.takeUploads());s.addUserBlock(i,b),s.markSending(i);try{await g.sendMessage(b)}catch(x){throw s.clearSending(i),x}return}}}const Po="__new__",ec="";function mx({credentialsUrl:l,provider:r,value:s,onChange:i,onError:u,reloadKey:d=0}){const[p,h]=q.useState([]),[y,g]=q.useState(null),[b,x]=q.useState(!1),w=l?vc(l):null;q.useEffect(()=>{if(!w||!r){h([]),g(null);return}let K=!1;return w.list(r).then(W=>{K||(h(W),g(r),s.kind==="none"&&W.length>0&&i({kind:"stored",id:W[W.length-1].id}),s.kind==="stored"&&!W.some(de=>de.id===s.id)&&i({kind:"none"}))}).catch(W=>{K||u(W instanceof Error?W.message:String(W))}),()=>{K=!0}},[l,r,d]);const j=async K=>{if(w){x(!0);try{await w.remove(K),h(W=>W.filter(de=>de.id!==K)),s.kind==="stored"&&s.id===K&&i({kind:"none"})}catch(W){u(W instanceof Error?W.message:String(W))}finally{x(!1)}}},B=s.kind==="new"?s.secret:"",z=s.kind==="new"?s.label:"",Y=K=>i({kind:"new",secret:K.secret??B,label:K.label??z}),V="input input-mono mt-1";if(!w)return f.jsxs("label",{className:"block",children:[f.jsx("span",{className:"field-label",children:"API key"}),f.jsx("input",{"aria-label":"API key",value:B,onChange:K=>Y({secret:K.target.value}),type:"password",autoComplete:"off",className:V})]});const ee=s.kind==="stored"?s.id:s.kind==="new"?Po:ec,te=s.kind==="stored"?p.find(K=>K.id===s.id):void 0;return f.jsxs("div",{className:"block","data-testid":"credential-picker",children:[f.jsxs("label",{className:"block",children:[f.jsx("span",{className:"field-label",children:"API key"}),f.jsxs("select",{"aria-label":"API key",value:ee,disabled:!r,onChange:K=>{const W=K.target.value;i(W===Po?{kind:"new",secret:"",label:""}:W===ec?{kind:"none"}:{kind:"stored",id:W})},className:"input",children:[f.jsx("option",{value:ec,children:y===r&&p.length===0?"— no stored key —":"—"}),p.map(K=>f.jsx("option",{value:K.id,children:Zb(K)},K.id)),f.jsx("option",{value:Po,children:"New key…"})]})]}),te&&f.jsxs("div",{className:"mt-1 flex items-center justify-between text-[11px] text-text-muted",children:[f.jsxs("span",{children:["stored ",new Date(te.createdAt).toLocaleDateString()]}),f.jsx("button",{type:"button",disabled:b,onClick:()=>j(te.id),className:"link hover:text-error","aria-label":`Forget stored key ${te.label}`,children:"forget"})]}),s.kind==="new"&&f.jsxs(f.Fragment,{children:[f.jsx("input",{"aria-label":"New API key",value:B,onChange:K=>Y({secret:K.target.value}),type:"password",autoComplete:"off",placeholder:"paste the key",className:V}),f.jsx("input",{"aria-label":"Key label",value:z,onChange:K=>Y({label:K.target.value}),placeholder:"label (optional) — e.g. work account",className:`${V} text-xs`})]})]})}const Xl="px-3.5 py-2 text-left font-medium border-b hairline kicker kicker-muted",dp="px-3.5 py-2.5 border-b hairline align-middle";function px(l){if(!l)return"—";const r=new Date(l);if(Number.isNaN(r.getTime()))return l;const s=new Date,i=r.toDateString()===s.toDateString(),u=r.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"});return i?`${u} today`:`${r.toLocaleDateString(void 0,{day:"numeric",month:"short"})} ${u}`}function hx(){const l=M(X=>X.workspace),r=M(X=>X.setScreen),s=M(X=>X.setWorkspaceListNotice),i=M(X=>X.credentialsUrl),u=M(X=>X.backend),[d,p]=q.useState(""),[h,y]=q.useState(""),[g,b]=q.useState(""),[x,w]=q.useState({kind:"none"}),[j,B]=q.useState(0),[z,Y]=q.useState(!1),[V,ee]=q.useState(null),[te,K]=q.useState(null);q.useEffect(()=>{Xp().catch(()=>{})},[]),q.useEffect(()=>{l.config&&(y(l.config.provider??""),b(l.config.model??""))},[l.config]);const W=async X=>{Y(!0);try{await dc(X),r("session")}finally{Y(!1)}},de=async X=>{Y(!0);try{await dc(X),ee(X)}finally{Y(!1)}},Z=async X=>{Y(!0);try{await Cb(X)}finally{Y(!1),K(null)}},U=async X=>{X.preventDefault(),d.trim()&&(await Ob(d.trim()),p(""))},se=async()=>{const X=i?vc(i):null;if(x.kind==="stored")return{apiKey:X?await X.reveal(x.id):void 0};if(x.kind==="new"&&x.secret.trim()){const Te=x.secret.trim();let ze;if(X&&h)try{ze=(await X.add(h,Te,x.label.trim()||void 0)).id}catch(Ce){s({text:`Key applied, but not stored for later: ${Ce instanceof Error?Ce.message:String(Ce)}`,error:!0})}return{apiKey:Te,storedId:ze}}return{}},fe=async X=>{X.preventDefault(),Y(!0);try{const{apiKey:Te,storedId:ze}=await se();await Rb({provider:h||void 0,model:g||void 0,api_key:Te}),x.kind==="new"&&(w(ze?{kind:"stored",id:ze}:{kind:"none"}),B(Ce=>Ce+1))}catch(Te){s({text:Te instanceof Error?Te.message:String(Te),error:!0})}finally{Y(!1)}},ie=l.config;return f.jsx("div",{className:"h-full overflow-auto p-6 sm:p-10 flex justify-center",children:f.jsxs("div",{className:"w-full max-w-[880px] flex flex-col gap-5",children:[f.jsxs("header",{className:"flex items-end justify-between gap-4 border-b hairline pb-2.5",children:[f.jsxs("div",{children:[f.jsx("div",{className:"kicker tracking-[0.16em]",children:l.root?"Workspace root":"Pick a workspace"}),f.jsx("h1",{className:"display text-[30px] m-0",children:"Workspaces"})]}),f.jsxs("div",{className:"text-right space-y-0.5",children:[f.jsxs("div",{className:"font-mono text-xs text-text-muted",children:[l.root??"workspace mode"," · ",l.list.length," ",l.list.length===1?"entry":"entries"]}),f.jsxs("div",{className:"text-xs text-text-muted",children:[u?.user&&f.jsxs(f.Fragment,{children:["Signed in as ",f.jsx("span",{className:"font-semibold text-text",children:u.user})," · "]}),u?f.jsx("a",{href:u.logoutUrl,className:"link",children:"Sign out"}):f.jsx("button",{type:"button",onClick:()=>{dx().catch(()=>{})},className:"link",children:"Disconnect"})]})]})]}),l.notice&&f.jsx("div",{role:"status",className:`text-xs ${l.notice.error?"text-error":"text-text-muted"}`,children:l.notice.text}),f.jsx(Nt,{className:"overflow-x-auto",children:f.jsxs("table",{className:"w-full border-collapse text-sm",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{className:Xl,children:"Workspace"}),f.jsx("th",{className:Xl,children:"Provider · model"}),f.jsx("th",{className:Xl,children:"Owner"}),f.jsx("th",{className:Xl,children:"Last opened"}),f.jsx("th",{className:`${Xl} text-right`,children:"Actions"})]})}),f.jsxs("tbody",{className:"font-mono text-[13px]",children:[l.list.length===0&&f.jsx("tr",{children:f.jsx("td",{colSpan:5,className:"px-3.5 py-3 font-sans text-sm text-text-muted italic",children:"No workspaces yet — create one below."})}),l.list.map((X,Te)=>{const Ce=Te===l.list.length-1?dp.replace("border-b hairline",""):dp;return f.jsxs("tr",{className:l.selected===X.name?"tint":"hover:bg-tint/60",children:[f.jsx("td",{className:`${Ce} whitespace-nowrap`,children:f.jsxs("button",{type:"button",disabled:z,onClick:()=>W(X.name),className:"text-left hover:text-steel",children:[f.jsx("span",{className:`mr-2 ${X.configured?"text-success":"text-warning"}`,children:X.configured?"●":"○"}),X.name]})}),f.jsx("td",{className:`${Ce} ${X.configured?"":"text-text-muted"}`,children:X.configured?[X.provider,X.model].filter(Boolean).join(" / "):f.jsxs(f.Fragment,{children:["no provider in ",f.jsx("span",{className:"text-text",children:".env"})," — sign in from the prompt, or configure"]})}),f.jsx("td",{className:`${Ce} text-text-muted`,children:X.owner?f.jsx("span",{title:`Owned by ${X.owner}`,children:X.owner}):"—"}),f.jsx("td",{className:`${Ce} text-text-muted whitespace-nowrap`,children:px(X.last_accessed)}),f.jsx("td",{className:`${Ce} text-right whitespace-nowrap`,children:te===X.name?f.jsxs("span",{className:"inline-flex items-center gap-2 font-sans text-xs",role:"group","aria-label":`Confirm deleting workspace ${X.name}`,children:[f.jsxs("span",{className:"text-warning",children:["delete ",X.name," and its sessions?"]}),f.jsx("button",{type:"button",disabled:z,onClick:()=>Z(X.name),className:"btn btn-sm btn-danger","aria-label":`Confirm delete workspace ${X.name}`,children:"Delete"}),f.jsx("button",{type:"button",onClick:()=>K(null),className:"btn btn-sm","aria-label":"Cancel delete",children:"Cancel"})]}):f.jsxs("span",{className:"inline-flex items-center gap-2",children:[f.jsx("button",{type:"button",disabled:z,onClick:()=>W(X.name),className:`btn btn-sm ${l.selected===X.name?"btn-steel":"text-steel"}`,"aria-label":`Open workspace ${X.name}`,children:"Open"}),f.jsx("button",{type:"button",disabled:z,onClick:()=>de(X.name),className:"btn btn-sm btn-quiet border-transparent","aria-label":`Configure workspace ${X.name}`,children:"Configure"}),f.jsx("button",{type:"button",disabled:z,onClick:()=>K(X.name),className:"btn btn-sm btn-quiet border-transparent hover:text-error","aria-label":`Delete workspace ${X.name}`,children:"Delete"})]})})]},X.name)})]})]})}),f.jsxs("form",{onSubmit:U,className:"flex items-center gap-3",children:[f.jsx("input",{value:d,onChange:X=>p(X.target.value),placeholder:"new-workspace-name",className:"input input-mono flex-1","aria-label":"New workspace name"}),f.jsx("button",{type:"submit",className:"btn",children:"Create"}),f.jsx("span",{className:"flex-1"}),f.jsx("button",{type:"button",className:"link text-[13px]",onClick:()=>r("session"),title:"The daemon provisions a fresh workspace for the session under its workspace root",children:"Open a session in a server-provisioned workspace"})]}),ie&&V===ie.workspace&&f.jsxs(Nt,{role:"group","aria-label":"Manual provider configuration",className:"flex flex-col",children:[f.jsxs("div",{className:"flex items-baseline gap-3 px-5 py-3.5 border-b hairline",children:[f.jsx("span",{className:"kicker tracking-[0.16em]",children:"Configure"}),f.jsx("span",{className:"font-mono text-[16px]",children:ie.workspace}),f.jsx("span",{className:"flex-1"}),f.jsx("span",{className:"font-mono text-xs text-text-muted",children:ie.configured?"configured":`missing: ${ie.missingFields.join(", ")||"provider"}`})]}),f.jsxs("form",{onSubmit:fe,className:"p-5 flex flex-col gap-4",children:[f.jsxs("div",{className:"text-xs text-text-muted",children:["Writes ",f.jsx("span",{className:"font-mono",children:"JAATO_PROVIDER"})," / ",f.jsx("span",{className:"font-mono",children:"MODEL_NAME"})," (and the key) to this workspace's ",f.jsx("span",{className:"font-mono",children:".env"}),". Optional: an auth command from the prompt does the same after signing you in."]}),f.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3 text-sm",children:[f.jsxs("label",{className:"block",children:[f.jsx("span",{className:"field-label",children:"Provider"}),f.jsxs("select",{value:h,onChange:X=>y(X.target.value),className:"input",children:[f.jsx("option",{value:"",children:"—"}),ie.availableProviders.map(X=>f.jsx("option",{value:X,children:X},X))]})]}),f.jsxs("label",{className:"block",children:[f.jsx("span",{className:"field-label",children:"Model"}),f.jsx("input",{value:g,onChange:X=>b(X.target.value),className:"input input-mono"})]}),f.jsx(mx,{credentialsUrl:i,provider:h,value:x,onChange:w,reloadKey:j,onError:X=>s({text:X,error:!0})})]}),f.jsxs("div",{className:"flex items-center gap-2 border-t hairline pt-4",children:[f.jsx("button",{type:"submit",disabled:z,className:"btn btn-steel",children:"Save configuration"}),f.jsx("button",{type:"button",onClick:()=>ee(null),className:"btn btn-quiet",children:"Close"}),f.jsx("span",{className:"flex-1"}),f.jsx("button",{type:"button",onClick:()=>r("session"),className:"btn btn-primary",children:"Open session →"})]})]})]})]})})}var gx=Tp();function _x(l,r,s){const i=new Array(l);return new Proxy(i,{get(u,d,p){if(typeof d=="string"){const h=d.charCodeAt(0);if(h>=48&&h<=57){const y=+d;if(Number.isInteger(y)&&y>=0&&y<l){let g=u[y];if(!g){const b=r[y*2];g=u[y]={index:y,key:s(y),start:b,size:r[y*2+1],end:b+r[y*2+1],lane:0}}return g}}if(d==="length")return l}return Reflect.get(u,d,p)}})}function Va(l,r,s){let i=s.initialDeps??[],u,d=!0;function p(){const h=l();return(h.length!==i.length||h.some((g,b)=>i[b]!==g))&&(i=h,u=r(...h),s?.onChange&&!(d&&s.skipInitialOnChange)&&s.onChange(u),d=!1),u}return p.updateDeps=h=>{i=h},p}function mp(l,r){if(l===void 0)throw new Error("Unexpected undefined");return l}const yx=(l,r)=>Math.abs(l-r)<1.01,bx=(l,r,s)=>{let i;return Object.assign(function(...u){l.clearTimeout(i),i=l.setTimeout(()=>r.apply(this,u),s)},{cancel:()=>{l.clearTimeout(i)}})};let $l;const tc=()=>{if($l!==void 0)return $l;if(typeof navigator>"u")return $l=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return $l=!0;const l=navigator.maxTouchPoints;return $l=navigator.platform==="MacIntel"&&l!==void 0&&l>0},pp=l=>{const{offsetWidth:r,offsetHeight:s}=l;return{width:r,height:s}},xx=l=>l,vx=l=>{const r=Math.max(l.startIndex-l.overscan,0),i=Math.min(l.endIndex+l.overscan,l.count-1)-r+1,u=new Array(i);for(let d=0;d<i;d++)u[d]=r+d;return u},Sx=(l,r)=>{const s=l.scrollElement;if(!s)return;const i=l.targetWindow;if(!i)return;const u=p=>{const{width:h,height:y}=p;r({width:Math.round(h),height:Math.round(y)})};if(u(pp(s)),!i.ResizeObserver)return()=>{};const d=new i.ResizeObserver(p=>{const h=()=>{const y=p[0];if(y?.borderBoxSize){const g=y.borderBoxSize[0];if(g){u({width:g.inlineSize,height:g.blockSize});return}}u(pp(s))};l.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(h):h()});return d.observe(s,{box:"border-box"}),()=>{d.unobserve(s)}},Ei={passive:!0},Ex=typeof window>"u"?!0:"onscrollend"in window,wx=(l,r,s)=>{const i=l.scrollElement;if(!i)return;const u=l.targetWindow;if(!u)return;const d=l.options.useScrollendEvent&&Ex;let p=0;const h=d?null:bx(u,()=>r(p,!1),l.options.isScrollingResetDelay),y=x=>()=>{p=s(i),h?.(),r(p,x)},g=y(!0),b=y(!1);return i.addEventListener("scroll",g,Ei),d&&i.addEventListener("scrollend",b,Ei),()=>{i.removeEventListener("scroll",g),d&&i.removeEventListener("scrollend",b),h?.cancel()}},Nx=(l,r)=>wx(l,r,s=>{const{horizontal:i,isRtl:u}=l.options;return i?s.scrollLeft*(u&&-1||1):s.scrollTop}),Tx=(l,r,s)=>{if(s.options.useCachedMeasurements){const i=s.indexFromElement(l),u=s.options.getItemKey(i);return s.itemSizeCache.get(u)??s.options.estimateSize(i)}if(r?.borderBoxSize){const i=r.borderBoxSize[0];if(i)return Math.round(i[s.options.horizontal?"inlineSize":"blockSize"])}if(!r){const i=s.indexFromElement(l),u=s.options.getItemKey(i),d=s.itemSizeCache.get(u);if(d!==void 0)return d}return l[s.options.horizontal?"offsetWidth":"offsetHeight"]},kx=(l,{adjustments:r=0,behavior:s},i)=>{var u,d;(d=(u=i.scrollElement)==null?void 0:u.scrollTo)==null||d.call(u,{[i.options.horizontal?"left":"top"]:l+r,behavior:s})},jx=kx;class Ax{constructor(r){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var s,i,u;return((u=(i=(s=this.targetWindow)==null?void 0:s.performance)==null?void 0:i.now)==null?void 0:u.call(i))??Date.now()},this.observer=(()=>{let s=null;const i=()=>s||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:s=new this.targetWindow.ResizeObserver(u=>{u.forEach(d=>{const p=()=>{const h=d.target,y=this.indexFromElement(h);if(!h.isConnected){this.observer.unobserve(h);for(const[g,b]of this.elementsCache)if(b===h){this.elementsCache.delete(g);break}return}this.isIndexInRange(y)&&this.shouldMeasureDuringScroll(y)&&this.resizeItem(y,this.options.measureElement(h,d,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(p):p()})}));return{disconnect:()=>{var u;(u=i())==null||u.disconnect(),s=null},observe:u=>{var d;return(d=i())==null?void 0:d.observe(u,{box:"border-box"})},unobserve:u=>{var d;return(d=i())==null?void 0:d.unobserve(u)}}})(),this.range=null,this.setOptions=s=>{var i,u;const d={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:xx,rangeExtractor:vx,onChange:()=>{},measureElement:Tx,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const w in s){const j=s[w];j!==void 0&&(d[w]=j)}const p=this.options;let h=null,y=null,g=!1;if(p!==void 0&&p.enabled&&d.enabled&&d.anchorTo==="end"&&this.scrollElement!==null){const w=p.count,j=d.count,B=this.getMeasurements(),z=w>0?((i=B[0])==null?void 0:i.key)??p.getItemKey(0):null,Y=w>0?((u=B[w-1])==null?void 0:u.key)??p.getItemKey(w-1):null;if(j!==w||w>0&&j>0&&(d.getItemKey(0)!==z||d.getItemKey(j-1)!==Y)){g=!0;const te=w>0?this.getVirtualItemForOffset(this.getScrollOffset())??B[0]:null;te&&(h=[te.key,this.getScrollOffset()-te.start]);const K=d.followOnAppend===!0?"auto":d.followOnAppend||null;K&&j>w&&this.isAtEnd(p.scrollEndThreshold)&&(w===0||d.getItemKey(j-1)!==Y)&&(y=K)}}this.options=d,g&&(this.pendingMin=0,this.itemSizeCacheVersion++);let b=!1,x=0;if(h&&this.scrollOffset!==null){const[w,j]=h,B=this.getMeasurements(),{count:z,getItemKey:Y}=this.options;let V=0;for(;V<z&&Y(V)!==w;)V++;if(V<z){const ee=B[V];if(ee){const te=Math.max(0,ee.start+j);te!==this.scrollOffset&&(x=te-this.scrollOffset,this.scrollOffset=te,b=!0)}}}(b||y)&&(this.pendingScrollAnchor=[b?h[0]:null,b?h[1]:0,y,x])},this.notify=s=>{var i,u;(u=(i=this.options).onChange)==null||u.call(i,this,s)},this.maybeNotify=Va(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),s=>{this.notify(s)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(s=>s()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var s;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}if(this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((s=this.scrollElement)==null?void 0:s.window)??null,this.elementsCache.forEach(d=>{this.observer.observe(d)}),this.unsubs.push(this.options.observeElementRect(this,d=>{this.scrollRect=d,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(d,p)=>{if(p&&this._intendedScrollOffset===null&&d===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(d-this._intendedScrollOffset)<1.5&&(d=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(d-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;const h=this.getScrollOffset();this.scrollDirection=p?h===d?this.scrollDirection:h<d?"forward":"backward":null,this.scrollOffset=d,this.isScrolling=p,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const d=this.scrollElement,p=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},h=()=>{this._iosTouching=!1,!(!tc()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};d.addEventListener("touchstart",p,Ei),d.addEventListener("touchend",h,Ei),this.unsubs.push(()=>{d.removeEventListener("touchstart",p),d.removeEventListener("touchend",h),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const u=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,u&&this.scrollElement&&this.options.enabled){const[d,p,h,y]=u;d!==null&&!h&&(tc()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?y!==0&&(this._iosDeferredAdjustment+=y):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),h&&this.scrollToEnd({behavior:h})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;const{target:s,maxAtWrite:i}=this._clampedAdjustment,u=this.getMaxScrollOffset();u>i+.5&&(this._clampedAdjustment=s>u+.5?{target:s,maxAtWrite:u}:null,this._scrollToOffset(s,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const s=this.getScrollOffset(),i=this.getMaxScrollOffset();if(s<0||s>i)return;if(this._iosDeferredAdjustment<0&&s>=i-1){this._iosDeferredAdjustment=0;return}const u=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(s,{adjustments:this.scrollAdjustments+=u,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Va(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(s,i,u,d,p,h,y,g)=>(this.prevLanes!==void 0&&this.prevLanes!==h&&(this.lanesChangedFlag=!0),this.prevLanes=h,this.pendingMin=null,{count:s,paddingStart:i,scrollMargin:u,getItemKey:d,enabled:p,lanes:h,laneAssignmentMode:y,gap:g}),{key:!1}),this.isIndexInRange=s=>s>=0&&s<this.options.count,this.getMeasurements=Va(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:s,paddingStart:i,scrollMargin:u,getItemKey:d,enabled:p,lanes:h,laneAssignmentMode:y,gap:g},b)=>{const x=this.itemSizeCache;if(!p)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>s)for(const V of this.laneAssignments.keys())V>=s&&this.laneAssignments.delete(V);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(V=>{this.itemSizeCache.set(V.key,V.size)}));const w=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===s&&(this.lanesSettling=!1),h===1){const V=s*2;let ee=this._flatMeasurements;if(!ee||ee.length<V){const W=new Float64Array(V);ee&&w>0&&W.set(ee.subarray(0,w*2)),ee=W,this._flatMeasurements=ee}let te;if(w===0)te=i+u;else{const W=w-1;te=ee[W*2]+ee[W*2+1]+g}for(let W=w;W<s;W++){const de=d(W),Z=x.get(de),U=typeof Z=="number"?Z:this.options.estimateSize(W);ee[W*2]=te,ee[W*2+1]=U,te+=U+g}const K=_x(s,ee,d);return this.measurementsCache=K,K}const j=this.measurementsCache.slice(0,w),B=new Array(h).fill(void 0),z=new Float64Array(h);let Y=0;for(let V=0;V<w;V++){const ee=j[V];ee&&(B[ee.lane]===void 0&&Y++,B[ee.lane]=V,z[ee.lane]=ee.end)}for(let V=w;V<s;V++){const ee=d(V),te=this.laneAssignments.get(V);let K,W;const de=y==="estimate"||x.has(ee);if(te!==void 0&&this.options.lanes>1){K=te;const fe=B[K],ie=fe!==void 0?j[fe]:void 0;W=ie?ie.end+g:i+u}else if(Y===h){let fe=0,ie=z[0],X=B[0];for(let Te=1;Te<h;Te++){const ze=z[Te];(ze<ie||ze===ie&&B[Te]<X)&&(fe=Te,ie=ze,X=B[Te])}K=fe,W=ie+g,de&&this.laneAssignments.set(V,K)}else K=V%this.options.lanes,W=i+u,de&&this.laneAssignments.set(V,K);const Z=x.get(ee),U=typeof Z=="number"?Z:this.options.estimateSize(V),se=W+U;j[V]={index:V,start:W,size:U,end:se,key:ee,lane:K},B[K]===void 0&&Y++,B[K]=V,z[K]=se}return this.measurementsCache=j,j},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Va(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(s,i,u,d)=>s.length===0||i===0?(this.range=null,null):(this.range=Cx(s,i,u,d,d===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Va(()=>{let s=null,i=null;const u=this.calculateRange();return u&&(s=u.startIndex,i=u.endIndex),this.maybeNotify.updateDeps([this.isScrolling,s,i]),[this.options.rangeExtractor,this.options.overscan,this.options.count,s,i]},(s,i,u,d,p)=>d===null||p===null?[]:s({startIndex:d,endIndex:p,overscan:i,count:u}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=s=>{const i=this.options.indexAttribute,u=s.getAttribute(i);return u?parseInt(u,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=s=>{var i;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const u=this.scrollState.index??((i=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:i.index);if(u!==void 0&&this.range){const d=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),p=Math.max(0,u-d),h=Math.min(this.options.count-1,u+d);return s>=p&&s<=h}return!0},this.measureElement=s=>{if(!s){this.elementsCache.forEach((p,h)=>{p.isConnected||(this.observer.unobserve(p),this.elementsCache.delete(h))});return}const i=this.indexFromElement(s);if(!this.isIndexInRange(i))return;const u=this.options.getItemKey(i),d=this.elementsCache.get(u);d!==s&&(d&&this.observer.unobserve(d),this.observer.observe(s),this.elementsCache.set(u,s)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(i)&&this.resizeItem(i,this.options.measureElement(s,void 0,this))},this.resizeItem=(s,i)=>{var u,d;if(!this.isIndexInRange(s))return;let p,h,y;const g=this._flatMeasurements;if(this.options.lanes===1&&g!==null)y=this.options.getItemKey(s),h=g[s*2],p=g[s*2+1];else{const w=this.measurementsCache[s];if(!w)return;y=w.key,h=w.start,p=w.size}const b=this.itemSizeCache.get(y)??p,x=i-b;if(x!==0){const w=this.options.anchorTo==="end"&&((u=this.scrollState)==null?void 0:u.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,j=w?this.getTotalSize():0,B=this.getScrollOffset()+this.scrollAdjustments,Y=!this.itemSizeCache.has(y)?h<B:h+b<=B&&this.scrollDirection!=="backward",V=((d=this.scrollState)==null?void 0:d.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[s]??{index:s,key:y,start:h,size:p,end:h+p,lane:0},x,this):Y);(this.pendingMin===null||s<this.pendingMin)&&(this.pendingMin=s),this.itemSizeCache.set(y,i),this.itemSizeCacheVersion++;let ee=!1;w?ee=this.applyScrollAdjustment(this.getTotalSize()-j):V&&(ee=this.applyScrollAdjustment(x)),this.notify(ee),this._retryClampedAdjustment()}},this.getVirtualItems=Va(()=>[this.getVirtualIndexes(),this.getMeasurements()],(s,i)=>{const u=[];for(let d=0,p=s.length;d<p;d++){const h=s[d],y=i[h];u.push(y)}return u},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=s=>{const i=this.getMeasurements();if(i.length===0)return;const u=this._flatMeasurements,d=this.options.lanes===1&&u!=null,p=nh(0,i.length-1,d?h=>u[h*2]:h=>mp(i[h]).start,s);return mp(i[p])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const s=this.scrollElement.document.documentElement;return this.options.horizontal?s.scrollWidth-this.scrollElement.innerWidth:s.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(s=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=s,this.getOffsetForAlignment=(s,i,u=0)=>{if(!this.scrollElement)return 0;const d=this.getSize(),p=this.getScrollOffset();i==="auto"&&(i=s>=p+d?"end":"start"),i==="center"?s+=(u-d)/2:i==="end"&&(s-=d);const h=this.getMaxScrollOffset();return Math.max(Math.min(h,s),0)},this.getOffsetForIndex=(s,i="auto")=>{s=Math.max(0,Math.min(s,this.options.count-1));const u=this.getSize(),d=this.getScrollOffset(),p=this.measurementsCache[s];if(!p)return;if(i==="auto")if(p.end>=d+u-this.options.scrollPaddingEnd)i="end";else if(p.start<=d+this.options.scrollPaddingStart)i="start";else return[d,i];if(i==="end"&&s===this.options.count-1)return[this.getMaxScrollOffset(),i];const h=i==="end"?p.end+this.options.scrollPaddingEnd:p.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(h,i,p.size),i]},this.scrollToOffset=(s,{align:i="start",behavior:u="auto"}={})=>{this._iosDeferredAdjustment=0;const d=this.getOffsetForAlignment(s,i),p=this.now();this.scrollState={index:null,align:i,behavior:u,startedAt:p,lastTargetOffset:d,stableFrames:0},this._scrollToOffset(d,{adjustments:void 0,behavior:u}),this.scheduleScrollReconcile()},this.scrollToIndex=(s,{align:i="auto",behavior:u="auto"}={})=>{this._iosDeferredAdjustment=0,s=Math.max(0,Math.min(s,this.options.count-1));const d=this.getOffsetForIndex(s,i);if(!d)return;const[p,h]=d,y=this.now();this.scrollState={index:s,align:h,behavior:u,startedAt:y,lastTargetOffset:p,stableFrames:0},this._scrollToOffset(p,{adjustments:void 0,behavior:u}),this.scheduleScrollReconcile()},this.scrollBy=(s,{behavior:i="auto"}={})=>{const u=this.getScrollOffset()+s,d=this.now();this.scrollState={index:null,align:"start",behavior:i,startedAt:d,lastTargetOffset:u,stableFrames:0},this._scrollToOffset(u,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:s="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:s});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:s})},this.getTotalSize=()=>{var s;const i=this.getMeasurements();let u;if(i.length===0)u=this.options.paddingStart;else if(this.options.lanes===1){const d=i.length-1,p=this._flatMeasurements;p!=null?u=p[d*2]+p[d*2+1]:u=((s=i[d])==null?void 0:s.end)??0}else{const d=Array(this.options.lanes).fill(null);let p=i.length-1;for(;p>=0&&d.some(h=>h===null);){const h=i[p];d[h.lane]===null&&(d[h.lane]=h.end),p--}u=Math.max(...d.filter(h=>h!==null))}return Math.max(u-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const s=[];if(this.itemSizeCache.size===0)return s;const i=this.getMeasurements();for(const u of i)u&&this.itemSizeCache.has(u.key)&&s.push({index:u.index,key:u.key,start:u.start,size:u.size,end:u.end,lane:u.lane});return s},this._scrollToOffset=(s,{adjustments:i,behavior:u})=>{this._intendedScrollOffset=s+(i??0),this.options.scrollToFn(s,{behavior:u,adjustments:i},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(r)}applyScrollAdjustment(r,s){if(r===0)return!1;if(tc()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=r,!1;{const i=this.getScrollOffset()+this.scrollAdjustments+r,u=this.scrollElement,d=u!==null&&("scrollHeight"in u||"document"in u)?this.getMaxScrollOffset():null;return this._clampedAdjustment=d!==null&&i>d+.5?{target:i,maxAtWrite:d}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:s}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const i=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,u=i?i[0]:this.scrollState.lastTargetOffset,d=1,p=u!==this.scrollState.lastTargetOffset;if(!p&&yx(u,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=d){this.getScrollOffset()!==u&&this._scrollToOffset(u,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,p){const h=this.getSize()||600,y=Math.abs(u-this.getScrollOffset()),g=this.scrollState.behavior==="smooth"&&y>h;this.scrollState.lastTargetOffset=u,g||(this.scrollState.behavior="auto"),this._scrollToOffset(u,{adjustments:void 0,behavior:g?"smooth":"auto"})}this.scheduleScrollReconcile()}}const nh=(l,r,s,i)=>{for(;l<=r;){const u=(l+r)/2|0,d=s(u);if(d<i)l=u+1;else if(d>i)r=u-1;else return u}return l>0?l-1:0};function Ox(l,r,s){let i=0;for(;i<=r;){const u=(i+r)/2|0,d=l[u*2];if(d<s)i=u+1;else if(d>s)r=u-1;else return u}return i>0?i-1:0}function Cx(l,r,s,i,u){const d=l.length-1;if(l.length<=i)return{startIndex:0,endIndex:d};if(i===1&&u!==null){const g=Ox(u,d,s);let b=g;const x=s+r;for(;b<d&&u[b*2]+u[b*2+1]<x;)b++;return{startIndex:g,endIndex:b}}let h=nh(0,d,g=>l[g].start,s),y=h;if(i===1)for(;y<d&&l[y].end<s+r;)y++;else if(i>1){const g=Array(i).fill(0);for(;y<d&&g.some(x=>x<s+r);){const x=l[y];g[x.lane]=x.end,y++}const b=Array(i).fill(s+r);for(;h>=0&&b.some(x=>x>=s);){const x=l[h];b[x.lane]=x.start,h--}h=Math.max(0,h-h%i),y=Math.min(d,y+(i-1-y%i))}return{startIndex:h,endIndex:y}}const nc=typeof document<"u"?q.useLayoutEffect:q.useEffect;function Rx({useFlushSync:l=!0,directDomUpdates:r=!1,directDomUpdatesMode:s="transform",...i}){const u=q.useReducer(b=>b+1,0)[1],d=q.useRef({enabled:r,mode:s,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});d.current.enabled=r,d.current.mode=s;const p=b=>{const x=d.current;if(!x.enabled||!x.container)return;const w=b.getTotalSize();if(w!==x.lastSize){x.lastSize=w;const j=b.options.horizontal?"width":"height";x.container.style[j]=`${w}px`}},h=b=>{const x=d.current;if(!x.enabled||!x.container)return;p(b);const w=!!b.options.horizontal,j=x.mode==="transform",B=w?"left":"top",z=b.options.scrollMargin,Y=b.getVirtualItems();for(const V of Y){const ee=V.start-z,te=b.elementsCache.get(V.key);te&&x.lastPositions.get(te)!==ee&&(x.lastPositions.set(te,ee),j?te.style.transform=w?`translate3d(${ee}px, 0, 0)`:`translate3d(0, ${ee}px, 0)`:te.style[B]=`${ee}px`)}},y={...i,onChange:(b,x)=>{var w;const j=d.current;let B=!0;if(j.enabled){h(b);const z=b.range,Y=j.prevRange;B=!Y||Y.isScrolling!==b.isScrolling||Y.startIndex!==z?.startIndex||Y.endIndex!==z?.endIndex,B&&(j.prevRange=z?{startIndex:z.startIndex,endIndex:z.endIndex,isScrolling:b.isScrolling}:null)}B&&(l&&x?gx.flushSync(u):u()),(w=i.onChange)==null||w.call(i,b,x)}},[g]=q.useState(()=>{const b=new Ax(y);return Object.assign(b,{containerRef:x=>{const w=d.current;if(w.container=x,w.lastSize=null,x&&w.enabled){const j=b.getTotalSize();w.lastSize=j;const B=b.options.horizontal?"width":"height";x.style[B]=`${j}px`}}})});return g.setOptions(y),nc(()=>g._didMount(),[]),nc(()=>(p(g),g._willUpdate())),nc(()=>{h(g)}),g}function Mx(l){return Rx({observeElementRect:Sx,observeElementOffset:Nx,scrollToFn:jx,...l})}const Dx='<j-code(?:\\s+language="([^"]*)")?>\\n?([\\s\\S]*?)<\\/j-code>\\n?|<j-table>\\n?([\\s\\S]*?)<\\/j-table>\\n?',zx='<j-line(?:\\s+n="(\\d+)")?>([\\s\\S]*?)<\\/j-line>',Ux='<j-tok(?:\\s+t="([^"]*)")?>([\\s\\S]*?)<\\/j-tok>',hp="<j-tr>([\\s\\S]*?)<\\/j-tr>",Lx="<j-t[hd]>([\\s\\S]*?)<\\/j-t[hd]>",Hx=/<j-thead>\n?([\s\S]*?)<\/j-thead>/,Ia=l=>new RegExp(l,"g");function Ka(l){return l.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}function qx(l){const r=[],s=Ia(Ux);let i=0,u;for(;(u=s.exec(l))!==null;)u.index>i&&r.push({t:"",text:Ka(l.slice(i,u.index))}),r.push({t:u[1]??"",text:Ka(u[2]??"")}),i=u.index+u[0].length;return i<l.length&&r.push({t:"",text:Ka(l.slice(i))}),r}function Bx(l){const r=[],s=Ia(zx);let i,u=!1;for(;(i=s.exec(l))!==null;)u=!0,r.push({n:i[1]?Number(i[1]):null,tokens:qx(i[2]??"")});if(!u)for(const d of l.replace(/\n$/,"").split(`
|
|
22
|
+
`))r.push({n:null,tokens:[{t:"",text:Ka(d)}]});return r}function gp(l){const r=[],s=Ia(Lx);let i;for(;(i=s.exec(l))!==null;)r.push(Ka((i[1]??"").trim()));return r}function Gx(l){let r=[],s=l;const i=Hx.exec(l);if(i){const h=i[1]??"",y=Ia(hp).exec(h);r=gp(y?y[1]??"":h),s=l.slice(i.index+i[0].length)}const u=[],d=Ia(hp);let p;for(;(p=d.exec(s))!==null;)u.push(gp(p[1]??""));return{head:r,rows:u}}function Yx(l){const r=[],s=Ia(Dx);let i=0,u;for(;(u=s.exec(l))!==null;)u.index>i&&r.push({kind:"text",text:l.slice(i,u.index)}),u[3]!==void 0?r.push({kind:"table",...Gx(u[3])}):r.push({kind:"code",language:Ka(u[1]??""),lines:Bx(u[2]??"")}),i=u.index+u[0].length;return i<l.length&&r.push({kind:"text",text:l.slice(i)}),r}const Qx="(`+)([\\s\\S]*?[^`])\\1(?!`)|\\*\\*([^*]+)\\*\\*|(?<!\\w)__([^_]+)__(?!\\w)|\\*([^*\\s][^*]*?)\\*|(?<!\\w)_([^_\\s][^_]*?)_(?!\\w)|\\[([^\\]]+)\\]\\((https?:\\/\\/[^\\s)]+)\\)";function na(l){const r=[],s=new RegExp(Qx,"g");let i=0,u;for(;(u=s.exec(l))!==null;)u.index>i&&r.push({kind:"text",text:l.slice(i,u.index)}),u[2]!==void 0?r.push({kind:"code",text:u[2]}):u[3]!==void 0||u[4]!==void 0?r.push({kind:"strong",children:na(u[3]??u[4]??"")}):u[5]!==void 0||u[6]!==void 0?r.push({kind:"em",children:na(u[5]??u[6]??"")}):u[7]!==void 0&&u[8]!==void 0&&r.push({kind:"link",href:u[8],children:na(u[7])}),i=u.index+u[0].length;return i<l.length&&r.push({kind:"text",text:l.slice(i)}),r}function Vx(l){const r=[],s=l.replace(/\r\n?/g,`
|
|
23
|
+
`).split(`
|
|
24
|
+
`);let i=0;const u=[],d=()=>{u.length&&(r.push({kind:"paragraph",children:na(u.join(`
|
|
25
|
+
`))}),u.length=0)};for(;i<s.length;){const p=s[i];if(/^\s*$/.test(p)){d(),i++;continue}if(/^```/.test(p)){d();const g=[];for(i++;i<s.length&&!/^```/.test(s[i]);)g.push(s[i]),i++;i++,r.push({kind:"pre",text:g.join(`
|
|
26
|
+
`)});continue}const h=/^(#{1,6})\s+(.*)$/.exec(p);if(h){d(),r.push({kind:"heading",level:h[1].length,children:na(h[2])}),i++;continue}if(/^\s*([-*_])(\s*\1){2,}\s*$/.test(p)){d(),r.push({kind:"rule"}),i++;continue}if(/^\s*>\s?/.test(p)){d();const g=[];for(;i<s.length&&/^\s*>\s?/.test(s[i]);)g.push(s[i].replace(/^\s*>\s?/,"")),i++;r.push({kind:"quote",children:na(g.join(`
|
|
27
|
+
`))});continue}const y=/^\s*([-*+]|\d+[.)])\s+(.*)$/.exec(p);if(y){d();const g=/\d/.test(y[1]),b=[];for(;i<s.length;){const x=/^\s*([-*+]|\d+[.)])\s+(.*)$/.exec(s[i]);if(!x)break;let w=x[2];for(i++;i<s.length&&/^\s{2,}\S/.test(s[i])&&!/^\s*([-*+]|\d+[.)])\s+/.test(s[i]);)w+=`
|
|
28
|
+
`+s[i].trim(),i++;b.push(na(w))}r.push({kind:"list",ordered:g,items:b});continue}u.push(p),i++}return d(),r}const Xx={nf:"function",fm:"function",nc:"class",nn:"class",ne:"class",nt:"tag",nb:"builtin",bp:"builtin",no:"builtin",kc:"keyword",kt:"class",nd:"decorator",na:"attribute",nv:"name",vc:"name",vg:"name",vi:"name",vm:"name",gd:"deleted",gi:"inserted",gh:"heading",gu:"heading",gp:"prompt",gr:"error",gt:"error",err:"error",w:"text","":"text"};function $x(l){const r=Xx[l];if(r)return r;switch(l[0]){case"k":return"keyword";case"n":return"name";case"s":return"string";case"l":return"string";case"m":return"number";case"i":return"number";case"o":return"operator";case"p":return"punctuation";case"c":return"comment";case"g":return"text";default:return"text"}}function Kx(l){return`tok tok-${$x(l)}`}function aa({nodes:l}){return f.jsx(f.Fragment,{children:l.map((r,s)=>{switch(r.kind){case"text":return f.jsx("span",{children:r.text},s);case"code":return f.jsx("code",{className:"inline",children:r.text},s);case"strong":return f.jsx("strong",{children:f.jsx(aa,{nodes:r.children})},s);case"em":return f.jsx("em",{children:f.jsx(aa,{nodes:r.children})},s);case"link":return f.jsx("a",{href:r.href,target:"_blank",rel:"noreferrer noopener",children:f.jsx(aa,{nodes:r.children})},s)}})})}function Ix({blocks:l}){return f.jsx(f.Fragment,{children:l.map((r,s)=>{switch(r.kind){case"paragraph":return f.jsx("p",{className:"whitespace-pre-wrap break-words",children:f.jsx(aa,{nodes:r.children})},s);case"heading":{const i=`h${Math.min(4,r.level)}`;return f.jsx(i,{children:f.jsx(aa,{nodes:r.children})},s)}case"list":{const i=r.ordered?"ol":"ul";return f.jsx(i,{children:r.items.map((u,d)=>f.jsx("li",{className:"whitespace-pre-wrap",children:f.jsx(aa,{nodes:u})},d))},s)}case"quote":return f.jsx("blockquote",{className:"whitespace-pre-wrap",children:f.jsx(aa,{nodes:r.children})},s);case"rule":return f.jsx("hr",{},s);case"pre":return f.jsx("pre",{className:"code-block plate plate-ground p-2.5 my-1.5 overflow-x-auto whitespace-pre",children:r.text},s)}})})}function Zx({lines:l}){const r=l.some(s=>s.n!==null);return f.jsx("pre",{className:"code-block overflow-x-auto whitespace-pre p-2",children:l.map((s,i)=>f.jsxs("div",{children:[r&&f.jsx("span",{className:"ln",children:s.n??""}),s.tokens.map((u,d)=>u.t?f.jsx("span",{className:Kx(u.t),children:u.text},d):f.jsx("span",{children:u.text},d)),s.tokens.length===0&&" "]},i))})}function Jx({language:l,lines:r}){const s=r.map(i=>i.tokens.map(u=>u.text).join("")).join(`
|
|
29
|
+
`);return f.jsxs(Nt,{ground:!0,corners:"two",className:"my-2",children:[f.jsxs("div",{className:"flex items-center justify-between px-2.5 py-1 border-b hairline",children:[f.jsx("span",{className:"kicker kicker-muted",children:l||"text"}),f.jsx("button",{type:"button",className:"chrome-sm font-heading uppercase tracking-[0.1em] text-text-muted hover:text-steel",onClick:()=>navigator.clipboard?.writeText(s).catch(()=>{}),title:"Copy code",children:"copy"})]}),f.jsx(Zx,{lines:r})]})}function Wx({head:l,rows:r}){return f.jsx("div",{className:"overflow-x-auto",children:f.jsxs("table",{className:"j-table",children:[l.length>0&&f.jsx("thead",{children:f.jsx("tr",{children:l.map((s,i)=>f.jsx("th",{children:s},i))})}),f.jsx("tbody",{children:r.map((s,i)=>f.jsx("tr",{children:s.map((u,d)=>f.jsx("td",{children:u},d))},i))})]})})}function Fx({seg:l}){return l.kind==="code"?f.jsx(Jx,{language:l.language,lines:l.lines}):l.kind==="table"?f.jsx(Wx,{head:l.head,rows:l.rows}):f.jsx(Ix,{blocks:Vx(l.text)})}const ah=q.memo(function({text:r}){const s=q.useMemo(()=>Yx(r),[r]);return f.jsx("div",{className:"prose-j",children:s.map((i,u)=>f.jsx(Fx,{seg:i},u))})});function Px({lines:l}){return f.jsx("pre",{className:"code-block whitespace-pre overflow-x-auto p-2",children:l.map((r,s)=>{let i="";return r.startsWith("+++")||r.startsWith("---")?i="diff-meta":r.startsWith("@@")?i="diff-hunk":r.startsWith("+")?i="diff-add":r.startsWith("-")&&(i="diff-del"),f.jsx("div",{className:i,children:r||" "},s)})})}function e0(l){const[r,...s]=l.split(";").map(u=>u.trim());if(r!=="audio/pcm"&&r!=="audio/l16"&&r!=="audio/L16")return null;const i={};for(const u of s){const[d,p]=u.split("=");d&&p&&(i[d.toLowerCase()]=p)}return{rate:Number(i.rate??24e3),bits:Number(i.bits??16),channels:Number(i.channels??1)}}function t0(l){const r=atob(l),s=new Uint8Array(r.length);for(let i=0;i<r.length;i++)s[i]=r.charCodeAt(i);return s}class n0{ctx=null;nextAt=0;played=0;feed(r,s,i){for(;this.played<r.length;this.played++){const u=r[this.played],d=t0(u.dataB64),p=new Int16Array(d.buffer,d.byteOffset,Math.floor(d.byteLength/2));if(!p.length)continue;this.ctx??=new AudioContext({sampleRate:s});const h=Math.floor(p.length/i),y=this.ctx.createBuffer(i,h,s);for(let x=0;x<i;x++){const w=y.getChannelData(x);for(let j=0;j<h;j++)w[j]=p[j*i+x]/32768}const g=this.ctx.createBufferSource();g.buffer=y,g.connect(this.ctx.destination);const b=Math.max(this.ctx.currentTime+.02,this.nextAt);g.start(b),this.nextAt=b+y.duration}}close(){this.ctx?.close().catch(()=>{}),this.ctx=null}}function a0({items:l,mime:r}){const s=q.useRef(null),i=q.useMemo(()=>e0(r),[r]);q.useEffect(()=>{i&&(s.current??=new n0,s.current.feed(l,i.rate,i.channels))},[l,i]),q.useEffect(()=>()=>s.current?.close(),[]);const u=i?l.reduce((d,p)=>d+p.dataB64.length*3/4,0)/(i.rate*2*i.channels):0;return f.jsxs("div",{className:"text-xs text-text-muted font-mono",children:["🔊 pcm ",i?.rate??"?"," Hz · ",u.toFixed(1),"s",l.at(-1)?.final?"":" · streaming"]})}function l0({items:l}){if(!l.length)return null;const r=new Map;for(const s of l){const i=s.streamId??`${s.mimeType}#single`,u=r.get(i)??[];u.push(s),r.set(i,u)}return f.jsx("div",{className:"flex flex-col gap-2 p-2",children:[...r.entries()].map(([s,i])=>{const u=i[0].mimeType,d=u.split(";")[0].trim().toLowerCase();if(d.startsWith("image/")){const p=i.map(h=>h.dataB64).join("");return f.jsx("img",{alt:"tool output",className:"max-h-96 rounded-md border hairline",src:`data:${d};base64,${p}`},s)}if(d==="audio/pcm"||d==="audio/l16")return f.jsx(a0,{items:i,mime:u},s);if(d.startsWith("audio/")){const p=i.map(h=>h.dataB64).join("");return f.jsx("audio",{controls:!0,preload:"auto",src:`data:${d};base64,${p}`},s)}if(d==="application/pdf"){const p=i.map(h=>h.dataB64).join("");return f.jsx("a",{className:"text-primary underline text-xs",href:`data:${d};base64,${p}`,target:"_blank",rel:"noreferrer",children:"Open PDF attachment"},s)}return f.jsxs("div",{className:"text-xs text-text-muted",children:["[",u,": ",i.length," chunk(s), not renderable here]"]},s)})})}function s0(l,r=110){const s=[];for(const[u,d]of Object.entries(l)){let p;if(typeof d=="string")p=d;else{if(d==null)continue;p=JSON.stringify(d)}p=p.replace(/\s+/g," "),s.push(`${u}=${p.length>60?p.slice(0,57)+"…":p}`)}const i=s.join(" ");return i.length>r?i.slice(0,r-1)+"…":i}function i0({status:l}){return l==="running"?f.jsx("span",{className:"text-primary pulse","aria-label":"running",children:"●"}):l==="success"?f.jsx("span",{className:"text-success","aria-label":"succeeded",children:"✓"}):f.jsx("span",{className:"text-error","aria-label":"failed",children:"✗"})}const r0=q.memo(function({block:r}){const s=M(p=>p.toggleTool),i=M(p=>p.setPopup),u=r.output.length>0||r.media.length>0||!!r.errorMessage,d=r.status==="running";return f.jsxs("div",{"data-testid":"tool-block",className:"border-t hairline",children:[f.jsxs("button",{type:"button",onClick:()=>s(r.agentId,r.id),className:`w-full flex items-center gap-3 py-1.5 pr-1 text-left ${d?"bg-steel/8":"hover:bg-tint/70"}`,"aria-expanded":r.expanded,children:[f.jsx("span",{className:"w-3 shrink-0 text-center",children:f.jsx(i0,{status:r.status})}),f.jsx("span",{className:`chrome w-[120px] shrink-0 truncate ${r.status==="error"?"text-error":""}`,children:r.toolName}),f.jsx("span",{className:"font-mono text-xs text-text-muted truncate flex-1",children:s0(r.args)}),r.backgrounded&&f.jsx("span",{className:"kicker kicker-muted text-[10px]",children:"bg"}),d&&r.output?f.jsx("span",{role:"button",tabIndex:0,className:"chrome-sm font-heading font-medium uppercase tracking-[0.08em] text-steel w-[52px] text-right",onClick:p=>{p.stopPropagation(),i(r.callId)},onKeyDown:p=>{p.key==="Enter"&&(p.stopPropagation(),i(r.callId))},title:"Follow live output",children:"Follow"}):typeof r.durationSeconds=="number"?f.jsxs("span",{className:"font-mono text-[11px] text-text-muted w-[52px] text-right",children:[r.durationSeconds.toFixed(r.durationSeconds<10?2:1),"s"]}):f.jsx("span",{className:"w-[52px]"})]}),r.expanded&&u&&f.jsxs(Nt,{ground:!0,corners:"two",edge:r.status==="error"?"error":"hairline",className:"ml-6 mt-0.5 mb-2.5",children:[r.errorMessage&&f.jsx("div",{className:"px-3 py-1.5 text-error text-xs whitespace-pre-wrap",children:r.errorMessage}),r.output&&(r.output.includes("<j-")?f.jsx("div",{className:"px-3 py-1.5 text-[13px]",children:f.jsx(ah,{text:r.output})}):f.jsx("pre",{className:"code-block whitespace-pre-wrap break-words px-3 py-2 max-h-[60vh] overflow-auto",children:r.output})),f.jsx(l0,{items:r.media})]})]})}),o0=q.memo(function({block:r}){const s=r.source==="model";return f.jsxs("div",{className:`py-1.5 ${s?"":"text-[13px]"}`,children:[!s&&r.source!=="system"&&f.jsx("div",{className:"kicker kicker-muted text-[10px]",children:r.source}),f.jsx("div",{className:s?"":"text-text-muted",children:f.jsx(ah,{text:r.text})})]})}),c0=q.memo(function({block:r,turn:s}){return f.jsxs("div",{className:"my-2.5 flex items-start gap-3",children:[f.jsx("span",{className:"font-mono text-[10px] text-steel w-9 shrink-0 pt-2.5 select-none","aria-hidden":"true",children:s?`T${s}`:""}),f.jsx("span",{className:"flex-1"}),f.jsx("div",{className:"max-w-[76%] tint border-l-2 border-steel px-3 py-2 whitespace-pre-wrap break-words text-[15px]",children:r.text})]})}),_p={error:"text-error",warning:"text-warning",success:"text-success",hint:"text-text-muted italic",help:"text-text-muted font-mono text-xs whitespace-pre",info:"text-text-muted"},u0=q.memo(function({block:r}){const s=_p[r.style]??_p[r.style.split("_")[0]??""]??"text-text-muted";return f.jsx("div",{className:`py-0.5 text-[13px] whitespace-pre-wrap ${s}`,children:r.text})});function f0({block:l,turn:r}){switch(l.kind){case"text":return f.jsx(o0,{block:l});case"user":return f.jsx(c0,{block:l,turn:r});case"system":return f.jsx(u0,{block:l});case"tool":return f.jsx(r0,{block:l})}}function d0({agentId:l}){const r=M(Oy(l)),s=q.useRef(null),[i,u]=q.useState(!0),d=q.useMemo(()=>{const w=new Map;let j=0;for(const B of r)B.kind==="user"&&w.set(B.id,++j);return w},[r]),p=Mx({count:r.length,getScrollElement:()=>s.current,estimateSize:()=>64,overscan:8,getItemKey:w=>r[w]?.id??w}),h=q.useRef(0),y=q.useRef(null),g=r[r.length-1],b=g?`${g.id}:${g.kind==="text"?g.text.length:g.kind==="tool"?g.output.length+(g.expanded?1:0):0}`:null;q.useLayoutEffect(()=>{if(i&&(r.length!==h.current||b!==y.current)){h.current=r.length,y.current=b;const w=s.current;w&&requestAnimationFrame(()=>{w.scrollTop=w.scrollHeight})}},[r.length,b,i]),q.useEffect(()=>{const w=s.current;if(!w)return;const j=()=>{const B=w.scrollHeight-w.scrollTop-w.clientHeight<24;u(B)};return w.addEventListener("scroll",j,{passive:!0}),()=>w.removeEventListener("scroll",j)},[]),q.useEffect(()=>{const w=j=>{const B=j.target,z=B&&(B.tagName==="TEXTAREA"||B.tagName==="INPUT");if(z&&j.key!=="End"&&j.key!=="Home")return;const Y=s.current;Y&&(j.key==="End"&&(j.ctrlKey||!z)&&(Y.scrollTop=Y.scrollHeight,u(!0)),j.key==="Home"&&(j.ctrlKey||!z)&&(Y.scrollTop=0,u(!1)),!z&&j.key==="PageDown"&&(Y.scrollTop+=Y.clientHeight*.9),!z&&j.key==="PageUp"&&(Y.scrollTop-=Y.clientHeight*.9))};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[]);const x=p.getVirtualItems();return f.jsxs("div",{ref:s,className:"relative flex-1 overflow-y-auto px-5 py-3","data-testid":"output-pane",children:[r.length===0&&f.jsx("div",{className:"h-full flex items-center justify-center text-text-muted text-sm select-none",children:f.jsxs("div",{className:"text-center max-w-[52ch] space-y-2",children:[f.jsx("div",{className:"display text-[34px] text-text",children:"jaato"}),f.jsxs("div",{children:["Type a message, or a command such as ",f.jsx("kbd",{children:"help"}),", ",f.jsx("kbd",{children:"tools"}),", ",f.jsx("kbd",{children:"model"}),"."]}),f.jsxs("div",{children:["Commands are plain words — the composer proposes them as you type; ",f.jsx("kbd",{children:"Esc"})," dismisses the proposal to send the word verbatim."]})]})}),f.jsx("div",{style:{height:p.getTotalSize(),position:"relative",width:"100%"},children:x.map(w=>{const j=r[w.index];return f.jsx("div",{"data-index":w.index,ref:p.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${w.start}px)`},children:f.jsx(f0,{block:j,turn:d.get(j.id)})},w.key)})}),!i&&r.length>0&&f.jsx("button",{type:"button",className:"sticky bottom-3 left-1/2 -translate-x-1/2 btn btn-sm bg-surface text-text-muted shadow-md",onClick:()=>{const w=s.current;w&&(w.scrollTop=w.scrollHeight),u(!0)},children:"↓ follow output"})]})}function m0({agentId:l}){const r=M(h=>h.blocks[l]),s=M(h=>h.ui.popupCallId),i=M(h=>h.setPopup),u=q.useMemo(()=>(r??[]).filter(h=>h.kind==="tool"&&h.status==="running"&&h.output.length>0),[r]),d=u.find(h=>h.callId===s)??null,p=q.useRef(null);return q.useEffect(()=>{const h=p.current;h&&(h.scrollTop=h.scrollHeight)},[d?.output.length]),q.useEffect(()=>{const h=y=>{if(y.ctrlKey&&y.key.toLowerCase()==="o"&&u.length){y.preventDefault();const g=u.findIndex(b=>b.callId===s);i(u[(g+1)%u.length].callId)}};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[u,s,i]),d?f.jsxs(Nt,{ground:!0,edge:"steel",className:"absolute right-5 bottom-[104px] w-[min(560px,70%)] max-h-[45vh] flex flex-col shadow-lg z-20",role:"dialog","aria-label":"Live tool output",children:[f.jsxs("div",{className:"flex items-center gap-2.5 px-2.5 py-1.5 border-b hairline",children:[u.map(h=>f.jsxs("button",{type:"button",onClick:()=>i(h.callId),className:`kicker tracking-[0.12em] text-[12px] ${h.callId===d.callId?"":"kicker-muted hover:text-text"}`,children:[h.callId===d.callId?"Live · ":"",h.toolName]},h.callId)),f.jsx("span",{className:"flex-1"}),f.jsx("span",{className:"font-mono text-[10px] text-text-muted hidden md:inline",children:"Ctrl+O next"}),f.jsx("button",{type:"button",className:"text-text-muted hover:text-text",onClick:()=>i(null),"aria-label":"Close",children:"✕"})]}),f.jsx("pre",{ref:p,className:"code-block whitespace-pre-wrap break-words px-3 py-2.5 overflow-auto flex-1",children:d.output})]}):null}const ta=new Map;let ac=Promise.resolve(),p0=0;function h0(){return Wl()&&hc(M.getState())}function hc(l){return!!(l.sessionId||l.workspace.selected)}M.subscribe((l,r)=>{hc(l)&&!hc(r)&&Wl()&&l.uploads.some(s=>s.status==="queued")&&Ni().catch(()=>{})});function wi(l,r){if(!l.length)return;const s=M.getState(),i=$b(l.map(d=>d.size)),u=l.map((d,p)=>{const h=`up-${++p0}`,y=d.webkitRelativePath??"",g=Vb(d.name,y,r),b=g===null?"name must be a non-empty workspace-relative path with no '..' components":i[p].reason;return b?{id:h,path:g??d.name,size:d.size,status:"failed",error:b}:(ta.set(h,d),{id:h,path:g,size:d.size,status:"queued"})});s.addUploads(u),h0()&&Ni().catch(()=>{})}function g0(l){ta.delete(l),M.getState().removeUpload(l)}function Ni(){return ac=ac.then(()=>lh()).catch(()=>{}),ac}async function lh(l=!1){const r=M.getState(),s=r.uploads.filter(p=>p.status==="queued"&&ta.has(p.id));if(!s.length)return;for(const p of s)r.updateUpload(p.id,{status:"staging"});const i=r.selectedAgentId||Vt,u=[],d=[];for(const p of s){const h=ta.get(p.id);try{u.push({name:p.path,data:await h.arrayBuffer(),contentType:h.type||void 0}),d.push(p)}catch(y){ta.delete(p.id),r.updateUpload(p.id,{status:"failed",error:`could not read the file: ${y instanceof Error?y.message:String(y)}`})}}if(d.length)try{const p=await Re().stageFiles("",u);if(!l&&r.workspace.selected&&(p.failed??[]).some(x=>x.category==="workspace_not_found")){for(const x of d)r.updateUpload(x.id,{status:"queued"});return await Vp(),lh(!0)}const h=new Set(p.staged??[]),y=new Map((p.failed??[]).map(x=>[x.name,x.error||x.category||"failed"])),g=[],b=[];for(const x of d)if(ta.delete(x.id),h.has(x.path))r.updateUpload(x.id,{status:"staged"}),g.push(x.path);else{const w=y.get(x.path)??"the daemon did not report this file";r.updateUpload(x.id,{status:"failed",error:w}),b.push(`${x.path}: ${w}`)}g.length&&r.addSystemBlock(i,`Staged into the workspace: ${g.join(", ")}`,"info"),b.length&&r.addSystemBlock(i,`Not staged:
|
|
30
|
+
${b.join(`
|
|
31
|
+
`)}`,"error")}catch(p){const h=p instanceof Error?p.message:String(p);for(const y of d)ta.delete(y.id),r.updateUpload(y.id,{status:"failed",error:h});r.addSystemBlock(i,`Staging failed: ${h}`,"error")}}function _0(l=6e4){return new Promise(r=>{let s=()=>{};const i=setTimeout(()=>{s(),r(!1)},l);s=Re().subscribe(G.SESSION_INFO,()=>{clearTimeout(i),s(),r(!0)})})}async function yp(l){const r=M.getState();if(!r.uploads.some(u=>u.status==="queued"))return l();if(r.workspace.selected)return await Ni(),l();const i=_0();await l(),await i&&await Ni()}const bp={queued:{text:"○",cls:"text-text-muted"},staging:{text:"●",cls:"text-primary pulse"},staged:{text:"✓",cls:"text-success"},failed:{text:"✗",cls:"text-error"}};function sh({hint:l,always:r}){const s=M(p=>p.uploads),[i,u]=q.useState(""),d=q.useRef(null);return!r&&s.length===0?f.jsx("input",{ref:d,type:"file",multiple:!0,className:"hidden","aria-label":"Attach files","data-attach-input":!0,onChange:p=>{wi(Array.from(p.target.files??[]),i),p.target.value=""}}):f.jsxs("div",{className:"plate plate-ground mb-2 text-[13px]",role:"group","aria-label":"Attached files",children:[f.jsx("input",{ref:d,type:"file",multiple:!0,className:"hidden","aria-label":"Attach files","data-attach-input":!0,onChange:p=>{wi(Array.from(p.target.files??[]),i),p.target.value=""}}),f.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 px-3 py-2 border-b hairline",children:[f.jsx("button",{type:"button",onClick:()=>d.current?.click(),className:"btn btn-sm btn-steel",children:"Attach files"}),f.jsxs("label",{className:"flex items-center gap-2 text-text-muted",children:[f.jsx("span",{className:"kicker kicker-muted",children:"into"}),f.jsx("input",{value:i,onChange:p=>u(p.target.value),placeholder:"workspace root","aria-label":"Folder for the next files",className:"input input-mono text-[12px] py-0.5 w-40"})]}),f.jsx("span",{className:"text-[12px] text-text-muted",children:l})]}),s.length>0&&f.jsx("ul",{className:"flex flex-wrap gap-1.5 px-3 py-2","aria-label":"Attachments",children:s.map(p=>f.jsxs("li",{"data-status":p.status,title:p.error??p.path,className:`flex items-center gap-1.5 border hairline px-2 py-0.5 font-mono text-[12px] ${p.status==="failed"?"border-error":""}`,children:[f.jsx("span",{className:bp[p.status].cls,"aria-label":p.status,children:bp[p.status].text}),f.jsx("span",{className:"max-w-[18rem] truncate",children:p.path}),f.jsx("span",{className:"text-text-muted",children:Xb(p.size)}),p.status==="failed"&&f.jsx("span",{className:"text-error truncate max-w-[16rem]",children:p.error}),f.jsx("button",{type:"button",onClick:()=>g0(p.id),"aria-label":`Remove ${p.path}`,className:"text-text-muted hover:text-error px-0.5",children:"×"})]},p.id))})]})}function lc(l){if(!l)return[];const r=[];for(const s of Array.from(l.items??[])){if(s.kind!=="file")continue;const i=s.getAsFile();i&&r.push(i)}return!r.length&&l.files?.length&&r.push(...Array.from(l.files)),r}function sc(l){return(l.trimStart().split(/\s+/)[0]??"").toLowerCase()}function y0({commands:l,disabled:r,captureMode:s,history:i,onSubmit:u,onEscapeEmpty:d}){const[p,h]=q.useState(""),[y,g]=q.useState(!1),[b,x]=q.useState(!1),[w,j]=q.useState(0),[B,z]=q.useState(null),[Y,V]=q.useState(0),[ee,te]=q.useState(!1),K=q.useRef(null),W=q.useRef(""),de=p.slice(0,Y),Z=M(Q=>Q.sessions),U=q.useMemo(()=>{if(s||y||b)return[];if(!p.trim()&&!de.length)return[];const Q=gy(de,Z);return Q!==null?Q.slice(0,12):cy(de,l).slice(0,12)},[de,p,l,Z,s,y,b]),se=q.useRef(!1);q.useEffect(()=>{if(!s){if(!_y(de)){se.current=!1;return}se.current||(se.current=!0,Sc().catch(()=>{}))}},[de,s]);const fe=U.length>0;q.useEffect(()=>{j(0)},[U.length,de]),q.useEffect(()=>{const Q=sc(p);if(!p.trim()){g(!1),x(!1),W.current="";return}(y||b)&&Q!==W.current&&(g(!1),x(!1))},[p,y,b]);const ie=!s&&!y?Xm(p,l):null,X=!s&&y?Xm(p,l):null,Te=q.useCallback(()=>{const Q=K.current;Q&&(Q.style.height="0px",Q.style.height=Math.min(Q.scrollHeight,240)+"px")},[]);q.useEffect(Te,[p,Te]);const ze=q.useRef(null);q.useLayoutEffect(()=>{const Q=ze.current;Q!==null&&(ze.current=null,K.current?.setSelectionRange(Q,Q),V(Q))},[p]);const Ce=Q=>{const S=p.slice(Y).replace(/^\S*/,""),L=Q.insert+" "+S.replace(/^\s+/,"");ze.current=Q.insert.length+1,h(L)},R=()=>{const Q=p.replace(/\s+$/,"");!Q&&!s||(u(Q,y),h(""),g(!1),x(!1),z(null))},$=Q=>{if(Q.key==="Tab"&&!s){if(Q.preventDefault(),fe){Q.shiftKey?j(S=>(S-1+U.length)%U.length):(U.length===1||w>=0)&&Ce(U[w]??U[0]);return}g(!1),x(!1),W.current="";return}if(fe&&(Q.key==="ArrowDown"||Q.key==="ArrowUp")){Q.preventDefault(),j(S=>Q.key==="ArrowDown"?(S+1)%U.length:(S-1+U.length)%U.length);return}if(Q.key==="Escape"){if(fe){Q.preventDefault(),g(!0),x(!0),W.current=sc(p);return}if(!p){d?.();return}if(ie){Q.preventDefault(),g(!0),x(!0),W.current=sc(p);return}return}if(Q.key==="Enter"&&!Q.shiftKey&&!Q.altKey&&!Q.ctrlKey&&!Q.metaKey&&!Q.nativeEvent.isComposing){Q.preventDefault(),R();return}if(Q.key==="ArrowUp"&&!fe&&i.length&&(p===""||B!==null)&&le()){Q.preventDefault();const S=B===null?i.length-1:Math.max(0,B-1);z(S),h(i[S]??"");return}if(Q.key==="ArrowDown"&&!fe&&B!==null){Q.preventDefault();const S=B+1;S>=i.length?(z(null),h("")):(z(S),h(i[S]??""))}},le=()=>{const Q=K.current;return Q?!Q.value.slice(0,Q.selectionStart).includes(`
|
|
32
|
+
`):!0},Se=s?s.placeholder:"Message the agent — or type a command (help, tools, model …)";return f.jsxs("div",{className:"relative",children:[fe&&f.jsxs("div",{role:"listbox","aria-label":"Command proposals",className:"plate plate-ground absolute bottom-full mb-1.5 left-0 w-[min(34rem,100%)] shadow-md text-[13px] z-30",children:[U.map((Q,S)=>f.jsxs("div",{role:"option","aria-selected":S===w,onMouseDown:L=>{L.preventDefault(),Ce(Q)},className:`flex items-baseline gap-3 px-2.5 py-1 cursor-pointer ${S===w?"bg-surface text-steel":"hover:bg-tint"}`,children:[f.jsx("span",{className:"font-mono",children:Q.label}),Q.description&&f.jsx("span",{className:"text-text-muted text-xs truncate",children:Q.description})]},Q.insert)),f.jsxs("div",{className:"px-2.5 py-1 text-[11px] text-text-muted border-t hairline flex gap-3",children:[f.jsxs("span",{children:[f.jsx("kbd",{children:"Tab"})," complete"]}),f.jsxs("span",{children:[f.jsx("kbd",{children:"Enter"})," run"]}),f.jsxs("span",{children:[f.jsx("kbd",{children:"Esc"})," not a command — send as text"]})]})]}),f.jsx(sh,{hint:"Staged into the session's workspace now; the next message names them."}),f.jsxs("div",{className:`flex items-end gap-2.5 border px-3 py-2 bg-surface ${s?"border-warning":"border-steel"} ${ee?"bg-tint outline outline-1 outline-steel":""}`,onDragOver:Q=>{(lc(Q.dataTransfer).length||Q.dataTransfer.types.includes("Files"))&&(Q.preventDefault(),te(!0))},onDragLeave:()=>te(!1),onDrop:Q=>{const S=lc(Q.dataTransfer);te(!1),S.length&&(Q.preventDefault(),wi(S,""))},onPaste:Q=>{const S=lc(Q.clipboardData);S.length&&(Q.preventDefault(),wi(S,""))},children:[f.jsx("span",{className:`font-mono select-none pb-[3px] ${s?"text-warning":"text-steel"}`,children:s?"?":"›"}),f.jsx("textarea",{ref:K,value:p,rows:1,disabled:r,placeholder:Se,"aria-label":"Prompt",spellCheck:!ie,onChange:Q=>{h(Q.target.value),V(Q.target.selectionStart??Q.target.value.length)},onSelect:Q=>V(Q.target.selectionStart??0),onKeyDown:$,className:"flex-1 resize-none bg-transparent outline-none font-mono text-[13.5px] leading-5 placeholder:text-text-muted max-h-60"}),f.jsx("button",{type:"button",onClick:()=>document.querySelector("[data-attach-input]")?.click(),disabled:r,className:"chrome-sm font-heading font-medium uppercase tracking-[0.08em] pb-[3px] text-text-muted hover:text-steel disabled:opacity-40","aria-label":"Attach",title:"Attach files to the workspace (or drop / paste them here)",children:"Attach"}),f.jsxs("button",{type:"button",onClick:R,disabled:r||!p.trim()&&!s,className:`chrome-sm font-heading font-medium uppercase tracking-[0.08em] pb-[3px] disabled:opacity-40 ${s?"text-warning":"text-steel"}`,"aria-label":"Send",children:[s?"Answer":"Send"," ⏎"]})]}),f.jsx("div",{className:`mt-1.5 pl-2.5 border-l-2 text-[13px] text-text-muted flex items-center gap-3 min-h-5 ${s?"border-warning":"border-steel"}`,children:s&&s.suggestions?.length?f.jsxs("span",{children:["A key answers the prompt — ",s.suggestions.map(Q=>f.jsx("kbd",{className:"mx-0.5",children:Q},Q))," · anything longer is sent to the agent as a reply"]}):s?f.jsx("span",{children:"Enter sends your answer"}):ie?f.jsxs("span",{children:["Enter runs command ",f.jsx("span",{className:"font-mono text-steel",children:ie})," · Esc to send as text instead"]}):X?f.jsxs("span",{children:["Sending as text (not the ",f.jsx("span",{className:"font-mono",children:X})," command) · Tab to make it a command"]}):f.jsx("span",{children:"Enter sends a message · a first word that names a command runs it · Esc sends it verbatim · Shift+Enter for a newline · drop or paste files to stage them"})})]})}const xp=l=>Symbol.iterator in l,vp=l=>"entries"in l,Sp=(l,r)=>{const s=l instanceof Map?l:new Map(l.entries()),i=r instanceof Map?r:new Map(r.entries());if(s.size!==i.size)return!1;for(const[u,d]of s)if(!i.has(u)||!Object.is(d,i.get(u)))return!1;return!0},b0=(l,r)=>{const s=l[Symbol.iterator](),i=r[Symbol.iterator]();let u=s.next(),d=i.next();for(;!u.done&&!d.done;){if(!Object.is(u.value,d.value))return!1;u=s.next(),d=i.next()}return!!u.done&&!!d.done};function x0(l,r){return Object.is(l,r)?!0:typeof l!="object"||l===null||typeof r!="object"||r===null||Object.getPrototypeOf(l)!==Object.getPrototypeOf(r)?!1:xp(l)&&xp(r)?vp(l)&&vp(r)?Sp(l,r):b0(l,r):Sp({entries:()=>Object.entries(l)},{entries:()=>Object.entries(r)})}function ih(l){const r=Kl.useRef(void 0);return s=>{const i=l(s);return x0(r.current,i)?r.current:r.current=i}}function v0(l){const r=Math.max(0,Math.floor(l/1e3));if(r<60)return`${r}s`;const s=Math.floor(r/60),i=r%60;return`${s}:${String(i).padStart(2,"0")}`}function S0(l){const[r,s]=q.useState(()=>Date.now());return q.useEffect(()=>{if(!l)return;const i=window.setInterval(()=>s(Date.now()),1e3);return()=>window.clearInterval(i)},[l]),r}const E0={idle:["○","text-text-muted"],sending:["●","text-text-muted pulse"],thinking:["●","text-primary pulse"],tool:["▸","text-steel pulse"],waiting:["⚠","text-warning"]};function w0({agentId:l}){const r=M(ih(p=>yc(p,l))),s=S0(r.kind==="thinking"||r.kind==="tool"||r.kind==="waiting");if(r.kind==="idle")return null;const[i,u]=E0[r.kind],d=r.kind==="sending"?null:v0(s-r.since);return f.jsxs("div",{role:"status","aria-live":"polite",className:"kicker kicker-muted text-[12px] tracking-[0.1em] mb-1.5 flex items-center gap-2",children:[f.jsx("span",{className:u,children:i}),f.jsx("span",{children:Up(r)}),d&&f.jsx("span",{className:"font-mono normal-case tracking-normal text-text-muted",children:d}),f.jsx("span",{className:"text-divider",children:"·"}),r.kind==="waiting"?f.jsx("span",{children:"answer above to continue"}):f.jsxs("span",{children:["type to queue a follow-up · ",f.jsx("span",{className:"font-mono normal-case tracking-normal",children:"stop"})," or Ctrl+C to interrupt"]})]})}function ic(l){return/\b(deny|denied|never|reject|no)\b/i.test(`${l.label??""} ${l.action??""}`)||l.key==="n"}function N0({p:l,onRespond:r}){const s=M(g=>g.focusPermission);q.useEffect(()=>{const g=b=>{const x=b.target,w=x&&(x.tagName==="TEXTAREA"||x.tagName==="INPUT");if(b.key==="Tab"&&!w){b.preventDefault();const j=l.options.length||1;s(l.requestId,(l.focus+(b.shiftKey?-1:1)+j)%j)}};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[l,s]);const i=Object.entries(l.toolArgs??{}),u=l.warningLevel??"warning",d=l.options.length?l.options:[{key:"y",label:"yes"},{key:"n",label:"no"}],p=d.map((g,b)=>[g,b]).filter(([g])=>!ic(g)),h=d.map((g,b)=>[g,b]).filter(([g])=>ic(g)),y=([g,b])=>f.jsxs("button",{type:"button",onClick:()=>r(g.key),title:g.description??g.action??void 0,className:`btn ${b===l.focus?"btn-primary":ic(g)?"btn-danger":""}`,"aria-current":b===l.focus?"true":void 0,children:[g.label??g.key," ",f.jsx("span",{className:"key",children:g.key})]},g.key+b);return f.jsxs(Nt,{edge:"warning",className:"my-3",role:"group","aria-label":`Permission request for ${l.toolName}`,children:[f.jsxs("div",{className:"px-3.5 py-2.5 flex items-center gap-3 border-b hairline",children:[f.jsx("span",{className:"text-warning",children:"⚠"}),f.jsx("span",{className:"kicker text-warning",children:"Permission requested for"}),f.jsx("span",{className:"font-mono text-sm",children:l.toolName}),f.jsx("span",{className:"flex-1"}),f.jsxs("span",{className:"font-mono text-[11px] text-text-muted",children:["agent ",l.agentId]})]}),l.promptLines.length>0?l.formatHint==="diff"?f.jsx(Px,{lines:l.promptLines}):f.jsx("pre",{className:"code-block whitespace-pre-wrap px-3.5 py-2.5 max-h-[40vh] overflow-auto",children:l.promptLines.join(`
|
|
33
|
+
`)}):i.length>0?f.jsx("dl",{className:"px-3.5 py-2.5 grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1 text-[13px] font-mono max-h-[40vh] overflow-auto m-0",children:i.map(([g,b])=>f.jsxs("div",{className:"contents",children:[f.jsx("dt",{className:"text-text-muted",children:g}),f.jsx("dd",{className:"whitespace-pre-wrap break-words m-0",children:typeof b=="string"?b:JSON.stringify(b,null,2)})]},g))}):null,l.warnings&&f.jsx("div",{className:`px-3.5 py-2 text-[13px] whitespace-pre-wrap border-t hairline ${u==="error"?"text-error":u==="info"?"text-text-muted":"text-warning"}`,children:l.warnings}),f.jsxs("div",{className:"px-3.5 py-3 flex flex-wrap items-center gap-2.5 border-t hairline",children:[p.map(y),f.jsx("span",{className:"flex-1"}),h.map(y)]})]})}const T0="What should you pick up next time?",k0=200;function rh(l,r){switch(l.state){case"saving":return"saving…";case"saved":return`saved ${new Date(l.at).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}`;case"error":return"could not save — retry";case"signed-out":return"signed out — sign in to save";default:return r==="local"?"this browser only":""}}function Ec({sessionId:l,rows:r=3,label:s,autoFocus:i=!1,className:u="",handle:d}){const p=bc(l),h=d??p,y=rh(h.status,h.scope),g=h.status.state==="error"||h.status.state==="signed-out";return f.jsxs("div",{className:`flex flex-col gap-1 ${u}`,children:[s&&f.jsx("span",{className:"kicker kicker-muted text-[11px]",children:s}),f.jsx("textarea",{value:h.text,rows:r,autoFocus:i,onChange:b=>h.change(b.target.value),onBlur:()=>{h.flush().catch(()=>{})},placeholder:T0,"aria-label":s??`Note about session ${l}`,className:"w-full bg-transparent border hairline px-2 py-1.5 text-[13px] leading-snug resize-y focus:outline-none focus:border-[var(--c-steel)]"}),f.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-text-muted",children:[f.jsx("span",{className:g?"text-warning":"",children:y}),f.jsx("span",{className:"flex-1"}),h.remaining<=k0&&f.jsx("span",{className:"font-mono",children:h.remaining})]})]})}function j0({x:l,onAnswer:r}){const s=M(j=>j.focusExitChoice),i=M(j=>j.sessionId),u=bc(i),[d,p]=q.useState(!1),[h,y]=q.useState(null),g=l.options[l.focus]?.key==="e",b=async j=>{if(!d){p(!0),y(null);try{j==="e"?await u.remove().catch(()=>{}):j!=="r"&&await u.flush()}catch{p(!1),y(rh(u.status,u.scope)||"could not save — retry");return}p(!1),r(j)}};q.useEffect(()=>{const j=B=>{const z=B.target,Y=!!z&&(z.tagName==="TEXTAREA"||z.tagName==="INPUT");if(B.key==="Tab"&&!Y){B.preventDefault();const V=l.options.length||1;s((l.focus+(B.shiftKey?-1:1)+V)%V)}else if(B.key==="Escape"){if(Y){B.preventDefault(),z?.blur();return}B.preventDefault(),b("r")}};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)});const x=(j,B)=>f.jsxs("button",{type:"button",onClick:()=>{b(j.key)},disabled:d,title:j.description,className:`btn ${B===l.focus?"btn-primary":j.key==="e"?"btn-danger":""}`,"aria-current":B===l.focus?"true":void 0,children:[j.label," ",f.jsx("span",{className:"key",children:j.key})]},j.key),w=l.options.findIndex(j=>j.key==="r");return f.jsxs(Nt,{edge:"warning",className:"my-3",role:"group","aria-label":"Exit options",children:[f.jsxs("div",{className:"px-3.5 py-2.5 flex items-center gap-3 border-b hairline",children:[f.jsx("span",{className:"text-warning",children:"⚠"}),f.jsx("span",{className:"kicker text-warning",children:l.running?"Task in progress":"Exit options"}),f.jsx("span",{className:"text-[13px] text-text-muted",children:l.running?"What would you like to do?":"What should become of the session?"})]}),f.jsx("ul",{className:"px-3.5 py-2 m-0 list-none text-[13px] text-text-muted flex flex-col gap-0.5",children:l.options.map(j=>f.jsxs("li",{children:[f.jsxs("span",{className:"font-mono text-text",children:["[",j.key,"]"]})," ",j.label," ",f.jsxs("span",{children:["— ",j.description]})]},j.key))}),i&&f.jsx("div",{className:"px-3.5 py-2.5 border-t hairline",children:g?f.jsx("p",{className:"m-0 text-[12px] text-text-muted",children:"Ending the session also forgets your note about it."}):f.jsx(Ec,{sessionId:i,handle:u,rows:2,label:"Note to self"})}),h&&f.jsxs("p",{className:"px-3.5 pb-2 m-0 text-[12px] text-warning",role:"alert",children:["Your note was not saved (",h,"). Nothing has been closed — try again, or clear the note to leave anyway."]}),f.jsxs("div",{className:"px-3.5 py-2.5 flex items-center gap-2 border-t hairline",children:[l.options.map((j,B)=>j.key==="r"?null:x(j,B)),f.jsx("span",{className:"flex-1"}),w>=0&&x(l.options[w],w)]})]})}function Ep({p:l,onRespond:r,alreadyConfigured:s=!1}){const[i,u]=q.useState(l.models[0]?.name??""),[d,p]=q.useState(!!l.workspacePath&&!s),h=i.trim().length>0,y=l.hasActiveSession?`Signed in to ${l.providerDisplayName}. Switch this session to it? (currently ${[l.currentProvider,l.currentModel].filter(Boolean).join(" / ")})`:`Signed in to ${l.providerDisplayName}. Open a session with it?`;return f.jsxs(Nt,{edge:"steel",className:"my-3",role:"group","aria-label":"Post-auth setup",children:[f.jsxs("div",{className:"px-3.5 py-2.5 border-b hairline flex items-baseline gap-3",children:[f.jsx("span",{className:"kicker",children:"Signed in"}),f.jsx("span",{className:"text-[15px]",children:y})]}),f.jsxs("form",{className:"px-3.5 py-3 space-y-3 text-sm",onSubmit:g=>{g.preventDefault(),h&&r({connect:!0,modelName:i.trim(),persistEnv:d})},children:[f.jsxs("label",{className:"block max-w-md",children:[f.jsx("span",{className:"field-label",children:"Model"}),l.models.length>0?f.jsxs("select",{"aria-label":"Model",value:i,onChange:g=>u(g.target.value),className:"input input-mono",children:[l.models.map(g=>f.jsxs("option",{value:g.name,children:[g.name,g.description?` — ${g.description}`:""]},g.name)),f.jsx("option",{value:"",children:"other…"})]}):null,(l.models.length===0||i==="")&&f.jsx("input",{"aria-label":"Model name",value:i,onChange:g=>u(g.target.value),placeholder:"model name",className:"input input-mono mt-1"})]}),l.workspacePath&&!s&&f.jsxs("label",{className:"flex items-center gap-2 text-xs text-text-muted",children:[f.jsx("input",{type:"checkbox",checked:d,onChange:g=>p(g.target.checked)}),"Save provider and model to ",f.jsxs("span",{className:"font-mono",children:[l.workspacePath,"/.env"]})]}),f.jsxs("div",{className:"flex gap-2 pt-1",children:[f.jsx("button",{type:"submit",disabled:!h,className:"btn btn-primary",children:l.hasActiveSession?"Switch":"Open session"}),f.jsx("button",{type:"button",onClick:()=>r({connect:!1}),className:"btn btn-quiet",children:"Not now"})]})]})]})}function A0({c:l,onAnswer:r,onCancel:s}){const i=l.questions[l.index],u=l.questions.length||l.index+1;return f.jsxs(Nt,{edge:"steel",className:"my-3",role:"group","aria-label":"Clarification",children:[f.jsxs("div",{className:"px-3.5 py-2.5 flex items-center gap-3 border-b hairline",children:[f.jsx("span",{className:"text-steel",children:"?"}),f.jsx("span",{className:"kicker",children:"The agent needs clarification"}),f.jsx("span",{className:"flex-1"}),f.jsxs("span",{className:"font-mono text-[11px] text-text-muted",children:[l.index+1,"/",u,l.toolName?` · ${l.toolName}`:""]})]}),l.context&&l.index===0&&f.jsx("div",{className:"px-3.5 pt-2.5 text-[13px] text-text-muted whitespace-pre-wrap",children:l.context}),f.jsx("div",{className:"px-3.5 py-2.5 text-[15px] whitespace-pre-wrap",children:i?.question_text??(l.inputMode?"Please answer in the box below.":"Waiting for the question…")}),i&&fy(i)&&f.jsxs("div",{className:"px-3.5 pb-1.5 text-[12px] text-text-muted",children:["Pick one or more: click a choice, or type the numbers comma-separated (e.g. ",f.jsx("kbd",{children:"1,3"}),")."]}),i?.options&&i.options.length>0&&f.jsx("div",{className:"px-3.5 pb-3 flex flex-wrap gap-2",children:i.options.map((d,p)=>f.jsxs("button",{type:"button",onClick:()=>r(String(p+1)),className:`btn btn-md normal-case tracking-normal font-sans font-normal text-left ${i.default===p+1?"btn-steel":""}`,children:[f.jsx("span",{className:"font-mono text-[11px] text-steel",children:p+1}),d,i.default===p+1&&f.jsx("span",{className:"text-text-muted text-xs",children:"(default)"}),i.expects_attachment?.[p]&&f.jsx("span",{className:"text-text-muted",title:"This choice expects you to attach a file",children:"📎"})]},p))}),f.jsxs("div",{className:"px-3.5 py-2 border-t hairline text-[12px] text-text-muted flex gap-4",children:[i&&f.jsx("span",{children:i.optional?"optional (Enter on empty skips)":"required"}),i?.default!=null&&f.jsxs("span",{children:["default: ",f.jsx("kbd",{children:String(i.default)})," (Enter on empty)"]}),f.jsx("span",{className:"flex-1"}),f.jsx("button",{type:"button",className:"link",onClick:s,children:"cancel"})]})]})}function O0({r:l,onRespond:r}){return f.jsxs(Nt,{edge:"steel",className:"my-3",role:"group","aria-label":"Reference selection",children:[f.jsxs("div",{className:"px-3.5 py-2.5 border-b hairline flex items-baseline gap-3",children:[f.jsx("span",{className:"kicker",children:"Reference"}),f.jsx("span",{className:"text-[15px]",children:l.prompt})]}),f.jsx("div",{className:"px-3.5 py-3 flex flex-wrap gap-2",children:l.options.map((s,i)=>f.jsx("button",{type:"button",onClick:()=>r(s),className:"btn btn-md normal-case tracking-normal font-mono font-normal",children:s},i))})]})}const wp={pending:["○","text-text-muted"],in_progress:["◐","text-primary"],active:["◐","text-primary"],completed:["●","text-success"],done:["●","text-success"],failed:["✗","text-error"],skipped:["–","text-warning"],cancelled:["–","text-warning"],blocked:["⊘","text-warning"]};function C0(l){if(!l)return null;const r=l.steps.length;return`${l.steps.filter(i=>i.status==="completed"||i.status==="done").length}/${r}`}function R0({agentId:l}){const r=M(u=>u.plan[l]);if(!r)return f.jsx("div",{className:"px-3.5 py-3 text-xs text-text-muted italic",children:"No plan yet."});const s=r.steps.length,i=r.steps.filter(u=>u.status==="completed"||u.status==="done").length;return f.jsxs("div",{className:"px-3.5 py-3 text-[13.5px]",children:[f.jsx("div",{className:"display text-[16px] mb-2",children:r.name}),f.jsx("div",{className:"bar mb-2.5",children:f.jsx("span",{className:"bg-success",style:{width:s?`${i/s*100}%`:0}})}),f.jsx("ol",{className:"space-y-1.5 list-none m-0 p-0",children:[...r.steps].sort((u,d)=>(u.sequence??0)-(d.sequence??0)).map((u,d)=>{const[p,h]=wp[u.status??"pending"]??wp.pending;return f.jsxs("li",{className:"flex gap-2.5",children:[f.jsx("span",{className:`${h} w-3 shrink-0`,children:p}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:u.status==="in_progress"||u.status==="active"?"font-medium":u.status==="completed"||u.status==="done"?"text-text-muted":"",children:u.content}),u.result&&f.jsxs("div",{className:"text-xs text-success/80 whitespace-pre-wrap",children:["↳ ",u.result]}),u.error&&f.jsxs("div",{className:"text-xs text-error/90 whitespace-pre-wrap",children:["↳ ",u.error]}),u.blocked_by&&u.blocked_by.length>0&&f.jsxs("div",{className:"text-xs text-warning",children:["blocked by ",u.blocked_by.join(", ")]})]})]},u.step_id??d)})})]})}function un(l){return l==null?"–":l>=1e6?(l/1e6).toFixed(2)+"M":l>=1e4?(l/1e3).toFixed(1)+"k":String(l)}function M0({agentId:l}){const r=M(d=>d.context[l]);if(!r)return f.jsx("div",{className:"px-3.5 py-3 text-xs text-text-muted italic",children:"No usage reported yet."});const s=r.percentUsed??(r.contextLimit&&r.usage.total_tokens?r.usage.total_tokens/r.contextLimit*100:null),i=r.usage,u=[["prompt",un(i.prompt_tokens)],["output",un(i.output_tokens)],["cache read",un(i.cache_read_tokens)],["cache write",un(i.cache_creation_tokens)],["reasoning",un(i.reasoning_tokens??i.thinking_tokens)],["total / limit",`${un(i.total_tokens)} / ${un(r.contextLimit)}`],["remaining",un(r.tokensRemaining)],["turns",un(r.turns)]];return i.cost_usd!=null&&u.push(["cost",`$${Number(i.cost_usd).toFixed(4)}`]),f.jsxs("div",{className:"px-3.5 py-3 text-[13px]",children:[f.jsxs("div",{className:"flex items-baseline justify-between mb-1.5",children:[f.jsx("span",{className:"display text-[16px]",children:"Context"}),f.jsx("span",{className:"font-mono text-[11px] text-text-muted",children:s!=null?`${s.toFixed(1)}%`:""})]}),f.jsx("div",{className:"bar mb-3",children:f.jsx("span",{className:s!=null&&s>80?"bg-error":s!=null&&s>60?"bg-warning":"",style:{width:`${Math.min(100,s??0)}%`}})}),f.jsx("dl",{className:"kv m-0",children:u.map(([d,p])=>f.jsxs("div",{className:"contents",children:[f.jsx("dt",{children:d}),f.jsx("dd",{className:"m-0",children:p})]},d))}),r.lastTurn&&f.jsxs("div",{className:"mt-3 text-xs text-text-muted",children:["Last turn",r.lastTurn.turnNumber!=null?` #${r.lastTurn.turnNumber}`:"",": ",r.lastTurn.durationSeconds!=null?`${r.lastTurn.durationSeconds.toFixed(1)}s`:"",r.lastTurn.toolCalls?` · ${my(r.lastTurn.toolCalls)}`:"",r.lastTurn.finishReason?` · ${r.lastTurn.finishReason}`:""]})]})}function D0(l){const r={name:"",path:"",children:new Map};for(const[s,i]of Object.entries(l)){const u=s.split("/").filter(Boolean);let d=r;u.forEach((p,h)=>{let y=d.children.get(p);y||(y={name:p,path:u.slice(0,h+1).join("/"),children:new Map},d.children.set(p,y)),h===u.length-1&&(y.change=i),d=y})}return r}function z0(l){return l.children.size?`${l.path}/`:l.path}function oh(l,r){return r.some(s=>s===l||s.endsWith("/")&&l.startsWith(s))}function U0(l,r){return Object.keys(l).filter(s=>oh(s,r)).length}const L0={created:"text-success",added:"text-success",modified:"text-warning",deleted:"text-error"};function H0({id:l,hidden:r,ignored:s}){const i=M(d=>d.toggleWorkspaceHidden),u="font-heading uppercase tracking-[0.08em] text-[10px] px-1 text-text-muted hover:text-steel opacity-60 group-hover:opacity-100 focus:opacity-100";return f.jsxs("span",{className:"ml-auto shrink-0 flex gap-1",children:[f.jsx("button",{type:"button",className:u,onClick:()=>i(l),"aria-label":`${r?"Unhide":"Hide"} ${l}`,title:r?"Show this entry again":"Hide this entry from the panel (this session only)",children:r?"unhide":"hide"}),f.jsx("button",{type:"button",className:u,onClick:()=>{ox(l).catch(()=>{})},"aria-label":`${s?"Remove":"Add"} ${l} ${s?"from":"to"} .gitignore`,title:s?"Remove this entry from the workspace .gitignore":"Add this entry to the workspace .gitignore",children:s?"unignore":"ignore"})]})}function ch({node:l,depth:r,hidden:s,showHidden:i,ignored:u}){const d=[...l.children.values()].sort((p,h)=>(p.children.size?0:1)-(h.children.size?0:1)||p.name.localeCompare(h.name));return f.jsx("ul",{className:"list-none m-0 p-0",children:d.map(p=>{const h=z0(p),y=p.children.size>0,g=oh(h,s);if(g&&!i)return null;const b=y?f.jsxs("span",{className:"text-text-muted",children:["▾ ",p.name,"/"]}):f.jsxs("span",{className:L0[p.change??""]??"",title:p.change,children:[p.change==="deleted"?"−":p.change==="created"||p.change==="added"?"+":"~"," ",p.name]});return f.jsxs("li",{className:"font-mono text-[11.5px] leading-[1.8]",children:[f.jsxs("div",{className:`group flex items-center gap-1 pr-1 ${g?"opacity-50":""}`,style:{paddingLeft:r*12},"data-hidden":g||void 0,children:[g&&f.jsx("span",{className:"text-text-muted",title:"Hidden",children:"H"}),b,u[h]&&f.jsx("span",{className:"text-text-muted text-[10px]",title:"In .gitignore",children:"i"}),f.jsx(H0,{id:h,hidden:g,ignored:u[h]})]}),y&&f.jsx(ch,{node:p,depth:r+1,hidden:s,showHidden:i,ignored:u})]},p.path)})})}function q0(){const l=M(g=>g.workspaceFiles),r=M(g=>g.workspaceHidden),s=M(g=>g.workspaceShowHidden),i=M(g=>g.toggleWorkspaceShowHidden),u=M(g=>g.workspaceIgnored),d=M(g=>g.workspaceNotice),p=q.useMemo(()=>D0(l),[l]),h=Object.keys(l).length,y=q.useMemo(()=>U0(l,r),[l,r]);return f.jsxs("div",{className:"px-3.5 py-3",children:[d&&f.jsx("div",{role:"status",className:`text-[11px] mb-2 ${d.error?"text-error":"text-text-muted"}`,children:d.text}),h===0?f.jsx("div",{className:"text-xs text-text-muted italic",children:"No files changed yet."}):f.jsx(ch,{node:p,depth:0,hidden:r,showHidden:s,ignored:u}),y>0&&f.jsxs("div",{className:"mt-2 text-[11px] text-text-muted flex items-center gap-2",children:[f.jsxs("span",{children:[y," hidden"]}),f.jsx("button",{type:"button",className:"link",onClick:i,children:s?"hide hidden":"show hidden"})]}),h>0&&f.jsxs("div",{className:"mt-2.5 text-xs text-text-muted",children:[f.jsx("span",{className:"font-heading uppercase tracking-[0.08em] text-[10px]",children:"hide"})," drops an entry from the panel; ",f.jsx("span",{className:"font-heading uppercase tracking-[0.08em] text-[10px]",children:"ignore"})," adds it to ",f.jsx("span",{className:"font-mono",children:".gitignore"}),"."]})]})}function B0(l,r,s=Date.now()){const i=r?s-Date.parse(r):NaN;if(!Number.isFinite(i)||i<0)return`waiting: ${l}`;const u=Math.floor(i/6e4);return`waiting ${u<1?"just now":u<60?`${u} min`:`${Math.floor(u/60)}h ${u%60}m`}: ${l}`}function G0(l){const r=l.split(/[\\/]/).filter(Boolean);return r[r.length-1]??""}function uh({sess:l,onAttach:r,showWorkspace:s=!1}){const[i,u]=q.useState(!1),d=M(b=>b.notes[l.id]?.text),p=qp(d),h=s?G0(l.workspacePath):"",y=l.awaiting?B0(l.awaiting,l.awaitingSince):"",g=[l.description||l.name,h,l.provider?`${l.provider}/${l.model}`:"",l.turnCount?`${l.turnCount} turns`:""].filter(Boolean).join(" · ");return f.jsxs("div",{className:"border-t hairline",children:[f.jsxs("div",{className:"flex gap-3 py-2.5 items-start",children:[f.jsx("span",{className:`pt-0.5 ${y?"text-warning":l.isLoaded?"text-success":"text-text-muted"}`,"aria-hidden":"true",children:y?"⚠":l.isLoaded?"●":"○"}),f.jsxs("button",{type:"button",onClick:()=>r?.(l.id),disabled:!r,"aria-label":r?`Resume session ${l.id}`:void 0,className:"min-w-0 flex-1 text-left disabled:cursor-default",children:[f.jsx("span",{className:"block font-mono text-[13px]",children:l.id}),y&&f.jsx("span",{className:"block text-[13px] text-warning",children:y}),g&&f.jsx("span",{className:"block text-[13px] text-text-muted truncate",children:g}),p&&f.jsxs("span",{className:"block chrome text-[13px] truncate",title:d,children:["✎ ",p]})]}),f.jsx("button",{type:"button",onClick:()=>u(b=>!b),"aria-expanded":i,"aria-label":`${i?"Close":"Edit"} your note about session ${l.id}`,className:"btn btn-sm btn-quiet self-center shrink-0",children:p?"✎":"✎ Add a note"}),r&&f.jsx("span",{className:`btn btn-sm self-center shrink-0 ${l.isLoaded?"btn-steel":"btn-quiet"}`,"aria-hidden":"true",children:"Attach"})]}),i&&f.jsx("div",{className:"pb-2.5",children:f.jsx(Ec,{sessionId:l.id,rows:3})})]})}function Y0(){q.useEffect(()=>{Sc()},[]);const l=M(u=>u.sessions),r=M(u=>u.sessionId),s=bc(r).scope,i=l.filter(u=>u.id!==r);return f.jsxs("div",{className:"px-3.5 py-2 text-[13px]",children:[r?f.jsx("div",{className:"pb-2",children:f.jsx(Ec,{sessionId:r,rows:3,label:"This session"})}):f.jsx("p",{className:"m-0 py-2 text-text-muted",children:"No session attached."}),i.length>0&&f.jsx("div",{className:"kicker kicker-muted text-[11px] pt-1",children:"Other sessions"}),i.map(u=>f.jsx(uh,{sess:u,showWorkspace:!0},u.id)),s==="local"&&f.jsx("p",{className:"m-0 pt-3 text-[11px] text-text-muted",children:"Notes are kept in this browser only — a sign-in backend shares them across your devices."})]})}function Q0(l,r){if(l.length===0)return null;const s=l.filter(u=>u.awaiting).length;return s>0?`${s} waiting on you`:`${l.filter(u=>qp(r[u.id]?.text)).length} of ${l.length} noted`}const Np={idle:["○","text-text-muted"],done:["✓","text-text-muted"],error:["✗","text-error"],cancelled:["⊘","text-text-muted"]},V0={sending:["●","text-text-muted pulse"],thinking:["●","text-primary pulse"],tool:["▸","text-steel pulse"],waiting:["⚠","text-warning"]};function X0({id:l}){const r=M(g=>g.agents[l]),s=M(g=>g.selectedAgentId===l),i=M(g=>g.selectAgent),u=M(ih(g=>yc(g,l)));if(!r)return null;const d=u.kind==="waiting",[p,h]=u.kind==="idle"?Np[r.status]??Np.idle:V0[u.kind],y=u.kind==="idle"?r.status:Up(u);return f.jsxs("button",{role:"tab","aria-selected":s,onClick:()=>i(l),className:`flex items-center gap-2 px-3.5 border-r hairline whitespace-nowrap ${s?`bg-surface text-text shadow-[inset_0_-2px_0_var(--c-steel)] ${d?"shadow-[inset_0_-2px_0_var(--c-warning)]":""}`:"text-text-muted hover:text-text"}`,title:`${r.profile?`${r.type} · ${r.profile}`:r.type} — ${y}`,children:[f.jsx("span",{className:h,children:p}),f.jsx("span",{className:`chrome ${s?"":"font-medium"}`,children:r.name})]})}function $0(){const l=M(r=>r.agentOrder);return f.jsx("div",{role:"tablist",className:"flex items-stretch overflow-x-auto",title:"Ctrl+A selects the next agent",children:l.map(r=>f.jsx(X0,{id:r},r))})}function K0(){const l=M(g=>g.connection),r=M(g=>g.sessionId),s=M(g=>g.permissionStatus),i=M(g=>g.permissions.length),u=M(g=>g.toggleUi),d=M(g=>g.setToolsExpanded),p=M(g=>g.ui),h=l.phase==="connected"?"bg-success":l.phase==="reconnecting"||l.phase==="connecting"?"bg-warning pulse":"bg-error",y=g=>`chrome-sm font-heading font-medium uppercase tracking-[0.12em] ${g?"text-steel":"text-text-muted hover:text-steel"}`;return f.jsxs("div",{className:"flex items-center gap-4 px-4 h-[26px] text-[11px] bg-surface border-t hairline font-mono text-text-muted select-none shrink-0",children:[f.jsxs("span",{className:"flex items-center gap-1.5 text-text",children:[f.jsx("span",{className:`inline-block w-1.5 h-1.5 ${h}`}),l.phase,l.attempt?` #${l.attempt}`:""]}),f.jsxs("span",{title:Ip(),children:[l.serverVersion?`server ${l.serverVersion} · `:"","ui ",$a.ui]}),r&&f.jsxs("span",{title:r,children:["session ",r.slice(0,8)]}),s&&f.jsxs("span",{title:"Permission default policy (permissions default allow|deny|ask)","data-testid":"permission-status",className:i?"text-warning":"",children:[f.jsx("span",{children:"permissions "}),s.suspensionScope?f.jsxs("span",{className:"text-success",children:["allow ",f.jsxs("span",{className:"text-text-muted",children:["(",s.suspensionScope,")"]})]}):f.jsx("span",{className:i?"":s.effectiveDefault==="deny"?"text-warning":s.effectiveDefault==="allow"?"text-success":"text-text",children:s.effectiveDefault}),i>0&&f.jsxs("span",{children:[" · ",i," waiting"]})]}),f.jsx("span",{className:"flex-1"}),f.jsx("button",{type:"button",onClick:()=>u("showPlan"),className:y(p.showPlan),title:"Toggle plan (Ctrl+P)","aria-label":"Toggle plan (Ctrl+P)",children:"Plan"}),f.jsx("button",{type:"button",onClick:()=>u("showBudget"),className:y(p.showBudget),title:"Toggle budget (Ctrl+B)","aria-label":"Toggle budget (Ctrl+B)",children:"Budget"}),f.jsx("button",{type:"button",onClick:()=>u("showWorkspace"),className:y(p.showWorkspace),title:"Toggle workspace changes (Alt+W)","aria-label":"Toggle workspace changes (Alt+W)",children:"Files"}),f.jsx("button",{type:"button",onClick:()=>u("showSessions"),className:y(p.showSessions),title:"Toggle your sessions and their notes","aria-label":"Toggle your sessions and their notes",children:"Sessions"}),f.jsx("button",{type:"button",onClick:()=>d(!p.showTools),className:y(p.showTools),title:p.showTools?"Tool call boxes expanded — click to collapse them (Ctrl+T)":"Tool call boxes collapsed — click to expand them (Ctrl+T)","aria-label":"Toggle tool call boxes (Ctrl+T)",children:"Tools"}),f.jsx("button",{type:"button",onClick:()=>{Zp().catch(()=>{})},className:`${y(!1)} hover:text-error`,title:"Leave: detach from the session, or end it (the exit command)","aria-label":"Exit (detach from or end the session)",children:"Exit"})]})}function I0(){const l=M(h=>h.ui.railWidth),r=M(h=>h.setRailWidth),s=q.useRef(null),i=q.useCallback(h=>{h.button!==0&&h.pointerType==="mouse"||(s.current={startX:h.clientX,startW:l},h.currentTarget.setPointerCapture(h.pointerId),h.preventDefault())},[l]),u=q.useCallback(h=>{const y=s.current;y&&r(y.startW+(y.startX-h.clientX))},[r]),d=q.useCallback(h=>{s.current=null;try{h.currentTarget.releasePointerCapture(h.pointerId)}catch{}},[]),p=q.useCallback(h=>{const y=h.shiftKey?64:16;h.key==="ArrowLeft"?(r(l+y),h.preventDefault()):h.key==="ArrowRight"?(r(l-y),h.preventDefault()):h.key==="Home"?(r(cc),h.preventDefault()):h.key==="End"&&(r(oc),h.preventDefault())},[r,l]);return f.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize the session rail","aria-valuemin":oc,"aria-valuemax":cc,"aria-valuenow":l,tabIndex:0,title:"Drag to resize the rail",className:"hidden md:block shrink-0 w-[7px] -mr-[4px] -ml-[3px] z-10 cursor-col-resize select-none outline-none hover:bg-steel/40 focus-visible:bg-steel/60 active:bg-steel/60",style:{touchAction:"none"},onPointerDown:i,onPointerMove:u,onPointerUp:d,onPointerCancel:d,onKeyDown:p})}function Z0(){q.useEffect(()=>{const l=r=>{const s=r.key.toLowerCase(),i=r.ctrlKey||r.metaKey,u=M.getState();if(i&&s==="p")r.preventDefault(),u.toggleUi("showPlan");else if(i&&s==="b")r.preventDefault(),u.toggleUi("showBudget");else if((i||r.altKey)&&s==="w"&&(r.altKey||r.shiftKey))r.preventDefault(),u.toggleUi("showWorkspace");else if(i&&s==="t")r.preventDefault(),u.setToolsExpanded(!u.ui.showTools);else if(i&&s==="a"&&!r.target?.matches?.("textarea,input")){r.preventDefault();const d=u.agentOrder.indexOf(u.selectedAgentId);u.selectAgent(u.agentOrder[(d+1)%u.agentOrder.length]??u.selectedAgentId)}else i&&s==="c"&&!r.target?.matches?.("textarea,input")&&!window.getSelection()?.toString()&&Wl()&&zp(u,u.selectedAgentId)&&(r.preventDefault(),Re().stop().catch(()=>{}))};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[])}function J0(){const l=M(p=>p.session),r=M(p=>p.workspace.selected),s=M(p=>p.selectedAgentId),u=M(p=>p.context[s])?.percentUsed,d=[l.provider,l.model].filter(Boolean).join(" / ");return f.jsxs("header",{className:"flex items-stretch h-[46px] border-b hairline shrink-0",children:[f.jsx("div",{className:"flex items-center px-4 border-r hairline",children:f.jsx("span",{className:"display text-[18px] tracking-[0.02em]",children:"jaato"})}),f.jsx($0,{}),f.jsx("span",{className:"flex-1"}),f.jsxs("div",{className:"hidden md:flex items-center gap-[18px] px-[18px] font-mono text-xs",children:[r&&f.jsxs("span",{children:[f.jsx("span",{className:"text-text-muted",children:"ws "}),r]}),d&&f.jsxs("span",{children:[f.jsx("span",{className:"text-text-muted",children:"model "}),d]}),l.profile&&f.jsxs("span",{children:[f.jsx("span",{className:"text-text-muted",children:"profile "}),l.profile]}),u!=null&&f.jsxs("span",{className:"flex items-center gap-2",title:"Context window used",children:[f.jsx("span",{className:"text-text-muted",children:"ctx"}),f.jsx("span",{className:"inline-block w-[84px] h-1.5 bg-[color-mix(in_srgb,var(--c-text)_16%,var(--c-bg))]",children:f.jsx("span",{className:`block h-full ${u>80?"bg-error":u>60?"bg-warning":"bg-steel"}`,style:{width:`${Math.min(100,u)}%`}})}),f.jsxs("span",{className:u>80?"text-error":u>60?"text-warning":"",children:[u.toFixed(0),"%"]})]})]})]})}function yi({title:l,value:r,open:s,onToggle:i,children:u}){return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",onClick:i,className:"flex items-baseline justify-between px-3.5 py-2 border-b hairline w-full text-left hover:bg-tint/60","aria-expanded":s,"aria-label":`${s?"Close":"Open"} ${l}`,children:[f.jsx("span",{className:"kicker",children:l}),f.jsxs("span",{className:"font-mono text-[11px] text-text-muted",children:[r?`${r} `:"",s?"▾":"▸"]})]}),s&&f.jsx("section",{"aria-label":l,className:"border-b hairline overflow-auto min-h-0 shrink-0 max-h-[60%]",children:u})]})}function W0({agentId:l}){const r=M(g=>g.ui),s=M(g=>g.toggleUi),i=M(g=>g.plan[l]),u=M(g=>g.context[l]),d=M(g=>Object.keys(g.workspaceFiles).length),p=M(g=>g.sessions),h=M(g=>g.notes),y=u?.usage.cost_usd!=null?`$${Number(u.usage.cost_usd).toFixed(4)}`:u?.percentUsed!=null?`${u.percentUsed.toFixed(0)}%`:null;return f.jsxs("aside",{className:"hidden md:flex shrink-0 border-l hairline bg-surface flex-col min-h-0 overflow-auto",style:{width:r.railWidth},"aria-label":"Session rail",children:[f.jsx(yi,{title:"Plan",value:C0(i),open:r.showPlan,onToggle:()=>s("showPlan"),children:f.jsx(R0,{agentId:l})}),f.jsx(yi,{title:"Budget",value:y,open:r.showBudget,onToggle:()=>s("showBudget"),children:f.jsx(M0,{agentId:l})}),f.jsx(yi,{title:"Files",value:d?`${d} changed`:null,open:r.showWorkspace,onToggle:()=>s("showWorkspace"),children:f.jsx(q0,{})}),f.jsx(yi,{title:"Sessions",value:Q0(p,h),open:r.showSessions,onToggle:()=>s("showSessions"),children:f.jsx(Y0,{})})]})}function F0(l){return l.filter(r=>/-auth$/.test(r.name)&&!r.name.includes(" "))}function P0({onPick:l,onAttach:r,onAuth:s,onSkip:i}){const u=M(z=>z.profiles),d=M(z=>z.commands),p=M(z=>z.workspace),h=M(z=>z.sessions);q.useEffect(()=>{Sc().catch(()=>{})},[]);const y=F0(d),g=p.selected?p.list.find(z=>z.name===p.selected)??{name:p.selected}:void 0,b=p.config&&p.config.workspace===p.selected?p.config:void 0,x=b?.configured===!0,w=[b?.provider,b?.model].filter(Boolean).join(" / "),j=g?yy(h,g):h,B="flex gap-3 py-2.5 border-t hairline w-full text-left hover:bg-tint/60";return f.jsx("div",{className:"h-full flex items-center justify-center p-6 sm:p-12 overflow-auto",children:f.jsxs(Nt,{className:"w-full max-w-[880px] flex flex-col","data-testid":"session-picker",children:[f.jsxs("div",{className:"flex items-baseline justify-between gap-4 px-5 py-4 border-b hairline",children:[f.jsx("div",{className:"flex items-baseline gap-3",children:g?f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"kicker tracking-[0.16em]",children:"Workspace"}),f.jsx("span",{className:"font-mono text-[16px]",children:g.name})]}):f.jsx("span",{className:"display text-[20px]",children:"New session"})}),x&&f.jsxs("div",{className:"font-mono text-xs text-text-muted",children:[w," ",f.jsx("span",{className:"text-steel",children:"from .env"})]})]}),f.jsxs("div",{className:`grid grid-cols-1 ${j.length>0?"md:grid-cols-[1fr_1px_1fr]":""}`,children:[j.length>0&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"px-5 py-4 flex flex-col gap-2.5","aria-label":"Resume a session",children:[f.jsx("div",{className:"kicker kicker-muted text-[12px]",children:"Resume"}),f.jsx("div",{className:"flex flex-col max-h-72 overflow-auto",children:j.map(z=>f.jsx(uh,{sess:z,onAttach:r},z.id))})]}),f.jsx("div",{className:"hidden md:block bg-divider","aria-hidden":"true"})]}),f.jsxs("div",{className:"px-5 py-4 flex flex-col gap-2.5",children:[f.jsx("div",{className:"kicker kicker-muted text-[12px]",children:j.length>0?"Start new — agent profile":"Agent profile"}),f.jsxs("div",{className:"flex flex-col max-h-80 overflow-auto",children:[f.jsxs("button",{type:"button",onClick:()=>l(null),className:B,children:[f.jsx("span",{className:"font-mono text-[11px] text-steel w-[22px] shrink-0 pt-0.5",children:"01"}),f.jsxs("span",{className:"min-w-0",children:[f.jsx("span",{className:"block font-mono text-[13px]",children:"default"}),f.jsx("span",{className:"block text-[13px] text-text-muted",children:x?w:"the workspace .env provider and model"})]})]}),u.map((z,Y)=>f.jsxs("button",{type:"button",onClick:()=>l(z.name),className:B,children:[f.jsx("span",{className:"font-mono text-[11px] text-steel w-[22px] shrink-0 pt-0.5",children:String(Y+2).padStart(2,"0")}),f.jsxs("span",{className:"min-w-0",children:[f.jsx("span",{className:"block font-mono text-[13px]",children:z.name}),f.jsx("span",{className:"block text-[13px] text-text-muted",children:[z.description,[z.provider,z.model].filter(Boolean).join("/")].filter(Boolean).join(" · ")})]})]},z.name))]})]})]}),f.jsxs("div",{className:"px-5 pt-3 border-t hairline","aria-label":"Files for the session",children:[f.jsx("div",{className:"kicker kicker-muted text-[12px] mb-1.5",children:"Files for the session"}),f.jsx(sh,{always:!0,hint:g?"Staged into this workspace before the session opens.":"Staged into the session's workspace as soon as it is provisioned."})]}),f.jsxs("div",{className:"flex flex-wrap items-center gap-3 px-5 py-3 border-t hairline",children:[y.length>0&&!x&&f.jsxs("div",{className:"flex flex-wrap items-center gap-3","aria-label":"Sign in to a provider",children:[f.jsx("span",{className:"kicker kicker-muted",children:"Sign in first"}),y.map(z=>f.jsxs("button",{type:"button",onClick:()=>s(`${z.name} login`),className:"font-mono text-xs border hairline px-2 py-1 hover:border-steel hover:text-steel",title:z.description,children:[z.name," login"]},z.name)),f.jsx("span",{className:"text-[12px] text-text-muted",children:"No provider configured yet? Sign in first; the daemon then offers to open the session for you."})]}),f.jsx("span",{className:"flex-1"}),f.jsx("button",{type:"button",onClick:i,className:"link text-[13px]",children:"Go to the prompt without a session"})]})]})})}function ev(){Z0();const l=M(U=>U.sessionId),r=M(U=>U.selectedAgentId),s=M(U=>U.commands),i=M(U=>U.initProgress),u=M(U=>U.permissions),d=M(U=>U.exitChoice),p=M(U=>U.clarifications),h=M(U=>U.referenceSelections),y=M(U=>U.postAuth),g=M(U=>U.workspace.config),[b,x]=q.useState(!0),[w,j]=q.useState(!1),B=q.useRef(!1);q.useEffect(()=>{if(B.current)return;B.current=!0;const U=Re();return U.requestCommandList().catch(()=>{}),U.listProfiles().catch(()=>{}),U.subscribe(G.COMMAND_LIST_REFRESH,()=>{U.requestCommandList().catch(()=>{})})},[]);const z=async U=>{x(!1),j(!0);try{await yp(()=>fx(U))}finally{j(!1)}},Y=u.filter(U=>U.agentId===r),V=p.filter(U=>U.agentId===r),ee=h.filter(U=>U.agentId===r),te=q.useMemo(()=>{if(d)return{kind:"exit",placeholder:`Exit: ${d.options.map(fe=>fe.key).join(" · ")}`,suggestions:d.options.map(fe=>fe.key)};const U=Y[0];return U?{kind:"permission",placeholder:`Answer ${U.toolName} — ${U.options.map(fe=>fe.key).join(" · ")||"y · n"}, or type a reply`,suggestions:U.options.map(fe=>fe.key)}:V.find(fe=>fe.inputMode)?{kind:"clarification",placeholder:"Type your answer (or a choice number) and press Enter"}:ee[0]?{kind:"reference",placeholder:"Type the reference to use"}:null},[d,Y,V,ee]),K=U=>{x(!1),fp(U,!1).catch(se=>M.getState().addSystemBlock(r,String(se),"error"))},W=U=>{x(!1),yp(()=>th(U)).catch(se=>M.getState().addSystemBlock(r,String(se),"error"))},de=!!(y&&g?.configured&&g.provider===y.providerName),Z=y?f.jsx("div",{className:"px-5",children:f.jsx(Ep,{p:y,alreadyConfigured:de,onRespond:U=>{up(y.requestId,U).catch(se=>M.getState().addSystemBlock(r,String(se),"error"))}})}):null;return b&&!l?f.jsxs("div",{className:"h-full flex flex-col",children:[Z,f.jsx("div",{className:"flex-1 min-h-0",children:f.jsx(P0,{onPick:z,onAttach:W,onAuth:K,onSkip:()=>x(!1)})})]}):f.jsxs("div",{className:"h-full flex flex-col",children:[f.jsx(J0,{}),f.jsxs("div",{className:"flex-1 flex min-h-0",children:[f.jsxs("main",{className:"flex-1 flex flex-col min-w-0 relative",children:[(w||i)&&f.jsxs("div",{className:"px-5 py-1 kicker kicker-muted border-b hairline flex items-center gap-2",children:[f.jsx("span",{className:"pulse text-primary",children:"●"}),i?`${i.message??i.step??"initialising"}${i.stepNumber!=null&&i.totalSteps?` (${i.stepNumber}/${i.totalSteps})`:""}`:"Creating session…"]}),f.jsx(d0,{agentId:r}),f.jsxs("div",{className:"px-5",children:[d&&f.jsx(j0,{x:d,onAnswer:U=>{Jp(U).catch(se=>M.getState().addSystemBlock(r,String(se),"error"))}}),Y.map(U=>f.jsx(N0,{p:U,onRespond:se=>Wp(U.requestId,se)},U.requestId)),V.map(U=>f.jsx(A0,{c:U,onAnswer:se=>Fp(U,se),onCancel:()=>Pp(U)},U.requestId)),ee.map(U=>f.jsx(O0,{r:U,onRespond:se=>eh(U.requestId,se)},U.requestId)),y&&r==="main"&&f.jsx(Ep,{p:y,alreadyConfigured:de,onRespond:U=>{up(y.requestId,U).catch(se=>M.getState().addSystemBlock(r,String(se),"error"))}})]}),f.jsxs("div",{className:"px-5 pb-3 pt-2.5 border-t hairline",children:[!te&&f.jsx(w0,{agentId:r}),f.jsx(y0,{commands:s,history:Xa,captureMode:te,onSubmit:(U,se)=>{fp(U,se).catch(fe=>M.getState().addSystemBlock(r,String(fe),"error"))}})]}),f.jsx(m0,{agentId:r})]}),f.jsx(I0,{}),f.jsx(W0,{agentId:r})]}),f.jsx(K0,{})]})}function tv(){const l=M(i=>i.screen),r=M(i=>i.ui.theme),s=M(i=>i.setTheme);return q.useEffect(()=>{s(wb())},[s]),q.useEffect(()=>{Yp(r)},[r]),Uy(),l==="connect"?f.jsx(Yb,{}):l==="workspaces"?f.jsx(hx,{}):f.jsx(ev,{})}Q_.createRoot(document.getElementById("root")).render(f.jsx(q.StrictMode,{children:f.jsx(tv,{})}));
|